/* ==========================================================================
   ShakeNotes for macOS: "Black Stage"
   Vanilla CSS. Animates transform / opacity / filter only.
   ========================================================================== */

:root {
  --bg: #000000;
  --surface: #141416;
  --surface-2: #1B1B1E;
  --text: #F5F5F7;
  --muted: #A1A1A6;
  --accent: #FFC83D;
  --accent-ink: #0B0B0B;
  --accent-2: #0A84FF;
  --hairline: rgba(255,255,255,0.08);
  --hairline-strong: rgba(255,255,255,0.14);

  --glass: rgba(20,20,22,0.72);
  --glass-heavy: rgba(14,14,16,0.86);
  --glass-border: rgba(255,255,255,0.12);
  --glass-capsule: rgba(255,255,255,0.07);
  --glass-count: rgba(255,255,255,0.08);
  --glass-flat: #1C1C1E;
  --glass-blur: blur(28px) saturate(140%);

  --note-yellow: #FACC40; --note-green: #66C773; --note-blue: #599EF2;
  --note-pink: #F2739E; --note-purple: #9E7AEB; --note-gray: #999999;

  --wall-dark: #0B0B0F;
  --wall-bloom-y: rgba(255,200,61,0.14);
  --wall-bloom-b: rgba(10,132,255,0.12);
  --wall-light-a: #F3EEE3;
  --wall-light-b: #BFD8F5;
  --on-light-text: #14120F;
  --on-light-muted: #5E574C;

  --font-display: "Geist", -apple-system, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --font-body: "Geist", -apple-system, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-popup: -apple-system, "Geist", system-ui, sans-serif;

  --fs-h1: clamp(2.25rem, 9vw, 5.75rem);  /* 36px fits "Shake your mouse." (Geist 700) in 320px; 92px fits it in 840px */
  --fs-h2: clamp(2.2rem, 5.6vw, 5rem);
  --fs-beat: clamp(2.25rem, 4.5vw, 4.25rem);
  --fs-stat: clamp(4.5rem, 14vw, 12rem);
  --fs-price: clamp(4rem, 10vw, 7rem);
  --fs-lead: clamp(1.25rem, 1.7vw, 1.5rem);
  --fs-body: 1.125rem;
  --fs-small: 1rem;
  --fs-caption: 0.9375rem;
  --fs-eyebrow: 0.8125rem;   /* 13px: the floor for everything outside the macOS UI mockups */
  --lh-display: 1;
  --lh-body: 1.6;
  --ls-display: -0.03em;
  --ls-stat: -0.04em;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --section-pad: clamp(96px, 14vh, 200px);
  --gutter: 20px;
  --container: 1280px;
  --measure: 40ch;

  --r-pill: 999px; --r-card: 24px; --r-price: 28px; --r-popup: 22px;
  --r-row: 10px; --r-btn: 12px; --r-icon: 7px; --r-stage: 24px;

  --shadow-popup: 0 30px 80px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
  --shadow-stage: 0 40px 120px rgba(0,0,0,0.7);
  --ring-buy: 0 0 0 1px rgba(255,200,61,0.4);
  --ring-focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-2);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-land: cubic-bezier(0.2, 0.9, 0.25, 1.05);
  --d-fast: 160ms; --d-base: 320ms; --d-reveal: 700ms; --d-slow: 900ms;
  --stagger: 70ms;
  --lerp: 0.16;

  --stage-scale: 1;
}

@media (max-width: 399px) { :root { --gutter: 16px; } }
@media (max-width: 599px) { :root { --fs-body: 1.0625rem; } }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--font-mono); }
summary { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring-focus); border-radius: inherit; }
::selection { background: rgba(255,200,61,.35); color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Type ---------- */
.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  text-align: center;
  text-wrap: balance;
  margin-top: var(--s-4);
}
.h2--left { text-align: left; max-width: 16ch; }
.eyebrow {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--fs-eyebrow);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--center { text-align: center; }
.lead { color: var(--muted); font-size: var(--fs-lead); max-width: 44ch; margin-top: var(--s-5); }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: var(--section-pad) 0; position: relative; }
.faq__a a, .glass__body a, .under-link a, .stat__body a { color: var(--accent-2); text-decoration: underline; text-underline-offset: .15em; }

/* ---------- Skip link ---------- */
.skip {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 10px 14px; border-radius: var(--r-btn);
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  transform: translateY(-200%); opacity: 0;
  transition: transform var(--d-fast) var(--ease), opacity var(--d-fast) var(--ease);
}
.skip:focus-visible { transform: none; opacity: 1; }

/* ---------- Reveal ----------
   Pre-reveal states are gated on html.js so the page reads in its final state without JavaScript. */
