/*
 * Iron & Tonic marketing site — page/section layout
 * Depends on tokens.css and components.css being loaded first.
 *
 * This file owns layout for sections 1–3 (header, hero, stat strip).
 * Later sections extend this file. No hex values — tokens only.
 */

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 1 · Sticky header                                                         */
/* ─────────────────────────────────────────────────────────────────────────── */

#site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-100);
  border-bottom: 1px solid var(--border-header);
}

#site-header .container {
  padding-top: 14px;
  padding-bottom: 14px;
  display: flex;
  align-items: center;
  gap: var(--space-32);
}

.wordmark-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  gap: var(--space-26);
  margin-left: 8px;
  flex: 1;
  align-items: center;
}

.site-nav a {
  font: var(--fw-semibold) var(--text-13) var(--font-body);
  color: var(--fg-subtle);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

.site-nav a:hover {
  color: var(--ink);
}

/* Hamburger toggle button — hidden on desktop, shown on mobile via media query */
.site-nav-toggle {
  display: none;           /* hidden at ≥900px */
  align-items: center;
  justify-content: center;
  width: var(--hit-target-min);
  height: var(--hit-target-min);
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ink);
  border-radius: var(--radius-8);
  flex-shrink: 0;
}

.site-nav-toggle .mi {
  font-size: 24px;
  line-height: 1;
}

/* § 1 responsive (≤899px) */
@media (max-width: 899px) {
  #site-header .container {
    flex-wrap: wrap;
    gap: 0;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  /* Show the hamburger and push it to the right of the wordmark */
  .site-nav-toggle {
    display: flex;
    margin-left: auto;
  }

  /* Hide the desktop CTA button in the header */
  #site-header .container > .ds-button {
    display: none;
  }

  /* Collapse the nav by default; un-collapse when .is-open is toggled by JS */
  .site-nav {
    display: none;
    flex: none;
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    gap: 0;
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
    border-top: 1px solid var(--border-header);
  }

  .site-nav.is-open {
    display: flex;
  }

  /* Increase hit target for nav links on mobile */
  .site-nav a {
    display: flex;
    align-items: center;
    padding: var(--space-10) var(--space-8);
    min-height: var(--hit-target-min);
  }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 2 · Hero                                                                  */
/* ─────────────────────────────────────────────────────────────────────────── */

#top > .container {
  padding-top: 72px;
  padding-bottom: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 340px;
  column-gap: 56px;
  row-gap: 0;
  align-items: center;
}

/* ── Left column ── */

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
  align-items: flex-start;
}

.hero-h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: clamp(40px, 5.2vw, 62px);
  line-height: .92;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--ink);
}

.hero-body {
  margin: 0;
  max-width: 30em;
  font: var(--fw-regular) 17px/1.5 var(--font-body);
  color: var(--fg-subtle);
  text-wrap: pretty;
}

.hero-buttons {
  display: flex;
  gap: 10px;
  padding-top: var(--space-4);
}

.hero-chips {
  display: flex;
  gap: var(--space-8);
  padding-top: var(--space-8);
}

/* ── Right column — phone mock ── */

.hero-phone-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.phone-shell {
  width: 340px;
  background: var(--bg-contrast);
  border-radius: 46px;
  padding: 9px;
  flex: none;
  box-sizing: border-box;
}

.phone-screen {
  background: var(--bg-100);
  border-radius: 38px;
  overflow: hidden;
  height: 668px;
  display: flex;
  flex-direction: column;
}

