/* ==========================================================================
   The Fresh Agent — Homepage Styles (website_v2, Phase 3 second pass)
   Depends on tokens.css. Light editorial surface + dark ticker band.
   Do NOT migrate to website/ until Phase 4 cutover.
   ========================================================================== */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--navy); text-decoration: none; transition: color var(--dur-base) var(--ease); }
a:hover { color: var(--navy-hover); }
button { font-family: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-2); }

/* ---------- Typography base ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--f-display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: var(--tr-display);
  line-height: var(--lh-tight);
  margin: 0;
}
h1 { font-size: var(--t-h1); font-weight: 600; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); }
h5 { font-size: var(--t-h5); }
p  { margin: 0 0 var(--sp-4) 0; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  display: inline-block;
  font-family: var(--f-body);
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-4);
}
.lede {
  font-size: var(--t-lead);
  line-height: var(--lh-normal);
  color: var(--ink-2);
  max-width: 60ch;
}
.meta {
  font-family: var(--f-mono);
  font-size: var(--t-small);
  color: var(--faint);
  letter-spacing: 0;
}
.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
.container--narrow { max-width: var(--w-narrow); }
.container--wide   { max-width: var(--w-wide); }

.section {
  padding: var(--sp-10) 0;
  border-top: 1px solid var(--rule);
}
.section--tight   { padding: var(--sp-8) 0; }
.section--alt     { background: var(--paper-2); }
.section--tertiary { background: var(--paper-3); }
.section:first-of-type { border-top: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 14px 26px;
  font-family: var(--f-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--r-3);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease),
              color var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease),
              transform var(--dur-fast) var(--ease);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn--primary:hover { background: var(--navy-hover); color: var(--white); border-color: var(--navy-hover); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-2);
}
.btn--ghost:hover { background: var(--paper-2); color: var(--ink); }
.btn--sm { padding: 10px 18px; font-size: 14px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: var(--sp-5);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.nav__brand img { height: 28px; width: auto; }
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav__links a {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}
.nav__links a:hover { color: var(--ink); }
.nav__cta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.nav__cta .sign-in {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}

/* ==========================================================================
   Ticker (the one dark band) — animated but honest.
   --------------------------------------------------------------------------
   Layout: a horizontally-pinned label on the left, then a masked viewport
   containing an inline-flex track. The nine real items are duplicated
   inside the track; the entire track slides from translateX(0) to
   translateX(-50%) on an infinite linear loop. Because the first and
   second halves of the track are structurally identical, -50% lands exactly
   where 0% started, so the loop is visually seamless with no jump.

   The track uses margin-right on each item (NOT gap) as the inter-item
   spacer. Using gap would produce an odd number of internal gaps across 18
   items and throw the -50% landing point off by half a gap — the classic
   "marquee snap" artifact. Margin-right makes every item's slot identical,
   so 9 items × slot == 50% of the track, exactly.

   Feel: slow (~72 s per loop), restrained (no borders, no pulsing, no
   reverse direction), mask-faded at both viewport edges so items feather
   in and out of the band instead of clipping hard. Pauses on hover and
   on keyboard focus-within. Reduced-motion path drops the animation, drops
   the duplicate clones, and lets the user scroll the viewport manually.
   ========================================================================== */
.ticker {
  background: var(--dark-bg);
  color: var(--dark-ink);
  border-bottom: 1px solid var(--dark-rule);
  overflow: hidden;
  position: relative;
}
.ticker__inner {
  display: flex;
  align-items: stretch;
  max-width: var(--w-wide);
  margin: 0 auto;
  font-family: var(--f-mono);
  font-size: var(--t-small);
}

/* Pinned label — stays fixed while the track scrolls behind the mask. */
.ticker__label {
  display: flex;
  align-items: center;
  color: var(--dark-muted);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: var(--tr-eyebrow);
  padding: 14px var(--sp-5);
  border-right: 1px solid var(--dark-rule);
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--dark-bg);
  position: relative;
  z-index: 2;
}
.ticker__label-full  { display: inline; }
.ticker__label-short { display: none; }

/* Viewport — clips the track and applies an edge fade so items
   feather in/out of the band rather than clipping hard. */
.ticker__viewport {
  position: relative;
  flex: 1;
  min-width: 0;          /* lets flex child respect overflow:hidden */
  overflow: hidden;
  padding: 14px 0;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 72px,
    #000 calc(100% - 72px),
    transparent 100%
  );
          mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 72px,
    #000 calc(100% - 72px),
    transparent 100%
  );
}

/* Track — the element that actually translates. width:max-content so it
   sizes to its 18 items and the -50% translate is computed against the
   full doubled width. */
.ticker__track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  width: max-content;
  animation: ticker-scroll 72s linear infinite;
  will-change: transform;
}
.ticker:hover .ticker__track,
.ticker:focus-within .ticker__track {
  animation-play-state: paused;
}

/* Items use margin-right instead of gap so every slot has identical width
   and the seamless wrap lands on a clean boundary. */
