/* Reroll landing page: Swiss grid, hairlines, big type, one accent. Palettes swap via data-palette. */
:root, [data-palette="paper"] {
  --bg: #efebe3;
  --fg: #111111;
  --muted: #6b665d;
  --rule: #111111;
  --accent: #e5402a;
  --on-accent: #ffffff;
  --field: #f7f4ee;
}
[data-palette="navy"] {
  --bg: #0f1c30;
  --fg: #efebe3;
  --muted: #8a9ab3;
  --rule: #efebe3;
  --accent: #ff5a3c;
  --on-accent: #ffffff;
  --field: #16263d;
}
[data-palette="mono"] {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #6e6e6e;
  --rule: #000000;
  --accent: #000000;
  --on-accent: #ffffff;
  --field: #ffffff;
}

body { background: var(--bg); color: var(--fg); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--fg); color: var(--bg); padding: 8px 12px; }

.bar, .hero, .block, .foot { max-width: 1320px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* Top bar: three columns of small text over a hairline */
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 24px; padding-top: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); font-size: var(--t-sm); }
.mark { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.04em; text-decoration: none; }
.bar-mid { color: var(--muted); }
.bar-cta { justify-self: end; text-decoration: none; font-weight: 600; }
.bar-cta:hover { color: var(--accent); }

/* Hero: headline left, the real video big on the right */
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 4vw, 64px); padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(56px, 8vw, 112px); align-items: end; }
.hero h1 { font-size: clamp(3.4rem, 9.2vw, 9.5rem); line-height: .9; letter-spacing: -0.055em; font-weight: 700; margin: 0 0 clamp(28px, 4vw, 48px); }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.45; max-width: 26em; margin: 0 0 32px; }
.cta { display: inline-block; background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 600; padding: 16px 28px; }
.cta:hover { opacity: .88; }

