/* ============================================================
   Jorai — landing design system
   Typography mirrors the app (SF Rounded via ui-rounded).
   Colors come from the app's real palette:
   accent #5E5CE6 (Apple Wellbeing), teal #2E95B7 (Mood Blend),
   emotion inks/fills from EmotionPalette.swift.
   ============================================================ */

:root {
  color-scheme: light;
  /* surfaces — warm paper, Mood Blend undertone */
  --bg: #FBF8F3;
  --bg-elev: #FFFFFF;
  --bg-soft: #F4EFE7;
  --ink: #232230;
  --ink-2: #56536A;
  --ink-3: #8B8899;
  --line: rgba(35, 34, 48, 0.10);
  --line-strong: rgba(35, 34, 48, 0.16);

  /* brand */
  --accent: #5E5CE6;
  --accent-deep: #4B49C9;
  --accent-soft: rgba(94, 92, 230, 0.10);
  --teal: #2E95B7;
  --peach: #F2A57E;

  /* phone mockup screen — adapts to theme (light defaults here) */
  --ph-bg:
    radial-gradient(120% 70% at 85% -10%, rgba(94, 92, 230, 0.16), transparent 60%),
    radial-gradient(110% 60% at 0% 28%, rgba(46, 149, 183, 0.13), transparent 55%),
    radial-gradient(120% 80% at 70% 110%, rgba(242, 165, 126, 0.14), transparent 60%),
    #F5F2FB;
  --ph-ink: #1C1B26;
  --ph-ink-2: rgba(28, 27, 38, 0.55);
  --ph-surface: rgba(20, 19, 30, 0.045);
  --ph-border: rgba(20, 19, 30, 0.09);
  --ph-card: rgba(255, 255, 255, 0.82);
  --ph-card-ink: rgba(28, 27, 38, 0.92);
  --ph-card-ink-2: rgba(28, 27, 38, 0.5);
  --ph-gold: #A87B14;

  /* mood buckets — iOS fillColor (base RGB tuned saturation ×1.55, per MoodBucket.swift) */
  --mood-awful: #FF2626;
  --mood-bad: #FF7526;
  --mood-fine: #FFD300;
  --mood-good: #36CC36;
  --mood-great: #00B2D1;
  /* deep gradient stops — iOS fillColorDeep (hue-shifted 2nd stop) */
  --mood-awful-deep: #CC4065;
  --mood-bad-deep: #D9446C;
  --mood-fine-deep: #FF7120;
  --mood-good-deep: #42A393;
  --mood-great-deep: #0089D1;
  /* readable text variant for yellow on light bg (iOS Fine textColor #BD8F21) */
  --mood-fine-text: #BD8F21;

  /* emotion inks / fills (light variants from EmotionPalette.swift) */
  --em-sadness-ink: #24577A;     --em-sadness-fill: #DDEBFA;
  --em-joy-ink: #8B6500;         --em-joy-fill: #F5E9BE;
  --em-calm-ink: #14736A;        --em-calm-fill: #D6EFEB;
  --em-hope-ink: #2B7748;        --em-hope-fill: #D9EFDF;
  --em-anxiety-ink: #76388E;     --em-anxiety-fill: #F0E0F5;
  --em-gratitude-ink: #706417;   --em-gratitude-fill: #EEE9C9;
  --em-love-ink: #9B2F6D;        --em-love-fill: #F5DDEB;
  --em-anger-ink: #9F2017;       --em-anger-fill: #F8DDD9;
  --em-fear-ink: #4E4592;        --em-fear-fill: #E7E2FA;
  --em-pride-ink: #6544A5;       --em-pride-fill: #E9E0F8;
  --em-relief-ink: #1F7A66;      --em-relief-fill: #D8F0E8;
  --em-excitement-ink: #9B4B16;  --em-excitement-fill: #F6E0CF;
  --em-grief-ink: #344A62;       --em-grief-fill: #DDE5EC;
  --em-determination-ink: #8A4C00; --em-determination-fill: #F1E0C8;
  --em-empathy-ink: #236E70;     --em-empathy-fill: #D8EEEE;
  --em-overwhelm-ink: #61478A;   --em-overwhelm-fill: #E8E0F2;

  /* privacy panel — light theme (flips to dark under [data-theme="dark"]) */
  --panel-bg: #F2EFFB;
  --panel-ink: #232230;
  --panel-ink-2: #56536A;
  --panel-line: rgba(35, 34, 48, 0.10);
  --panel-card: rgba(255, 255, 255, 0.6);
  --panel-accent: var(--accent-deep);

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;

  /* spacing scale (4px base) — reuse these instead of ad-hoc px values */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  --shadow-card: 0 1px 2px rgba(35, 34, 48, 0.04), 0 12px 32px -16px rgba(35, 34, 48, 0.12);
  --shadow-pop: 0 2px 6px rgba(35, 34, 48, 0.06), 0 24px 56px -24px rgba(35, 34, 48, 0.22);

  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-out-strong: cubic-bezier(0.19, 1, 0.22, 1);
}

/* Dark theme — driven by [data-theme="dark"], which the inline <head> script
   sets before paint (resolving saved choice, else the OS preference). This way
   the in-page toggle works regardless of system setting; no-JS falls back to light. */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #131218;
    --bg-elev: #1C1B24;
    --bg-soft: #181722;
    --ink: #F2F0F7;
    --ink-2: #B6B3C6;
    --ink-3: #847F96;
    --line: rgba(242, 240, 247, 0.10);
    --line-strong: rgba(242, 240, 247, 0.18);

    --accent: #7B79FF;
    --accent-deep: #9D9BFF;
    --accent-soft: rgba(123, 121, 255, 0.14);

    /* phone mockup — dark app screen */
    --ph-bg:
      radial-gradient(120% 70% at 85% -10%, rgba(94, 92, 230, 0.30), transparent 60%),
      radial-gradient(110% 60% at 0% 28%, rgba(46, 149, 183, 0.22), transparent 55%),
      radial-gradient(120% 80% at 70% 110%, rgba(242, 165, 126, 0.20), transparent 60%),
      #16151E;
    --ph-ink: #F2F0F7;
    --ph-ink-2: rgba(242, 240, 247, 0.55);
    --ph-surface: rgba(255, 255, 255, 0.07);
    --ph-border: rgba(255, 255, 255, 0.10);
    --ph-card: rgba(22, 21, 30, 0.72);
    --ph-card-ink: rgba(242, 240, 247, 0.9);
    --ph-card-ink-2: rgba(242, 240, 247, 0.5);
    --ph-gold: #FFD27A;

    /* mood buckets — iOS dark fillColor (dark base × 1.55 saturation) */
    --mood-awful: #FF3939;
    --mood-bad: #FF792A;
    --mood-fine: #FFD40A;
    --mood-good: #40D648;
    --mood-great: #00C3E6;
    --mood-awful-deep: #D24A66;
    --mood-bad-deep: #E0556E;
    --mood-fine-deep: #FF8124;
    --mood-good-deep: #49B49C;
    --mood-great-deep: #149AD8;
    --mood-fine-text: #FFD40A;

    /* emotion chips flip to dark variants (ink ↔ deep fill) */
    --em-sadness-ink: #A9D6FF;     --em-sadness-fill: #18304A;
    --em-joy-ink: #FFE29A;         --em-joy-fill: #3B2D0F;
    --em-calm-ink: #A1E7DE;        --em-calm-fill: #123735;
    --em-hope-ink: #AAE6BC;        --em-hope-fill: #17381F;
    --em-anxiety-ink: #E2B6F2;     --em-anxiety-fill: #371943;
    --em-gratitude-ink: #E9DA86;   --em-gratitude-fill: #322E13;
    --em-love-ink: #FFB1D8;        --em-love-fill: #441630;
    --em-anger-ink: #FFAAA0;       --em-anger-fill: #431613;
    --em-fear-ink: #C9C1FF;        --em-fear-fill: #29214F;
    --em-pride-ink: #D5C0FF;       --em-pride-fill: #2E214A;
    --em-relief-ink: #A5E9D3;      --em-relief-fill: #17382F;
    --em-excitement-ink: #FFB47E;  --em-excitement-fill: #44220F;
    --em-grief-ink: #B9CCE0;       --em-grief-fill: #1E2834;
    --em-determination-ink: #F2BD78; --em-determination-fill: #3A2711;
    --em-empathy-ink: #A8E0E0;     --em-empathy-fill: #173536;
    --em-overwhelm-ink: #D6BFFF;   --em-overwhelm-fill: #2E2342;

    --panel-bg: #1C1B26;
    --panel-ink: #F2F0F7;
    --panel-ink-2: #B4B1C4;
    --panel-line: rgba(242, 240, 247, 0.12);
    --panel-card: rgba(255, 255, 255, 0.055);
    --panel-accent: #A5A3FF;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.5);
    --shadow-pop: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 56px -24px rgba(0, 0, 0, 0.6);
}

