:root {
  --orange: #ff8a2a;
  --bg: #0a0a0a;
  --text: #f5f5f0;
  --text-dim: #8a8a85;
  --card-bg: rgba(30, 28, 26, 0.55);
  --card-border: rgba(255, 255, 255, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body {
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }

/* ---------- Navbar ---------- */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  padding: 22px 0;
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: flex; align-items: center; }

.logo img {
  display: block;
  width: 108px;
  height: 108px;
  border-radius: 30px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 40px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: rgba(245, 245, 240, 0.85);
}

.nav-links a { transition: opacity 0.2s ease; }
.nav-links a:hover { opacity: 0.6; }

.btn-demo {
  background: #fff;
  color: #0a0a0a;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 11px 22px;
  border-radius: 999px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-demo:hover { background: var(--orange); transform: translateY(-1px); }

/* ---------- Story (continuous pinned background + scrolling chapters) ---------- */

.story {
  position: relative;
}

.story-canvas-wrap {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  margin-bottom: -100vh;
  overflow: hidden;
  z-index: 0;
  background: #000;
}

#story-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: url(#sharpen) contrast(1.05) saturate(1.06);
}

.chapter {
  position: relative;
  z-index: 5;
}

/* Hero stays pinned while frames 1-60 scrub (200vh of scroll), then releases. */
.chapter-hero { height: 300vh; }
.chapter-fall { height: 350vh; }

.chapter-visible {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5,5,5,0.95) 0%, rgba(5,5,5,0.6) 32%, rgba(5,5,5,0.22) 48%, rgba(5,5,5,0) 62%, rgba(5,5,5,0.55) 78%, rgba(5,5,5,0.92) 100%),
    linear-gradient(180deg, rgba(5,5,5,0.55) 0%, rgba(5,5,5,0) 22%, rgba(5,5,5,0) 72%, rgba(5,5,5,0.85) 100%);
}

.hero-content {
  position: relative;
  z-index: 3;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- Hero left ---------- */

.hero-left {
  max-width: 760px;
  padding-top: 40px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: rgba(245, 245, 240, 0.9);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 9px 18px;
  border-radius: 999px;
  margin-bottom: 30px;
}

.hero-title {
  font-size: clamp(38px, 5.6vw, 84px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.hero-title .line { display: block; overflow: hidden; white-space: nowrap; }
.hero-title .line > span { display: block; will-change: transform; }
.hero-title .line-solid:nth-child(2) { padding-left: 1.1em; }
.line-solid { color: var(--text); }
.line-fade > span {
  background: linear-gradient(90deg, rgba(245,245,240,0.75) 0%, rgba(245,245,240,0.15) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  max-width: 420px;
}

.desc-tick {
  flex-shrink: 0;
  width: 3px;
  border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--orange) 0 6px, transparent 6px 10px);
  opacity: 0.8;
}

.hero-desc p {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(245, 245, 240, 0.82);
}

.scroll-indicator {
  position: absolute;
  left: 48px;
  bottom: 40px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: rgba(245, 245, 240, 0.6);
}

.gauge {
  position: absolute;
  right: 300px;
  bottom: 24px;
  z-index: 3;
  width: 108px;
  height: 108px;
}

.gauge-ring {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 6px rgba(255, 138, 42, 0.5));
}

.gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.gauge-label strong {
  font-size: 20px;
  font-weight: 700;
}

.gauge-label small {
  font-size: 9px;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}

/* ---------- Hero right / cards ---------- */

.hero-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  width: 290px;
  min-height: 560px;
  flex-shrink: 0;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 18px 20px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 700;
  color: rgba(245, 245, 240, 0.95);
  margin-bottom: 8px;
}

.card-head svg { color: rgba(245, 245, 240, 0.5); width: 18px; height: 18px; }

/* Upgrade card */

.card-icon-wrap {
  display: flex;
  justify-content: center;
  padding: 2px 0 0;
  margin-bottom: -6px;
}
.card-icon-wrap svg { width: 56px; height: 56px; }
.card-upgrade .card-head, .card-contract .card-head { margin-bottom: 4px; font-size: 15px; }
.card-response .card-head { font-size: 15px; }
.card-response .ai-status { font-size: 13px; margin: 8px 0 12px; }
.card-response .ai-latency { padding-top: 10px; font-size: 12px; }
.card-response .ai-latency strong { font-size: 15px; }
.stat strong { font-size: 17px; }

.spark-icon { filter: drop-shadow(0 0 10px rgba(255,255,255,0.35)); }

.card-sub-head {
  font-size: 12px;
  font-weight: 600;
  color: rgba(245, 245, 240, 0.85);
  margin-bottom: 4px;
}

.card-note {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.mini-chart {
  position: relative;
  height: 40px;
  margin-top: 14px;
}

.chart-tag {
  position: absolute;
  top: -14px;
  right: 6px;
  font-size: 9px;
  font-weight: 700;
  color: var(--orange);
  background: rgba(255, 138, 42, 0.15);
  padding: 2px 6px;
  border-radius: 999px;
}

.chart-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 60%;
}

.chart-bars {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.chart-bars span {
  flex: 1;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px 2px 0 0;
}

/* Contract card */

.donut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 12px;
}

