/* ═══════════════════════════════════════════════════════════
   SWELL — MARKETING SITE
   swellapp.co.uk

   This file owns LAYOUT ONLY. Every colour, radius, type size
   and gradient comes from tokens.css, which is a verified-
   identical copy of the app's src/styles/tokens.css. If a value
   exists there, it is never restated here.

   Run  node checks/tokens-sync.mjs  to prove the copy has not
   drifted from the app.
   ═══════════════════════════════════════════════════════════ */

@import url("/tokens.css");

/* ─── SPACING ────────────────────────────────────────────────
   tokens.css deliberately carries no spacing scale, so the site
   defines its own here. Nothing else may invent a step.       */
:root{
  --s1:4px;  --s2:8px;  --s3:12px; --s4:16px; --s5:24px;
  --s6:32px; --s7:48px; --s8:64px; --s9:96px; --s10:132px;

  --wrap:1120px;
  --sec-y:clamp(72px,10vw,var(--s10));
  --ease:cubic-bezier(.22,.61,.36,1);
}

/* ─── RESET ──────────────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
body{
  margin:0;
  background:var(--bg);
  color:var(--text-1);
  font-family:var(--font);
  font-size:var(--t-body);
  font-weight:var(--w-body);
  line-height:var(--lh-body);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img,svg{max-width:100%}
a{color:inherit}
h1,h2,h3,h4,p{margin:0}
button{font:inherit;color:inherit}

/* ─── TYPE ───────────────────────────────────────────────────
   HARD RULE: weight 200 only at 40px and up. Every clamp below
   that carries weight 200 has a floor of 40px for that reason —
   do not lower one without raising the weight.                */
.display{
  font-size:clamp(40px,8.4vw,var(--t-display));
  font-weight:var(--w-display);
  letter-spacing:var(--ls-display);
  line-height:1.02;
  /* Two short sentences at 76px break badly on width alone — the second
     clause starts on the tail of a line. Balance evens the ragged edge
     and keeps the break near the full stop. */
  text-wrap:balance;
}
.page-title{
  font-size:clamp(30px,5.2vw,var(--t-page));
  font-weight:var(--w-page);
  letter-spacing:var(--ls-page);
  line-height:1.1;
}
.section-title{
  font-size:clamp(24px,3.4vw,32px);
  font-weight:var(--w-page);
  letter-spacing:var(--ls-page);
  line-height:1.16;
}
.sub-title{
  font-size:var(--t-section);
  font-weight:var(--w-section);
  letter-spacing:-.01em;
  line-height:1.3;
}
.tile-label{font-size:var(--t-tile);font-weight:var(--w-tile);letter-spacing:-.01em}
.lead{
  font-size:clamp(17px,2vw,21px);
  font-weight:var(--w-body);
  line-height:1.5;
  color:var(--text-2);
}
.body{color:var(--text-2)}
.meta{font-size:var(--t-meta);font-weight:var(--w-meta);color:var(--text-3);line-height:1.5}

/* Micro label. 14px is the floor from the brief — chart furniture
   inside a tile is the only thing allowed to go under it.       */
.micro{
  font-size:var(--t-meta);
  font-weight:600;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--text-3);
  line-height:1.2;
}

/* ─── LAYOUT ─────────────────────────────────────────────── */
.wrap{width:100%;max-width:var(--wrap);margin-inline:auto;padding-inline:clamp(20px,4vw,var(--s6))}
.section{padding-block:var(--sec-y)}
.section + .section{padding-top:0}
.stack > * + *{margin-top:var(--s5)}
.measure{max-width:62ch}
.measure-tight{max-width:46ch}
.rule-top{border-top:1px solid var(--border);padding-top:var(--s6)}

