/*
  Wholeday site components. Reads only the custom properties in tokens.css.

  Components: base, wrap, header, hero, eyebrow, section (eyebrow → two-line
  headline → one paragraph → visual), button, form field, signup form, note
  band, FAQ table, footer, prose pages, and the abstract illustrations.
*/

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
figure { margin: 0; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
p { margin: 0; text-wrap: pretty; }
a { color: var(--primary); text-underline-offset: 0.18em; }
a:hover { color: var(--primary-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 10;
  background: var(--surface); color: var(--fg); padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.skip-link:focus { top: var(--space-4); }

.wrap { max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding-block: var(--space-4);
}
.wordmark { display: inline-flex; align-items: center; text-decoration: none; }
.wordmark img { display: block; height: 32px; width: auto; }
.badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--step--1); color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 0.3rem 0.8rem; white-space: nowrap;
}
.badge::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--sun); box-shadow: 0 0 0 1.5px var(--accent);
}

/* Eyebrow label */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--2);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 var(--space-3);
}

/* Hero */
.hero {
  display: grid; gap: var(--space-7);
  padding-block: var(--space-6) var(--space-8);
}
.hero h1 { font-size: var(--step-4); max-width: 14ch; }
.hero .lede { margin-top: var(--space-5); }
.hero .signup { margin-top: var(--space-6); }
.lede { font-size: var(--step-1); color: var(--muted); max-width: var(--measure); }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; align-items: center; padding-block: var(--space-8) var(--space-9); }
}

/* Section: eyebrow → two-line headline → one paragraph → visual */
.section {
  display: grid; gap: var(--space-6);
  padding-block: var(--space-8);
  border-top: 1px solid var(--line);
}
.section h2 { font-size: var(--step-3); }
.section h2 .line { display: block; }
.section__text p { margin-top: var(--space-4); max-width: var(--measure); }
.section__text .more { margin-top: var(--space-4); }
@media (min-width: 900px) {
  .section { grid-template-columns: 1fr 1fr; align-items: center; gap: var(--space-8); padding-block: var(--space-9); }
  .section--flip .section__text { order: 2; }
}

.visual {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow);
}
.visual figcaption, .caption {
  margin-top: var(--space-4);
  font-size: var(--step--1);
  color: var(--muted);
}

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 0 1.4rem;
  border: 1px solid transparent; border-radius: var(--radius-pill);
  font: 600 1rem/1 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-strong); color: var(--on-primary); }
.btn--secondary { background: transparent; color: var(--primary); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--primary); }
.btn--wide { width: 100%; }
@media (min-width: 520px) { .btn--wide { width: auto; min-width: 14rem; } }

/* Form field */
.field { display: grid; gap: var(--space-2); }
.field label { font-size: var(--step--1); font-weight: 600; }
.field .optional { font-weight: 400; color: var(--muted); }
.input, .select {
  width: 100%; min-height: 48px; padding: 0 0.95rem;
  font: inherit; font-size: 1rem; /* 16px keeps iOS from zooming */
  color: var(--fg); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-md);
}
.input::placeholder { color: var(--muted); opacity: 0.8; }
.input:focus-visible, .select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--primary); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 2.5rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.hint { font-size: var(--step--1); color: var(--muted); }

/* Signup form */
.signup { display: grid; gap: var(--space-4); max-width: 34rem; }
.signup__row { display: grid; gap: var(--space-3); }
@media (min-width: 520px) {
  .signup__row { grid-template-columns: 1fr auto; align-items: end; }
}
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Note band (pricing line and similar one-liners) */
.note-band {
  display: grid; gap: var(--space-2);
  background: var(--accent-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5);
  margin-block: var(--space-2) var(--space-8);
}
.note-band p { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.3; font-weight: 600; text-wrap: balance; }
.note-band small { font-size: var(--step--1); color: var(--muted); }
@media (min-width: 900px) { .note-band { padding: var(--space-6) var(--space-7); } }