.learn-more {
  font-size: 11px;
  color: rgba(245, 245, 240, 0.55);
  display: flex;
  align-items: center;
  gap: 3px;
}

.donut-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}

.donut { width: 100%; height: 100%; }

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

.donut-center small { font-size: 12px; font-weight: 600; margin-left: 1px; }

.bubble {
  position: absolute;
  background: #1c1c1c;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
}

.bubble-top { top: -6px; right: -14px; }
.bubble-bot { bottom: 4px; left: -18px; }

.stat-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 12px;
}

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat strong { font-size: 20px; font-weight: 700; }
.stat small { font-size: 10.5px; color: var(--text-dim); }

/* AI response card */

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 10px 3px rgba(255,138,42,0.6);
}

.ai-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(245, 245, 240, 0.82);
  margin: 12px 0 18px;
}

.ai-status .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
  margin-top: 6px;
  flex-shrink: 0;
}

.ai-latency {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
  font-size: 14px;
}

.ai-latency small { color: var(--text-dim); }
.ai-latency strong { font-size: 18px; font-weight: 700; }

/* Care highlights card */

.care-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.care-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: rgba(245, 245, 240, 0.88);
  line-height: 1.35;
}

.icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-badge svg { width: 18px; height: 18px; }

.icon-green { background: rgba(120, 210, 120, 0.18); color: #86dd86; }
.icon-blue { background: rgba(90, 168, 255, 0.18); color: #5aa8ff; }
.icon-purple { background: rgba(178, 130, 255, 0.18); color: #b98cff; }

/* ---------- Fall detection / vitals chapter ---------- */

.fall-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5,5,5,0.94) 0%, rgba(5,5,5,0.78) 26%, rgba(5,5,5,0.12) 46%, rgba(5,5,5,0.12) 58%, rgba(5,5,5,0.78) 76%, rgba(5,5,5,0.94) 100%),
    linear-gradient(180deg, rgba(5,5,5,0.6) 0%, rgba(5,5,5,0) 24%, rgba(5,5,5,0) 74%, rgba(5,5,5,0.85) 100%);
}

.fall-beam {
  position: absolute;
  top: -20%;
  left: 8%;
  width: 340px;
  height: 160%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 200, 120, 0.4) 35%, rgba(255, 170, 80, 0.28) 55%, transparent 90%);
  transform: rotate(18deg);
  filter: blur(38px);
  mix-blend-mode: screen;
  opacity: 0.7;
}

.fall-beam-2 {
  left: auto;
  right: 18%;
  width: 200px;
  transform: rotate(-14deg);
  opacity: 0.4;
  filter: blur(46px);
}

.fall-content {
  position: relative;
  z-index: 4;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 48px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

/* Left */

.fall-left {
  width: 440px;
  flex-shrink: 0;
}

.fall-left .badge { margin-bottom: 20px; padding: 8px 16px; font-size: 11px; }

.fall-title {
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--text);
  text-shadow: 0 6px 34px rgba(0,0,0,0.85);
  margin-bottom: 18px;
}

.fall-title .line { display: block; white-space: nowrap; }
.line-bold { font-weight: 700; }
.line-light { font-weight: 300; }

.fall-lead {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(245, 245, 240, 0.8);
  text-shadow: 0 4px 20px rgba(0,0,0,0.8);
  margin-bottom: 24px;
}

.feature-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  margin-bottom: 26px;
}

.feature { display: flex; align-items: flex-start; gap: 12px; }
.feature strong { display: block; font-size: 13.5px; font-weight: 700; line-height: 1.25; color: var(--text); }
.feature small { display: block; font-size: 12px; line-height: 1.4; color: var(--text-dim); margin-top: 3px; }
.feature .icon-badge { width: 38px; height: 38px; }

.icon-red { background: rgba(255, 105, 105, 0.18); color: #ff7a7a; }
.icon-teal { background: rgba(60, 210, 190, 0.18); color: #4fd8c4; }

.btn-learn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: #0a0a0a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 12px 22px;
  border-radius: 999px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn-learn:hover { background: var(--orange); transform: translateY(-1px); }

/* Right */

.fall-right {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fall-right .card { padding: 16px 18px; border-radius: 20px; }
.fall-right .card-head { font-size: 14px; margin-bottom: 10px; }

.card-alert { border-color: rgba(255, 138, 42, 0.35); }
.card-alert .card-head small { font-size: 11px; font-weight: 500; color: var(--text-dim); }
.alert-title { display: flex; align-items: center; gap: 8px; }
.alert-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #ff4d4d; color: #fff;
}
.alert-text { font-size: 13px; line-height: 1.45; color: rgba(245,245,240,0.85); }

.live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-dim);
}
.live .pulse-dot { width: 7px; height: 7px; }