.grid{display:grid;gap:var(--s5)}
.g-2{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
.g-3{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.g-4{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}

.skip{
  position:absolute;left:-9999px;top:var(--s4);z-index:100;
  background:var(--text-1);color:var(--bg);
  padding:var(--s3) var(--s5);border-radius:var(--r-full);
}
.skip:focus{left:var(--s4)}

:where(a,button,summary,[tabindex]):focus-visible{
  outline:2px solid var(--text-1);
  outline-offset:3px;
  border-radius:var(--r-xs);
}

/* ─── WORDMARK ───────────────────────────────────────────── */
.mark{
  font-size:26px;font-weight:700;letter-spacing:-.03em;
  text-decoration:none;line-height:1;display:inline-block;
}
.mark span{
  background:var(--g-meditation);
  -webkit-background-clip:text;background-clip:text;
  color:transparent;
}

/* ─── NAV ────────────────────────────────────────────────────
   The reference hid every link below 900px with no replacement,
   which left Method and Principles reachable only from the
   footer. The disclosure panel below is the fix.              */
.nav{
  position:sticky;top:0;z-index:50;
  background:color-mix(in srgb,var(--bg) 88%,transparent);
  -webkit-backdrop-filter:saturate(180%) blur(14px);
  backdrop-filter:saturate(180%) blur(14px);
  border-bottom:1px solid transparent;
  transition:border-color .25s var(--ease);
}
.nav.is-stuck{border-bottom-color:var(--border)}
.nav-in{display:flex;align-items:center;gap:var(--s5);min-height:72px}
.nav-links{display:flex;gap:var(--s6);margin-left:auto}
.nav-links a{
  text-decoration:none;font-size:var(--t-meta);font-weight:500;
  color:var(--text-2);transition:color .18s var(--ease);
}
.nav-links a:hover,.nav-links a[aria-current="page"]{color:var(--text-1)}
.nav-end{display:flex;align-items:center;gap:var(--s3);margin-left:auto}
.nav-links + .nav-end{margin-left:var(--s6)}

.icon-btn{
  display:grid;place-items:center;width:38px;height:38px;
  background:var(--surface-2);border:1px solid var(--border);
  border-radius:var(--r-full);cursor:pointer;
  transition:background .18s var(--ease);
}
.icon-btn:hover{background:var(--surface)}
.icon-btn svg{width:17px;height:17px;fill:none;stroke:var(--text-2);stroke-width:1.6;
  stroke-linecap:round;stroke-linejoin:round}
/* the icon names the destination: moon in light mode, sun in dark */
[data-theme="dark"] .moon{display:none}
:root:not([data-theme="dark"]) .sun{display:none}

.nav-toggle{display:none}
.nav-panel{display:none}

@media(max-width:900px){
  .nav-links{display:none}
  .nav-toggle{display:grid}
  .nav-panel{
    display:block;overflow:hidden;max-height:0;
    border-top:1px solid transparent;
    transition:max-height .3s var(--ease),border-color .3s var(--ease);
  }
  .nav-panel[data-open="true"]{max-height:340px;border-top-color:var(--border)}
  .nav-panel ul{list-style:none;margin:0;padding:var(--s4) 0 var(--s5)}
  .nav-panel a{
    display:block;padding:var(--s3) 0;text-decoration:none;
    font-size:18px;font-weight:500;color:var(--text-2);
  }
  .nav-panel a[aria-current="page"]{color:var(--text-1)}
}
@media(prefers-reduced-motion:reduce){.nav-panel{transition:none}}

/* ─── BUTTONS ────────────────────────────────────────────────
   Primary is the text colour itself, so the site never invents a
   brand colour that tokens.css does not carry.                */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:var(--s2);
  padding:12px var(--s5);border-radius:var(--r-full);
  border:1px solid var(--border-str);background:transparent;
  font-size:var(--t-meta);font-weight:500;text-decoration:none;
  color:var(--text-1);cursor:pointer;white-space:nowrap;
  transition:transform .18s var(--ease),background .18s var(--ease),border-color .18s var(--ease);
}
.btn:hover{background:var(--surface-2);transform:translateY(-1px)}
.btn--solid{background:var(--text-1);color:var(--bg);border-color:var(--text-1)}
.btn--solid:hover{background:var(--text-1);opacity:.88}
.btn--lg{padding:15px var(--s6);font-size:var(--t-body)}
.cta-row{display:flex;flex-wrap:wrap;gap:var(--s3)}
@media(prefers-reduced-motion:reduce){.btn:hover{transform:none}}

/* ─── SURFACES ───────────────────────────────────────────── */
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r-md);
  padding:clamp(var(--s5),3vw,var(--s6));
  box-shadow:var(--shadow);
}
.panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  padding:clamp(var(--s6),5vw,var(--s9)) clamp(var(--s5),4vw,var(--s8));
  box-shadow:var(--shadow);
}