/* FAQ table */
.faq-block { padding-block: var(--space-8); border-top: 1px solid var(--line); }
.faq-block h2 { font-size: var(--step-3); margin-bottom: var(--space-6); }
.faq { margin: 0; border-top: 1px solid var(--line); }
.faq > div {
  display: grid; gap: var(--space-2);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--line);
}
.faq dt { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); line-height: 1.35; }
.faq dd { margin: 0; color: var(--muted); max-width: var(--measure); }
.faq dd p + p { margin-top: var(--space-3); }
@media (min-width: 760px) {
  .faq > div { grid-template-columns: minmax(14rem, 1fr) 2fr; gap: var(--space-7); }
}

/* Closing call to action */
.cta { padding-block: var(--space-8); border-top: 1px solid var(--line); display: grid; gap: var(--space-5); }
.cta h2 { font-size: var(--step-3); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-7) var(--space-8);
  font-size: var(--step--1); color: var(--muted);
  display: grid; gap: var(--space-4);
}
.site-footer .tagline { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); color: var(--fg); }
.site-footer .disclaimer { color: var(--fg); max-width: var(--measure); }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--fg); }

/* Prose pages (support, thanks, errors) */
.prose { max-width: 44rem; padding-block: var(--space-6) var(--space-8); }
.prose h1 { font-size: var(--step-4); }
.prose h2 { font-size: var(--step-2); margin-top: var(--space-7); }
.prose p, .prose ul { margin-top: var(--space-4); }
.prose ul { padding-left: 1.2rem; }
.prose .actions { margin-top: var(--space-6); display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ------------------------------------------------------------------ */
/* Illustrations: abstract product shapes, not screenshots.            */

.legend { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--step--1); color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.key { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.key--dose { color: var(--dose); border-radius: 2px; transform: rotate(45deg); width: 9px; height: 9px; }
.key--meal { color: var(--meal); }
.key--water { color: var(--water); }
.key--weigh { color: var(--weigh); border-radius: 2px; }
.key--fast { color: var(--fast); border-radius: 3px; width: 16px; height: 8px; }
.key--level { width: 18px; height: 0; border-top: 2px dashed var(--meds); border-radius: 0; background: none; }
.key--protein { color: var(--protein); border-radius: 2px; }
.key--move { color: var(--move); }
.key--now { width: 0; height: 14px; border-radius: 0; background: none; border-left: 2px solid var(--meal); }

/* Abstract phone */
.device {
  width: min(100%, 300px);
  margin-inline: auto;
  border: 9px solid var(--device);
  border-radius: 44px;
  background: var(--bg);
  padding: 22px 14px 18px;
  box-shadow: var(--shadow);
  display: grid; gap: 12px;
}
.device__notch { width: 70px; height: 6px; border-radius: 6px; background: var(--line); margin: -8px auto 2px; }
.d-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.d-label { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.d-bar { height: 8px; border-radius: 4px; background: var(--line); }

.d-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; justify-items: center; }
.d-day { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); position: relative; }
.d-day--done { border-color: var(--primary); }
.d-day--today { border-color: var(--primary); background: var(--primary-soft); }
.d-day--dose::after {
  content: ""; position: absolute; left: 50%; bottom: -9px; width: 6px; height: 6px;
  background: var(--dose); transform: translateX(-50%) rotate(45deg); border-radius: 1px;
}

.d-level svg { width: 100%; height: auto; margin-top: 6px; }
.level-area { fill: color-mix(in srgb, var(--meds) 16%, var(--surface)); opacity: 0.8; }
.level-line { fill: none; stroke: var(--meds); stroke-width: 2px; stroke-dasharray: 4 3; stroke-linecap: round; }
.now-line { stroke: var(--meal); stroke-width: 1.5px; opacity: 0.7; }
.phase-rule { stroke: var(--line-strong); stroke-width: 1px; opacity: 0.6; }
.axis { stroke: var(--line); stroke-width: 1; }

.d-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; position: relative; }
.d-timeline::before { content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.d-row { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: center; position: relative; --c: var(--primary); --soft: var(--primary-soft); }
.d-row--meal { --c: var(--meal); --soft: var(--meal-soft); }
.d-row--water { --c: var(--water); --soft: var(--water-soft); }
.d-row--weigh { --c: var(--weigh); --soft: var(--weigh-soft); }
.d-row--fast { --c: var(--fast); --soft: var(--fast-soft); }
.d-row--dose { --c: var(--meds); --soft: var(--meds-soft); }
.d-row--move { --c: var(--move); --soft: var(--move-soft); }
.marker {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); color: var(--surface); box-shadow: 0 0 0 3px var(--bg); border: 2px solid var(--c);
}
.marker svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.marker svg .fill { fill: currentColor; stroke: none; }
.d-row__body { display: grid; gap: 5px; padding: 8px 10px; border-radius: 10px; background: var(--soft); border: 1.5px solid transparent; }
.d-row__body .d-bar:first-child { width: 55%; background: color-mix(in srgb, var(--c) 35%, var(--surface)); }
.d-row__body .d-bar:last-child { width: 80%; height: 6px; background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
/* Entries still to come: outlined and dashed, like the app. */
.d-row--next .marker { background: var(--surface); color: var(--c); border-style: dashed; }
.d-row--next .d-row__body { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--c) 55%, transparent); }

