/* ───────── Tokens ───────── */
:root {
  --cream: #fff6e8;
  --cream-2: #ffeccf;
  --ink: #2b1a10;
  --ink-soft: #6b5040;
  --cookie: #e8a95b;
  --coral: #ff7a6b;
  --mint: #8fd9b6;
  --butter: #ffd66b;

  --night: #0c0f1d;
  --night-2: #151a30;
  --gold: #e9c67a;
  --gold-deep: #b8873b;
  --ichor: #c8322a;
  --parchment: #efe6d4;

  /* 0 = light (cream) … 1 = dark (night); driven by scroll in main.js */
  --cocoa: #5a3526;
  --dark: 0;     /* background blend: cream → cocoa → night */
  --dark-a: 0;   /* first half (cream → cocoa) */
  --dark-b: 0;   /* second half (cocoa → night) */
  --dark-fg: 0;  /* text blend: flips over a shorter window so text stays readable */
  --bg: color-mix(in oklab, var(--night) calc(var(--dark-b) * 100%),
          color-mix(in oklab, var(--cocoa) calc(var(--dark-a) * 100%), var(--cream)));
  --fg: color-mix(in oklab, var(--parchment) calc(var(--dark-fg) * 100%), var(--ink));
  --fg-soft: color-mix(in oklab, #b9b2a3 calc(var(--dark-fg) * 100%), var(--ink-soft));

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --radius: 22px;
  --gutter: clamp(16px, 5vw, 64px);

  --font-brand: "Plus Jakarta Sans", var(--font-body);
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-myth: "Cinzel", Georgia, serif;
}


@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--butter); color: var(--ink); }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--cream);
  text-decoration: none; transition: top .2s;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 8px; }

.eyebrow {
  margin: 0 0 14px;
  font: 700 12px/1 var(--font-body);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.eyebrow.gold { color: var(--gold); }

/* ───────── Nav ───────── */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  transition: backdrop-filter .5s, box-shadow .5s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--fg) 8%, transparent);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--fg);
}
.brand-mark {
  width: 34px; height: 34px;
  filter: drop-shadow(0 3px 4px rgb(90 45 15 / .25));
  transition: transform .6s var(--ease-spring);
}
.brand:hover .brand-mark { transform: rotate(-18deg); }
.brand-word {
  display: flex; align-items: baseline; gap: 6px;
  font: 800 22px/1 "Plus Jakarta Sans", var(--font-body); letter-spacing: -.045em;
}
.brand-word b {
  font-weight: 700; letter-spacing: -.03em; color: var(--coral);
}
.nav nav { display: flex; gap: 6px; }
.nav nav a {
  padding: 8px 14px; border-radius: 999px; text-decoration: none;
  font-weight: 500; font-size: 15px; transition: background-color .25s;
}
.nav nav a:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }

/* ───────── Hero ───────── */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 110px var(--gutter) 96px; text-align: center;
}

.lockup {
  display: inline-flex; align-items: center; gap: clamp(14px, 2.6vw, 40px);
  margin: 0 0 clamp(48px, 6.5vw, 88px);
}
.emblem-stage { position: relative; flex: none; width: clamp(104px, 17vw, 250px); aspect-ratio: 1; }
.glow {
  position: absolute; inset: -22%;
  background: radial-gradient(circle, rgb(255 214 107 / .55), rgb(255 122 107 / .12) 45%, transparent 68%);
  animation: fade-in 1.6s var(--ease-out) .2s both, breathe 7s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.08); opacity: .8; } }
