/* Adra landing page — plain CSS, no external requests, no JavaScript.
   Token names follow the shadcn-style architecture of mockups/ingredient-capture/index.html,
   mapped to the Adra obsidian palette (lib/design_system/design_system.dart, dark mode).
   Contrast rules: macro colors are used only as dots/bars/borders/backgrounds with
   primary/secondary text labels — never as small colored text. --tertiary is decoration only. */

:root {
  color-scheme: dark;
  /* shadcn-style tokens mapped to the Adra obsidian palette */
  --background: #0E0E0F;
  --foreground: #F2EDE4;
  --card: #161618;
  --card-foreground: #F2EDE4;
  --popover: #1E1E21;
  --popover-foreground: #F2EDE4;
  --primary: #E8E2D9;
  --primary-foreground: #1A1715;
  --secondary: #2A2A2E;
  --secondary-foreground: #F2EDE4;
  --muted: #1E1E21;
  --muted-foreground: #9E9589;
  --accent: #2A2A2E;
  --accent-foreground: #F2EDE4;
  --destructive: #C05C4A;
  --destructive-foreground: #F2EDE4;
  --border: #1C1C1F;
  --border-strong: #202023;
  --input: #2E2E33;
  --ring: #E8E2D9; /* ivory focus ring — #5E5A52 fails 3:1 non-text contrast */
  --tertiary: #5E5A52; /* decoration only — fails WCAG AA as text */

  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;

  /* macro colors — dots, bars, borders, backgrounds only; never small colored text */
  --cal: #C8C4BC;
  --prot: #7A8C58;
  --carb: #A87D4A;
  --fat: #96685E;

  /* spacing scale 4 → 64 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.1px;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus { left: 0; }

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ── Header ───────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--foreground);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  width: 26px;
  height: 26px;
  color: var(--primary);
}

.site-nav {
  order: 3;
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
  letter-spacing: 0.3px;
}

.site-nav a { color: var(--muted-foreground); }

.site-nav a:hover {
  color: var(--foreground);
  text-decoration: none;
}

.play-badge {
  display: inline-flex;
  margin-left: auto;
}

.play-badge-img {
  display: block;
  height: 40px;
  width: auto;
}

.play-badge--lg .play-badge-img { height: 56px; }

/* ── Sections ─────────────────────────────── */

.section {
  padding-block: 64px;
  border-top: 1px solid var(--border);
}

.section h2 {
  margin: 0 0 16px;
  font-size: clamp(26px, 4.5vw, 36px);
  font-weight: 300;
  letter-spacing: 0.5px;
  line-height: 1.15;
}

section[id] { scroll-margin-top: 112px; }

/* ── Hero ─────────────────────────────────── */

.hero { padding-block: 56px 64px; }

.hero-grid {
  display: grid;
  gap: 48px;
}

.hero-copy { max-width: 560px; }

.eyebrow {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(34px, 8vw, 56px);
  font-weight: 300;
  letter-spacing: 0.5px;
  line-height: 1.08;
}

.lede {
  margin: 0 0 28px;
  font-size: clamp(17px, 2.2vw, 19px);
  color: var(--muted-foreground);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.text-link {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--tertiary);
}

.text-link:hover { text-decoration-color: var(--foreground); }

.trust-line {
  margin: 0;
  font-size: 14px;
  color: var(--muted-foreground);
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ── Phone frames ─────────────────────────── */

.phone {
  position: relative;
  width: 100%;
  max-width: 320px;
  border-radius: 44px;
  border: 1px solid #26262a;
  background: #050506;
  padding: 10px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.screen {
  width: 100%;
  aspect-ratio: 1080 / 2424;
  border-radius: 36px;
  overflow: hidden;
  background: var(--background);
}

.screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screen picture { display: contents; }

.phone--step {
  max-width: 220px;
  border-radius: 36px;
  padding: 8px;
}

.phone--step .screen { border-radius: 28px; }

/* AI Model visual: the frame is cut off at the top (flat top edge, no top
   bezel, rounded bottom) so it reads as a crop of a complete phone photo. */
.phone--settings {
  max-width: 300px;
  border-radius: 0 0 44px 44px;
  border-top: 0;
  padding: 0 10px 10px;
}

.phone--settings .screen {
  aspect-ratio: 1080 / 1828;
  border-radius: 0 0 36px 36px;
}

/* per-image aspect ratios — set on .screen so the image fills it exactly (no cover-crop) */
.phone--hero .screen { aspect-ratio: 1080 / 2400; }
.phone--snap .screen { aspect-ratio: 1080 / 2400; }
.phone--confirm .screen { aspect-ratio: 1080 / 2424; }
.phone--move-on .screen { aspect-ratio: 1080 / 2424; }

/* ── Macro legend ─────────────────────────── */

.macro-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.macro-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.macro-dot--cal { background: var(--cal); }
.macro-dot--prot { background: var(--prot); }
.macro-dot--carb { background: var(--carb); }
.macro-dot--fat { background: var(--fat); }

/* ── Problem ──────────────────────────────── */

.problem-grid {
  display: grid;
  gap: 32px;
  margin-top: 32px;
}

.problem-copy p {
  margin: 0 0 16px;
  max-width: 640px;
  color: var(--muted-foreground);
}

.contrast-card {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}

.contrast-col { padding: 24px; }

.contrast-col + .contrast-col { border-top: 1px solid var(--border); }

.contrast-col h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.contrast-col--adra h3 { color: var(--foreground); }

.contrast-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 15px;
}

.contrast-col li {
  position: relative;
  padding-left: 16px;
}

.contrast-col li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tertiary);
}