/* Week chart (pillar 1) */
.week-chart svg { width: 100%; height: auto; }
.week-chart text { font-family: var(--font-body); font-size: 12px; fill: var(--muted); }
.week-chart .phase-label { font-size: 11px; font-weight: 600; }
.phase--peak { fill: color-mix(in srgb, var(--meds) 6%, var(--surface)); }
.future { opacity: 0.35; }
.dot-meal { fill: var(--meal); }
.dot-water { fill: var(--water); }
.dot-weigh { fill: var(--weigh); }
.dot-dose { fill: var(--dose); }
.band-fast { fill: var(--fast); }

/* Phases and plan (pillar 2) */
.phases { display: grid; grid-template-columns: 2.6fr 1.6fr 2.2fr 2.2fr; gap: 4px; }
.phases span {
  display: block; padding: 9px 6px; border-radius: 10px; text-align: center;
  font-size: 12px; font-weight: 600;
  background: var(--primary); color: var(--on-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.phases .phases__break { background: var(--primary-soft); color: var(--primary); }
.plan { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: var(--space-5); }
.plan__day { display: grid; gap: 6px; align-content: start; }
.plan__head { font-size: 11px; color: var(--muted); text-align: center; font-weight: 600; position: relative; padding-bottom: 4px; }
.plan__day--dose .plan__head::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 6px; height: 6px;
  background: var(--dose); transform: translateX(-50%) rotate(45deg); border-radius: 1px;
}
.meal-block { border-radius: 8px; background: var(--meal-soft); padding: 5px; display: flex; align-items: flex-end; }
.meal-block i { display: block; width: 100%; border-radius: 4px; background: var(--protein); }
.meal-block--l { height: 46px; }
.meal-block--m { height: 34px; }
.meal-block--s { height: 24px; }
.meal-block--l i { height: 40%; }
.meal-block--m i { height: 45%; }
.meal-block--s i { height: 50%; }

/* Privacy (pillar 3) */
.privacy-visual { display: grid; gap: var(--space-5); justify-items: center; }
.vault {
  width: 150px; height: 240px; border: 8px solid var(--device); border-radius: 34px;
  background: var(--bg); display: grid; place-items: center;
}
.vault svg { width: 64px; height: 64px; }
.vault .lock-body { fill: var(--primary); }
.vault .lock-shackle { fill: none; stroke: var(--primary); stroke-width: 7; stroke-linecap: round; }
.vault .lock-hole { fill: var(--on-primary); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
.chips li {
  font-size: var(--step--1); font-weight: 600;
  padding: 0.45rem 0.85rem; border-radius: var(--radius-pill);
  background: var(--primary-soft); color: var(--primary);
}
.chips .chip--choice { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); font-weight: 400; }

/* Motion: subtle, and only for people who haven't asked for less. */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: rise 1s var(--ease) both;
    animation-timeline: view();
    animation-range: entry 0% entry 45%;
  }
  .draw { stroke-dashoffset: 0; animation: fade-in 1.2s var(--ease) 0.2s both; }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } }
  @keyframes fade-in { from { opacity: 0; } }
}
