:root {
  --ink: #05080b;
  --ink-soft: #071018;
  --surface: #081723;
  --surface-2: #11151d;
  --bone: #f4f0e8;
  --muted: #abb3ba;
  --blue: #4b9fe8;
  --blue-bright: #78bcf5;
  --red: #c84f45;
  --red-bright: #ea6b5e;
  --gold: #b98b3e;
  --gold-bright: #d9b765;
  --line: rgba(244, 240, 232, 0.18);
  --line-blue: rgba(75, 159, 232, 0.58);
  --line-red: rgba(200, 79, 69, 0.58);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Baskerville, Georgia, serif;
  --sans: Avenir, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max: 1440px;
  --gutter: clamp(1.25rem, 4vw, 5.5rem);
  --header-height: 92px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ink); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 4px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.7rem 1rem;
  background: var(--bone);
  color: var(--ink);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  min-height: var(--header-height);
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: min-height 220ms ease, background 220ms ease, border-color 220ms ease, backdrop-filter 220ms ease;
}
.site-header.scrolled {
  background: rgba(5, 8, 11, 0.88);
  border-color: var(--line);
  backdrop-filter: blur(16px);
}
body.admin-bar .site-header { top: 32px; }
.brand {
  width: clamp(210px, 18vw, 275px);
  text-decoration: none;
  transition: width 220ms ease;
}
.brand img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.45));
}
.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 3.4rem);
}
.desktop-nav a {
  position: relative;
  padding: 0.7rem 0;
  text-decoration: none;
  font-size: 0.83rem;
  letter-spacing: 0.08em;
}
.desktop-nav a::after {
  content: "";
  position: absolute;
  inset: auto 50% 0;
  height: 1px;
  background: linear-gradient(90deg, var(--blue), var(--red));
  transition: inset 180ms ease;
}
.desktop-nav a:hover::after,
.desktop-nav a.active::after { inset-inline: 0; }
.menu-toggle {
  display: none;
  justify-self: end;
  width: 44px;
  height: 44px;
  padding: 11px 8px;
  border: 0;
  background: transparent;
  color: var(--bone);
}
.menu-toggle span:not(.sr-only) {
  display: block;
  height: 1px;
  margin: 5px 0;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}
.mobile-nav { display: none; }

.hero {
  position: relative;
  min-height: clamp(540px, 63svh, 680px);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: calc(var(--header-height) + 4rem) var(--gutter) 7rem;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue) 0 34%, var(--gold) 34% 67%, var(--red) 67% 100%);
  opacity: 0.72;
}
.hero-media,
.hero-vignette { position: absolute; inset: 0; z-index: -2; }
.hero-media {
  background: url("assets/hero-eclipse.webp") 50% 50% / cover no-repeat;
  transform: scale(1.015);
  animation: hero-breathe 18s ease-in-out infinite alternate;
}
.hero-vignette {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5,8,11,0.88) 0%, rgba(5,8,11,0.66) 28%, rgba(5,8,11,0.05) 62%),
    linear-gradient(0deg, rgba(5,8,11,0.74) 0%, transparent 28%),
    radial-gradient(circle at center, transparent 45%, rgba(5,8,11,0.23) 100%);
}
.hero-content { width: min(780px, 60vw); padding-top: 1rem; }
.hero-orbit,
.section-label,
.map-intro > p:first-child,
.decoder-copy > p:first-child {
  margin: 0 0 1.7rem;
  color: var(--blue-bright);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.75rem, 6.6vw, 7.5rem);
  font-weight: 400;
  line-height: 0.87;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.hero h1 span { display: block; color: var(--gold-bright); }

.hero h1 em {
  color: var(--red-bright);
  font-style: inherit;
}
.hero-deck {
  max-width: 650px;
  margin: 2rem 0 2.2rem;
  color: #d7dbde;
  font-size: clamp(1rem, 1.45vw, 1.28rem);
  line-height: 1.55;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  min-height: 50px;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--blue);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