.emblem {
  position: absolute; inset: 0; padding: 0; border: 0; background: none; cursor: pointer;
  translate: var(--px, 0) var(--py, 0); transition: translate .6s var(--ease-out);
  animation: emblem-in 1.3s var(--ease-spring) .15s both;
  -webkit-tap-highlight-color: transparent;
}
.emblem img {
  width: 100%; height: 100%;
  filter: drop-shadow(0 22px 26px rgb(90 45 15 / .25));
  animation: hover 6s ease-in-out infinite;
}
.emblem.spin img { animation: spin 1s var(--ease-spring), hover 6s ease-in-out 1s infinite; }
@keyframes emblem-in { from { opacity: 0; transform: scale(.4) rotate(-160deg); } }
@keyframes hover { 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes spin { from { transform: rotate(-360deg) scale(.9); } }
@keyframes fade-in { from { opacity: 0; } }

.float-bit {
  position: absolute; z-index: 1;
  translate: var(--px, 0) var(--py, 0); transition: translate .8s var(--ease-out);
  filter: drop-shadow(0 10px 12px rgb(90 45 15 / .2));
  animation: bit-in 1s var(--ease-spring) both, drift 7s ease-in-out infinite;
}
.b1 { top: -14%; left: -12%; width: 26%; animation-delay: .9s, 0s; }
.b2 { bottom: -4%; left: -20%; width: 17%; animation-delay: 1s, -2.5s; }
.b3 { bottom: -16%; right: 6%; width: 15%; animation-delay: 1.1s, -4.5s; }
@keyframes bit-in { from { opacity: 0; transform: scale(0); } }
@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-12px) rotate(10deg); }
}

.wordmark { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.wm-name {
  font: 800 clamp(58px, 12.5vw, 184px)/.78 var(--font-display);
  letter-spacing: -.06em; color: var(--ink);
  padding-bottom: .06em;
}
.wm-games {
  align-self: flex-end; margin: .22em .06em 0 0;
  font: 700 clamp(20px, 4.25vw, 62px)/1 var(--font-display);
  letter-spacing: -.03em; color: var(--coral);
  animation: track-in 1.2s var(--ease-out) .75s both;
}
@keyframes track-in { from { opacity: 0; transform: translateY(-10px); filter: blur(6px); } }

.headline {
  margin: 0 0 14px;
  font: 700 clamp(30px, 4.6vw, 62px)/1.05 var(--font-display);
  letter-spacing: -.04em;
}
.headline .accent { color: var(--coral); }
.word { display: inline-block; white-space: nowrap; }
[data-split] .ch {
  display: inline-block; opacity: 0;
  transform: translateY(.45em); filter: blur(10px);
  animation: letter-in .9s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 45ms + var(--base, .35s));
}
.headline [data-split] { --base: 1s; }
.headline .accent { --base: 1.4s; }
@keyframes letter-in { to { opacity: 1; transform: none; filter: none; } }

.lede {
  max-width: 34ch; margin: 0; font-size: clamp(17px, 1.5vw, 20px); color: var(--fg-soft);
  animation: rise 1s var(--ease-out) 1.6s both;
}
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }

.crumb {
  position: absolute; width: 10px; height: 10px; border-radius: 40%;
  background: var(--c, var(--cookie)); pointer-events: none; z-index: 2;
  animation: burst .9s var(--ease-out) forwards;
}
@keyframes burst {
  to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; }
}

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; translate: -50% 0;
  width: 26px; height: 42px; border: 2px solid color-mix(in srgb, var(--fg) 30%, transparent);
  border-radius: 999px; animation: fade-in 1s 2s both;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 4px; background: var(--fg); animation: cue 1.8s var(--ease-out) infinite;
}
@keyframes cue { 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ───────── Reveal ───────── */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ───────── Godsblood ───────── */
.games {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(100px, 13vw, 170px) var(--gutter) clamp(70px, 8vw, 110px);
  color: var(--parchment);
}
.gb-ambient {
  position: absolute; inset: -10%; z-index: -2;
  background: url("assets/splash.webp") center / cover;
  filter: blur(70px) saturate(1.3); opacity: calc(var(--dark) * .38);
}
.games::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 50% 45%, transparent 30%, var(--bg) 80%);
}
.embers { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }

