/* ============================================================
   RITUAL DISORDER — landing page
   Occult brutalist minimalism. Bone on void, gold & blood.
   Palette, fonts and atmosphere inherited from the game's UI
   and the jam presentation; layout is new.
   ============================================================ */

/* ---- Fonts (self-hosted WOFF2) ---- */
@font-face { font-family: "Baron";      src: url("../fonts/Baron.woff2") format("woff2");       font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Spartan";    src: url("../fonts/Spartan-400.woff2") format("woff2"); font-weight: 400;     font-style: normal; font-display: swap; }
@font-face { font-family: "Spartan";    src: url("../fonts/Spartan-600.woff2") format("woff2"); font-weight: 600;     font-style: normal; font-display: swap; }
@font-face { font-family: "UbuntuMono"; src: url("../fonts/UbuntuMono.woff2") format("woff2");  font-weight: 400;     font-style: normal; font-display: swap; }

/* ---- Tokens ---- */
:root {
  --void: #060709;
  --void-deep: #040506;
  --panel: rgba(14, 15, 18, 0.90);
  --panel-solid: #0e0f12;
  --panel-hi: #16171c;

  --bone: #e2ddd0;
  --ash: #c6c0b0;
  --ash-dim: rgba(198, 192, 176, 0.55);

  --gold: #cda44a;
  --gold-hi: #e6c576;
  --blood: #d65240;
  --blood-deep: #780c0e;

  --line: rgba(198, 192, 176, 0.16);
  --line-hi: rgba(198, 192, 176, 0.34);

  --font-hero: "Baron", "Spartan", system-ui, sans-serif;
  --font-display: "Spartan", system-ui, sans-serif;
  --font-body: "Spartan", system-ui, sans-serif;
  --font-mono: "UbuntuMono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --mx: 50vw;
  --my: 50vh;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--void-deep);
  color: var(--bone);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }
::selection { background: rgba(214, 82, 64, 0.35); color: var(--bone); }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

/* custom cursor only where the candle is actually rendered (fine pointer, motion allowed) */
html.has-candle, html.has-candle a, html.has-candle button { cursor: none; }

/* ---- Atmosphere: grain + torch light following the cursor ---- */
.grain, .torch, .glow, .vignette { position: fixed; inset: 0; pointer-events: none; }
.vignette { z-index: 57; background: radial-gradient(120% 100% at 50% 0%, transparent 60%, rgba(4, 5, 6, 0.55) 100%); }
.torch {
  z-index: 58;
  background: radial-gradient(circle 760px at var(--mx) var(--my),
    transparent 0%, rgba(4, 5, 6, 0) 40%, rgba(4, 5, 6, 0.16) 78%, rgba(4, 5, 6, 0.26) 100%);
}
.glow { z-index: 59; mix-blend-mode: screen; background: radial-gradient(circle 240px at var(--mx) var(--my), rgba(205, 164, 74, 0.09), transparent 70%); }
.grain {
  z-index: 61; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.8'/></svg>");
  animation: grain-shift 0.6s steps(2) infinite;
}
@keyframes grain-shift { 0% { transform: translate(0, 0); } 50% { transform: translate(-4px, 3px); } 100% { transform: translate(2px, -2px); } }
/* the torch/glow only make sense with a pointer; without one they'd just darken the page */
html:not(.has-candle) .torch, html:not(.has-candle) .glow { display: none; }

/* candle cursor */
.candle {
  position: fixed; left: 0; top: 0; width: 14px; height: 20px; z-index: 90;
  transform: translate(-50%, -60%); pointer-events: none; will-change: transform;
  display: none;
}
html.has-candle .candle { display: block; }
.candle .flame {
  position: absolute; left: 50%; top: 0; width: 8px; height: 14px; transform: translateX(-50%);
  background: radial-gradient(50% 60% at 50% 65%, #fff6d8 0%, var(--gold-hi) 35%, var(--blood) 78%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; filter: blur(0.4px);
  animation: flicker 0.14s infinite alternate;
}
.candle .halo {
  position: absolute; left: 50%; top: 6px; width: 34px; height: 34px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(205, 164, 74, 0.5), transparent 70%);
}
@keyframes flicker {
  from { transform: translateX(-50%) scaleY(1) rotate(-2deg); opacity: 0.9; }
  to   { transform: translateX(-51%) scaleY(1.12) rotate(2deg); opacity: 1; }
}

