/* ============================================================
   Movapoint 3D waitlist site - HTML overlay styling
   The 3D scene renders on a fixed canvas behind these layers.
   Same brand system as the flat site:
   warm near-black + crimson · Anton / Instrument Serif / Inter
   ============================================================ */

:root {
  --bg: #070605;
  --surface: #14100f;
  --line: #2a221f;
  --text: #f5f1ee;
  --muted: #a89b94;
  --red: #e2373f;
  --red-deep: #b91c2e;
  --red-glow: rgba(226, 55, 63, 0.35);
  --caption-shadow:
    0 2px 4px rgba(0, 0, 0, 0.92),
    0 10px 26px rgba(0, 0, 0, 0.82);
  --caption-box-bg: rgba(7, 6, 5, 0.82);
  --caption-box-border: rgba(245, 241, 238, 0.1);
  --caption-box-shadow:
    0 18px 56px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --font-display: "Anton", "Arial Narrow", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* the hidden attribute must win over any display rule below */
[hidden] { display: none !important; }

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--red); color: #fff; }

/* the page scrolls, the world moves */
.scroll-space { height: 700vh; }

/* ---------- 3D stage ---------- */

#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
}
#stage canvas { display: block; }

/* ---------- loader ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
  transition: opacity 0.8s ease, visibility 0.8s;
}
.loader.done { opacity: 0; visibility: hidden; }

.loader-word {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 4rem);
  letter-spacing: 0.14em;
}
.loader-word span { color: var(--red); }

.loader-sub {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  font-size: 1.1rem;
}

.loader-bar {
  width: min(240px, 60vw);
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.loader-bar i {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--red);
  border-radius: 2px;
  animation: loadslide 1.1s ease-in-out infinite;
}
@keyframes loadslide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(260%); }
}

/* ---------- HUD ---------- */

.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 40;
  background: rgba(255, 255, 255, 0.05);
}
.progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red-deep), var(--red));
  box-shadow: 0 0 12px var(--red-glow);
}

.hud-header {
  position: fixed;
  top: 3px; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 48px);
  pointer-events: none;
}
.hud-header > * { pointer-events: auto; }

