/*
 * upwell.page — one stylesheet, no fonts or images from anywhere else.
 *
 * The colours are the app's two palettes (upwell-mobile apps/mobile/src/ui/palettes.ts),
 * token for token: light by default, dark under prefers-color-scheme. site/check.py
 * checks every text pair below against WCAG AA (4.5:1) in both.
 */

:root {
  color-scheme: light dark;
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --surface-alt: #EDF0F4;
  --border: #D6DCE4;
  --text: #0F1419;
  --text-dim: #5A6675;
  --accent: #0369A1;
  --accent-soft: #E0F2FE;
  --accent-line: #BAE6FD;
  --on-accent: #FFFFFF;
  --good: #166534;
  --warn: #92400E;
  --warn-soft: #FEF3C7;
  --warn-line: #FCD34D;
  --protein: #166534;
  --fat: #92400E;
  --carbs: #7E22CE;
  --sleep: #4338CA;
  --bar-muted: #7D8A9B;
  --radius: 14px;
  --gap: 12px;
  --measure: 44rem;
  --wide: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0D10;
    --surface: #14181D;
    --surface-alt: #1B2027;
    --border: #252C35;
    --text: #F2F5F8;
    --text-dim: #8A96A6;
    --accent: #5AC8FA;
    --accent-soft: #10222B;
    --accent-line: #1F4557;
    --on-accent: #04222E;
    --good: #4ADE80;
    --warn: #FBBF24;
    --warn-soft: #2A2110;
    --warn-line: #5C4613;
    --protein: #4ADE80;
    --fat: #FBBF24;
    --carbs: #C084FC;
    --sleep: #7DD3FC;
    --bar-muted: #3C4856;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  z-index: 10;
}
.skip:focus { left: 0.5rem; }

/* ---------------------------------------------------------------- header -- */

.top {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1rem 1rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand .mark { width: 2.1rem; height: 2.1rem; }

.mark .mark-bg { fill: #0E161C; }
.mark .mark-line {
  fill: none;
  stroke: #5AC8FA;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mark .mark-ring { fill: #0B0D10; stroke: #5AC8FA; stroke-width: 2.8; }

.lang {
  display: inline-flex;
  background: var(--surface-alt);
  border-radius: 999px;
  padding: 3px;
}
.lang a {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.4;
}
.lang a[aria-current] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
}

/* ------------------------------------------------------------------ text -- */

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0.5rem 1rem 2rem;
}
.page-index main { max-width: var(--wide); }

h1 {
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 1.25rem 0 0.5rem;
}
h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 2.5rem 0 0.5rem;
  scroll-margin-top: 1rem;
}
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.25rem; }

p, ul, ol, dl { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; }
li + li { margin-top: 0.3rem; }

.meta { color: var(--text-dim); font-size: 0.9rem; }
.lede { font-size: 1.1rem; }
b.ui { font-weight: 650; }

mark.ph {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px dashed var(--warn-line);
  border-radius: 6px;
  padding: 0 0.25em;
  font-weight: 650;
}

.draft {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 1rem 0 0.5rem;
}

.callout {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
}
.callout > :last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- the glance -- */

.glance {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--gap);
}
.glance li {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.75rem;
  align-items: start;
  align-content: start;
}
.glance .ic { grid-row: span 2; color: var(--accent); width: 1.75rem; height: 1.75rem; }
.glance strong { line-height: 1.35; }
.glance span { color: var(--text-dim); font-size: 0.92rem; line-height: 1.45; }

.ic {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 0.5rem;
  margin: 1.5rem 0;
}
.toc h2 { margin: 0 0 0.25rem; font-size: 1rem; }
.toc ol { columns: 2 15rem; column-gap: 2rem; margin: 0 0 0.5rem; }
.toc li { break-inside: avoid; margin: 0 0 0.2rem; }

