/* ==========================================================================
   Cosmetic Checker: design system "Atelier"
   Warm ivory + rosewood, champagne-gold hairlines, serif display type.
   All tokens live in :root; dark mode is redefined three ways (see bottom of tokens).
   ========================================================================== */

:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #fbf6f2;
  --bg-alt: #f4ebe6;
  --surface: #ffffff;
  --surface-2: #fdf9f6;
  --line: rgba(74, 40, 46, 0.12);
  --line-strong: rgba(74, 40, 46, 0.22);

  /* Text */
  --ink: #2a1a1e;
  --ink-soft: #5d4a4f;
  --ink-mute: #85737a;

  /* Brand */
  --rose: #9a4f58;
  --rose-deep: #7b3a43;
  --rose-wash: #f3dfe0;
  --gold: #a98450;
  --gold-soft: #d8c19a;
  --on-rose: #fff8f6;

  /* Hero atmosphere */
  --halo-a: rgba(226, 150, 158, 0.38);
  --halo-b: rgba(216, 193, 154, 0.32);
  --halo-c: rgba(190, 150, 210, 0.18);

  /* Elevation: warm rose glow, never grey/black */
  --shadow-sm: 0 1px 2px rgba(122, 58, 67, 0.06), 0 4px 14px rgba(122, 58, 67, 0.06);
  --shadow-md: 0 2px 6px rgba(122, 58, 67, 0.06), 0 18px 44px rgba(122, 58, 67, 0.12);
  --shadow-lg: 0 6px 16px rgba(122, 58, 67, 0.08), 0 40px 90px rgba(122, 58, 67, 0.2);
  --phone-bezel: #1c1215;

  /* Type */
  --font-display: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: 'Jost', 'Avenir Next', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Rhythm */
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 32px;
  --container: 1180px;
  --gutter: clamp(20px, 5vw, 40px);
  --section: clamp(84px, 12vw, 148px);
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Dark: explicit toggle */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #150d10;
  --bg-alt: #1b1215;
  --surface: #211619;
  --surface-2: #281b1f;
  --line: rgba(245, 226, 220, 0.1);
  --line-strong: rgba(245, 226, 220, 0.2);
  --ink: #f6ece8;
  --ink-soft: #d0bcc0;
  --ink-mute: #a08e93;
  --rose: #e2a1a8;
  --rose-deep: #efb8bd;
  --rose-wash: #3a2127;
  --gold: #d9b87e;
  --gold-soft: #8a6f46;
  --on-rose: #2a1418;
  --halo-a: rgba(190, 90, 108, 0.3);
  --halo-b: rgba(170, 130, 70, 0.2);
  --halo-c: rgba(130, 90, 170, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 44px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.35), 0 40px 90px rgba(0, 0, 0, 0.55);
  --phone-bezel: #0b0607;
}

/* Dark: follow the OS until the visitor chooses */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #150d10;
    --bg-alt: #1b1215;
    --surface: #211619;
    --surface-2: #281b1f;
    --line: rgba(245, 226, 220, 0.1);
    --line-strong: rgba(245, 226, 220, 0.2);
    --ink: #f6ece8;
    --ink-soft: #d0bcc0;
    --ink-mute: #a08e93;
    --rose: #e2a1a8;
    --rose-deep: #efb8bd;
    --rose-wash: #3a2127;
    --gold: #d9b87e;
    --gold-soft: #8a6f46;
    --on-rose: #2a1418;
    --halo-a: rgba(190, 90, 108, 0.3);
    --halo-b: rgba(170, 130, 70, 0.2);
    --halo-c: rgba(130, 90, 170, 0.18);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 44px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.35), 0 40px 90px rgba(0, 0, 0, 0.55);
    --phone-bezel: #0b0607;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 500; line-height: 1.08; letter-spacing: -0.01em; font-variant-numeric: lining-nums; }
.stat-num, .step::before, .notfound-code { font-variant-numeric: lining-nums; }

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

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 500;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Typographic helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before { content: ''; width: 28px; height: 1px; background: currentColor; }

.display { font-size: clamp(2.6rem, 6.4vw, 5.1rem); }
.display em, .title em, .cta-title em { font-style: italic; color: var(--rose); font-weight: 500; }
.title { font-size: clamp(2rem, 4.2vw, 3.3rem); }
.lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--ink-soft); max-width: 40ch; }

.section { padding-block: var(--section); position: relative; }
.section--alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head .title { margin-top: 18px; }
.section-head p { margin-top: 18px; color: var(--ink-soft); }