.reveal {
  transition: opacity var(--d-reveal) var(--ease), transform var(--d-reveal) var(--ease);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.js .reveal:not(.is-in) { opacity: 0; transform: translateY(28px); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal--fade { transition-delay: calc(var(--i, 0) * 60ms); }
.js .reveal--fade:not(.is-in) { transform: none; }

/* visually hidden, still in the accessibility tree */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 52px; padding: 0 26px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 1.0625rem; white-space: nowrap;
  position: relative; isolation: isolate;
  transition: transform var(--d-fast) var(--ease), opacity var(--d-fast) var(--ease), filter var(--d-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost { border: 1px solid var(--hairline-strong); color: var(--text); }
.btn--ghost::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: var(--surface); opacity: 0; transition: opacity var(--d-fast) var(--ease);
}
.btn--ghost:hover::before { opacity: 1; }
.btn--block { width: 100%; }
.btn--buy { box-shadow: var(--ring-buy); }
.btn--buy::after {
  content: ""; position: absolute; inset: -4px; border-radius: inherit;
  border: 1px solid var(--accent); opacity: 0; transform: scale(.96);
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
  pointer-events: none;
}
.btn--buy:hover::after { opacity: 1; transform: scale(1); }
.btn--buy:focus-visible { box-shadow: var(--ring-focus); }

.pill {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px;
  border-radius: var(--r-pill); font-weight: 600; font-size: .9375rem; white-space: nowrap;
  transition: transform var(--d-fast) var(--ease), filter var(--d-fast) var(--ease);
}
.pill--accent { background: var(--accent); color: var(--accent-ink); }
.pill--accent:hover { filter: brightness(1.06); }
.pill:active { transform: translateY(1px); }

/* ==========================================================================
   Header
   ========================================================================== */
.nav { position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 50; }
.nav::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(0,0,0,0.72);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--hairline);
  opacity: 0; transition: opacity var(--d-base) var(--ease);
}
.nav.is-scrolled::before { opacity: 1; }
.nav__inner {
  position: relative; max-width: var(--container); margin: 0 auto; height: 100%;
  padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; border-radius: 8px; }