/* Suppress all transitions during a manual theme switch (Emil: theme changes
   should not animate element-by-element). Justified, momentary !important. */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
  font-weight: 800;
}

p { margin: 0; }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-weight: 700;
  transition: top 150ms var(--ease-out);
}
.skip-link:focus { top: 12px; }

.wrap {
  width: min(1120px, 100% - 48px);
  margin-inline: auto;
}

/* ---------- grain texture ---------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  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='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { position: relative; z-index: 2; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand img, .brand svg {
  width: 30px; height: 30px;
  border-radius: 7px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.nav-links {
  display: flex;
  gap: 24px;
  margin-left: auto;
}
.nav-links a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: color 150ms ease;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }

.nav-cta { margin-left: 4px; }

/* theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  transition: color 150ms ease, background-color 150ms ease, transform 120ms var(--ease-out);
}
.theme-toggle:hover { color: var(--ink); background: var(--accent-soft); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle:active { transform: none; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .theme-toggle { margin-left: auto; }
  .nav-cta { margin-left: 0; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 150ms ease, transform 120ms var(--ease-out), box-shadow 150ms ease;
  will-change: transform;
}
.btn:active { transform: scale(0.97); }
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }

/* launch flag: App Store CTAs read "Coming soon" (non-clickable) until live */
.btn.is-soon { cursor: default; opacity: 0.78; }
.btn.is-soon:active { transform: none; }
.btn-primary.is-soon:hover { background: var(--accent); }

[data-theme="dark"] .btn-primary { color: #14132B; }
[data-theme="dark"] .btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.btn-ghost:hover { background: var(--accent-soft); }

.btn-sm { padding: 9px 18px; font-size: 0.92rem; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: background-color 150ms ease; }
  .btn:active { transform: none; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: clip;
  padding: 72px 0 96px;
}

.mesh {
  position: absolute;
  inset: -20% -10%;
  z-index: -1;
  pointer-events: none;
}
.mesh i {
  position: absolute;
  border-radius: 50%;
  opacity: 0.55;
}
.mesh i:nth-child(1) {
  width: 56vw; height: 56vw;
  left: -12vw; top: -8vw;
  background: radial-gradient(circle at center, rgba(94, 92, 230, 0.22), transparent 65%);
  animation: drift-a 38s ease-in-out infinite alternate;
}
.mesh i:nth-child(2) {
  width: 48vw; height: 48vw;
  right: -10vw; top: 4vw;
  background: radial-gradient(circle at center, rgba(46, 149, 183, 0.20), transparent 65%);
  animation: drift-b 44s ease-in-out infinite alternate;
}
.mesh i:nth-child(3) {
  width: 42vw; height: 42vw;
  left: 28vw; top: 16vw;
  background: radial-gradient(circle at center, rgba(242, 165, 126, 0.20), transparent 65%);
  animation: drift-c 52s ease-in-out infinite alternate;
}

@keyframes drift-a { to { transform: translate(7vw, 5vw); } }
@keyframes drift-b { to { transform: translate(-6vw, 7vw); } }
@keyframes drift-c { to { transform: translate(-5vw, -6vw); } }

@media (prefers-reduced-motion: reduce) {
  .mesh i { animation: none; }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}

.hero-copy { max-width: 560px; }

.hero h1 {
  font-size: clamp(2.7rem, 6vw, 4.3rem);
  font-weight: 900;
}

.hero-sub {
  margin-top: 22px;
  font-size: clamp(1.1rem, 1.8vw, 1.28rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 32em;
  text-wrap: pretty;
}

.hero-cta {
  margin-top: 34px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--ink-3);
  font-weight: 600;
}

/* intro stagger — plays once per session; default state is fully visible (no-JS safe) */
body.intro .hero-copy > * {
  animation: rise 700ms var(--ease-out-strong) both;
}
body.intro .hero-copy > *:nth-child(1) { animation-delay: 60ms; }
body.intro .hero-copy > *:nth-child(2) { animation-delay: 150ms; }
body.intro .hero-copy > *:nth-child(3) { animation-delay: 240ms; }
body.intro .hero-copy > *:nth-child(4) { animation-delay: 310ms; }
body.intro .hero-visual {
  animation: rise-visual 850ms var(--ease-out-strong) both;
  animation-delay: 220ms;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes rise-visual {
  from { opacity: 0; transform: translateY(20px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.intro .hero-copy > *,
  body.intro .hero-visual { animation: none; }
}

/* ---------- phone mockup ---------- */

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

.phone {
  position: relative;
  width: min(330px, 86vw);
  aspect-ratio: 330 / 668;
  border-radius: 52px;
  background: #0E0D14;
  padding: 10px;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.14),
    var(--shadow-pop);
}

.phone-screen {
  position: relative;
  height: 100%;
  border-radius: 43px;
  overflow: hidden;
  background: var(--ph-bg);
  color: var(--ph-ink);
  transition: background 200ms ease, color 200ms ease;
  display: flex;
  flex-direction: column;
  padding: 54px 20px 20px;
}

.phone-island {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 102px; height: 28px;
  border-radius: 999px;
  background: #0E0D14;
}

.ps-date {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ph-ink-2);
}
.ps-greet {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* streak banner — matches the Journal home screen */
.ps-streak {
  margin-top: 18px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 18px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
}
.ps-streak-flame {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #FFD27A, #F0A93C);
  color: #5A3A00;
}
.ps-streak-flame svg { width: 18px; height: 18px; }
.ps-streak-text { flex: 1; }
.ps-streak-title { font-size: 0.98rem; font-weight: 800; color: var(--ph-ink); }
.ps-streak-sub { margin-top: 3px; font-size: 0.76rem; line-height: 1.4; color: var(--ph-ink-2); }
.ps-streak-x { flex: none; font-size: 1.15rem; line-height: 1; color: var(--ph-ink-2); }

.ps-ring-card {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 22px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
}

/* mood flower ring — the app's "Recent moods" signature: a content face
   wrapped in emotion-coloured petals */
.ps-flower {
  width: 82px; height: 82px;
  flex: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.28));
}

.ps-ring-label .big {
  font-size: 1.05rem;
  font-weight: 800;
}
.ps-ring-label .small {
  font-size: 0.8rem;
  color: var(--ph-ink-2);
  font-weight: 600;
}

/* waveform — the signature: voice bars in emotion colors */
.ps-wave {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  height: 88px;
  padding: 0 6px;
}
.ps-wave i {
  flex: 1;
  height: 100%;
  border-radius: 99px;
  transform: scaleY(var(--s, 0.4));
  animation: wave 1.7s ease-in-out infinite alternate;
  animation-delay: var(--d, 0ms);
  will-change: transform;
}
.ps-wave.paused i { animation-play-state: paused; }

@keyframes wave {
  from { transform: scaleY(var(--s, 0.4)); }
  to { transform: scaleY(calc(var(--s, 0.4) * 0.45 + 0.12)); }
}

@media (prefers-reduced-motion: reduce) {
  .ps-wave i { animation: none; }
}

.ps-chips {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ps-chip {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}

/* daily insight card — VOICE / PATTERN / TRY TODAY, dawn gradient border */
.ps-daily {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--ph-card), var(--ph-card)) padding-box,
    linear-gradient(135deg, #9B8CFF, #FF9D8A, #FFD27A) border-box;
}
.ps-daily-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.ps-daily-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 800;
  color: var(--ph-gold); background: color-mix(in srgb, var(--ph-gold) 16%, transparent);
  padding: 3px 9px; border-radius: 999px;
}
.ps-daily-badge svg { width: 11px; height: 11px; }
.ps-daily-when { font-size: 0.8rem; font-weight: 700; color: var(--ph-card-ink-2); }
.ps-di-row { display: flex; gap: 9px; align-items: flex-start; padding: 4px 0; }
.ps-di-ic { flex: none; margin-top: 1px; }
.ps-di-ic svg { width: 15px; height: 15px; }
.ps-di-lab {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ph-card-ink-2);
}
.ps-di-row p { font-size: 0.79rem; line-height: 1.35; color: var(--ph-card-ink); margin-top: 1px; }

