/* Colors mirror apps/mobile/src/theme/tokens.ts. Dark first, light matches it. */
:root {
  --bg: #131715;
  --surface-1: #1b201d;
  --surface-2: #252b27;
  --surface-3: #303732;
  --hairline: rgba(255, 255, 255, 0.07);
  --text: #ece8df;
  --text-muted: #9a998d;
  --text-faint: #5e625a;
  --accent: #7fb8ac;
  --accent-deep: #4a8a7e;
  --on-accent: #131715;
  --band: #1b201d;
  --footer: #0e1210;
  --card-shadow: none;
  --phone-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f1eee8;
    --surface-1: #fbfaf7;
    --surface-2: #e5e0d6;
    --surface-3: #d9d3c7;
    --hairline: rgba(30, 37, 34, 0.08);
    --text: #1e2522;
    --text-muted: #6a6960;
    --text-faint: #a5a297;
    --accent: #3f7d74;
    --accent-deep: #2b5b54;
    --on-accent: #fbfaf7;
    --band: #ffffff;
    --footer: #e7e2d9;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    --phone-shadow: 0 40px 80px -36px rgba(30, 37, 34, 0.35);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.num { font-variant-numeric: tabular-nums; }

/* Header / footer */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand img { width: 34px; height: 34px; }

.site-header nav { display: flex; gap: 24px; }

.site-header nav a,
.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.site-header nav a:hover,
.site-footer a:hover { color: var(--text); }

.site-footer {
  background: var(--footer);
  color: var(--text-faint);
  font-size: 14px;
}

.site-footer .wrap {
  padding-top: 36px;
  padding-bottom: 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
}

.site-footer .spacer { flex: 1; }

/* Type */

h1, h2, h3 { font-weight: 600; margin: 0; }

.display {
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1;
  letter-spacing: -0.035em;
}

.display em {
  font-style: normal;
  color: var(--accent);
}

.lede {
  color: var(--text-muted);
  font-size: clamp(18px, 2vw, 20px);
  max-width: 30em;
  margin: 24px 0 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

h2 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.section-lede {
  color: var(--text-muted);
  max-width: 34em;
  margin: 16px 0 0;
}

/* Buttons */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  transition: transform 150ms cubic-bezier(0.2, 0, 0, 1);
}

.btn:active { transform: scale(0.97); }

/* Not in the store yet: an outlined pill that reads as a label, not an action. */
.btn-soon {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  cursor: default;
}

.btn-soon:active { transform: none; }

.btn svg { width: 20px; height: 20px; }

.cta-note {
  color: var(--text-faint);
  font-size: 14px;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding-top: 48px;
  padding-bottom: 112px;
}

.hero .phone { justify-self: center; }

/* Sections */

section { padding: 112px 0; }

.band { background: var(--band); }

/* Cards that sit on a band take the page color so they still stand apart. */
.band .type-it { background: var(--bg); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.split .phone { justify-self: center; }

.steps {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  display: grid;
  gap: 28px;
}

.steps li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
}

.steps .n {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 15px;
}

.steps h3 { font-size: 20px; letter-spacing: -0.01em; }

.steps p { margin: 4px 0 0; color: var(--text-muted); }

.type-it {
  margin-top: 36px;
  background: var(--surface-1);
  box-shadow: var(--card-shadow);
  border-radius: 24px;
  padding: 18px 20px;
  max-width: 420px;
}

.type-it .input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
}

.type-it .caret {
  display: inline-block;
  width: 2px;
  height: 18px;
  background: var(--accent);
  vertical-align: -3px;
  margin-left: 2px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.type-it .arrow { color: var(--text-faint); font-size: 13px; }

.type-it .result {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
  padding: 0 2px;
}

.type-it .result span:first-child { font-size: 16px; }
.type-it .result small { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.type-it .result strong { font-weight: 600; font-size: 18px; }

/* Principles */

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.card {
  background: var(--surface-1);
  box-shadow: var(--card-shadow);
  border-radius: 24px;
  padding: 28px;
}

.card h3 {
  font-size: 20px;
  letter-spacing: -0.01em;
}

.card p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 16px;
}

.card .icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.card .icon svg { width: 20px; height: 20px; }

/* Not-list */

.nots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
  padding: 0;
  list-style: none;
}

.nots li {
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: line-through;
  text-decoration-color: var(--text-faint);
}

.closing { text-align: center; }

.closing img { width: 64px; height: 64px; margin: 0 auto 28px; }

.closing .section-lede { margin-left: auto; margin-right: auto; }

.closing .cta-row { justify-content: center; }

.disclaimer {
  color: var(--text-faint);
  font-size: 13px;
  max-width: 40em;
  margin: 40px auto 0;
  text-align: center;
}

/* Phone mockups: sized to the app's own tokens at ~0.8 scale */

.phone {
  width: 300px;
  height: 620px;
  border-radius: 44px;
  background: var(--bg);
  padding: 10px;
  box-shadow: 0 0 0 1px var(--hairline), 0 0 0 9px var(--surface-2), var(--phone-shadow);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.screen {
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  position: relative;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.status {
  display: flex;
  justify-content: space-between;
  padding: 12px 22px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.status .cam {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-3);
}

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 0;
}

.app-bar .title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

.app-bar .avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}

