/*
 * Covena website. The app's own palettes (Daylight light and dark, Ember),
 * its type (system font, light figures), soft glass surfaces, and one
 * motion system: a living 3D circle behind the page, scroll-driven scenes,
 * a cursor that responds.
 */

:root {
  --accent: #12A594;
  --accent-deep: #067A6F;
  --accent-soft: #E0F8F3;
  --accent-border: #AFDFD7;
  --on-accent: #FFFFFF;
  --gold: #F5B83D;
  --bg: #FBFCFD;
  --surface-soft: #F1F3F5;
  --surface: #FFFFFF;
  --border: #E6E8EB;
  --border-strong: #D7DBDF;
  --ink: #11181C;
  --ink-2: #687076;
  --ink-3: #889096;
  --success: #2A7E3B;
  --error: #CE2C31;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glow: rgba(18, 165, 148, 0.16);
  --shadow: 0 1px 2px rgba(17, 24, 28, 0.04), 0 12px 40px -18px rgba(17, 24, 28, 0.14);
  --phone-shadow: 0 40px 90px -40px rgba(17, 24, 28, 0.35);
  --wash-1: #E0F8F3; --wash-2: #FEFBE9;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "SF Arabic", "Geeza Pro", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 44px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="ember"]) {
    --accent: #12A594; --accent-deep: #0BD8B6; --accent-soft: #0D2D2A; --accent-border: #0D5C54;
    --gold: #FFC53D;
    --bg: #0E0F10; --surface-soft: #1B1D1F; --surface: #202325;
    --border: rgba(255, 255, 255, 0.08); --border-strong: rgba(255, 255, 255, 0.14);
    --ink: #ECEDEE; --ink-2: #9BA1A6; --ink-3: #787F85;
    --success: #71D083; --error: #FF9592;
    --glass: rgba(32, 35, 37, 0.55); --glass-strong: rgba(32, 35, 37, 0.8);
    --glow: rgba(11, 216, 182, 0.14);
    --shadow: 0 20px 60px -24px rgba(0, 0, 0, 0.7);
    --phone-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.8);
    --wash-1: #0D2D2A; --wash-2: #231F12;
    color-scheme: dark;
  }
}

:root[data-theme="ember"] {
  --accent: #E8875A; --accent-deep: #F0A47E; --accent-soft: #3A2A20; --accent-border: #5A3C2B;
  --on-accent: #1A1714; --gold: #E6B566;
  --bg: #1A1714; --surface-soft: #221E1A; --surface: #2A2520;
  --border: rgba(237, 230, 220, 0.08); --border-strong: rgba(237, 230, 220, 0.15);
  --ink: #EDE6DC; --ink-2: #B5AA9C; --ink-3: #8A8075;
  --success: #A9D3B2; --error: #E58A80;
  --glass: rgba(42, 37, 32, 0.55); --glass-strong: rgba(42, 37, 32, 0.82);
  --glow: rgba(232, 135, 90, 0.16);
  --shadow: 0 20px 60px -24px rgba(0, 0, 0, 0.75);
  --phone-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.85);
  --wash-1: #3A2619; --wash-2: #2B1F18;
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background:
    radial-gradient(60vw 60vw at 85% -10%, var(--wash-1), transparent 60%),
    radial-gradient(50vw 50vw at -10% 30%, var(--wash-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:lang(ar) body { font-family: var(--font-ar); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: 16px; top: -60px; z-index: 80; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; text-decoration: none; }
.skip:focus { top: 12px; }

main, .foot { position: relative; z-index: 2; }

/* ── The living circle ────────────────────────────────── */

.scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.6s var(--ease);
}

/* ── Cursor ───────────────────────────────────────────── */

.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none !important; }
  html.has-cursor .cursor { display: block; }
  .cursor-dot, .cursor-ring {
    position: fixed; top: 0; left: 0; z-index: 90; pointer-events: none; border-radius: 50%;
    will-change: transform;
  }
  .cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--ink); }
  .cursor-ring {
    width: 38px; height: 38px; margin: -19px 0 0 -19px;
    border: 1px solid var(--ink-3);
    transition: width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), background-color 0.35s, border-color 0.35s;
  }
  .cursor.hover .cursor-ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: var(--glow); border-color: transparent; }
  .cursor.press .cursor-ring { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
}

/* ── Type ─────────────────────────────────────────────── */