.button span { color: var(--red-bright); }
.button:hover { background: var(--blue); color: #02111f; transform: translateY(-2px); }
.button:hover span { color: #02111f; }
.button-secondary { border-color: var(--bone); }
.button-secondary:hover { background: var(--bone); color: var(--ink); }
.scroll-cue {
  position: absolute;
  left: var(--gutter);
  bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(244,240,232,0.7);
  text-decoration: none;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.editorial-section,
.map-section,
.library-section,
.site-footer { padding-inline: var(--gutter); }
.editorial-section {
  max-width: calc(var(--max) + (var(--gutter) * 2));
  margin: 0 auto;
  padding-top: clamp(2.5rem, 5vw, 5rem);
  padding-bottom: clamp(5.5rem, 9vw, 9rem);
}
.section-heading {
  display: grid;
  grid-template-columns: 0.65fr 2fr auto;
  align-items: end;
  gap: 2rem;
  margin-bottom: 2.8rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}
.section-heading > p {
  margin: 0;
  color: var(--blue-bright);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.23em;
  text-transform: uppercase;
}
.section-heading h2,
.map-intro h2,
.decoder-copy h2,
.library-section h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4vw, 4.7rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.025em;
}
.section-heading > a,
.text-link {
  color: var(--red-bright);
  text-decoration: none;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.story-grid {
  display: grid;
  grid-template-columns: 1.55fr repeat(3, minmax(0, 0.72fr));
  gap: 1rem;
}
.story-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--ink-soft);
  transition: border-color 180ms ease, transform 180ms ease;
}
.story-card:hover { border-color: var(--line-blue); transform: translateY(-4px); }
.story-card:nth-child(3):hover,
.story-card:nth-child(4):hover { border-color: var(--line-red); }
.story-image { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.04);
  transition: transform 520ms cubic-bezier(.2,.8,.2,1), filter 300ms ease;
}
.story-card:hover .story-image img { transform: scale(1.035); filter: saturate(1) contrast(1.03); }
.story-card-featured .story-image { aspect-ratio: 16 / 9; }
.story-copy { display: flex; flex: 1; flex-direction: column; padding: clamp(1.15rem, 2vw, 1.8rem); }
.story-category {
  margin: 0 0 0.8rem;
  color: var(--blue-bright);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.story-card-featured .story-category { color: var(--gold-bright); }
.story-card:nth-child(3) .story-category,
.story-card:nth-child(4) .story-category { color: var(--red-bright); }
.story-card-featured .text-link { color: var(--blue-bright); }
.story-copy h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2vw, 2.4rem);
  font-weight: 400;
  line-height: 1.02;
}
.story-copy h3 a { text-decoration: none; }
.story-copy > p:not(.story-category) { margin: 1rem 0 1.5rem; color: var(--muted); font-size: 0.86rem; }
.story-copy .text-link { margin-top: auto; }

.map-section {
  display: grid;
  grid-template-columns: 0.8fr 1.45fr;
  gap: clamp(3rem, 8vw, 10rem);
  padding-top: clamp(5.5rem, 9vw, 10rem);
  padding-bottom: clamp(5.5rem, 9vw, 10rem);
  border-block: 1px solid var(--line);
  background:
    radial-gradient(circle at 12% 30%, rgba(75,159,232,0.14), transparent 30%),
    radial-gradient(circle at 92% 78%, rgba(200,79,69,0.10), transparent 28%),
    var(--surface);
}
.map-intro { position: sticky; top: 9rem; align-self: start; }
.map-intro > p:last-child { max-width: 520px; margin: 2rem 0 0; color: var(--muted); }
.path-list { border-top: 1px solid var(--line); }
.path {
  display: grid;
  grid-template-columns: 54px minmax(190px, 0.72fr) 1fr 30px;
  align-items: center;
  gap: 1.5rem;
  min-height: 112px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background 180ms ease, padding 180ms ease;
}
.path:hover { padding-inline: 1.2rem; background: rgba(75,159,232,0.07); }
.path:nth-child(even):hover { background: rgba(200,79,69,0.055); }
.path-number { color: var(--blue-bright); font-size: 0.66rem; letter-spacing: 0.15em; }
.path:nth-child(3n + 2) .path-number,
.path:nth-child(3n + 2) .path-arrow { color: var(--red-bright); }
.path:nth-child(3n) .path-number,
.path:nth-child(3n) .path-arrow { color: var(--gold-bright); }
.path-title { font-family: var(--serif); font-size: clamp(1.55rem, 2.15vw, 2.3rem); }
.path-description { color: var(--muted); font-size: 0.86rem; }
.path-arrow { justify-self: end; color: var(--blue-bright); }