.brand img { border-radius: var(--r-icon); }
.nav__links { display: none; gap: 28px; }
.nav__links a { font-weight: 500; font-size: .9375rem; color: var(--muted); transition: color var(--d-fast) var(--ease); border-radius: 4px; }
.nav__links a:hover { color: var(--text); }
@media (min-width: 1024px) { .nav__links { display: flex; } }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { min-height: 100svh; padding: 120px 0 var(--s-9); display: flex; flex-direction: column; align-items: center; }
.nav-sentinel { position: absolute; top: 96px; left: 0; width: 1px; height: 1px; pointer-events: none; }
.hero__inner { max-width: 880px; padding: 0 var(--gutter); text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero__eyebrow .eyebrow--narrow { display: none; }
@media (max-width: 599px) {
  .hero__eyebrow .eyebrow--wide { display: none; }
  .hero__eyebrow .eyebrow--narrow { display: inline; }
}
.hero__title {
  margin-top: var(--s-5);
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--fs-h1); line-height: var(--lh-display); letter-spacing: -0.035em;
}
.hero__title .line { display: block; }
.hero__title .w { display: inline-block; }
.hero__lead { margin-top: var(--s-6); color: var(--muted); font-size: var(--fs-lead); max-width: var(--measure); text-wrap: pretty; }
.hero__cta { margin-top: var(--s-6); display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero__micro { margin-top: var(--s-4); font-size: var(--fs-caption); color: var(--muted); }

/* entrance choreography (JS adds html.js; CSS animates only when JS + motion allowed) */
.js .hero__title .w { opacity: 0; transform: translateY(32px); animation: rise var(--d-reveal) var(--ease) forwards; }
.js .hero__title .line:nth-child(1) .w:nth-child(1) { animation-delay: 0ms; }
.js .hero__title .line:nth-child(1) .w:nth-child(2) { animation-delay: 70ms; }
.js .hero__title .line:nth-child(1) .w:nth-child(3) { animation-delay: 140ms; }
.js .hero__title .line:nth-child(2) .w:nth-child(1) { animation-delay: 210ms; }
.js .hero__title .line:nth-child(2) .w:nth-child(2) { animation-delay: 280ms; }
.js .hero__title .line:nth-child(2) .w:nth-child(3) { animation-delay: 350ms; }
.js .hero .enter { opacity: 0; transform: translateY(32px); animation: rise var(--d-reveal) var(--ease) 550ms forwards; }
.js .stage-wrap { opacity: 0; animation: fadeIn 700ms var(--ease) 700ms forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fadeIn { to { opacity: 1; } }

/* ---------- Stage ---------- */
.stage-wrap { width: 100%; max-width: 880px; margin-top: var(--s-8); padding: 0 var(--gutter); }
.stage-viewport {
  position: relative; width: 100%; height: calc(520px * var(--stage-scale));
  overflow: hidden; border-radius: var(--r-stage); box-shadow: var(--shadow-stage);
  background: var(--wall-dark);
}
.stage {
  position: absolute; left: 50%; top: 0; width: 880px; height: 520px; margin-left: calc(-440px + var(--stage-shift, 0px));
  transform: scale(var(--stage-scale)); transform-origin: top center;
}
.stage .stage__menubar { padding-left: calc(var(--vis-l, 0px) + 14px); padding-right: calc(880px - var(--vis-r, 880px) + 14px); }
.stage__wall {
  position: absolute; inset: 0;
  background:
    radial-gradient(55% 45% at 18% 12%, var(--wall-bloom-y), transparent 70%),
    radial-gradient(55% 45% at 88% 92%, var(--wall-bloom-b), transparent 70%),
    var(--wall-dark);
}
.stage__menubar {
  position: absolute; left: 0; right: 0; top: 0; height: 28px;
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
  font-family: var(--font-popup); font-size: 12px; color: rgba(245,245,247,.85);
  border-bottom: 1px solid var(--hairline); background: rgba(0,0,0,.25);
}
.mb__dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(245,245,247,.85); }
.mb__app { font-weight: 600; }
.mb__item { opacity: .8; }
.mb__spacer { flex: 1; }
.mb__note { color: var(--accent); }
.mb__wifi { width: 14px; height: 10px; border-radius: 14px 14px 0 0; border: 2px solid rgba(245,245,247,.85); border-bottom: 0; }
.mb__time { font-variant-numeric: tabular-nums; white-space: nowrap; }

.bloom {
  position: absolute; left: 278px; top: 217px; width: 420px; height: 220px; border-radius: 50%;
  background: rgba(255,200,61,.55); filter: blur(60px); opacity: 0; pointer-events: none;
}

/* cursors */
.cursor, .ghost { position: absolute; left: 0; top: 0; width: 20px; height: 24px; pointer-events: none; transform-origin: 2px 1px; }
.cursor svg { position: absolute; left: 0; top: 0; }
.cursor .click-ring { position: absolute; left: -13px; top: -13px; width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.95); box-shadow: 0 0 10px rgba(255,255,255,.45), inset 0 0 8px rgba(255,255,255,.25); opacity: 0; transform: scale(.15); }
.cursor .click-ring--2 { border-width: 1.5px; box-shadow: none; }
.cursor.is-clicking .click-ring { animation: click-ring 720ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.cursor.is-clicking .click-ring--2 { animation: click-ring 720ms cubic-bezier(0.16, 1, 0.3, 1) 160ms forwards; }
@keyframes click-ring { 0% { opacity: .95; transform: scale(.15); } 100% { opacity: 0; transform: scale(2.6); } }
.cursor .arrow { fill: #000; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.cursor .ibeam { opacity: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.ghost svg { fill: rgba(255,255,255,.35); }
.ghost { opacity: 0; }
.flick-layer .ghost { opacity: .35; }

/* the caption is a sibling of the scaled stage (inside the viewport) so it never shrinks with it */
.stage__caption {
  position: absolute; left: 16px; right: 16px; bottom: 18px; text-align: center; z-index: 2; pointer-events: none;
  font-size: var(--fs-caption); line-height: 1.4; color: var(--muted);
  display: grid; text-wrap: balance;
}
/* the four lines share one grid cell so a wrapped line still sits on the bottom edge */
.stage__caption span { grid-area: 1 / 1; opacity: 0; transition: opacity 300ms var(--ease); }
.stage-viewport[data-cap="1"] .stage__caption span:nth-child(1),
.stage-viewport[data-cap="2"] .stage__caption span:nth-child(2),
.stage-viewport[data-cap="3"] .stage__caption span:nth-child(3),
.stage-viewport[data-cap="4"] .stage__caption span:nth-child(4),
.stage-viewport[data-cap="5"] .stage__caption span:nth-child(5) { opacity: 1; }

/* yielding to the visitor's real pointer (the wrapper fades; the loop never touches it) */
.stage__actors { position: absolute; inset: 0; pointer-events: none; transition: opacity 200ms var(--ease); }


.stage__under { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 14px; min-height: 20px; }
.replay {
  display: none; align-items: center; min-height: 40px; font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); transition: color var(--d-fast) var(--ease); border-radius: 4px; padding: 0 8px; margin-left: -8px;
}
.replay:hover { color: var(--text); }
.js .replay { display: inline-flex; }
.stage__touchcap { display: none; font-size: var(--fs-caption); color: var(--muted); text-align: right; }
@media (pointer: coarse) { .stage__touchcap { display: block; } }

/* ==========================================================================
   Popup component
   ========================================================================== */
.popup {
  position: absolute; left: 0; top: 0; width: 340px;
  border-radius: var(--r-popup); border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-popup); font-family: var(--font-popup); color: var(--text);
  transform-origin: 8% 8%; overflow: hidden; isolation: isolate;
  font-size: 13px; line-height: 1.3;
}
.popup__glass { position: absolute; inset: 0; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-radius: inherit; z-index: -1; }
.popup--flat .popup__glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-flat); }
/* Safari keeps painting a backdrop-filter even when its parent sits at opacity 0, so the popup
   uses a flat tint while it fades in or out, and is fully hidden between loops */