.phone-brand-row {
  padding: 8px 16px 12px;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.phone-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 14px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* display:flex above beats the UA [hidden]{display:none} rule; restore it
   explicitly so site.js's Iron/Tonic toggle actually hides the inactive body. */
.phone-body[hidden] {
  display: none;
}

.phone-caption {
  font: var(--fw-regular) var(--text-12) var(--font-body);
  color: var(--fg-subtle);
  text-align: center;
}

/* ── Iron phone cards ── */

.iron-hero-card {
  background: var(--bg-contrast);
  border-radius: var(--radius-hero);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.iron-hero-title {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: 30px;
  line-height: .95;
  text-transform: uppercase;
  color: var(--text-on-dark);
}

.iron-hero-meta {
  font: var(--fw-regular) var(--text-12) var(--font-body);
  color: var(--text-on-dark-muted);
}

.phone-card {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.phone-card--pad16 {
  padding: 16px;
  gap: 12px;
}

.phone-card--pad14-16 {
  padding: 14px 16px;
  gap: 12px;
}

/* ── Tonic phone cards ── */

.tonic-calorie-card {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-shrink: 0;
}

.tonic-macro-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.tonic-today-card {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.tonic-today-header {
  padding: 0 12px 6px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.tonic-today-count {
  font: var(--fw-regular) var(--text-11) var(--font-body);
  color: var(--fg-subtle);
}

.tonic-insight-card {
  background: var(--accent-subtle);
  border-radius: var(--radius-card);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.tonic-insight-icon {
  font-size: 20px;
  color: var(--accent);
}

.tonic-insight-text {
  font: var(--fw-regular) var(--text-12)/1.4 var(--font-body);
  color: var(--ink);
}

/* § 2 responsive (≤899px) */
@media (max-width: 899px) {
  #top > .container {
    /* Collapse two-column grid to single column;
       phone mock naturally moves below hero copy */
    grid-template-columns: 1fr;
    column-gap: var(--space-26);
    row-gap: 0;
    padding-top: 40px;
    padding-bottom: 32px;
  }

  /* Restore inter-child spacing lost when row-gap was zeroed */
  #top > .container > *:not(:first-child):not(.wt-panel) { margin-top: var(--space-26); }

  /* Phone mock: pinned at reference width so internal fixed-px layout never squeezes.
     Below 372px it overflows the column; .hero-phone-col clips the layout box while
     the transform:scale rules below keep the visual within available width. */
  .phone-shell {
    width: 340px;
  }

  /* Contain layout-box overflow from the scaled phone at narrow viewports.
     overflow:hidden is harmless at 372–899px where 340px ≤ available width. */
  .hero-phone-col {
    overflow: hidden;
  }

  /* Hero copy: allow chips and buttons to wrap */
  .hero-buttons {
    flex-wrap: wrap;
  }

  .hero-chips {
    flex-wrap: wrap;
  }
}

/* Phone mock narrow-viewport scaling
   The phone is pinned at 340px layout width; transform:scale() keeps the visual
   within available container width (viewport - 32px) without clipping any controls.
   transform-origin: top center anchors scaling at the top centre; the freed layout
   space below is reclaimed with a matching negative margin-bottom.
   Phone-shell box height = 9px*2 padding + 668px screen = 686px.
   Gap formula: 686 * (1 - scale). */

/* Step 1: 340-371px viewport (available 308-339px).
   scale(0.90) -> visual width 306px; fits at worst case 340px viewport (308px avail). */
@media (max-width: 371px) {
  .phone-shell {
    transform: scale(0.90);
    transform-origin: top center;
    margin-bottom: -69px; /* gap = 686 * 0.10 = 68.6px */
  }
}

/* Step 2: <=339px viewport (available <=307px).
   scale(0.84) -> visual width 285.6px; fits at worst case 320px viewport (288px avail). */
@media (max-width: 339px) {
  .phone-shell {
    transform: scale(0.84);
    margin-bottom: -110px; /* gap = 686 * 0.16 = 109.76px */
  }
}


/* ─────────────────────────────────────────────────────────────────────────── */
/* § 3 · Stat strip                                                            */
/* ─────────────────────────────────────────────────────────────────────────── */

.stat-strip > .container {
  padding-top: 26px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat-tiles {
  display: flex;
  gap: 14px;
}

/* § 3 responsive (≤599px: 4-tile row → 2×2 grid) */
@media (max-width: 599px) {
  .stat-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 4 · Who logs (#audience)                                                  */
/* ─────────────────────────────────────────────────────────────────────────── */

#audience {
  background: var(--bg-0);
  border-top: 1px solid var(--border-header);
}

#audience > .container {
  padding-top: 72px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  gap: var(--space-26);
}

.audience-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.audience-header-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-14);
}

/* Shared: 40px display heading used in §4, §5, §6 */
.section-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: 40px;
  line-height: .95;
  text-transform: uppercase;
  color: var(--ink);
}

/* Shared: audience-body columns and their mirror in §5/§6 */
.audience-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

/* display:grid above beats the UA [hidden]{display:none} rule; restore it
   explicitly so the solo/trainer segmented control actually hides the
   inactive panel. */
.audience-body[hidden] {
  display: none;
}

/* Shared: left/right copy columns (§4, §5, §6) */
.section-copy-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}

/* Shared: icon + overline pairing */
.section-icon-row {
  display: flex;
  align-items: center;
  gap: var(--space-10);
}

.section-icon {
  font-size: 20px;
  color: var(--accent);
}

/* §4/§6 body paragraph (32em) — §5 overrides to 34em below */
.section-p {
  margin: 0;
  max-width: 32em;
  font: var(--fw-regular) var(--text-15)/1.5 var(--font-body);
  color: var(--fg-subtle);
  text-wrap: pretty;
}

#iron .section-p {
  max-width: 34em;
}

/* §4 sub-heading */
.audience-h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: 30px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
}

