@font-face { font-family: "Marcellus"; src: url("/fonts/marcellus-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/figtree-latin-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  color-scheme: dark;
  --ink: #070a1c;
  --ink-2: #0e1230;
  --panel: rgba(23, 26, 62, .62);
  --line: rgba(214, 200, 255, .16);
  --cream: #f7f0dd;
  --text: #d7daea;
  --muted: #a6acc8;
  --gold: #e8c98c;
  --gold-hi: #fbe6b5;
  --violet: #9d8bff;
  --gutter: clamp(16px, 4vw, 48px);
  --display: "Marcellus", Georgia, "Times New Roman", serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); font: 400 17px/1.65 var(--body); overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; color: var(--cream); font-family: var(--display); font-weight: 400; line-height: 1.12; text-wrap: balance; }
h2 { font-size: clamp(32px, 4.6vw, 56px); }
h3 { font-size: 24px; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; border-radius: 4px; }

.skip { position: fixed; top: 8px; left: 8px; z-index: 40; padding: 8px 14px; background: var(--cream); color: var(--ink); border-radius: 8px; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* Fixed sky behind every section. main.js fades the layers as you scroll. */
.sky { position: fixed; inset: 0; z-index: -1; background: radial-gradient(90% 60% at 50% 0%, #182050 0%, transparent 70%), radial-gradient(70% 50% at 90% 90%, #241a4e 0%, transparent 70%), var(--ink); }
.sky-layer { position: absolute; inset: 0; opacity: 0; }
.sky-dream { background: radial-gradient(90% 70% at 20% 30%, #3b1f78 0%, transparent 70%), radial-gradient(80% 60% at 85% 75%, #1d3a7a 0%, transparent 70%), #120b2c; }
.sky-dawn { background: radial-gradient(100% 55% at 50% 0%, #6a3f73 0%, transparent 72%), radial-gradient(80% 50% at 15% 100%, #203c6e 0%, transparent 70%), #141634; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 26px; border-radius: 12px; font-weight: 650; font-size: 16px; text-decoration: none; transition: transform .2s, box-shadow .25s, background-color .2s, border-color .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { position: relative; overflow: hidden; color: #1b1630; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 8px 34px rgba(232, 201, 140, .32), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .7) 50%, transparent 65%); transform: translateX(-110%); transition: transform .7s; }
.btn-primary:hover { box-shadow: 0 12px 44px rgba(232, 201, 140, .5), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn-primary:hover::after { transform: translateX(110%); }
.btn-ghost { color: var(--cream); background: rgba(14, 16, 44, .45); border: 1px solid rgba(247, 240, 221, .34); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--gold-hi); background: rgba(14, 16, 44, .7); }
.btn-small { min-height: 40px; padding: 6px 16px; font-size: 14px; color: #1b1630; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* Header */
.nav { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 12px var(--gutter); transition: background-color .3s, border-color .3s; border-bottom: 1px solid transparent; }
.nav.is-solid { background: rgba(9, 11, 32, .78); backdrop-filter: blur(14px); border-color: var(--line); }
.nav-brand { display: flex; align-items: center; gap: 10px; margin-right: auto; color: var(--cream); font-family: var(--display); font-size: 19px; text-decoration: none; opacity: 0; transition: opacity .3s; }
.nav.is-solid .nav-brand { opacity: 1; }
.nav-brand img { border-radius: 50%; }
.nav-links { display: flex; gap: 24px; font-size: 15px; }
.nav-links a { color: var(--text); text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: var(--gold-hi); }

/* Hero */
.hero { position: relative; display: grid; align-items: center; min-height: 100svh; overflow: hidden; isolation: isolate; }
.hero-art, .hero-plate, .hero-fg { position: absolute; inset: -3% -2%; z-index: -3; }
.hero-art img, .hero-plate img, .hero-fg img { width: 100%; height: 100%; object-fit: cover; object-position: 56% 50%; }
.hero-plate, .hero-fg { opacity: 0; pointer-events: none; }
.hero-fg { z-index: -2; }
.hero-stars { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; pointer-events: none; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(7, 10, 28, .28) 0%, transparent 28%, transparent 60%, var(--ink) 100%), radial-gradient(52% 46% at 50% 44%, rgba(7, 10, 28, .5) 0%, transparent 100%); }
.hero-content { display: grid; justify-items: center; gap: 18px; width: min(100% - 2 * var(--gutter), 760px); margin: 0 auto; padding: 84px 0 96px; text-align: center; }
.hero-content > * { animation: rise 1.1s cubic-bezier(.2, .7, .2, 1) both; }
.hero-content > :nth-child(2) { animation-delay: .15s; }
.hero-content > :nth-child(3) { animation-delay: .28s; }
.hero-content > :nth-child(4) { animation-delay: .4s; }
.hero-content > :nth-child(5) { animation-delay: .52s; }
.hero-wordmark { width: min(86vw, 640px); filter: drop-shadow(0 6px 34px rgba(7, 10, 28, .55)); }
.hero h1 { font-size: clamp(30px, 4.4vw, 54px); text-shadow: 0 2px 24px rgba(7, 10, 28, .9); }
.hero-sub { max-width: 40em; color: var(--cream); font-size: clamp(17px, 1.7vw, 20px); text-shadow: 0 1px 16px rgba(7, 10, 28, .95); }
.hero .cta-row { margin-top: 8px; }
.hero-meta { color: var(--text); font-size: 14px; text-shadow: 0 1px 10px rgba(7, 10, 28, 1); }
.hero-meta span { padding: 0 4px; color: var(--gold); }
.hero-scroll { position: absolute; bottom: 22px; left: 50%; width: 28px; height: 44px; margin-left: -14px; border: 1.5px solid rgba(247, 240, 221, .55); border-radius: 16px; }
.hero-scroll span { position: absolute; top: 8px; left: 50%; width: 3px; height: 9px; margin-left: -1.5px; border-radius: 2px; background: var(--cream); animation: wheel 1.9s infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.985); } }
@keyframes wheel { 0% { opacity: 0; transform: translateY(-2px); } 30% { opacity: 1; } 80%, 100% { opacity: 0; transform: translateY(14px); } }

/* Sections */
.section { padding: clamp(72px, 10vw, 140px) 0; }
.wrap { width: min(100% - 2 * var(--gutter), 1240px); margin: 0 auto; }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 64px); }
.eyebrow { margin-bottom: 14px; color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.lede { margin-top: 18px; color: var(--text); font-size: clamp(18px, 1.6vw, 21px); }

.beats { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); margin: 0; padding: 0; list-style: none; }
.beat { padding: 12px 12px 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); backdrop-filter: blur(6px); transition: transform .3s, border-color .3s; }
.beat:hover { transform: translateY(-6px); border-color: rgba(232, 201, 140, .5); }
.beat img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; }
.beat-time { margin: 20px 12px 6px; color: var(--gold); font-size: 14px; font-weight: 700; }
.beat h3, .beat > p:last-child { margin-inline: 12px; }
.beat > p:last-child { margin-top: 10px; color: var(--text); font-size: 16px; }

/* Dream chooser */
.dream-grid { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 10fr); align-items: center; gap: clamp(24px, 3.5vw, 56px); }
.dream-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 1.2vw, 16px); perspective: 900px; }
.dream-card { position: relative; padding: 0; overflow: hidden; border: 0; border-radius: 12px; background: none; cursor: pointer; opacity: .78; transform-style: preserve-3d; transition: opacity .3s, box-shadow .3s; }
.dream-card:hover { opacity: .9; }
.dream-card.is-active { opacity: 1; box-shadow: 0 0 0 2px var(--gold-hi), 0 14px 46px rgba(232, 201, 140, .35); }
.dream-card img { width: 100%; }
.dream-shine { position: absolute; inset: 0; opacity: 0; mix-blend-mode: soft-light; background: radial-gradient(circle at var(--shine-x, 50%) var(--shine-y, 50%), rgba(255, 255, 255, .85), transparent 55%); transition: opacity .3s; pointer-events: none; }
.dream-card:hover .dream-shine { opacity: 1; }
.dream-result { display: grid; }
.dream-morning { grid-area: 1 / 1; margin: 0; opacity: 0; visibility: hidden; transition: opacity .55s, visibility .55s; }
.dream-morning.is-active { opacity: 1; visibility: visible; }
.dream-morning img { width: 100%; border-radius: 14px; border: 1px solid var(--line); }
.dream-morning figcaption { margin-top: 16px; font-size: 18px; }
.dream-morning strong { color: var(--cream); font-weight: 650; }

