/* ============================================================================
   main.css — base reset, layout, navigation, buttons, footer, utilities.
   Motion-graphic components live in motion.css.
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease-standard), color 0.4s var(--ease-standard);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--flesh); outline-offset: 3px; border-radius: 4px; }

/* ---- Typographic primitives ----------------------------------------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08;
  letter-spacing: -0.01em; margin: 0; }
.serif { font-family: var(--font-display); }
.mono-label {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--flesh);
}
.lede { color: var(--pith); font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem); line-height: 1.55; }

/* ---- Layout --------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--screen-h); }
section { position: relative; }
.section-pad { padding-block: var(--sp-section); }

/* ============================================================================
   Navigation
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  border-bottom: 0.75px solid transparent;
  transition: border-color 0.3s var(--ease-standard), background-color 0.3s var(--ease-standard);
}
.nav.scrolled { border-bottom-color: var(--whisper); }
.nav__inner {
  display: flex; align-items: center; gap: var(--sp-lg);
  height: 64px; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--screen-h);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display);
  font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 1px 2px var(--shadow)); }
.nav__spacer { flex: 1; }
.nav__links { display: flex; align-items: center; gap: var(--sp-xl); }
.nav__links a { color: var(--pith); font-size: var(--t-small); font-weight: 500;
  transition: color 0.2s var(--ease-snap); }
.nav__links a:hover { color: var(--ink); }
.nav__tools { display: flex; align-items: center; gap: var(--sp-sm); }

/* segmented control — language + theme, echoing WMStatusPill */
.seg {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--mist); border: 0.75px solid var(--whisper);
  border-radius: var(--r-pill); padding: 3px;
}
.seg button, .seg a {
  border: 0; background: transparent; color: var(--pith); text-decoration: none;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 5px 9px; border-radius: var(--r-pill); line-height: 1; display: inline-flex; align-items: center;
  transition: color 0.2s var(--ease-snap), background-color 0.2s var(--ease-snap);
}
.seg button[aria-pressed="true"], .seg a[aria-current="true"] { background: var(--paper); color: var(--ink);
  box-shadow: var(--elev-rest); }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 0.75px solid var(--whisper); border-radius: var(--r-pill);
  background: var(--mist); color: var(--ink);
  transition: transform 0.2s var(--ease-spring), background-color 0.2s var(--ease-snap);
}
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .sun { display: none; }
[data-theme="dark"] .icon-btn .sun { display: block; }
[data-theme="dark"] .icon-btn .moon { display: none; }

/* more specific than .btn so its display:inline-flex doesn't leak in below 720px */
.nav__tools .nav__cta { display: none; }
@media (min-width: 720px) { .nav__tools .nav__cta { display: inline-flex; } }

/* mobile: hide inline links, keep tools */
@media (max-width: 880px) { .nav__links { display: none; } }

/* ============================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: var(--t-small); line-height: 1;
  padding: 14px 22px; border-radius: var(--r-pill); border: 0.75px solid transparent;
  transition: transform 0.24s var(--ease-spring), box-shadow 0.3s var(--ease-standard),
              background-color 0.2s var(--ease-snap);
  will-change: transform;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--flesh); color: #fff; box-shadow: 0 8px 22px var(--flesh-35); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px var(--flesh-35); }
.btn--ghost { background: var(--mist); color: var(--ink); border-color: var(--whisper); }
.btn--ghost:hover { transform: translateY(-2px); box-shadow: var(--elev-card); }
.btn--sm { padding: 9px 16px; font-size: 0.8125rem; }

/* App Store badge — Apple-style pill, drawn in CSS so it themes + scales crisply */
.appstore {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 20px 11px 18px; border-radius: 14px;
  background: var(--ink); color: var(--paper);
  box-shadow: var(--elev-card);
  transition: transform 0.24s var(--ease-spring), box-shadow 0.3s var(--ease-standard);
}
.appstore:hover { transform: translateY(-2px); box-shadow: var(--elev-lifted); }
.appstore svg { width: 26px; height: 26px; flex: none; }
.appstore__text { display: grid; line-height: 1.1; text-align: left; }
.appstore__text small { font-size: 0.625rem; letter-spacing: 0.02em; opacity: 0.85; }
.appstore__text strong { font-size: 1.18rem; font-weight: 600; letter-spacing: -0.01em; }

/* ============================================================================
   Pills / badges / chips
   ========================================================================== */
.eyebrow {
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--flesh-08); border: 0.75px solid var(--flesh-15);
  font-family: var(--font-mono); font-size: var(--t-label); font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--flesh);
}

.privacy-badge {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 9px 16px; border-radius: var(--r-pill);
  background: var(--mist); border: 0.75px solid var(--whisper);
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--pith); letter-spacing: 0.02em;
}
.privacy-badge .sep { color: var(--rind); }

/* ============================================================================
   Section heading block
   ========================================================================== */
.section-head { max-width: 720px; margin-bottom: var(--sp-xxl); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: var(--t-display); margin-block: 14px 16px; }
.section-head p { color: var(--pith); font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.2rem); margin: 0; }

/* ============================================================================
   Footer
   ========================================================================== */
.footer { border-top: 0.75px solid var(--whisper); padding-block: var(--sp-xxl) var(--sp-xl);
  margin-top: var(--sp-section); }
