/* DoomRoll site — "Molten Verdict" palette, mirrored from the app's Theme.swift.
   Gold is the result, ember is doom only, bone/ash are the text on black. */

@font-face {
  font-family: "Nunito";
  src: url("assets/fonts/nunito.woff2") format("woff2");
  font-weight: 600 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* App palette (Theme.swift) */
  --gold: #E8B84B;
  --gold-deep: #A37B2E;
  --on-gold: #5A3A0A;
  --ember: #FF4D33;
  --bone: #F4EFE3;
  --ash: #A39A87;
  --arcane: #9D7BFF;
  --roll: #FF8C42;

  /* Page surfaces — documentation chrome, not app colour */
  --bg: #000;
  --panel: #12100C;
  --panel-2: #1A1610;
  --hairline: #2A2418;

  --font: "Nunito", ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --radius: 22px;
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 32px);

  /* Motion tokens (MotionTokens.swift) */
  --ack: 120ms;
  --move: 250ms;
  --reveal: 600ms;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--bone);
  font-family: var(--font);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--bone); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--gold); color: var(--on-gold); padding: 12px 16px; border-radius: 999px;
}
.skip:focus { left: 8px; z-index: 10; }

/* ── Header ─────────────────────────────────────────── */

.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(0, 0, 0, .72);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(42, 36, 24, .6);
  padding-top: env(safe-area-inset-top);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; min-height: 44px; gap: 10px; color: var(--bone); text-decoration: none; font-weight: 900; font-size: 20px; letter-spacing: -.2px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.top nav { display: flex; align-items: center; gap: 22px; }
.top nav a.link { color: var(--ash); text-decoration: none; font-size: 15px; display: inline-flex; align-items: center; min-height: 44px; }
.top nav a.link:hover { color: var(--bone); }
@media (max-width: 640px) { .top nav a.link { display: none; } }

/* ── Buttons ────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px;
  background: var(--gold); color: var(--on-gold);
  font: 900 18px/1 var(--font); text-decoration: none;
  box-shadow: 0 0 0 1px rgba(255, 220, 140, .25) inset, 0 10px 40px -10px rgba(232, 184, 75, .55);
  transition: transform var(--ack) ease-out, box-shadow var(--move) ease-out, background var(--ack);
}
.btn:hover { color: var(--on-gold); background: #F0C55E; transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255, 220, 140, .35) inset, 0 14px 50px -10px rgba(232, 184, 75, .7); }
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.small { padding: 9px 16px; min-height: 44px; font-size: 15px; box-shadow: none; }

/* ── Hero ───────────────────────────────────────────── */

.hero { position: relative; padding: clamp(28px, 6vw, 72px) 0 clamp(40px, 7vw, 96px); }
.hero .wrap { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: center; }
@media (min-width: 720px) { .hero .wrap { grid-template-columns: 1fr 1fr; gap: 24px; } }

.kicker { margin: 0 0 14px; color: var(--ash); font-weight: 800; font-size: 14px; letter-spacing: .22em; text-transform: uppercase; }
.hero h1 { margin: 0; font-weight: 900; font-size: clamp(52px, 10.5vw, 104px); line-height: 1.02; letter-spacing: -.02em; }
.hero h1 > span { display: block; white-space: nowrap; }
.t-spin { color: var(--arcane); }
.t-flip { color: var(--gold); }
.t-roll { color: var(--roll); }
.hero .lead { margin: 22px 0 30px; max-width: 30ch; color: var(--ash); font-size: clamp(19px, 2.3vw, 23px); line-height: 1.4; font-weight: 800; }
.hero .lead b { color: var(--bone); font-weight: 900; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.cta-note { color: var(--ash); font-size: 14px; font-weight: 700; }

.hero-art { position: relative; margin: 0 auto; width: min(100%, 560px, 44svh); order: -1; }
@media (min-width: 720px) { .hero-art { order: 0; width: 100%; max-width: 600px; } }
.hero-art img {
  width: 100%;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
}

/* ── Sections ───────────────────────────────────────── */

section { padding: clamp(56px, 9vw, 112px) 0; }
.section-head { max-width: 680px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { margin: 0 0 12px; font-weight: 900; font-size: clamp(34px, 5.5vw, 56px); line-height: 1.05; letter-spacing: -.015em; }
.section-head p { margin: 0; color: var(--ash); font-size: 19px; }
.gold { color: var(--gold); }

/* ── Games ──────────────────────────────────────────── */

.group { margin-top: clamp(36px, 5vw, 56px); }
.group-title { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font-size: 15px; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; color: var(--ash); }
.group-title::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--tint); box-shadow: 0 0 14px var(--tint); }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.group-title small { color: var(--tint); letter-spacing: .08em; font-size: 15px; }
.toss { --tint: var(--gold); }
.spin { --tint: var(--arcane); }
.roll { --tint: var(--roll); }