.ring-wrap {
  position: relative;
  width: 216px;
  height: 216px;
  margin: 12px auto 0;
}

.ring-wrap svg { position: absolute; inset: 0; transform: rotate(-90deg); }

.ring-track { stroke: var(--surface-3); }
.ring-arc { stroke: var(--accent); }
.ring-inner { stroke: var(--text-muted); }

.ring-arc,
.ring-inner {
  stroke-linecap: round;
  animation: sweep 1.4s cubic-bezier(0.2, 0, 0, 1) both 300ms;
}

@keyframes sweep { from { stroke-dashoffset: var(--full); } }

.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.ring-center .big {
  font-size: 62px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.ring-center .label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  margin-top: 6px;
}

.ring-center .sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 3px;
}

.meals {
  display: grid;
  gap: 9px;
  padding: 16px 16px 0;
}

.meal {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-1);
  box-shadow: var(--card-shadow);
  border-radius: 20px;
  padding: 11px 13px;
}

.meal .thumb {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  object-fit: cover;
  background: var(--surface-3);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.meal .thumb svg { width: 20px; height: 20px; }

.meal .info { flex: 1; min-width: 0; }

.meal .name {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meal .when { font-size: 10.5px; font-weight: 500; color: var(--text-muted); }

.meal .kcal { font-size: 16px; font-weight: 600; }

.fab {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  height: 44px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}

.fab svg { width: 18px; height: 18px; }

/* Scan screen */

.scan-photo {
  height: 190px;
  object-fit: cover;
  width: 100%;
}

.sheet {
  flex: 1;
  margin-top: -26px;
  position: relative;
  background: var(--surface-2);
  border-radius: 24px 24px 0 0;
  padding: 10px 16px 0;
  display: flex;
  flex-direction: column;
}

.sheet .grab {
  width: 32px;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  margin: 0 auto 12px;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.sheet-head .title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.sheet-head .total { font-size: 17px; font-weight: 600; }
.sheet-head .total small { color: var(--text-muted); font-size: 11px; font-weight: 500; }

.items { margin-top: 8px; }

.item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
  opacity: 0;
  transform: translateY(6px);
  animation: land 400ms cubic-bezier(0.2, 0, 0, 1) forwards;
}

.item:nth-child(1) { animation-delay: 500ms; }
.item:nth-child(2) { animation-delay: 560ms; }
.item:nth-child(3) { animation-delay: 620ms; }
.item:nth-child(4) { animation-delay: 680ms; }
.item:nth-child(5) { animation-delay: 740ms; }

@keyframes land { to { opacity: 1; transform: none; } }

.item .info { flex: 1; min-width: 0; }
.item .name { font-size: 13px; }

.item .portion { font-size: 10.5px; font-weight: 500; color: var(--text-muted); }

.item .portion.unsure {
  text-decoration: underline dotted var(--text-faint);
  text-underline-offset: 3px;
}

.item .kcal { font-size: 13px; font-weight: 600; }

.pill-check {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--surface-3);
  border-radius: 999px;
  padding: 2px 7px;
}

.chips { display: flex; gap: 5px; margin-top: 7px; }

.chip {
  font-size: 10.5px;
  font-weight: 500;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface-3);
  color: var(--text-muted);
}

.chip.on { background: var(--accent); color: var(--on-accent); }

.add-item {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  padding: 10px 0 0;
}

/* Legal pages */

.legal {
  max-width: 720px;
  padding-top: 32px;
  padding-bottom: 112px;
}

.legal h1 {
  font-size: clamp(36px, 5vw, 48px);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.legal .updated { color: var(--text-muted); margin: 12px 0 0; font-size: 15px; }

.legal .summary {
  background: var(--surface-1);
  box-shadow: var(--card-shadow);
  border-radius: 24px;
  padding: 24px 28px;
  margin: 36px 0 8px;
}

.legal .summary h2 { font-size: 18px; letter-spacing: -0.01em; margin: 0 0 8px; }
.legal .summary ul { margin: 0; padding-left: 20px; color: var(--text-muted); }
.legal .summary li + li { margin-top: 4px; }

.legal h2 {
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 48px 0 0;
  scroll-margin-top: 24px;
}

.legal h3 { font-size: 17px; margin: 24px 0 0; }

.legal p,
.legal li { color: var(--text-muted); }

.legal p { margin: 12px 0 0; }
.legal ul { margin: 12px 0 0; padding-left: 20px; }
.legal li + li { margin-top: 6px; }
.legal strong { color: var(--text); font-weight: 500; }
.legal a { color: var(--accent); text-underline-offset: 3px; }

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 15px;
}

.legal th,
.legal td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--hairline);
}

.legal th { color: var(--text); font-weight: 500; }
.legal td { color: var(--text-muted); }

.table-scroll { overflow-x: auto; }

/* Responsive */

@media (max-width: 880px) {
  .hero,
  .split { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .split .copy { order: -1; }
  .principles { grid-template-columns: 1fr; }
  section { padding: 88px 0; }
  .hero { padding-bottom: 88px; }
}

@media (max-width: 380px) {
  .phone { transform: scale(0.9); transform-origin: top center; margin-bottom: -62px; }
  .site-header nav { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .item { opacity: 1; transform: none; }
}