/* Growth: a tall section whose sticky child is scrubbed by scroll. */
.growth { height: 420vh; }
.growth-pin { position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; height: 100svh; padding: 76px var(--gutter) 18px; overflow: hidden; text-align: center; }
.growth-head .eyebrow { margin-bottom: 6px; }
.growth-head h2 { font-size: clamp(28px, 3.6vw, 46px); }
.growth-stage { position: relative; flex: 1; width: 100%; max-width: 1400px; min-height: 0; margin-top: 10px; }
.growth-frame { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; }
.growth-frame img { min-height: 0; flex: 0 1 auto; width: auto; max-width: 100%; object-fit: contain; border-radius: 14px; -webkit-mask-image: radial-gradient(75% 75% at 50% 50%, #000 62%, transparent 100%); mask-image: radial-gradient(75% 75% at 50% 50%, #000 62%, transparent 100%); }
.growth-frame figcaption { flex: none; margin-top: 8px; color: var(--cream); font-size: clamp(16px, 1.5vw, 20px); }
.growth-night { margin-right: 10px; color: var(--gold); font-family: var(--display); font-size: 1.2em; }
.growth-progress { flex: none; width: min(100%, 460px); height: 3px; margin-top: 12px; border-radius: 3px; background: var(--line); overflow: hidden; }
.growth-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--gold-hi)); transform: scaleX(0); transform-origin: left; }
.fineprint { flex: none; margin-top: 8px; color: var(--muted); font-size: 13px; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(10, 1fr); gap: clamp(10px, 1.2vw, 18px); }
.shot { position: relative; grid-column: span 4; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: var(--ink-2); }
.shot-wide { grid-column: span 6; }
.shot-full { grid-column: span 10; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.shot:hover img { transform: scale(1.035); }
.shot-label { position: absolute; left: 12px; bottom: 12px; padding: 5px 12px; border-radius: 8px; background: rgba(8, 10, 30, .78); color: var(--cream); font-size: 14px; font-weight: 600; backdrop-filter: blur(6px); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: clamp(28px, 4vw, 48px) 0 0; padding: 0; list-style: none; }
.facts li { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-size: 15px; }
.facts strong { display: block; color: var(--cream); font-size: 17px; }

/* Heroes */
.heroes-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 72px); }
.heroes-grid .section-head { margin-bottom: 0; }
.hero-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 2vw, 24px); }
.hero-card { display: grid; align-content: end; justify-items: center; gap: 18px; margin: 0; }
.hero-portrait { width: 100%; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .45)); }
.sprite { width: 192px; height: 192px; background-size: 2304px 192px; background-repeat: no-repeat; image-rendering: pixelated; animation: walk 1.15s steps(12) infinite; }
.sprite-explorer { background-image: url("/assets/sprite-explorer.webp"); }
.sprite-heroine { background-image: url("/assets/sprite-heroine.webp"); }
@keyframes walk { to { background-position-x: -2304px; } }