/* ---- Layout ---- */
.wrap { width: min(92vw, var(--maxw)); margin-inline: auto; }
section { position: relative; padding: clamp(72px, 11vh, 140px) 0; }
.section-line { border-top: 1px solid var(--line); }

.kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.38em;
  text-transform: uppercase; color: var(--gold); opacity: 0.9;
  display: inline-flex; align-items: center; gap: 12px;
}
.kicker::before { content: ""; width: 34px; height: 1px; background: var(--gold); opacity: 0.6; }
h2.title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(28px, 4.6vw, 54px); line-height: 1.02;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--bone);
  margin: 20px 0 16px;
}
.lede { max-width: 58ch; color: var(--ash); font-size: clamp(15px, 1.35vw, 18px); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.06s; }
.reveal.d2 { transition-delay: 0.14s; }
.reveal.d3 { transition-delay: 0.22s; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100svh; min-height: 100vh;
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden;
  isolation: isolate;
}

/* key-art layers: poster underneath, GIF fades in on top once fully loaded */
.keyart { position: absolute; inset: 0; z-index: 0; background: radial-gradient(80% 70% at 70% 40%, #3a0f16 0%, #1a0a0d 45%, var(--void-deep) 100%); }  /* before the poster decodes: crimson, not a black hole */
.keyart picture, .keyart img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 78% 38%; }
.keyart picture, .keyart .keyart-anim { transform: scale(1.12); transform-origin: 80% 30%; }
.keyart-anim { opacity: 0; transition: opacity 1.4s var(--ease); }
.keyart.is-animated .keyart-anim { opacity: 1; }
/* reading shade: heavy on the left where the copy sits, open on the right where the jaws are */
.keyart-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 5, 6, 0.94) 0%, rgba(4, 5, 6, 0.78) 36%, rgba(4, 5, 6, 0.28) 66%, rgba(4, 5, 6, 0.18) 100%),
    linear-gradient(180deg, rgba(4, 5, 6, 0.62) 0%, rgba(4, 5, 6, 0) 28%, rgba(4, 5, 6, 0) 58%, rgba(4, 5, 6, 0.72) 84%, var(--void-deep) 100%),
    radial-gradient(42% 38% at 8% 96%, rgba(4, 5, 6, 0.98) 0%, rgba(4, 5, 6, 0.85) 50%, transparent 100%);
}
/* scanlines — the game renders at 640×360, the site should remember that */
.keyart-shade::after {
  content: ""; position: absolute; inset: 0; opacity: 0.35; mix-blend-mode: multiply;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px);
}

/* top bar */
.topbar {
  position: relative; z-index: 5;
  width: min(92vw, var(--maxw)); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 0;
}
.brand img { height: 44px; width: auto; opacity: 0.9; filter: drop-shadow(0 0 12px rgba(205, 164, 74, 0.25)); transition: opacity 0.3s; }
.brand:hover img { opacity: 1; }
.topnav { display: flex; gap: clamp(16px, 3vw, 34px); align-items: center; }
.topnav a {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ash); padding: 6px 0; position: relative; transition: color 0.3s;
}
.topnav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--gold); transition: right 0.4s var(--ease); }
.topnav a:hover, .topnav a:focus-visible { color: var(--gold-hi); text-shadow: 0 0 14px rgba(205, 164, 74, 0.3); }
.topnav a:hover::after { right: 0; }
.topnav .nav-steam { color: var(--gold); }

/* copy block */
.hero-inner {
  position: relative; z-index: 5; align-self: center;
  width: min(92vw, var(--maxw)); margin-inline: auto;
  padding: clamp(40px, 8vh, 90px) 0 clamp(40px, 8vh, 80px);
  max-width: min(92vw, 760px); margin-left: max(4vw, calc((100vw - var(--maxw)) / 2));
}
.hero-mark {
  font-family: var(--font-hero); font-weight: 900;
  font-size: clamp(54px, 11.5vw, 148px); line-height: 0.88;
  letter-spacing: 0.03em; text-transform: uppercase; color: var(--bone);
  text-shadow: 0 0 60px rgba(205, 164, 74, 0.14), 0 2px 0 rgba(0, 0, 0, 0.6);
  margin-top: clamp(14px, 2.4vh, 26px);
}
.hero-mark .word { display: block; }
.hero-mark .word + .word { color: var(--ash); }
.hero-pitch {
  margin-top: clamp(20px, 3.4vh, 34px); max-width: 46ch;
  font-size: clamp(16px, 1.55vw, 21px); line-height: 1.5; color: var(--ash);
}
.hero-pitch b { color: var(--bone); font-weight: 600; }
.hero-pitch b::after { content: ""; display: inline-block; width: 0.38em; height: 0.38em; margin-left: 0.32em; background: var(--blood); transform: rotate(45deg) translateY(-0.05em); box-shadow: 0 0 10px rgba(214, 82, 64, 0.6); }