/* ─── HERO ───────────────────────────────────────────────── */
.hero{position:relative;padding-block:clamp(var(--s8),11vw,var(--s10)) var(--sec-y);overflow:hidden}
/* max-width in ch must sit on the display element itself: `ch` resolves
   against the element's own font-size, so 20ch on this wrapper meant
   20 × 16px = 320px and broke the headline to one word per line. */
.hero-in{position:relative;z-index:1}
.hero .display{max-width:13ch}
.hero .lead{max-width:52ch;margin-top:var(--s6)}
.hero .cta-row{margin-top:var(--s7)}
.hero-wash{
  position:absolute;inset:auto -10% 0 auto;
  width:min(760px,80vw);aspect-ratio:1;
  background:var(--g-meditation);
  filter:blur(90px);opacity:.13;border-radius:var(--r-full);
  pointer-events:none;
}
[data-theme="dark"] .hero-wash{opacity:.24}

/* ─── THE JOIN ───────────────────────────────────────────── */
.join{display:grid;gap:var(--s6);align-items:start}
.join-quote{
  font-size:clamp(22px,3vw,30px);
  font-weight:var(--w-page);
  letter-spacing:-.02em;line-height:1.32;
}
.chips{display:flex;flex-wrap:wrap;gap:var(--s2);margin-top:var(--s5)}
.chip{
  display:inline-flex;align-items:center;gap:var(--s2);
  padding:7px var(--s3);border-radius:var(--r-xs);
  background:var(--surface-2);border:1px solid var(--border);
  font-size:var(--t-meta);font-weight:500;color:var(--text-2);
}
.chip i{width:9px;height:9px;border-radius:2px;flex:none}

