/* backlitgame.com. Colours and type follow the game's own tokens
   (src/design/tokens.css): dark ink, paper text, sodium-lamp amber. */

@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Variable';
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink-0: #09090b;
  --ink-1: #101013;
  --ink-2: #17171b;
  --ink-3: #202026;
  --line: rgba(255, 244, 230, 0.09);
  --line-strong: rgba(255, 244, 230, 0.16);
  --paper: #efe9df;
  --paper-2: #c9c2b7;
  --muted: #8e877d;
  --sodium: #f0b35a;
  --sodium-deep: #c98a34;
  --sodium-glow: rgba(240, 179, 90, 0.22);
  --signal: #e5484d;

  --font-display: 'Instrument Serif', 'Iowan Old Style', 'Times New Roman', serif;
  --font-ui: 'Inter Variable', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --gutter: 16px;
  --max: 1160px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--paper);
  font: 400 16px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--sodium); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.08; margin: 0; letter-spacing: -0.005em; }
em { font-style: italic; color: var(--sodium); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-left)); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--paper); color: var(--ink-0); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* Launch switch: <html data-launch="coming-soon|early-access|live">, from launch.json.
   when-soon: coming soon only; when-open: early access or live; when-early, when-live: that stage only. */
[data-launch='coming-soon'] :is(.when-open, .when-early, .when-live) { display: none !important; }
[data-launch='early-access'] :is(.when-soon, .when-live) { display: none !important; }
[data-launch='live'] :is(.when-soon, .when-early) { display: none !important; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(9, 9, 11, 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 20px; height: 60px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; font-family: var(--font-display); font-size: 22px; letter-spacing: 0.28em; }
.wordmark .mark { width: 13px; height: 20px; color: var(--sodium); filter: drop-shadow(0 0 6px var(--sodium-glow)); }
.nav { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.nav a { color: var(--paper-2); text-decoration: none; }
.nav a:hover { color: var(--paper); }
@media (max-width: 640px) { .nav { display: none; } .top-in > .btn, .top-in > .pill { margin-left: auto; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  background: var(--sodium); color: #1a1206; font-weight: 600; font-size: 16px;
  text-decoration: none; border: 1px solid transparent;
  box-shadow: 0 0 0 0 var(--sodium-glow), 0 8px 30px -8px var(--sodium-glow);
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: #f6c579; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--paper); border-color: var(--line-strong); box-shadow: none; }
.btn-ghost:hover { background: rgba(255, 244, 230, 0.06); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.pill { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sodium); border: 1px solid rgba(240, 179, 90, 0.35); padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--sodium); outline-offset: 3px; }

.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sodium); margin-bottom: 14px; }

/* Hero */
.hero { position: relative; padding: 48px 0 40px; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 55% at 72% 42%, rgba(240, 179, 90, 0.16), transparent 70%),
    radial-gradient(40% 40% at 10% 0%, rgba(143, 179, 255, 0.06), transparent 70%),
    var(--ink-0);
}
.hero-in { display: grid; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(44px, 11vw, 92px); margin-bottom: 20px; }
.hero h1 em { display: inline-block; }
.lead { font-size: clamp(17px, 2.2vw, 19px); color: var(--paper-2); max-width: 34em; }
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 28px; }
.soon { display: inline-flex; align-items: center; gap: 10px; color: var(--paper); font-size: 15px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sodium); box-shadow: 0 0 0 4px var(--sodium-glow); animation: pulse 2.4s ease-in-out infinite; flex: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(240, 179, 90, 0.06); } }
.platforms { margin-top: 14px; color: var(--muted); font-size: 14px; }
.hero-phone { display: flex; justify-content: center; }

.phone {
  position: relative; width: 100%; max-width: 300px; aspect-ratio: 585 / 1266;
  border-radius: 44px; padding: 9px; background: #050506;
  border: 1px solid rgba(255, 244, 230, 0.14);
  box-shadow: 0 0 0 1px #000, 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 90px -20px var(--sodium-glow);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 36px; }
.phone-lg { max-width: 320px; transform: rotate(-3deg); }

.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--paper-2); font-size: 14px; }
.facts strong { color: var(--paper); font-weight: 600; }

@media (min-width: 900px) {
  .hero { padding: 72px 0 48px; }
  .hero-in { grid-template-columns: 1.25fr 1fr; gap: 48px; }
  .phone-lg { max-width: 340px; }
}

/* Sections */
.section { padding: 72px 0; }
.section h2 { font-size: clamp(34px, 6.4vw, 60px); margin-bottom: 20px; }
.intro { color: var(--paper-2); font-size: 17px; max-width: 38em; }