.eyebrow { font-size: 15px; font-weight: 500; color: var(--ink-2); margin-bottom: 18px; }
.title { font: 600 clamp(34px, 4.6vw, 60px)/1.05 var(--font-display); letter-spacing: -0.03em; max-width: 17ch; }
.body { color: var(--ink-2); font-size: 18px; max-width: 34em; }
.figure { font-family: var(--font-display); font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -0.025em; }
.figure-xl { font-size: clamp(60px, 6.4vw, 84px); line-height: 1; }
.card-label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.card-sub { font-size: 15px; color: var(--ink-2); }
.note { font-size: 14px; color: var(--ink-3); }
.faint { color: var(--ink-3); font-size: 14px; }
:lang(ar) .title, :lang(ar) .hero-title, :lang(ar) .story-title, :lang(ar) .closing-title { font-family: var(--font-ar); letter-spacing: 0; line-height: 1.25; }

/* Split text: each word slides up from behind a mask. */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split .w > span { display: inline-block; will-change: transform; }

/* ── Buttons ──────────────────────────────────────────── */

.pill-primary, .pill-glass {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 0 28px;
  border-radius: 999px;
  font-size: 17px; font-weight: 600;
  text-decoration: none;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.pill-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 30px -10px var(--accent); }
.pill-glass {
  background: var(--glass); border: 1px solid var(--border); color: var(--ink);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  cursor: pointer;
}
.pill-glass.small { min-height: 42px; padding: 0 18px; font-size: 15px; font-weight: 500; }
.pill-glass.static { cursor: default; font-weight: 500; font-size: 16px; color: var(--accent-deep); }
.magnetic > span { display: inline-block; pointer-events: none; }

/* ── Dock ─────────────────────────────────────────────── */

.dock {
  position: fixed; z-index: 50; top: 14px; left: 0; right: 0; margin-inline: auto;
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 8px 8px 22px;
  border-radius: 999px;
  background: var(--glass); border: 1px solid var(--border); box-shadow: var(--shadow);
  backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
  transition: transform 0.5s var(--ease);
}
.dock.hidden { transform: translateY(-140%); }
:lang(ar) .dock { padding: 8px 22px 8px 8px; }
.brand { font: 600 20px/1 var(--font-display); letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.dock-links { display: flex; gap: 2px; }
.dock-links a, .pill-quiet {
  text-decoration: none; color: var(--ink-2); font-size: 15px; padding: 9px 14px; border-radius: 999px;
  transition: background-color 0.25s, color 0.25s; border: none; background: transparent; cursor: pointer;
}
.dock-links a:hover, .pill-quiet:hover { color: var(--ink); background: var(--surface-soft); }
.dock-links a.active { color: var(--accent-deep); background: var(--accent-soft); }
.dock-actions { display: flex; gap: 2px; }
.pill-quiet[lang="ar"] { font-family: var(--font-ar); }

/* ── Hero ─────────────────────────────────────────────── */

.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding-block: 120px 80px; }
.hero-inner { position: relative; }
.hero-title {
  font: 600 clamp(52px, 7.6vw, 112px)/0.98 var(--font-display);
  letter-spacing: -0.045em;
  max-width: 9.5ch;
}
:lang(ar) .hero-title { max-width: 10ch; }
.hero-lead { margin-top: 28px; font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-2); max-width: 30em; }
.hero-actions { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.scroll-cue {
  position: absolute; bottom: 28px; inset-inline-start: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-3);
}
:lang(ar) .scroll-cue { transform: translateX(50%); }
.cue-line { width: 1px; height: 46px; background: linear-gradient(var(--ink-3), transparent); transform-origin: top; animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ── Story ────────────────────────────────────────────── */

.story { position: relative; height: 520vh; }
.story-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; align-items: center; }
.story-inner { position: relative; height: 60vh; }
.chapter {
  position: absolute; inset-inline-start: 0; top: 50%; transform: translateY(-50%);
  max-width: 400px;
  opacity: 0; visibility: hidden;
}
.chap-num { color: var(--accent-deep); font-variant-numeric: tabular-nums; margin-inline-end: 6px; }
.story-title { font: 600 clamp(34px, 3.8vw, 52px)/1.06 var(--font-display); letter-spacing: -0.03em; }
.story-body { margin-top: 18px; color: var(--ink-2); font-size: 18px; }
.month { margin-top: 26px; display: flex; align-items: baseline; gap: 12px; color: var(--ink-2); }
.month-num { font: 300 76px/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; min-width: 1.2ch; }
.story-progress { position: absolute; bottom: 40px; inset-inline: var(--gutter); height: 2px; border-radius: 2px; background: var(--border); overflow: hidden; max-width: var(--wrap); margin-inline: auto; }
.story-progress-fill { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
:lang(ar) .story-progress-fill { transform-origin: right; }

/* ── Sections ─────────────────────────────────────────── */

.section { padding-block: clamp(110px, 13vw, 170px); position: relative; }
.head { margin-bottom: clamp(44px, 5vw, 70px); }
.head .title { margin-bottom: 20px; }

.glass {
  position: relative;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: saturate(160%) blur(24px); -webkit-backdrop-filter: saturate(160%) blur(24px);
}

/* Spotlight: a soft glow that follows the cursor across a surface. */
.spotlight { --mx: 50%; --my: 0%; overflow: hidden; }
.spotlight::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx) var(--my), var(--glow), transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.spotlight:hover::before { opacity: 1; }
.spotlight > * { position: relative; }