.vitals-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vital { display: flex; flex-direction: column; gap: 2px; }
.vital-wave { width: 100%; height: 20px; margin-bottom: 6px; }
.vital strong { font-size: 22px; font-weight: 700; line-height: 1; }
.vital strong em { font-style: normal; font-size: 10px; font-weight: 600; color: var(--text-dim); margin-left: 3px; }
.vital small { font-size: 10.5px; color: var(--text-dim); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 600; color: #86dd86;
  background: rgba(120, 210, 120, 0.14); border-radius: 999px; padding: 4px 9px;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #86dd86; }

.sleep-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.sleep-score strong { display: block; font-size: 34px; font-weight: 700; line-height: 1; color: var(--orange); }
.sleep-score small { font-size: 10.5px; color: var(--text-dim); }
.hypno { flex: 1; height: 42px; display: flex; align-items: flex-end; gap: 3px; }
.hypno span { flex: 1; background: linear-gradient(180deg, rgba(90,168,255,0.85), rgba(90,168,255,0.25)); border-radius: 2px; }

.sleep-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  border-top: 1px solid rgba(255,255,255,0.08); padding-top: 10px;
}
.sleep-stats strong { display: block; font-size: 15px; font-weight: 700; }
.sleep-stats small { font-size: 10.5px; color: var(--text-dim); }
.sleep-note { margin-top: 10px; font-size: 11.5px; line-height: 1.4; color: rgba(245,245,240,0.65); }