.footer__grid { display: flex; flex-wrap: wrap; gap: var(--sp-xl) var(--sp-section);
  justify-content: space-between; align-items: flex-start; }
.footer .brand { font-size: 1.25rem; }
.footer__tag { color: var(--pith); margin-top: 10px; max-width: 320px; font-size: var(--t-small); }
.footer__cols { display: flex; flex-wrap: wrap; gap: var(--sp-section); }
.footer__col h4 { font-family: var(--font-mono); font-size: var(--t-label); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--pith); margin: 0 0 14px; font-weight: 600; }
.footer__col a { display: block; color: var(--ink); font-size: var(--t-small); margin-bottom: 10px;
  transition: color 0.2s var(--ease-snap); }
.footer__col a:hover { color: var(--flesh); }
.footer__base { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  align-items: center; margin-top: var(--sp-xxl); padding-top: var(--sp-lg);
  border-top: 0.75px solid var(--whisper); color: var(--pith); font-size: 0.8rem; }

/* ============================================================================
   Scroll-reveal — translate/opacity, GPU-friendly, reduced-motion safe
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(26px); }
/* directional variants — defined after .reveal so they win the single-class cascade;
   .reveal.in (two classes) still overrides them back to none. */
.reveal-up    { transform: translateY(26px); }
.reveal-left  { transform: translateX(-34px); }
.reveal-right { transform: translateX(34px); }
.reveal-scale { transform: scale(0.93); }
.reveal.in { opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal[data-delay="1"].in { transition-delay: 0.08s; }
.reveal[data-delay="2"].in { transition-delay: 0.16s; }
.reveal[data-delay="3"].in { transition-delay: 0.24s; }
.reveal[data-delay="4"].in { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* utility */
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.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; }

/* ============================================================================
   Scroll progress rail — the rind→flesh line under the nav fills as you read.
   Driven by --scroll (0..1) set in animations.js via rAF; pure transform.
   ========================================================================== */
.scroll-rail { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; }
.scroll-rail__fill {
  display: block; height: 100%; transform: scaleX(var(--scroll, 0)); transform-origin: left;
  background: linear-gradient(90deg, var(--rind), var(--gold), var(--flesh));
}

/* ============================================================================
   Sub-hero ribbon — the three promises relocated out of the hero, as a band.
   A distinct layout family (no cards, hairline-bounded).
   ========================================================================== */
.ribbon-wrap { margin-top: calc(var(--sp-section) * -0.35); }
.ribbon {
  display: grid; grid-template-columns: repeat(3, 1fr) auto; align-items: start;
  gap: var(--sp-md) var(--sp-xl); padding-block: var(--sp-xl);
  border-top: 0.75px solid var(--whisper); border-bottom: 0.75px solid var(--whisper);
}
.ribbon__item { display: flex; gap: 10px; align-items: baseline; margin: 0;
  font-size: var(--t-small); color: var(--ink); }
.ribbon__no { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  color: var(--flesh); letter-spacing: 0.04em; }
.ribbon__privacy { margin: 0; font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.02em; color: var(--pith); text-align: right; white-space: nowrap; }
@media (max-width: 900px) {
  .ribbon { grid-template-columns: 1fr; gap: var(--sp-md); }
  .ribbon__privacy { text-align: left; padding-top: 4px; border-top: 0.75px solid var(--whisper); }
}

/* wider, asymmetric split for the flagship capture feature */
@media (min-width: 900px) {
  .feature--wide { grid-template-columns: 1.08fr 0.92fr; gap: clamp(2.5rem, 1rem + 5vw, 5.5rem); }
}

/* ============================================================================
   Centered feature (AI polish) — single column, breaks the split rhythm
   ========================================================================== */
.centered-feature { display: grid; justify-items: center; text-align: center; gap: var(--sp-xxl); }
.centered-feature__copy { max-width: 640px; }
.centered-feature__copy h2 { font-size: var(--t-display); margin-bottom: 14px; }
.centered-feature__copy p { color: var(--pith); margin: 0;
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.2rem); }

/* ============================================================================
   Privacy — indexed columns with a hairline cap, not a card grid
   ========================================================================== */
.priv-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-xl); }
.priv-item { display: flex; flex-direction: column; gap: 6px;
  padding-top: var(--sp-lg); border-top: 1.5px solid var(--whisper); }
.priv-item .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--flesh-08); color: var(--flesh); margin-bottom: 6px; }
.priv-item .ic svg { width: 21px; height: 21px; }
.priv-item h4 { font-family: var(--font-display); font-size: 1.08rem; margin: 0; }
.priv-item p { color: var(--pith); font-size: 0.86rem; margin: 0; }
@media (max-width: 820px) { .priv-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .priv-row { grid-template-columns: 1fr; } }

/* ============================================================================
   Pocket — the brand phone moment (graceful without real screenshots)
   ========================================================================== */
.pocket { display: grid; grid-template-columns: 1fr; gap: var(--sp-xxl); align-items: center; }
@media (min-width: 900px) { .pocket { grid-template-columns: 0.92fr 1.08fr; gap: var(--sp-section); } }
.pocket__copy h2 { font-size: var(--t-display); margin-bottom: 14px; }
.pocket__copy p { color: var(--pith); margin: 0 0 var(--sp-xl); max-width: 42ch; }

.cta__note { margin-top: var(--sp-lg); font-family: var(--font-mono); font-size: 0.78rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--pith); }
