/* Spelastream website. Design tokens mirror the app (web/src/styles.css, theme.ts). */
:root {
  --bg: #0B0E13; --surface: #141922; --surface-2: #1b2230; --line: #262f3f;
  --text: #e8ecf3; --muted: #9aa4b5; --accent: #7C9CFF; --on-accent: #0B0E13; --warn: #ffb547;
  --display: 'Bricolage Grotesque Variable', 'Bricolage Grotesque', 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
  --body: 'Manrope Variable', Manrope, 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Cascadia Mono', Consolas, ui-monospace, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f3f5f9; --surface: #ffffff; --surface-2: #eef1f6; --line: #dde2ea; --text: #121722; --muted: #566072; --accent: #4865e8; --on-accent: #ffffff; --warn: #8a5200; color-scheme: light; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.12; margin: 0; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible, .button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 20px/1 var(--display); color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand svg { width: 34px; height: 34px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 16px; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent); }
.nav a.button { background: var(--accent); color: var(--on-accent); min-height: 40px; padding: 0 18px; font-size: 16px; border-radius: 12px; display: inline-flex; align-items: center; }
.nav a.button:hover { filter: brightness(1.08); background: var(--accent); }
@media (max-width: 560px) { .site-header .wrap { justify-content: center; } .nav a { padding: 6px 9px; font-size: 15px; } .nav a.button { padding: 0 14px; } }

/* buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 26px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font: 700 18px/1 var(--body); text-decoration: none; max-width: 100%; border: 0; cursor: pointer; }
.button:hover { filter: brightness(1.08); }
.button svg { width: 22px; height: 22px; flex: none; }
.button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.button.ghost:hover { background: var(--surface-2); filter: none; }
.meta { margin: 0; color: var(--muted); font-size: 15px; }

/* sections */
section.block { padding: 72px 0; border-top: 1px solid var(--line); }
section.block.tight { padding: 40px 0; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
h1 { font-size: clamp(36px, 7vw, 62px); font-weight: 700; }
h2 { font-size: clamp(27px, 4.5vw, 40px); font-weight: 700; margin-bottom: 14px; }
h3 { font-size: 20px; margin-bottom: 8px; }
.lead { font-size: clamp(17px, 2.4vw, 20px); color: var(--muted); max-width: 40em; }
.section-head { max-width: 46em; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 18px; }

/* hero */
.hero { padding: 56px 0 64px; }
.hero-grid { display: grid; gap: 40px; align-items: center; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.hero .cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .meta { margin-top: 14px; }
.pagehead { padding: 56px 0 36px; }
.pagehead h1 { font-size: clamp(34px, 6vw, 52px); }

/* cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.card h3 { margin-top: 12px; }
.card p { color: var(--muted); font-size: 16px; margin: 0; }
.icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: s; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; margin-bottom: 12px; }
.steps strong { display: block; font: 700 20px/1.2 var(--display); margin-bottom: 6px; }
.steps span { color: var(--muted); font-size: 16px; }
.split { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
ul.plain { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
ul.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ul.checks li { padding-left: 30px; position: relative; }
ul.checks li::before { content: ""; position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 22%, transparent); }
ul.checks li::after { content: ""; position: absolute; left: 6px; top: 9px; width: 5px; height: 9px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(40deg); }
.feature-group { padding: 48px 0; border-top: 1px solid var(--line); }
.feature-group .section-head { margin-bottom: 24px; }
.feature-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.feature-list article { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.feature-list h3 { font-size: 18px; margin-bottom: 6px; }
.feature-list p { margin: 0; color: var(--muted); font-size: 16px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.toc a { border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 15px; }
.toc a:hover { border-color: var(--accent); }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 14px; padding: 16px 18px; }
.callout h3 { font-size: 19px; margin-bottom: 8px; }
.callout p:last-child { margin-bottom: 0; }
kbd, .ui { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font: 600 0.92em/1.5 inherit; white-space: nowrap; }
code.hash { display: block; margin-top: 8px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font: 14px/1.5 var(--mono); word-break: break-all; user-select: all; }
.cta-band { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 48px 20px; }
.cta-band p { color: var(--muted); max-width: 32em; margin: 0 auto 24px; }
.dl-hero { padding: 48px 0 32px; }
.dl-hero .cta { margin-top: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.dl-sec { padding: 28px 0; border-top: 1px solid var(--line); }
.dl-sec h2 { font-size: clamp(24px, 5vw, 30px); }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; line-height: 1; color: var(--accent); flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 18px 16px; color: var(--muted); }
.faq details > div p:last-child { margin-bottom: 0; }
.prose h2 { font-size: 26px; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--muted); }
.prose ul { padding-left: 1.2em; }

footer.site-footer { border-top: 1px solid var(--line); padding: 36px 0 52px; color: var(--muted); font-size: 15px; }
.foot { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.foot ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.foot a { color: var(--text); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot strong { color: var(--text); }

/* scroll reveal (only when JS is on) */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ====================== The live demos: the real app in iframes ====================== */
.demo-stage { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
/* The app is drawn at its real size (data-w x data-h) and scaled down by --s, which site.js sets. */
.dframe { --s: .4; position: relative; width: 100%; aspect-ratio: 1280 / 800; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: #0B0E13; box-shadow: 0 24px 60px -24px rgba(0,0,0,.55); }
.dframe iframe { position: absolute; left: 0; top: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; transform: scale(var(--s)); background: #0B0E13; }
.dframe.touch { aspect-ratio: 844 / 390; max-width: 640px; border-radius: 22px; }
.dframe.touch iframe { width: 844px; height: 390px; }
.dframe iframe { pointer-events: none; }

/* demo controls */
.controls { display: grid; gap: 18px 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.ctl h3 { font: 800 13px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 10px; padding: 8px 13px; font: 600 15px/1.2 var(--body); cursor: pointer; min-height: 38px; }
.opt:hover { border-color: var(--accent); }
.opt[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.opt.sw { width: 38px; padding: 0; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.opt.sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--text); border-color: var(--surface); }
.demo-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.caption { font-weight: 700; margin: 0; }
.caption span { color: var(--accent); }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* small helpers (classes, because the page CSP has no inline styles) */
.nb { border-top: 0; } .mu { color: var(--muted); } .f28 { font-size: 28px; }
.dlh { font-size: clamp(34px, 8vw, 56px); }
.mb14 { margin-bottom: 14px; } .mt12 { margin-top: 12px; } .mt14 { margin-top: 14px; } .mt16 { margin-top: 16px; } .mt18 { margin-top: 18px; } .mt26 { margin-top: 26px; } .mt28 { margin-top: 28px; }
.m0 { margin: 0; } .m4 { margin: 4px 0 0; } .m404 { margin: 14px auto 26px; } .nf { text-align: center; padding: 40px 0; }
.mid { margin-top: 56px; align-items: center; } .mid h3 { font-size: 28px; }
.sw-periwinkle { background: #7C9CFF; } .sw-teal { background: #2DD4BF; } .sw-amber { background: #F59E0B; } .sw-pink { background: #F472B6; } .sw-lime { background: #A3E635; } .sw-coral { background: #FF7A59; }
.ctl [data-grad-group] { margin-top: 12px; }
.foot p { margin-top: 12px; }

/* analytics notice: fixed bottom corner card, so it never shifts the page */
.notice { position: fixed; right: 16px; bottom: 16px; z-index: 40; max-width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); animation: notice-in .25s ease-out; }
.notice p { margin: 0 0 12px; font-size: 15px; }
.notice-btns { display: flex; gap: 8px; }
.notice .opt:focus-visible, .notice a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes notice-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 480px) { .notice { left: 16px; max-width: none; } }
@media (prefers-reduced-motion: reduce) { .notice { animation: none; } }