.ticker__item {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-2);
  color: var(--dark-ink);
  flex-shrink: 0;
  margin-right: var(--sp-6);
}
.ticker__commodity { color: var(--dark-muted); text-transform: uppercase; font-size: var(--t-micro); letter-spacing: 0.06em; }
.ticker__price { font-weight: 600; font-variant-numeric: tabular-nums; }
.ticker__delta { font-size: var(--t-micro); padding: 2px 6px; border-radius: var(--r-1); font-variant-numeric: tabular-nums; }
.ticker__delta--up   { color: #6FE29B; background: rgba(111,226,155,0.08); }
.ticker__delta--down { color: #FF8F7A; background: rgba(255,143,122,0.08); }
.ticker__delta--flat { color: #E3C05B; background: rgba(227,192,91,0.08); }

@keyframes ticker-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* One-line monospace caveat directly under the ticker band —
   sits on the light paper surface, not inside the dark band. */
.ticker__caveat {
  margin: 0;
  padding: 10px var(--sp-5);
  max-width: var(--w-wide);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  font-family: var(--f-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.02em;
  color: var(--faint);
  border-bottom: 1px solid var(--rule);
}

/* Reduced motion — disable the animation, drop the clones so AT and
   non-animated users see each item exactly once, and let the viewport
   scroll horizontally via touch/trackpad instead. */
@media (prefers-reduced-motion: reduce) {
  .ticker__track {
    animation: none;
    transform: none;
    width: auto;
  }
  .ticker__track > [aria-hidden="true"] {
    display: none;
  }
  .ticker__viewport {
    overflow-x: auto;
    -webkit-mask-image: none;
            mask-image: none;
    scrollbar-width: none;
  }
  .ticker__viewport::-webkit-scrollbar { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--sp-10) 0 var(--sp-9);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: var(--sp-9);
  align-items: center;
}
.hero__headline {
  font-size: clamp(40px, 5.2vw, var(--t-h1));
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-5);
  color: var(--ink);
}
.hero__headline em {
  font-style: italic;
  color: var(--forest);
}
.hero__sub {
  font-size: var(--t-lead);
  line-height: var(--lh-normal);
  color: var(--ink-2);
  max-width: 52ch;
  margin-bottom: var(--sp-7);
}
.hero__cta { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-6); }
.hero__attest {
  font-family: var(--f-mono);
  font-size: var(--t-small);
  color: var(--faint);
}
/* Hero visual — option A "Floating editorial":
   - Two-layer drop shadow (tight + wide, no blur halo)
   - 1px inner border
   - 12px radius
   - Faint paper → off-white gradient plate behind the image (the parent card
     acts as the gradient plate; the image sits inside with its own radius and
     1px rule border). */
.hero__visual {
  position: relative;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--paper) 0%, #F3F3ED 100%);
  box-shadow:
    0 2px 4px rgba(15, 20, 25, 0.05),
    0 24px 60px -14px rgba(15, 20, 25, 0.14);
}
.hero__visual img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.hero__visual::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(15, 20, 25, 0.05);
  border-radius: 8px;
}
/* Plate-mask over the "W7 · 2026" tooltip date in the dark hero image.
   Positioned over the header of the tooltip at roughly (47%, 59%) of the
   image. Background matches the dashboard chart surface. Positioning is
   approximate — fine-tune during visual review. */
.hero__date-mask {
  position: absolute;
  left: 46.5%;
  top: 58.5%;
  width: 9.5%;
  height: 2.8%;
  background: #111820;
  border-radius: 2px;
  pointer-events: none;
}

/* ---------- Trust strip ---------- */
.trust {
  padding: var(--sp-7) 0;
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.trust__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-6);
  align-items: start;
}
.trust__item {
  border-left: 2px solid var(--rule-2);
  padding-left: var(--sp-4);
}
.trust__num {
  font-family: var(--f-display);
  font-size: var(--t-h4);
  color: var(--ink);
  line-height: 1;
  margin-bottom: var(--sp-2);
  font-variant-numeric: tabular-nums;
}
.trust__label {
  font-size: var(--t-small);
  color: var(--muted);
  line-height: 1.4;
}

/* ---------- Showcase (3 cards with real screenshots) ---------- */
.showcase__header {
  max-width: var(--w-narrow);
  margin-bottom: var(--sp-8);
}
/* Showcase — one designed system, not three equals. Center card is the hero
   anchor; flankers sit lower on the baseline with softer elevation so the
   eye reads center → edges, not left → right. */
.showcase__grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: var(--sp-5);
  align-items: center;
}
/* Base card — floating editorial: two-layer shadow, 1px inner border,
   12px radius, subtle hover lift. */
.showcase__card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
/* Flankers — visually recede: lower baseline offset, softer shadow. */
.showcase__card:not(.showcase__card--featured) {
  transform: translateY(16px);
  box-shadow:
    0 1px 2px rgba(15, 20, 25, 0.03),
    0 16px 40px -14px rgba(15, 20, 25, 0.08);
}
.showcase__card:not(.showcase__card--featured):hover {
  transform: translateY(14px);
  box-shadow:
    0 2px 4px rgba(15, 20, 25, 0.04),
    0 24px 48px -14px rgba(15, 20, 25, 0.12);
}
/* Featured (center) card — the clear hero: larger drop shadow, sits on the
   shared baseline (no translate), elevated above flankers via z-index. */
.showcase__card--featured {
  box-shadow:
    0 2px 4px rgba(15, 20, 25, 0.06),
    0 40px 88px -20px rgba(15, 20, 25, 0.20);
  z-index: 1;
}
.showcase__card--featured:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 8px rgba(15, 20, 25, 0.07),
    0 48px 100px -20px rgba(15, 20, 25, 0.24);
}
@media (prefers-reduced-motion: reduce) {
  .showcase__card:not(.showcase__card--featured),
  .showcase__card:not(.showcase__card--featured):hover { transform: none; }
  .showcase__card--featured:hover { transform: none; }
}
/* NOTE: .showcase__img is preserved in CSS but no longer used in markup.
   Phase A removed all three showcase images in favor of editorial
   principle cards. Phase B will slot real screenshots back in above
   the principle text, at which point this rule becomes live again. */
.showcase__img {
  aspect-ratio: 16 / 9;
  background: var(--paper-3);
  overflow: hidden;
}
.showcase__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Image-less principle card body — no top border since there is no
   image above the body. Extra top padding makes the principle statement
   read as the card's opening line. */
.showcase__body {
  padding: var(--sp-7) var(--sp-5) var(--sp-6);
}
/* The principle statement: large Source Serif 4, italic, ink-heavy.
   Reads as the editorial thesis for the card before the descriptive
   paragraph below. */
.showcase__principle {
  font-family: var(--f-display);
  font-weight: 600;
  font-style: italic;
  font-size: var(--t-h4);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 var(--sp-4);
}
/* Thin monospace rule beneath the principle, separating the thesis
   from the supporting paragraph. */
.showcase__rule {
  border: 0;
  border-top: 1px solid var(--rule-2);
  width: 48px;
  margin: 0 0 var(--sp-4);
}
.showcase__card--featured .showcase__principle {
  font-size: calc(var(--t-h4) + 4px);
}
.showcase__card--featured .showcase__rule {
  width: 64px;
  border-top-color: var(--navy);
}
.showcase__title {
  font-size: var(--t-h5);
  margin-bottom: var(--sp-3);
}
.showcase__copy {
  font-size: 15px;
  color: var(--muted);
  line-height: var(--lh-normal);
}

/* ---------- Feature deep-dives (alternating) ---------- */
.feature {
  padding: var(--sp-10) 0;
  border-top: 1px solid var(--rule);
}
.feature__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-9);
  align-items: center;
}
.feature__grid--reverse > :first-child { order: 2; }
/* Editorial modifier: single narrow column, no visual. Used by Feature 3
   (History) in Phase A to match the methodology section's treatment. */