/* §4 bordered list card (bg-100 background — audience panel) */
.audience-list-card {
  background: var(--bg-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-card-lg);
  padding: var(--space-6);
}

/* § 4 responsive (≤899px) */
@media (max-width: 899px) {
  .audience-body {
    grid-template-columns: 1fr;
    gap: var(--space-26);
  }

  /* Stack header-copy and segmented control vertically */
  .audience-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-16);
  }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 5 · Iron (#iron)                                                          */
/* ─────────────────────────────────────────────────────────────────────────── */

#iron {
  background: var(--bg-100);
  border-top: 1px solid var(--border-header);
}

#iron > .container {
  padding-top: 72px;
  padding-bottom: 72px;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  column-gap: 56px;
  row-gap: 0;
  align-items: center;
}

/* §5 bordered list card (bg-0 background — iron panel) */
.section-list-card {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-card-lg);
  padding: var(--space-6);
}

/* § 5 responsive (≤899px) */
@media (max-width: 899px) {
  #iron > .container {
    grid-template-columns: 1fr;
    column-gap: var(--space-26);
    row-gap: 0;
  }

  /* Restore inter-child spacing lost when row-gap was zeroed */
  #iron > .container > *:not(:first-child):not(.wt-panel) { margin-top: var(--space-26); }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 6 · Tonic (#tonic)                                                        */
/* ─────────────────────────────────────────────────────────────────────────── */

#tonic {
  background: var(--bg-0);
  border-top: 1px solid var(--border-header);
}

#tonic > .container {
  padding-top: 72px;
  padding-bottom: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  column-gap: 56px;
  row-gap: 0;
  align-items: center;
}

.tonic-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-14);
}

.tonic-feature-card {
  background: var(--bg-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.tonic-feature-card--accent {
  background: var(--accent-subtle);
  border: none;
}

.tonic-feature-icon {
  font-size: 22px;
  color: var(--accent);
}

.tonic-feature-title {
  font: var(--fw-bold) var(--text-15) var(--font-body);
  color: var(--ink);
}

.tonic-feature-body {
  font: var(--fw-regular) var(--text-13)/1.4 var(--font-body);
  color: var(--fg-subtle);
}

.tonic-feature-card--accent .tonic-feature-body {
  color: var(--ink);
}

/* § 6 responsive (≤899px) */
@media (max-width: 899px) {
  #tonic > .container {
    grid-template-columns: 1fr;
    column-gap: var(--space-26);
    row-gap: 0;
  }

  /* Restore inter-child spacing lost when row-gap was zeroed */
  #tonic > .container > *:not(:first-child):not(.wt-panel) { margin-top: var(--space-26); }
}

/* § 6 responsive (≤599px): collapse the 2×2 feature-card grid to a single
   column. At 375px cards would be ~165px wide leaving ~10 chars/line which
   is too ragged. ≥600px has genuine room; ≥900px is the untouched reference.
   Rule is intentionally isolated here so it is easy to revert if needed. */
@media (max-width: 599px) {
  .tonic-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 7 · The logging contract (#honest)                                        */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Full-bleed dark section — background breaks out of the 1120px container */
#honest {
  background: var(--bg-contrast);
}

#honest > .container {
  padding-top: 76px;
  padding-bottom: 76px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.honest-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: flex-end;
}

.honest-head-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.honest-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: 46px;
  line-height: .95;
  text-transform: uppercase;
  color: var(--text-on-dark);
}

.honest-p {
  margin: 0;
  font: var(--fw-regular) 16px/1.5 var(--font-body);
  color: var(--text-on-dark-muted);
  text-wrap: pretty;
}

.honest-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-14);
}