.gb-inner { max-width: 1080px; margin: 0 auto; text-align: center; }
.gb-logo { margin: 0 auto; width: min(100%, 560px); }
.gb-logo img { width: 100%; filter: drop-shadow(0 10px 30px rgb(200 50 42 / .35)); }
.gb-tag {
  margin: 10px auto 0; max-width: 34ch;
  font: 500 clamp(17px, 2vw, 22px)/1.4 var(--font-myth); letter-spacing: .04em; color: var(--gold);
}

.device-wrap { position: relative; margin: clamp(40px, 6vw, 72px) auto 0; width: min(100%, 900px); perspective: 1400px; }
.device {
  position: relative;
  padding: clamp(8px, 1.4vw, 14px);
  border-radius: clamp(26px, 4.4vw, 52px);
  background: linear-gradient(145deg, #3a3f52, #12141d 40%, #2a2e3d);
  box-shadow:
    inset 0 0 0 1.5px rgb(255 255 255 / .12),
    inset 0 0 0 4px #07080d,
    0 40px 90px -20px rgb(0 0 0 / .7),
    0 0 120px -30px rgb(200 50 42 / .5);
  transform: rotateX(var(--rx, 8deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .8s var(--ease-out);
}
.screen {
  position: relative; overflow: hidden; aspect-ratio: 19.5 / 9;
  border-radius: clamp(18px, 3.2vw, 40px); background: #000;
}
.screen img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%;
  transform-origin: 50% 30%;
  animation: kenburns 22s ease-in-out infinite alternate;
}
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.08) translate(-1%, .5%); } }
.glare {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgb(255 255 255 / .14) 48%, transparent 60%);
  transform: translateX(var(--gx, -30%)); transition: transform .8s var(--ease-out);
}
.notch {
  position: absolute; left: clamp(14px, 2.4vw, 26px); top: 50%; translate: 0 -50%;
  width: clamp(6px, .9vw, 10px); height: clamp(40px, 7vw, 70px);
  border-radius: 999px; background: #05060a;
}
.device-shadow {
  position: absolute; left: 10%; right: 10%; bottom: -46px; height: 40px;
  background: radial-gradient(ellipse, rgb(0 0 0 / .6), transparent 70%); filter: blur(10px);
}

.gb-info {
  display: flex; gap: 22px; align-items: center; text-align: left;
  max-width: 760px; margin: clamp(64px, 8vw, 96px) auto 0;
}
.gb-icon {
  flex: none; width: 96px; height: 96px; border-radius: 24px;
  box-shadow: 0 0 0 1px rgb(233 198 122 / .35), 0 16px 40px -10px rgb(0 0 0 / .8);
}
.gb-meta p { margin: 0 0 18px; color: #cfc6b4; }
.gb-meta em { color: var(--parchment); }

.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 20px 10px 16px; min-height: 54px;
  border-radius: 14px; background: #000; color: #fff; text-decoration: none;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .22);
  transition: transform .35s var(--ease-spring), box-shadow .35s;
}
.store:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--gold), 0 12px 30px -8px rgb(233 198 122 / .45); }
.store:active { transform: scale(.97); }
.store svg { width: 24px; height: 28px; }
.store span { display: flex; flex-direction: column; font: 600 19px/1.05 var(--font-body); letter-spacing: -.01em; }
.store small { font-size: 11px; font-weight: 500; letter-spacing: .02em; opacity: .85; }
.store i {
  position: absolute; top: -9px; right: -8px;
  padding: 3px 8px; border-radius: 999px;
  background: var(--gold); color: var(--night);
  font: 700 10px/1.2 var(--font-body); font-style: normal; letter-spacing: .08em; text-transform: uppercase;
}

