:root {
  color-scheme: dark;
  --navy: #1C1B47;
  --navy-deep: #141338;
  --navy-line: #34336A;
  --white: #FFFFFF;
  --text: #E4E5F4;
  --mist: #C8CAE8;
  --steam: #5CC9CF;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Figtree", "Segoe UI", Calibri, system-ui, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --navy: #1C1B47; --navy-deep: #141338; --white: #FFFFFF; --mist: #C8CAE8; }
}
:root[data-theme="dark"] { --navy: #1C1B47; --navy-deep: #141338; --white: #FFFFFF; --mist: #C8CAE8; }

*, *::before, *::after { box-sizing: inherit; }
html { background: var(--navy); scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 5rem); }
body { margin: 0; background: var(--navy); color: var(--white); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: rgba(28,27,71,.88); backdrop-filter: blur(10px); }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--steam); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(28,27,71,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--navy-line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 4.5rem; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand img { height: 2.4rem; width: auto; }
.brand span { font-weight: 500; letter-spacing: .02em; font-size: 1.05rem; }
.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a { text-decoration: none; color: var(--mist); font-size: .95rem; }
.nav a:hover { color: var(--white); }
.btn { display: inline-block; text-decoration: none; font-weight: 600; font-size: .95rem; padding: .7rem 1.25rem; border-radius: 999px; border: 1px solid var(--steam); background: var(--steam); color: var(--navy-deep); }
.btn:hover { background: var(--white); border-color: var(--white); }
.btn.ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.45); }
.btn.ghost:hover { border-color: var(--white); background: rgba(255,255,255,.06); }
.nav .btn { color: var(--navy-deep); }
@media (max-width: 960px) { .nav a:not(.btn) { display: none; } }

/* Article */
.post-head.narrow { padding: clamp(2.5rem, 7vw, 5rem) var(--gutter) 2rem; }
.narrow { max-width: 46rem; margin: 0 auto; padding: 0 var(--gutter); }
.back { display: inline-block; color: var(--steam); text-decoration: none; font-weight: 600; font-size: .95rem; margin-bottom: 2rem; }
.back:hover { color: var(--white); }
.post-head h1 { font-family: var(--serif); font-weight: 300; font-variation-settings: "opsz" 72; font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.06; letter-spacing: -.02em; margin: 0 0 1.5rem; }
.meta { color: var(--mist); font-size: .95rem; margin: 0; }
.cover { margin: 1rem auto 3rem; padding: 0 var(--gutter); max-width: 56rem; }
.cover img { margin: 0 auto; max-height: min(78vh, 46rem); width: auto; height: auto; border-radius: 4px; }
figcaption { color: var(--mist); font-size: .9rem; text-align: center; margin-top: .85rem; font-style: italic; }
.inline-fig { margin: 2.5rem 0; }
.inline-fig img { border-radius: 4px; width: 100%; height: auto; }

.prose { color: var(--text); font-size: 1.125rem; line-height: 1.75; padding-bottom: clamp(3rem, 7vw, 5rem); }
.prose p { margin: 0 0 1.35rem; }
.prose h2 { font-family: var(--serif); font-weight: 400; color: var(--white); font-size: clamp(1.55rem, 2.6vw, 1.95rem); line-height: 1.2; margin: 2.75rem 0 1rem; }
.prose h3 { font-family: var(--serif); font-weight: 400; color: var(--white); font-size: 1.4rem; line-height: 1.25; margin: 2.25rem 0 .75rem; }
.prose strong { color: var(--white); font-weight: 600; }
.prose em { font-style: italic; }
.prose ul, .prose ol { margin: 0 0 1.5rem; padding-left: 1.4rem; }
.prose li { margin-bottom: .7rem; }
.prose li ul, .prose li ol { margin: .7rem 0 0; }
.prose li::marker { color: var(--steam); }
.prose a { color: var(--steam); }

/* Author */
.author { background: var(--navy-deep); padding: clamp(3rem, 7vw, 5rem) 0; }
.author .narrow { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.author img { width: 7rem; height: 7rem; object-fit: cover; object-position: 50% 20%; border-radius: 50%; }
.author h2 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 0 0 .5rem; }
.author p { color: var(--mist); margin: 0 0 1.5rem; }
.author .actions { display: flex; flex-wrap: wrap; gap: .85rem; }
@media (max-width: 560px) { .author .narrow { grid-template-columns: 1fr; } }

/* More posts */
.more { padding: clamp(3rem, 7vw, 5rem) 0; }
.more h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin: 0 0 2rem; }
.posts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--navy-line); }
.posts li { border-bottom: 1px solid var(--navy-line); }
.posts a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 2rem; align-items: baseline; padding: 1.25rem 0; text-decoration: none; }
.posts .t { font-family: var(--serif); font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.25; }
.posts .m { color: var(--mist); font-size: .92rem; white-space: nowrap; }
.posts a:hover .t { color: var(--steam); }
@media (max-width: 600px) { .posts a { grid-template-columns: 1fr; } }

footer { border-top: 1px solid var(--navy-line); padding: 2rem 0; color: var(--mist); font-size: .92rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
footer a { text-decoration: none; }
footer a:hover { color: var(--white); }

.tm { font-size: .55em; vertical-align: super; line-height: 0; margin-left: .1em; font-weight: 400; letter-spacing: 0; }
footer .legal { flex-basis: 100%; margin: 0; font-size: .8rem; color: var(--mist); opacity: .8; }

footer .social { display: inline-flex; gap: .7rem; align-items: center; }
footer .social a { display: inline-flex; opacity: .9; transition: opacity .15s; }
footer .social a:hover { opacity: 1; }
footer .social img { width: 22px; height: 22px; display: block; }
.btn:has(.ico) { display: inline-flex; align-items: center; gap: .5rem; }
.btn .ico { display: inline-block; width: 18px; height: 18px; margin: 0; }

.cq-link { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--navy-line); }
.cq-link a { color: var(--steam); }
