/* curvetta.app. The layout follows circloop.app (same sections, same spacing,
   same header and footer); the colours come from the app: Shared/Palette.swift
   and docs/kickoff.html in the Curvetta repo. One teal, a calm wash, the muted
   green and amber of the phrases (never red), the group colours only in their
   circles. Familjen Grotesk for headings, Instrument Sans for text, and the
   system's rounded face for numbers, as in the app. */
:root {
  color-scheme: light;
  --accent: #0F6E6A;            /* 5.5:1 on --bg */
  --accent-hover: #0B524F;
  --head: #0B1312;
  --ink: #15201F;
  --muted: #4F5E5B;             /* 6.2:1 on --bg */
  --bg: #F1F4F3;                /* never pure white (Repetta, 7 Nov 2026) */
  --card: #FAFCFB;
  --line: #D6DFDC;
  --wash: #D6EFE8;              /* Palette.wash */
  --wash-soft: #E3F1EC;
  --on-wash: #34504A;
  --band: #D9E6E1;              /* the usual range, Palette.band */
  --tag-bg: #DCEDEA;
  --tag-ink: #0B524F;
  --fav: #2A7047;               /* Palette.favorable */
  --fav-bg: #DCEFE3;
  --unfav: #8B5916;             /* Palette.unfavorable, never red */
  --unfav-bg: #F3E6D3;
  --neutral-ink: #4F5E5B;
  --neutral-bg: #E3E9E7;
  --symptom: #6B5B95;           /* Palette.symptom */
  --pill-arrow-ink: #FFFFFF;
  --deep: #0E2E2B;              /* the calm band */
  --deep-ink: #DCEBE7;
  --deep-accent: #5CC2B7;
  --btn-bg: #0B1312;            /* the app's black pill (Palette.button) */
  --btn-ink: #FFFFFF;
  --btn-bg-hover: #26322F;
  --hover-bg: #E3F1EC;
  /* The drawn iPhone: iOS's grouped list. */
  --phone-bg: #F2F2F7;
  --phone-card: #FFFFFF;
  --phone-ink: #101314;
  --phone-ink-2: #6B7270;
  --phone-sep: #E2E5E4;
  --frame: #1B1F20;
  --frame-edge: rgba(11, 19, 18, 0.16);
  --shadow: 0 28px 60px -24px rgba(8, 40, 36, 0.38);
  /* Group circles: the light-mode colours in both themes, under a white glyph. */
  --g-heart: #C8456A;
  --g-sleep: #5A63D6;
  --g-fitness: #B35A14;
  --g-training: #0F7F78;
  --rounded: ui-rounded, "SF Pro Rounded", "Familjen Grotesk", system-ui, sans-serif;
  --display: "Familjen Grotesk", "Avenir Next", "Helvetica Neue", sans-serif;
  --text: "Instrument Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.01em; color: var(--head); }
p { margin: 0; }

.wrap { max-width: 1164px; margin: 0 auto; padding-left: 22px; padding-right: 22px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--head); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--bg); }

.eyebrow {
  color: var(--accent); font-weight: 700; font-size: 13.5px;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px;
}
.section-h {
  font-size: clamp(31px, 4.2vw, 50px); font-weight: 700; line-height: 1.04;
  letter-spacing: -0.028em; text-wrap: balance;
}
.section-sub { color: var(--muted); font-size: 19px; margin-top: 16px; max-width: 560px; }
.tag {
  display: inline-block; vertical-align: 2px; margin-left: 6px;
  background: var(--tag-bg); color: var(--tag-ink); border-radius: 999px;
  padding: 2px 9px; font: 700 12px/1.5 var(--text); letter-spacing: 0.01em;
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; }

/* ---------- Nav ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { flex: none; border-radius: 22.5%; box-shadow: 0 0 0 1px var(--frame-edge); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 25px; letter-spacing: -0.025em; color: var(--head); }
.brand-name-sm { font-size: 20px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.navlink { color: var(--ink); font-weight: 500; font-size: 16px; }
.navlink:hover { color: var(--accent); }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--btn-bg); color: var(--btn-ink); border-radius: 999px;
  padding: 15px 28px; font-weight: 600; font-size: 17px;
}
.btn-primary:hover { background: var(--btn-bg-hover); color: var(--btn-ink); }
.btn-nav { padding: 11px 22px; font-size: 15px; white-space: nowrap; }

/* The App Store spot before launch: a status, not a button. */
.store-soon {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--head); color: var(--head); border-radius: 999px;
  padding: 12px 22px; font-weight: 600; font-size: 16px;
}
.store-soon::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