/* Alpha */
.alpha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.5vw, 32px); }
.alpha-grid article { padding: clamp(24px, 3vw, 44px); border: 1px solid var(--line); border-radius: 20px; background: var(--panel); backdrop-filter: blur(6px); }
.alpha-grid h2 { margin-bottom: 16px; font-size: clamp(28px, 3vw, 38px); }
.text-link { display: inline-block; margin-top: 18px; color: var(--gold-hi); font-weight: 650; text-decoration-color: rgba(251, 230, 181, .4); text-underline-offset: 4px; }

/* Finale */
.finale { position: relative; display: grid; place-items: center; min-height: 86svh; padding: 80px var(--gutter); overflow: hidden; isolation: isolate; text-align: center; }
.finale-art { position: absolute; inset: 0; z-index: -1; }
.finale-art img { width: 100%; height: 100%; object-fit: cover; object-position: 56% 50%; }
.finale::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--ink) 0%, rgba(7, 10, 28, .35) 32%, rgba(7, 10, 28, .6) 100%); }
.finale h2 { font-size: clamp(44px, 7vw, 88px); text-shadow: 0 2px 30px rgba(7, 10, 28, .9); }
.finale .lede { margin: 12px 0 26px; color: var(--cream); text-shadow: 0 1px 14px rgba(7, 10, 28, 1); }
.finale .hero-meta { margin-top: 18px; }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding: 26px var(--gutter); border-top: 1px solid var(--line); background: var(--ink); color: var(--muted); font-size: 14px; }
.footer span { color: var(--gold); }