.honest-card {
  background: var(--overlay-on-dark);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.honest-card-headline {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 30px;
  line-height: 1;
  color: var(--text-on-dark);
}

.honest-card-body {
  font: var(--fw-regular) var(--text-13)/1.4 var(--font-body);
  color: var(--text-on-dark-muted);
}

/* § 7 responsive */
/* Stack the two-column head; step honest-cards 3→2→1 */
@media (max-width: 899px) {
  .honest-head {
    grid-template-columns: 1fr;
    gap: var(--space-20);
  }

  .honest-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 8 · Coach (#coach)                                                        */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Full-bleed dark section — background breaks out of the 1120px container,
   matching #honest's dark treatment immediately above it */
#coach {
  background: var(--bg-contrast);
  border-top: 1px solid var(--border-header);
}

#coach > .container {
  padding-top: 76px;
  padding-bottom: 76px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.coach-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: flex-end;
}

.coach-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: 46px;
  line-height: .95;
  text-transform: uppercase;
  color: var(--text-on-dark);
}

.coach-p {
  margin: 0;
  font: var(--fw-regular) 16px/1.5 var(--font-body);
  color: var(--text-on-dark-muted);
  text-wrap: pretty;
}

.coach-chips {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

/* The one gradient in the system */
.coach-card {
  background: var(--gradient-coach);
  border: 1px solid var(--border-on-dark-soft);
  border-radius: var(--radius-hero);
  padding: var(--space-26);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--space-32);
  align-items: center;
}

.coach-card-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.coach-card-body {
  margin: 0;
  font: var(--fw-regular) 17px/1.5 var(--font-body);
  color: var(--text-on-dark);
  text-wrap: pretty;
}

.coach-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-10);
}

.coach-stat {
  background: var(--overlay-on-dark);
  border-radius: var(--radius-12);
  padding: var(--space-14);
}

.coach-stat-label {
  font: var(--fw-regular) var(--overline-size) var(--font-body);
  color: var(--text-on-dark-muted);
}

.coach-stat-value {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--display-stat);
  line-height: var(--display-line);
  color: var(--text-on-dark);
  white-space: nowrap;
}

/* § 8 responsive (≤899px) */
@media (max-width: 899px) {
  .coach-head {
    grid-template-columns: 1fr;
    gap: var(--space-20);
    align-items: flex-start;
  }

  .coach-card {
    grid-template-columns: 1fr;
    gap: var(--space-20);
  }
}

@media (max-width: 599px) {
  .coach-stats {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 9 · Macro plan (#plan)                                                    */
/* ─────────────────────────────────────────────────────────────────────────── */

#plan {
  background: var(--bg-0);
  border-top: 1px solid var(--border-header);
}

#plan > .container {
  padding-top: 72px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  gap: var(--space-26);
}

/* Header row: mirrors .audience-header — overline + h2 left, body copy right */
.plan-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.plan-header-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.plan-header-p {
  margin: 0;
  max-width: 30em;
  font: var(--fw-regular) var(--text-15)/1.5 var(--font-body);
  color: var(--fg-subtle);
  text-wrap: pretty;
}

.plan-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-14);
}

.plan-card {
  background: var(--bg-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.plan-card-name {
  font: var(--fw-bold) var(--text-15) var(--font-body);
  color: var(--ink);
}

.plan-card-ratio {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 22px;
  line-height: 1;
  color: var(--accent);
}

.plan-card-caption {
  font: var(--fw-regular) var(--text-11) var(--font-body);
  letter-spacing: var(--overline-tracking-tight);
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.plan-card-desc {
  margin: 0;
  border-top: 1px solid var(--border-row);
  padding-top: 10px;
  font: var(--fw-regular) var(--text-13)/1.45 var(--font-body);
  color: var(--fg-subtle);
  text-wrap: pretty;
}

.plan-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--space-14);
}

.plan-hero-card {
  background: var(--bg-contrast);
  border-radius: var(--radius-hero);
  padding: var(--space-26);
  display: flex;
  flex-direction: column;
  gap: var(--space-14);
}

.plan-hero-title {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: 30px;
  line-height: .95;
  text-transform: uppercase;
  color: var(--text-on-dark);
}

.plan-hero-body {
  margin: 0;
  max-width: 34em;
  font: var(--fw-regular) var(--text-14)/1.5 var(--font-body);
  color: var(--text-on-dark-muted);
  text-wrap: pretty;
}

.plan-hero-stats {
  display: flex;
  gap: var(--space-10);
  margin-top: var(--space-4);
}

.plan-hero-stat {
  flex: 1;
  background: var(--overlay-on-dark);
  border-radius: var(--radius-12);
  padding: 14px 16px;
}

.plan-hero-stat-value {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 22px;
  color: var(--text-on-dark);
}

.plan-hero-stat-label {
  font: var(--fw-regular) var(--text-12) var(--font-body);
  color: var(--text-on-dark-muted);
}

.plan-feature-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-14);
}