/* The hero demonstrates the product's reasoning order, once per session. */
body.intro .ps-daily .ps-di-row {
  animation: insight-step 520ms var(--ease-out-strong) both;
}
body.intro .ps-daily .ps-di-row:nth-child(2) { animation-delay: 720ms; }
body.intro .ps-daily .ps-di-row:nth-child(3) { animation-delay: 860ms; }
body.intro .ps-daily .ps-di-row:nth-child(4) { animation-delay: 1000ms; }

@keyframes insight-step {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

/* floating glass cards beside the phone */
.float-card {
  position: absolute;
  z-index: 3;
  padding: 13px 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-elev) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}
.float-card .sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-3);
  margin-top: 2px;
}
.fc-1 { top: 13%; left: -4%; transform: rotate(-3deg); }
.fc-2 { bottom: 16%; right: -6%; transform: rotate(2.5deg); }

.fc-meter {
  display: flex;
  gap: 3px;
  margin-top: 7px;
}
.fc-meter i {
  width: 14px; height: 5px;
  border-radius: 99px;
  background: var(--line-strong);
}
.fc-meter i.on { background: var(--teal); }

@media (max-width: 980px) {
  .fc-1 { left: 0; }
  .fc-2 { right: 0; }
}

/* ---------- sections ---------- */

.section { padding: 64px 0; }
.section-tight { padding: 46px 0; }

.kicker {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: var(--sp-3);
}

.section h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  max-width: 21em;
}

.section .lead {
  margin-top: var(--sp-4);
  font-size: 1.12rem;
  color: var(--ink-2);
  max-width: 36em;
  text-wrap: pretty;
}

.center { text-align: center; }
.center h2, .center .lead { margin-inline: auto; }

/* ---------- how it works: alternating step rows with phone mockups ---------- */

.how-steps {
  margin-top: var(--sp-8);
  max-width: 1100px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4.5vw, 60px);
  align-items: start;
}

.how-col { display: flex; flex-direction: column; align-items: center; text-align: center; }
.how-col-head { margin-bottom: var(--sp-4); }
.how-num {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 6px;
}
.how-col-head h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
.how-col-desc { margin-top: var(--sp-4); max-width: 30ch; color: var(--ink-2); font-size: 0.95rem; line-height: 1.55; }

.how-visual { display: flex; justify-content: center; width: 100%; }

/* device shown as the TOP SLICE of a proper-proportion iPhone — rounded top,
   clipped flat bottom, so it reads as a real phone bleeding off the section
   (Rosebud-style crop) rather than a squat full device */
.how-phone {
  position: relative;
  width: 100%;
  max-width: 318px;
  border-radius: 50px 50px 0 0;
  background: #0E0D14;
  padding: 12px 12px 0;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.14), var(--shadow-pop);
  overflow: hidden;
}
.how-phone .phone-screen {
  height: 366px;
  border-radius: 40px 40px 0 0;
  padding: 44px 18px 22px;
}
/* phone content reads left-aligned like the real app, regardless of the row's
   centered text on mobile (individual elements opt back into centering) */
.hp-screen { text-align: left; }

/* ---- record screen ---- */
.hp-recnav { display: flex; align-items: center; justify-content: space-between; font-size: 0.92rem; font-weight: 700; color: var(--ph-ink); }
.hp-recnav .hp-x { font-size: 1.25rem; font-weight: 500; color: var(--ph-ink-2); line-height: 1; }
.hp-wave { margin-top: 30px; height: 90px; }
.hp-wave i { opacity: 0.95; }
.hp-rectimer { margin-top: 18px; text-align: center; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; color: var(--ph-ink); }
.hp-transcript { margin-top: 14px; font-size: 0.95rem; line-height: 1.45; font-weight: 600; color: var(--ph-ink); text-align: center; }
.hp-audio { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 0.76rem; font-weight: 600; color: var(--ph-ink-2); }
.hp-audio-dot { width: 8px; height: 8px; border-radius: 50%; background: #34C759; }
/* bottom bar = iOS 26 Liquid Glass (translucent frosted), not solid fills */
.hp-recbar { margin-top: auto; display: flex; align-items: center; gap: 10px; }
.hp-recbar-ic { flex: none; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--ph-ink) 8%, transparent); border: 1px solid color-mix(in srgb, var(--ph-ink) 12%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--ph-ink-2); }
.hp-recbar-ic svg { width: 19px; height: 19px; }
.hp-recbar-fin { flex: 1; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 16px; border-radius: 999px; background: color-mix(in srgb, var(--accent-deep) 16%, transparent); border: 1px solid color-mix(in srgb, var(--accent-deep) 32%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--accent-deep); font-size: 0.9rem; font-weight: 700; }