.trailer { background: linear-gradient(var(--ink-0), var(--ink-1)); }
.video { margin-top: 28px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #000; aspect-ratio: 16 / 9; box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9), 0 0 120px -40px var(--sodium-glow); }
.video video { width: 100%; height: 100%; }
/* On a phone held upright the same trailer plays in its portrait cut (site.js swaps the source before anything loads). */
.video.portrait { aspect-ratio: 9 / 16; max-width: 360px; margin-left: auto; margin-right: auto; }

.how { background: var(--ink-1); }
.beats { margin-top: 48px; display: grid; gap: 64px; counter-reset: beat; }
.beat { display: grid; gap: 28px; align-items: center; }
.beat .phone { max-width: 260px; margin: 0 auto; }
.num { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.beat h3 { font-size: clamp(30px, 5vw, 44px); margin-bottom: 14px; }
.beat p { color: var(--paper-2); font-size: 17px; max-width: 30em; }
@media (min-width: 800px) {
  .beat { grid-template-columns: 300px 1fr; gap: 64px; }
  .beat:nth-child(even) { grid-template-columns: 1fr 300px; }
  .beat:nth-child(even) .phone { order: 2; }
  .beat .phone { max-width: 300px; }
}

.more { margin-top: 80px; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.more li { background: var(--ink-1); padding: 22px 22px 24px; }
.more h3 { font-size: 24px; margin-bottom: 6px; }
.more p { color: var(--paper-2); font-size: 15px; }
@media (min-width: 640px) { .more { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .more { grid-template-columns: repeat(3, 1fr); } }

/* Cases */
.grid { margin-top: 36px; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (min-width: 1120px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { position: relative; border-radius: 16px; overflow: hidden; background: var(--ink-2); border: 1px solid var(--line); aspect-ratio: 540 / 723; isolation: isolate; }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform 0.6s ease; }
.card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(9, 9, 11, 0) 30%, rgba(9, 9, 11, 0.72) 58%, rgba(9, 9, 11, 0.97) 100%); }
.card:hover img { transform: scale(1.04); }
.card-in { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px; }
.series { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sodium); margin-bottom: 8px; }
.card h3 { font-size: 28px; margin-bottom: 8px; }
.card-in > p:not(.series):not(.meta) { color: var(--paper-2); font-size: 15px; line-height: 1.5; }
.meta { margin-top: 10px; font-size: 13px; color: var(--muted); }
.card-story .series { color: #d7a3ff; }

/* Clips */
.clips { background: var(--ink-1); }
.reel { margin-top: 32px; display: grid; grid-auto-flow: column; grid-auto-columns: min(72vw, 300px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
.reel li { scroll-snap-align: start; }
@media (min-width: 980px) { .reel { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); grid-auto-columns: auto; overflow: visible; margin-right: 0; padding-right: 0; } }
.clip { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: #000; cursor: pointer; aspect-ratio: 9 / 16; }
.clip video { width: 100%; height: 100%; object-fit: cover; }
.play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(9, 9, 11, 0.55); border: 1px solid rgba(255, 244, 230, 0.4); backdrop-filter: blur(6px); transition: opacity 0.2s; }
.play::before { content: ''; position: absolute; left: 26px; top: 21px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent var(--paper); }
.clip.playing .play { opacity: 0; }

/* Final */
.final { text-align: center; background: radial-gradient(50% 60% at 50% 40%, rgba(240, 179, 90, 0.12), transparent 70%), var(--ink-0); padding: 96px 0; }
.final-in { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.mark-lg { width: 28px; height: 42px; color: var(--sodium); filter: drop-shadow(0 0 14px var(--sodium-glow)); }
.final h2 { margin-bottom: 0; }
.small { color: var(--muted); font-size: 14px; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 32px 0 calc(40px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; background: var(--ink-0); }
.foot-top { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.studio { color: var(--paper); text-decoration: none; font-family: var(--font-display); font-size: 20px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot nav a { color: var(--paper-2); text-decoration: none; font-size: 14px; }
.foot nav a:hover { color: var(--paper); text-decoration: underline; }
.legal { max-width: 60em; }
.legal + .legal { margin-top: 8px; }


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot { animation: none; }
  .card img { transition: none; }
}
.notfound { min-height: 100vh; display: flex; align-items: center; }

@media (max-width: 559px) {
  .card { aspect-ratio: 1 / 1.1; }
  .phone-lg { max-width: 270px; }
}

/* The last card in the grid: no photo, says more cases are coming. */
.card-next { background: radial-gradient(70% 60% at 50% 35%, rgba(240, 179, 90, 0.14), transparent 70%), var(--ink-2); border-style: dashed; border-color: rgba(240, 179, 90, 0.3); }
.card-next::after { display: none; }
.card-next .card-in { top: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.card-next .mark-lg { margin-bottom: 18px; }
@media (max-width: 559px) { .card-next { aspect-ratio: auto; min-height: 280px; } .card-next .card-in { position: relative; } }
