:root {
  --paper: #030914;
  --surface: #071321;
  --surface-strong: #0a1829;
  --ink: #eef5ff;
  --muted: #9eb1c9;
  --line: rgba(125, 166, 219, 0.24);
  --line-strong: rgba(227, 169, 61, 0.52);
  --gold: #e3a93d;
  --gold-soft: #ffd477;
  --blue: #238cff;
  --cyan: #55c8ff;
  --green: #61d6a8;
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.34);
  --font-sans: "Hanken Grotesk", "Segoe UI", sans-serif;
  --font-display: "EB Garamond", Georgia, serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
  --font-scale: 1;
  --max: 1240px;
}

:root[data-theme="day"] {
  --paper: #f7f9fc;
  --surface: #ffffff;
  --surface-strong: #eef3f9;
  --ink: #071227;
  --muted: #52657d;
  --line: rgba(7, 18, 39, 0.16);
  --line-strong: rgba(174, 114, 11, 0.5);
  --gold: #b9780d;
  --gold-soft: #8f5900;
  --blue: #096dd9;
  --cyan: #0879ad;
  --green: #197e61;
  --shadow: 0 18px 42px rgba(7, 18, 39, 0.12);
}

:root[data-contrast="high"] { --line: currentColor; --line-strong: currentColor; --shadow: none; }
:root[data-access-profile="calm"] { --font-scale: 1.06; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, transparent 0 71%, rgba(35, 140, 255, 0.05) 71% 71.08%, transparent 71.08%),
    linear-gradient(180deg, var(--paper), color-mix(in srgb, var(--surface) 58%, var(--paper)) 48%, var(--paper));
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: calc(16px * var(--font-scale));
  line-height: 1.62;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
}
.skip-link:focus { top: 16px; }