/* ---- analyze screen ---- */
.hp-mood { display: flex; align-items: center; gap: 12px; }
.hp-orb { flex: none; width: 46px; height: 46px; filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.22)); }
.hp-orb svg { width: 100%; height: 100%; display: block; }
.hp-mood-title { font-size: 1.32rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ph-ink); }
.hp-mood-dur { margin-top: 3px; display: flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 600; color: var(--ph-ink-2); }
.hp-mood-dur svg { width: 13px; height: 13px; }
.hp-emhead, .hp-vhead { margin-top: 20px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ph-ink-2); }
.hp-emrow { margin-top: 11px; display: flex; align-items: center; gap: 10px; }
.hp-emlab { width: 56px; flex: none; font-size: 0.84rem; font-weight: 700; color: var(--ph-ink); }
.hp-embar { flex: 1; height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ph-ink) 8%, transparent); overflow: hidden; }
.hp-embar i { display: block; height: 100%; width: var(--w); border-radius: 99px; }
.hp-empct { width: 34px; flex: none; text-align: right; font-size: 0.78rem; font-weight: 700; color: var(--ph-ink-2); font-variant-numeric: tabular-nums; }
.hp-axis { margin-top: 13px; }
.hp-axis-track { position: relative; height: 8px; border-radius: 99px; }
.hp-axis-mark { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ph-ink) 14%, transparent), 0 1px 4px rgba(0, 0, 0, 0.3); }
.hp-axis-poles { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; font-size: 0.68rem; color: var(--ph-ink-2); }
.hp-axis-name { margin-bottom: 7px; font-weight: 800; color: var(--ph-ink); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.68rem; }

/* ---- patterns screen (Mood Flow) ---- */
.hp-flowhead { font-size: 0.88rem; font-weight: 800; color: var(--ph-ink); }
.hp-chartwrap { position: relative; margin-top: 10px; padding-right: 24px; }
.hp-mf { display: block; width: 100%; height: auto; overflow: visible; }
.hp-mf-emoji span { position: absolute; right: 0; transform: translateY(-50%); font-size: 13px; line-height: 1; }
.hp-week { margin-top: 14px; display: flex; gap: 8px; }
.hp-week-stat { flex: 1; padding: 10px 6px; border-radius: 13px; background: var(--ph-surface); border: 1px solid var(--ph-border); text-align: center; }
.hp-week-v { display: block; font-size: 0.82rem; font-weight: 800; color: var(--ph-ink); white-space: nowrap; }
.hp-week-l { display: block; margin-top: 2px; font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ph-ink-2); }
/* the worded insight card (Voice / Pattern) pins to the bottom so all three mocks end level */
.hp-pcard { margin-top: auto; padding: 10px 14px 12px; border-radius: 13px; background: var(--ph-surface); border: 1px solid var(--ph-border); }
.hp-pcard-k { display: block; line-height: 1; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-deep); }
.hp-pcard p { margin-top: 3px; font-size: 0.82rem; line-height: 1.38; color: var(--ph-ink); }

/* each step column rises in as it enters; staggered across the row */
html.anim .how-col.reveal { opacity: 0; transform: translateY(28px); }
html.anim .how-col.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease-out), transform 0.8s var(--ease-out-strong);
}
html.anim .how-col.reveal:nth-child(2).in { transition-delay: 0.09s; }
html.anim .how-col.reveal:nth-child(3).in { transition-delay: 0.18s; }

@media (max-width: 880px) {
  .how-steps { grid-template-columns: 1fr; gap: clamp(40px, 8vw, 56px); max-width: 420px; }
  .how-col-desc { max-width: 36ch; }
}

/* ---------- emotions cloud ---------- */

.emotion-cloud {
  margin-top: 48px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 880px;
  margin-inline: auto;
}

.em-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--fill, var(--bg-soft));
  color: var(--tone, var(--ink));
  transition: transform 160ms var(--ease-out);
}
.em-chip::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

@media (hover: hover) and (pointer: fine) {
  .em-chip:hover { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .em-chip { transition: none; }
  .em-chip:hover { transform: none; }
}

.emotion-foot {
  margin-top: 28px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--ink-3);
  font-weight: 600;
}

/* ---------- split feature (voice) ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}
.split.reverse > .split-visual { order: -1; }

.split h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
.split .lead { font-size: 1.08rem; }

.split-list {
  margin: var(--sp-6) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--sp-4);
}
.split-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 1rem;
  color: var(--ink-2);
}
.split-list li b { color: var(--ink); }
.split-list .dot {
  flex: none;
  width: 26px; height: 26px;
  margin-top: 1px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.split-list .dot svg { width: 14px; height: 14px; }

@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; gap: 40px; }
  .split.reverse > .split-visual { order: 0; }
}

/* voice gauges card */
.gauge-card {
  padding: var(--sp-6);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  display: grid;
  gap: 26px;
}

.gauge .g-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.gauge .g-name { font-weight: 800; font-size: 1.02rem; }
.gauge .g-val {
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.gauge .g-track {
  height: 10px;
  border-radius: 99px;
  background: var(--bg-soft);
  overflow: hidden;
}
.gauge .g-bar {
  height: 100%;
  border-radius: 99px;
  width: var(--w, 50%);
  transform-origin: left center;
}
.gauge .g-sub {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--ink-3);
  font-weight: 600;
}

.gauge-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
  font-size: 0.88rem;
  color: var(--ink-2);
  font-weight: 600;
}
.gauge-foot svg { flex: none; width: 18px; height: 18px; color: var(--teal); }

html.anim .gauge-card.motion-trigger .g-bar { transform: scaleX(0); }
html.anim .gauge-card.motion-trigger.in .g-bar {
  transform: scaleX(1);
  transition: transform 900ms var(--ease-out-strong);
}
html.anim .gauge-card.motion-trigger.in .gauge:nth-child(2) .g-bar {
  transition-delay: 140ms;
}

/* ---------- insights chart ---------- */

.chart-card {
  padding: var(--sp-6);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  gap: 12px;
}
.chart-title { font-weight: 800; font-size: 1.02rem; }
.chart-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--em-hope-ink);
  background: var(--em-hope-fill);
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.chart-svg { width: 100%; height: auto; }
.chart-svg .grid-line { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis-label {
  fill: var(--ink-3);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
}
.chart-svg .mood-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-svg .mood-area { fill: url(#moodFill); }
.chart-svg .mood-dot { fill: var(--accent); stroke: var(--bg-elev); stroke-width: 2.5; }
.chart-svg .sleep-bar { fill: var(--teal); opacity: 0.35; rx: 3; }

.chart-legend {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
}
.chart-legend i {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 7px;
}

/* ---------- privacy panel ---------- */

.privacy-panel {
  border-radius: 36px;
  background:
    radial-gradient(90% 120% at 90% -20%, rgba(94, 92, 230, 0.25), transparent 60%),
    radial-gradient(80% 100% at 0% 110%, rgba(46, 149, 183, 0.18), transparent 55%),
    var(--panel-bg);
  color: var(--panel-ink);
  padding: clamp(40px, 6vw, 72px);
  overflow: clip;
  position: relative;
}

.privacy-panel .kicker { color: var(--panel-accent); }
.privacy-panel h2 { color: var(--panel-ink); }
.privacy-panel .lead { color: var(--panel-ink-2); }

.privacy-grid {
  margin-top: var(--sp-10);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

.privacy-card {
  padding: var(--sp-6);
  border-radius: var(--radius-md);
  background: var(--panel-card);
  border: 1px solid var(--panel-line);
}
.privacy-card svg {
  width: 26px; height: 26px;
  color: var(--panel-accent);
  margin-bottom: 16px;
}
.privacy-card h3 { font-size: 1.12rem; margin-bottom: 8px; color: var(--panel-ink); }
.privacy-card p { font-size: 0.95rem; color: var(--panel-ink-2); }

.privacy-foot {
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--panel-ink-2);
}
.privacy-foot a { color: var(--panel-accent); font-weight: 700; }

@media (max-width: 760px) {
  .privacy-grid { grid-template-columns: 1fr; }
}

/* ---------- pricing ---------- */

.pricing-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 420px));
  justify-content: center;
  gap: 22px;
}

