/* Eatova site — base layer: reset, typography, shared primitives.
   Section files must only add prefixed classes; never restyle these selectors. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
strong { font-weight: 600; }

::selection { background: var(--lime); color: var(--on-lime); }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* The skip link is an .sr-only anchor; it must become visible when focused. */
a.sr-only:focus-visible {
  position: fixed; top: var(--space-sm); left: var(--space-sm); z-index: var(--z-modal);
  width: auto; height: auto; margin: 0; padding: var(--space-xs) var(--space-md);
  overflow: visible; clip: auto; white-space: normal;
  background: var(--lime); color: var(--on-lime);
  border-radius: var(--radius-pill); font-weight: 600;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: var(--section-y-tight); }
.section--loose { padding-block: var(--section-y-loose); }
.section--top-tight { padding-block-start: var(--section-y-tight); }

/* ---------- Typography ---------- */
.display, .h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.02;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: anywhere;
  min-width: 0;
  font-variation-settings: 'opsz' 96;
}
.h1 { font-size: var(--h1); font-weight: 800; letter-spacing: -0.035em; line-height: 0.96; }
.h2 { font-size: var(--h2); }
.h3 { font-size: var(--h3); line-height: 1.12; letter-spacing: -0.02em; font-variation-settings: 'opsz' 48; }

.lead {
  font-size: var(--text-xl);
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
  max-width: 48ch;
}
.body-lg { font-size: var(--text-lg); line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.muted { color: var(--ink-2); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lime);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex: none;
}
.eyebrow--plain::before { display: none; }

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.num { font-variant-numeric: tabular-nums; }

/* Section header block shared by most sections */
.sec-head { display: grid; gap: 18px; max-width: 720px; }
.sec-head--center { margin-inline: auto; text-align: center; justify-items: center; }
.sec-head .lead { margin-top: var(--space-2xs); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surf-2);
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding-inline: var(--space-lg);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform var(--dur-micro) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { --btn-bg: var(--lime); --btn-fg: var(--on-lime); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink-a24); }
.btn-forest { --btn-bg: var(--forest); --btn-fg: var(--lime); }
.btn--sm { height: 42px; padding-inline: var(--space-md); font-size: 14px; }
.btn--lg { height: 58px; padding-inline: calc(var(--space-lg) + var(--space-xs)); font-size: 16px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--surf);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: var(--rule-hair) solid var(--line);
}
.card--forest { background: var(--forest); border-color: var(--lime-a10); --ink: var(--on-forest); --ink-2: var(--on-forest-2); color: var(--ink); }

/* Dot grid texture — the calorie card's pattern */
.dots {
  background-image: radial-gradient(var(--lime-a12) 1px, transparent 1.2px);
  background-size: 22px 22px;
}

/* ---------- Screenshot figure ----------
   <figure class="phone" style="--phone-w:320px"><img src="assets/screens/today-top.webp" alt="…" width="1206" height="2622"></figure>
   A real screenshot with a hairline border and rounded corners — no drawn bezel, no notch (Hallmark gate 47).
   Screens are 1206×2622 raw iPhone screenshots (include status bar). */
.phone {
  --phone-w: 300px;
  width: var(--phone-w);
  max-width: 100%;
  aspect-ratio: 1206 / 2622;
  border-radius: var(--radius-lg);
  border: var(--rule-hair) solid var(--line-strong);
  box-shadow: var(--shadow-figure);
  background: var(--bg);
  position: relative;
  overflow: hidden;
  flex: none;
}
.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
/* Cropped variant: fixed height, shows the top of the screen, open at the bottom */
.phone--crop {
  aspect-ratio: auto;
  height: var(--phone-h, 420px);
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* ---------- Tick gauge (signature motif) ----------
   <div class="ticks" data-ticks="36" data-fill="0.52" aria-hidden="true"></div>
   main.js renders <i> children; --fill 0..1 decides how many are lit. */
.ticks { display: flex; gap: var(--space-2xs); align-items: flex-end; justify-content: space-between; }
.ticks i {
  flex: 1 1 0;
  min-width: 3px;
  max-width: 7px;
  height: var(--tick-h, 28px);
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 320ms var(--ease-out), transform 320ms var(--ease-out);
  transform-origin: bottom;
}
.ticks i.is-on { background: var(--lime); }
.ticks--rule { gap: clamp(3px, 1.2vw, 6px); }
.ticks--rule i { height: 14px; flex: 1 1 0; min-width: 2px; max-width: 3px; }

/* ---------- Scroll reveal — retired ----------
   The universal fade-up was removed in the Hallmark pass. .reveal is inert; content is simply there. */
.reveal { opacity: 1; transform: none; }

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticks i { transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