.popup.is-fading .popup__glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(20,20,22,.9); }
.popup.is-hidden { visibility: hidden; }
.popup--tint .popup__glass { background: var(--glass-heavy); }
.popup--glassflat .popup__glass { background: rgba(20,20,22,.9); }
.popup__tint { position: absolute; inset: 0; background: var(--glass-heavy); border-radius: inherit; z-index: -1; opacity: 1; transition: opacity 600ms var(--ease); }
.popup__sheen {
  position: absolute; top: -50%; left: 0; width: 60%; height: 200%; z-index: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%);
  transform: translateX(-120%);
}
.popup__head { position: relative; height: 40px; padding: 0 12px 0 14px; display: flex; align-items: center; gap: 8px; }
.ic { color: rgba(245,245,247,.85); flex: none; }
.popup__title { font-size: 13px; font-weight: 600; }
.popup__count { position: relative; display: inline-grid; place-items: center; height: 17px; min-width: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--glass-count); font-size: 10.5px; font-weight: 600; margin-left: 2px; }
.popup__count > span { grid-area: 1 / 1; transition: opacity 200ms var(--ease); }
.popup__count .n4 { opacity: 0; }
.popup__spacer { flex: 1; }
.popup__btn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: rgba(245,245,247,.85); }
.popup__btn--real:hover { background: rgba(255,255,255,.08); }
.popup__rule { height: 1px; margin: 0 12px; background: var(--hairline); }
.popup__quick { padding: 8px 12px; }
.popup__capsule {
  position: relative; height: 32px; border-radius: var(--r-pill); background: var(--glass-capsule);
  padding: 0 12px; display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.popup__capsule::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--accent-2); opacity: 0; transition: opacity 200ms var(--ease); pointer-events: none; }