.feature__grid--editorial {
  grid-template-columns: 1fr;
  max-width: var(--w-narrow);
  margin: 0 auto;
}
.feature__grid--editorial .feature__copy p,
.feature__grid--editorial .feature__copy h3 {
  max-width: none;
}
.feature__copy h3 {
  font-size: var(--t-h3);
  margin-bottom: var(--sp-5);
}
.feature__copy p {
  font-size: var(--t-body);
  color: var(--ink-2);
  line-height: var(--lh-body);
  max-width: 52ch;
}
.feature__bullets {
  list-style: none;
  padding: 0;
  margin: var(--sp-5) 0 0;
}
.feature__bullets li {
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  color: var(--ink-2);
  display: flex;
  gap: var(--sp-3);
}
.feature__bullets li:last-child { border-bottom: 1px solid var(--rule); }
.feature__bullets strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-family: var(--f-body);
  margin-bottom: 2px;
}
/* Feature visuals — same floating editorial treatment as the hero, plus a 2°
   counter-rotation that alternates between features via the reverse-grid
   modifier (features 1 + 3 tilt -1°, feature 2 tilts +1°). */
.feature__visual {
  position: relative;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--paper) 0%, #F3F3ED 100%);
  box-shadow:
    0 2px 4px rgba(15, 20, 25, 0.05),
    0 24px 60px -14px rgba(15, 20, 25, 0.14);
  transform: rotate(-1deg);
}
.feature__grid--reverse .feature__visual {
  transform: rotate(1deg);
}
.feature__visual img {
  display: block;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.feature__visual::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(15, 20, 25, 0.05);
  border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .feature__visual,
  .feature__grid--reverse .feature__visual { transform: none; }
}
.feature__placeholder {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-family: var(--f-mono);
  font-size: var(--t-small);
  padding: var(--sp-6);
  text-align: center;
}

/* ---------- Methodology (narrow editorial column) ---------- */
.methodology {
  padding: var(--sp-10) 0;
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
}
.methodology__body {
  max-width: var(--w-narrow);
  margin: 0 auto;
}
.methodology h2 {
  font-size: var(--t-h3);
  margin-bottom: var(--sp-6);
}
.methodology p {
  font-size: var(--t-lead);
  line-height: var(--lh-loose);
  color: var(--ink-2);
  margin-bottom: var(--sp-5);
}
.methodology p:first-of-type::first-line {
  font-variant-caps: small-caps;
  letter-spacing: 0.02em;
}

/* ---------- Pricing preview ---------- */
.pricing {
  padding: var(--sp-10) 0;
  border-top: 1px solid var(--rule);
}
.pricing__header {
  text-align: center;
  margin-bottom: var(--sp-8);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.pricing__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}
.plan {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-4);
  padding: var(--sp-7) var(--sp-6) var(--sp-6);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-2);
}
.plan--featured {
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy), var(--shadow-3);
}
.plan__name {
  font-family: var(--f-body);
  font-size: var(--t-small);
  text-transform: uppercase;
  letter-spacing: var(--tr-eyebrow);
  color: var(--muted);
  margin-bottom: var(--sp-3);
}
.plan--featured .plan__name { color: var(--navy); }
.plan__price {
  font-family: var(--f-display);
  font-size: var(--t-h2);
  color: var(--ink);
  line-height: 1;
  margin-bottom: var(--sp-2);
  font-variant-numeric: tabular-nums;
}
.plan__price small {
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}
.plan__annual {
  font-family: var(--f-mono);
  font-size: var(--t-small);
  color: var(--faint);
  margin-bottom: var(--sp-5);
}
.plan__tag {
  font-size: var(--t-small);
  color: var(--ink-2);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--rule);
}
.plan__features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-6);
  font-size: 14px;
  color: var(--ink-2);
}
.plan__features li {
  padding: 8px 0;
  display: flex;
  gap: 10px;
}
.plan__features li::before {
  content: "—";
  color: var(--faint);
  flex-shrink: 0;
}
.plan .btn { width: 100%; margin-top: auto; }
.pricing__footnote {
  margin-top: var(--sp-6);
  text-align: center;
  font-family: var(--f-mono);
  font-size: var(--t-small);
  color: var(--faint);
}

/* ---------- Mobile section ----------
   Copy sits centered above; four phones compose a single floating row below.
   The composition is art-directed: subtle alternating vertical stagger, one
   soft-elevation shadow, paper-plate background per phone. Real iOS captures
   drop in via background-image slots on .phone__screen--{home|avocado|cucumber|potato}. */
.mobile {
  padding: var(--sp-10) 0;
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
}
.mobile__copy {
  max-width: 56ch;
  margin: 0 auto var(--sp-9);
  text-align: center;
}
.mobile__copy .eyebrow { margin-bottom: var(--sp-4); }
.mobile__copy h2 { margin-bottom: var(--sp-5); font-size: var(--t-h3); }
.mobile__copy p  {
  font-size: var(--t-body);
  color: var(--ink-2);
  margin-left: auto;
  margin-right: auto;
}
.mobile__badges {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  flex-wrap: wrap;
  justify-content: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px 20px;
  border: 1px solid var(--rule-2);
  border-radius: var(--r-3);
  background: var(--white);
  font-size: 13px;
  color: var(--ink);
  transition: background var(--dur-base) var(--ease);
}
.badge:hover { background: var(--paper-3); }
.badge--soon { opacity: 0.65; cursor: default; }
.badge__label { display: flex; flex-direction: column; line-height: 1.2; }
.badge__label small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.badge__label strong { font-weight: 600; font-family: var(--f-display); }

