/* =====================================================================
   ANTAEUS — site layer. Depends on tokens-9.css.
   Page composition only; every colour/size/radius comes from a token.
   ===================================================================== */

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

/* ---------------------------------------------------------------------
   PHONE — a restrained bezel. The app's own chamfer scale doesn't apply
   to hardware, so this is the one place a larger radius is allowed.
   The screen itself is a CSS background so only ONE theme's image is
   ever downloaded, and the swap is instant with no flash.
   --------------------------------------------------------------------- */
.phone {
  width: 100%;
  max-width: 320px;
  border-radius: 42px;
  border: 3px solid var(--border);
  background: var(--card);
  padding: 6px;
  box-shadow: var(--shadow);
}
.shot {
  display: block;
  width: 100%;
  aspect-ratio: 860 / 1870;
  border-radius: 34px;
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  background-color: var(--bg);
}
.phone.tall .shot { aspect-ratio: 860 / 1180; background-position: top center; }

/* One rule per screen, twice (light default + dark override). */
.shot.today { background-image: url('screens/today-light.webp?v=4'); }
.shot.muscles { background-image: url('screens/muscles-light.webp?v=4'); }
.shot.fuel { background-image: url('screens/fuel-light.webp?v=4'); }
.shot.coach { background-image: url('screens/coach-light.webp?v=4'); }
.shot.records { background-image: url('screens/records-light.webp?v=4'); }
.shot.history { background-image: url('screens/history-light.webp?v=4'); }
.shot.workouts { background-image: url('screens/workouts-light.webp?v=4'); }
.shot.logger { background-image: url('screens/logger-light-2.webp'); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .shot.today { background-image: url('screens/today-dark.webp?v=4'); }
  :root:not([data-theme='light']) .shot.muscles { background-image: url('screens/muscles-dark.webp?v=4'); }
  :root:not([data-theme='light']) .shot.fuel { background-image: url('screens/fuel-dark.webp?v=4'); }
  :root:not([data-theme='light']) .shot.coach { background-image: url('screens/coach-dark.webp?v=4'); }
  :root:not([data-theme='light']) .shot.records { background-image: url('screens/records-dark.webp?v=4'); }
  :root:not([data-theme='light']) .shot.history { background-image: url('screens/history-dark.webp?v=4'); }
  :root:not([data-theme='light']) .shot.workouts { background-image: url('screens/workouts-dark.webp?v=4'); }
  :root:not([data-theme='light']) .shot.logger { background-image: url('screens/logger-dark-2.webp'); }
}
:root[data-theme='dark'] .shot.today { background-image: url('screens/today-dark.webp?v=4'); }
:root[data-theme='dark'] .shot.muscles { background-image: url('screens/muscles-dark.webp?v=4'); }
:root[data-theme='dark'] .shot.fuel { background-image: url('screens/fuel-dark.webp?v=4'); }
:root[data-theme='dark'] .shot.coach { background-image: url('screens/coach-dark.webp?v=4'); }
:root[data-theme='dark'] .shot.records { background-image: url('screens/records-dark.webp?v=4'); }
:root[data-theme='dark'] .shot.history { background-image: url('screens/history-dark.webp?v=4'); }
:root[data-theme='dark'] .shot.workouts { background-image: url('screens/workouts-dark.webp?v=4'); }
:root[data-theme='dark'] .shot.logger { background-image: url('screens/logger-dark-2.webp'); }

/* ---------------------------------------------------------------------
   HERO — the product leads. One headline, one line of prose, the app.
   --------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s-huge);
  align-items: center;
  padding: var(--s-huge) 0 var(--s-xxxl);
}
.hero h1 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.5px;
  color: var(--t1);
  margin: var(--s-md) 0 var(--s-lg);
  text-wrap: balance;
}
.hero .lede { max-width: 46ch; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  margin-top: var(--s-xxl);
  align-items: center;
}
.hero-note {
  margin-top: var(--s-md);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--t3);
}
.hero-phone { display: flex; justify-content: center; }

/* ---------------------------------------------------------------------
   SECTIONS
   --------------------------------------------------------------------- */