/* buttons */
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(26px, 4.4vh, 44px); align-items: center; }
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 26px; border: 1px solid var(--gold);
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--bone);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn::before, .btn::after { content: ""; position: absolute; width: 8px; height: 8px; border: 1px solid var(--gold); transition: all 0.4s var(--ease); }
.btn::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.btn::after  { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.btn-steam { background: linear-gradient(180deg, rgba(205, 164, 74, 0.16), rgba(205, 164, 74, 0.04)); }
.btn-steam:hover { transform: translateY(-2px); box-shadow: 0 0 38px rgba(205, 164, 74, 0.22); background: linear-gradient(180deg, rgba(205, 164, 74, 0.26), rgba(205, 164, 74, 0.08)); }
.btn-steam:hover::before, .btn-steam:hover::after { width: 14px; height: 14px; }
.ico-steam { width: 20px; height: 20px; fill: var(--gold-hi); flex: none; }
.btn-soon {
  display: none; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3em;
  padding: 4px 8px 3px; border: 1px solid var(--blood); color: #f0786a; background: rgba(120, 12, 14, 0.35); margin-left: 2px; font-weight: 400;
}
/* "Soon" state — the store page isn't live yet. Looks intentional, does nothing on click. */
.btn-steam.is-soon { border-color: var(--line-hi); background: rgba(14, 15, 18, 0.6); cursor: not-allowed; }
.btn-steam.is-soon::before, .btn-steam.is-soon::after { border-color: var(--line-hi); }
.btn-steam.is-soon .ico-steam { fill: var(--ash-dim); }
.btn-steam.is-soon .btn-label { color: var(--ash); }
.btn-steam.is-soon .btn-soon { display: inline-block; }
.btn-steam.is-soon:hover { transform: none; box-shadow: 0 0 0 1px rgba(214, 82, 64, 0.25); }
html.has-candle .btn-steam.is-soon { cursor: none; }
.btn-ghost { border-color: var(--line-hi); color: var(--ash); }
.btn-ghost::before, .btn-ghost::after { border-color: var(--line-hi); }
.btn-ghost:hover { color: var(--bone); border-color: var(--gold); }
.btn-ghost:hover::before, .btn-ghost:hover::after { border-color: var(--gold); width: 14px; height: 14px; }

.hero-meta {
  margin-top: clamp(22px, 3.6vh, 36px); font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ash);
  display: flex; flex-wrap: wrap; gap: 0 12px; align-items: center;
}
.hero-meta .dot { color: var(--gold); opacity: 0.7; }

.scroll-cue {
  position: relative; z-index: 5; justify-self: center; margin-bottom: 22px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--ash-dim);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-cue .bar { width: 1px; height: 40px; background: linear-gradient(var(--gold), transparent); animation: cue 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ============================================================
   GALLERY
   ============================================================ */
.gallery { background: linear-gradient(180deg, var(--void-deep), var(--void) 30%, var(--void-deep)); }
.sec-head { margin-bottom: clamp(32px, 5vh, 56px); }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.shot a {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px solid var(--line); background: var(--void-deep);
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.shot a::before, .shot a::after {
  content: ""; position: absolute; z-index: 2; width: 18px; height: 18px; border: 1px solid var(--gold); opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.shot a::before { left: 8px; top: 8px; border-right: 0; border-bottom: 0; }
.shot a::after  { right: 8px; bottom: 8px; border-left: 0; border-top: 0; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease), filter 0.5s var(--ease); filter: saturate(0.92); }
.shot a:hover { border-color: var(--line-hi); transform: translateY(-3px); }
.shot a:hover::before, .shot a:hover::after { opacity: 0.8; }
.shot a:hover img { transform: scale(1.04); filter: saturate(1.05) contrast(1.04); }
.shot .cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 26px 14px 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ash);
  background: linear-gradient(180deg, transparent, rgba(4, 5, 6, 0.88));
  transform: translateY(6px); opacity: 0.85; transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}