/* Planner */
.planner { display: grid; grid-template-columns: 5fr 6fr; gap: 20px; align-items: stretch; }
.controls { padding: 32px 32px 22px; display: flex; flex-direction: column; gap: 28px; }
.control { display: flex; flex-direction: column; gap: 12px; }
.control-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; color: var(--ink-2); }
.control-value { font: 300 32px/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; --pct: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--accent) var(--pct), var(--border-strong) var(--pct)); }
:lang(ar) input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(to left, var(--accent) var(--pct), var(--border-strong) var(--pct)); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 30px; height: 30px; margin-top: -12px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border-strong); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s var(--ease);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--border-strong); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 1px solid var(--border-strong); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16); }

.result { padding: 32px; display: flex; flex-direction: column; gap: 6px; }
.result .figure-xl { margin: 6px 0 4px; }
.seat-orbit { position: relative; width: 100%; max-width: 260px; aspect-ratio: 1; margin: 18px auto 10px; }
.seat-orbit span {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 500; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--border-strong);
  transition: left 0.6s var(--ease), top 0.6s var(--ease), background-color 0.3s, color 0.3s, transform 0.4s var(--ease);
}
.seat-orbit span.early { border-color: var(--gold); }
.seat-orbit span.you { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: scale(1.25); box-shadow: 0 6px 20px -6px var(--accent); }
.seat-orbit .hub { position: absolute; inset: 22%; border-radius: 50%; border: 1px dashed var(--border-strong); display: grid; place-items: center; text-align: center; font-size: 13px; color: var(--ink-3); }
.pair-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.pair-figures .figure { font-size: 34px; line-height: 1.1; }
.result .note { margin-top: 14px; min-height: 2.6em; }

/* Trust */
.trust-grid { display: grid; grid-template-columns: 6fr 5fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.trust-grid .head { margin-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--glass-strong);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font-size: 15px; cursor: pointer;
}
.chip b { font: 400 16px/1 var(--font-display); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.chip.up b { color: var(--success); }
.chip.down b { color: var(--error); }
.dial-wrap { position: relative; width: min(100%, 420px); aspect-ratio: 1; margin-inline: auto; }
.dial { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.dial-track { fill: none; stroke: var(--border); stroke-width: 10; }
.dial-fill { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray 0.9s var(--ease), stroke 0.4s; filter: drop-shadow(0 0 12px var(--glow)); }
.dial-centre { position: absolute; inset: 16%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.dial-figure { font-size: clamp(76px, 9vw, 112px); line-height: 1; }
.tier-chip { font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); }
.dial-note { min-height: 3em; max-width: 22ch; margin-top: 4px; }

/* Safety bento */
.bento { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: auto auto; gap: 16px; perspective: 1200px; }
.tile {
  position: relative;
  padding: 30px;
  border-radius: 28px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(160%) blur(24px); -webkit-backdrop-filter: saturate(160%) blur(24px);
  display: flex; flex-direction: column; gap: 10px;
  transform-style: preserve-3d;
  will-change: transform;
}
.tile.big { grid-row: span 2; }
.tile h3 { font: 600 24px/1.15 var(--font-display); letter-spacing: -0.02em; }
:lang(ar) .tile h3 { font-family: var(--font-ar); }
.tile p:not(.card-label) { color: var(--ink-2); }
.bento .tile:nth-child(4) { grid-column: span 2; }

/* A small receipt being checked */
.receipt { margin-top: auto; align-self: center; width: min(220px, 80%); aspect-ratio: 3 / 4; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); padding: 22px 20px; display: flex; flex-direction: column; gap: 12px; position: relative; box-shadow: var(--shadow); transform: rotate(-4deg); }
.receipt span:not(.stamp) { display: block; height: 8px; border-radius: 4px; background: var(--surface-soft); }
.receipt span:nth-child(1) { width: 60%; } .receipt span:nth-child(2) { width: 90%; } .receipt span:nth-child(3) { width: 40%; }
.stamp { position: absolute; bottom: 22px; inset-inline-end: 18px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--accent); color: var(--accent-deep); font-size: 13px; font-weight: 600; transform: rotate(-8deg) scale(0); opacity: 0; }
.receipt.stamped .stamp { animation: stamp 0.6s var(--ease) forwards; }
@keyframes stamp { 0% { transform: rotate(-8deg) scale(1.8); opacity: 0; } 100% { transform: rotate(-8deg) scale(1); opacity: 1; } }