/* ---------- Buttons & badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px; border-radius: 999px;
  font-weight: 500; font-size: 0.98rem; letter-spacing: 0.02em; text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--rose); color: var(--on-rose); box-shadow: 0 10px 28px rgba(154, 79, 88, 0.3); }
.btn--primary:hover { background: var(--rose-deep); box-shadow: 0 14px 34px rgba(154, 79, 88, 0.38); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--rose); color: var(--rose); }
.btn .icon { width: 1.1em; height: 1.1em; }

.stores { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.store-badge { display: block; border-radius: 10px; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.store-badge:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.store-badge img { height: 52px; width: auto; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(18px); backdrop-filter: saturate(1.4) blur(18px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: var(--shadow-sm); }
.brand-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: 0.01em; }
.nav-links { display: none; align-items: center; gap: 34px; }
.nav-links a { text-decoration: none; font-size: 0.95rem; color: var(--ink-soft); position: relative; transition: color 0.2s; }
.nav-links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.nav-links a:hover, .nav-links a[aria-current='page'] { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current='page']::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-cta { display: none; min-height: 42px; padding: 0 20px; font-size: 0.92rem; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface); }
.icon-btn .icon { width: 20px; height: 20px; }
.theme-toggle .i-moon { display: none; }
:root[data-theme='dark'] .theme-toggle .i-sun { display: none; }
:root[data-theme='dark'] .theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme='light']) .theme-toggle .i-moon { display: block; }
}

.menu-btn .bars { width: 18px; height: 12px; position: relative; display: block; }
.menu-btn .bars::before, .menu-btn .bars::after { content: ''; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform 0.3s var(--ease), top 0.3s var(--ease); }
.menu-btn .bars::before { top: 1px; }
.menu-btn .bars::after { top: 9px; }
.menu-btn[aria-expanded='true'] .bars::before { top: 5px; transform: rotate(45deg); }
.menu-btn[aria-expanded='true'] .bars::after { top: 5px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 90; background: var(--bg);
  padding: calc(var(--nav-h) + 24px) var(--gutter) 40px;
  display: flex; flex-direction: column; gap: 4px;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}
.menu.is-open { opacity: 1; visibility: visible; transform: none; }
.menu a:not(.btn) { font-family: var(--font-display); font-size: 2.1rem; text-decoration: none; padding: 12px 0; border-bottom: 1px solid var(--line); }
.menu .btn { margin-top: 28px; align-self: flex-start; }

@media (min-width: 900px) {
  .nav-links, .nav-cta { display: inline-flex; }
  .menu-btn, .menu { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: calc(var(--nav-h) + clamp(36px, 7vw, 88px)); padding-bottom: clamp(72px, 9vw, 120px); overflow: clip; }
.hero-halo { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero-halo::before, .hero-halo::after { content: ''; position: absolute; border-radius: 50%; filter: blur(70px); }
.hero-halo::before { width: 620px; height: 620px; right: -120px; top: -80px; background: radial-gradient(circle, var(--halo-a), transparent 68%); }
.hero-halo::after { width: 520px; height: 520px; left: -160px; bottom: -120px; background: radial-gradient(circle, var(--halo-b), transparent 68%); }
.hero-grid { position: relative; z-index: 1; display: grid; gap: clamp(48px, 7vw, 80px); align-items: center; }
.hero-copy .display { margin: 22px 0 26px; }
.hero-copy .lede { margin-bottom: 38px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 14px 30px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.95rem; }
.hero-proof li { display: flex; align-items: center; gap: 10px; }
.hero-proof .icon { color: var(--gold); width: 1.15em; height: 1.15em; }
.hero-proof { list-style: none; padding-inline: 0; margin-bottom: 0; }

.hero-stage { position: relative; min-height: 520px; display: grid; place-items: center; }
.hero-stage .phone--main { position: relative; z-index: 2; width: min(270px, 62vw); }
.hero-stage .phone--back { position: absolute; z-index: 1; width: min(228px, 52vw); right: 50%; top: 50%; transform: translate(-30%, -46%) rotate(-7deg); opacity: 0.96; }
.hero-stage .phone--side { position: absolute; z-index: 1; width: min(228px, 52vw); left: 50%; top: 50%; transform: translate(34%, -40%) rotate(7deg); }
.hero-stage .ring { position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 1px solid var(--gold-soft); opacity: 0.55; }
.hero-stage .ring--2 { width: 560px; height: 560px; opacity: 0.28; }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
  .hero-stage { min-height: 640px; }
}
@media (max-width: 560px) {
  .hero-stage .phone--back, .hero-stage .phone--side { display: none; }
  .hero-stage { min-height: 0; }
  .hero-stage .ring { width: 330px; height: 330px; }
  .hero-stage .ring--2 { width: 430px; height: 430px; }
  .store-badge img { height: 48px; }
}

/* ---------- Phone frame ---------- */
.phone {
  position: relative; border-radius: 15% / 7%; padding: 2.6%;
  background: var(--phone-bezel);
  box-shadow: var(--shadow-lg), inset 0 0 0 1.5px rgba(255, 255, 255, 0.14);
}
.phone img { width: 100%; aspect-ratio: 1206 / 2622; object-fit: cover; border-radius: 13% / 6%; background: var(--bg-alt); }