/* ───────── Contact ───────── */
.contact {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(110px, 14vw, 170px) var(--gutter) clamp(190px, 22vw, 260px);
}
.contact-title {
  max-width: 16ch; margin: 0 auto 32px;
  font: 700 clamp(34px, 5vw, 60px)/1.02 var(--font-display); letter-spacing: -.03em;
}
.mail-row { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.mail {
  position: relative; text-decoration: none;
  font: 600 clamp(22px, 3.4vw, 38px)/1.2 var(--font-display); letter-spacing: -.01em; color: var(--coral);
}
.mail::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; border-radius: 4px;
  background: currentColor; transform: scaleX(.18); transform-origin: left;
  transition: transform .6s var(--ease-spring);
}
.mail:hover::after { transform: scaleX(1); }
.copy {
  padding: 9px 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--cream); font: 600 14px/1 var(--font-body);
  transition: transform .3s var(--ease-spring), background-color .3s;
}
.copy:hover { transform: rotate(-4deg) scale(1.06); background: var(--coral); }
.peek {
  position: absolute; left: 50%; bottom: 0; width: clamp(150px, 18vw, 210px);
  translate: -50% 42%; rotate: -12deg;
  transition: translate 1s var(--ease-out), rotate 1s var(--ease-out);
}
.contact.in-view .peek { translate: -50% 22%; }
.peek:hover {
  translate: -50% 10%; rotate: 8deg;
  transition: translate .6s var(--ease-spring), rotate .6s var(--ease-spring);
}

/* ───────── Footer ───────── */
.footer {
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between;
  padding: 26px var(--gutter);
  font-size: 14px; color: var(--fg-soft);
  border-top: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
}
.footer p { margin: 0; }
.footer nav { display: flex; gap: 20px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }

/* ───────── Toast ───────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80;
  padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: var(--cream); font-weight: 500; font-size: 15px;
  box-shadow: 0 14px 40px -10px rgb(0 0 0 / .5);
  translate: -50% 140%; opacity: 0; pointer-events: none;
  transition: translate .5s var(--ease-spring), opacity .3s;
}
body[data-scene="dark"] .toast { background: var(--gold); color: var(--night); }
.toast.show { translate: -50% 0; opacity: 1; }

/* ───────── Legal pages ───────── */
.doc {
  max-width: 720px; margin: 0 auto;
  padding: 120px var(--gutter) 80px;
}
.doc h1 { margin: 0 0 6px; font: 700 clamp(40px, 7vw, 64px)/1 var(--font-display); letter-spacing: -.03em; }
.doc .updated { margin: 0 0 40px; color: var(--fg-soft); font-size: 15px; }
.doc h2 { margin: 44px 0 10px; font: 600 23px/1.25 var(--font-display); }
.doc h3 { margin: 26px 0 6px; font: 600 18px/1.3 var(--font-body); }
.doc p, .doc li { color: color-mix(in srgb, var(--fg) 88%, transparent); }
.doc ul, .doc ol { padding-left: 1.2em; }
.doc .todo { background: #ffe27a; color: var(--ink); padding: 0 .25em; border-radius: 4px; font-weight: 600; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--coral); }
.doc a { color: var(--coral); text-underline-offset: 3px; }
.doc .card {
  margin: 28px 0; padding: 22px 24px; border-radius: var(--radius);
  background: var(--cream-2);
}
.doc .card p { margin: 0; }
.doc details {
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
  padding: 16px 0;
}
.doc summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: "+"; font: 600 22px/1 var(--font-display); color: var(--coral); transition: transform .3s var(--ease-spring); }
.doc details[open] summary::after { transform: rotate(45deg); }
.doc details p { margin: 10px 0 0; }
.doc-enter { animation: doc-in .8s var(--ease-out) both; }
@keyframes doc-in { from { opacity: 0; transform: translateY(20px); } }

/* ───────── Responsive ───────── */
@media (max-width: 860px) {
  .scroll-cue { display: none; }
  .gb-info { flex-direction: column; text-align: center; }
  .stores { justify-content: center; }
}
@media (max-width: 560px) {
  .lockup { flex-direction: column; gap: 22px; }
  .emblem-stage { width: min(46vw, 190px); }
  .wm-name { font-size: min(24vw, 104px); }
  .wm-games { font-size: min(8.2vw, 35px); }
}
@media (max-width: 480px) {
  .nav nav a { padding: 8px 10px; }
  .footer { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .reveal, [data-split] .ch { opacity: 1; transform: none; filter: none; }
}