/* A chain of signed links */
.chain { margin-top: auto; display: flex; gap: 8px; align-items: center; padding-top: 16px; }
.chain span { flex: 1; height: 10px; border-radius: 999px; background: var(--accent-soft); position: relative; transform: scaleX(0.2); opacity: 0.3; transform-origin: left; }
:lang(ar) .chain span { transform-origin: right; }
.chain.linked span { animation: link 0.5s var(--ease) forwards; }
.chain.linked span:nth-child(2) { animation-delay: 0.12s; } .chain.linked span:nth-child(3) { animation-delay: 0.24s; }
.chain.linked span:nth-child(4) { animation-delay: 0.36s; } .chain.linked span:nth-child(5) { animation-delay: 0.48s; background: var(--accent); }
@keyframes link { to { transform: none; opacity: 1; } }

/* Ember band */
.ember-band {
  --ink: #EDE6DC; --ink-2: #B5AA9C; --accent-deep: #F0A47E; --border: rgba(237, 230, 220, 0.08);
  background: radial-gradient(45% 60% at 80% 40%, #3A2619, transparent 70%), radial-gradient(40% 60% at 15% 80%, #2B1F18, transparent 70%), #1A1714;
  color: #EDE6DC; overflow: hidden;
}
.ember-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.ember-grid .title { margin-bottom: 20px; }
.pair { display: flex; justify-content: center; gap: 24px; }
.phone { position: relative; border-radius: 46px; padding: 9px; background: #0E0F10; box-shadow: var(--phone-shadow); will-change: transform; }
.phone img { border-radius: 37px; width: 100%; }
.small-phone { width: clamp(180px, 18vw, 250px); }
.small-phone.raised { margin-top: 70px; }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: 2fr 3fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { border-radius: 22px; transition: background-color 0.3s; }
.faq summary { list-style: none; cursor: pointer; padding: 22px 56px 22px 24px; font-size: 18px; font-weight: 500; position: relative; }
:lang(ar) .faq summary { padding: 22px 24px 22px 56px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; inset-inline-end: 22px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-soft); color: var(--ink-2); font: 300 20px/1 var(--font);
  transition: transform 0.4s var(--ease), background-color 0.3s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); background: var(--accent-soft); color: var(--accent-deep); }
.faq details p { padding: 0 24px 24px; color: var(--ink-2); }

/* Closing: the ring returns behind this */
.closing { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 120px var(--gutter); }
.closing-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; max-width: 640px; }
.closing-title { font: 600 clamp(44px, 6vw, 84px)/1 var(--font-display); letter-spacing: -0.04em; }
.closing .pill-glass { margin-top: 10px; }

.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 28px 48px; }

/* Content cards fade up as they arrive (set by the script) */
.rise { opacity: 0; transform: translateY(28px); }

@media (prefers-reduced-motion: reduce) {
  .cue-line { animation: none; }
  .rise { opacity: 1; transform: none; }
  .chapter { position: static; transform: none; opacity: 1; visibility: visible; margin-bottom: 64px; }
  .story { height: auto; }
  .story-pin { position: static; height: auto; padding-block: 120px; }
  .story-inner { height: auto; }
  .story-progress { display: none; }
  .stamp { transform: rotate(-8deg); opacity: 1; }
  .chain span { transform: none; opacity: 1; }
}

/* ── Smaller screens ──────────────────────────────────── */

@media (max-width: 980px) {
  .dock-links { display: none; }
  .planner, .trust-grid, .ember-grid, .faq-grid { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr 1fr; }
  .tile.big { grid-row: auto; grid-column: span 2; }
  .bento .tile:nth-child(4) { grid-column: span 2; }
  .chapter { max-width: 520px; top: auto; bottom: 8%; transform: none; }
  .story-inner { height: 100%; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { align-items: flex-start; padding-top: 128px; }
  .hero-title { font-size: clamp(46px, 13vw, 64px); }
  .bento { grid-template-columns: 1fr; }
  .tile.big, .bento .tile:nth-child(4) { grid-column: auto; }
  .controls, .result, .tile { padding: 24px; }
  .story-title { font-size: 30px; }
  .story-body { font-size: 16px; }
  .month-num { font-size: 56px; }
  .chapter { background: var(--glass-strong); border: 1px solid var(--border); border-radius: 24px; padding: 22px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); inset-inline: 0; }
  .small-phone { width: 42vw; }
  .faq summary { font-size: 16px; }
}
