/* Halation home: a fixed WebGL stage (the game's own frames with depth, drifting smog and halation bloom),
   chapters of a few words scrolled over it, a gallery strip, and a lamp-lit finale.
   Single dark theme on purpose: it is the game's world. */
:root {
  color-scheme: dark;
  --night: #0b0907;
  --smog: #17130f;
  --ink: #f1e7d8;
  --dim: #b4a690;
  --faint: rgba(241,231,216,.55);
  --lamp: #f2a54b;
  --lamp-hot: #ffdcae;
  --rust: #c8653a;
  --font: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --gutter: clamp(18px, 4.5vw, 72px);
  --ease: cubic-bezier(.2,.7,.1,1);
}
* { box-sizing: border-box; }
html { background: var(--night); overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; background: var(--night); color: var(--ink); font: 400 17px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
html.js.loading body { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; -webkit-user-drag: none; user-select: none; }
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
a { color: var(--lamp); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Loader: the letters light one by one, like lamps down a street, over a thin line ---------- */
.loader { position: fixed; inset: 0; z-index: 100; background: #050403; display: grid; place-items: center; overflow: hidden; --p: 0; }
html:not(.js) .loader { display: none; }
.loader-center { display: grid; justify-items: stretch; gap: clamp(22px, 3vh, 34px); width: max-content; max-width: 92vw; }
.loader-word { display: flex; justify-content: space-between; gap: .5em; font-weight: 800; font-variation-settings: "wdth" 125;
  font-size: clamp(30px, 5.2vw, 72px); line-height: 1; color: var(--ink); }
.loader-word span { opacity: .08; transition: opacity .7s var(--ease), color .7s; }
.loader-word span.lit { opacity: 1; animation: lamp .5s steps(1); }
@keyframes lamp { 0% { opacity: .8; } 20% { opacity: .2; } 40% { opacity: 1; } 60% { opacity: .5; } 100% { opacity: 1; } }
.loader-bar { position: relative; height: 1px; background: rgba(241,231,216,.1); overflow: hidden; }
.loader-bar i { position: absolute; inset: 0; background: var(--lamp); transform-origin: left; transform: scaleX(var(--p)); }
.loader-pct { justify-self: end; font: 500 clamp(12px, 1vw, 14px)/1 var(--font); letter-spacing: .3em; margin-right: -.3em; color: rgba(241,231,216,.55); font-variant-numeric: tabular-nums; }
/* Out: the word opens up and dissolves while the screen lifts to the scene. */
.loader.out { pointer-events: none; transition: opacity 1.1s var(--ease) .45s; opacity: 0; }
.loader.out .loader-word { gap: 1.1em; filter: blur(10px); opacity: 0; }
.loader.out .loader-word { transition: gap 1.4s var(--ease), filter 1.2s var(--ease), opacity 1.2s var(--ease); }
.loader.out .loader-bar, .loader.out .loader-pct { transition: opacity .4s; opacity: 0; }

/* ---------- Stage, grain, cursor ---------- */
.stage { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; display: block; background: var(--night); }
.stage.fallback { background-size: cover; background-position: center; transition: background-image .6s; }
.grain { position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  animation: grain 1s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-1%); } 80% { transform: translate(3%,3%); } 100% { transform: translate(0,0); } }
.cursor { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; width: 0; height: 0; opacity: 0; transition: opacity .4s; }
.cursor span { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: #fff3dc; border: 1px solid rgba(11,9,7,.6);
  box-shadow: 0 0 12px 3px rgba(255,200,130,.55), 0 0 40px 14px rgba(242,165,75,.18);
  transition: transform .35s var(--ease), background .35s, border-color .35s, box-shadow .35s; }
.cursor.big span { transform: scale(3.4); background: transparent; border: 1px solid rgba(255,243,220,.95); box-shadow: 0 0 0 1px rgba(11,9,7,.45), 0 0 18px rgba(242,165,75,.35); }
html.dialog-open .cursor { opacity: 0 !important; }
html.dialog-open, html.dialog-open * { cursor: auto !important; }
html.dialog-open a, html.dialog-open button { cursor: pointer !important; }
html.dialog-open input { cursor: text !important; }
html.has-cursor .cursor { opacity: 1; }
html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor .track { cursor: none; }
html.has-cursor input { cursor: text; }

/* ---------- Bottom chrome ---------- */
.chrome { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-inline: var(--gutter); padding-block: 0 calc(18px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.chrome > * { pointer-events: auto; }
.sound { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: -12px; background: none; border: 0; color: var(--faint); padding: 0; }
.sound:hover, .sound[aria-pressed="true"] { color: var(--ink); }
.bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.bars i { width: 2px; height: 5px; background: currentColor; border-radius: 1px; transition: height .3s; }
.sound[aria-pressed="true"] .bars i { animation: bar 1.1s ease-in-out infinite; }
.sound[aria-pressed="true"] .bars i:nth-child(2) { animation-delay: -.3s; } .sound[aria-pressed="true"] .bars i:nth-child(3) { animation-delay: -.6s; } .sound[aria-pressed="true"] .bars i:nth-child(4) { animation-delay: -.9s; }
@keyframes bar { 0%, 100% { height: 3px; } 50% { height: 14px; } }
.progress { flex: 0 1 180px; height: 1px; background: rgba(241,231,216,.15); position: relative; overflow: hidden; }
.progress i { position: absolute; inset: 0; background: var(--lamp); transform-origin: left; transform: scaleX(0); }
.cta-pill { display: inline-flex; align-items: center; height: 38px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(242,165,75,.55);
  color: var(--ink); text-decoration: none; font: 600 11px var(--font); letter-spacing: .22em; text-transform: uppercase; backdrop-filter: blur(8px);
  background: rgba(11,9,7,.35); transition: background .4s, box-shadow .4s, color .4s; }
.cta-pill:hover { background: var(--lamp); color: var(--night); box-shadow: 0 0 30px rgba(242,165,75,.5); }
@media (max-width: 600px) { .progress { display: none; } }

/* ---------- Chapters ---------- */
main { position: relative; z-index: 10; }
.ch { position: relative; min-height: 190vh; }
.ch .sticky { overflow: clip; position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; padding-inline: var(--gutter); }
.line { position: relative; align-self: end; padding-block: 0 clamp(96px, 16vh, 170px); max-width: 640px; }
.line::before { content: ""; position: absolute; inset: -30% -40%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(8,6,4,.62), rgba(8,6,4,.28) 55%, transparent); }
.line.left { justify-self: start; }
.line.right { justify-self: end; text-align: right; }
.line.center { justify-self: center; text-align: center; align-self: center; padding: 0; }
.ch h2 { margin: 0; font-weight: 800; font-variation-settings: "wdth" 118; text-transform: uppercase; letter-spacing: .02em;
  font-size: clamp(38px, 6.4vw, 92px); line-height: .95; text-wrap: balance; text-shadow: 0 2px 40px rgba(0,0,0,.65); }
.ch p { margin: 18px 0 0; color: #d6c8b2; font-size: clamp(15px, 1.3vw, 18px); text-shadow: 0 1px 14px rgba(0,0,0,.8); }
.line.right p { margin-left: auto; } .line p { max-width: 34ch; }
.line.center p { margin-inline: auto; }
.hint { font-size: 11px !important; letter-spacing: .3em; text-transform: uppercase; color: var(--lamp) !important; }
.hint-touch { display: none; }
@media (hover: none) { .hint-mouse { display: none; } .hint-touch { display: inline; } }

/* Hero */
.hero { min-height: 140vh; }
.hero .ch-inner { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-content: end; justify-items: center; text-align: center;
  padding-inline: var(--gutter); padding-block: 0 clamp(110px, 19vh, 200px); }
.wordmark { margin: 0; font-weight: 800; font-variation-settings: "wdth" 125; text-transform: uppercase;
  font-size: clamp(30px, 8vw, 150px); letter-spacing: .32em; margin-right: -.32em; line-height: .9; white-space: nowrap;
  text-shadow: 0 0 60px rgba(242,165,75,.35), 0 0 3px rgba(255,220,174,.4); }
.tag { margin: 22px 0 0; font-weight: 500; font-size: clamp(12px, 1.1vw, 14px); letter-spacing: .45em; margin-right: -.45em; text-transform: uppercase; color: var(--lamp-hot); }
.scroll-cue { position: absolute; left: 50%; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; justify-items: center; gap: 10px;
  font: 600 10px var(--font); letter-spacing: .32em; text-transform: uppercase; color: var(--faint); }
.scroll-cue i { width: 1px; height: 38px; background: linear-gradient(var(--lamp), transparent); animation: cue 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.ns { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }

/* Hero calls to action: everything a visitor needs on the first screen. */
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; justify-content: inherit; }
.btn-steam, .btn-ghost { display: inline-flex; align-items: center; gap: 12px; height: 54px; padding: 0 26px; border-radius: 4px; text-decoration: none;
  font: 700 12px var(--font); letter-spacing: .2em; text-transform: uppercase; transition: background .35s, box-shadow .35s, color .35s, border-color .35s; }
.btn-steam { color: var(--night); background: var(--lamp); box-shadow: 0 0 0 rgba(242,165,75,0); }
.btn-steam:hover { background: var(--lamp-hot); box-shadow: 0 0 44px 4px rgba(242,165,75,.45); }
.steam-ico { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn-ghost { color: var(--ink); border: 1px solid rgba(241,231,216,.35); background: rgba(11,9,7,.35); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--lamp); color: var(--lamp-hot); }
.platforms { margin: 16px 0 0; font: 600 10px var(--font); letter-spacing: .3em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 899px) { .hero-cta { justify-content: center; } .btn-steam, .btn-ghost { flex: 1 1 220px; justify-content: center; } }
.cta-pill { transition: opacity .5s, background .4s, box-shadow .4s, color .4s; }
html.at-hero .cta-pill { opacity: 0; pointer-events: none; }

/* Notify panel (until the Steam page exists) */
.notify { position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100vh - 32px); overflow: auto; width: min(92vw, 520px); max-width: calc(100vw - 32px); border: 1px solid rgba(242,165,75,.35); border-radius: 6px; padding: 40px 32px 30px; color: var(--ink); text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(242,165,75,.16), transparent 60%), #120e0b; box-shadow: 0 40px 120px rgba(0,0,0,.7); }
.notify::backdrop { background: rgba(5,4,3,.75); backdrop-filter: blur(8px); }
.notify h2 { margin: 0; font-weight: 800; font-variation-settings: "wdth" 115; text-transform: uppercase; letter-spacing: .04em; font-size: clamp(22px, 3vw, 30px); line-height: 1.1; }
.notify p { margin: 10px auto 0; color: var(--dim); max-width: 36ch; }
.notify .signup { margin-top: 24px; width: 100%; }
.notify-close-form { position: absolute; top: 10px; right: 10px; margin: 0; }
.notify-close { background: none; border: 0; color: var(--faint); font: 600 10px var(--font); letter-spacing: .24em; text-transform: uppercase; padding: 10px; }
.notify-close:hover { color: var(--ink); }

/* Desktop: the title sits in the dark sea to the right of the lamp and Scrappy. */
@media (min-width: 900px) {
  .hero .ch-inner { align-content: center; justify-items: end; text-align: right; padding-block: 4vh 0; }
  .hero .hero-cta { justify-content: flex-end; }
  .hero .wordmark { font-size: clamp(48px, 5.6vw, 108px); letter-spacing: .34em; margin-right: -.34em; }
  .hero .tag { margin-right: -.45em; }
}

/* Split-text reveal (JS adds .w / .c spans) */
html.js [data-split] .w, html.js [data-split] .c { display: inline-block; will-change: transform, opacity, filter; }
html.js [data-split] .w { margin-right: .22em; } html.js [data-split] .w:last-child { margin-right: 0; }

/* ---------- Gallery ---------- */
.gallery { position: relative; z-index: 12; background: linear-gradient(180deg, transparent, var(--night) 16%, var(--night) 90%, rgba(11,9,7,.6) 97%, transparent); padding-block: 24vh 30vh; }
@media (max-width: 700px) { .gallery { padding-block: 14vh 16vh; } .shot { width: 86vw; } }
.gallery-head { display: flex; justify-content: flex-start; align-items: baseline; gap: 16px; padding-inline: var(--gutter); margin-bottom: 28px; }
.gallery-head h2 { margin: 0; font-weight: 800; font-variation-settings: "wdth" 125; letter-spacing: .3em; text-transform: uppercase; font-size: 13px; color: var(--lamp); }
.gallery-head p { margin: 0; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--faint); }
.track { display: flex; gap: clamp(12px, 1.6vw, 22px); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding-inline: var(--gutter); padding-block: 6px 20px;
  scrollbar-width: none; }
.track::-webkit-scrollbar { display: none; }
.shot { flex: 0 0 auto; width: min(78vw, 860px); aspect-ratio: 16 / 9; padding: 0; border: 0; background: var(--smog); border-radius: 3px; overflow: hidden; scroll-snap-align: center; position: relative; }
.shot img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.4s var(--ease), filter 1s; filter: brightness(.82) saturate(.95); }
.shot:hover img, .shot:focus-visible img { transform: scale(1); filter: brightness(1.05); }
.shot::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 120px rgba(0,0,0,.55); pointer-events: none; }

