:root {
  --void: #05080d;
  --void-2: #0b0f14;
  --stone: #1f2937;
  --deep: #0b3b4c;
  --aurora: #2e6f8f;
  --ice: #8ec1e6;
  --prime: #d4af7f;
  --ember: #c7783b;
  --text: #e8e4dc;
  --muted: #a3acb9;
  --faint: #6b7686;
  --line: rgba(212, 175, 127, 0.22);
  --glass: rgba(11, 17, 26, 0.62);
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --wrap: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
em { color: #f1e6d2; }
strong { color: var(--prime); font-weight: 600; }

/* ---------- Sky ---------- */
#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}
.nebula {
  position: fixed;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 30% at 78% 18%, rgba(46, 111, 143, 0.16), transparent 70%),
    radial-gradient(35% 28% at 12% 62%, rgba(88, 62, 140, 0.12), transparent 70%),
    radial-gradient(50% 30% at 55% 105%, rgba(212, 175, 127, 0.08), transparent 70%),
    radial-gradient(30% 22% at 30% 12%, rgba(142, 193, 230, 0.06), transparent 70%);
  animation: drift 90s ease-in-out infinite alternate;
}
@keyframes drift {
  to { transform: translate3d(-2%, 1.5%, 0) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) { .nebula { animation: none; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px clamp(16px, 4vw, 40px);
  transition: background .4s ease, border-color .4s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 8, 13, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  font-family: var(--display);
  letter-spacing: .32em;
  font-size: .95rem;
}
.brand-mark { width: 30px; height: 30px; }
.nav nav { display: flex; gap: clamp(.9rem, 2.2vw, 2rem); }
.nav nav a {
  font-family: var(--display);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color .25s;
}
.nav nav a:hover, .nav nav a:focus-visible { color: var(--text); }
@media (max-width: 760px) { .nav nav { display: none; } }

/* ---------- Common ---------- */
section { position: relative; padding: clamp(80px, 12vw, 150px) 16px; }
.eyebrow {
  font-family: var(--display);
  font-size: .72rem;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--prime);
  margin: 0 0 1.1rem;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; }
h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.8rem);
  line-height: 1.22;
  letter-spacing: .06em;
  color: #f3efe7;
}
.section-head { max-width: 760px; margin: 0 auto clamp(40px, 6vw, 70px); text-align: center; }
.section-head > p:not(.eyebrow) { color: var(--muted); margin: 1.4rem auto 0; max-width: 64ch; }
.section-head.left { text-align: left; margin: 0; }
.section-head.left > p:not(.eyebrow) { margin-left: 0; }

.frame {
  margin: 0;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .07);
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(212, 175, 127, .12);
  pointer-events: none;
}

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 100px;
  padding-bottom: 90px;
}
.hero-art {
  width: min(620px, 92vw);
  aspect-ratio: 354 / 250;
  margin-bottom: -4.5rem;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 26%, #000 74%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 22%, #000 66%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(90deg, transparent 0%, #000 26%, #000 74%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 22%, #000 66%, transparent 100%);
          mask-composite: intersect;
  animation: rise 2.4s cubic-bezier(.2,.7,.2,1) both;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.95) contrast(1.05); }
.wordmark {
  position: relative;
  font-size: clamp(3rem, 11vw, 7.2rem);
  letter-spacing: .28em;
  margin-right: -.28em;
  line-height: 1;
  font-weight: 500;
  background: linear-gradient(180deg, #fbf8f2 0%, #d9d4ca 45%, #8e97a5 70%, #e7e1d6 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 30px rgba(0, 0, 0, .8));
  animation: fade 2s .5s ease both;
}
.divider {
  display: flex;
  align-items: center;
  gap: .9rem;
  width: min(440px, 80vw);
  margin: 1.3rem 0 .5rem;
  color: #fff;
  animation: fade 2s .9s ease both;
}
.divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(232, 228, 220, .7), transparent); }
.divider i { font-style: normal; font-size: .8rem; text-shadow: 0 0 12px #8ec1e6; }
.motto {
  font-family: var(--display);
  letter-spacing: .6em;
  margin: 0 -.6em 0 0;
  text-transform: uppercase;
  font-size: clamp(.8rem, 1.6vw, 1rem);
  color: #cfd4dc;
  animation: fade 2s 1.1s ease both;
}
.tagline {
  font-style: italic;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  color: var(--muted);
  margin: 2.2rem 0 1.4rem;
  animation: fade 2s 1.5s ease both;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin: 0;
  padding: .45rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 15, 20, .55);
  font-family: var(--display);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #d8cdb9;
  animation: fade 2s 1.8s ease both;
}
@media (max-width: 480px) { .status-chip { font-size: .58rem; letter-spacing: .12em; padding: .45rem .9rem; } }
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--prime); box-shadow: 0 0 10px var(--prime); animation: pulse 2.6s ease-in-out infinite; }
.scroll-cue { position: absolute; bottom: 28px; left: 50%; translate: -50% 0; width: 22px; height: 36px; border: 1px solid rgba(232, 228, 220, .35); border-radius: 12px; animation: fade 2s 2.4s ease both; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 2px; height: 7px; margin-left: -1px; border-radius: 2px; background: var(--text); animation: cue 2.2s ease-in-out infinite; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  .hero-art, .wordmark, .divider, .motto, .tagline, .status-chip, .scroll-cue { animation: none; }
  .dot, .scroll-cue span { animation: none; }
}