/* ---------- Demo modal ---------- */

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,5,5,0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-panel {
  position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 40px); overflow-y: auto;
  background: rgba(24,22,20,0.92); border: 1px solid var(--card-border); border-radius: 26px; padding: 34px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 60px rgba(255,138,42,0.12);
}
.modal-panel h2 { font-size: 30px; font-weight: 600; margin: 4px 0 6px; }
.modal-sub { font-size: 14px; color: var(--text-dim); margin-bottom: 22px; }
.modal-panel .badge { margin-bottom: 16px; padding: 7px 14px; font-size: 11px; }
.modal-close {
  position: absolute; top: 18px; right: 18px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--card-border); background: rgba(255,255,255,0.06); color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.modal-close:hover { background: rgba(255,255,255,0.14); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; letter-spacing: .06em; font-weight: 600; color: rgba(245,245,240,0.8); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; padding: 12px 14px; outline: none; resize: vertical;
  transition: border-color .2s, background .2s;
}
.field input:focus, .field textarea:focus { border-color: var(--orange); background: rgba(255,255,255,0.09); }
.field.invalid input, .field.invalid textarea { border-color: #ff5a4f; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-error { color: #ff7a70; font-size: 13px; margin: 0 0 12px; }
.btn-submit {
  width: 100%; border: 0; cursor: pointer; background: #fff; color: #0a0a0a; font: inherit; font-size: 13px;
  font-weight: 700; letter-spacing: .06em; padding: 14px; border-radius: 999px; transition: background .2s, transform .2s;
}
.btn-submit:hover { background: var(--orange); transform: translateY(-1px); }
.btn-submit:disabled { opacity: .6; cursor: wait; transform: none; }
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 110; max-width: 90vw;
  background: rgba(24,22,20,0.95); border: 1px solid var(--card-border); border-radius: 999px;
  padding: 14px 24px; font-size: 14px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.toast[hidden] { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero-content { flex-direction: column; justify-content: center; gap: 40px; padding-top: 100px; }
  .hero-right { width: 100%; max-width: 360px; min-height: 0; }
  .hero-left { padding-top: 0; }
  .gauge { right: 24px; bottom: 90px; width: 80px; height: 80px; }

  /* Content is taller than the viewport on small screens: let it scroll naturally. */
  .chapter-fall { height: auto; }
  .chapter-fall .chapter-visible { position: relative; height: auto; min-height: 100vh; overflow: visible; }
  .fall-vignette { background: rgba(5,5,5,0.82); }
  .fall-content { flex-direction: column; align-items: stretch; height: auto; gap: 28px; padding: 130px 24px 60px; }
  .fall-left, .fall-right { width: 100%; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* ---------- Fall section: larger right-hand cards ---------- */

.fall-left { width: min(390px, 27vw); min-width: 340px; }
.fall-right { width: min(372px, 26vw); min-width: 330px; gap: 14px; }
.fall-right .card { padding: 20px 22px; border-radius: 22px; }
.fall-right .card-head { font-size: 17px; margin-bottom: 12px; }
.card-alert .card-head small { font-size: 13px; }
.alert-icon { width: 26px; height: 26px; }
.alert-text { font-size: 15px; }
.live { font-size: 11px; }
.vital-wave { height: 26px; margin-bottom: 8px; }
.vital strong { font-size: 28px; }
.vital strong em { font-size: 12px; }
.vital strong.ok { color: #86dd86; }
.vital small { font-size: 12.5px; }
.status-pill { font-size: 11.5px; padding: 5px 11px; }
.sleep-score strong { font-size: 44px; }
.sleep-score small { font-size: 12.5px; }
.hypno { height: 54px; }
.sleep-stats strong { font-size: 18px; }
.sleep-stats small { font-size: 12.5px; }
.sleep-note { font-size: 13px; }

@media (max-width: 900px) {
  .fall-left, .fall-right { width: 100%; min-width: 0; }
}

/* ---------- Fall section: columns sized to the space beside the device ---------- */
/* --left-w / --right-w are set from JS (layoutFall) using the device's on-screen edges. */

.fall-left {
  width: var(--left-w, min(360px, 26vw));
  min-width: 0;
  container-type: inline-size;
}
.fall-right { width: var(--right-w, min(372px, 26vw)); min-width: 0; }

.fall-title { font-size: clamp(30px, 13.2cqw, 68px); margin-bottom: 16px; }
.fall-lead { font-size: clamp(15px, 4.6cqw, 19px); line-height: 1.5; margin-bottom: 22px; color: rgba(245,245,240,0.88); }
.feature-grid { grid-template-columns: 1fr; gap: 14px; margin-bottom: 24px; }
.feature { align-items: center; gap: 14px; }
.feature .icon-badge { width: 44px; height: 44px; }
.feature .icon-badge svg { width: 22px; height: 22px; }
.feature strong { font-size: clamp(15px, 5cqw, 18px); }
.feature small { font-size: clamp(12.5px, 3.9cqw, 14.5px); margin-top: 2px; color: rgba(245,245,240,0.62); }
.btn-learn { font-size: 15px; padding: 14px 26px; }

@media (max-width: 900px) {
  .fall-left, .fall-right { width: 100%; }
}

.fall-content { max-width: 1760px; }

/* ---------- Seamless hand-off between sections ---------- */
/* Vignettes/beams live on the fixed canvas layer and crossfade on scroll (see main.js),
   so no section edge is ever visible. The fall section also overlaps the hero's tail. */

.chapter-fall { margin-top: -35vh; }
.fall-vignette, .fall-beam { opacity: 0; }

@media (max-width: 900px) {
  .chapter-fall { margin-top: -20vh; }
}

/* ---------- Section 3: sleep & respiratory insights ---------- */

.chapter-fall, .chapter-sig, .chapter-footer { margin-top: -35vh; }
.chapter-fall { height: 300vh; }
.chapter-sig { height: 300vh; }

.sig-content {
  position: relative;
  z-index: 4;
  height: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 104px 48px 28px;
  display: flex;
  flex-direction: column;
}

.sig-top {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding-top: 20px;
}

.sig-left { width: var(--left-w, min(360px, 26vw)); container-type: inline-size; flex-shrink: 0; }
.sig-right { width: var(--right-w, min(372px, 26vw)); flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }

.sig-left .badge { margin-bottom: 18px; padding: 8px 16px; font-size: 11px; }

.sig-title {
  font-size: clamp(30px, 12.4cqw, 68px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 6px 34px rgba(0,0,0,0.85);
  margin-bottom: 18px;
}
.sig-title span { display: block; white-space: nowrap; }

.sig-lead {
  font-size: clamp(14px, 4.4cqw, 18px);
  line-height: 1.55;
  color: rgba(245,245,240,0.86);
  text-shadow: 0 4px 20px rgba(0,0,0,0.8);
  margin-bottom: 20px;
}

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: rgba(245,245,240,0.9);
  background: rgba(20,18,16,0.5); border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 999px; padding: 9px 15px;
}
.chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-orange { background: var(--orange); box-shadow: 0 0 8px rgba(255,138,42,.7); }
.dot-blue { background: #5aa8ff; }
.dot-green { background: #86dd86; }
.dot-purple { background: #b98cff; }

.sig-right .card { padding: 18px 20px; border-radius: 20px; }
.sig-right .card-head { font-size: 15px; margin-bottom: 10px; }
.card-tag { font-size: 11px; font-weight: 500; color: var(--text-dim); }

.breath-wave { width: 100%; height: 64px; display: block; }
.breath-meta { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.breath-meta strong { font-size: 26px; font-weight: 700; }
.breath-meta em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-left: 3px; }
.breath-meta small { font-size: 12px; color: var(--text-dim); }

.stage { display: grid; grid-template-columns: 48px 1fr 38px; align-items: center; gap: 10px; font-size: 12.5px; margin-top: 10px; color: rgba(245,245,240,0.82); }
.stage i { height: 8px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; display: block; }
.stage b { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ff8a2a, #ffb36b); }
.stage em { font-style: normal; text-align: right; color: var(--text-dim); font-weight: 600; }

.sig-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 16px; }
.sig-stat {
  background: rgba(40, 24, 16, 0.45); border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 20px; padding: 16px 22px;
}
.sig-stat strong { display: block; font-size: clamp(26px, 2.6vw, 38px); font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; }
.sig-stat em { font-style: normal; font-size: 0.5em; font-weight: 600; margin-left: 4px; color: rgba(245,245,240,0.75); }
.sig-stat small { display: block; margin-top: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(245,245,240,0.62); }

@media (max-width: 900px) {
  .chapter-fall, .chapter-sig { height: auto; margin-top: -20vh; }
  .chapter-sig .chapter-visible { position: relative; height: auto; min-height: 100vh; overflow: visible; }
  .sig-content { height: auto; padding: 120px 24px 60px; flex-direction: column; align-items: stretch; }
  .sig-top { flex-direction: column; gap: 24px; }
  .sig-left, .sig-right { width: 100%; }
  .sig-stats { grid-template-columns: 1fr 1fr; }
}

/* ---------- Hero: orbiting step cards ---------- */

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.orbit { position: absolute; inset: 0; z-index: 3; pointer-events: none; --c: 200px; }

.orbit-track { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.orbit-track path { stroke: rgba(255, 255, 255, 0.12); stroke-width: 1; stroke-dasharray: 3 7; }

.orbit-card {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--c);
  height: var(--c);
  border-radius: 22px;
  overflow: hidden;
  container-type: inline-size;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 138, 42, 0.12);
  will-change: transform, opacity;
  opacity: 0;
}

.orbit-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.oc-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0) 26%, rgba(6,6,8,0.6) 50%, rgba(6,6,8,0.95) 100%);
}
.orbit-card::after { content: ""; position: absolute; inset: 0; background: #000; opacity: var(--dim, 0); pointer-events: none; }

.oc-num {
  position: absolute; top: 6cqw; left: 6cqw;
  width: 12cqw; height: 12cqw; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--orange); color: #140b03; font-size: 6.6cqw; font-weight: 800;
  box-shadow: 0 4px 16px rgba(255, 138, 42, 0.45);
}

.oc-text { position: absolute; left: 7cqw; right: 7cqw; bottom: 7cqw; z-index: 1; }
.oc-text h3 { font-size: 7.8cqw; line-height: 1.15; font-weight: 700; color: #fff; letter-spacing: -0.005em; }
.oc-text p { margin-top: 1.8cqw; font-size: 5.7cqw; line-height: 1.35; color: rgba(255, 255, 255, 0.86); }

@media (max-width: 900px) {
  .scroll-indicator { left: 24px; bottom: 24px; }
}

/* ---------- Hero taglines (gold display type + travelling beam) ---------- */

.hero-tag {
  position: absolute;
  inset: 0;
  z-index: 3;
  max-width: 1760px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.tag {
  position: relative;
  --fs: var(--hero-fs, 40px);
  font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs);
  line-height: 1.08;
  letter-spacing: -0.01em;
  filter: drop-shadow(0 4px 22px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px rgba(226, 178, 104, 0.18));
}
.tag-left { width: var(--left-w, 340px); text-align: left; }
.tag-right { width: var(--right-w, 340px); text-align: right; }

.tag .ln { display: block; white-space: nowrap; }
.tag .caps { font-weight: 800; }
.tag .low { font-weight: 600; }
.tag .w { display: inline-block; white-space: nowrap; }

/* Each letter carries the same block-sized gold gradient (offset by JS) plus a shared, moving highlight
   band (--beam), so the beam reads as one continuous light across the whole tagline. */
.tag .ch {
  display: inline-block;
  color: transparent;
  background-image:
    linear-gradient(100deg, transparent calc(var(--beam, -400px) - 110px), rgba(255, 248, 228, 0.95) var(--beam, -400px), transparent calc(var(--beam, -400px) + 110px)),
    linear-gradient(180deg, #ebcf96 0%, #d3a865 52%, #b98b4a 100%);
  background-size: var(--tw, 100%) var(--th, 100%);
  background-position: var(--bx, 0) var(--by, 0);
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
}

@media (max-width: 900px) {
  .hero-tag { flex-direction: column; justify-content: space-between; padding: 150px 24px 90px; }
  .tag-left, .tag-right { width: 100%; text-align: center; }
  .tag { --fs: clamp(22px, 7.2vw, 34px); }
}

@media (prefers-reduced-motion: reduce) {
  .tag .ch { background-image: linear-gradient(180deg, #ebcf96 0%, #d3a865 52%, #b98b4a 100%); }
}

/* ---------- Hero taglines v2: Anton caps + Playfair italic, cinematic gold beam ---------- */

.tag {
  font-family: "Anton", "Impact", "Arial Narrow", sans-serif;
  line-height: 0.98;
  letter-spacing: 0.005em;
  filter: drop-shadow(0 6px 30px rgba(0, 0, 0, 0.7));
}
.tag .ln { line-height: 1; }
.tag .caps { font-family: "Anton", "Impact", "Arial Narrow", sans-serif; font-weight: 400; text-transform: uppercase; }
.tag .low {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 0.78em;
  letter-spacing: -0.01em;
}
.tag-left .ln:nth-child(2) { padding-left: 0.5em; }

/* Ivory letters; a wide gold band with a hot core travels through them (--beam is tweened by GSAP). */
.tag .ch {
  background-image:
    linear-gradient(100deg,
      transparent calc(var(--beam, -400px) - 190px),
      rgba(214, 150, 52, 0.7) calc(var(--beam, -400px) - 80px),
      rgba(255, 226, 150, 1) var(--beam, -400px),
      rgba(214, 150, 52, 0.7) calc(var(--beam, -400px) + 80px),
      transparent calc(var(--beam, -400px) + 190px)),
    linear-gradient(180deg, #fdfbf3 0%, #f5f5f0 55%, #e4dfd0 100%);
}

/* Soft blurred glow that exists only where the beam is, so the light seems to bloom off the letters. */
.tag-bloom {
  position: absolute;
  inset: 0;
  font: inherit;
  text-align: inherit;
  pointer-events: none;
  filter: blur(11px);
  mix-blend-mode: screen;
  opacity: 0.95;
}
.tag-bloom .ch {
  background-image: linear-gradient(100deg,
    transparent calc(var(--beam, -400px) - 210px),
    rgba(255, 168, 56, 0.75) var(--beam, -400px),
    transparent calc(var(--beam, -400px) + 210px));
}

@media (prefers-reduced-motion: reduce) {
  .tag .ch { background-image: linear-gradient(180deg, #fdfbf3 0%, #f5f5f0 55%, #e4dfd0 100%); }
  .tag-bloom { display: none; }
}

.tag .low { line-height: 1.32; }

/* ---------- Hero v3: both taglines left, cinematic accordion right ---------- */

.hero-tag { align-items: center; }
.tag-col { width: var(--left-w, 340px); flex-shrink: 0; display: flex; flex-direction: column; }
.tag-col .tag { width: 100%; text-align: left; }
.tag-col .tag + .tag { margin-top: 0.62em; }

/* Accordion: one open panel, the rest slim rows. Photos share one colour grade + light film grain
   so four differently-lit pictures read as a single set. */

.hero-acc {
  --ease: cubic-bezier(0.77, 0, 0.175, 1);
  width: var(--right-w, 340px);
  height: min(64vh, 540px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.acc-item {
  position: relative;
  isolation: isolate;
  flex: 1 1 0;
  min-height: 0;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  background: #0d0d0f;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 18px 44px rgba(0, 0, 0, 0.45);
  transition: flex-grow 0.95s var(--ease), box-shadow 0.8s ease;
}
.acc-item.is-active {
  flex-grow: 5.6;
  box-shadow: 0 0 0 1px rgba(236, 196, 124, 0.55), 0 26px 70px rgba(0, 0, 0, 0.6), 0 0 50px rgba(255, 150, 40, 0.22);
}
.acc-item:focus-visible { box-shadow: 0 0 0 2px #fff, 0 18px 44px rgba(0, 0, 0, 0.45); }

/* Photo (slow push-out on the open panel; kept subtle so the image stays sharp) */
.acc-media { position: absolute; inset: 0; z-index: -3; }
.acc-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  filter: brightness(0.62) saturate(0.9) contrast(1.04);
  transition: transform 6s cubic-bezier(0.2, 0.6, 0.2, 1), filter 0.9s ease;
}
.acc-item:not(.is-active):hover .acc-media img { filter: brightness(0.82) saturate(1) contrast(1.04); }
.acc-item.is-active .acc-media img { transform: scale(1); filter: saturate(1.05) contrast(1.05); }

/* Open panel: top/bottom shading + a faint warm wash that ties the photos to the brand. */
.acc-grade {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 6, 5, 0.4) 0%, rgba(8, 6, 5, 0) 26%, rgba(8, 6, 5, 0) 44%, rgba(8, 6, 5, 0.92) 100%),
    linear-gradient(120deg, rgba(255, 140, 40, 0.14) 0%, rgba(255, 140, 40, 0) 55%);
  transition: opacity 0.8s ease;
}
.acc-item:not(.is-active) .acc-grade { opacity: 0; }

/* Closed row: left-weighted scrim keeps the title legible over any photo. */
.acc-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(6, 6, 8, 0.9) 0%, rgba(6, 6, 8, 0.6) 55%, rgba(6, 6, 8, 0.32) 100%);
  transition: opacity 0.8s ease;
}
.acc-item.is-active::before { opacity: 0; }

.acc-grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* "Step n of 4" pill, top-left of the open panel */
.acc-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(10, 8, 6, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.4s ease, transform 0.5s ease;
}
.acc-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 8px rgba(255, 138, 42, 0.9); }
.acc-item.is-active .acc-pill { opacity: 1; transform: none; transition-delay: 0.45s; }

/* Text block */
.acc-text {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 11px;
  z-index: 2;
  display: grid;
  grid-template-columns: 32px 1fr 20px;
  column-gap: 12px;
  align-items: start;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.75);
}
.acc-num {
  grid-column: 1;
  grid-row: 1;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}
.acc-item.is-active .acc-num {
  color: #140b03;
  border-color: transparent;
  background: var(--orange);
  box-shadow: 0 4px 16px rgba(255, 138, 42, 0.5);
}
.acc-text h3 {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.5s ease;
}
.acc-item.is-active .acc-text h3 {
  font-size: 17px;
  line-height: 1.22;
  padding-top: 5px;
  font-weight: 700;
  color: #fff;
  white-space: normal;
}
.acc-chev {
  grid-column: 3;
  grid-row: 1;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  transition: opacity 0.4s ease, transform 0.6s ease;
}
.acc-item:hover .acc-chev { color: #fff; }
.acc-item.is-active .acc-chev { opacity: 0; transform: rotate(180deg); }
.acc-text p {
  grid-column: 2 / 4;
  grid-row: 2;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.9s var(--ease), opacity 0.4s ease, margin-top 0.9s ease;
}
.acc-item.is-active .acc-text p { max-height: 5.8em; opacity: 1; margin-top: 4px; transition-delay: 0s, 0.45s, 0s; }

/* Progress bar for the auto-advance timer */
.acc-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  z-index: 3;
  background: linear-gradient(90deg, #f0b84f, #ffe29a);
  box-shadow: 0 0 12px rgba(255, 200, 100, 0.7);
}
.acc-item.is-active .acc-bar { animation: accbar var(--acc-ms, 4800ms) linear forwards; }
.hero-acc.is-paused .acc-item.is-active .acc-bar { animation-play-state: paused; }
@keyframes accbar { from { width: 0; } to { width: 100%; } }

@media (max-width: 900px) {
  .hero-tag { flex-direction: column; justify-content: flex-start; gap: 22px; padding: 132px 20px 36px; }
  .tag-col { width: 100%; }
  .hero-acc { width: 100%; height: 38vh; }
  .tag { --fs: clamp(22px, 7vw, 32px); }
}

@media (prefers-reduced-motion: reduce) {
  .acc-item, .acc-media img, .acc-text p, .acc-pill { transition: none; }
  .acc-item.is-active .acc-bar { animation: none; width: 100%; }
}

/* ---------- Footer (final frames): frosted card, warm glow, blurred wordmark ---------- */

.chapter-footer { height: 300vh; }

.ft {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 28px 28px;
  pointer-events: none;
}

.ft-card {
  --ft-grad: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(214, 120, 70, 0.55) 42%, rgba(255, 214, 176, 0.98) 100%);
  position: relative;
  pointer-events: auto;
  width: 100%;
  max-width: 1760px;
  height: min(50vh, 460px);
  border-radius: 28px;
  overflow: hidden;
  container-type: inline-size;
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.8), rgba(17, 17, 17, 0.62));
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  backdrop-filter: blur(20px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  font-family: "Sora", "Helvetica Neue", Arial, sans-serif;
}

/* Warm light rising from the bottom edge (brightens as the last frames play) */
.ft-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 92% at 88% 114%, rgba(255, 160, 110, 0.95) 0%, rgba(226, 110, 58, 0.7) 28%, rgba(120, 52, 26, 0.38) 55%, transparent 78%),
    radial-gradient(46% 56% at 12% 120%, rgba(214, 96, 52, 0.55) 0%, transparent 70%);
}

.ft-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 34px 0;
}

.ft-nav { display: flex; flex-direction: column; gap: 10px; }
.ft-nav a {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: #fff;
  transition: opacity 0.2s ease, transform 0.25s ease;
}
.ft-nav a:hover { opacity: 0.65; transform: translateX(3px); }

.ft-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.ft-social { display: flex; gap: 16px; margin-bottom: 10px; }
.ft-social a { display: block; width: 22px; height: 22px; color: #fff; transition: color 0.2s ease, transform 0.25s ease; }
.ft-social a:hover { color: var(--orange); transform: translateY(-2px); }
.ft-social svg { display: block; width: 100%; height: 100%; }
.ft-line { font-size: 14.5px; color: rgba(255, 255, 255, 0.74); transition: color 0.2s ease; }
a.ft-line:hover { color: #fff; }
.ft-line.dim { color: rgba(255, 255, 255, 0.52); }

/* Giant wordmark: crisp at the top, dissolving into a soft blur toward the bottom. */
.ft-word {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.05em;
  z-index: 1;
  text-align: center;
  font-size: 18cqw;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.86;
  white-space: nowrap;
  user-select: none;
  color: transparent;
  background-image: var(--ft-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-mask-image: linear-gradient(180deg, #000 26%, rgba(0, 0, 0, 0.22) 80%);
  mask-image: linear-gradient(180deg, #000 26%, rgba(0, 0, 0, 0.22) 80%);
}
.ft-word::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  background-image: var(--ft-grad);
  -webkit-background-clip: text;
  background-clip: text;
  filter: blur(10px);
  -webkit-mask-image: linear-gradient(180deg, transparent 36%, #000 88%);
  mask-image: linear-gradient(180deg, transparent 36%, #000 88%);
}

@media (max-width: 900px) {
  .chapter-footer { height: auto; margin-top: -20vh; }
  .chapter-footer .chapter-visible { position: relative; height: auto; min-height: 100vh; overflow: hidden; }
  .ft { position: relative; min-height: 100vh; padding: 0 14px 14px; }
  .ft-card { height: auto; min-height: 64vh; display: flex; flex-direction: column; }
  .ft-top { flex-direction: column; gap: 26px; padding: 26px 22px 0; }
  .ft-right { align-items: flex-start; text-align: left; }
  .ft-word { position: relative; margin-top: auto; bottom: -0.04em; font-size: 17.5cqw; }
}

/* ---------- Footer: compact card so more of the device shows (desktop) ---------- */

@media (min-width: 901px) {
  .ft-card { height: clamp(280px, 35vh, 320px); }
  .ft-top { padding: 26px 34px 0; }
  .ft-nav { flex-direction: row; align-items: center; gap: 28px; }
  .ft-nav a { font-size: 17px; }
  .ft-right { gap: 6px; }
  .ft-social { margin-bottom: 6px; }
  .ft-word { font-size: 15cqw; letter-spacing: 0.07em; }
}

/* ---------- Navbar logo: heartbeat animation ---------- */
/* One 2.8s "lub-dub" drives everything: the mark pulses, the glow swells, a ripple leaves the border,
   and a light runs along the logo's own pulse line. The PNG artwork itself is never altered. */

.logo {
  --beat: 2.8s;
  --beat-delay: 1.5s;
  position: relative;
  width: 108px;
  height: 108px;
  display: block;
}

.logo-mark, .logo-beat, .logo-lift { display: block; position: relative; width: 100%; height: 100%; }

/* entrance: soft-focus scale-in that settles with a small overshoot */
.logo-mark { animation: logoIn 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both; }
@keyframes logoIn {
  0%   { opacity: 0; transform: scale(0.66) rotate(-14deg); filter: blur(10px); }
  55%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}

/* heartbeat: lub-dub */
.logo-beat { animation: logoBeat var(--beat) ease-in-out var(--beat-delay) infinite; transform-origin: 50% 55%; }
@keyframes logoBeat {
  0%, 34%, 100% { transform: scale(1); }
  8%  { transform: scale(1.055); }
  16% { transform: scale(0.995); }
  24% { transform: scale(1.03); }
}

/* hover: lift + tilt (own layer so it never fights the keyframes above) */
.logo-lift { transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1); }
.logo:hover .logo-lift { transform: scale(1.08) rotate(-3deg); }
.logo:active .logo-lift { transform: scale(0.96); transition-duration: 0.15s; }

.logo img { position: relative; z-index: 1; }

/* glow behind the mark, swelling with each beat */
.logo-halo {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 140, 60, 0.55), rgba(255, 120, 50, 0.24) 46%, rgba(20, 150, 120, 0.18) 66%, transparent 80%);
  filter: blur(10px);
  opacity: 0;
  animation: haloIn 1.4s ease 0.3s forwards, haloBeat var(--beat) ease-in-out var(--beat-delay) infinite;
}
@keyframes haloIn { to { opacity: 0.4; } }
@keyframes haloBeat {
  0%, 34%, 100% { opacity: 0.32; transform: scale(1); }
  8%  { opacity: 0.85; transform: scale(1.08); }
  16% { opacity: 0.5; }
  24% { opacity: 0.68; transform: scale(1.04); }
}
.logo:hover .logo-halo { opacity: 0.95 !important; }

/* ripple leaving the rounded border on each beat */
.logo-ring {
  position: absolute;
  inset: 3px;
  border-radius: 32px;
  pointer-events: none;
  border: 1.5px solid rgba(70, 220, 175, 0.75);
  opacity: 0;
  animation: logoRing var(--beat) ease-out var(--beat-delay) infinite;
}
@keyframes logoRing {
  0%   { opacity: 0; transform: scale(1); }
  6%   { opacity: 0.65; }
  62%  { opacity: 0; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* light sweep, masked to the logo's own strokes (transparent interior stays untouched) */
.logo-shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  -webkit-mask: url("../assets/brand/logo-mark.png") center / contain no-repeat;
  mask: url("../assets/brand/logo-mark.png") center / contain no-repeat;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.9) 50%, transparent 62%);
  background-size: 300% 100%;
  background-position: 80% 0;
  opacity: 0.75;
  animation: logoShine 6s cubic-bezier(0.4, 0, 0.2, 1) 2.4s infinite;
}
@keyframes logoShine {
  0%   { background-position: 80% 0; }
  30%  { background-position: 20% 0; }
  100% { background-position: 20% 0; }
}

/* a mint highlight travels along the logo's pulse line, once per beat */
.logo-ecg {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.logo-ecg path {
  fill: none;
  stroke: #c9fff0;
  stroke-width: 22;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16 130;
  stroke-dashoffset: 16;
  filter: drop-shadow(0 0 3px rgba(110, 255, 210, 0.95)) drop-shadow(0 0 7px rgba(60, 220, 170, 0.6));
  animation: logoEcg var(--beat) cubic-bezier(0.45, 0, 0.35, 1) var(--beat-delay) infinite;
}
@keyframes logoEcg {
  0%   { stroke-dashoffset: 16; }
  38%  { stroke-dashoffset: -100; }
  100% { stroke-dashoffset: -100; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-mark, .logo-beat, .logo-halo, .logo-ring, .logo-shine, .logo-ecg path { animation: none; }
  .logo-halo { opacity: 0.35; }
  .logo-ring, .logo-shine, .logo-ecg { display: none; }
}

/* ---------- Navigation: current-section indicator + mobile menu ---------- */

.nav-cta { display: flex; align-items: center; gap: 12px; }

.nav-links a { position: relative; padding: 6px 0; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, #f0b84f, #ffe29a);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-links a.is-current { color: #fff; }
.nav-links a.is-current::after,
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  border-radius: 2px;
  background: #fff;
  transition: top 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-toggle span:nth-child(1) { top: 18px; }
.nav-toggle span:nth-child(2) { top: 25px; }
.navbar.nav-open .nav-toggle span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.navbar.nav-open .nav-toggle span:nth-child(2) { top: 21.5px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .nav-inner { padding: 0 18px; }
  .nav-toggle { display: block; }
  .nav-links {
    display: flex;
    position: fixed;
    top: 148px;
    left: 14px;
    right: 14px;
    z-index: 60;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    font-size: 14px;
    background: rgba(14, 14, 14, 0.94);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.4s;
  }
  .navbar.nav-open .nav-links { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav-links a { padding: 14px 16px; border-radius: 12px; }
  .nav-links a::after { left: 16px; right: auto; width: 26px; bottom: 8px; }
  .nav-links a.is-current { background: rgba(255, 255, 255, 0.07); }
}

/* Footer nav: hover uses colour only, so it never fights the reveal animation (which drives opacity/transform). */
.ft-nav a { transition: color 0.2s ease; }
.ft-nav a:hover { opacity: 1; transform: none; color: rgba(255, 255, 255, 0.6); }