/* ---------- Trust strip ---------- */
.strip { border-block: 1px solid var(--line); background: var(--surface-2); }
.strip-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.stat { padding: 34px 16px; text-align: center; border-right: 1px solid var(--line); }
.stat:nth-child(2n) { border-right: 0; }
.stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
.stat-num { font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 500; line-height: 1; color: var(--rose); }
.stat-label { margin-top: 10px; font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); }
@media (min-width: 800px) {
  .strip-grid { grid-template-columns: repeat(4, 1fr); }
  .stat { border-bottom: 0 !important; border-right: 1px solid var(--line) !important; }
  .stat:last-child { border-right: 0 !important; }
}

/* ---------- How it works ---------- */
.how-grid { display: grid; gap: clamp(40px, 7vw, 96px); align-items: center; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { display: grid; grid-template-columns: 76px 1fr; gap: 6px 20px; padding: 30px 0; border-top: 1px solid var(--line); }
.step:last-child { border-bottom: 1px solid var(--line); }
.step::before { counter-increment: step; content: '0' counter(step); grid-row: span 2; font-family: var(--font-display); font-size: 3.6rem; line-height: 0.9; color: var(--gold); font-style: italic; }
.step h3 { font-size: 1.7rem; }
.step p { color: var(--ink-soft); max-width: 46ch; }
.how-visual { position: relative; display: grid; place-items: center; padding: 20px 0; }
.how-visual .phone { width: min(300px, 70vw); }
.how-visual::before { content: ''; position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--halo-a), transparent 70%); filter: blur(30px); }
.how-visual .phone { position: relative; }
@media (min-width: 900px) { .how-grid { grid-template-columns: 1.1fr 0.9fr; } }

/* ---------- Features (bento) ---------- */
.bento { display: grid; gap: 18px; grid-template-columns: 1fr; }
.card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(26px, 3vw, 38px);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--rose-wash); color: var(--rose); margin-bottom: 26px; }
.card-icon .icon { width: 24px; height: 24px; }
.card h3 { font-size: 1.75rem; margin-bottom: 12px; }
.card p { color: var(--ink-soft); font-size: 1rem; }
.card--feature { background: linear-gradient(160deg, var(--rose-wash), var(--surface) 62%); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 500; letter-spacing: 0.03em; border: 1px solid var(--line-strong); color: var(--ink-soft); background: var(--surface-2); }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--gold)); }
.pill--fresh { --dot: #5faa44; }
.pill--soon { --dot: #e8962a; }
.pill--expired { --dot: #d23f3f; }
@media (min-width: 760px) {
  .bento { grid-template-columns: repeat(6, 1fr); }
  .bento .card { grid-column: span 3; }
  .bento .card--wide { grid-column: span 4; }
  .bento .card--narrow { grid-column: span 2; }
}

/* ---------- Themes ---------- */
.themes { overflow: clip; }
.themes-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 3vw, 32px); align-items: start; }
.themes-row .phone { width: 100%; }
.themes-row figure { margin: 0; }
.themes-row figure:nth-child(even) { margin-top: 44px; }
.themes-row figcaption { margin-top: 18px; text-align: center; font-family: var(--font-display); font-size: 1.35rem; font-style: italic; color: var(--ink-soft); }
@media (min-width: 860px) { .themes-row { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Guide teaser ---------- */
.teaser { display: grid; gap: 32px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(30px, 5vw, 64px); position: relative; overflow: hidden; }
.teaser::after { content: ''; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, var(--halo-b), transparent 70%); }
.teaser > * { position: relative; z-index: 1; }
.teaser p { color: var(--ink-soft); margin-top: 16px; max-width: 54ch; }
@media (min-width: 800px) { .teaser { grid-template-columns: 1fr auto; } }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin-inline: auto; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 0; cursor: pointer; font-family: var(--font-display); font-size: clamp(1.3rem, 2.4vw, 1.65rem); line-height: 1.2; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--gold); transition: transform 0.3s var(--ease); width: 22px; height: 22px; }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq .answer { padding: 0 0 28px; color: var(--ink-soft); max-width: 66ch; }
.faq .answer a { color: var(--rose); }