.popup.is-typed .popup__capsule::after { opacity: 1; }
.popup__field { position: relative; flex: 1; height: 100%; display: flex; align-items: center; min-width: 0; }
.popup__placeholder { color: rgba(245,245,247,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 120ms var(--ease); }
.popup__typed { position: absolute; left: 0; top: 0; height: 100%; display: flex; align-items: center; white-space: pre; pointer-events: none; }
.popup__typed .c { opacity: 0; }
.popup.is-typed .popup__placeholder { opacity: 0; }
.popup.is-typed .popup__typed .c { opacity: 1; }
.popup__caret { position: absolute; left: 0; top: 8px; width: 1px; height: 16px; background: var(--text); opacity: 0; }
.popup__caret.is-blinking { animation: blink 1s steps(2, start) infinite; }
.popup.is-typed .popup__caret.is-static { opacity: 1; transform: translateX(217px); }
@keyframes blink { to { opacity: 0; } }
.popup__listview { position: relative; height: 138px; overflow: hidden; }
.popup__listview--auto { height: auto; }
.popup__listview--two { height: 92px; }
.popup__list { position: relative; }
.row { position: relative; height: 46px; padding: 6px 14px 6px 12px; display: flex; align-items: center; gap: 10px; }
.row + .row, .row + .swatches, .swatches + .row { border-top: 1px solid var(--hairline); }
.row > div { min-width: 0; flex: 1; }
.bar { position: relative; flex: none; width: 4px; height: 26px; border-radius: 2px; background: var(--c); overflow: hidden; }
.bar__flash { position: absolute; inset: 0; background: var(--accent); opacity: 0; }
.row b { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row small { display: block; font-size: 10.5px; color: #B4B4B9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row--hover::before { content: ""; position: absolute; inset: 3px 6px; border-radius: var(--r-row); background: rgba(255,255,255,.05); }
.row__tools { display: inline-flex; gap: 8px; color: rgba(245,245,247,.8); flex: none; }
.swatches { display: flex; gap: 8px; padding: 6px 12px 6px 26px; height: 28px; align-items: center; }
.sw { width: 16px; height: 16px; border-radius: 50%; background: var(--c); }
.sw.is-selected { box-shadow: 0 0 0 1.5px var(--text), 0 0 0 3px var(--glass-flat); }
.popup--fading { opacity: .22; }

/* live popup (JS writes translate to `transform` per frame and the entrance to `scale`, separately) */
.popup--live { position: fixed; left: 0; top: 0; z-index: 60; opacity: 0; scale: .94; }
.popup--live[hidden] { display: none; }
.popup__capsule--input { cursor: text; }
.popup__capsule--input input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; padding: 0; }
.popup__capsule--input input::placeholder { color: rgba(245,245,247,.55); }
.popup__capsule--input:focus-within::after { opacity: 1; }
.popup__capsule--input input:focus-visible { box-shadow: none; }

/* hero rest state: the "Saved" end frame (note in the list, field cleared, focus still in the capsule), no JS needed */
.stage[data-state="rest"] .popup--hero { transform: translate(398px, 224px); opacity: 1; }
.stage[data-state="rest"] .popup__list { transform: none; }
.stage[data-state="rest"] .row--new { opacity: 1; }
.stage[data-state="rest"] .popup__count .n3 { opacity: 0; }
.stage[data-state="rest"] .popup__count .n4 { opacity: 1; }
.stage[data-state="rest"] .popup__placeholder { opacity: 1; }
.stage[data-state="rest"] .popup__capsule::after { opacity: 1; }
.stage[data-state="rest"] .cursor { transform: translate(568px, 286px); }
.stage[data-state="rest"] .cursor .arrow { opacity: 0; }
.stage[data-state="rest"] .cursor .ibeam { opacity: 1; }
.stage[data-state="rest"] .bloom { opacity: .35; }
.stage[data-state="live"] .popup--hero { opacity: 0; transform: translate(318px, 214px) scale(.94); }
.stage[data-state="live"] .popup__list { transform: translateY(-46px); }
.stage[data-state="live"] .row--new { opacity: 0; }
.stage[data-state="live"] .cursor { transform: translate(250px, 210px); }

/* ==========================================================================
   How it works (pinned, stepped)
   ========================================================================== */
.flick { height: 300vh; padding: 0; }
/* sentinels are bands tiling the section; the observer watches a 1vh line at the viewport centre,
   so beats switch at ~70vh and ~130vh of the 200vh pinned range (~46vh / ~94vh of 140vh below 1024) */
.flick__sentinel { position: absolute; left: 0; width: 1px; pointer-events: none; }
.flick__sentinel[data-sentinel="1"] { top: 0; height: 40%; }
.flick__sentinel[data-sentinel="2"] { top: 40%; height: 20%; }
.flick__sentinel[data-sentinel="3"] { top: 60%; height: 40%; }
.flick-sticky {
  position: sticky; top: 0; height: 100svh;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; align-content: center;
  max-width: var(--container); margin: 0 auto; padding: 72px var(--gutter) 0;
}
.flick__text .h2 { margin-top: var(--s-4); font-size: clamp(2rem, 3.6vw, 3.25rem); }
.beats { margin-top: var(--s-7); display: grid; gap: var(--s-5); }
.beat { display: grid; grid-template-columns: 32px 1fr; gap: 16px; align-items: baseline; opacity: .45; transform: translateY(8px); transition: opacity 400ms var(--ease), transform 400ms var(--ease); }
.beat__n { font-family: var(--font-mono); font-size: var(--fs-eyebrow); color: var(--muted); letter-spacing: .12em; }
.beat__word { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-beat); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
.beat__body { margin-top: 10px; color: var(--muted); max-width: 46ch; font-size: var(--fs-body); }
.flick[data-beat="1"] .beat:nth-child(1),
.flick[data-beat="2"] .beat:nth-child(2),
.flick[data-beat="3"] .beat:nth-child(3) { opacity: 1; transform: none; }
/* the pinned column must fit 100svh at every width: only the active beat shows its body */
.beat__body { display: none; }
.flick[data-beat="1"] .beat:nth-child(1) .beat__body,
.flick[data-beat="2"] .beat:nth-child(2) .beat__body,
.flick[data-beat="3"] .beat:nth-child(3) .beat__body { display: block; }
@media (max-height: 720px) {
  .flick__text .h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
  .beats { gap: var(--s-4); }
}

.flick-viewport { position: relative; width: 100%; max-width: 520px; height: calc(400px * var(--flick-scale, 1)); overflow: hidden; border-radius: var(--r-stage); box-shadow: var(--shadow-stage); justify-self: center; }
.flick-stage { position: absolute; left: 0; top: 0; width: 520px; height: 400px; transform: scale(var(--flick-scale, 1)); transform-origin: top left; }
.flick-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 600ms var(--ease); }
.flick[data-beat="1"] .flick-layer[data-layer="1"],
.flick[data-beat="2"] .flick-layer[data-layer="2"],
.flick[data-beat="3"] .flick-layer[data-layer="3"] { opacity: 1; }

@media (max-width: 1023px) {
  .flick { height: 240vh; }
  .flick-sticky { grid-template-columns: 1fr; gap: var(--s-6); align-content: center; align-content: safe center; }
  /* short viewports: the column is 56px padding + demo + 32px gap + up to ~370px of text, so cap the demo's width
     (its ResizeObserver scales it 1.3:1) at what fits; "safe center" (where supported) pushes any residue below the fold */
  .flick-viewport { order: -1; max-width: min(520px, max(300px, calc((100svh - 470px) * 1.3))); }
  .beats { margin-top: var(--s-5); gap: var(--s-4); }
  .beat__body { font-size: var(--fs-small); max-width: 72ch; } /* one line in the full-width column keeps the pinned stack under 100svh */
  .flick-sticky { padding-top: 56px; }
}
@media (max-width: 599px) {
  .beat { grid-template-columns: 1fr; }
  .beat__n { display: none; }
  .flick__text .h2 { font-size: clamp(1.8rem, 8vw, 2.6rem); }
  .beat__word { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .beat__body { margin-top: 4px; }
}

/* ==========================================================================
   Details
   ========================================================================== */
.anno { margin-top: var(--s-8); display: grid; grid-template-columns: 1fr 420px 1fr; gap: 40px; align-items: center; }
.anno__col { display: grid; gap: var(--s-6); }
.callout { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; }
.callout h3 { font-weight: 500; font-size: 1.125rem; }
.callout p { margin-top: 6px; color: var(--muted); font-size: var(--fs-small); max-width: 30ch; }
.marker { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono); font-size: var(--fs-eyebrow); font-weight: 500; line-height: 1; margin-top: 4px; flex: none; }
.marker--on { position: absolute; left: var(--x); top: var(--y); margin: 0; transform: translate(-50%, -50%); z-index: 2; box-shadow: 0 0 0 2px rgba(0,0,0,.5); }
.anno__col--left .callout { text-align: right; grid-template-columns: 1fr 20px; }
.anno__col--left .callout > .marker { order: 2; }
.anno__col--left .callout p { margin-left: auto; }
.callout::after {
  content: ""; position: absolute; top: 14px; width: 40px; height: 1px; background: var(--hairline-strong);
  transition: transform 600ms var(--ease); transition-delay: calc(var(--i, 0) * var(--stagger) + 200ms);
}
.js .callout:not(.is-in)::after { transform: scaleX(0); }
.anno__col--left .callout::after { right: -44px; transform-origin: left center; }
.anno__col--right .callout::after { left: -44px; transform-origin: right center; }
.callout.is-in::after { transform: scaleX(1); }
.js .reveal--x:not(.is-in) { transform: translateX(-12px); }
.js .anno__col--right .reveal--x:not(.is-in) { transform: translateX(12px); }
.reveal--x.is-in { transform: none; }
.anno__panel {
  position: relative; width: 420px; height: 340px; border-radius: 24px; overflow: hidden; justify-self: center;
  background:
    radial-gradient(55% 45% at 18% 12%, var(--wall-bloom-y), transparent 70%),
    radial-gradient(55% 45% at 88% 92%, var(--wall-bloom-b), transparent 70%),
    var(--wall-dark);
  box-shadow: var(--shadow-stage);
}
.anno__scaler { position: absolute; left: 50%; top: 50%; width: 340px; height: 255px; transform: translate(-50%, -50%) scale(1.1); }
.popup--anno { position: relative; overflow: visible; }
.popup--anno .popup__glass { background: var(--glass); }


@media (max-width: 1023px) {
  .anno { grid-template-columns: 1fr; gap: var(--s-6); }
  .anno__panel { grid-row: 1; width: 100%; max-width: 420px; }
  .anno__col--left, .anno__col--right { gap: var(--s-5); }
  .anno__col--left .callout { text-align: left; grid-template-columns: 20px 1fr; }
  .anno__col--left .callout > .marker { order: 0; }
  .anno__col--left .callout p { margin-left: 0; }
  .callout::after { display: none; }
  .callout p { max-width: 44ch; }
  .js .reveal--x:not(.is-in), .js .anno__col--right .reveal--x:not(.is-in) { transform: translateY(28px); }
  .anno__col--right { margin-top: calc(-1 * var(--s-6) + var(--s-5)); }
}
@media (max-width: 479px) {
  .anno__panel { height: 300px; }
  .anno__scaler { transform: translate(-50%, -50%) scale(.86); }
}

/* ==========================================================================
   Liquid Glass
   ========================================================================== */
.glass { padding: 0; height: 220vh; }
/* bands tiling the section (see .flick__sentinel): steps switch at ~40vh and ~80vh of the 120vh pinned range */
.glass__sentinel { position: absolute; left: 0; width: 1px; pointer-events: none; }
.glass__sentinel[data-sentinel="0"] { top: 0; height: 41%; }
.glass__sentinel[data-sentinel="1"] { top: 41%; height: 18%; }
.glass__sentinel[data-sentinel="2"] { top: 59%; height: 41%; }
.glass-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.wall { position: absolute; inset: 0; }
.wall--light { background: linear-gradient(135deg, var(--wall-light-a), var(--wall-light-b)); }
.wall--dark {
  background:
    radial-gradient(60% 50% at 20% 15%, var(--wall-bloom-y), transparent),
    radial-gradient(60% 50% at 85% 85%, var(--wall-bloom-b), transparent),
    var(--wall-dark);
  opacity: 0; transition: opacity 600ms var(--ease);
}
.glass[data-step="2"] .wall--dark { opacity: 1; }
.glass__center { position: absolute; inset: 0; display: grid; place-items: center; }
.popup--glass { position: relative; }
.glass[data-step="2"] .popup__tint { opacity: 0; }
.glass[data-step="1"] .popup--glass .popup__sheen { animation: sheen 700ms var(--ease) forwards; }
@keyframes sheen { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
/* the popup is centred and 340px wide: cap the text so it can never reach the popup's left edge */
.glass__text {
  position: absolute; left: calc(var(--gutter) + 48px); bottom: calc(var(--gutter) + 48px);
  max-width: min(34ch, calc(50vw - 170px - var(--gutter) - 48px - 32px));
  color: var(--on-light-text); transition: color 400ms var(--ease);
}
@media (max-width: 1279px) { .glass__text .h2 { font-size: clamp(2rem, 3.6vw, 3rem); } }
.glass__text .eyebrow { color: var(--on-light-muted); transition: color 400ms var(--ease); }
.glass__body { margin-top: var(--s-5); font-size: var(--fs-small); color: var(--on-light-muted); transition: color 400ms var(--ease); }
/* the wallpaper only goes dark at step 2, so the text switches there */
.glass[data-step="2"] .glass__text { color: var(--text); }
.glass[data-step="2"] .glass__text .eyebrow,
.glass[data-step="2"] .glass__body { color: var(--muted); }
.glass__caps { position: absolute; right: calc(var(--gutter) + 48px); bottom: calc(var(--gutter) + 48px); display: grid; gap: 8px; text-align: right; font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: .12em; text-transform: uppercase; color: var(--on-light-text); transition: color 400ms var(--ease); }
.glass[data-step="2"] .glass__caps { color: var(--text); }
.glass__caps span { opacity: .35; transition: opacity 300ms var(--ease); }
.glass[data-step="0"] .glass__caps span[data-cap="0"],
.glass[data-step="1"] .glass__caps span[data-cap="1"],
.glass[data-step="2"] .glass__caps span[data-cap="2"] { opacity: 1; }

.glass-static { display: none; }
.glass__text--static { position: static; max-width: none; color: var(--text); }
.glass__text--static .eyebrow { color: var(--muted); }
.glass__text--static .glass__body { color: var(--muted); max-width: 56ch; }
.tiles { margin-top: var(--s-7); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tile { border-radius: 24px; overflow: hidden; padding: 24px 24px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.tile--light { background: linear-gradient(135deg, var(--wall-light-a), var(--wall-light-b)); }
.tile--light figcaption { color: var(--on-light-muted); }
.tile--dark { background: radial-gradient(60% 50% at 20% 15%, var(--wall-bloom-y), transparent), radial-gradient(60% 50% at 85% 85%, var(--wall-bloom-b), transparent), var(--wall-dark); }
.tile--flat { background: var(--surface); grid-column: 1 / -1; }
.tile figcaption { font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: center; }
.tile__scaler { position: relative; width: 300px; height: 160px; }
.tile__scaler .popup { transform: scale(.882); transform-origin: top left; }
.tile__scaler--sm { width: 240px; height: 128px; }
.tile__scaler--sm .popup { transform: scale(.706); }

@media (max-width: 1023px) {
  .glass { height: auto; padding: var(--section-pad) 0; }
  .glass__sentinel, .glass-sticky { display: none; }
  .glass-static { display: block; }
}
/* one column before a tile gets narrower than the 300px mockup plus breathing room */
@media (max-width: 719px) { .tiles { grid-template-columns: 1fr; } }

/* ==========================================================================
   Quiet (trust stats)
   ========================================================================== */
.stats { margin-top: var(--s-8); display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.mask { display: block; overflow: hidden; }
.stat__num { display: block; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-stat); line-height: 1; letter-spacing: var(--ls-stat); color: var(--accent); transition: transform var(--d-slow) var(--ease); transition-delay: calc(var(--i, 0) * 120ms); }
.js .rise:not(.is-in) .stat__num { transform: translateY(100%); }
.rise.is-in .stat__num { transform: none; }
.stat__meter { height: 1px; background: var(--hairline-strong); margin-top: 8px; transform-origin: left; transition: transform 900ms var(--ease) 300ms; }
.js .rise:not(.is-in) .stat__meter { transform: scaleX(0); }
.rise.is-in .stat__meter { transform: scaleX(1); }
.stat__label { margin-top: 16px; font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat__body { margin-top: 10px; color: var(--muted); max-width: 30ch; font-size: var(--fs-small); }
@media (max-width: 819px) {
  .stats { grid-template-columns: 1fr; gap: var(--s-7); }
  .quiet .h2 { text-align: left; }
  .quiet .eyebrow--center { text-align: left; }
}

/* ==========================================================================
   Buy
   ========================================================================== */
.buy__inner { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter); }
.price-card { margin-top: var(--s-8); background: var(--surface); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-price); padding: 40px; }
.js .price-card:not(.is-in) { transform: translateY(24px); }
.price-card.is-in { transform: none; }
.price-card__top { display: flex; align-items: center; gap: 14px; font-weight: 500; }
.price-card__top img { border-radius: 14px; }
.price-line { margin-top: var(--s-5); display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.price { display: block; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-price); line-height: 1; letter-spacing: var(--ls-stat); transition: transform var(--d-slow) var(--ease) 100ms; }
.js .rise:not(.is-in) .price { transform: translateY(100%); }
.rise.is-in .price { transform: none; }
.price-note { font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--muted); }
.gets { margin-top: var(--s-5); }
.gets li { padding: 12px 0; border-top: 1px solid var(--hairline); font-size: var(--fs-body); }
.gets li:last-child { border-bottom: 1px solid var(--hairline); }
.price-card .btn--buy { margin-top: var(--s-6); }
.checkout-note { margin-top: 12px; text-align: center; color: var(--muted); font-size: var(--fs-caption); }
.under-link { margin-top: 8px; text-align: center; color: var(--muted); font-size: var(--fs-small); }
.install { margin-top: 24px; border: 1px solid var(--hairline); border-radius: 16px; padding: 24px; }
.install h3 { font-weight: 500; font-size: 1.0625rem; }
.install p { margin-top: 6px; color: var(--muted); font-size: var(--fs-small); }
@media (max-width: 599px) {
  .price-card { padding: 28px; }
}

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq__inner { max-width: 800px; margin: 0 auto; padding: 0 var(--gutter); }
.faq-list { margin-top: var(--s-7); }
.faq-list details { border-bottom: 1px solid var(--hairline); transition-delay: calc(var(--i, 0) * 50ms); }
.faq-list summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; font-weight: 500; font-size: 1.125rem; border-radius: 6px; }
.faq-list summary::-webkit-details-marker { display: none; }
.plus { position: relative; flex: none; width: 12px; height: 12px; transition: transform 240ms var(--ease); }
.plus::before, .plus::after { content: ""; position: absolute; background: var(--muted); left: 50%; top: 50%; }
.plus::before { width: 12px; height: 1px; transform: translate(-50%, -50%); }
.plus::after { width: 1px; height: 12px; transform: translate(-50%, -50%); }
details[open] .plus { transform: rotate(45deg); }
.faq__a { padding-bottom: 20px; color: var(--muted); font-size: var(--fs-small); max-width: 62ch; }
details[open] .faq__a { animation: faqIn 240ms var(--ease); }
@keyframes faqIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.faq__a code { font-size: var(--fs-caption); background: var(--surface-2); border-radius: 4px; padding: 1px 5px; overflow-wrap: anywhere; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { border-top: 1px solid var(--hairline); padding: 48px 0 32px; }
.footer__grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.footer__brand { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.footer__brand img { border-radius: 6px; }
.footer__links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer__links a { color: var(--muted); transition: color var(--d-fast) var(--ease); border-radius: 4px; }
.footer__links a:hover { color: var(--text); }
.footer__mono { font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--muted); text-align: right; }
.footer__legal { margin-top: var(--s-6); color: var(--muted); font-size: var(--fs-caption); }
@media (max-width: 1023px) {
  .footer__grid { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .footer__mono { text-align: center; }
  .footer__legal { text-align: center; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .reveal { transition: none; }
  .js .reveal:not(.is-in), .js .reveal--x:not(.is-in), .js .anno__col--right .reveal--x:not(.is-in) { opacity: 1; transform: none; }
  .stat__num, .price, .stat__meter, .callout::after { transition: none; }
  .js .rise:not(.is-in) .stat__num, .js .rise:not(.is-in) .price, .js .rise:not(.is-in) .stat__meter,
  .js .callout:not(.is-in)::after { transform: none; }
  .js .hero__title .w, .js .hero .enter, .js .stage-wrap { opacity: 1; transform: none; animation: none; }
  .beat, .flick-layer, .wall--dark, .popup__tint, .glass__caps span, .glass__text, .glass__body, .glass__caps { transition: none; }
  .replay { display: none !important; }
  .js .price-card:not(.is-in) { transform: none; }
  .popup--live { transition: opacity 120ms linear; scale: 1; }
}