.contrast-col--adra li::before { background: var(--primary); }

/* ── How it works ─────────────────────────── */

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

.step {
  display: grid;
  gap: 16px;
  justify-items: start;
}

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

.step-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.step-num {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--muted-foreground);
}

.step p {
  margin: 0;
  color: var(--muted-foreground);
}

/* ── Why on-device ────────────────────────── */

.why-grid {
  display: grid;
  gap: 48px;
}

.why-copy .lede { max-width: 640px; }

.proof-list {
  display: grid;
  gap: 24px;
  margin: 32px 0;
  padding: 0;
  list-style: none;
}

.proof-list h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.proof-list p {
  margin: 0;
  color: var(--muted-foreground);
}

.tech-note {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 14px 16px;
  font-size: 14px;
}

.tech-note summary {
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.tech-note p {
  margin: 12px 0 0;
  color: var(--muted-foreground);
}

.why-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 0;
}

.why-visual figcaption {
  max-width: 360px;
  font-size: 13px;
  text-align: center;
  color: var(--muted-foreground);
}

/* ── Limits ───────────────────────────────── */

.limits-grid {
  display: grid;
  gap: 24px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.limits-grid li {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 24px;
}

.limits-grid h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.limits-grid p {
  margin: 0;
  font-size: 15px;
  color: var(--muted-foreground);
}

/* ── Accessibility ────────────────────────── */

.accessibility .lede { max-width: 640px; }

.a11y-grid {
  display: grid;
  gap: 24px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.a11y-grid h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.a11y-grid p {
  margin: 0;
  color: var(--muted-foreground);
}

/* ── Pricing ──────────────────────────────── */

.price-cards {
  display: grid;
  gap: 24px;
  margin-top: 32px;
}

.price-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 28px;
}

.price-card--full {
  border-color: var(--border-strong);
  background: var(--popover);
}

.price-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.price {
  margin: 0 0 20px;
  font-size: 34px;
  font-weight: 300;
  letter-spacing: 0.5px;
}

.price-note {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.3px;
  color: var(--muted-foreground);
}

.price-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.price-list li {
  position: relative;
  padding-left: 18px;
}

.price-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.price-emphasis {
  margin: 20px 0 0;
  font-style: italic;
  color: var(--muted-foreground);
}

.compare {
  width: 100%;
  margin-top: 40px;
  border-collapse: collapse;
  font-size: 15px;
}

.compare caption {
  margin-bottom: 12px;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-align: left;
  color: var(--muted-foreground);
}

.compare th,
.compare td {
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.compare thead th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.compare tbody th { font-weight: 500; }

.compare td[rowspan] {
  border-left: 1px solid var(--border);
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.3px;
}

.footnote {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted-foreground);
}

.refund {
  margin: 8px 0 0;
  font-style: italic;
  color: var(--muted-foreground);
}

/* ── FAQ ──────────────────────────────────── */

.faq-list {
  max-width: 800px;
  margin-top: 32px;
  border-top: 1px solid var(--border);
}

.faq-list details { border-bottom: 1px solid var(--border); }

.faq-list summary {
  cursor: pointer;
  padding: 18px 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.faq-list summary::marker { color: var(--muted-foreground); }

.faq-list details p {
  margin: 0 0 18px;
  max-width: 680px;
  color: var(--muted-foreground);
}

/* ── Footer ───────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 48px 32px;
}

.footer-grid {
  display: grid;
  gap: 32px;
}

.footer-about p {
  margin: 16px 0 0;
  max-width: 520px;
  font-size: 15px;
  color: var(--muted-foreground);
}

.footer-links {
  display: grid;
  gap: 10px;
  align-content: start;
  font-size: 15px;
}

.footer-links a { color: var(--foreground); }

.footer-meta {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted-foreground);
}

.footer-meta p { margin: 0; }

/* ── Breakpoints ──────────────────────────── */

@media (min-width: 720px) {
  .container { padding-inline: 32px; }

  .site-nav {
    order: 0;
    flex-basis: auto;
    margin-left: auto;
  }

  .play-badge { margin-left: 0; }

  section[id] { scroll-margin-top: 88px; }

  .problem-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
  }

  .contrast-card { grid-template-columns: 1fr 1fr; }

  .contrast-col + .contrast-col {
    border-top: 0;
    border-left: 1px solid var(--border);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }

  .step p { font-size: 15px; }

  .limits-grid { grid-template-columns: 1fr 1fr; }

  .a11y-grid { grid-template-columns: 1fr 1fr; }

  .price-cards { grid-template-columns: 1fr 1fr; }

  .compare th,
  .compare td { padding: 12px 14px; }

  .footer-grid { grid-template-columns: 1.4fr 1fr; }

  .footer-meta {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 24px;
  }
}

@media (min-width: 960px) {
  .container { padding-inline: 40px; }

  .hero { padding-block: 80px 96px; }

  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 64px;
  }

  .why-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 64px;
  }
}

/* ── Reduced motion ───────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}