/* ---------- Download CTA ---------- */
.cta { text-align: center; position: relative; overflow: clip; padding-top: calc(var(--section) * 0.35); }
.cta::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 80% at 50% 100%, var(--halo-a), transparent 70%); pointer-events: none; }
.cta .container { position: relative; }
.cta-title { font-size: clamp(2.4rem, 5.4vw, 4.2rem); max-width: 16ch; margin: 22px auto 20px; }
.cta p.lede { margin-inline: auto; margin-bottom: 38px; }
.cta .stores { justify-content: center; }
.cta-icon { width: 84px; height: 84px; border-radius: 24px; margin: 0 auto 8px; box-shadow: var(--shadow-md); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 64px 36px; background: var(--bg-alt); }
.footer-grid { display: grid; gap: 40px; }
.footer-brand p { margin-top: 16px; color: var(--ink-soft); max-width: 34ch; font-size: 0.98rem; }
.footer-col h4 { font-family: var(--font-body); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
.footer-col a { display: block; text-decoration: none; color: var(--ink-soft); padding: 5px 0; font-size: 0.98rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--rose); }
.footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.footer-note { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--ink-mute); display: grid; gap: 10px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.3fr 1fr; } .footer-cols { grid-template-columns: repeat(3, 1fr); } }

/* ---------- To top ---------- */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 80; background: var(--surface); box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity 0.3s, transform 0.3s, visibility 0.3s, border-color 0.2s, background 0.2s; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ---------- Reveal ---------- */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }
.d1 { --d: 0.08s; } .d2 { --d: 0.16s; } .d3 { --d: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Prose pages (privacy, guide, 404) ---------- */
.page-head { padding-top: calc(var(--nav-h) + clamp(48px, 8vw, 96px)); padding-bottom: clamp(32px, 5vw, 56px); position: relative; overflow: clip; border-bottom: 1px solid var(--line); }
.page-head .hero-halo::before { width: 420px; height: 420px; right: -100px; top: -140px; }
.page-head .hero-halo::after { display: none; }
.page-head .container { position: relative; z-index: 1; }
.page-head h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); margin: 18px 0 16px; }
.page-head p { color: var(--ink-soft); max-width: 58ch; }
.crumbs { display: flex; gap: 10px; font-size: 0.9rem; color: var(--ink-mute); margin-bottom: 8px; }
.crumbs a { text-decoration: none; color: var(--ink-soft); }
.crumbs a:hover { color: var(--rose); }

.prose-wrap { padding-block: clamp(48px, 7vw, 88px) var(--section); }
.prose { max-width: 740px; margin-inline: auto; }
.prose h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); margin: 56px 0 16px; padding-top: 8px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.5rem; margin: 32px 0 10px; }
.prose p, .prose li { color: var(--ink-soft); }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 1.3em; }
.prose li { margin-bottom: 8px; padding-left: 4px; }
.prose li::marker { color: var(--gold); }
.prose a { color: var(--rose); text-underline-offset: 3px; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose .meta { font-size: 0.92rem; color: var(--ink-mute); margin-bottom: 36px; }
.callout { border: 1px solid var(--line-strong); border-left: 3px solid var(--gold); background: var(--surface); border-radius: var(--radius-sm); padding: 20px 24px; margin: 28px 0; }
.callout p:last-child { margin: 0; }

.table-wrap { overflow-x: auto; margin: 22px 0 28px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--ink); background: var(--surface-2); font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; }
td { color: var(--ink-soft); }
tr:last-child td { border-bottom: 0; }

.notfound { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 120px var(--gutter) 80px; position: relative; overflow: clip; }
.notfound-code { font-family: var(--font-display); font-size: clamp(7rem, 22vw, 14rem); line-height: 0.85; color: var(--gold-soft); font-style: italic; }
.notfound h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 8px 0 16px; }
.notfound p { color: var(--ink-soft); margin: 0 auto 32px; max-width: 42ch; }
.notfound > div { position: relative; z-index: 1; }

@media print {
  .nav, .menu, .to-top, .footer, .hero-halo { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page-head { padding-top: 0; border: 0; }
  .prose a { color: #000; }
}

.page-head h1 em, .notfound h1 em { font-style: italic; color: var(--rose); }

/* Typographic polish: no orphans, keep emphasized phrases together */
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.display em { white-space: nowrap; }