.plan-feature-card {
  background: var(--bg-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  gap: var(--space-14);
  align-items: flex-start;
}

.plan-feature-title {
  font: var(--fw-bold) var(--text-15) var(--font-body);
  color: var(--ink);
}

.plan-feature-body {
  font: var(--fw-regular) var(--text-13)/1.4 var(--font-body);
  color: var(--fg-subtle);
  padding-top: var(--space-4);
}

/* § 9 responsive (≤899px) */
@media (max-width: 899px) {
  .plan-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-bottom {
    grid-template-columns: 1fr;
  }

  .plan-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-16);
  }
}

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

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 10 · Analytics (#analytics)                                               */
/* ─────────────────────────────────────────────────────────────────────────── */

#analytics {
  background: var(--bg-100);
  border-top: 1px solid var(--border-header);
}

#analytics > .container {
  padding-top: 72px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  gap: var(--space-26);
}

.analytics-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.analytics-header-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-14);
}

/* display:grid above beats the UA [hidden]{display:none} rule; restore it
   explicitly so the In Iron / In Tonic segmented control actually hides the
   inactive grid. */
.analytics-grid[hidden] {
  display: none;
}

.analytics-feature-card {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  gap: var(--space-14);
  align-items: flex-start;
}

.analytics-feature-title {
  font: var(--fw-bold) var(--text-15) var(--font-body);
  color: var(--ink);
}

.analytics-feature-body {
  font: var(--fw-regular) var(--text-13)/1.4 var(--font-body);
  color: var(--fg-subtle);
  padding-top: var(--space-4);
}

/* § 10 responsive (≤899px) */
@media (max-width: 899px) {
  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-16);
  }
}

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

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 11 · Other features (#other)                                               */
/* ─────────────────────────────────────────────────────────────────────────── */

#other {
  background: var(--bg-0);
  border-top: 1px solid var(--border-header);
}

#other > .container {
  padding-top: 72px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  gap: var(--space-26);
}

/* Shared: overline + h2 intro block (§9, §10) */
.section-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.other-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--space-14);
}

/* Lead card — dark surface, no gradient */
.other-lead-card {
  background: var(--bg-contrast);
  border-radius: var(--radius-hero);
  padding: var(--space-26);
  display: flex;
  flex-direction: column;
  gap: var(--space-14);
}

.other-lead-title {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: 30px;
  line-height: .95;
  text-transform: uppercase;
  color: var(--text-on-dark);
}

.other-lead-body {
  margin: 0;
  font: var(--fw-regular) var(--text-14)/1.5 var(--font-body);
  color: var(--text-on-dark-muted);
  max-width: 34em;
  text-wrap: pretty;
}

.other-lead-stats {
  display: flex;
  gap: var(--space-10);
  margin-top: var(--space-4);
}

.other-lead-stat {
  background: var(--overlay-on-dark);
  border-radius: var(--radius-12);
  padding: var(--space-14) var(--space-16);
  flex: 1;
}

.other-lead-stat-value {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 22px;
  color: var(--text-on-dark);
}

.other-lead-stat-label {
  font: var(--fw-regular) var(--text-12) var(--font-body);
  color: var(--text-on-dark-muted);
}

/* Right column of three feature cards */
.other-right-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-14);
}

.other-feature-card {
  background: var(--bg-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  gap: var(--space-14);
  align-items: flex-start;
}

/* Shared: 44px accent-subtle icon tile used in §9 and §10 */
.feature-icon-tile {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-10);
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-icon-tile .mi,
.feature-icon-tile .mio {
  font-size: 22px;
  color: var(--accent);
}

.other-feature-title {
  font: var(--fw-bold) var(--text-15) var(--font-body);
  color: var(--ink);
}

.other-feature-body {
  font: var(--fw-regular) var(--text-13)/1.4 var(--font-body);
  color: var(--fg-subtle);
  padding-top: var(--space-4);
}

/* § 11 responsive (≤899px) */
@media (max-width: 899px) {
  .other-grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 12 · Everything else (#everything)                                        */
/* ─────────────────────────────────────────────────────────────────────────── */

#everything {
  border-top: 1px solid var(--border-header);
}

#everything > .container {
  padding-top: 72px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  gap: var(--space-26);
}

.everything-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: 34px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
}

.everything-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-14);
}

.everything-card {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  gap: var(--space-14);
  align-items: flex-start;
}