/* Four-phone composition ---------- */
.mobile__visual {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-5);
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-4) var(--sp-8);
}
.phone {
  position: relative;
  margin: 0;
  padding: 8px;
  aspect-ratio: 9 / 19;
  border: 1px solid var(--rule);
  border-radius: 28px;
  background: linear-gradient(135deg, var(--paper) 0%, #F3F3ED 100%);
  box-shadow:
    0 2px 4px rgba(15, 20, 25, 0.05),
    0 28px 64px -18px rgba(15, 20, 25, 0.16);
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.phone::after {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(15, 20, 25, 0.05);
  border-radius: 22px;
}
.phone:hover {
  box-shadow:
    0 4px 8px rgba(15, 20, 25, 0.06),
    0 36px 80px -18px rgba(15, 20, 25, 0.22);
}
/* Staggered vertical offset — outer phones sit lower, inner phones sit higher,
   so the four-phone row reads as a deliberate composition rather than a row. */
.phone--1 { transform: translateY(10px); }
.phone--2 { transform: translateY(-10px); }
.phone--3 { transform: translateY(-10px); }
.phone--4 { transform: translateY(10px); }
.phone--1:hover { transform: translateY(6px); }
.phone--2:hover { transform: translateY(-14px); }
.phone--3:hover { transform: translateY(-14px); }
.phone--4:hover { transform: translateY(6px); }

.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  background-color: var(--white);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.phone__screen--home     { background-image: url("../img/mobile-home.jpg"); }
.phone__screen--avocado  { background-image: url("../img/mobile-avocado.jpg"); }
.phone__screen--cucumber { background-image: url("../img/mobile-cucumber.jpg"); }
.phone__screen--potato   { background-image: url("../img/mobile-potato.jpg"); }
.phone__label {
  font-family: var(--f-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
@media (prefers-reduced-motion: reduce) {
  .phone--1, .phone--2, .phone--3, .phone--4,
  .phone--1:hover, .phone--2:hover, .phone--3:hover, .phone--4:hover { transform: none; }
}

/* ---------- Final CTA ---------- */
.cta-final {
  padding: var(--sp-10) 0 var(--sp-11);
  text-align: center;
  border-top: 1px solid var(--rule);
}
.cta-final h2 {
  font-size: var(--t-h2);
  max-width: 20ch;
  margin: 0 auto var(--sp-5);
}
.cta-final p {
  font-size: var(--t-lead);
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto var(--sp-7);
}
.cta-final__btns { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer {
  background: var(--paper-3);
  border-top: 1px solid var(--rule);
  padding: var(--sp-9) 0 var(--sp-7);
  color: var(--muted);
  font-size: 14px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--sp-6);
  margin-bottom: var(--sp-8);
}
.footer h5 {
  font-family: var(--f-body);
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-4);
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { padding: 6px 0; }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--ink); }
.footer__brand { max-width: 36ch; line-height: 1.6; }
.footer__brand img { height: 28px; margin-bottom: var(--sp-4); }
.footer__legal {
  padding-top: var(--sp-5);
  border-top: 1px solid var(--rule-2);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  font-family: var(--f-mono);
  font-size: var(--t-small);
  color: var(--faint);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--sp-7); }
  .showcase__grid { grid-template-columns: 1fr 1fr; }
  .showcase__card--featured { grid-column: 1 / -1; order: -1; }
  /* When flankers stack below the featured card, drop the baseline offset
     so they sit naturally on their own row. */
  .showcase__card:not(.showcase__card--featured),
  .showcase__card:not(.showcase__card--featured):hover { transform: none; }
  .feature__grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .feature__grid--reverse > :first-child { order: 0; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .trust__grid { grid-template-columns: 1fr 1fr; }
  /* Mobile composition — 4 across is too tight at this width, go 2×2. */
  .mobile__visual { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; gap: var(--sp-6); }
  .phone--1, .phone--1:hover,
  .phone--2, .phone--2:hover,
  .phone--3, .phone--3:hover,
  .phone--4, .phone--4:hover { transform: none; }
}

@media (max-width: 780px) {
  :root {
    --t-h1: 44px;
    --t-h2: 34px;
    --t-h3: 28px;
    --t-h4: 22px;
    --t-lead: 17px;
    --t-body: 16px;
  }
  .section { padding: var(--sp-8) 0; }
  .hero { padding: var(--sp-8) 0; }
  .nav__links { display: none; }
  .showcase__grid { grid-template-columns: 1fr; }
  .showcase__card--featured { grid-column: auto; order: -1; }
  .pricing__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .trust__grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .feature { padding: var(--sp-8) 0; }
  .methodology { padding: var(--sp-8) 0; }
  .cta-final { padding: var(--sp-8) 0 var(--sp-9); }
  .mobile { padding: var(--sp-8) 0; }
  .mobile__copy { margin-bottom: var(--sp-7); }
  /* Ticker — swap long label for short label at tablet width so the
     pinned label doesn't starve the scrolling viewport. */
  .ticker__label-full  { display: none; }
  .ticker__label-short { display: inline; }
  .ticker__label       { padding: 12px var(--sp-4); }
  .ticker__track       { animation-duration: 56s; }
}

@media (max-width: 520px) {
  .nav__cta .sign-in { display: none; }
  .btn { padding: 12px 20px; font-size: 14px; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { width: 100%; }
  /* 2×2 stays, but tighter and narrower for phone widths. */
  .mobile__visual { gap: var(--sp-4); max-width: 420px; padding: var(--sp-4) 0 var(--sp-6); }
}

/* ==========================================================================
   Legal pages (privacy, terms)
   Reading-first shell. Same design system as the homepage, dialled down:
   no hero, no ticker, no screenshots, no decorative imagery. Narrow column,
   generous vertical rhythm, strong H2/H3 hierarchy, subtle hairlines. All
   selectors are scoped under .legal or .legal-page so the homepage is
   completely unaffected.
   ========================================================================== */

.legal {
  background: var(--paper);
  padding: var(--sp-9) 0 var(--sp-10);
  border-top: 1px solid var(--rule);
}

.legal__inner {
  /* Slight narrowing vs default container--narrow for a more book-like
     reading measure on wide screens. */
  max-width: 760px;
}

/* ---------- Title block (plain, centered, no hero treatment) ---------- */
.legal__title-block {
  text-align: center;
  padding: var(--sp-4) 0 var(--sp-7);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--sp-7);
}
.legal__kicker {
  font-family: var(--f-mono);
  font-size: var(--t-small);
  text-transform: uppercase;
  letter-spacing: var(--tr-caps);
  color: var(--muted);
  margin: 0 0 var(--sp-3) 0;
}
.legal__title-block h1 {
  font-size: 56px;
  line-height: 1.08;
  color: var(--ink);
  margin: 0 0 var(--sp-4) 0;
}
.legal__meta {
  font-family: var(--f-mono);
  font-size: var(--t-small);
  text-transform: uppercase;
  letter-spacing: var(--tr-caps);
  color: var(--faint);
  margin: 0;
}

/* ---------- Table of contents (text-first, no sidebar) ---------- */
.legal__toc {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  padding: var(--sp-5) var(--sp-6);
  margin: 0 0 var(--sp-7) 0;
}
.legal__toc-title {
  font-family: var(--f-body);
  font-size: var(--t-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tr-eyebrow);
  color: var(--muted);
  margin: 0 0 var(--sp-3) 0;
  padding: 0;
  border: 0;
  /* override .legal__body h2 rules that might otherwise apply */
  font-family: var(--f-body);
}
.legal__toc ol {
  list-style: decimal;
  margin: 0;
  padding-left: var(--sp-5);
  columns: 2;
  column-gap: var(--sp-6);
}
.legal__toc li {
  margin: 0 0 var(--sp-1) 0;
  font-size: var(--t-small);
  line-height: var(--lh-normal);
  break-inside: avoid;
  color: var(--ink-2);
}
.legal__toc a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease);
}
.legal__toc a:hover {
  color: var(--navy);
  border-bottom-color: var(--rule-2);
}