.decoder-section {
  display: grid;
  grid-template-columns: 0.55fr 1.5fr auto;
  align-items: center;
  gap: clamp(2rem, 6vw, 7rem);
  padding: clamp(5rem, 8vw, 8rem) var(--gutter);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(110deg, rgba(75,159,232,0.08), transparent 36%),
    linear-gradient(290deg, rgba(200,79,69,0.07), transparent 32%),
    var(--ink-soft);
}
.decoder-mark { display: flex; justify-content: center; gap: clamp(0.6rem, 1vw, 1.1rem); }
.decoder-mark span {
  display: block;
  width: clamp(8px, 1vw, 14px);
  height: clamp(80px, 11vw, 150px);
  border: 1px solid var(--blue);
  box-shadow: 0 0 38px rgba(75,159,232,0.18);
}
.decoder-mark span:nth-child(2) { border-color: var(--gold); box-shadow: 0 0 38px rgba(185,139,62,0.15); }
.decoder-mark span:nth-child(3) { border-color: var(--red); box-shadow: 0 0 38px rgba(200,79,69,0.18); }
.decoder-section .button { border-color: var(--red); }
.decoder-section .button:hover { background: var(--red); color: var(--bone); }
.decoder-copy > p:last-child { max-width: 650px; margin: 1.5rem 0 0; color: var(--muted); }

.library-section {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr auto;
  align-items: end;
  gap: clamp(2rem, 6vw, 7rem);
  padding-top: clamp(6rem, 10vw, 11rem);
  padding-bottom: clamp(6rem, 10vw, 11rem);
  background:
    linear-gradient(90deg, rgba(5,8,11,0.96), rgba(5,8,11,0.72)),
    url("assets/story-1111.webp") 50% 46% / cover no-repeat;
}
.library-section > p { max-width: 520px; margin: 0; color: #d1d6da; }

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: end;
  gap: 3rem;
  padding-top: 4rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--line);
  background: #030506;
}
.footer-brand img {
  width: 220px;
  height: auto;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.4));
}
.footer-brand p,
.copyright { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.13em; text-transform: uppercase; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.75rem; }
.footer-links a:hover { color: var(--bone); }
.footer-links a:nth-child(odd):hover { color: var(--blue-bright); }
.footer-links a:nth-child(even):hover { color: var(--red-bright); }

@keyframes hero-breathe {
  from { transform: scale(1.015); }
  to { transform: scale(1.045); }
}