.everything-title {
  font: var(--fw-bold) var(--text-15) var(--font-body);
  color: var(--ink);
}

.everything-body {
  font: var(--fw-regular) var(--text-13)/1.4 var(--font-body);
  color: var(--fg-subtle);
  padding-top: var(--space-4);
}

/* § 12 responsive: step 3→2→1 for the feature grid */
@media (max-width: 899px) {
  .everything-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 13 · iOS waitlist (#ios)                                                  */
/* ─────────────────────────────────────────────────────────────────────────── */

#ios {
  background: var(--bg-contrast);
  border-top: 1px solid var(--border-on-dark-soft);
}

#ios > .container {
  padding-top: 76px;
  padding-bottom: 76px;
}

/* Constrain form content width; copy and form stack vertically */
.ios-inner {
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: var(--space-20);
}

.ios-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: clamp(32px, 4vw, 46px);
  line-height: .95;
  text-transform: uppercase;
  color: var(--text-on-dark);
}

.ios-p {
  margin: 0;
  font: var(--fw-regular) 16px/1.5 var(--font-body);
  color: var(--text-on-dark-muted);
  text-wrap: pretty;
}

/* ── Form ── */

.ios-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-14);
  padding-top: var(--space-8);
}

/* Email row: inline input + primary button */
.ios-email-row {
  display: flex;
  gap: var(--space-10);
  align-items: stretch;
}

/* Input stretches to fill the row; button stays fixed width.
   Sized above the DS minimum (44px) — this is the page's primary CTA.
   flex-basis must stay "auto" (not the 0% a bare "flex: 1" implies) —
   at the ≤599px breakpoint below, .ios-email-row switches to
   flex-direction: column, making height the flex main axis; a 0%
   basis there overrides the explicit height and collapses the input. */
.ios-email-row .ds-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 60px;
  padding: 0 var(--space-20);
  font-size: 16px;
}

.ios-email-row .ds-button {
  height: 60px;
  padding-left: var(--space-20);
  padding-right: var(--space-20);
  font-size: 16px;
}

/* Inline field / server error */
.ios-field-error {
  font: var(--fw-regular) var(--text-13) var(--font-body);
  color: var(--negative);
  /* does not set display, so the UA [hidden]{display:none} rule applies here */
}

/* Interest chip radiogroup row */
.ios-interest-row {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  flex-wrap: wrap;
}

.ios-interest-label {
  font: var(--fw-semibold) var(--text-13) var(--font-body);
  color: var(--text-on-dark-muted);
  white-space: nowrap;
}

.ios-interest-chips {
  display: flex;
  gap: var(--space-8);
}

/* Context-specific chip style for dark background.
   Overrides .ds-chip defaults (components.css loads before sections.css). */
.ios-chip-radio {
  background: var(--overlay-on-dark);       /* subtle white wash */
  color: var(--text-on-dark-muted);
  border-color: var(--border-on-dark);
  cursor: pointer;
  min-height: var(--hit-target-min);        /* 44px — DS interactive invariant */
  transition: background   var(--duration-fast) var(--ease-standard),
              color        var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard);
}

.ios-chip-radio[aria-checked="true"] {
  background: var(--accent-light);    /* #DCDCFF — light accent on dark bg */
  color: var(--accent);               /* #5252E6 */
  border-color: var(--accent);
}

.ios-chip-radio:focus-visible {
  outline: var(--border-focus);
  outline-offset: 3px;
}

/* Checkbox row */
.ios-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-10);
  cursor: pointer;
  min-height: var(--hit-target-min);  /* 44px — DS interactive invariant */
}

.ios-checkbox-text {
  font: var(--fw-regular) var(--text-14) var(--font-body);
  color: var(--text-on-dark-muted);
}

/* Fine print */
.ios-fine-print {
  margin: 0;
  font: var(--fw-regular) var(--text-12) var(--font-body);
  color: var(--text-on-dark-muted);
  opacity: .6;
}

/* Success confirmation panel */
.ios-success {
  display: flex;
  align-items: flex-start;
  gap: var(--space-14);
  padding-top: var(--space-8);
  /* display:flex above beats the UA [hidden]{display:none} rule;
     see the explicit override below */
}

/* display:flex on .ios-form and .ios-success overrides the UA
   [hidden]{display:none} rule; restore it explicitly. */
.ios-form[hidden],
.ios-success[hidden] {
  display: none;
}

.ios-success-icon {
  font-size: 28px;
  color: var(--positive);
  flex-shrink: 0;
  margin-top: 2px;
}