section { padding: var(--s-huge) 0; }
.section-head { margin-bottom: var(--s-xxl); }
.section-head h2 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.2px;
  color: var(--t1);
  margin: var(--s-sm) 0 0;
  text-wrap: balance;
}
.section-head p { margin: var(--s-sm) 0 0; max-width: 58ch; }

/* --- THE LOOP: goal → plan → log → adjust → prove ------------------- */
.loop {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.loop-step {
  padding: var(--s-lg) var(--s-lg) var(--s-lg) 0;
  border-left: 1px solid var(--border-sub);
  padding-left: var(--s-lg);
}
.loop-step:first-child { border-left: 0; padding-left: 0; }
.loop-step h3 {
  margin: var(--s-sm) 0 var(--s-xs);
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
}
.loop-step p { margin: 0; font-size: 13px; line-height: 18px; color: var(--t3); }

/* --- FEATURE ROWS: alternating, real screens ----------------------- */
.feat {
  display: grid;
  /* Explicit columns + explicit placement. An `auto` column gave the
     phone no intrinsic width, so `width:100%` resolved against zero and
     the whole visual collapsed on alternating rows. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: var(--s-huge);
  align-items: center;
  padding: var(--s-huge) 0;
  border-top: 1px solid var(--border-sub);
}
.feat-body { grid-column: 1; grid-row: 1; }
.feat-visual { grid-column: 2; grid-row: 1; display: flex; justify-content: center; }
.feat:nth-child(even) .feat-body { grid-column: 2; }
.feat:nth-child(even) .feat-visual { grid-column: 1; }
.feat h3 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(23px, 2.6vw, 30px);
  line-height: 1.12;
  color: var(--t1);
  margin: var(--s-sm) 0 var(--s-md);
  text-wrap: balance;
}
.feat p { margin: 0 0 var(--s-lg); max-width: 50ch; }
.feat-points { list-style: none; margin: 0; padding: 0; }
.feat-points li {
  position: relative;
  padding: var(--s-sm) 0 var(--s-sm) var(--s-xl);
  border-top: 1px solid var(--border-sub);
  font-size: 14px;
  line-height: 20px;
  color: var(--t2);
}
.feat-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15px;
  width: 10px;
  height: 1px;
  background: var(--t3);
}

/* --- the coach ledger card: the product thesis, as ruled rows ------- */
.ledger {
  border: 1px solid var(--border-sub);
  border-radius: var(--r-lg);
  background: var(--card);
  padding: var(--s-lg);
  max-width: 420px;
}
.ledger-row { padding: var(--s-md) 0; border-top: 1px solid var(--border-sub); }
.ledger-row:first-of-type { border-top: 0; padding-top: var(--s-sm); }
.ledger-row .k {
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  margin-bottom: var(--s-xs);
}
.ledger-row .k svg { width: 13px; height: 13px; color: var(--tip); flex: none; }
.ledger-row p { margin: 0; font-size: 14px; line-height: 20px; color: var(--t1); }
.ledger-row p em { font-style: normal; color: var(--t3); }

/* --- privacy: the label/value ledger grid --------------------------- */
.spec { max-width: 640px; }
.spec .lrow { border-top: 1px solid var(--border-sub); padding: var(--s-md) 0; }
.spec .lrow:first-child { border-top: 0; }
.spec .lrow > .mono:first-child { width: 148px; }
.spec .lrow p { margin: 0; font-size: 14px; line-height: 20px; color: var(--t1); }

/* --- beta signup ---------------------------------------------------- */
.join {
  border-top: 1px solid var(--border);
  padding-top: var(--s-xxxl);
}
.signup {
  display: flex;
  gap: var(--s-md);
  max-width: 520px;
  margin-top: var(--s-lg);
  flex-wrap: wrap;
}
.signup .field { flex: 1 1 260px; }
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.note { margin-top: var(--s-md); font-size: 13px; line-height: 18px; color: var(--t3); }
.note.err { color: var(--danger); }
.note.ok { color: var(--accent); }
#success { display: none; }
#success.on { display: block; }

/* --- doc pages (privacy/terms/support) ------------------------------ */
.doc { max-width: 720px; padding: var(--s-huge) 0; }
.doc h1 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
  color: var(--t1);
  margin: var(--s-sm) 0 var(--s-sm);
}
.doc h2 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.2px;
  color: var(--t1);
  margin: var(--s-xxxl) 0 var(--s-sm);
  padding-bottom: var(--s-sm);
  border-bottom: 1px solid var(--border);
}
.doc p, .doc li { color: var(--t2); font-size: 15px; line-height: 25px; }
.doc ul { margin: var(--s-md) 0; padding-left: var(--s-xl); }
.doc li { margin: var(--s-sm) 0; }
.doc strong { color: var(--t1); }
.doc table { width: 100%; border-collapse: collapse; margin: var(--s-lg) 0; font-size: 14px; }
.doc th, .doc td {
  text-align: left;
  padding: var(--s-sm) var(--s-md) var(--s-sm) 0;
  border-bottom: 1px solid var(--border-sub);
  color: var(--t2);
  vertical-align: top;
  line-height: 20px;
}
.doc th {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--t3);
}