.top-strip {
  min-height: 31px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 7px max(24px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
}
.top-strip strong { color: var(--gold); text-align: center; }
.top-strip span:last-child { text-align: right; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(18px);
}
.header-inner {
  width: min(calc(100% - 40px), var(--max));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand-mark-shell { position: relative; width: 48px; height: 48px; flex: 0 0 48px; }
.brand-mark { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.brand-mark-light { opacity: 0; }
:root[data-theme="day"] .brand-mark-dark { opacity: 0; }
:root[data-theme="day"] .brand-mark-light { opacity: 1; }
.brand-copy strong { display: block; font-family: var(--font-display); font-size: 1.55rem; line-height: 1; }
.brand-copy small { display: block; margin-top: 4px; color: var(--cyan); font-size: 0.66rem; font-weight: 800; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.main-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 800;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--ink); border-color: var(--gold); }
.main-nav .nav-primary { margin-left: 7px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); }
.mobile-toggle { display: none; }

.journal-hero {
  width: min(calc(100% - 40px), var(--max));
  min-height: min(690px, calc(100vh - 110px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: clamp(40px, 7vw, 96px);
  padding: clamp(64px, 8vw, 112px) 0;
}
.eyebrow {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.journal-hero h1 {
  max-width: 11.5ch;
  margin-bottom: 24px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(3.7rem, 6vw, 6rem);
  line-height: 0.94;
}
.hero-lead { max-width: 690px; color: var(--muted); font-size: clamp(1.08rem, 1.7vw, 1.28rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button, .text-link, .utility-dock > * {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 10px 15px;
  background: var(--gold);
  color: #071227;
  font-weight: 800;
  cursor: pointer;
}
.button.secondary { background: transparent; color: var(--ink); }
.button:hover, .text-link:hover { border-color: var(--cyan); }
.hero-signals { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 34px; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.hero-signals span { padding-left: 10px; border-left: 2px solid var(--gold); }
.hero-identity { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.hero-identity img { width: min(100%, 570px); margin-inline: auto; filter: drop-shadow(0 24px 44px rgba(0,0,0,.24)); }
.hero-identity p { display: flex; justify-content: space-between; gap: 24px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); }
.hero-identity strong { color: var(--gold); }
.hero-identity span { max-width: 30ch; text-align: right; }

.section-band { border-top: 1px solid var(--line); }
.section-band:nth-of-type(even) { background: color-mix(in srgb, var(--surface) 72%, transparent); }
.section-inner { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; padding: clamp(62px, 7vw, 96px) 0; }
.section-heading { max-width: 820px; margin-bottom: 38px; }
.section-heading h2, .about-grid h2 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4.4vw, 4.6rem);
  line-height: 0.98;
}
.split-heading { max-width: none; display: grid; grid-template-columns: 1.1fr 0.75fr; gap: 52px; align-items: end; }
.split-heading > p { margin: 0; color: var(--muted); }

.publication-feature {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 30px 0;
  border-block: 1px solid var(--line-strong);
}
.publication-index { color: var(--gold); font-family: var(--font-mono); font-size: 1.5rem; }
.article-meta { display: flex; gap: 12px; color: var(--cyan); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }
.publication-feature h3 { margin: 10px 0; font-family: var(--font-display); font-size: clamp(2rem, 3.5vw, 3.5rem); line-height: 1; }
.publication-feature p { max-width: 760px; margin: 0; color: var(--muted); }
.publication-feature .text-link { background: transparent; color: var(--ink); white-space: nowrap; }

.track-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.track-grid article { min-height: 250px; padding: 28px; border-right: 1px solid var(--line); }
.track-grid article:last-child { border-right: 0; }
.track-grid span { color: var(--gold); font-family: var(--font-mono); font-size: 0.74rem; }
.track-grid h3 { margin: 42px 0 14px; font-family: var(--font-display); font-size: 2rem; }
.track-grid p { color: var(--muted); }

.about-band { border-bottom: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1.08fr 0.82fr; gap: clamp(42px, 8vw, 110px); align-items: start; }
.about-copy { padding-top: 22px; }
.about-copy p { color: var(--muted); font-size: 1.08rem; }
.about-copy .button { margin-top: 15px; }

.utility-dock {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.utility-dock > * { min-width: 46px; min-height: 38px; padding: 7px 10px; background: transparent; color: var(--ink); border-color: transparent; font-size: 0.76rem; }
.utility-dock .support-button { background: var(--blue); color: #fff; }

.site-footer {
  width: min(calc(100% - 40px), var(--max));
  min-height: 170px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 40px 0 78px;
  color: var(--muted);
}
.footer-brand { display: flex; align-items: center; gap: 13px; }
.footer-brand img { width: 42px; height: 42px; border-radius: 6px; }
.footer-brand strong, .footer-brand span { display: block; }
.footer-brand strong { color: var(--ink); }
.site-footer nav { display: flex; gap: 20px; font-weight: 700; }
.site-footer nav a:hover { color: var(--gold); }
.site-footer > p { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.78rem; }

.post-layout { width: min(calc(100% - 40px), 920px); margin: 0 auto; padding: clamp(58px, 8vw, 104px) 0; }
.post-body { padding: clamp(28px, 5vw, 58px); border-block: 1px solid var(--line-strong); }
.post-body h1 { max-width: 12ch; font-family: var(--font-display); font-size: clamp(3rem, 7vw, 5.8rem); line-height: .95; }
.post-body h2 { margin-top: 38px; font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); }
.post-body p { color: var(--muted); font-size: 1.08rem; }
.back-link { display: inline-flex; margin-bottom: 22px; color: var(--cyan); font-weight: 800; }

@media (max-width: 980px) {
  .top-strip { display: none; }
  .header-inner { min-height: 70px; }
  .mobile-toggle { display: inline-flex; width: 42px; height: 42px; flex-direction: column; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 5px; background: transparent; }
  .mobile-toggle span { width: 18px; height: 2px; margin-inline: auto; background: var(--ink); }
  .main-nav { position: absolute; top: calc(100% + 1px); left: 20px; right: 20px; display: none; padding: 12px; border: 1px solid var(--line); background: var(--surface-strong); box-shadow: var(--shadow); }
  .site-header[data-open="true"] .main-nav { display: grid; }
  .main-nav .nav-primary { margin-left: 0; }
  .journal-hero { min-height: auto; grid-template-columns: 1fr; padding-block: 66px; }
  .hero-identity { max-width: 680px; }
  .split-heading, .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .header-inner, .journal-hero, .section-inner, .site-footer, .post-layout { width: min(calc(100% - 30px), var(--max)); }
  .brand-copy strong { font-size: 1.3rem; }
  .brand-copy small { font-size: .58rem; }
  .journal-hero h1 { max-width: 11ch; font-size: clamp(2.85rem, 13vw, 4.2rem); }
  .hero-identity p { display: block; }
  .hero-identity span { display: block; max-width: none; margin-top: 5px; text-align: left; }
  .publication-feature { grid-template-columns: 46px 1fr; }
  .publication-feature .text-link { grid-column: 2; justify-self: start; }
  .track-grid { grid-template-columns: 1fr; }
  .track-grid article { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .track-grid article:last-child { border-bottom: 0; }
  .track-grid h3 { margin-top: 22px; }
  .utility-dock { left: 8px; right: 8px; bottom: 8px; justify-content: center; }
  .utility-dock > * { flex: 1 1 auto; }
  .site-footer { display: block; padding-bottom: 92px; }
  .site-footer nav { margin-top: 28px; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