/* ---------- Body (narrow reading column) ---------- */
.legal__body {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-2);
}
.legal__body h2 {
  font-family: var(--f-display);
  font-size: 26px;
  line-height: 1.2;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: var(--tr-display);
  margin: var(--sp-8) 0 var(--sp-4) 0;
  padding-top: var(--sp-5);
  border-top: 1px solid var(--rule);
}
.legal__body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.legal__body h3 {
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0;
  margin: var(--sp-6) 0 var(--sp-3) 0;
}
.legal__body p {
  margin: 0 0 var(--sp-4) 0;
}
.legal__body p:last-child {
  margin-bottom: 0;
}
.legal__body a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--dur-base) var(--ease),
              color var(--dur-base) var(--ease);
}
.legal__body a:hover {
  color: var(--navy-hover);
  text-decoration-color: var(--navy-hover);
}
.legal__body strong {
  color: var(--ink);
  font-weight: 600;
}
.legal__body em {
  color: var(--ink-2);
  font-style: italic;
}

/* Lists */
.legal__body ul,
.legal__body ol {
  margin: 0 0 var(--sp-4) 0;
  padding-left: var(--sp-5);
}
.legal__body li {
  margin: 0 0 var(--sp-2) 0;
}
.legal__body li > ul,
.legal__body li > ol {
  margin-top: var(--sp-2);
  margin-bottom: var(--sp-2);
}

/* Blockquote — institutional feel, no cyan accent bar. Used for the data
   controller identity panel in privacy §2 and the contact blocks. */
.legal__body blockquote {
  margin: var(--sp-4) 0;
  padding: var(--sp-4) var(--sp-5);
  background: var(--paper-2);
  border-left: 3px solid var(--ink-2);
  border-radius: 0 var(--r-2) var(--r-2) 0;
}
.legal__body blockquote p {
  margin: 0 0 var(--sp-1) 0;
  font-size: 15px;
  color: var(--ink-2);
}
.legal__body blockquote p:last-child {
  margin-bottom: 0;
}

/* Caps-block — the ALL CAPS legal warnings. Subtle paper surface,
   mono-adjacent feel, calm border. No dramatic treatment. */
.legal__caps {
  margin: var(--sp-5) 0;
  padding: var(--sp-5) var(--sp-6);
  background: var(--paper-3);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-3);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}
.legal__caps p {
  margin: 0 0 var(--sp-3) 0;
}
.legal__caps p:last-child {
  margin-bottom: 0;
}
.legal__caps strong {
  color: var(--ink);
}

/* ---------- Legal page tablet ---------- */
@media (max-width: 780px) {
  .legal { padding: var(--sp-7) 0 var(--sp-8); }
  .legal__title-block { padding: 0 0 var(--sp-5); margin-bottom: var(--sp-5); }
  .legal__title-block h1 { font-size: 40px; }
  .legal__toc { padding: var(--sp-4) var(--sp-5); }
  .legal__toc ol { columns: 1; }
  .legal__body { font-size: 15px; line-height: 1.72; }
  .legal__body h2 { font-size: 22px; margin-top: var(--sp-7); }
  .legal__body h3 { font-size: 16px; }
}

@media (max-width: 520px) {
  .legal__title-block h1 { font-size: 32px; }
  .legal__body { font-size: 15px; }
  .legal__caps { padding: var(--sp-4); }
}

/* ============================================================
   Offline page
   Single-screen cached fallback. Minimal header (brand only),
   centered editorial card on paper background, single-column
   reading width. No illustration, no spinner, no network calls.
   ============================================================ */
.nav--minimal { position: static; background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
.nav__inner--minimal { justify-content: flex-start; }

.offline {
  background: var(--paper);
  padding: var(--sp-9) 0 var(--sp-10);
  min-height: calc(100vh - 68px - 140px); /* nav height - footer reserve */
  display: flex;
  align-items: center;
}
.offline__inner {
  max-width: 640px;
  padding: var(--sp-8) var(--sp-7);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  box-shadow: 0 1px 0 var(--rule) inset;
}
.offline__kicker {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--sp-4);
}
.offline__title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 48px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 var(--sp-5);
}
.offline__body {
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 var(--sp-7);
}
.offline__subhead {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 var(--sp-3);
}
.offline__list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-8);
  border-top: 1px solid var(--rule);
}
.offline__list li {
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}
.offline__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.offline__actions .btn { min-width: 160px; justify-content: center; }
.offline__home {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-2);
  padding-bottom: 2px;
  transition: color var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.offline__home:hover { color: var(--ink); border-bottom-color: var(--ink); }

.footer__legal--solo { border-top: 1px solid var(--rule); padding-top: var(--sp-5); }

/* ---------- Offline tablet ---------- */
@media (max-width: 780px) {
  .offline { padding: var(--sp-7) 0 var(--sp-8); }
  .offline__inner { padding: var(--sp-7) var(--sp-6); }
  .offline__title { font-size: 38px; }
  .offline__body { font-size: 16px; }
}

/* ---------- Offline phone ---------- */
@media (max-width: 520px) {
  .offline__inner { padding: var(--sp-6) var(--sp-5); }
  .offline__title { font-size: 30px; }
  .offline__body { font-size: 15px; }
  .offline__actions { gap: var(--sp-4); }
  .offline__actions .btn { width: 100%; min-width: 0; }
  .offline__home { width: 100%; text-align: center; border-bottom: none; }
}

/* ============================================================
   Pricing page (standalone)
   Extends the .plan / .pricing__grid component system used on the
   homepage pricing preview. Adds an editorial title block, billing
   cadence toggle, trust line, and native <details>/<summary> FAQ
   list. Pro card is featured via .plan--featured border/shadow
   only — no external badge. Zero existing selectors touched.
   ============================================================ */
.pricing-page {
  background: var(--paper);
  padding: var(--sp-9) 0 var(--sp-10);
}