.price-card {
  padding: 34px 32px 36px;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.price-card.featured {
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--line-strong));
  box-shadow: var(--shadow-pop), 0 0 0 6px var(--accent-soft);
  position: relative;
}

.price-badge {
  position: absolute;
  top: -13px; right: 26px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  padding: 5px 13px;
  border-radius: 999px;
}
[data-theme="dark"] .price-badge { color: #14132B; }

.price-name { font-size: 1.25rem; font-weight: 800; }
.price-amount {
  margin-top: 14px;
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.price-amount .per {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0;
}
.price-alt {
  margin-top: 6px;
  font-size: 0.92rem;
  color: var(--ink-3);
  font-weight: 600;
}

.price-list {
  margin: 26px 0 30px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.price-list li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 0.97rem;
  color: var(--ink-2);
}
.price-list svg {
  flex: none;
  width: 19px; height: 19px;
  margin-top: 3px;
  color: var(--em-hope-ink);
}
.price-list li.muted { color: var(--ink-3); }
.price-list li.muted svg { color: var(--ink-3); opacity: 0.5; }

.price-card .btn { margin-top: auto; }

.pricing-note {
  margin-top: 26px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-3);
  font-weight: 600;
}

@media (max-width: 760px) {
  .pricing-grid { grid-template-columns: minmax(0, 440px); }
}

/* ---------- crisis strip ---------- */

.crisis {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: var(--sp-6) var(--sp-8);
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}
.crisis svg {
  flex: none;
  width: 24px; height: 24px;
  margin-top: 3px;
  color: var(--em-love-ink);
}
.crisis h3 { font-size: 1.1rem; margin-bottom: 6px; }
.crisis p { font-size: 0.95rem; color: var(--ink-2); max-width: 62em; }

/* ---------- FAQ ---------- */

.faq-list {
  margin-top: var(--sp-10);
  max-width: 760px;
  margin-inline: auto;
  display: grid;
  gap: var(--sp-3);
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--sp-5) var(--sp-6);
  font-weight: 700;
  font-size: 1.02rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  flex: none;
  width: 11px; height: 11px;
  border-right: 2.5px solid var(--ink-3);
  border-bottom: 2.5px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 200ms var(--ease-out);
  margin-right: 4px;
}
.faq-item[open] summary::after { transform: rotate(225deg); }
.faq-item .faq-body {
  padding: 0 var(--sp-6) var(--sp-5);
  color: var(--ink-2);
  font-size: 0.98rem;
  text-align: left;
}
@media (prefers-reduced-motion: reduce) {
  .faq-item summary::after { transition: none; }
}

/* ---------- final CTA ---------- */

.final-cta { text-align: center; padding: 72px 0 84px; }
.final-cta h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
.final-cta .lead { margin-inline: auto; }
.final-cta .hero-cta { justify-content: center; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 52px;
  font-size: 0.92rem;
  color: var(--ink-3);
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.footer .brand { font-size: 1.05rem; }
.footer .brand img, .footer .brand svg { width: 24px; height: 24px; border-radius: 6px; }
.footer-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  flex-wrap: wrap;
}
.footer-links a { color: var(--ink-2); font-weight: 600; }
.footer-copy { width: 100%; margin-top: 4px; }

/* ---------- legal pages ---------- */

.legal-hero { padding: 64px 0 18px; }
.legal-hero h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); }
.legal-hero .meta {
  margin-top: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-3);
}

.legal-summary {
  margin-top: 28px;
  padding: 24px 28px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  font-size: 0.98rem;
  color: var(--ink);
  max-width: 70ch;
}
.legal-summary b { font-weight: 800; }

.legal-body {
  padding: 28px 0 96px;
  max-width: 70ch;
}
.legal-body h2 {
  font-size: 1.45rem;
  margin: 44px 0 14px;
  scroll-margin-top: 90px;
}
.legal-body h3 { font-size: 1.12rem; margin: 28px 0 10px; }
.legal-body p { margin: 0 0 14px; color: var(--ink-2); }
.legal-body p b, .legal-body li b { color: var(--ink); }
.legal-body ul { margin: 0 0 16px; padding-left: 22px; color: var(--ink-2); }
.legal-body li { margin-bottom: 9px; }
.legal-body li::marker { color: var(--accent); }

.legal-toc {
  margin: 30px 0 8px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-elev);
}
.legal-toc strong {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.legal-toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 36px;
  font-size: 0.95rem;
}
.legal-toc li { margin-bottom: 7px; }
.legal-toc a { font-weight: 600; }

@media (max-width: 640px) {
  .legal-toc ol { columns: 1; }
}

.legal-callout {
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  background: var(--em-love-fill);
  color: var(--em-love-ink);
  font-weight: 600;
  font-size: 0.97rem;
  margin: 18px 0;
}

/* ---------- support page ---------- */

.support-cards {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 760px;
}
.support-card {
  padding: var(--sp-6);
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.support-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.support-card p { font-size: 0.95rem; color: var(--ink-2); margin-bottom: 16px; }

@media (max-width: 680px) {
  .support-cards { grid-template-columns: 1fr; }
}

/* ---------- responsive hero ---------- */

@media (max-width: 980px) {
  .hero { padding: 48px 0 72px; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .hero-copy { max-width: 620px; }
}

/* ============================================================
   Statistics bento — recreates the app's real Insights surfaces:
   Mood Flow, correlation scatter (ρ), mood distribution, the
   AI combo-pattern card, streak + calendar heatmap, voice bars.
   ============================================================ */

.bento {
  margin-top: var(--sp-10);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--sp-4);
}

.bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--sp-6);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.bento-card.b-wide { grid-column: span 7; }
.bento-card.b-narrow { grid-column: span 5; }
.bento-card.b-half { grid-column: span 6; }
.bento-card.b-full { grid-column: 1 / -1; }