.games { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
@media (min-width: 640px) { .games { gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .toss .games { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.game {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 14px 14px 18px;
  transition: transform var(--move) ease-out, border-color var(--move);
}
.game:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--tint) 45%, var(--hairline)); }

.screen {
  position: relative; margin: 6px auto 18px; width: 82%; max-width: 210px;
  aspect-ratio: 422 / 514; border-radius: 26% / 21%;
  overflow: hidden; background: #000;
  box-shadow: 0 0 0 6px #1E1B16, 0 0 0 7px #3A3428, 0 18px 40px -16px color-mix(in srgb, var(--tint) 55%, transparent);
}
.screen img { width: 100%; height: 100%; object-fit: cover; }

.game h4 { margin: 0 0 6px; font-weight: 900; font-size: clamp(18px, 2.2vw, 22px); line-height: 1.15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.game p { margin: 0; color: var(--ash); font-size: 15px; line-height: 1.45; }
@media (max-width: 639px) { .game p { font-size: 14px; } .screen { box-shadow: 0 0 0 4px #1E1B16, 0 0 0 5px #3A3428, 0 14px 30px -14px color-mix(in srgb, var(--tint) 55%, transparent); } }
.game .tag { align-self: flex-start; order: 1; margin: 0 0 8px; }
.game .screen { order: 0; }
.game h4 { order: 2; }
.game p { order: 3; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; }
.tag.free { background: rgba(232, 184, 75, .14); color: var(--gold); }
.tag.pack { background: rgba(163, 154, 135, .14); color: var(--ash); }

.dice-card { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .dice-card { flex-direction: row; align-items: center; gap: 28px; padding: 22px 28px; }
  .dice-card .pair { display: flex; gap: 18px; flex: none; }
  .dice-card .screen { width: 190px; margin: 0; }
}
.dice-card .pair { display: flex; gap: 14px; justify-content: center; }
.dice-card .pair .screen { width: 46%; margin-bottom: 18px; }
@media (min-width: 720px) { .dice-card .pair .screen { width: 190px; margin-bottom: 0; } }
.dice-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.dice-list li { font-size: 14px; font-weight: 900; padding: 4px 10px; border-radius: 10px; background: rgba(255, 140, 66, .1); color: var(--roll); }

/* ── Features ───────────────────────────────────────── */

.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.feature { padding: 26px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--hairline); }
.feature .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: rgba(232, 184, 75, .12); color: var(--gold); margin-bottom: 16px; }
.feature .ico svg { width: 24px; height: 24px; }
.feature h3 { margin: 0 0 8px; font-size: 21px; font-weight: 900; }
.feature p { margin: 0; color: var(--ash); font-size: 16px; }
.feature q { color: var(--bone); quotes: "“" "”"; }

/* ── Pricing ────────────────────────────────────────── */

.pricing { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .pricing { grid-template-columns: 1.15fr 1fr; } }
.plan { padding: clamp(24px, 3vw, 34px); border-radius: var(--radius); background: var(--panel); border: 1px solid var(--hairline); }
.plan.free { border-color: rgba(232, 184, 75, .45); background: radial-gradient(120% 90% at 0% 0%, rgba(232, 184, 75, .12), transparent 60%), var(--panel); }
.plan h3 { margin: 0 0 6px; font-size: 26px; font-weight: 900; }
.plan .sub { margin: 0 0 18px; color: var(--ash); }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.plan li { position: relative; padding-left: 28px; color: var(--bone); }
.plan li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px rgba(232, 184, 75, .6); }
.plan li span { color: var(--ash); }
.packs li::before { background: transparent; border: 2px solid var(--gold-deep); box-shadow: none; }
.packs li b { color: var(--gold); }

/* ── Devices (iPhone & iPad) ────────────────────────── */

.devices {
  position: relative; overflow: hidden;
  border-radius: calc(var(--radius) + 8px); border: 1px solid var(--hairline);
  padding: clamp(28px, 5vw, 56px);
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(157, 123, 255, .16), transparent 60%),
    radial-gradient(60% 120% at 0% 100%, rgba(255, 140, 66, .12), transparent 60%),
    var(--panel);
}
.devices h2 { margin: 10px 0 12px; font-size: clamp(30px, 4.6vw, 46px); line-height: 1.08; font-weight: 900; }
.devices p { margin: 0; color: var(--ash); max-width: 58ch; font-size: 18px; }
.devices .badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; background: rgba(157, 123, 255, .16); color: var(--arcane); }
.device-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 0; padding: 0; list-style: none; }
.device-row li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; background: rgba(244, 239, 227, .06); color: var(--bone); font-size: 15px; }
.device-row svg { width: 18px; height: 18px; color: var(--ash); }

/* ── FAQ ────────────────────────────────────────────── */

.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { border-radius: 18px; background: var(--panel); border: 1px solid var(--hairline); padding: 0 22px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 30px 18px 0; position: relative; font-size: 18px; font-weight: 900; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; content: "+" / ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--gold); font-size: 26px; font-weight: 800; transition: transform var(--move) ease-out; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: 0 0 20px; color: var(--ash); }

/* ── Final CTA + footer ─────────────────────────────── */

.final { text-align: center; }
.final h2 { margin: 0 0 14px; font-size: clamp(40px, 7vw, 76px); font-weight: 900; line-height: 1.02; letter-spacing: -.02em; }
.final p { margin: 0 auto 30px; color: var(--ash); font-size: 19px; max-width: 36ch; }
.final img { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 26px; box-shadow: 0 20px 60px -18px rgba(232, 184, 75, .5); }

footer { border-top: 1px solid var(--hairline); padding: 32px 0 calc(40px + env(safe-area-inset-bottom)); color: var(--ash); font-size: 14px; font-weight: 600; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
footer a { color: var(--ash); text-decoration: none; }
footer a:hover { color: var(--bone); }
footer .legal { flex-basis: 100%; font-size: 12px; color: #8A8273; }

/* ── Entrance (decoration only, skipped for Reduce Motion) ── */

@media (prefers-reduced-motion: no-preference) {
  .hero h1 span, .hero .lead, .hero .cta-row, .hero-art { animation: rise var(--reveal) cubic-bezier(.2, .7, .2, 1) both; }
  .hero h1 span:nth-child(2) { animation-delay: 80ms; }
  .hero h1 span:nth-child(3) { animation-delay: 160ms; }
  .hero .lead { animation-delay: 240ms; }
  .hero .cta-row { animation-delay: 320ms; }
  .hero-art { animation-name: glow; animation-duration: 1.1s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
  @keyframes glow { from { opacity: 0; transform: scale(.96); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .game, .faq summary::after { transition: none; }
}