/* --- changelog ------------------------------------------------------ */
.release { padding: var(--s-xxl) 0; border-top: 1px solid var(--border-sub); }
.release-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-md);
  margin-bottom: var(--s-md);
}
.release-head h2 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 26px;
  color: var(--t1);
  margin: 0;
}
.change { display: flex; gap: var(--s-md); padding: var(--s-sm) 0; align-items: baseline; }
.change .tag { width: 76px; flex: none; }
.change .tag.new { color: var(--accent); }
.change .tag.imp { color: var(--info); }
.change .tag.fix { color: var(--t3); }
.change p { margin: 0; font-size: 14px; line-height: 20px; color: var(--t1); }
.change .from {
  display: inline-block;
  margin-top: var(--s-xxs);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--t3);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.change .from:hover { color: var(--t1); }

/* --- a quiet, non-intrusive feedback line --------------------------- */
.nudge {
  margin-top: var(--s-huge);
  padding-top: var(--s-lg);
  border-top: 1px solid var(--border-sub);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  align-items: baseline;
}
.nudge a { font-family: var(--f-mono); font-size: 11px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--t3); text-decoration: none; }
.nudge a:hover { color: var(--t1); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--s-xxl); padding-top: var(--s-xxl); }
  .hero-phone { order: -1; }
  .phone { max-width: 260px; }
  .feat { grid-template-columns: minmax(0, 1fr); gap: var(--s-xxl); }
  .feat-body,
  .feat:nth-child(even) .feat-body { grid-column: 1; grid-row: 1; }
  .feat-visual,
  .feat:nth-child(even) .feat-visual { grid-column: 1; grid-row: 2; }
  .feat .phone, .feat .ledger { margin: 0 auto; }
  .loop { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .loop-step { border-left: 0; padding-left: 0; border-top: 1px solid var(--border-sub); }
  .loop-step:nth-child(-n + 2) { border-top: 0; }
}
@media (max-width: 560px) {
  section { padding: var(--s-xxxl) 0; }
  .loop { grid-template-columns: minmax(0, 1fr); }
  .loop-step:nth-child(2) { border-top: 1px solid var(--border-sub); }
  .signup { flex-direction: column; }
  /* `flex: 1 1 260px` measures along the MAIN axis, so the moment this
     column stacks, 260px stopped being the field's minimum width and
     became its height — a quarter-screen-tall email box on every phone.
     Down here the field just wants full width and its own height. */
  .signup .field { flex: 0 0 auto; width: 100%; }
  .signup .btn { width: 100%; }
  .lrow > .mono:first-child,
  .spec .lrow > .mono:first-child { width: 104px; }
}