.ios-success-title {
  font: var(--fw-bold) var(--text-17) var(--font-body);
  color: var(--text-on-dark);
}

.ios-success-body {
  font: var(--fw-regular) var(--text-14)/1.5 var(--font-body);
  color: var(--text-on-dark-muted);
  padding-top: var(--space-4);
}

/* § 13 responsive (≤599px): stack email row vertically */
@media (max-width: 599px) {
  .ios-email-row {
    flex-direction: column;
  }

  .ios-email-row .ds-button {
    width: 100%;
    justify-content: center;
  }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 14 · Closing CTA + footer                                                 */
/* ─────────────────────────────────────────────────────────────────────────── */

#cta {
  background: var(--bg-contrast);
}

#cta > .container {
  padding-top: 76px;
  padding-bottom: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.cta-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-14);
}

.cta-tagline {
  margin: 0;
  font: var(--fw-regular) var(--text-15) var(--font-body);
  color: var(--text-on-dark-muted);
}

.cta-buttons {
  display: flex;
  gap: var(--space-10);
}

footer {
  background: var(--bg-contrast);
  border-top: 1px solid var(--border-on-dark-soft);
}

footer > .container {
  padding-top: var(--space-26);
  padding-bottom: var(--space-26);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-26);
}

/* § 14 responsive (≤899px): stack CTA copy + buttons vertically */
@media (max-width: 899px) {
  #cta > .container {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 56px;
    padding-bottom: 56px;
  }

  footer > .container {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-16);
  }
}

.footer-copy {
  font: var(--fw-regular) var(--text-12) var(--font-body);
  color: var(--text-on-dark-muted);
}

.footer-nav {
  display: flex;
  gap: var(--space-20);
}

.footer-nav a {
  font: var(--fw-semibold) var(--text-12) var(--font-body);
  color: var(--text-on-dark-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

.footer-nav a:hover {
  color: var(--text-on-dark);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* § 15 · Walkthrough panels                                                   */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Collapsed panel — placed as last child inside a section .container grid */
.wt-panel {
  grid-column: 1 / -1;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  visibility: hidden;     /* f2: invisible panels leave tab order + a11y tree */
  margin-top: 0;
  transition: max-height 320ms var(--ease-standard),
              opacity 200ms,
              visibility 0s linear 320ms,   /* f2: delay until collapse anim ends */
              margin-top 320ms var(--ease-standard);
}

/* Open panel needs its own top separation (container row-gap is zero) */
.wt-panel[data-open] { margin-top: 56px; }

/* Open state — JS toggles [data-open] or .is-open */
#wt-iron[data-open],  #wt-iron.is-open  {
  max-height: 910px;
  opacity: 1;
  visibility: visible;    /* f2 */
  transition: max-height 320ms var(--ease-standard),
              opacity 200ms,
              visibility 0s,              /* f2: become visible immediately on open */
              margin-top 320ms var(--ease-standard);
}
#wt-tonic[data-open], #wt-tonic.is-open {
  max-height: 910px;
  opacity: 1;
  visibility: visible;
  transition: max-height 320ms var(--ease-standard),
              opacity 200ms,
              visibility 0s,
              margin-top 320ms var(--ease-standard);
}
#wt-day[data-open],   #wt-day.is-open   {
  max-height: 620px;
  opacity: 1;
  visibility: visible;
  transition: max-height 320ms var(--ease-standard),
              opacity 200ms,
              visibility 0s,
              margin-top 320ms var(--ease-standard);
}

/* Card shell */
.wt-card {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-card-lg);
  padding: 20px;
  display: grid;
  gap: 32px;
  align-items: center;
}

.wt-card--iron  { grid-template-columns: minmax(0, 1fr) 296px; margin-top: 14px; }
.wt-card--tonic { grid-template-columns: 296px minmax(0, 1fr); margin-top: 14px; }
.wt-card--day   { grid-template-columns: 1fr 1fr; margin-top: 6px; }

/* Header row: overline label + dot nav + close button */
.wt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.wt-head__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Dot strip */
.wt-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Each dot is a <button>; box-sizing:content-box so height:6px is the content
   height and padding:19px 0 gives a true 44px (6+19+19) touch target.
   background-clip restricts colour to the 6px content zone.
   f6: ::before overlay widens the hit area horizontally; inset -3px keeps the
   reach within the 6px gap so adjacent overlays do not overlap. */