/* ─── SUB-AREA TILES ─────────────────────────────────────────
   Ported verbatim from swell-tiles.html. Every tile is a 300×300
   viewBox on the skeleton in BUILD-BRIEF §5: header 32, number
   80, sub-line 98, viz band 114–222, hairline 248, context 272.
   checks/geometry.mjs asserts it and runs over this file's
   rendered output, not over the source.                       */
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--s3)}
@media(max-width:900px){.tiles{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.tiles{grid-template-columns:1fr}}

.tile-fig{margin:0}
.tile{border-radius:var(--r-md);overflow:hidden;line-height:0;box-shadow:var(--shadow)}
.tile svg{display:block;width:100%;height:auto;font-family:var(--font)}

/* tile internals — scoped so no other SVG on the site inherits */
.tile svg text{fill:#fff}
.tile .lbl{font-size:12px;font-weight:600;letter-spacing:.11em;opacity:.74}
.tile .tag{font-size:11px;font-weight:600;letter-spacing:.055em;opacity:.64}
.tile .big{font-size:42px;font-weight:300;letter-spacing:-.035em;font-variant-numeric:tabular-nums}
.tile .unit{font-size:12px;font-weight:600;letter-spacing:.06em;opacity:.66}
.tile .sml{font-size:10px;font-weight:600;letter-spacing:.045em;opacity:.72}
.tile .ctx{font-size:12.5px;font-weight:500;opacity:.8}
.tile .tick{font-size:9px;font-weight:600;letter-spacing:.08em;opacity:.5}
.tile .val{font-size:9.5px;font-weight:600;letter-spacing:.03em;opacity:.74}
.tile .cal{font-size:10px;font-weight:700;letter-spacing:.02em}
.tile .rule{stroke:rgba(255,255,255,.14);stroke-width:1}
.tile .grid-l{stroke:rgba(255,255,255,.10);stroke-width:1}

@keyframes tw{0%,100%{opacity:.12}50%{opacity:.72}}
.tile .star{animation:tw 5s ease-in-out infinite}
@keyframes sh1{0%,1%{opacity:0}2%{opacity:.95}5%{opacity:.95}7%,100%{opacity:0}}
.tile .sh{animation-name:sh1;animation-timing-function:linear;animation-iteration-count:infinite}
@media(prefers-reduced-motion:reduce){
  .tile .star{animation:none}
  .tile .sh{display:none}
}

.legend{display:flex;flex-wrap:wrap;gap:var(--s5);margin-top:var(--s6)}
.legend span{display:flex;align-items:center;gap:var(--s2);font-size:var(--t-meta);color:var(--text-2)}
.legend i{width:11px;height:11px;border-radius:3px;flex:none}
.legend i.prior{
  /* --prior is white at 32%, meant to be seen over a dark tile. Split
     into colour + image: in the `background` shorthand a var() colour
     in a non-final layer parses as an image and resolves to none. */
  background-color:var(--text-2);
  background-image:linear-gradient(var(--prior),var(--prior));
}

/* ─── PILLAR HEAD ────────────────────────────────────────── */
.pillar-head{
  display:flex;align-items:baseline;gap:var(--s4);flex-wrap:wrap;
  margin:var(--s8) 0 var(--s5);padding-top:var(--s5);
  border-top:1px solid var(--border);
}
.pillar-head .sub-title{letter-spacing:-.01em}

/* ─── NUMBERED STEPS ─────────────────────────────────────── */
.steps{counter-reset:step;display:grid;gap:var(--s5)}
.step{counter-increment:step;position:relative;padding-top:var(--s5);border-top:1px solid var(--border)}
.step::before{
  content:counter(step,decimal-leading-zero);
  display:block;margin-bottom:var(--s4);
  font-size:var(--t-meta);font-weight:600;letter-spacing:.12em;color:var(--text-3);
}
.step h3{margin-bottom:var(--s3)}

/* ─── RULES LIST ─────────────────────────────────────────── */
.rules{display:grid;gap:var(--s5)}
.rule-item{padding-top:var(--s5);border-top:1px solid var(--border)}
.rule-item h3{margin-bottom:var(--s3)}

/* ─── FAQ ────────────────────────────────────────────────── */
.faq{border-top:1px solid var(--border)}
.faq details{border-bottom:1px solid var(--border)}
.faq summary{
  display:flex;align-items:center;gap:var(--s4);
  padding:var(--s5) 0;cursor:pointer;list-style:none;
  font-size:clamp(17px,2vw,var(--t-section));font-weight:var(--w-section);
}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{
  content:"";margin-left:auto;flex:none;width:11px;height:11px;
  border-right:1.5px solid var(--text-3);border-bottom:1.5px solid var(--text-3);
  transform:rotate(45deg) translate(-2px,-2px);
  transition:transform .22s var(--ease);
}
.faq details[open] summary::after{transform:rotate(-135deg) translate(-2px,-2px)}
.faq .answer{padding-bottom:var(--s5);max-width:70ch}
@media(prefers-reduced-motion:reduce){.faq summary::after{transition:none}}

/* ─── BAND (closing CTA) ─────────────────────────────────────
   White text on a token gradient, dark stop top-left. The old
   band ran a pale gradient at 1.60:1 and was illegible.       */
/* Content is LEFT-aligned on purpose. At 135° the light stop sits
   bottom-right, so centred text drifts onto it — measured 3.16:1 for
   white, below AA. Keeping copy in the left column holds it in the
   dark half of the gradient (measured 12.5:1 and 4.9:1). This is the
   same reasoning as §5 putting the tile label and number top-left. */
.band{
  border-radius:var(--r-lg);
  padding:clamp(var(--s7),7vw,var(--s9)) clamp(var(--s5),5vw,var(--s8));
  background:var(--g-meditation);
  color:#fff;
}
.band > *{max-width:52ch}
.band .lead,.band .micro{color:rgba(255,255,255,.78)}
.band .btn{border-color:rgba(255,255,255,.4);color:#fff}
.band .btn:hover{background:rgba(255,255,255,.14)}
/* literal-ok: the band is a fixed-dark surface in BOTH themes, so its
   ink cannot follow --text-1 (which inverts). #111113 is the light-theme
   value of --text-1, pinned deliberately. checks/tokens-usage.mjs
   requires this marker for any literal that duplicates a token. */
.band .btn--solid{background:#fff;color:#111113;border-color:#fff}
.band .btn--solid:hover{background:#fff;opacity:.9}

/* ─── LEGAL / PROSE PAGES ────────────────────────────────── */
.prose{max-width:72ch}
.prose h2{margin:var(--s8) 0 var(--s4);font-size:var(--t-section);font-weight:var(--w-section)}
.prose h3{margin:var(--s6) 0 var(--s3);font-size:18px;font-weight:500}
.prose p,.prose li{color:var(--text-2)}
.prose p + p{margin-top:var(--s4)}
.prose ul,.prose ol{margin:var(--s4) 0;padding-left:var(--s5)}
.prose li + li{margin-top:var(--s2)}
.prose a{color:var(--text-1);text-underline-offset:3px}
.prose table{width:100%;border-collapse:collapse;margin:var(--s5) 0;font-size:var(--t-meta)}
.prose th{
  text-align:left;padding:0 var(--s4) var(--s3) 0;
  border-bottom:1px solid var(--border-str);
  font-size:var(--t-meta);font-weight:600;letter-spacing:.1em;
  text-transform:uppercase;color:var(--text-3);
}
.prose td{padding:var(--s3) var(--s4) var(--s3) 0;border-bottom:1px solid var(--border);color:var(--text-2);vertical-align:top}
.prose td:first-child{color:var(--text-1);font-weight:500}
.todo{
  display:inline-block;padding:2px var(--s2);border-radius:var(--r-xs);
  background:var(--surface-2);border:1px solid var(--border-str);
  font-size:var(--t-meta);font-weight:600;color:var(--text-3);
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.foot{border-top:1px solid var(--border);padding-block:var(--s8) var(--s7);margin-top:var(--sec-y)}
.foot-grid{display:grid;gap:var(--s6);grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
.foot-col{display:flex;flex-direction:column;gap:var(--s3);align-items:flex-start}
.foot-col a{
  text-decoration:none;font-size:var(--t-meta);color:var(--text-2);
  transition:color .18s var(--ease);
}
.foot-col a:hover{color:var(--text-1)}
.foot-base{
  display:flex;flex-wrap:wrap;gap:var(--s4);justify-content:space-between;
  margin-top:var(--s8);padding-top:var(--s5);border-top:1px solid var(--border);
}
.foot-base span{font-size:var(--t-meta);color:var(--text-3)}

/* ─── REVEAL ─────────────────────────────────────────────── */
/* Scoped to .js — the inline head script adds that class. With
   JavaScript off the rule never applies, so the page renders fully
   visible instead of blank. Never write `.rv{opacity:0}` unscoped. */
.js .rv{opacity:0;transform:translateY(14px);transition:opacity .6s var(--ease),transform .6s var(--ease)}
.js .rv.is-in{opacity:1;transform:none}
.rv-d1{transition-delay:.07s}
.rv-d2{transition-delay:.14s}
.rv-d3{transition-delay:.21s}
@media(prefers-reduced-motion:reduce){
  .js .rv{opacity:1;transform:none;transition:none}
}

/* ─── PROSE EXTRAS (legal pages) ─────────────────────────── */
.updated{font-size:var(--t-meta);color:var(--text-3);margin-bottom:var(--s6)}
.callout{
  background:var(--surface);border:1px solid var(--border);
  border-left:3px solid var(--warn);
  border-radius:var(--r-md);padding:var(--s5) var(--s6);margin:var(--s6) 0;
  box-shadow:var(--shadow);
}
.callout p{color:var(--text-2)}
.callout p + p{margin-top:var(--s3)}
.phead{padding-block:clamp(var(--s8),9vw,var(--s9)) var(--s6)}

/* ═══════════════════════════════════════════════════════════
   HERO — two columns: copy left, the replica right
   ═══════════════════════════════════════════════════════════ */
.hero-in{display:grid;gap:clamp(var(--s7),6vw,var(--s9));align-items:center}
@media(min-width:960px){
  .hero-in{grid-template-columns:minmax(0,1fr) minmax(0,1.05fr)}
}
.hero-copy .lead{max-width:46ch;margin-top:var(--s6)}
.hero-copy .cta-row{margin-top:var(--s7)}
.hero-demo{min-width:0}
.demo-cap{margin-top:var(--s4);display:flex;gap:var(--s3);align-items:flex-start;max-width:46ch}

/* ═══════════════════════════════════════════════════════════
   THE REPLICA — SITE-BRIEF §1
   A stripped-down mock of the Swell home screen with hard-coded
   data, built from the app's REAL tile SVGs. Never the live app.

   This is the static beat-8 frame: the insight present and the
   connection drawn. §1 requires that exact frame as the
   reduced-motion and no-JavaScript fallback, so it is what the
   static site ships and what the timeline will later animate to.

   Radii follow the §6 component inventory exactly — area panel
   --r-lg, metric tile --r-md, habit/insight row --r-sm, entry bar
   and badges --r-full — so the mock is dimensionally the product.
   ═══════════════════════════════════════════════════════════ */
.replica{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r-lg);              /* area panel */
  padding:clamp(var(--s4),2.4vw,var(--s5));
  box-shadow:var(--shadow);
  display:flex;flex-direction:column;gap:var(--s4);
  max-width:520px;
}
.rep-top{display:flex;align-items:center;justify-content:space-between;gap:var(--s4)}
.rep-mark{font-size:17px;font-weight:700;letter-spacing:-.03em;line-height:1}
.rep-mark span{
  background:var(--g-meditation);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
.rep-streak{                               /* streak badge */
  padding:5px var(--s3);border-radius:var(--r-full);
  background:var(--surface-2);border:1px solid var(--border);
  font-size:var(--t-meta);font-weight:500;color:var(--text-2);line-height:1.2;
}

/* The insight. Everything else in the mock is texture; this has to
   stay readable at every width, so it never drops below --t-body. */
.rep-insight{
  border-radius:var(--r-sm);              /* insight row */
  background:var(--surface-2);
  border:1px solid var(--border);
  padding:var(--s4) var(--s5);
}
.rep-sentence{
  font-size:var(--t-body);font-weight:var(--w-body);
  line-height:1.45;color:var(--text-1);
}
.rep-chips{display:flex;flex-wrap:wrap;gap:var(--s2);margin-top:var(--s3)}
.rep-chip{
  display:inline-flex;align-items:center;gap:6px;
  padding:3px var(--s2);border-radius:var(--r-xs);   /* stat pill */
  background:var(--surface);border:1px solid var(--border);
  font-size:var(--t-meta);color:var(--text-2);line-height:1.3;
}
.rep-chip i{width:8px;height:8px;border-radius:2px;flex:none}

.rep-grid{
  position:relative;
  display:grid;grid-template-columns:1fr 1fr;gap:var(--s3);
}
/* .tile carries the radius, the clip and ALL the text styling; this
   only adds what the replica needs on top. Never restate a .tile rule
   here — that is how the hero ended up with a second implementation. */
.rep-tile{box-shadow:none}

/* Beat 7 — the connection. Sits above the tiles, ignores pointers.
   preserveAspectRatio="none" stretches the viewBox to the grid, and
   vector-effect keeps the stroke a true 1.6px at any size. */
.rep-link{
  position:absolute;inset:0;width:100%;height:100%;
  pointer-events:none;overflow:visible;
}

.rep-habit{                                /* habit row */
  display:flex;align-items:center;justify-content:space-between;gap:var(--s4);
  border-radius:var(--r-sm);
  background:var(--surface-2);border:1px solid var(--border);
  padding:var(--s3) var(--s4);
}
.rep-habit-title{font-size:var(--t-meta);font-weight:500;color:var(--text-1);line-height:1.3}
.rep-habit-sub{font-size:var(--t-meta);color:var(--text-3);line-height:1.3;margin-top:2px}
.rep-habit-btns{display:flex;gap:var(--s2);flex:none}
.rep-btn{                                  /* pill button */
  padding:5px var(--s3);border-radius:var(--r-full);
  border:1px solid var(--border-str);
  font-size:var(--t-meta);font-weight:500;color:var(--text-2);line-height:1.3;
  white-space:nowrap;
}
.rep-btn--go{background:var(--text-1);color:var(--bg);border-color:var(--text-1)}

.rep-entry{                                /* entry bar */
  border-radius:var(--r-full);
  background:var(--surface-2);border:1px solid var(--border);
  padding:var(--s3) var(--s5);
  font-size:var(--t-meta);color:var(--text-3);
}

@media(max-width:520px){
  .rep-habit{flex-direction:column;align-items:flex-start;gap:var(--s3)}
}

/* ═══════════════════════════════════════════════════════════
   SECTION 2 — insight rows, styled as the app's own
   ═══════════════════════════════════════════════════════════ */
.insight-rows{align-items:stretch}
.insight-row{
  border-radius:var(--r-sm);              /* insight row */
  background:var(--surface);
  border:1px solid var(--border);
  padding:var(--s5);
  box-shadow:var(--shadow);
  display:flex;flex-direction:column;gap:var(--s3);
}
.insight-pair{
  display:flex;align-items:center;gap:var(--s2);
  font-size:var(--t-meta);font-weight:500;
  letter-spacing:.06em;text-transform:uppercase;color:var(--text-3);
}
.insight-pair i{width:10px;height:10px;border-radius:3px;flex:none}
.insight-pair i + i{margin-left:-4px}
.insight-text{font-size:var(--t-body);line-height:1.5;color:var(--text-1)}


/* ═══════════════════════════════════════════════════════════
   PILLAR CAROUSEL

   One track, three slides — Health, Money, Mind. Each slide holds
   the three-per-row grid of six tiles that SITE-BRIEF §2 asks for;
   the carousel moves BETWEEN pillars, not between tiles.

   Built on native horizontal scroll, deliberately. §5 requires the
   site to read completely with JavaScript disabled, and a track
   that is a real scroll container satisfies that by construction:
   with no JS all three pillars are still reachable by scroll and
   swipe. The toggle and arrows are enhancement gated behind .js, so
   they never appear as dead controls.
   ═══════════════════════════════════════════════════════════ */
.carousel{margin-top:var(--s7)}
.car-bar{
  display:flex;align-items:center;justify-content:space-between;
  gap:var(--s5);flex-wrap:wrap;margin-bottom:var(--s6);
}

/* Segmented toggle — the app's own component, --r-full (§6). */
.car-tabs{display:none;background:var(--surface-2);border:1px solid var(--border);
  border-radius:var(--r-full);padding:4px}
.js .car-tabs{display:inline-flex}
.car-tab{
  font-family:inherit;font-size:var(--t-meta);font-weight:500;
  color:var(--text-2);background:none;border:0;cursor:pointer;
  padding:9px 20px;border-radius:var(--r-full);
  transition:color .2s var(--ease),background .2s var(--ease);
}
.car-tab:hover{color:var(--text-1)}
.car-tab[aria-current="true"]{background:var(--surface);color:var(--text-1);box-shadow:var(--shadow)}
@media(prefers-reduced-motion:reduce){.car-tab{transition:none}}

.car-track{
  display:flex;gap:var(--s7);
  overflow-x:auto;overscroll-behavior-x:contain;
  scroll-snap-type:x mandatory;
  scrollbar-width:none;
}
.car-track::-webkit-scrollbar{display:none}
.car-track > .pillar-slide{flex:0 0 100%;min-width:0;scroll-snap-align:start}
/* Focusable so the track can be scrolled from the keyboard — a scroll
   container full of non-focusable content is otherwise pointer-only. */
.car-track:focus-visible{outline:2px solid var(--text-1);outline-offset:4px;border-radius:var(--r-sm)}

/* The slide's own title, needed only when the toggle is absent. With
   JavaScript on, the segmented control already names the active pillar
   and a panel that repeats its own title reads as a mistake; the slide
   keeps aria-label="Health" either way, so nothing is lost to a screen
   reader. */
.pillar-cap{margin-bottom:var(--s4)}
.js .pillar-cap{display:none}

/* ─── WORKED EXAMPLE ─────────────────────────────────────── */
.worked{width:100%;border-collapse:collapse;margin-top:var(--s4);font-size:var(--t-meta)}
.worked td{padding:var(--s3) 0;border-bottom:1px solid var(--border);color:var(--text-2)}
.worked tr:last-child td{border-bottom:0}
.worked td:last-child{text-align:right;color:var(--text-1);font-variant-numeric:tabular-nums}

/* Four stages want 2×2, not the auto-fit 3-up that leaves an orphan
   on the second row. Principles keeps auto-fit because six divides. */
.stages{grid-template-columns:1fr}
@media(min-width:760px){.stages{grid-template-columns:1fr 1fr}}
