/* Swarm demo page. Colour tokens per preset first; everything else reads them. */
@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, [data-preset="aurora"] {
  --bg: #03050d; --ink: #eef3ff; --muted: #a3afcf; --accent: #3ee6c8; --accent-ink: #03110e;
  --glass: rgba(9, 13, 32, .62); --line: rgba(190, 210, 255, .14); --solid: #070a18;
  --display: "Space Grotesk", system-ui, sans-serif; --body: "DM Sans", system-ui, sans-serif;
  --r: 18px; color-scheme: dark;
}
[data-preset="ember"] { --bg: #080302; --ink: #fff4ea; --muted: #d6b4a0; --accent: #ff9b2f; --accent-ink: #1d0800; --glass: rgba(30, 10, 4, .62); --line: rgba(255, 190, 150, .16); --solid: #120604; }
[data-preset="mono"] { --bg: #000; --ink: #fff; --muted: #b3b3b3; --accent: #fff; --accent-ink: #000; --glass: rgba(18, 18, 18, .66); --line: rgba(255, 255, 255, .16); --solid: #0b0b0b; }
[data-preset="candy"] { --bg: #f7eedd; --ink: #2a1d33; --muted: #6b5870; --accent: #e33d7a; --accent-ink: #fff; --glass: rgba(255, 250, 240, .72); --line: rgba(60, 30, 70, .14); --solid: #fbf4e7; color-scheme: light; }
[data-preset="emerald"] { --bg: #010705; --ink: #eafff4; --muted: #9fcdb7; --accent: #3cf0a2; --accent-ink: #01140b; --glass: rgba(3, 22, 15, .62); --line: rgba(160, 255, 210, .14); --solid: #03110b; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overscroll-behavior-x: none; } /* sideways drags part the swarm; they must not swipe back a page */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; overscroll-behavior-x: none; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--body); transition: background-color .4s; }
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: -80px; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 10px; z-index: 20; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- the sky: poster first, canvas once live ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--bg); }
.poster, .sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.poster { object-fit: cover; object-position: 50% 30%; transition: opacity .8s; }
.sky canvas { opacity: 0; transition: opacity .8s; }
.s-live .sky canvas { opacity: 1; }
.s-live .poster { opacity: 0; }
html:not([data-preset="aurora"]) .swarm:not(.s-live) .poster { opacity: .35; }

/* ---------- header ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 12px clamp(16px, 4vw, 44px); }
.top::before { content: ""; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none; background: linear-gradient(var(--bg) 30%, color-mix(in srgb, var(--bg) 70%, transparent) 60%, transparent); }
.brand { display: flex; align-items: center; gap: 8px; font: 700 21px/1 var(--display); letter-spacing: -.02em; text-decoration: none; min-height: 44px; }
.brand-mark { width: 24px; height: 24px; fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.top nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; padding: 12px 0; }
.top nav a:hover { color: var(--ink); }
.cta { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-weight: 600; font-size: 15px; text-decoration: none; }
.cta:hover { border-color: var(--accent); }

/* ---------- the four morph sections ---------- */
main { position: relative; z-index: 1; }
.panel { min-height: 100vh; min-height: 100svh; display: flex; padding: 96px clamp(16px, 5vw, 72px) 150px; position: relative; }
.copy { max-width: 34rem; text-shadow: 0 0 18px var(--bg), 0 0 36px var(--bg); }
.panel-hero, .panel-cta { align-items: flex-end; justify-content: center; text-align: center; }
.panel-hero .copy, .panel-cta .copy { max-width: 44rem; }
.panel-left { align-items: center; justify-content: flex-start; }
.panel-right { align-items: center; justify-content: flex-end; }
.kicker { margin: 0 0 10px; font: 600 13px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font: 700 clamp(26px, 3.2vw, 38px)/1 var(--display); letter-spacing: .32em; text-transform: uppercase; padding-left: .32em; }
h2 { margin: 0 0 14px; font: 700 clamp(34px, 5vw, 64px)/1.02 var(--display); letter-spacing: -.035em; }
.lede { font-size: clamp(18px, 1.7vw, 22px); color: var(--ink); margin: 14px auto 0; max-width: 36ch; }
.copy p { color: var(--muted); }
.copy .lede { color: var(--ink); }
.try { font-size: 15px; border-left: 2px solid var(--accent); padding-left: 12px; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 22px 0 0; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--ink); font-weight: 600; text-decoration: none; text-shadow: none; }
.btn-solid { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn:hover { transform: translateY(-1px); }

/* ---------- solid sections after the swarm ---------- */
.solid { position: relative; z-index: 2; background: var(--solid); padding: 88px clamp(16px, 5vw, 72px); border-top: 1px solid var(--line); }
.solid h2 { max-width: 20ch; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; max-width: 1200px; }
.cols h3 { font: 600 20px/1.3 var(--display); margin: 0 0 8px; }
.cols p, .honest { margin: 0; color: var(--muted); }
.honest { max-width: 62ch; margin-top: 36px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); }
.faq details { border-top: 1px solid var(--line); max-width: 780px; }
.faq summary { cursor: pointer; min-height: 56px; display: flex; align-items: center; font: 600 18px/1.35 var(--display); padding: 8px 0; }
.faq details p { margin: 0 0 18px; color: var(--muted); }
.foot { position: relative; z-index: 2; background: var(--solid); padding: 28px clamp(16px, 5vw, 72px) 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- the control dock ---------- */
.dock { position: fixed; z-index: 9; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); padding: 8px 10px 8px 16px; border-radius: 22px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); transition: opacity .35s, transform .35s; }
.s-away .dock { opacity: 0; transform: translate(-50%, 24px); pointer-events: none; }
.reads { display: flex; gap: 14px; margin: 0; }
.reads div { min-width: 64px; }
.reads dt { font-size: 12px; color: var(--muted); line-height: 1.2; }
.reads dd { margin: 0; font: 600 17px/1.25 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.reads small { font-size: 12px; color: var(--muted); font-weight: 500; }
.dock-scroll { display: flex; gap: 10px; align-items: center; }
.acts, .toggles, .presets { display: flex; gap: 6px; }
.toggles, .presets { padding-left: 10px; border-left: 1px solid var(--line); }
.dock button { appearance: none; border: 0; cursor: pointer; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 14px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); font: 600 14px var(--body); white-space: nowrap; }
.dock button:hover { background: color-mix(in srgb, var(--ink) 16%, transparent); }
.dock button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.presets button { padding: 0; border-radius: 50%; width: 44px; background: transparent; display: grid; place-items: center; }
.presets button::before { content: ""; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 0 0 1px var(--line); }
.presets button[aria-pressed="true"] { background: transparent; }
.presets button[aria-pressed="true"]::before { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.presets button:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.fallback { position: fixed; z-index: 9; left: 16px; right: 16px; top: 76px; margin: 0 auto; max-width: 560px; padding: 12px 16px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }

@media (max-width: 1180px) {
  .dock { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; border-radius: 20px; }
  .reads { justify-content: space-around; }
  .dock-scroll { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .dock-scroll::-webkit-scrollbar { display: none; }
}
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .panel-left, .panel-right { align-items: flex-end; justify-content: center; text-align: center; }
  .panel-left .copy, .panel-right .copy { margin: 0 auto; }
  .try { border-left: 0; padding-left: 0; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .top { padding: 8px 16px; gap: 12px; }
  .top nav { display: none; }
  .cta { margin-left: auto; padding: 0 14px; font-size: 14px; }
  .panel { padding: 72px 16px 176px; }
  h2 { font-size: clamp(28px, 8.2vw, 40px); }
  .copy p { font-size: 15.5px; }
  .copy .lede { font-size: 17px; }
  .kicker { font-size: 12px; letter-spacing: .1em; }
  .dock { left: 8px; right: 8px; bottom: 8px; max-width: none; transform: none; }
  .s-away .dock { transform: translateY(24px); }
  .reads { gap: 8px; }
  .reads div { min-width: 0; text-align: center; }
  .dock button { padding: 0 12px; font-size: 13.5px; }
  .solid { padding: 64px 16px; }
}
