/* Bubble demo page. Colour tokens first (the active film preset rewrites them live). */
@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk-latin-wght-normal.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }
:root {
  --bg: #090c16; --surface: #111726; --ink: #eef2ff; --muted: #9ba5c2; --line: #222b42;
  --accent: #8fd3ff; --accent2: #ffb0e3;
  --r: 26px; --gap: 16px; --pad: clamp(16px, 4vw, 48px);
  --display: "Space Grotesk", system-ui, sans-serif; --body: "DM Sans", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--body); transition: background-color .6s, color .6s; }
a { color: inherit; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* header */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 12px var(--pad); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand { font: 700 22px/1 var(--display); text-decoration: none; letter-spacing: -0.03em; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.brand-dot { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #fff 0 8%, transparent 20%), conic-gradient(from 210deg, #8fd3ff, #c9a2ff, #ffb0e3, #ffe29a, #9ff0c9, #8fd3ff); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55), 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent); opacity: .92; }
.top nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--muted); padding: 12px 0; }
.top nav a:hover { color: var(--ink); }
.cta { background: var(--ink); color: var(--bg); text-decoration: none; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }

/* the stage */
.hero { padding: 4px var(--pad) 40px; }
.stage { position: relative; height: min(80svh, 860px); min-height: 480px; border-radius: var(--r); overflow: hidden; background: radial-gradient(ellipse 60% 55% at 50% 44%, #22305a, transparent 70%), linear-gradient(#1b2544, #0c1122 76%, #131a2f 77%, #05070d); box-shadow: 0 0 0 1px var(--line), 0 40px 80px -40px rgba(0,0,0,.8); outline: none; isolation: isolate; }
.stage:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.poster, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.poster { object-fit: cover; z-index: 0; transition: opacity .6s; }
.word { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-58%); margin: 0; z-index: 1; text-align: center; pointer-events: none; font: 700 clamp(88px, 21vw, 330px)/1 var(--display); letter-spacing: -0.06em; color: #eef2ff; text-shadow: 0 0 60px rgba(140,170,255,.25); }
.stage canvas { z-index: 2; touch-action: none; cursor: crosshair; opacity: 0; transition: opacity .6s; }
[data-bubble].b-live .stage canvas { opacity: 1; }
[data-bubble].b-live .poster { opacity: 0; }
.kicker { position: absolute; z-index: 3; left: 20px; top: 16px; margin: 0; padding: 10px 14px; border-radius: 999px; font: 600 12px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); background: rgba(8, 10, 20, .38); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); pointer-events: none; }
.stage-reset { position: absolute; z-index: 3; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: rgba(255,255,255,.1); color: var(--ink); font: 600 14px var(--body); cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.stage-reset svg { width: 18px; height: 18px; }
.stage-reset:hover { background: rgba(255,255,255,.18); }
.wand { position: absolute; z-index: 3; left: -21px; top: -21px; width: 42px; height: 42px; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .2s; background: conic-gradient(from 0deg, #8fd3ff, #ffb0e3, #ffe29a, #9ff0c9, #8fd3ff); -webkit-mask: radial-gradient(circle, transparent 16px, #000 17px); mask: radial-gradient(circle, transparent 16px, #000 17px); }
.wand.b-on { opacity: .85; }
.hint { position: absolute; z-index: 3; left: 50%; bottom: 84px; transform: translateX(-50%); margin: 0; padding: 10px 16px; border-radius: 999px; background: rgba(8, 10, 20, .55); color: #fff; font-size: 14px; white-space: nowrap; pointer-events: none; transition: opacity .5s; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hint.b-hide, .hint:empty { opacity: 0; }
.fallback { position: absolute; z-index: 3; left: 16px; right: 16px; bottom: 16px; margin: 0; padding: 12px 16px; background: var(--surface); border-radius: 14px; }
.read { position: absolute; z-index: 3; left: 16px; bottom: 16px; right: 16px; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.read div { background: rgba(8, 10, 20, .42); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 14px; padding: 8px 14px; min-width: 92px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.read span { display: block; font-size: 12px; color: rgba(255,255,255,.66); letter-spacing: .02em; }
.read b { font: 600 20px/1.2 var(--display); font-variant-numeric: tabular-nums; color: #fff; }
.read i { font-style: normal; font-size: 12px; color: rgba(255,255,255,.66); margin-left: 3px; }

/* under the stage: the pitch and the controls */
.deck { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 20px 40px; padding-top: 28px; align-items: start; }
.lede { margin: 0 0 20px; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.5; color: var(--muted); max-width: 36ch; }
.links { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px; box-shadow: inset 0 0 0 1px var(--line); }
.btn.solid { background: var(--ink); color: var(--bg); box-shadow: none; }
.btn:not(.solid):hover { box-shadow: inset 0 0 0 1px var(--muted); }
.panel { background: var(--surface); border-radius: var(--r); padding: 20px; box-shadow: inset 0 0 0 1px var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; transition: background-color .6s; }
.panel .group:first-child { grid-column: 1 / -1; }
.panel h2 { margin: 0 0 10px; font: 600 12px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.presets button { appearance: none; border: 0; cursor: pointer; min-height: 80px; border-radius: 16px; padding: 44px 6px 10px; font: 600 13px/1.2 var(--body); color: var(--ink); background: color-mix(in srgb, var(--bg) 60%, var(--surface)); box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.presets button::before { content: ""; position: absolute; left: 50%; top: 10px; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.95) 0 7%, transparent 18%), var(--s); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4), inset -4px -6px 10px rgba(0,0,0,.25); }
.presets button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.presets button:hover { background: color-mix(in srgb, var(--bg) 30%, var(--surface)); }
.acts, .toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggles { margin-top: 10px; }
.acts button, .toggles button { appearance: none; border: 0; cursor: pointer; min-height: 44px; padding: 0 16px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 9%, transparent); font: 600 14px var(--body); color: var(--ink); }
.acts button:hover, .toggles button:hover { background: color-mix(in srgb, var(--ink) 16%, transparent); }
.acts button:first-child { background: var(--accent); color: #07101c; }
.toggles button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.range { display: block; font-size: 15px; }
.range span { display: flex; justify-content: space-between; }
.range output { font-variant-numeric: tabular-nums; color: var(--muted); }
input[type=range] { width: 100%; height: 44px; margin: 0; accent-color: var(--accent); }

/* content sections */
.how, .faq { padding: 64px var(--pad); max-width: 1320px; }
.how h2, .faq h2 { font: 700 clamp(32px, 4.4vw, 56px)/1.04 var(--display); letter-spacing: -0.035em; margin: 0 0 32px; max-width: 18ch; }
.cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.cols article { padding: 22px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.num { display: inline-block; font: 600 12px/1 var(--display); letter-spacing: .14em; color: var(--accent); margin-bottom: 14px; }
.cols h3 { font: 600 20px/1.25 var(--display); margin: 0 0 8px; letter-spacing: -0.01em; }
.cols p { margin: 0; color: var(--muted); font-size: 16px; }
.faq details { border-top: 1px solid var(--line); padding: 6px 0; max-width: 820px; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font: 600 19px/1.3 var(--display); min-height: 48px; display: flex; align-items: center; list-style: none; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--accent); font-size: 24px; font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq p { margin: 0 0 16px; color: var(--muted); max-width: 70ch; }
.foot { padding: 36px var(--pad) 56px; color: var(--muted); font-size: 15px; border-top: 1px solid var(--line); }
.foot a { text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 4px; }

@media (max-width: 1100px) { .cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 960px) {
  .deck { grid-template-columns: 1fr; }
  .panel { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top { gap: 12px; }
  .top nav { display: none; }
  .cta { margin-left: auto; padding: 0 16px; font-size: 14px; }
  .hero { padding: 0 12px 32px; }
  .stage { height: 62svh; min-height: 380px; border-radius: 20px; }
  .word { font-size: 26vw; }
  .kicker { left: 10px; top: 12px; padding: 9px 12px; letter-spacing: .08em; }
  .kicker .k2 { display: none; }
  .stage-reset { top: 8px; right: 8px; padding: 0 14px; font-size: 13px; }
  .read { left: 10px; right: 10px; bottom: 10px; gap: 6px; }
  .read div { min-width: 0; padding: 6px 10px; border-radius: 12px; }
  .read b { font-size: 16px; }
  .read .thin { display: none; }
  .hint { bottom: 70px; font-size: 13px; white-space: normal; width: max-content; max-width: calc(100% - 32px); text-align: center; }
  .presets { grid-template-columns: repeat(3, 1fr); }
  .presets button { min-height: 76px; font-size: 12px; }
  .cols { grid-template-columns: 1fr; }
  .how, .faq { padding: 48px 16px; }
}