/* ---------- Rows and phrases ----------
   One component everywhere a number appears: the drawn iPhone, the widget,
   the cards and the coming-soon page. Sized in em, so each place sets one
   font-size; coloured by --r-ink and --r-ink-2. */
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6em; align-items: center;
  padding: 0.6em 0.85em; color: var(--r-ink, var(--ink));
}
.row-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.12em; min-width: 0; }
.row-name { display: block; font-size: 0.8em; color: var(--r-ink-2, var(--muted)); }
.row-value, .d-value, .w-value, .try-value, .t-value, .watch-value, .lock-value {
  font-family: var(--rounded); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1.12;
}
.row-value { display: block; font-size: 1.36em; margin-bottom: 0.12em; }
.row-value small, .d-value small, .w-value small, .try-value small, .t-value small, .watch-value small, .lock-value small {
  font-size: 0.56em; font-weight: 600; color: var(--r-ink-2, var(--muted)); margin-left: 0.14em; letter-spacing: 0;
}
.pill {
  display: inline-flex; align-items: center; gap: 0.42em; max-width: 100%;
  padding: 0.26em 0.75em 0.26em 0.28em; border-radius: 999px;
  background: var(--neutral-bg); color: var(--neutral-ink);
  font: 600 0.74em/1.25 var(--system); white-space: nowrap;
}
.pill-fav { background: var(--fav-bg); color: var(--fav); }
.pill-unfav { background: var(--unfav-bg); color: var(--unfav); }
.pill-arrow { flex: none; width: 1.5em; height: 1.5em; border-radius: 50%; background: currentColor; display: grid; place-items: center; }
.arrow { width: 1em; height: 1em; fill: none; stroke: var(--pill-arrow-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.spark { display: block; width: 6em; height: 2.5em; overflow: visible; }

/* Group circles, as the app's group titles. */
.grp-dot { flex: none; width: 1.55em; height: 1.55em; border-radius: 50%; display: inline-grid; place-items: center; }
.grp-dot svg { width: 0.95em; height: 0.95em; }
.grp-heart { background: var(--g-heart); }
.grp-sleep { background: var(--g-sleep); }
.grp-fitness { background: var(--g-fitness); }
.grp-training { background: var(--g-training); }

/* ---------- Charts ---------- */
.chart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--text); }
.c-band { fill: var(--band); }
.c-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.c-label { fill: var(--muted); font-size: 13px; font-weight: 500; }
.chart:not(.chart-try) .c-label { font-size: 14px; }
.c-dots circle { fill: var(--muted); opacity: 0.38; }
.c-area { fill: var(--accent); opacity: 0.09; }
.c-line { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.spark .c-line { stroke-width: 2.2; }
.c-end { fill: var(--accent); }
.c-end-ring { fill: var(--card); }
.c-recent { fill: var(--accent); opacity: 0.07; }
.c-recent-label { fill: var(--accent); font-size: 13px; font-weight: 700; }
.c-symptom { fill: var(--symptom); opacity: 0.28; }
.c-symptom-label { fill: var(--symptom); font-size: 14px; font-weight: 700; }
.c-marker { stroke: var(--head); stroke-width: 1.6; stroke-dasharray: 3 3; }
.c-marker-label { fill: var(--head); font-size: 14px; font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .is-drawing .c-line:not(.spark .c-line) { stroke-dasharray: 1; animation: draw 0.9s cubic-bezier(0.55, 0, 0.25, 1) both; }
  .is-drawing .c-area, .is-drawing .c-dots { animation: fade 0.6s ease 0.25s both; }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- The drawn iPhone ----------
   Sized in cqi (1% of the phone's width), so it scales as one picture. */
.phone {
  container-type: inline-size; position: relative;
  background: var(--frame); border-radius: 15.5% / 7.4%;
  box-shadow: var(--shadow), 0 0 0 1px var(--frame-edge);
}
/* Container units resolve against the nearest container above, so the
   bezel is the screen's margin rather than the phone's padding. */
.screen {
  --r-ink: var(--phone-ink); --r-ink-2: var(--phone-ink-2);
  position: relative; margin: 3.2cqi; aspect-ratio: 9 / 19.2; overflow: hidden; border-radius: 12.4cqi;
  background: var(--phone-bg); color: var(--phone-ink);
  font-family: var(--system); font-size: 5.3cqi; line-height: 1.25;
}
.screen::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16cqi;
  background: linear-gradient(to bottom, transparent, var(--phone-bg)); pointer-events: none;
}
.island { position: absolute; top: 3.2cqi; left: 50%; transform: translateX(-50%); width: 30cqi; height: 8.6cqi; border-radius: 99px; background: #000; z-index: 2; }
.status { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 4.4cqi 8.5cqi 0; font-size: 0.86em; font-weight: 600; }
.status-icons { display: inline-flex; gap: 1.2cqi; align-items: center; }
.status-icons i { display: block; height: 2.6cqi; border-radius: 0.8cqi; background: currentColor; }
.status-icons i:nth-child(1) { width: 4.4cqi; opacity: 0.9; }
.status-icons i:nth-child(2) { width: 3.6cqi; opacity: 0.9; }
.status-icons i:nth-child(3) { width: 6.6cqi; height: 3.2cqi; background: none; border: 0.5cqi solid currentColor; }
.wash { padding: 5.5cqi 5.5cqi 3.4cqi; background: linear-gradient(to bottom, var(--wash) 0%, var(--wash) 62%, var(--phone-bg) 100%); }
.wash small { display: block; font-size: 0.74em; font-weight: 600; color: var(--on-wash); text-transform: uppercase; letter-spacing: 0.02em; }
.wash strong { display: block; font-family: var(--rounded); font-size: 1.95em; font-weight: 800; letter-spacing: -0.01em; margin-top: 0.08em; }
.seg {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: rgba(118, 118, 128, 0.14); border-radius: 0.65em; padding: 0.16em;
  font-size: 0.76em; font-weight: 600; text-align: center; margin-top: 0.75em;
}
.seg span { padding: 0.36em 0; border-radius: 0.52em; color: var(--r-ink-2, var(--muted)); white-space: nowrap; }
.seg .on { background: var(--phone-card); color: var(--phone-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }
.grp-h { display: flex; align-items: center; gap: 0.5em; font-weight: 700; font-size: 0.96em; padding: 0.95em 5.5cqi 0.45em; }
.screen .grp-h { font-family: var(--rounded); }
.grp { margin: 0 4cqi; background: var(--phone-card); border-radius: 1em; overflow: hidden; }
.grp .row + .row { border-top: 1px solid var(--phone-sep); }
.screen .spark { width: 5.6em; }

/* ---------- Widgets ---------- */
.widget {
  --r-ink-2: var(--on-wash);
  background: linear-gradient(to bottom, var(--wash), var(--card) 78%);
  border-radius: 1.6em; padding: 1.25em 1.25em 1.1em; box-shadow: var(--shadow), 0 0 0 1px var(--frame-edge);
  font-family: var(--system); font-size: 14px; color: var(--ink);
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.35em;
}
.w-head { display: flex; align-items: center; gap: 0.45em; font-size: 0.84em; font-weight: 600; }
.w-head .grp-dot { font-size: 0.9em; }
.w-value { font-size: 2.15em; margin-top: 0.1em; }
.widget .pill { font-size: 0.74em; white-space: normal; }
.widget .spark { width: 100%; height: auto; margin-top: 0.35em; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 40px; align-items: center;
  padding-top: 40px; padding-bottom: 104px; overflow-x: clip;
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--tag-bg); color: var(--tag-ink); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; font-weight: 600;
}
h1 { font-size: clamp(44px, 5.6vw, 76px); line-height: 0.98; font-weight: 700; letter-spacing: -0.038em; text-wrap: balance; }
.hero-sub { font-size: 21px; color: var(--muted); max-width: 500px; }
.hero-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 6px; }
.cta-note { font-size: 14px; color: var(--muted); }

.hero-art { position: relative; width: 100%; max-width: 520px; aspect-ratio: 520 / 600; justify-self: end; container-type: inline-size; }
.hero-art .phone { position: absolute; left: 6%; top: 0; width: 56%; }
.hero-widget { position: absolute; right: 0; bottom: 4%; width: 40%; font-size: 2.75cqi; }
.motif { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.motif-band { fill: var(--wash); }
.motif-curve { fill: none; stroke: var(--accent); stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; }
.motif-dot { fill: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .motif-curve { stroke-dasharray: 1; animation: draw 2.4s cubic-bezier(0.55, 0, 0.25, 1) 0.2s both; }
  .motif-dot { transform-box: fill-box; transform-origin: center; animation: pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) 2.45s both; }
}
@keyframes pop { from { opacity: 0; transform: scale(0.2); } }

/* ---------- How to read it ---------- */
.how { padding-top: 24px; padding-bottom: 112px; }
.anatomy { margin-top: 44px; max-width: 600px; }
.anatomy .row {
  font-size: clamp(17px, 3.4vw, 24px); background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; padding: 0.8em 1.1em; box-shadow: var(--shadow);
}
.anatomy .spark { width: 5.5em; height: 2.25em; }
.tick {
  display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; margin-right: 0.45em; vertical-align: 0.3em;
  border-radius: 50%; border: 2px solid var(--accent); color: var(--accent);
  font: 700 11px/1 var(--text); letter-spacing: 0;
}
.anat-pill { display: inline-flex; align-items: center; }
.anat-pill .tick { vertical-align: 0; }
.anat-spark { position: relative; }
.anat-spark .tick { position: absolute; top: -0.5rem; left: -0.4rem; background: var(--card); z-index: 1; margin: 0; }
.steps {
  list-style: none; margin: 48px 0 0; padding: 0; position: relative;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px;
}
/* A dotted line from one step to the next, drawn as it scrolls into view where supported. */
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 25px; left: 64px; width: calc(100% + 40px - 76px);
  height: 3px; border-radius: 3px; transform-origin: left;
  background: repeating-linear-gradient(90deg, var(--accent) 0 3px, transparent 3px 10px);
  opacity: 0.6;
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .step:not(:last-child)::after { animation: grow-x linear both; animation-timeline: view(); animation-range: entry 40% cover 55%; }
  }
}
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); } }
.step { position: relative; display: flex; flex-direction: column; gap: 10px; }
.step-dot {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); color: var(--accent); border: 3px solid var(--accent); margin-bottom: 10px;
  font: 700 21px/1 var(--display);
}
.step h3 { font-size: 25px; font-weight: 700; }
.step p { color: var(--muted); max-width: 330px; }