/* Title block — same editorial rhythm as .legal__title-block but
   center-aligned and sized for a marketing page, not a document. */
.pricing-page__title-block {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--sp-8);
  padding-bottom: var(--sp-7);
  border-bottom: 1px solid var(--rule);
}
.pricing-page__kicker {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--sp-4);
}
.pricing-page__title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 52px;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 var(--sp-5);
}
.pricing-page__lede {
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 600px;
  margin: 0 auto;
}

/* Billing cadence toggle — segmented pair of buttons on a paper
   surface, with a mono savings note to the right. Pure client-side. */
.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  margin: 0 auto var(--sp-8);
  flex-wrap: wrap;
}
.billing-toggle__btn {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 10px 22px;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease),
              color var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease);
}
.billing-toggle__btn:first-of-type {
  border-radius: var(--r-3) 0 0 var(--r-3);
  border-right: none;
}
.billing-toggle__btn:nth-of-type(2) {
  border-radius: 0 var(--r-3) var(--r-3) 0;
}
.billing-toggle__btn:hover { color: var(--ink); }
.billing-toggle__btn.is-active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* Pricing grid container — borderless on the standalone page so it
   does not stack a second top border on top of the title block rule. */
.pricing-page__grid {
  margin-bottom: var(--sp-8);
}

/* Reserve a row for the price amount so swapping monthly/yearly
   does not shift the card heights. */
.plan__price { display: flex; align-items: baseline; gap: 4px; min-height: 1.05em; }
.plan__amount { display: inline-block; }
.plan__period { display: inline-block; }

/* Trust / provenance line */
.pricing-page__trust {
  max-width: 640px;
  margin: 0 auto var(--sp-10);
  text-align: center;
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--rule);
}

/* FAQ — native details/summary, editorial hairline rules */
.pricing-faq {
  max-width: 720px;
  margin: 0 auto;
  padding-top: var(--sp-8);
  border-top: 1px solid var(--rule);
}
.pricing-faq__heading {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-align: center;
  margin: 0 0 var(--sp-7);
}
.pricing-faq__item {
  border-bottom: 1px solid var(--rule);
  padding: var(--sp-4) 0;
}
.pricing-faq__item:first-of-type {
  border-top: 1px solid var(--rule);
}
.pricing-faq__q {
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-2) 0;
}
.pricing-faq__q::-webkit-details-marker { display: none; }
.pricing-faq__q::after {
  content: "+";
  font-family: var(--f-mono);
  font-size: 20px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1;
  flex-shrink: 0;
  transition: transform var(--dur-base) var(--ease);
}
.pricing-faq__item[open] .pricing-faq__q::after {
  content: "\2013"; /* en dash */
}
.pricing-faq__a {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
  padding: var(--sp-3) 0 var(--sp-2);
  max-width: 640px;
}

/* ---------- Pricing page tablet ---------- */
@media (max-width: 780px) {
  .pricing-page { padding: var(--sp-8) 0 var(--sp-9); }
  .pricing-page__title { font-size: 40px; }
  .pricing-page__lede { font-size: 16px; }
  .billing-toggle { margin-bottom: var(--sp-7); }
  .pricing-page__grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .pricing-faq__heading { font-size: 26px; }
}

/* ---------- Pricing page phone ---------- */
@media (max-width: 520px) {
  .pricing-page { padding: var(--sp-7) 0 var(--sp-8); }
  .pricing-page__title { font-size: 32px; }
  .pricing-page__lede { font-size: 15px; }
  .billing-toggle { gap: var(--sp-3); }
  .billing-toggle__btn { padding: 9px 18px; font-size: 13px; }
  .pricing-faq__heading { font-size: 22px; }
  .pricing-faq__q { font-size: 15px; }
}

/* ============================================================
   Auth pages (login — first surface; shared with signup /
   checkout shells when those land later).
   Paper-surface editorial auth card. Reuses the website_v2
   design system — tokens.css + shared .btn, .nav, .footer.
   Behavioral contracts for website_v2/login.html (host
   redirect script, POST /auth/login fetch, session-expired
   IIFE, /dashboard 800ms redirect, PWA wiring) are all
   preserved verbatim inside login.html itself. This CSS block
   only restyles the shell. New selectors only. Zero existing
   selectors touched.
   ============================================================ */

/* Nav variant — brand lockup on the left, single sign-up link
   on the right. Static (not sticky) to match the restrained
   tone of the auth card. */
.nav--auth {
  position: static;
  background: var(--paper);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.nav__inner--auth { justify-content: space-between; }
.nav__auth-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.nav__auth-links a {
  color: var(--ink-2);
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur-base) var(--ease);
}
.nav__auth-links a:hover { color: var(--ink); }

/* Auth main — centered editorial card on paper. */
.auth {
  background: var(--paper);
  padding: var(--sp-9) 0 var(--sp-10);
  min-height: calc(100vh - 68px - 140px);
  display: flex;
  align-items: center;
}
.auth__inner {
  display: flex;
  justify-content: center;
}
.auth__card {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  padding: var(--sp-8) var(--sp-7);
  box-shadow: var(--shadow-2);
}
.auth__title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 var(--sp-2);
  text-align: center;
}
.auth__sub {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 var(--sp-7);
  text-align: center;
}

/* Alert banner — scoped to .auth__card so the JS-managed
   className ("alert", "alert error show", "alert success show")
   survives without exposing a global .alert selector. */
.auth__card .alert {
  display: none;
  padding: var(--sp-3) var(--sp-4);
  margin: 0 0 var(--sp-5);
  border-radius: var(--r-2);
  font-family: var(--f-body);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  color: var(--ink-2);
}
.auth__card .alert.show { display: block; }
.auth__card .alert.error {
  background: var(--down-tint);
  border-color: rgba(179, 58, 46, 0.22);
  color: var(--down);
}
.auth__card .alert.success {
  background: var(--up-tint);
  border-color: rgba(47, 122, 76, 0.22);
  color: var(--up);
}

/* Form. */
.auth__form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.auth__field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.auth__label {
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.auth__input {
  width: 100%;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-2);
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  transition: border-color var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}
.auth__input::placeholder {
  color: var(--faint);
  font-family: var(--f-body);
}
.auth__input:focus {
  border-color: var(--navy);
  box-shadow: var(--focus-ring);
}

/* Remember-me + forgot password row. */
.auth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: calc(-1 * var(--sp-2));
}
.auth__check {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.auth__check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--navy);
  cursor: pointer;
}
.auth__forgot {
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease);
}
.auth__forgot:hover { border-bottom-color: var(--navy); }