.shot a:hover .cap { transform: none; opacity: 1; color: var(--bone); }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(4, 5, 6, 0.94); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lb-fig { max-width: min(94vw, 1400px); max-height: 92vh; display: grid; gap: 14px; justify-items: center; }
.lb-fig img { max-width: 94vw; max-height: 82vh; width: auto; height: auto; border: 1px solid var(--line-hi); box-shadow: 0 30px 120px rgba(0, 0, 0, 0.8); }
.lb-fig figcaption { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ash); text-align: center; padding: 0 20px; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; color: var(--ash); font-size: 44px; line-height: 1; padding: 10px 18px; transition: color 0.3s, transform 0.3s var(--ease);
}
.lb-close { top: 14px; right: 20px; font-size: 38px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: var(--gold); }
.lb-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lb-next:hover { transform: translateY(-50%) translateX(3px); }
body.lb-lock { overflow: hidden; }

/* ============================================================
   FOOTER
   ============================================================ */
.foot { padding: clamp(56px, 9vh, 100px) 0 34px; background: var(--void-deep); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
.foot-brand img { width: min(280px, 70vw); height: auto; opacity: 0.92; }
.foot-tag { margin-top: 18px; color: var(--ash-dim); font-size: 14px; max-width: 34ch; }
.foot-h { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
.social, .contacts { display: grid; gap: 9px; }
.social a, .contacts a {
  font-family: var(--font-display); font-size: 14px; letter-spacing: 0.04em; color: var(--ash);
  position: relative; padding-left: 16px; display: inline-block;
  transition: color 0.3s var(--ease), transform 0.4s var(--ease), text-shadow 0.4s var(--ease);
}
.social a::before, .contacts a::before {
  content: "◇"; position: absolute; left: 0; top: 0.3em; font-size: 9px; color: var(--gold); opacity: 0.7;
  transition: opacity 0.3s var(--ease), text-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}
/* hover: gold text, lit marker, a nudge to the right — ash→bone alone is invisible under the torch shade */
.social a:hover, .contacts a:hover, .social a:focus-visible, .contacts a:focus-visible {
  color: var(--gold-hi); transform: translateX(4px); text-shadow: 0 0 18px rgba(205, 164, 74, 0.35);
}
.social a:hover::before, .contacts a:hover::before { content: "◆"; opacity: 1; text-shadow: 0 0 10px rgba(205, 164, 74, 0.8); }
.contacts li { display: flex; gap: 10px; align-items: baseline; }
.contacts .lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ash-dim); min-width: 58px; }
.contacts a { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em; padding-left: 0; }
.contacts a::before { display: none; }
.contacts a:hover { transform: none; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(205, 164, 74, 0.6); }
.foot-legal {
  margin-top: clamp(36px, 6vh, 60px); padding-top: 18px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--ash-dim);
  display: flex; flex-wrap: wrap; gap: 6px 12px;
}
.foot-legal .sep { color: var(--gold); opacity: 0.6; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .shots { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .keyart picture, .keyart img { object-position: 66% 50%; }
}
@media (max-width: 640px) {
  .hero-inner { margin-left: auto; padding-top: 24px; }
  .btn { padding: 14px 18px; letter-spacing: 0.18em; font-size: 12px; }
  .cta-row { gap: 10px; }
  .hero-mark { font-size: clamp(52px, 17vw, 92px); }
  .topnav { gap: 14px; }
  .topnav a { font-size: 11px; letter-spacing: 0.2em; }
  .shots { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .keyart-shade {
    background:
      linear-gradient(180deg, rgba(4, 5, 6, 0.7) 0%, rgba(4, 5, 6, 0.55) 40%, rgba(4, 5, 6, 0.82) 78%, var(--void-deep) 100%);
  }
  .keyart picture, .keyart img { object-position: 64% 50%; }
  .lb-prev, .lb-next { font-size: 34px; padding: 8px 10px; }
}

/* ---- Motion preferences ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .scroll-cue .bar, .candle .flame { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .keyart-anim { transition: none; }
  .shot img, .shot a, .btn { transition: none; }
}