/* ---------- Try it ---------- */
.try-band { background: var(--wash-soft); padding: 104px 0; }
.try { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 56px; align-items: center; }
.try-controls { margin-top: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
[data-try]:not(.is-live) .try-controls { display: none; }
.chips, .segment { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips label, .segment label { position: relative; }
.chips input, .segment input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span {
  display: inline-block; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
}
.chips input:checked + span { background: var(--head); border-color: var(--head); color: var(--bg); }
.segment { gap: 0; background: rgba(118, 118, 128, 0.14); border-radius: 12px; padding: 3px; }
.segment span { display: inline-block; padding: 7px 16px; border-radius: 9px; font-weight: 600; font-size: 15px; color: var(--muted); }
.segment input:checked + span { background: var(--card); color: var(--head); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }
.chips input:focus-visible + span, .segment input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.try-unl { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.try-unl .icon { color: var(--accent); flex: none; }
.try-note { margin-top: 24px; font-size: 13.5px; color: var(--muted); }
.try-card { padding: 26px 26px 22px; box-shadow: var(--shadow); }
.try-head { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.try-head .row-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.try-value { font-size: clamp(38px, 4.6vw, 52px); }
.try-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 18px; }
.try-usual { font-size: 14.5px; color: var(--muted); }
.try-chart { margin-top: 14px; }
.try-calc { margin-top: 10px; font-size: 14.5px; color: var(--muted); border-left: 3px solid var(--accent); padding-left: 12px; }

/* ---------- Features ---------- */
.features { padding-top: 120px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 128px; }
.feature-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: center; }
.feature-row:nth-child(even) .feature-copy { order: 2; }
.feature-list { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 24px; }
.feature-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 16px; align-items: start; }
.feature-list .icon { color: var(--accent); margin-top: 2px; }
.feature-list h3 { font: 600 18px/1.35 var(--text); letter-spacing: 0; }
.feature-list p { color: var(--muted); font-size: 16.5px; margin-top: 3px; }
.feature-art {
  background: var(--wash-soft); border-radius: 36px; padding: 48px 32px;
  display: flex; justify-content: center; align-items: center; min-height: 100%;
}
.ui-card { width: min(460px, 100%); padding: 22px 24px; box-shadow: var(--shadow); font-size: 18px; }
.d-head { display: flex; align-items: center; gap: 0.5em; font-weight: 600; font-size: 15px; color: var(--ink); }
.d-head .grp-dot { font-size: 15px; }
.d-value { display: block; font-size: 40px; margin: 6px 0 8px; }
.d-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.d-usual { font-size: 14px; color: var(--muted); }
.seg-mini { --r-ink-2: var(--muted); max-width: 300px; font-size: 13px; margin: 16px 0 8px; }
.ui-card .seg .on { background: var(--card); color: var(--head); }
.tp { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.tp-h { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.tp ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; color: var(--muted); }
.tp b { color: var(--ink); font-weight: 600; }

.art-stack { flex-direction: column; align-items: stretch; gap: 16px; }
.art-stack .ui-card { width: min(440px, 100%); }
.art-stack .chart-card { align-self: flex-end; }
.wm-card { display: flex; flex-direction: column; gap: 2px; }
.wm-head { font-size: 13px; font-weight: 700; color: var(--accent); }
.wm-count { font-family: var(--rounded); font-size: 21px; color: var(--head); }
.wm-rest { font-size: 14px; color: var(--muted); }
.wm-lines { list-style: none; margin: 10px 0 0; padding: 0; }
.wm-lines li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.wm-lines .pill { font-size: 13px; }
.chart-card .chart { margin-top: 8px; }

.train-card .t-main { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 12px 0 6px; }
.train-card .t-main .row-name { font-size: 14px; }
.train-card .d-value { margin: 0 0 4px; }
.bars { display: block; width: 100%; height: auto; margin: 10px 0 4px; font-family: var(--text); }
.bar { fill: var(--band); }
.bar-now { fill: var(--accent); }
.bar-avg { stroke: var(--head); stroke-width: 1.5; stroke-dasharray: 4 4; }
.bar-avg-label { fill: var(--muted); font-size: 12px; font-weight: 600; }
.t-rows { border-top: 1px solid var(--line); margin-top: 8px; }
.t-row { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px 0; }
.t-row + .t-row { border-top: 1px solid var(--line); }
.t-row .row-name { font-size: 14px; }
.t-row .t-value { grid-row: 2; font-size: 22px; }
.t-row .pill { grid-row: 1 / 3; grid-column: 2; font-size: 12.5px; }
.train-card .t-main .pill { font-size: 13px; }

.feature-row-wide { grid-template-columns: minmax(0, 1fr); gap: 44px; }
.feature-row-wide .feature-copy { order: 0 !important; }
.feature-list-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 44px; }

/* Wherever you look: a widget, a watch and a Lock Screen, all drawn. The
   watch and the Lock Screen are dark in both themes, like the real things. */
.places { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-items: center; align-items: center; gap: 32px; padding: 56px 40px; }
.place-widget { width: min(220px, 100%); }
.on-dark {
  --fav: #6CC08A; --fav-bg: #16301F; --neutral-ink: #C3CFCC; --neutral-bg: #253130;
  --accent: #5CC2B7; --band: #1F3431; --card: #000; --pill-arrow-ink: #0B1312;
  --r-ink-2: #9AA4A2; color: #F2F5F4;
}
.watch {
  container-type: inline-size;
  width: min(200px, 100%); aspect-ratio: 0.84; padding: 7%;
  border-radius: 30% / 26%; background: #1A1E21; box-shadow: var(--shadow), 0 0 0 1px var(--frame-edge), inset 0 0 0 2px #2B3135;
}
.watch-screen {
  height: 100%; border-radius: 22% / 19%; background: #000;
  padding: 10% 9% 7%; display: flex; flex-direction: column; align-items: flex-start; gap: 2.5%;
  font-family: var(--system); font-size: 7.6cqi; color: #F2F5F4;
}
.watch-time { align-self: flex-end; color: #5CC2B7; font-weight: 600; font-size: 0.95em; margin-bottom: 4%; }
.watch-name { font-size: 0.86em; color: #9AA4A2; }
.watch-value { font-size: 1.9em; }
.watch-screen .pill { font-size: 0.72em; }
.watch-screen .spark { width: 100%; height: auto; margin-top: auto; }
.lock {
  width: min(210px, 100%); aspect-ratio: 0.7; border-radius: 15% / 10.5%;
  background: radial-gradient(120% 80% at 30% 0%, #1C5650 0%, #0D2B28 55%, #071513 100%);
  box-shadow: var(--shadow), 0 0 0 4px #1B1F20; container-type: inline-size;
  display: flex; flex-direction: column; align-items: center; padding: 14% 9% 0; font-family: var(--system); color: #fff;
}
.lock-inline { display: inline-flex; align-items: center; gap: 0.35em; font-size: 6cqi; font-weight: 600; opacity: 0.9; }
.lock-inline .arrow, .lock-phrase .arrow { stroke: currentColor; width: 1.1em; height: 1.1em; }
.lock-time { font-family: var(--rounded); font-weight: 700; font-size: 30cqi; line-height: 1; letter-spacing: -0.02em; margin: 1% 0 8%; }
.lock-widget {
  width: 100%; border-radius: 9cqi; padding: 6cqi 7cqi; background: rgba(255, 255, 255, 0.14);
  display: flex; flex-direction: column; gap: 1cqi; font-size: 6.4cqi;
}
.lock-name { font-weight: 600; opacity: 0.85; }
.lock-value { font-size: 1.7em; }
.lock-value small { color: rgba(255, 255, 255, 0.75); }
.lock-phrase { display: inline-flex; align-items: center; gap: 0.3em; font-weight: 600; }

/* ---------- Calm band ---------- */
.calm { background: var(--deep); padding: 104px 0; }
.calm-inner { display: flex; flex-direction: column; gap: 56px; }
.calm-h { color: #FFFFFF; font-size: clamp(32px, 4.4vw, 52px); font-weight: 700; letter-spacing: -0.028em; line-height: 1.05; text-wrap: balance; }
.calm-sub { color: var(--deep-ink); opacity: 0.85; font-size: 19px; margin-top: 18px; max-width: 620px; }
.calm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.calm-item { display: flex; flex-direction: column; gap: 10px; }
.calm-item .icon { color: var(--deep-accent); }
.calm-item h3 { color: #FFFFFF; font: 700 19px/1.3 var(--text); letter-spacing: 0; margin-top: 6px; }
.calm-item p { color: var(--deep-ink); opacity: 0.85; font-size: 16px; }
.calm-item a { color: var(--deep-accent); text-decoration: underline; text-underline-offset: 3px; }
.calm-item a:hover { color: #94D7D0; }

/* ---------- Pricing ---------- */
.pricing-band { padding: 112px 0; }
.pricing-inner { display: flex; flex-direction: column; gap: 44px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; max-width: 900px; }
.price-card { padding: 34px; display: flex; flex-direction: column; gap: 22px; }
.price-card-unl { border: 2px solid var(--accent); position: relative; }
.price-badge {
  position: absolute; top: -14px; left: 32px;
  background: var(--head); color: var(--bg); border-radius: 999px;
  padding: 5px 14px; font-size: 13px; font-weight: 700;
}
.price-note { margin: -20px 0 0; font-size: 14px; color: var(--muted); max-width: 900px; }
.price-head { display: flex; flex-direction: column; gap: 4px; }
.price-name { font-weight: 700; font-size: 22px; font-family: var(--display); color: var(--head); }
.price-amount { font-size: 38px; font-weight: 700; font-family: var(--display); color: var(--head); letter-spacing: -0.02em; }
.price-amount small { font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.price-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.price-list li { position: relative; padding-left: 30px; font-size: 16px; }
.price-list li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; background-color: var(--accent);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>') center / contain no-repeat;
}

/* ---------- FAQ ---------- */
.faq { padding-bottom: 112px; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 22px 44px 22px 0; position: relative;
  font-weight: 600; font-size: 19px; color: var(--head);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  background: linear-gradient(var(--accent), var(--accent)) center / 14px 2.5px no-repeat,
              linear-gradient(var(--accent), var(--accent)) center / 2.5px 14px no-repeat;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--muted); padding: 0 44px 24px 0; max-width: 680px; }

/* ---------- Closing ---------- */
.closing { padding-top: 24px; padding-bottom: 120px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px; }
.closing-mark { border-radius: 22.5%; box-shadow: var(--shadow); }
.closing-h { font-size: clamp(34px, 5vw, 60px); font-weight: 700; letter-spacing: -0.032em; line-height: 1.02; text-wrap: balance; }

/* ---------- Footer ---------- */
.footer { padding-top: 56px; padding-bottom: 44px; display: flex; flex-direction: column; gap: 28px; border-top: 1px solid var(--line); }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand { display: flex; flex-direction: column; gap: 10px; }
.footer-made { color: var(--muted); font-size: 15px; }
.footer-cols { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 9px; font-size: 15px; }
.footer-col-h { font-weight: 700; color: var(--ink); }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--line); padding-top: 20px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--muted);
}

/* ---------- Legal pages ---------- */
.legal-main { padding-top: 24px; padding-bottom: 88px; }
.legal { max-width: 760px; }
.legal-eyebrow { color: var(--accent); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; margin: 24px 0 6px; }
.legal-h1 { font-size: clamp(34px, 4.5vw, 46px); }
.legal-tagline { color: var(--muted); font-size: 18px; margin: 12px 0 4px; }
.legal-dates { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.draft-banner { margin: 16px 0 8px; background: var(--unfav-bg); color: var(--unfav); border-radius: 12px; padding: 10px 16px; font-size: 14.5px; font-weight: 600; }
.legal-body { font-size: 16.5px; }
.legal-body h2 { font-size: 23px; font-weight: 700; margin: 36px 0 10px; }
.legal-body h3 { font-size: 18px; font-weight: 700; margin: 24px 0 8px; }
.legal-body p { margin: 10px 0; }
.legal-body ul { margin: 10px 0; padding-left: 22px; }
.legal-body li { margin: 6px 0; }
.legal-body .headline { background: var(--wash-soft); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; margin: 24px 0 20px; }
.legal-body .headline p { margin: 6px 0; font-weight: 500; }
.legal-body .never { background: var(--deep); color: #fff; border-radius: 16px; padding: 14px 22px; margin: 16px 0; }
.legal-body .never li { color: var(--deep-ink); }
.legal-de { margin-top: 56px; padding-top: 8px; border-top: 1px solid var(--line); }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  appearance: none; cursor: pointer; padding: 0;
  width: 37px; height: 37px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

/* ---------- Coming soon ---------- */
body.soon { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; overflow-x: clip; }
.soon-main {
  flex: 1; width: 100%; max-width: 780px; margin: 0 auto; padding: 11vh 22px 32px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px;
}
.soon-brand { display: inline-flex; align-items: center; gap: 13px; }
.soon-brand .brand-name { font-size: 30px; }
.soon-h { font-size: clamp(42px, 7.2vw, 80px); line-height: 0.98; font-weight: 700; letter-spacing: -0.04em; text-wrap: balance; margin-top: 8px; }
.soon-h span { color: var(--accent); }
.soon-sub { color: var(--muted); font-size: clamp(17px, 2.2vw, 20px); max-width: 560px; }
.soon-row { width: min(420px, 100%); margin: 8px 0; text-align: left; }
.soon-row .row { font-size: clamp(17px, 2.6vw, 20px); background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 0.75em 1em; box-shadow: var(--shadow); }
.soon-row .spark { width: 5.5em; height: 2.25em; }
.soon-family { color: var(--muted); font-size: 15px; }
.soon-curve { display: block; width: 100%; height: clamp(110px, 16vw, 200px); overflow: visible; }
.soon-curve .motif-curve { stroke-width: 12; vector-effect: non-scaling-stroke; }
.soon-foot {
  width: 100%; max-width: 1164px; margin: 0 auto; padding: 22px 22px 30px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  font-size: 14px; color: var(--muted);
}
.soon-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.soon-foot a { color: var(--muted); }
.soon-foot a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .nav-links { gap: 20px; }
  .nav-links .navlink:first-child { display: none; }
  .feature-list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 16px; padding-bottom: 72px; }
  .hero-art { justify-self: center; max-width: 460px; }
  .try, .feature-row, .faq { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .feature-row:nth-child(even) .feature-copy { order: 0; }
  .features { gap: 96px; padding-top: 88px; }
  .calm-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .try-band, .calm { padding: 80px 0; }
  .pricing-band { padding: 88px 0; }
  .places { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 40px 20px; }
}
@media (max-width: 980px) {
  /* On narrow screens the chart sits between the heading and the controls,
     so it stays in view while a thumb picks a number (as circloop.app's map). */
  .try { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .try-copy { display: contents; }
  .try > *, .try-copy > * { order: 2; }
  .try .eyebrow, .try .section-h, .try .section-sub { order: 1; }
  .try-card { order: 1; margin-top: 28px; }
  .try-controls { margin-top: 24px; }
}
@media (max-width: 760px) {
  .nav-links .navlink { display: none; }
  .chart .c-label { font-size: 19px; }
  .chart .c-recent-label, .chart .c-symptom-label, .chart .c-marker-label { font-size: 19px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 40px; }
  .step:not(:last-child)::after {
    top: 64px; left: 24px; width: 3px; height: calc(100% + 32px - 76px); transform-origin: top;
    background: repeating-linear-gradient(180deg, var(--accent) 0 3px, transparent 3px 10px);
  }
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) { .step:not(:last-child)::after { animation-name: grow-y; } }
  }
  .step { padding-left: 76px; min-height: 52px; }
  .step-dot { position: absolute; left: 0; top: 0; }
  .feature-list-grid { grid-template-columns: minmax(0, 1fr); }
  .feature-art { border-radius: 28px; padding: 32px 16px; }
  .places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .places .lock { grid-column: 1 / -1; }
  .hero-sub { font-size: 19px; }
  .try-card { padding: 20px 16px 18px; }
}
@media (max-width: 480px) {
  .btn-nav { display: none; }   /* the hero's store spot is right below */
  .art-stack .chart-card { align-self: stretch; }
  .ui-card { padding: 18px 16px; }
  .t-row .pill { grid-row: auto; grid-column: 1 / -1; justify-self: start; margin-top: 6px; }
}

/* ---------- Dark theme ----------
   Follows the system by default; an explicit data-theme wins. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --accent: #5CC2B7; --accent-hover: #94D7D0;
    --head: #F2F6F5; --ink: #E3EAE8; --muted: #9DABA8;
    --bg: #0C1011; --card: #131A1B; --line: #243031;
    --wash: #0D302B; --wash-soft: #0F1C1B; --on-wash: #B7CCC7; --band: #1B2B28;
    --tag-bg: #173532; --tag-ink: #94D7D0;
    --fav: #6CC08A; --fav-bg: #16301F; --unfav: #DDA555; --unfav-bg: #33260F;
    --neutral-ink: #B6C3C0; --neutral-bg: #1F2A2A; --symptom: #B9A8E6; --pill-arrow-ink: #0C1011;
    --deep: #0F2523; --btn-bg: #F4F7F6; --btn-ink: #0B1312; --btn-bg-hover: #FFFFFF; --hover-bg: #173532;
    --phone-bg: #000000; --phone-card: #1C1C1E; --phone-ink: #F2F4F3; --phone-ink-2: #9A9FA0; --phone-sep: #2C2F30;
    --frame: #2A2F30; --frame-edge: rgba(255, 255, 255, 0.10); --shadow: 0 28px 60px -24px rgba(0, 0, 0, 0.75);
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #5CC2B7; --accent-hover: #94D7D0;
  --head: #F2F6F5; --ink: #E3EAE8; --muted: #9DABA8;
  --bg: #0C1011; --card: #131A1B; --line: #243031;
  --wash: #0D302B; --wash-soft: #0F1C1B; --on-wash: #B7CCC7; --band: #1B2B28;
  --tag-bg: #173532; --tag-ink: #94D7D0;
  --fav: #6CC08A; --fav-bg: #16301F; --unfav: #DDA555; --unfav-bg: #33260F;
  --neutral-ink: #B6C3C0; --neutral-bg: #1F2A2A; --symptom: #B9A8E6; --pill-arrow-ink: #0C1011;
  --deep: #0F2523; --btn-bg: #F4F7F6; --btn-ink: #0B1312; --btn-bg-hover: #FFFFFF; --hover-bg: #173532;
  --phone-bg: #000000; --phone-card: #1C1C1E; --phone-ink: #F2F4F3; --phone-ink-2: #9A9FA0; --phone-sep: #2C2F30;
  --frame: #2A2F30; --frame-edge: rgba(255, 255, 255, 0.10); --shadow: 0 28px 60px -24px rgba(0, 0, 0, 0.75);
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