.bento-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.bento-icon {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bento-icon svg { width: 17px; height: 17px; }
.bento-title { font-size: 1rem; font-weight: 800; letter-spacing: -0.01em; }
.bento-sub {
  font-size: 0.86rem;
  color: var(--ink-3);
  font-weight: 600;
  margin: 2px 0 16px;
}
.bento-spacer { flex: 1; }

/* shared pill: correlation strength / ρ / kind badges */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---- Mood Flow (gradient line + mood dots + area) ---- */
.flow-svg { width: 100%; height: auto; overflow: visible; }
.flow-svg .grid-line { stroke: var(--line); stroke-width: 1; }
.flow-svg .flow-area { fill: url(#flowArea); }
.flow-svg .flow-line {
  fill: none;
  stroke: url(#flowStroke);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.flow-svg .flow-dot { stroke: none; }
.flow-svg .axis-label {
  fill: var(--ink-3);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
}

.flow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}
.flow-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-2);
}
.flow-key i { width: 9px; height: 9px; border-radius: 50%; }

/* ---- Correlation scatter ---- */
.scatter-wrap { position: relative; }
.scatter-svg { width: 100%; height: auto; overflow: visible; }
.scatter-svg .sc-band { fill: var(--accent-soft); }
.scatter-svg .sc-ref { stroke: var(--ink-3); stroke-width: 1.4; stroke-dasharray: 4 4; opacity: 0.5; }
.scatter-svg .sc-reg { stroke: var(--ink-3); stroke-width: 2; opacity: 0.75; stroke-linecap: round; }
.scatter-svg .sc-axis {
  fill: var(--ink-3);
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 700;
}
.scatter-svg .sc-dot-pos { fill: var(--em-hope-ink); }
.scatter-svg .sc-dot-neg { fill: var(--em-excitement-ink); }
.scatter-foot {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--ink-2);
  font-weight: 600;
}
.scatter-foot b { color: var(--ink); }

/* ---- Mood distribution ---- */
.dist { display: grid; gap: 11px; margin-top: 2px; }
.dist-row {
  display: grid;
  grid-template-columns: 56px 1fr 42px;
  align-items: center;
  gap: 12px;
}
.dist-label { font-size: 0.86rem; font-weight: 800; }
.dist-track {
  height: 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  overflow: hidden;
}
.dist-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transform-origin: left center;
}
.dist-pct {
  text-align: right;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* ---- Combo insight (AI pattern) ---- */
.combo-when {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.combo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}
.combo-chip svg { width: 13px; height: 13px; }
.combo-arrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.combo-arrow .arr {
  flex: none;
  color: var(--accent-deep);
  font-weight: 800;
}
.combo-takeaway {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--accent-soft);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
}
.combo-takeaway svg { flex: none; width: 17px; height: 17px; color: var(--accent-deep); margin-top: 2px; }
.combo-foot {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--ink-3);
  font-weight: 600;
}

/* ---- Streak + calendar heatmap ---- */
.streak-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.streak-flame {
  flex: none;
  width: 52px; height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #FFD27A, #F0A93C);
  color: #5A3A00;
}
.streak-flame svg { width: 26px; height: 26px; }
.streak-num {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.streak-cap { font-size: 0.85rem; color: var(--ink-3); font-weight: 600; margin-top: 3px; }

/* 7-day weekday tokens (gold = wrote that day) */
.streak-tokens { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.stk {
  aspect-ratio: 1;
  max-height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
}
.stk.on {
  background: linear-gradient(160deg, #FFCE6E, #F0A93C);
  color: #5A3A00;
}
.stk.today {
  color: var(--ink-3);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  border-style: dashed;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.heatmap .hm-dow {
  font-size: 0.66rem;
  font-weight: 800;
  text-align: center;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.heatmap .hm-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.heatmap .hm-cell.lvl::after { content: ""; }
.heatmap .hm-today { box-shadow: inset 0 0 0 1.5px var(--accent); }

/* ---- Voice × mood diverging bars ---- */
.dvg-svg { width: 100%; height: auto; overflow: visible; }
.dvg-svg .dvg-base { stroke: var(--line-strong); stroke-width: 1.4; }
.dvg-svg .dvg-axis {
  fill: var(--ink-3);
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 700;
}
.dvg-legend {
  display: flex;
  gap: 18px;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-2);
}
.dvg-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

/* ---- bento responsive ---- */
@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(6, 1fr); }
  .bento-card.b-wide,
  .bento-card.b-narrow,
  .bento-card.b-half { grid-column: span 6; }
}

/* ============================================================
   Reveal animations — gated on html.anim (added by JS only when
   motion is allowed), so no-JS and reduced-motion show final state.
   Transform/opacity only; one-shot on first scroll-into-view.
   ============================================================ */

/* line draw (paths use pathLength="1") */
html.anim .reveal .draw-line,
html.anim .reveal .draw-reg {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
html.anim .reveal.in .draw-line {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.25s var(--ease-out-strong);
}
html.anim .reveal.in .draw-reg {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.9s var(--ease-out) 0.5s;
}

/* area + axis fade */
html.anim .reveal .fade-soft { opacity: 0; }
html.anim .reveal.in .fade-soft {
  opacity: 1;
  transition: opacity 0.9s ease 0.35s;
}

/* dots pop (SVG circles) */
html.anim .reveal .pop {
  opacity: 0;
  transform: scale(0.4);
  transform-box: fill-box;
  transform-origin: center;
}
html.anim .reveal.in .pop {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.35s ease, transform 0.5s var(--ease-out-strong);
}

/* Containers remain visible. Reveal classes animate only their product data. */

/* HRV is a trend line — styles in the "hrv trend" block below */

/* distribution / diverging bars grow */
html.anim .reveal .grow-x { transform: scaleX(0); }
html.anim .reveal.in .grow-x {
  transform: scaleX(1);
  transition: transform 0.85s var(--ease-out-strong);
}
html.anim .reveal .grow-y {
  transform: scaleY(0);
  transform-box: fill-box;
  transform-origin: var(--gy, bottom);
}
html.anim .reveal.in .grow-y {
  transform: scaleY(1);
  transition: transform 0.7s var(--ease-out-strong);
}

/* heatmap cells fade-pop */
html.anim .reveal .hm-cell { opacity: 0; transform: scale(0.6); }
html.anim .reveal.in .hm-cell {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
}

/* staggers (kept short — Emil: no long sequential waits) */
html.anim .reveal.in .st > *:nth-child(1) { transition-delay: 0.05s; }
html.anim .reveal.in .st > *:nth-child(2) { transition-delay: 0.12s; }
html.anim .reveal.in .st > *:nth-child(3) { transition-delay: 0.19s; }
html.anim .reveal.in .st > *:nth-child(4) { transition-delay: 0.26s; }
html.anim .reveal.in .st > *:nth-child(5) { transition-delay: 0.33s; }
html.anim .reveal.in .st > *:nth-child(6) { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  html.anim .reveal *,
  html.anim .reveal.in * { transition: none !important; }
}

/* ============================================================
   Extra stat cards recreating the iOS Statistics / Correlations
   screens: day-of-week, time-of-day radial, sleep pattern,
   HRV trend, topics × mood.
   ============================================================ */

.bento-card svg text { font-family: var(--font); }
.bento-card .ax { fill: var(--ink-3); font-size: 11px; font-weight: 700; }

.csvg { width: 100%; height: auto; overflow: visible; }
.csvg .grid-line { stroke: var(--line); stroke-width: 1; }

/* day of week — gradient bars + count badges */
.dow-badge-bg { fill: #20202B; }
.dow-badge-tx { fill: #fff; font-size: 13px; font-weight: 800; }

/* shared 5-swatch mood legend */
.mood-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-2);
}
.mood-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mood-legend i { width: 10px; height: 10px; border-radius: 3px; }

/* month calendar */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cal-nav {
  margin-left: auto;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cal-nav span { color: var(--ink-3); padding: 0 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cal-dow {
  text-align: center;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cal-cell.fill { color: rgba(0, 0, 0, 0.6); }
.cal-cell.empty { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-3); }
.cal-cell.future { background: color-mix(in srgb, var(--ink) 3.5%, transparent); color: var(--ink-3); opacity: 0.5; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--accent); color: var(--ink); }

/* time of day radial */
.tod-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.tod-legend { display: grid; gap: 10px; }
.tod-legend .row { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); }
.tod-legend .row i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.tod-legend .row b { color: var(--ink); font-weight: 700; }
.tod-svg { width: 196px; height: 196px; flex: none; }
.tod-svg .tod-ring { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.tod-svg .tod-lab { fill: var(--ink-3); font-size: 11px; font-weight: 700; }
.tod-foot { margin-top: 14px; font-size: 0.85rem; color: var(--ink-3); font-weight: 600; }

@media (max-width: 540px) {
  .tod-wrap { justify-content: center; }
}

/* sleep pattern */
.sleep-svg .avg-line { stroke: rgba(130, 130, 140, 0.6); stroke-width: 1.5; stroke-dasharray: 3 4; }
.sleep-legend, .hrv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
}
.sleep-legend span, .hrv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sleep-legend i, .hrv-legend i { width: 10px; height: 10px; border-radius: 3px; }
.hrv-legend i.round { border-radius: 50%; }

/* hrv trend */
.hrv-svg .hrv-band { fill: #2F9A93; opacity: 0.14; }
.hrv-svg .hrv-line { fill: none; stroke: url(#hrvStroke); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hrv-svg .hrv-dot { stroke: var(--bg-elev); stroke-width: 2; }
.hrv-svg .hrv-yax { fill: var(--ink-3); font-size: 10.5px; font-weight: 700; }

/* topics × mood timeline */
.txm { display: grid; gap: 4px; }
.txm-row { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: start; padding: 2px 0; }
.txm-mood {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.02rem;
  font-weight: 800;
  padding-top: 4px;
}
.txm-mood .node { width: 11px; height: 11px; border-radius: 50%; flex: none; }
/* connecting spine */
.txm-row:not(:last-child) .txm-mood::before {
  content: "";
  position: absolute;
  left: 5px; top: 22px; bottom: -10px;
  width: 2px;
  background: var(--line-strong);
}
.txm-pills { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 8px; }
.txm-pill {
  font-size: 0.86rem;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--p-fill, var(--bg-soft));
  color: var(--p-ink, var(--ink));
  box-shadow: inset 0 0 0 1.3px color-mix(in srgb, var(--p-ink, var(--ink)) 30%, transparent);
}

@media (max-width: 460px) {
  .txm-row { grid-template-columns: 1fr; gap: 6px; }
  .txm-row:not(:last-child) .txm-mood::before { display: none; }
}

/* ============================================================
   v4 redesign — proof band, signature/secondary split,
   calmer Apple-Wellbeing surfaces, lighter cards.
   ============================================================ */

/* proof / privacy band under the hero */
.proof-band {
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg));
}
.proof-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3) var(--sp-4);
  padding: 16px 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-2);
}
.proof-item { display: inline-flex; align-items: center; gap: 8px; }
.proof-item svg { width: 18px; height: 18px; color: var(--accent-deep); flex: none; }
.proof-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); opacity: 0.5; }
@media (max-width: 760px) {
  .proof-dot { display: none; }
}