/* Lightbox */
.lightbox { max-width: 96vw; max-height: 96vh; padding: 0; overflow: visible; border: 0; border-radius: 12px; background: none; }
.lightbox::backdrop { background: rgba(4, 5, 16, .9); backdrop-filter: blur(4px); }
.lightbox img { max-width: 96vw; max-height: 92vh; width: auto; border-radius: 12px; }
.lightbox button { position: absolute; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; background: rgba(10, 12, 34, .85); color: var(--cream); font-size: 26px; line-height: 1; cursor: pointer; }
.lightbox-close { top: 10px; right: 10px; }
.lightbox-nav { top: calc(50% - 23px); }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

/* Standalone pages such as the 404 */
.simple { display: grid; place-items: center; min-height: 100svh; padding: var(--gutter); text-align: center; }
.simple h1 { margin-bottom: 14px; font-size: clamp(40px, 7vw, 72px); }
.simple p { margin-bottom: 26px; }
.simple .eyebrow { margin-bottom: 14px; }

@media (max-width: 960px) {
  .beats { grid-template-columns: 1fr; }
  .dream-grid, .heroes-grid, .alpha-grid { grid-template-columns: 1fr; }
  .gallery .shot { grid-column: span 10; }
  .facts { grid-template-columns: 1fr 1fr; }
  .sprite { width: 128px; height: 128px; background-size: 1536px 128px; }
  @keyframes walk { to { background-position-x: -1536px; } }
}
@media (max-aspect-ratio: 3/2) {
  .hero-art img, .hero-plate img, .hero-fg img, .finale-art img { object-position: 74% 50%; }
}
@media (max-aspect-ratio: 1/1) {
  .hero-art img, .finale-art img { object-position: 50% 100%; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav { gap: 12px; }
  .nav-links { display: none; }
  .hero-content { align-self: start; padding-top: 12vh; }
  .hero .cta-row .btn { width: 100%; }
  .hero-meta span { display: none; }
  .hero-meta { display: grid; }
  .btn-ghost { backdrop-filter: none; }
  .facts { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .growth { height: auto; padding: 72px 0; }
  .growth-pin { position: static; height: auto; overflow: visible; }
  .growth-stage { display: grid; gap: 28px; }
  .growth-frame { position: static; }
  .growth-progress { display: none; }
  .hero-scroll { display: none; }
}