/* ---------- Premise ---------- */
.split {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.split .frame { aspect-ratio: 4 / 3; }
.split .frame img { object-position: 30% 50%; }
.copy .lead { font-size: 1.35rem; color: #ddd6ca; margin-top: 1.6rem; }
.copy p { color: var(--muted); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.pillars {
  list-style: none;
  padding: 0;
  max-width: var(--wrap);
  margin: clamp(70px, 10vw, 120px) auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.pillars li { padding: 2rem 1.6rem 0; border-left: 1px solid rgba(255, 255, 255, .05); }
.pillars li:first-child { border-left: 0; }
.pillars .num { font-family: var(--display); color: var(--prime); font-size: .8rem; letter-spacing: .2em; }
.pillars h3 { font-size: 1.05rem; letter-spacing: .24em; text-transform: uppercase; margin: .6rem 0 .6rem; }
.pillars p { margin: 0; color: var(--muted); font-size: 1.08rem; }
@media (max-width: 900px) {
  .pillars { grid-template-columns: 1fr 1fr; }
  .pillars li:nth-child(3) { border-left: 0; }
}
@media (max-width: 520px) {
  .pillars { grid-template-columns: 1fr; }
  .pillars li { border-left: 0; padding-left: 0; }
}

/* ---------- Forge ---------- */
.forge-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: stretch;
}
.frame.tall { min-height: 420px; }
@media (max-width: 860px) { .forge-grid { grid-template-columns: 1fr; } .frame.tall { min-height: 0; aspect-ratio: 370 / 285; } }

.console {
  background: linear-gradient(180deg, rgba(14, 22, 33, .82), rgba(8, 12, 19, .82));
  border: 1px solid rgba(142, 193, 230, .16);
  border-radius: 6px;
  padding: clamp(22px, 3vw, 34px);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 60px -20px rgba(46, 111, 143, .35) inset;
}
.console-head h3 { font-size: 1.1rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ice); }
.console-head p { margin: .4rem 0 1.4rem; color: var(--faint); font-size: 1rem; font-style: italic; }
.field { display: block; margin-bottom: 1.1rem; }
.field > span {
  display: flex;
  justify-content: space-between;
  font-family: var(--display);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .45rem;
}
.field output { color: var(--text); letter-spacing: .08em; text-transform: none; font-family: var(--serif); font-size: 1rem; }
select {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: rgba(5, 8, 13, .7);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 4px;
  padding: .5rem .7rem;
}
input[type="range"] { width: 100%; accent-color: var(--ice); background: transparent; }
input[type="range"]:focus-visible, select:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }

.derived {
  margin: 1.6rem 0 1.1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .06);
}
.derived div { background: rgba(6, 10, 16, .92); padding: .75rem .9rem; }
.derived dt { font-family: var(--display); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.derived dd { margin: .15rem 0 0; font-size: 1.35rem; color: #f3efe7; font-variant-numeric: tabular-nums; }
.verdict { margin: 0; font-size: 1.12rem; color: var(--muted); min-height: 3.4em; }
.verdict b { font-family: var(--display); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; margin-right: .4rem; }
.verdict.rhymes b { color: var(--prime); text-shadow: 0 0 14px rgba(212, 175, 127, .5); }
.verdict.unspoken b { color: #d58b7a; }
.verdict.close b { color: var(--ice); }

/* ---------- Peoples ---------- */
.people-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 1040px) { .people-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .people-grid { grid-template-columns: 1fr; } }
.people {
  position: relative;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color .4s ease, transform .6s cubic-bezier(.2,.7,.2,1), box-shadow .4s ease, opacity 1.1s ease;
}
.people:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 20px 60px -30px color-mix(in srgb, var(--accent) 50%, transparent); }
.people-art { aspect-ratio: 16 / 9; overflow: hidden; }
.people-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s cubic-bezier(.2,.7,.2,1); }
.people:hover .people-art img { transform: scale(1.06); }
.people-body { position: relative; padding: 2.6rem 1.4rem 1.5rem; }
.emblem {
  position: absolute;
  top: -30px;
  left: 1.3rem;
  width: 58px;
  height: 58px;
  padding: 10px;
  color: #fff;
  background: rgba(6, 10, 16, .92);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 50%;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 40%, transparent));
}
.people h3 { font-size: 1.35rem; letter-spacing: .24em; text-transform: uppercase; }
.epithet { margin: .2rem 0 .8rem; font-style: italic; color: var(--accent); font-size: 1.02rem; }
.people-body > p:not(.epithet) { color: var(--muted); font-size: 1.05rem; margin: 0 0 1rem; }
.people dl { margin: 0; border-top: 1px solid rgba(255, 255, 255, .07); padding-top: .8rem; }
.people dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .18rem 0; }
.people dt { font-family: var(--display); font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); padding-top: .3rem; }
.people dd { margin: 0; text-align: right; font-size: 1rem; color: #d7d1c6; }

/* ---------- Spiral bento ---------- */
.bento {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 250px;
  gap: 16px;
}
.tile { position: relative; overflow: hidden; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .07); background: #070a10; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s cubic-bezier(.2,.7,.2,1); }
.tile:hover img { transform: scale(1.05); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(4, 6, 10, .92) 100%); pointer-events: none; }
.tile-copy { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 1.3rem 1.4rem; }
.tile h3 { font-size: 1rem; letter-spacing: .26em; text-transform: uppercase; }
.tile p { margin: .35rem 0 0; color: #bfc6d0; font-size: 1.02rem; line-height: 1.45; max-width: 46ch; }
.t-ruins { grid-column: span 3; grid-row: span 2; }
.t-forgehold { grid-column: span 3; }
.t-hush { grid-column: span 3; }
.t-cold { grid-column: span 3; }
.t-living { grid-column: span 3; }
@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr; grid-auto-rows: 260px; }
  .bento .tile { grid-column: auto; grid-row: auto; }
  .t-ruins { grid-row: span 2 !important; }
}