.wt-dot {
  position: relative;   /* f6: anchor the ::before hit-area overlay */
  box-sizing: content-box;  /* height is content-only so 6+19+19=44px total */
  width: 8px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-track);
  border: none;
  padding: 19px 0;
  background-clip: content-box;
  cursor: pointer;
  transition: width 200ms var(--ease-standard),
              background 200ms var(--ease-standard);
}

/* f6: overlay hit area — leaves layout geometry untouched.
   Horizontal reach is capped at 3px (half the 6px gap) so neighbour
   overlays never intersect. */
.wt-dot::before {
  content: "";
  position: absolute;
  inset: -19px -3px;
}

.wt-dot[aria-current="step"],   /* f10: aria-current="step" is the correct token */
.wt-dot.is-active {
  width: 26px;
  background: var(--accent);
  background-clip: content-box;
}

/* Close button — 32px round */
.wt-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-0);
  color: var(--fg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* Per-step content wrapper — hidden until JS marks active */
.wt-step         { display: none; }
.wt-step.is-active { display: block; }

/* Display title */
.wt-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 34px;
  line-height: .95;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 12px;
}

.wt-card--day .wt-title {
  font-size: 30px;
  line-height: 1;
}

/* Body paragraph */
.wt-body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-subtle);
  margin: 0 0 12px;
}

/* Step label ("Step 2 · Log the set") */
.wt-step-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--fg-subtle);
}

/* Phone bezel */
.wt-phone {
  width: 296px;
  background: var(--bg-contrast);
  border-radius: 40px;
  padding: 8px;
  box-shadow: var(--shadow-phone);
  box-sizing: border-box;
}

.wt-card--iron .wt-phone { justify-self: end; }

.wt-phone-screen {
  position: relative;
  height: 581px;
  border-radius: 33px;
  overflow: hidden;
  background: var(--bg-100);
}

.wt-phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* § 15 responsive (≤899px): stack to one column, centre the phone */
@media (max-width: 899px) {
  .wt-card--iron,
  .wt-card--tonic,
  .wt-card--day {
    grid-template-columns: 1fr;
  }

  .wt-phone,
  .wt-card--iron .wt-phone { justify-self: center; }

  .wt-panel[data-open] { margin-top: var(--space-26); }
  #wt-iron[data-open],  #wt-iron.is-open  { max-height: 1350px; }
  #wt-tonic[data-open], #wt-tonic.is-open { max-height: 1350px; }
  #wt-day[data-open],   #wt-day.is-open   { max-height: 1100px; }
}

/* § 15 reduced-motion: disable height animation and dot transitions.
   The open-state selectors (#wt-*[data-open] / .is-open) at (1,1,0) beat the
   plain .wt-panel rule at (0,1,0), so we must list them explicitly here to
   suppress the OPENING transition too, not just closing. */
@media (prefers-reduced-motion: reduce) {
  .wt-panel,
  #wt-iron[data-open],  #wt-iron.is-open,
  #wt-tonic[data-open], #wt-tonic.is-open,
  #wt-day[data-open],   #wt-day.is-open  { transition: none; }
  .wt-dot   { transition: none; }
}

/* ── f1: display:flex on .ds-list-row overrides UA [hidden]{display:none} ── */
.wt-card--day .ds-list-row[hidden] { display: none; }

/* ── f8: inline-style classes for walkthrough panel internals ─────────────── */

/* Copy column inside .wt-card panels */
.wt-copy-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.wt-card--day .wt-copy-col { gap: 16px; }

/* Stat-tile row (two tiles side-by-side) */
.wt-tiles {
  display: flex;
  gap: 10px;
}

/* Tuesday day-list card */
.wt-day-list {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Day-list header row (overline + count) */
.wt-day-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 8px;
}

/* Item-count label in the day-list header */
.wt-day-list__count {
  font: 400 var(--text-12) var(--font-body);
  color: var(--fg-subtle);
}

/* Phone-screen step wrappers need full height so the screenshot fills the bezel */
.wt-phone-screen .wt-step { height: 100%; }

/* f-bezel: when a screenshot is absent (onerror adds .wt-no-img), hide the
   phone wrapper entirely and collapse the card to a single copy column so
   there is no empty bezel or dead whitespace.  Self-reversing: once the real
   PNGs exist the onerror never fires and the class is never added. */
.wt-card.wt-no-img .wt-phone { display: none; }
.wt-card--iron.wt-no-img,
.wt-card--tonic.wt-no-img  { grid-template-columns: 1fr; }