/* Submit — reuses .btn .btn--primary, locked to full card width. */
.auth__submit {
  width: 100%;
  margin-top: var(--sp-2);
}
.auth__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Spinner — JS injects <span class="spinner"> inside the submit
   button while the fetch is pending. Scoped to .auth__submit so
   the name cannot leak into any future surface. */
.auth__submit .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* Footer link line under the card. */
.auth__footer {
  margin: var(--sp-7) 0 0;
  text-align: center;
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--muted);
}
.auth__footer a {
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-2);
  padding-bottom: 1px;
  transition: color var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease);
}
.auth__footer a:hover {
  color: var(--navy-hover);
  border-bottom-color: var(--navy);
}

/* ---------- Auth tablet ---------- */
@media (max-width: 780px) {
  .auth { padding: var(--sp-7) 0 var(--sp-8); }
  .auth__card { padding: var(--sp-7) var(--sp-6); }
  .auth__title { font-size: 30px; }
}

/* ---------- Auth phone ---------- */
@media (max-width: 520px) {
  .auth__card { padding: var(--sp-6) var(--sp-5); }
  .auth__title { font-size: 26px; }
  .auth__sub { font-size: 14px; margin-bottom: var(--sp-6); }
  .auth__row { flex-wrap: wrap; gap: var(--sp-3); }
}

/* ============================================================
   Auth — signup additions (Option B password UX).
   Additive only. Zero existing selectors touched. All selectors
   namespaced or descendant-scoped so nothing can leak into other
   website_v2 surfaces. Behavioral contracts (handleSignup fetch,
   element IDs, host-redirect, PWA wiring, /dashboard 1000ms
   redirect) live inside signup.html and are not affected by any
   selector below.
   ============================================================ */

/* Password field wrapper — positions the show/hide toggle
   absolutely inside the input's right edge. The input keeps its
   id="password" and .auth__input class so handleSignup's
   getElementById read is untouched. */
.auth__password {
  position: relative;
  display: block;
}
.auth__password .auth__input {
  padding-right: 64px;
}

/* Show / Hide toggle — text only, not an icon. Restrained navy
   link treatment, flush with the right edge of the input. */
.auth__toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 4px 6px;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--navy);
  cursor: pointer;
  border-radius: var(--r-1);
  transition: color var(--dur-base) var(--ease),
              background var(--dur-base) var(--ease);
}
.auth__toggle:hover {
  color: var(--navy-hover);
  background: var(--paper-2);
}
.auth__toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Inline rule under the password field — static, informational.
   Matches the backend policy exactly: Pydantic min_length=8 +
   redundant handler check. No character classes, no complexity. */
.auth__hint {
  font-family: var(--f-body);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}

/* Caps-lock warning — sibling of .auth__hint, not an alert
   band. Same typography and color weight as the hint; the only
   differences are (a) hidden by default, (b) a tiny leading
   glyph so the state change is readable without shouting. No
   background, no border, no padding. */
.auth__caps {
  display: none;
  font-family: var(--f-body);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.auth__caps::before {
  content: "\2191\0020"; /* UP ARROWS + space */
  color: var(--faint);
}
.auth__caps.is-on { display: block; }

/* Pre-submit reassurance line — small, muted, centered. Sits
   just above the submit button so a user reads the verification
   note at the moment of commitment, not at the top of the form. */
.auth__reassure {
  margin: var(--sp-2) 0 0;
  font-family: var(--f-body);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

/* Terms text under the form — small legal line, distinct from
   the alt-account footer line so the two don't fight for tone. */
.auth__terms {
  margin: var(--sp-5) 0 0;
  font-family: var(--f-body);
  font-size: 12px;
  line-height: 1.55;
  color: var(--faint);
  text-align: center;
}
.auth__terms a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
  text-underline-offset: 2px;
  transition: color var(--dur-base) var(--ease),
              text-decoration-color var(--dur-base) var(--ease);
}
.auth__terms a:hover {
  color: var(--ink-2);
  text-decoration-color: var(--muted);
}

/* ---------- Signup tablet / phone ---------- */
@media (max-width: 780px) {
  .auth__password .auth__input { padding-right: 58px; }
  .auth__toggle { font-size: 11px; right: 8px; }
}
@media (max-width: 520px) {
  .auth__password .auth__input { padding-right: 56px; }
}

/* ============================================================
   Checkout page
   Shell-only paper-surface styling for website_v2/checkout.html.
   All selectors are namespaced under .checkout__* or live under
   a .checkout ancestor, except the JS-managed legacy class names
   (.plan-tab, .pay-btn, .mini-toggle, .msg, etc.) which are
   reused verbatim because the inline JS rewrites className on
   those elements and cannot be re-namespaced without changing
   behavior.
   ============================================================ */

/* ---------- Shell layout ---------- */
.checkout {
  background: var(--paper);
  min-height: calc(100vh - 60px);
  padding: var(--sp-9) 0 var(--sp-10);
}
.checkout__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
.checkout__head {
  text-align: left;
  margin-bottom: var(--sp-7);
  max-width: 640px;
}
.checkout__title {
  /* Scale matched to .auth__title so checkout's H1 sits in the same
     editorial ladder as login/signup. Alignment stays left because the
     checkout page is wider than the single-card auth layout. */
  font-family: var(--f-display);
  font-size: 36px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 var(--sp-3);
}
.checkout__sub {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* ---------- Two-column grid (desktop) ---------- */
.checkout__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: start;
}
.checkout__form-col { min-width: 0; }

/* ---------- Plan tabs (legacy class names kept for JS) ---------- */
.checkout .plan-tabs {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.checkout .plan-tab {
  flex: 1;
  padding: var(--sp-4) var(--sp-4);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease),
              background-color var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
  text-align: left;
  position: relative;
}
.checkout .plan-tab:hover {
  border-color: var(--rule-2);
  background: var(--paper-2);
}
.checkout .plan-tab.active-pro,
.checkout .plan-tab.active-max {
  /* Single hairline navy border — no inset ring. One honest indicator. */
  border-color: var(--navy);
  background: var(--paper);
}
.checkout .plan-tab .tab-name {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
  letter-spacing: -0.005em;
}
.checkout .plan-tab .tab-price {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.checkout .plan-tab .tab-badge {
  position: absolute;
  top: -9px;
  left: var(--sp-4);
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
  background: var(--navy);
  color: var(--paper);
}
.checkout .plan-tab .tab-badge.max-badge {
  background: var(--ink-2);
  color: var(--paper);
}

/* ---------- Form card ---------- */
.checkout__form {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: var(--sp-6);
}
.checkout__section-title {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 var(--sp-2);
  letter-spacing: -0.005em;
}
.checkout__section-sub {
  font-family: var(--f-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 var(--sp-5);
}
/* Form fields reuse the shared .auth__field / .auth__label / .auth__input
   primitives from the auth surface so checkout and signup/login stay in
   lockstep on input styling. No checkout-specific field primitives. */

/* ---------- Payment Element host ---------- */
.checkout__payment-slot {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: var(--sp-4);
  transition: border-color var(--dur-base) var(--ease);
}
.checkout__payment-slot:focus-within { border-color: var(--navy); }

/* ---------- Billing toggle (legacy class names kept for JS) ---------- */
.checkout .checkout-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-5) 0 var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.checkout .checkout-toggle label {
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.checkout .checkout-toggle label.active { color: var(--ink); }
.checkout .mini-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--rule-2);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease);
  flex-shrink: 0;
}
.checkout .mini-toggle.on { background: var(--navy); }
.checkout .mini-toggle .dot {
  /* Flat hairline dot — no drop shadow, matches the rest of website_v2. */
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--paper);
  border-radius: 50%;
  transition: transform var(--dur-base) var(--ease);
}
.checkout .mini-toggle.on .dot { transform: translateX(16px); }
.checkout .checkout-toggle .save {
  /* Muted label instead of green — semantic color reserved for actual
     up/down data, not decorative marketing callouts. */
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-left: auto;
  letter-spacing: 0.02em;
}