/* calm Apple-Wellbeing mesh behind the data sections (#8) */
#insights, #stats {
  background:
    radial-gradient(55% 45% at 8% 4%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 72%),
    radial-gradient(50% 42% at 100% 38%, color-mix(in srgb, var(--teal) 8%, transparent), transparent 72%);
}
/* cards pick up a faint wellbeing tint instead of flat white/grey */
.bento-card,
.chart-card,
.gauge-card {
  background: color-mix(in srgb, var(--accent) 3.5%, var(--bg-elev));
}

/* signature group spacing */
.bento-signature { margin-top: 44px; }

/* "more inside the app" — clearly secondary, lighter, smaller (#7) */
.more-label {
  margin: 56px 0 18px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.bento-more .bento-card {
  padding: 20px 20px 18px;
  border-left-width: 2px;
  box-shadow: var(--shadow-card);
  opacity: 0.96;
}
.bento-more .bento-title { font-size: 0.95rem; }
.bento-more .bento-sub { font-size: 0.82rem; margin-bottom: 12px; }

/* ---- app-style lenses: Statistics / Correlations sub-groups ---- */
.lens-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 46px 0 18px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.lens-label::before,
.lens-label::after {
  content: "";
  flex: none;
  height: 1px;
  width: 38px;
  background: var(--line-strong);
}
.bento-lens { margin-top: 0; }
/* voice-signals lens lives inside the centred Signals section → re-left-align */
.voice-lens { margin-top: 0; text-align: left; align-items: center; }
.voice-lead { max-width: 30rem; margin-bottom: var(--sp-5); color: var(--ink-2); font-size: 1.02rem; line-height: 1.6; }

/* ---- insights: example cards that open a modal (Daily / Weekly / Monthly / Themed) ---- */
.ix-cards {
  margin: var(--sp-10) auto 0;
  max-width: 940px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
.ix-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  text-align: left;
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 3.5%, var(--bg-elev));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), border-color 0.2s ease;
}
@media (hover: hover) {
  .ix-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
    border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  }
  .ix-card:hover .ix-card-cta svg { transform: translateX(3px); }
}
.ix-card:active { transform: translateY(-1px); }
.ix-card-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--t-ink);
  background: var(--t-fill);
}
.ix-card-badge svg { width: 14px; height: 14px; }
.ix-card-desc { flex: 1; font-size: 0.9rem; line-height: 1.45; color: var(--ink-2); }
.ix-card-cta {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.82rem; font-weight: 800; color: var(--accent);
}
.ix-card-cta svg { width: 14px; height: 14px; transition: transform 0.2s var(--ease-out); }
@media (max-width: 860px) { .ix-cards { grid-template-columns: repeat(2, 1fr); max-width: 560px; } }
@media (max-width: 480px) { .ix-cards { grid-template-columns: 1fr; max-width: 380px; } }