/* ---------------------------------------------------------------- tables -- */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
tr:last-child > th, tr:last-child > td { border-bottom: 0; }
thead th { color: var(--text-dim); font-weight: 600; font-size: 0.85rem; }
tbody th { font-weight: 600; }

/* ------------------------------------------------------- steps, questions -- */

.steps { list-style: none; padding: 0; counter-reset: step; margin: 1rem 0 1.25rem; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.85rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0 0 0.5rem;
}
.steps li::before {
  content: counter(step);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-weight: 700;
}

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 1rem;
  margin: 0 0 0.5rem;
}
summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.8rem 0;
}
details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 0.75rem; }
details > :last-child { margin-bottom: 0.9rem; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-weight: 650;
  text-decoration: none;
}
.button:hover { text-decoration: underline; }
.button .ic { width: 1.25rem; height: 1.25rem; }

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 1.25rem 0 2rem;
}
.contact p { margin: 0; color: var(--text-dim); font-size: 0.92rem; }

/* --------------------------------------------------------------- landing -- */

.hero { text-align: center; padding: 1.5rem 0 0.5rem; }
.hero .mark {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 22%;
  box-shadow: 0 10px 30px rgb(3 105 161 / 0.25);
}
.hero h1 { font-size: clamp(2.4rem, 9vw, 3.4rem); margin: 0.9rem 0 0.25rem; }
.hero .lede { color: var(--text-dim); max-width: 30rem; margin: 0 auto 1rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-size: 0.92rem;
  margin: 0;
}
.status .dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgb(22 101 52 / 0.18);
}

.shots { margin: 2.25rem 0 1.75rem; }
.phones {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.5rem, 3vw, 1.5rem);
}
.phones svg { width: min(31%, 12rem); height: auto; }
.phones svg:nth-child(2) { width: min(34%, 13rem); }

.phone-body { fill: var(--surface); stroke: var(--border); stroke-width: 2; }
.phone-notch { fill: var(--surface-alt); }
.phone-line { fill: var(--surface-alt); }
.ring-track { fill: none; stroke: var(--surface-alt); stroke-width: 9; }
.ring { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring.energy { stroke: var(--accent); }
.ring.protein { stroke: var(--protein); }
.ring.fat { stroke: var(--fat); }
.bar { fill: var(--bar-muted); }
.bar.today { fill: var(--accent); }
.target { stroke: var(--text-dim); stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; }
.trend { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dot-point { fill: var(--bar-muted); }

.features {
  list-style: none;
  padding: 0;
  margin: 0 auto 1.5rem;
  max-width: 46rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
}
.features li {
  flex: 1 1 6.5rem;
  max-width: 8.5rem;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.5rem 0.85rem;
  text-align: center;
  font-weight: 600;
}
.features li > span { display: block; }
.features .ic { display: block; margin: 0 auto 0.45rem; width: 2rem; height: 2rem; }
.c-energy { color: var(--accent); }
.c-protein { color: var(--protein); }
.c-fat { color: var(--fat); }
.c-carbs { color: var(--carbs); }
.c-sleep { color: var(--sleep); }

.promises {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.promises li {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dim);
  font-size: 0.92rem;
  background: var(--surface-alt);
  border-radius: 999px;
  padding: 0.3rem 0.85rem 0.3rem 0.6rem;
}
.promises .ic { width: 1.1rem; height: 1.1rem; color: var(--good); }

.lost { text-align: center; padding: 3rem 0; }
.lost-code { font-size: 4rem; font-weight: 800; color: var(--text-dim); margin: 0; line-height: 1; }

/* ---------------------------------------------------------------- footer -- */

.bottom {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1.25rem 1rem 2rem;
}
.bottom ul {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: var(--wide);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.25rem;
}
.bottom li { margin: 0; }
.bottom a { color: var(--text-dim); font-size: 0.92rem; }
.bottom a[aria-current] { color: var(--text); font-weight: 600; }

@media print {
  .top .lang, .bottom, .skip { display: none; }
  body { background: #fff; color: #000; }
}