/* ---------- Pay button (legacy class names kept for JS) ---------- */
.checkout .pay-btn {
  width: 100%;
  padding: 14px var(--sp-5);
  border: 1px solid var(--navy);
  border-radius: 6px;
  background: var(--navy);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease),
              opacity var(--dur-base) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}
.checkout .pay-btn.pro,
.checkout .pay-btn.max {
  background: var(--navy);
  color: var(--paper);
  border-color: var(--navy);
}
.checkout .pay-btn:hover:not(:disabled) { background: var(--navy-hover); border-color: var(--navy-hover); }
.checkout .pay-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.checkout .pay-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.checkout .pay-btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(250,250,247,0.35);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: checkoutSpin 0.6s linear infinite;
  display: none;
}
.checkout .pay-btn.loading .spinner { display: block; }
.checkout .pay-btn.loading .btn-text { display: none; }
@keyframes checkoutSpin { to { transform: rotate(360deg); } }

/* ---------- Message zone (#msg — JS rewrites className) ---------- */
.checkout #msg {
  display: none;
  margin-top: var(--sp-3);
  padding: 10px 14px;
  border-radius: 6px;
  font-family: var(--f-body);
  font-size: 13px;
  line-height: 1.5;
}
.checkout #msg.error {
  display: block;
  background: var(--down-tint);
  border: 1px solid var(--down);
  color: var(--down);
}
.checkout #msg.success {
  display: block;
  background: var(--up-tint);
  border: 1px solid var(--up);
  color: var(--up);
}

/* ---------- Reassurance micro-line ---------- */
.checkout__reassure {
  margin: var(--sp-3) 0 0;
  font-family: var(--f-body);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

/* ---------- Order summary (right column) ---------- */
.checkout__summary {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: var(--sp-6);
  position: sticky;
  top: 80px;
}
.checkout__summary-title {
  /* Matched to .checkout__section-title so both section headers
     ("Payment details" and "Order summary") read as a pair: same
     display face, same size, same weight, sentence case. Only the
     bottom margin differs because the summary title is followed
     directly by a content row, not a sub-line. */
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 var(--sp-5);
  letter-spacing: -0.005em;
}
.checkout .summary-plan {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: 0 0 var(--sp-4);
  border-bottom: 1px solid var(--rule);
}
.checkout .summary-plan .plan-name {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.checkout .summary-plan .plan-tier {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  padding: 1px 6px;
  border: 1px solid var(--rule-2);
  border-radius: 3px;
}
.checkout__summary-price-block { text-align: right; }
.checkout .summary-plan .plan-price {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.checkout .summary-plan .plan-period {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.01em;
}
.checkout .summary-features {
  list-style: none;
  padding: var(--sp-4) 0;
  margin: 0;
  border-bottom: 1px solid var(--rule);
}
.checkout .summary-features li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-family: var(--f-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  padding: 4px 0;
}
.checkout .summary-features li svg {
  /* Neutral hairline check — no green. Editorial tone on paper. */
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 3px;
}
.checkout .summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--sp-4) 0 0;
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.checkout .summary-total .due-label {
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.checkout .trial-note {
  margin-top: var(--sp-3);
  font-family: var(--f-body);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.checkout .trial-note #trial-end-date {
  color: var(--ink-2);
  font-weight: 500;
}

/* ---------- Responsive: summary-first stack below 1080px ---------- */
@media (max-width: 1079px) {
  .checkout__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }
  .checkout__form-col { order: 2; }
  .checkout__summary {
    order: 1;
    position: static;
    top: auto;
  }
}

/* ---------- Responsive: tablet ---------- */
@media (max-width: 780px) {
  .checkout { padding: var(--sp-7) 0 var(--sp-8); }
  .checkout__inner { padding: 0 var(--sp-5); }
  .checkout__head { margin-bottom: var(--sp-6); }
  .checkout__form { padding: var(--sp-5); }
  .checkout__summary { padding: var(--sp-5); }
  .checkout .plan-tab { padding: var(--sp-3) var(--sp-4); }
  .checkout .plan-tab .tab-name { font-size: 16px; }
}

/* ---------- Responsive: phone ---------- */
@media (max-width: 520px) {
  .checkout { padding: var(--sp-6) 0 var(--sp-7); }
  .checkout__inner { padding: 0 var(--sp-4); }
  .checkout__form { padding: var(--sp-4); }
  .checkout__summary { padding: var(--sp-4); }
  .checkout .plan-tabs { gap: var(--sp-2); }
  .checkout .plan-tab { padding: var(--sp-3); }
  .checkout .plan-tab .tab-badge { font-size: 9px; left: var(--sp-3); }
  .checkout .checkout-toggle { padding: var(--sp-2) var(--sp-3); gap: var(--sp-2); }
  .checkout .checkout-toggle .save { font-size: 10px; }
  .checkout .summary-plan .plan-price { font-size: 20px; }
}