.wordmark {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.14em;
  color: var(--text);
  text-decoration: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
.wordmark::after { content: "."; color: var(--red); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: rgba(10, 9, 8, 0.55);
  border: 1px solid rgba(245, 241, 238, 0.14);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.lang-switch button {
  min-width: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font: 700 0.68rem var(--font-body);
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.lang-switch button:hover {
  color: var(--text);
  background: rgba(245, 241, 238, 0.08);
}

.lang-switch button.active {
  color: #fff;
  background: rgba(226, 55, 63, 0.8);
  box-shadow: 0 0 18px rgba(226, 55, 63, 0.22);
}

.nav-cta {
  font: 600 0.9rem var(--font-body);
  color: var(--text);
  background: rgba(226, 55, 63, 0.12);
  backdrop-filter: blur(8px);
  padding: 10px 20px;
  border: 1px solid rgba(226, 55, 63, 0.55);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
}
.nav-cta:hover { border-color: var(--red); background: rgba(226, 55, 63, 0.24); }

.hud-location {
  position: fixed;
  top: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 39;
  display: flex;
  align-items: center;
  gap: 9px;
  font: 600 0.72rem var(--font-body);
  letter-spacing: 0.22em;
  color: var(--muted);
  background: rgba(10, 9, 8, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  white-space: nowrap;
  transition: opacity 0.4s;
}
.hud-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 var(--red-glow);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--red-glow); }
  70%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- story captions ---------- */

.caption {
  position: fixed;
  z-index: 30;
  max-width: 560px;
  padding: 0 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  text-shadow: var(--caption-shadow);
}

/* Keep hidden overlays inert. On iOS, fixed translucent layers and their
   child animations can still cost memory/compositing even at opacity:0. */
.caption.visible,
.finale.visible,
.logdemo.visible {
  visibility: visible;
  will-change: opacity;
}
.caption:not(.visible) *,
.finale:not(.visible) *,
.logdemo:not(.visible) * {
  animation-play-state: paused !important;
}
.logdemo:not(.visible) .adv-toggle:not(.used) { animation: none; }

/* adaptive-quality fallback (set from main.js when a device can't hold
   ~45fps): live backdrop blur is one of the priciest effects on weak
   GPUs, and the panels are near-opaque anyway */
.perf-lite .caption-panel,
.perf-lite .caption-left,
.perf-lite .caption-right,
.perf-lite .caption-center,
.perf-lite .logdemo-card,
.perf-lite .eyebrow,
.perf-lite .hud-location,
.perf-lite .nav-cta,
.perf-lite .waitlist-form input[type="email"] {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.caption.live { pointer-events: auto; }

.caption-left,
.caption-right {
  width: min(560px, calc(100vw - 48px));
  padding: 26px 30px 28px;
  background: var(--caption-box-bg);
  border: 1px solid var(--caption-box-border);
  border-radius: 8px;
  box-shadow: var(--caption-box-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.caption-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(var(--caption-panel-width, 720px), 100%);
  padding: var(--caption-panel-padding, 28px 34px 32px);
  background: var(--caption-box-bg);
  border: 1px solid var(--caption-box-border);
  border-radius: 8px;
  box-shadow: var(--caption-box-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
}

.caption-hero .caption-panel {
  --caption-panel-width: 720px;
  --caption-panel-padding: 28px 34px 32px;
}

.caption-hero {
  inset: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.caption-left  { left: clamp(8px, 6vw, 96px);  top: 50%; transform: translateY(-50%); }
.caption-right { right: clamp(8px, 6vw, 96px); top: 50%; transform: translateY(-50%); text-align: right; }

/* centered story card, same treatment as the live logger card */
.caption-center {
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  padding: 26px 30px 28px;
  background: var(--caption-box-bg);
  border: 1px solid var(--caption-box-border);
  border-radius: 14px;
  box-shadow: var(--caption-box-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
}
.caption-center .sub { margin-inline: auto; }
.caption-center .caption-actions { justify-content: center; }

/* While the camera is moving (during scroll and the ease-out after it),
   drop the panels' backdrop blur. Re-rasterising a full-panel blur every
   frame while several panels cross-fade is the scroll-time cost; the blur
   returns the instant the camera settles, and it's imperceptible mid-motion
   anyway. Panels stay 82% opaque so text is readable with or without it. */
body.moving .caption-left,
body.moving .caption-right,
body.moving .caption-center,
body.moving .caption-panel,
body.moving .logdemo-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
body.moving .caption,
body.moving .finale,
body.moving .logdemo {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.88);
}
body.moving .eyebrow,
body.moving .hud-location,
body.moving .nav-cta,
body.moving .waitlist-form input[type="email"] {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.moving .caption-action-primary,
body.moving .logdemo-btn,
body.moving .waitlist-form button {
  box-shadow: none;
}
body.moving .pulse-dot,
body.moving .hud-dot,
body.moving .scroll-hint span,
body.moving .adv-toggle:not(.used) {
  animation-play-state: paused;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  margin-bottom: 30px;
  background: rgba(10, 9, 8, 0.55);
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 2.2s ease-out infinite;
}

.caption h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7.5vw, 5.2rem);
  line-height: 1.04;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  width: min(12ch, 100%);
  text-wrap: balance;
}

.caption-hero h1 {
  margin-inline: auto;
}

.caption-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}
.caption-hero .caption-actions,
.finale .caption-actions {
  justify-content: center;
}
.caption-right .caption-actions {
  justify-content: flex-end;
}
.caption-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  font: 700 0.88rem var(--font-body);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  text-shadow: none;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.caption-action::after {
  content: "→";
  font-size: 1.05em;
  line-height: 1;
}
.caption-action-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px -10px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.caption-action-secondary {
  background: rgba(245, 241, 238, 0.08);
  border: 1px solid rgba(245, 241, 238, 0.18);
}
.caption-action:hover {
  transform: translateY(-2px);
}
.caption-action-primary:hover {
  box-shadow: 0 14px 36px -10px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.caption-action-secondary:hover {
  background: rgba(245, 241, 238, 0.13);
  border-color: rgba(245, 241, 238, 0.3);
}
.caption-action:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.caption h2, .finale h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  line-height: 1.06;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.caption em, .finale em {
  font-family: var(--font-serif);
  font-style: italic;
  text-transform: lowercase;
  color: var(--red);
  font-size: 1.08em;
}

.cap-day {
  font: 600 0.76rem var(--font-body);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}

.sub {
  color: var(--muted);
  font-size: clamp(0.98rem, 1.5vw, 1.12rem);
  max-width: 560px;
  text-wrap: pretty;
}
.caption-hero .sub { margin-top: 22px; }
.sub b { color: var(--text); font-weight: 600; }

.scroll-hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  font: 600 0.72rem var(--font-body);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.scroll-hint span {
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, transparent, var(--red));
  animation: drip 1.6s ease-in-out infinite;
}
.scroll-hint b {
  font: inherit;
  font-weight: inherit;
}
@keyframes drip {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- finale ---------- */

.finale {
  position: fixed;
  inset: 0;
  z-index: 31;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  text-shadow: var(--caption-shadow);
}
.finale .caption-panel {
  --caption-panel-width: 940px;
  --caption-panel-padding: 42px 54px 46px;
}
.finale.live { pointer-events: auto; }

.finale h2 { font-size: clamp(2.35rem, 5.8vw, 4.7rem); }
.finale .sub {
  max-width: 660px;
  margin: 10px auto 30px;
  font-size: clamp(1.02rem, 1.6vw, 1.22rem);
}
.finale.signed-up .sub {
  margin-bottom: 18px;
}

.waitlist-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  width: min(640px, 100%);
}
.waitlist-form input[type="email"] {
  flex: 1 1 260px;
  padding: 16px 22px;
  font: 500 1rem var(--font-body);
  color: var(--text);
  background: rgba(20, 16, 15, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.waitlist-form input[type="email"]::placeholder { color: #6d635e; }
.waitlist-form input[type="email"]:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(226, 55, 63, 0.15);
}
.waitlist-form button {
  padding: 16px 30px;
  font: 700 1rem var(--font-body);
  color: #fff;
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 28px -8px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.waitlist-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px -8px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.waitlist-form button:disabled { opacity: 0.6; cursor: wait; transform: none; }

.waitlist-form button:focus-visible,
.nav-cta:focus-visible,
.wordmark:focus-visible,
.lang-switch button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* after a successful signup: hide the inputs, show the share hook */
.waitlist-form.done input[type="email"],
.waitlist-form.done button[type="submit"] { display: none; }

.waitlist-form.done {
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.share-btn {
  padding: 16px 34px;
  font: 700 1rem var(--font-body);
  color: #fff;
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 28px -8px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.2s, box-shadow 0.2s;
}
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px -8px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.share-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.form-status {
  flex-basis: 100%;
  font-size: 1rem;
  font-weight: 500;
  min-height: 1.4em;
  color: var(--muted);
}
.waitlist-form.done .form-status {
  flex: 0 1 auto;
  flex-basis: auto;
  width: min(660px, 100%);
  margin: 0;
  padding: 12px 0;
  line-height: 1.5;
}
.waitlist-form.done .share-btn {
  flex: 0 0 auto;
}
.waitlist-form.done + .microcopy { margin-top: 16px; }
.form-status.ok  { color: #7ed492; }
.form-status.err { color: #ff8a8f; }

.microcopy { margin-top: 12px; font-size: 0.85rem; color: #8a7f79; }

.finale-points {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  font: 600 0.78rem var(--font-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: center;
}
.finale-points i { color: var(--red); font-style: normal; }

/* ---------- optional "log a set" interactive beat ---------- */

.logdemo {
  position: fixed;
  z-index: 30;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  text-shadow: var(--caption-shadow);
}
.logdemo.live { pointer-events: auto; }
.logdemo-wide { width: min(560px, calc(100vw - 32px)); }
.logdemo.adv-open { width: min(520px, calc(100vw - 32px)); }

.logdemo-card {
  position: relative;
  padding: 16px 22px 14px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  scrollbar-width: none; /* failsafe scroll on tiny screens, without the bar */
  background: rgba(4, 3, 3, 0.88);
  border: 1px solid var(--caption-box-border);
  border-radius: 14px;
  box-shadow: var(--caption-box-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
}
.logdemo-card::-webkit-scrollbar { display: none; }
.logdemo .cap-day { margin-bottom: 8px; }
.logdemo h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.35rem, 3.4vw, 1.7rem);
  line-height: 1.08;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.logdemo h3 em {
  font-family: var(--font-serif);
  font-style: italic;
  text-transform: lowercase;
  color: var(--red);
  font-size: 1.08em;
}
.logdemo-last {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.logdemo-last b { color: var(--text); }

.logdemo-set {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 4px;
}
.fieldbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
/* the revealed RIR block sits between chip rows - keep it tight */
.adv-extra .logdemo-set { margin-bottom: 0; }
.fieldbox-label {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.fieldbox-unit { font-size: 0.68rem; color: #8a7f79; }

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(20, 16, 15, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stepper-btn {
  width: 30px; height: 30px;
  flex: none;
  border: none;
  border-radius: 8px;
  background: rgba(245, 241, 238, 0.06);
  color: var(--text);
  font: 400 1.4rem var(--font-body);
  line-height: 1;
  cursor: pointer;
  text-shadow: none;
  transition: background 0.15s;
}
.stepper-btn:hover { background: rgba(226, 55, 63, 0.28); }
.stepper-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.stepper-input {
  width: 60px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text);
  font: 700 1.2rem var(--font-body);
  outline: none;
}
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-input { -moz-appearance: textfield; appearance: textfield; }

.optrow { margin-top: 8px; text-align: center; }
.optrow-label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chips button {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(40, 32, 30, 0.6);
  color: var(--muted);
  font: 600 0.76rem var(--font-body);
  cursor: pointer;
  text-shadow: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chips button:hover { border-color: rgba(226, 55, 63, 0.5); color: var(--text); }
.chips button.sel {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.chips button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.logdemo-btn {
  position: relative;
  width: 100%;
  margin-top: 12px;
  padding: 13px 24px;
  font: 700 1rem var(--font-body);
  color: #fff;
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-shadow: none;
  box-shadow: 0 10px 30px -10px var(--red-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.15s, box-shadow 0.2s;
}
.logdemo-btn::before { content: "✓  "; }
.logdemo-btn:hover { transform: translateY(-2px); }
.logdemo-btn:active { transform: translateY(0) scale(0.98); }
.logdemo-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.logdemo-fx {
  position: relative; /* floats originate here, just under the Log button */
  height: 0;
  pointer-events: none;
}
.logdemo-float {
  position: absolute;
  left: 50%; bottom: 0;
  font: 400 1.7rem var(--font-display);
  color: #ffd0d3;
  text-shadow: 0 0 18px var(--red-glow);
  animation: floatUp 0.9s ease-out forwards;
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, 8px) scale(0.8); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -52px) scale(1.12); }
}

/* score + hint are always present, so the card never grows when you log */
.logdemo-score {
  margin-top: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.logdemo-score span {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--red);
  letter-spacing: 0.02em;
  vertical-align: -4px;
  margin-right: 6px;
}
.logdemo-hint {
  margin-top: 6px;
  min-height: 1.3em; /* reserved so text changes never reflow the card */
  font-size: 0.82rem;
  color: var(--muted);
}

/* advanced toggle: a small switch that reveals the detailed options */
.adv-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 7px 14px;
  font: 600 0.8rem var(--font-body);
  color: var(--muted);
  background: rgba(245, 241, 238, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  text-shadow: none;
  transition: color 0.15s, border-color 0.15s;
}
.adv-toggle:hover { color: var(--text); border-color: rgba(226, 55, 63, 0.45); }
.adv-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.adv-toggle-dot {
  position: relative;
  width: 30px; height: 16px;
  flex: none;
  border-radius: 999px;
  background: rgba(245, 241, 238, 0.16);
  transition: background 0.2s;
}
.adv-toggle-dot::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.adv-toggle[aria-pressed="true"] { color: var(--text); border-color: rgba(226, 55, 63, 0.55); }
.adv-toggle[aria-pressed="true"] .adv-toggle-dot { background: var(--red); }
.adv-toggle[aria-pressed="true"] .adv-toggle-dot::after { transform: translateX(14px); }

/* a soft glow pulse draws the eye to the toggle until it's been used once -
   it's how visitors discover the advanced half of the logger */
@keyframes togglePing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 55, 63, 0); }
  50%      { box-shadow: 0 0 0 5px rgba(226, 55, 63, 0.14), 0 0 20px rgba(226, 55, 63, 0.4); }
}
.adv-toggle:not(.used) {
  border-color: rgba(226, 55, 63, 0.5);
  animation: togglePing 2s ease-in-out infinite;
}
.adv-toggle:not(.used) .adv-toggle-dot { background: rgba(226, 55, 63, 0.45); }

.adv-extra {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin-top 0.35s ease;
}
.logdemo.adv-open .adv-extra { max-height: 340px; opacity: 1; margin-top: 6px; }
/* qualitative feedback ("Better form", "Felt easier"…) floats up like the
   points popup instead of sitting as a static chip row */
.logdemo-float-tag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 999px;
  font: 600 0.76rem var(--font-body);
  color: #ffd7d9;
  background: rgba(226, 55, 63, 0.2);
  border: 1px solid rgba(226, 55, 63, 0.55);
  text-shadow: none;
  opacity: 0;
  animation: floatUpTag 1.35s ease-out forwards;
}
@keyframes floatUpTag {
  0%   { opacity: 0; transform: translate(-50%, 12px) scale(0.9); }
  18%  { opacity: 1; }
  78%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(1); }
}
.logdemo-skip {
  margin-top: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a7f79;
}

.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- no-WebGL fallback ---------- */

.no-webgl {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  background:
    radial-gradient(60% 45% at 50% -5%, rgba(226, 55, 63, 0.16), transparent 70%),
    var(--bg);
}
.no-webgl h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 5rem);
  text-transform: uppercase;
  line-height: 1.05;
  margin-bottom: 18px;
}
.no-webgl em {
  font-family: var(--font-serif);
  font-style: italic;
  text-transform: lowercase;
  color: var(--red);
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .hud-header {
    padding: 18px 18px;
    gap: 10px;
  }

  .wordmark {
    font-size: 1.08rem;
    letter-spacing: 0.12em;
  }

  .header-actions {
    gap: 6px;
  }

  .lang-switch {
    gap: 2px;
    padding: 2px;
  }

  .lang-switch button {
    min-width: 29px;
    padding: 5px 6px;
    font-size: 0.62rem;
  }

  .nav-cta {
    padding: 8px 11px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .hud-location { top: auto; bottom: max(18px, env(safe-area-inset-bottom)); font-size: 0.6rem; }
  .scroll-hint { display: none; }

  .caption-left,
  .caption-right,
  .caption-center,
  .caption-panel,
  .logdemo-card {
    background: rgba(7, 6, 5, 0.68);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.42);
  }

  .caption-hero {
    justify-content: flex-end;
    padding: 92px 20px 136px;
  }

  .caption-hero .caption-panel {
    --caption-panel-width: 360px;
    --caption-panel-padding: 16px 18px 18px;
  }

  .caption-left, .caption-right {
    left: 20px; right: 20px;
    width: auto;
    padding: 16px 17px 18px;
    text-align: left;
    top: auto;
    bottom: max(108px, calc(env(safe-area-inset-bottom) + 84px));
    transform: none;
  }

  .caption-panel {
    --caption-panel-width: 360px;
    --caption-panel-padding: 18px 18px 20px;
  }

  .caption h1 {
    font-size: clamp(2.35rem, 11vw, 3.35rem);
    line-height: 0.98;
  }

  .caption h2,
  .finale h2 {
    font-size: clamp(1.45rem, 7.8vw, 2.15rem);
    line-height: 1;
    margin-bottom: 8px;
  }

  .caption em,
  .finale em {
    font-size: 1.02em;
  }

  .cap-day {
    margin-bottom: 7px;
    font-size: 0.58rem;
    letter-spacing: 0.15em;
  }

  .sub {
    max-width: 30ch;
    font-size: 0.92rem;
    line-height: 1.4;
  }

  .caption-hero .sub { margin-top: 10px; }

  .caption .sub + .sub {
    margin-top: 8px;
  }

  .caption-actions {
    gap: 8px;
    margin-top: 14px;
  }

  .caption-hero .caption-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .caption-right .caption-actions { justify-content: flex-start; }
  .caption-action {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.76rem;
  }

  .eyebrow {
    margin-bottom: 14px;
    padding: 7px 11px;
    font-size: 0.56rem;
    letter-spacing: 0.13em;
  }

  .finale {
    justify-content: flex-end;
    padding: 86px 16px 92px;
  }

  .finale .caption-panel {
    --caption-panel-width: 390px;
    --caption-panel-padding: 22px 20px 24px;
  }

  .finale .sub {
    max-width: 31ch;
    margin: 8px auto 18px;
  }

  .waitlist-form {
    gap: 9px;
  }

  .waitlist-form input[type="email"] {
    flex-basis: 100%;
    min-height: 46px;
    padding: 12px 16px;
    font-size: 0.92rem;
  }

  .waitlist-form button {
    min-height: 46px;
    padding: 12px 22px;
    font-size: 0.92rem;
  }

  .waitlist-form.done {
    gap: 18px;
  }

  .waitlist-form.done .form-status {
    padding: 10px 0;
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .share-btn {
    min-height: 46px;
    padding: 12px 24px;
    font-size: 0.92rem;
  }

  .microcopy {
    margin-top: 8px;
    font-size: 0.76rem;
  }

  .finale-points {
    gap: 8px 10px;
    margin-top: 18px;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
  }

  .logdemo {
    top: auto;
    bottom: max(92px, calc(env(safe-area-inset-bottom) + 68px));
    width: min(390px, calc(100vw - 28px));
    transform: translateX(-50%);
  }

  .logdemo-card {
    padding: 13px 14px 12px;
    max-height: min(68vh, 560px);
    max-height: min(68svh, 560px);
    background: rgba(4, 3, 3, 0.86);
    border-color: rgba(245, 241, 238, 0.16);
  }

  .logdemo.adv-open {
    bottom: max(34px, calc(env(safe-area-inset-bottom) + 24px));
    width: min(390px, calc(100vw - 24px));
  }

  .logdemo.adv-open .logdemo-card {
    padding: 14px 16px 14px;
    max-height: min(84vh, 700px);
    max-height: min(84svh, 700px);
    background: rgba(4, 3, 3, 0.9);
  }

  .logdemo .cap-day {
    margin-bottom: 6px;
  }

  .logdemo h3 {
    margin-bottom: 7px;
    font-size: clamp(1.45rem, 7.6vw, 2rem);
  }

  .logdemo.adv-open h3 {
    margin-bottom: 6px;
    font-size: clamp(1.38rem, 7.2vw, 1.9rem);
  }

  .logdemo-last {
    margin-bottom: 7px;
  }

  .logdemo.adv-open .logdemo-last {
    margin-bottom: 8px;
  }

  .logdemo-set {
    gap: 8px 10px;
  }

  .logdemo.adv-open .logdemo-set {
    gap: 8px 10px;
    margin-bottom: 2px;
  }

  .logdemo.adv-open .fieldbox {
    gap: 3px;
  }

  .logdemo.adv-open .fieldbox-label,
  .logdemo.adv-open .optrow-label {
    font-size: 0.57rem;
    letter-spacing: 0.14em;
  }

  .logdemo.adv-open .fieldbox-unit {
    font-size: 0.64rem;
  }

  .stepper {
    padding: 3px;
  }

  .stepper-btn {
    width: 28px;
    height: 28px;
  }

  .logdemo.adv-open .stepper-btn {
    width: 28px;
    height: 28px;
  }

  .stepper-input {
    width: 52px;
    font-size: 1.05rem;
  }

  .logdemo.adv-open .stepper-input {
    width: 52px;
    font-size: 1.05rem;
  }

  .optrow {
    margin-top: 6px;
  }

  .logdemo.adv-open .optrow {
    margin-top: 7px;
  }

  .chips {
    gap: 5px;
  }

  .chips button {
    padding: 4px 8px;
    font-size: 0.68rem;
  }

  .logdemo.adv-open .chips button {
    padding: 4px 9px;
    font-size: 0.66rem;
  }

  .adv-toggle {
    margin-top: 8px;
    padding: 6px 11px;
    font-size: 0.74rem;
  }

  .logdemo.adv-open .adv-toggle {
    margin-top: 8px;
    padding: 6px 12px;
  }

  .logdemo.adv-open .adv-extra {
    max-height: 330px;
    margin-top: 7px;
  }

  .logdemo-btn {
    margin-top: 10px;
    padding: 11px 18px;
    font-size: 0.92rem;
  }

  .logdemo.adv-open .logdemo-btn {
    margin-top: 10px;
    padding: 10px 16px;
  }

  .logdemo-score {
    margin-top: 7px;
    font-size: 0.68rem;
  }

  .logdemo.adv-open .logdemo-score {
    margin-top: 8px;
  }

  .logdemo-score span {
    font-size: 1.55rem;
  }

  .logdemo-hint {
    margin-top: 4px;
    font-size: 0.76rem;
  }

  .logdemo.adv-open .logdemo-hint {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .logdemo-float {
    font-size: 1.45rem;
  }

  .logdemo-float-tag {
    display: block;
    max-width: calc(100% - 24px);
    padding: 4px 9px;
    white-space: normal;
    font-size: 0.62rem;
    line-height: 1.12;
    background: rgba(82, 18, 24, 0.92);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
  }

  .logdemo-skip {
    display: none;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .pulse-dot, .hud-dot, .scroll-hint span, .loader-bar i { animation: none; }
  .logdemo-float, .logdemo-float-tag, .adv-toggle:not(.used) { animation: none; }
}