.hero-video { margin: 0; position: relative; justify-self: end; width: 100%; max-width: 440px; }
.hero-video video { width: 100%; height: auto; aspect-ratio: 9 / 16; background: #000; }
.hero-video figcaption { margin-top: 12px; font-size: var(--t-xs); color: var(--muted); }
.sound { position: absolute; left: 12px; top: 12px; padding: 6px 10px; border: 0; border-radius: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: var(--t-xs); font-weight: 600; }
.sound[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* Blocks: label in the left column, content on the right, hairline above */
.block { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 24px; padding-top: 20px; padding-bottom: clamp(56px, 8vw, 104px); }
.block::before { content: ""; grid-column: 1 / -1; border-top: 1px solid var(--rule); margin-bottom: 4px; }
.label { margin: 0; font-size: var(--t-sm); font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid color-mix(in srgb, var(--rule) 25%, transparent); }
.list li:first-child { padding-top: 0; }
.list .n { font-size: var(--t-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.list strong { font-size: clamp(1.3rem, 2.2vw, 1.9rem); letter-spacing: -0.03em; font-weight: 700; line-height: 1.1; }
.list li > span:last-child { color: var(--muted); }

/* Waitlist */
.beta-head { font-size: clamp(2rem, 4.6vw, 4rem); letter-spacing: -0.045em; font-weight: 700; line-height: 1; margin: 0 0 28px; }
.row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; border: 1px solid var(--rule); }
.row input, .row select { height: 58px; border: 0; border-right: 1px solid var(--rule); border-radius: 0; background: var(--field); color: var(--fg); padding: 0 16px; font-size: var(--t-md); min-width: 0; }
.row select { appearance: none; cursor: pointer; }
.row input:focus, .row select:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.row button { border: 0; border-radius: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; padding: 0 32px; font-size: var(--t-md); }
.row button[disabled] { opacity: .6; cursor: default; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: var(--t-sm); color: var(--muted); }
.consent input { margin-top: 3px; accent-color: var(--accent); }
.status { min-height: 1.5em; margin: 10px 0 0; font-size: var(--t-sm); }
.status.error { color: var(--accent); }
.hp { position: absolute; left: -9999px; }

/* Footer */
.foot { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-top: 16px; padding-bottom: 40px; border-top: 1px solid var(--rule); font-size: var(--t-xs); color: var(--muted); }
.foot p { margin: 0; max-width: 40em; }

@media (max-width: 860px) {
  .bar { grid-template-columns: 1fr auto; }
  .bar-mid { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-video { justify-self: start; max-width: 360px; }
  .block { grid-template-columns: 1fr; }
  .list li { grid-template-columns: 40px minmax(0, 1fr); }
  .list li > span:last-child { grid-column: 2; }
  .foot { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
  .row input, .row select { border-right: 0; border-bottom: 1px solid var(--rule); }
  .row button { height: 54px; }
}

/* Bar and footer rules stop at the content edge, like the block rules */
.bar, .foot { width: calc(100% - 2 * var(--gutter)); max-width: calc(1320px - 2 * var(--gutter)); padding-left: 0; padding-right: 0; }

/* ---- Motion ---- */
/* Sticky top bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); }

/* Load: headline lines rise out of a mask, then lede, button and video follow */
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.hero h1 .line > span { display: inline-block; animation: rise .9s cubic-bezier(.2, .7, 0, 1) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: .09s; }
.lede, .cta { animation: fadeup .8s .28s cubic-bezier(.2, .7, 0, 1) both; }
.cta { animation-delay: .36s; }
.hero-video { animation: unveil 1.1s .15s cubic-bezier(.7, 0, .2, 1) both; }
@keyframes rise { from { transform: translateY(105%); } }
@keyframes fadeup { from { opacity: 0; transform: translateY(14px); } }
@keyframes unveil { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Button: arrow nudges, fill inverts */
.cta { transition: background-color .2s, color .2s, box-shadow .2s; box-shadow: inset 0 0 0 2px var(--accent); }
.cta .arrow { display: inline-block; transition: transform .25s cubic-bezier(.2, .7, 0, 1); }
.cta:hover { opacity: 1; background: var(--bg); color: var(--fg); }
.cta:hover .arrow { transform: translateX(6px); }
.bar-cta { transition: letter-spacing .25s; }
.row button { transition: opacity .2s; }
.row button:hover { opacity: .8; }

/* Video: click toggles sound */
.hero-video video { cursor: pointer; }

/* Edit strip: the real cut list of the demo, playhead synced to the video */
.edit { margin-top: 10px; }
.edit-track { position: relative; height: 22px; cursor: pointer; display: flex; gap: 1px; }
.edit-seg { height: 100%; background: var(--fg); opacity: .14; transition: opacity .25s; }
.edit-seg.fast { background: repeating-linear-gradient(135deg, var(--fg) 0 2px, transparent 2px 5px); opacity: .35; }
.edit-seg.on { opacity: 1; }
.edit-seg.fast.on { opacity: 1; }
.edit-seg.clip-start { box-shadow: -2px 0 0 var(--bg); }
.edit-head { position: absolute; top: -4px; bottom: -4px; left: 0; width: 2px; background: var(--fg); pointer-events: none; z-index: 1; }
.edit-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: var(--t-xs); color: var(--muted); }
.key { display: inline-block; width: 10px; height: 10px; margin: 0 5px 0 10px; vertical-align: -1px; }
.key-real { background: var(--fg); }
.key-fast { background: repeating-linear-gradient(135deg, var(--fg) 0 2px, transparent 2px 4px); outline: 1px solid var(--fg); outline-offset: -1px; }

/* List rows: hover slides the title and draws the rule across */
.list li { position: relative; }
.list li::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--fg); transform: scaleX(0); transform-origin: left; transition: transform .5s cubic-bezier(.2, .7, 0, 1); }
.list li:hover::after { transform: scaleX(1); }
.list strong { transition: transform .35s cubic-bezier(.2, .7, 0, 1); }
.list li:hover strong { transform: translateX(10px); }
.list li:hover .n { color: var(--fg); }

/* Scroll: rows settle in as they arrive (visible by default; JS only adds the motion) */
.js .reveal { transition: transform .8s cubic-bezier(.2, .7, 0, 1), opacity .8s; }
.js .reveal.pending { transform: translateY(24px); opacity: .001; }

@media (prefers-reduced-motion: reduce) {
  .hero h1 .line > span, .lede, .cta, .hero-video { animation: none; }
  .js .reveal.pending { transform: none; opacity: 1; }
}

/* ---- Type: Schibsted Grotesk (SIL OFL, fonts/OFL-SchibstedGrotesk.txt), self-hosted ---- */
@font-face { font-family: "Schibsted Grotesk"; font-weight: 400; font-display: swap; src: url("/assets/fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 500; font-display: swap; src: url("/assets/fonts/schibsted-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 700; font-display: swap; src: url("/assets/fonts/schibsted-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 800; font-display: swap; src: url("/assets/fonts/schibsted-grotesk-latin-800-normal.woff2") format("woff2"); }
body, button, input, select { font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, "Segoe UI", sans-serif; }
.hero h1, .beta-head, .list strong { font-weight: 800; letter-spacing: -0.045em; }
.mark { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; }

/* ---- The die: Reroll's mark. Faces are drawn by site.js from data-face. ---- */
.die { --size: 26px; --ink: var(--fg); --pip: var(--bg); display: inline-grid; flex: none; width: var(--size); height: var(--size); padding: calc(var(--size) * .14); border-radius: calc(var(--size) * .24); background: var(--ink); grid-template: repeat(3, 1fr) / repeat(3, 1fr); vertical-align: middle; }
.die i { width: 78%; height: 78%; place-self: center; border-radius: 50%; background: var(--pip); opacity: 0; transform: scale(.4); transition: opacity .12s, transform .12s; }
.die i.on { opacity: 1; transform: none; }
.die.rolling { animation: tumble .55s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes tumble { 0% { transform: rotate(0) scale(1); } 40% { transform: rotate(200deg) scale(.82); } 100% { transform: rotate(360deg) scale(1); } }
.die-sm { --size: 18px; margin-right: 10px; vertical-align: -3px; }
.cta .die-sm { --ink: var(--on-accent); --pip: var(--accent); }
.cta:hover .die-sm { --ink: var(--fg); --pip: var(--bg); }
.row button .die-sm { --ink: var(--on-accent); --pip: var(--accent); }
.die-line { --size: 22px; --ink: transparent; --pip: var(--fg); box-shadow: inset 0 0 0 1.5px var(--fg); }
.list li:hover .die-line { --ink: var(--fg); --pip: var(--bg); }
.list .n { display: flex; align-items: center; }
.mark .die { transition: transform .3s; }
.beta-sub { margin: -14px 0 24px; color: var(--muted); font-size: var(--t-md); }
.status .die { --size: 16px; margin-right: 8px; vertical-align: -2px; }
@media (prefers-reduced-motion: reduce) { .die.rolling { animation: none; } }
.row button { display: inline-flex; align-items: center; justify-content: center; }
.row button .die-sm { margin-right: 8px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.cta { display: inline-flex; align-items: center; gap: 10px; }
.cta .die-sm { margin: 0; vertical-align: 0; }

/* ---- Hero v2: headline at the top, landscape demo full width below ---- */
.hero { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: end; padding-top: clamp(24px, 3.5vw, 48px); row-gap: clamp(28px, 4vw, 56px); }
.hero h1 { margin: 0; }
.hero-text { padding-bottom: .4em; }
.hero-text .lede { margin-bottom: 24px; }
.hero-video { grid-column: 1 / -1; justify-self: stretch; max-width: none; }
.hero-video video { aspect-ratio: 16 / 9; }
.sound { left: auto; right: 12px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-video { max-width: none; }
}

/* List rows: die, title and description share one centre line */
.list li { align-items: center; }
.list .n { align-self: stretch; align-items: center; }

/* Waitlist row: email + Join (no game choice) */
.row { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } .row input { border-right: 0; } }
.row input { border-right: 1px solid var(--rule); }
@media (max-width: 520px) { .row input { border-right: 0; border-bottom: 1px solid var(--rule); } }
