/* Wellcast — landing page. Legal pages keep using styles.css. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #F4F2F9;
  --paper: #FFFFFF;
  --ink: #26213A;
  --ink-2: #5E5874;
  --ink-3: #8A84A0;
  --line: #E2DEEC;
  --brand: #8B7EC8;
  --accent: #6B5DA8;
  --on-accent: #FFFFFF;
  --neutral-mark: #CFC8E4;
  --cause: #D0645D;
  --cause-soft: #F8DDD9;
  --good: #2F8A66;
  --good-soft: #D3EFE1;
  --band: #26213A;
  --band-ink: #EEEBF6;
  --band-ink-2: #B9B2CF;
  --band-line: #3C3554;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", ui-sans-serif, system-ui, sans-serif;

  --container: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(72px, 10vw, 128px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16131F;
    --paper: #201C2C;
    --ink: #EEEBF6;
    --ink-2: #A9A3BD;
    --ink-3: #807A96;
    --line: #332D44;
    --brand: #A898D8;
    --accent: #B4A6E2;
    --on-accent: #16131F;
    --neutral-mark: #4A4262;
    --cause: #EE8A83;
    --cause-soft: #4A2A2C;
    --good: #6FCB9F;
    --good-soft: #1F3B30;
    --band: #0F0D16;
    --band-line: #2C2740;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16131F;
  --paper: #201C2C;
  --ink: #EEEBF6;
  --ink-2: #A9A3BD;
  --ink-3: #807A96;
  --line: #332D44;
  --brand: #A898D8;
  --accent: #B4A6E2;
  --on-accent: #16131F;
  --neutral-mark: #4A4262;
  --cause: #EE8A83;
  --cause-soft: #4A2A2C;
  --good: #6FCB9F;
  --good-soft: #1F3B30;
  --band: #0F0D16;
  --band-line: #2C2740;
  color-scheme: dark;
}

*, *::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(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); }
h3 { font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.01em; }

p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--paper);
  padding: 8px 12px;
}

/* ---------- Header ---------- */

.site-header {
  padding: 20px 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }

.site-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 1rem;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-2);
}
.site-nav a:hover { color: var(--ink); }

.toggles {
  display: flex;
  gap: 6px;
}
.site-nav + .toggles { margin-left: 8px; }

.chip-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 999px;
  cursor: pointer;
}
.chip-btn:hover { color: var(--ink); border-color: var(--ink-3); }

.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: inline; }
}

@media (max-width: 760px) {
  .site-nav { display: none; }
  .site-nav + .toggles { margin-left: auto; }
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  border: 2px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-quiet { border-color: var(--line); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink-3); }

/* ---------- Hero ---------- */

.hero {
  padding: clamp(40px, 7vw, 88px) 0 var(--section);
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5.25rem);
  letter-spacing: -0.035em;
  line-height: 0.98;
  max-width: 15ch;
}
.hero .lede {
  margin-top: 28px;
  max-width: 56ch;
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  color: var(--ink-2);
}
.hero .actions { margin-top: 36px; }
.hero .status {
  margin-top: 18px;
  font-size: 0.9375rem;
  color: var(--ink-3);
}

/* The week strip: the page's one memorable moment. */

.week-panel {
  margin-top: clamp(48px, 7vw, 80px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(20px, 3.5vw, 40px);
}

.week {
  display: grid;
  grid-template-columns: 6.5rem repeat(7, minmax(0, 1fr));
  column-gap: clamp(4px, 1.2vw, 16px);
  align-items: end;
}
.week .row-label {
  font-size: 0.9375rem;
  color: var(--ink-2);
  align-self: center;
}
.week .day {
  text-align: center;
  font-size: 0.875rem;
  color: var(--ink-3);
  padding-bottom: 14px;
}
.week .day.is-key { color: var(--ink); font-weight: 700; }

.mood-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 116px;
}
.mood-cell .bar {
  width: min(28px, 70%);
  border-radius: 8px 8px 4px 4px;
  background: var(--neutral-mark);
}
.mood-cell .val {
  font-size: 0.8125rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.mood-cell.is-effect .bar { background: var(--cause); }
.mood-cell.is-effect .val { color: var(--cause); font-weight: 700; }

.week { position: relative; }
.arc-row { grid-column: 2 / -1; height: clamp(64px, 8vw, 96px); }
.week .arc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.week .arc path {
  fill: none;
  stroke: var(--cause);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.week .lag {
  position: absolute;
  transform: translate(-50%, -50%);
  background: var(--cause-soft);
  color: var(--cause);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
html:not(.js) .week .arc,
html:not(.js) .week .lag { display: none; }

.factor-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
}
.factor-cell .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--neutral-mark);
}
.factor-cell.is-cause .dot {
  width: 22px;
  height: 22px;
  border: 0;
  background: var(--cause);
}