/* ---------- Progress ---------- */
.progress-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(36px, 6vw, 90px);
}
@media (max-width: 860px) { .progress-inner { grid-template-columns: 1fr; } }
.roadmap { list-style: none; margin: 0; padding: 0; position: relative; counter-reset: phase -1; }
.roadmap::before { content: ""; position: absolute; left: 11px; top: 10px; bottom: 10px; width: 1px; background: linear-gradient(180deg, var(--prime), rgba(142, 193, 230, .35) 30%, rgba(255, 255, 255, .06)); }
.roadmap li { position: relative; padding: 0 0 1.6rem 3rem; counter-increment: phase; }
.roadmap li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(232, 228, 220, .35);
  background: var(--void);
}
.roadmap li.done::before { background: var(--prime); border-color: var(--prime); box-shadow: 0 0 12px var(--prime); }
.roadmap li.next::before { border-color: var(--ice); box-shadow: 0 0 0 4px rgba(142, 193, 230, .15); }
.roadmap h3 { font-size: .95rem; letter-spacing: .2em; text-transform: uppercase; }
.roadmap h3::before { content: "Phase " counter(phase) " · "; color: var(--faint); font-size: .72rem; letter-spacing: .18em; }
.roadmap p { margin: .25rem 0 0; color: var(--muted); font-size: 1.05rem; }
.roadmap li:not(.done):not(.next) { opacity: .72; }
.tag { display: inline-block; margin-top: .5rem; font-family: var(--display); font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: var(--prime); border: 1px solid var(--line); padding: .2rem .6rem; border-radius: 999px; }
.next .tag { color: var(--ice); border-color: rgba(142, 193, 230, .3); }

/* ---------- Footer ---------- */
.footer { position: relative; text-align: center; padding: 120px 16px 40px; overflow: hidden; }
.horizon { position: absolute; inset: 0; z-index: -1; opacity: .55; -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%); mask-image: linear-gradient(180deg, transparent, #000 60%); }
.horizon img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.footer-mark { width: 56px; height: 56px; margin: 0 auto; display: block; }
.footer-word { font-family: var(--display); letter-spacing: .5em; margin: 1rem -.5em 0 0; font-size: 1.4rem; }
.footer-motto { font-family: var(--display); letter-spacing: .45em; margin: .2rem -.45em 0 0; text-transform: uppercase; font-size: .7rem; color: var(--muted); }
.fine { margin: 3rem 0 0; font-size: .95rem; color: var(--faint); }