/* ---------- Finale ---------- */
.finale { min-height: 170vh; }
.signup { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: min(92vw, 500px); margin: 34px auto 0; }
.signup input { flex: 1 1 230px; min-width: 0; height: 54px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(241,231,216,.28);
  background: rgba(11,9,7,.55); color: var(--ink); font: inherit; backdrop-filter: blur(10px); }
.signup input::placeholder { color: rgba(241,231,216,.45); }
.signup button { height: 54px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer; font: 700 12px var(--font); letter-spacing: .22em; text-transform: uppercase;
  color: var(--night); background: var(--lamp); transition: box-shadow .4s, background .4s; }
.signup button:hover { background: var(--lamp-hot); box-shadow: 0 0 40px 4px rgba(242,165,75,.5); }
.signup button[disabled] { opacity: .6; }
.form-note:empty { display: none; }
.form-note { flex-basis: 100%; margin: 4px 0 0 !important; font-size: 13px !important; color: var(--dim); text-align: center; }
.form-note.ok { color: var(--lamp-hot); } .form-note.err { color: #ff9f80; }

/* ---------- Footer ---------- */
.foot { position: relative; z-index: 12; background: var(--night); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px;
  padding-inline: var(--gutter); padding-block: 34px calc(84px + env(safe-area-inset-bottom, 0px)); color: var(--dim); font-size: 13px; border-top: 1px solid rgba(241,231,216,.08); }
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.foot a { color: var(--ink); text-decoration: none; padding-block: 6px; }
.foot a:hover { color: var(--lamp); }

/* ---------- Lightbox ---------- */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(5,4,3,.92); backdrop-filter: blur(6px); }
.lightbox img { position: absolute; inset: 0; margin: auto; max-width: min(94vw, 1600px); max-height: 88vh; width: auto; height: auto; border-radius: 3px; box-shadow: 0 40px 120px rgba(0,0,0,.7); }
.lb-edge { position: absolute; top: 0; bottom: 0; width: 18vw; border: 0; background: none; color: var(--ink); opacity: .45; transition: opacity .3s; }
.lb-edge:hover { opacity: 1; }
.lb-edge.prev { left: 0; } .lb-edge.next { right: 0; }
.lb-edge::before { content: ""; position: absolute; top: 50%; width: 18px; height: 18px; border-top: 1px solid currentColor; border-left: 1px solid currentColor; }
.lb-edge.prev::before { left: 32px; transform: translateY(-50%) rotate(-45deg); }
.lb-edge.next::before { right: 32px; transform: translateY(-50%) rotate(135deg); }

@media (prefers-reduced-motion: reduce) {
  .grain, .scroll-cue i, .loader .filament { animation: none; }
  .shot img { transition: none; }
}