/* modal — the bigger window */
.ix-modal {
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  width: min(540px, 92vw);
  max-height: 86vh;
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transform-origin: center;
  will-change: transform, opacity;
}
.ix-modal[open] { display: flex; flex-direction: column; }
.ix-modal::backdrop {
  background: rgba(13, 12, 18, 0.42);
  -webkit-backdrop-filter: blur(18px) saturate(0.82);
  backdrop-filter: blur(18px) saturate(0.82);
  animation: ixFade 0.3s var(--ease-out);
}
.ix-modal.is-closing::backdrop { animation: ixFadeOut 0.18s ease-out forwards; }
@keyframes ixFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ixFadeOut { from { opacity: 1; } to { opacity: 0; } }
.ix-modal-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--t-fill), color-mix(in srgb, var(--t-fill) 25%, var(--bg-elev)));
  border-bottom: 1px solid var(--line);
}
.ix-modal-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.86rem; font-weight: 800; color: var(--t-ink);
}
.ix-modal-badge svg { width: 16px; height: 16px; }
.ix-modal-close {
  flex: none;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: none;
  color: #fff;
  background: #242329;
  box-shadow: 0 6px 16px rgba(20, 19, 26, 0.18);
  transition: transform 120ms var(--ease-out), background-color 150ms ease, box-shadow 150ms ease;
}
.ix-modal-close:active { transform: scale(0.92); }
.ix-modal-close svg { width: 17px; height: 17px; }
[data-theme="dark"] .ix-modal-close {
  color: #17161C;
  background: #F1EFF5;
  box-shadow: 0 6px 18px rgba(0,0,0,0.26);
}
@media (hover: hover) and (pointer: fine) {
  .ix-modal-close:hover {
    background: #08080A;
    box-shadow: 0 8px 20px rgba(20, 19, 26, 0.24);
  }
  [data-theme="dark"] .ix-modal-close:hover { background: #fff; }
}
.ix-modal-body { padding: var(--sp-5) var(--sp-5) var(--sp-6); overflow-y: auto; text-align: left; }
@media (prefers-reduced-motion: reduce) {
  .ix-modal::backdrop,
  .ix-modal.is-closing::backdrop { animation: none; }
  body.intro .ps-daily .ps-di-row,
  .steps.motion-trigger.in .mic-pulse::after,
  html.anim .steps.motion-trigger.in .step-icon,
  html.anim .steps.motion-trigger.in .step-draw,
  html.anim .steps.motion-trigger.in .step-dot { animation: none; }
  html.anim .steps.motion-trigger .step-icon,
  html.anim .steps.motion-trigger .step-dot { opacity: 1; transform: none; }
  html.anim .steps.motion-trigger .step-draw { stroke-dashoffset: 0; }
}

/* shared example content (rendered inside the modal body) */
.ix-when { font-size: 0.8rem; font-weight: 600; color: var(--ink-3); margin: 0 0 6px; }
.ix-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.ix-ic { flex: none; margin-top: 1px; }
.ix-ic svg { width: 20px; height: 20px; }
.ix-lab { display: block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.ix-row p { font-size: 0.95rem; line-height: 1.5; color: var(--ink); }
.ix-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 4px; }
.ix-meta { font-size: 0.82rem; font-weight: 600; color: var(--ink-3); margin-bottom: 12px; }
.ix-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 15px; }
.ix-chip {
  font-size: 0.78rem; font-weight: 700;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border-radius: 999px;
  padding: 4px 11px;
}
.ix-para { font-size: 0.95rem; line-height: 1.55; color: var(--ink); margin-bottom: 11px; }
.ix-close { font-size: 0.92rem; line-height: 1.5; color: var(--ink-3); font-style: italic; margin: 6px 0 2px; }
/* iOS-style mini-cards inside the modal — each section in its own card, not a wall of text */
.ix-card-block {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--sp-4);
  padding: var(--sp-4);
  margin-top: var(--sp-3);
}
.ix-card-block .ix-row { padding: var(--sp-2) 0; }
.ix-card-block .ix-row:first-child { padding-top: 0; }
.ix-card-block .ix-row:last-child { padding-bottom: 0; }
.ix-letter .ix-para:first-child { margin-top: 0; }
.ix-letter .ix-close { margin-bottom: 0; }
.ix-sub { }
.ix-sub-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.95rem; font-weight: 800;
  margin-bottom: 9px;
}
.ix-sub-head svg { flex: none; width: 16px; height: 16px; color: var(--ink-3); }
.ix-sub p { font-size: 0.93rem; line-height: 1.5; color: var(--ink-2); margin-bottom: 4px; }
.ix-tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 800;
  color: var(--t-ink); background: var(--t-fill);
  border-radius: 999px; padding: 3px 10px;
  margin: 9px 0 5px;
}

/* ---- gentle hero phone float + scroll fade-up reveal (point #1) ---- */
@keyframes phoneFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
.phone { animation: phoneFloat 7s var(--ease-out) infinite; will-change: transform; }
.ps-wave.paused ~ * .phone { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .phone { animation: none; }
}

/* ---- phone: Summary peek + floating tab bar (fills the home screen) ---- */
.ps-summary {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 18px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
}
.ps-summary-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.7rem; font-weight: 800;
  color: var(--ph-gold);
  background: color-mix(in srgb, var(--ph-gold) 16%, transparent);
  padding: 3px 9px; border-radius: 999px;
}
.ps-summary-badge svg { width: 11px; height: 11px; }
.ps-summary-title { margin-top: 9px; font-size: 0.95rem; font-weight: 800; line-height: 1.2; color: var(--ph-ink); }
.ps-summary-meta { margin-top: 3px; font-size: 0.72rem; font-weight: 600; color: var(--ph-ink-2); }
.ps-summary-body { margin-top: 8px; font-size: 0.78rem; line-height: 1.42; color: var(--ph-ink-2); }

.ps-tabbar {
  position: absolute;
  left: 14px; right: 14px; bottom: 12px;
  display: flex; align-items: center; gap: 4px;
  padding: 7px 8px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--ph-card) 92%, transparent);
  border: 1px solid var(--ph-border);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.ps-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 0.55rem; font-weight: 700;
  color: var(--ph-ink-2);
}
.ps-tab svg { width: 17px; height: 17px; }
.ps-tab.active { color: var(--accent); }
.ps-plus {
  flex: none;
  width: 34px; height: 34px; margin-left: 2px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
}
[data-theme="dark"] .ps-plus { color: #14132B; }
.ps-plus svg { width: 16px; height: 16px; }

/* ---- insight cadences (Daily / Weekly / Monthly / Themed) ---- */
.cadence-grid {
  margin-top: var(--sp-10);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
.cadence-card {
  text-align: left;
  padding: var(--sp-6);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 3.5%, var(--bg-elev));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.cadence-ic {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.cadence-ic svg { width: 21px; height: 21px; }
.cadence-card h3 { font-size: 1.12rem; margin-bottom: 7px; }
.cadence-card p { font-size: 0.92rem; line-height: 1.5; color: var(--ink-2); }
@media (max-width: 860px) { .cadence-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .cadence-grid { grid-template-columns: 1fr; } }

/* ---- signature charts: smaller, centred (not full-bleed) ---- */
.bento-signature .dvg-svg,
.bento-signature .flow-svg { max-width: 680px; margin-inline: auto; }
.bento-signature .dist { max-width: 560px; margin-inline: auto; }

/* ---- mobile: tighten the vertical rhythm further (gradient tints already separate sections) ---- */
@media (max-width: 760px) {
  .section { padding: 52px 0; }
  .section-tight { padding: 38px 0; }
  .final-cta { padding: 56px 0 66px; }
  .legal-hero { padding: 48px 0 16px; }
}
@media (max-width: 560px) {
  :root { --sp-8: 22px; --sp-10: 28px; }
  .section { padding: 44px 0; }
  .section-tight { padding: 30px 0; }
  .final-cta { padding: 48px 0 56px; }
  .hero { padding: 36px 0 56px; }
  .legal-hero { padding: 40px 0 14px; }
}