.week-result {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  align-items: baseline;
}
.week-result .finding {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.1875rem, 2vw, 1.5rem);
  letter-spacing: -0.01em;
  line-height: 1.25;
  max-width: 36ch;
}
.week-result .meta {
  font-size: 0.9375rem;
  color: var(--ink-3);
}

@media (prefers-reduced-motion: no-preference) {
  .js .week .arc path {
    stroke-dashoffset: 1;
    animation: draw 1.1s cubic-bezier(.6, 0, .2, 1) .5s forwards;
  }
  .js .week .lag,
  .js .mood-cell.is-effect {
    opacity: 0;
    animation: appear .4s ease-out 1.5s forwards;
  }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes appear { to { opacity: 1; } }
}

@media (max-width: 560px) {
  .week { grid-template-columns: 3.75rem repeat(7, minmax(0, 1fr)); }
  .week .row-label { font-size: 0.8125rem; }
  .week .day { font-size: 0.75rem; }
  .mood-cell .val { font-size: 0.6875rem; }
  .week .lag { font-size: 0.75rem; padding: 3px 8px; }
}

/* ---------- Sections ---------- */

.section { padding: var(--section) 0; }
.section + .section { padding-top: 0; }

.section-head { max-width: 640px; }
.section-head p {
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 1.1875rem;
}

/* How it works: a real three-step sequence */
.steps {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 3.5rem;
  line-height: 1;
  color: var(--brand);
  margin-bottom: 16px;
}
.steps p { margin-top: 10px; color: var(--ink-2); }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
}

/* Ecos examples */
.ecos {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.ecos .copy p + p { margin-top: 16px; }
.ecos .copy p { color: var(--ink-2); max-width: 52ch; }
.ecos .copy h2 { margin-bottom: 24px; }
@media (max-width: 900px) {
  .ecos { grid-template-columns: 1fr; }
}

.echo-list {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 8px clamp(20px, 3vw, 32px);
  margin: 0;
  list-style: none;
}
.echo-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 22px 0;
}
.echo-list li + li { border-top: 1px solid var(--line); }
.echo-list .factor { font-weight: 700; font-size: 1.125rem; }
.echo-list .effect { color: var(--ink-2); grid-column: 1; }
.echo-list .conf { grid-column: 1 / -1; font-size: 0.875rem; color: var(--ink-3); margin-top: 6px; }
.echo-list .lag-tag {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: start;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.lag-tag.worse { background: var(--cause-soft); color: var(--cause); }
.lag-tag.better { background: var(--good-soft); color: var(--good); }
.echo-list li.caption {
  display: block;
  padding: 18px 0 0;
  font-size: 0.875rem;
  color: var(--ink-3);
}
.echo-list li.caption + li { border-top: 0; }

/* What it tracks */
.tracks {
  margin: 48px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 48px);
}
.tracks div {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.tracks dt { font-weight: 700; }
.tracks dd { margin: 6px 0 0; color: var(--ink-2); font-size: 1rem; }
@media (max-width: 900px) { .tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tracks { grid-template-columns: 1fr; } }

/* Privacy: the one inverted band */
.band {
  background: var(--band);
  color: var(--band-ink);
  padding: var(--section) 0;
}
.band + .section { padding-top: var(--section); }
.band .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
}
.band p { color: var(--band-ink-2); margin-top: 20px; max-width: 50ch; }
.band a { color: var(--band-ink); }
.promises {
  list-style: none;
  margin: 0;
  padding: 0;
  align-self: center;
}
.promises li {
  padding: 18px 0;
  border-bottom: 1px solid var(--band-line);
  font-size: 1.125rem;
}
.promises li:first-child { border-top: 1px solid var(--band-line); }
@media (max-width: 900px) {
  .band .container { grid-template-columns: 1fr; }
}

/* Company */
.company {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 80px);
}
.company .copy p { color: var(--ink-2); max-width: 54ch; }
.company .copy p:first-of-type { margin-top: 24px; }
.company .copy p + p { margin-top: 16px; }
.facts {
  margin: 0;
  align-self: start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px 24px;
}
.facts div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 12px;
  padding: 14px 0;
  font-size: 1rem;
}
.facts div + div { border-top: 1px solid var(--line); }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }
@media (max-width: 900px) {
  .company { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .facts div { grid-template-columns: 1fr; gap: 2px; }
}

/* FAQ */
.faq {
  margin-top: 40px;
  max-width: 760px;
}
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 22px 40px 22px 0;
  font-weight: 700;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--ink-3);
}
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding: 0 0 24px; color: var(--ink-2); max-width: 64ch; }

/* Final call to action */
.closing h2 { max-width: 14ch; }
.closing p { margin-top: 18px; color: var(--ink-2); max-width: 52ch; }
.closing .actions { margin-top: 32px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 40px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px 48px;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--ink); }
.site-footer .fine { width: 100%; color: var(--ink-3); font-size: 0.875rem; }