@media (max-width: 1180px) {
  .story-grid { grid-template-columns: repeat(3, 1fr); }
  .story-card-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.35fr 0.65fr; }
  .story-card-featured .story-image { aspect-ratio: auto; min-height: 350px; }
  .decoder-section,
  .library-section { grid-template-columns: 0.55fr 1.45fr; }
  .decoder-section .button,
  .library-section .button { grid-column: 2; justify-self: start; }
  .site-footer { grid-template-columns: 1fr auto; }
  .copyright { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  :root { --header-height: 76px; }
  .site-header { grid-template-columns: 1fr auto; }
  .site-header.scrolled { min-height: 58px; }
  .brand { width: 190px; }
  .site-header.scrolled .brand { width: 142px; }
  .desktop-nav { display: none; }
  .menu-toggle {
    position: relative;
    z-index: 3;
    display: block;
    transition: transform 220ms ease;
  }
  .site-header.scrolled .menu-toggle { transform: scale(0.88); }
  .site-header .brand { position: relative; z-index: 3; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(1.15rem, 4.5vh, 1.8rem);
    min-height: 100svh;
    padding: calc(var(--header-height) + 2rem) var(--gutter) max(2rem, env(safe-area-inset-bottom));
    overflow-y: auto;
    background: #05080b !important;
    color: var(--bone) !important;
  }
  .site-header.scrolled .mobile-nav {
    inset-block-start: 0;
    min-height: 100svh;
    padding-top: calc(58px + 2rem);
  }
  .mobile-nav[hidden] { display: none; }
  .mobile-nav a {
    display: block;
    color: var(--bone) !important;
    font-family: var(--serif) !important;
    font-size: clamp(1.45rem, 7vw, 2rem) !important;
    font-weight: 400 !important;
    line-height: 1.15 !important;
    text-align: center;
    text-decoration: none !important;
  }
  .mobile-nav.submenu-open {
    justify-content: flex-start;
    gap: 0.8rem;
  }
  .mobile-nav-group {
    width: min(100%, 24rem);
  }
  .mobile-nav-row {
    display: grid;
    grid-template-columns: 36px auto 36px;
    align-items: center;
    justify-content: center;
  }
  .mobile-nav-row > a { grid-column: 2; }
  .mobile-submenu-toggle {
    grid-column: 3;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--gold-bright);
  }
  .mobile-submenu-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 180ms ease;
  }
  .mobile-submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .mobile-submenu {
    display: grid;
    gap: 0.7rem;
    width: 100%;
    max-height: 38svh;
    margin-top: 0.65rem;
    padding: 0.9rem 0;
    overflow-y: auto;
    border-block: 1px solid rgba(120, 188, 245, 0.26);
  }
  .mobile-submenu[hidden] { display: none; }
  .mobile-submenu a {
    color: var(--muted) !important;
    font-family: var(--sans) !important;
    font-size: clamp(0.88rem, 4vw, 1rem) !important;
    line-height: 1.3 !important;
  }

  body.menu-open .site-header {
    background: #05080b;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .hero { min-height: 760px; align-items: end; }
  .hero-media { background-position: 61% 50%; }
  .hero-vignette {
    background:
      linear-gradient(0deg, rgba(5,8,11,0.97) 0%, rgba(5,8,11,0.7) 42%, rgba(5,8,11,0.08) 78%),
      linear-gradient(90deg, rgba(5,8,11,0.45), transparent);
  }
  .hero-content { width: 100%; padding-bottom: 3rem; }
  .hero h1 { font-size: clamp(3.25rem, 12vw, 5.8rem); }
  .scroll-cue { display: none; }
  .section-heading { grid-template-columns: 1fr auto; }
  .section-heading h2 { grid-column: 1 / -1; grid-row: 2; }
  .section-heading > a { grid-column: 2; grid-row: 1; }
  .story-grid { grid-template-columns: 1fr 1fr; }
  .story-card-featured { grid-column: 1 / -1; }
  .story-card:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .map-section { grid-template-columns: 1fr; }
  .map-intro { position: static; }
  .path { grid-template-columns: 44px minmax(150px, 0.85fr) 1fr 24px; }
}

@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
  body.admin-bar .menu-toggle { margin-right: 44px; }
  body.admin-bar .mobile-nav,
  body.admin-bar .site-header.scrolled .mobile-nav { top: 0; }
}

@media (max-width: 620px) {
  .hero { min-height: 700px; padding-bottom: 3rem; }
  .hero-orbit { display: none; }
  .hero h1 { line-height: 0.94; }
  .hero-deck { margin: 1.4rem 0 1.8rem; font-size: 0.98rem; }
  .section-heading { display: block; }
  .section-heading h2 { margin: 0.7rem 0 1.4rem; }
  .story-grid { display: block; }
  .story-card,
  .story-card-featured,
  .story-card:last-child { display: flex; margin-bottom: 1rem; }
  .story-card-featured .story-image,
  .story-card:last-child .story-image { aspect-ratio: 4 / 3; min-height: 0; }
  .map-section { gap: 3rem; }
  .path {
    grid-template-columns: 38px 1fr 24px;
    gap: 1rem;
    padding-block: 1.2rem;
  }
  .path-description { grid-column: 2 / -1; margin-top: -0.75rem; }
  .path-arrow { grid-column: 3; grid-row: 1; }
  .decoder-section,
  .library-section { display: block; }
  .decoder-mark { justify-content: flex-start; margin-bottom: 2.5rem; }
  .decoder-mark span { height: 64px; }
  .decoder-section .button,
  .library-section .button { margin-top: 2rem; }
  .library-section > p { margin-top: 1.7rem; }
  .site-footer { display: block; }
  .footer-links { margin-top: 2rem; flex-wrap: wrap; }
  .copyright { margin-top: 2.5rem; }
}

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