/* ============================================================
   Body Signals - base
   Reset, document defaults, layout shell, typography.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;      /* stop iOS zooming our type */
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--c-cream);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: var(--lh-body);
  font-weight: 400;
  min-height: 100dvh;
  overscroll-behavior-y: none;         /* no rubber-band on the app shell */
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button { background: none; border: none; padding: 0; cursor: pointer; }

/* Inputs must be >=16px or iOS zooms the whole viewport on focus. */
input, textarea, select { font-size: 1rem; }

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

/* ---- focus -------------------------------------------------
   Visible for keyboard users, absent for pointer users.
   Never remove the outline without replacing it. */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--c-terra-soft); color: var(--c-forest); }

/* ============================================================
   App shell
   ============================================================ */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: var(--w-max);
  margin-inline: auto;
  background: var(--c-cream);
}

.app__main {
  flex: 1 1 auto;
  padding: var(--s-2) var(--pad-x) var(--s-6);
  padding-top: calc(var(--s-2) + var(--safe-t));
  /* Room for the tab bar so the last control is never trapped under it. */
  padding-bottom: calc(72px + var(--safe-b));
}
.app__main--full { padding-bottom: calc(var(--s-6) + var(--safe-b)); }

/* Screens fade in. 120ms - enough to feel deliberate, not enough to wait. */
.screen { animation: screen-in var(--m-base) var(--m-ease); }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
}

/* ============================================================
   Typography
   ============================================================ */

.title {
  font-family: var(--f-display);
  font-size: var(--t-lg);
  font-weight: 600;
  line-height: 1.1;
  color: var(--c-sage-deep);
  margin: 0;
  letter-spacing: 0.01em;
}

.question {
  font-family: var(--f-display);
  font-size: var(--t-xl);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--c-ink);
  margin: var(--s-3) 0 var(--s-2);
  text-wrap: balance;
}

.hero-num {
  font-family: var(--f-display);
  font-size: var(--t-2xl);
  font-weight: 400;
  line-height: 1;
  color: var(--c-sage-deep);
  font-variant-numeric: tabular-nums;
}

.label {
  font-size: var(--t-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  font-weight: 700;
  color: var(--c-terra);
  margin: 0 0 var(--s-2);
}

.sub  { font-size: var(--t-sm);   color: var(--c-ink-soft); margin: 0 0 var(--s-4); }
.note { font-size: var(--t-sm);   color: var(--c-ink-soft); line-height: var(--lh-body); margin: 0; }
.meta { font-size: var(--t-xs);   color: var(--c-ink-soft); line-height: 1.55; margin: 0; }

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

/* Screen header: title left, context right. Used on every screen. */
.screen-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin: var(--s-2) 0 var(--s-4);
}
.screen-head__meta {
  font-size: var(--t-xs);
  letter-spacing: 0.05em;
  color: var(--c-ink-soft);
  white-space: nowrap;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---- utilities (kept deliberately few) ---- */
.stack > * + * { margin-top: var(--s-3); }
.row      { display: flex; align-items: center; gap: var(--s-3); }
.spread   { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.center   { text-align: center; }
.push-top { margin-top: auto; }
.hidden   { display: none !important; }

.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;
}

.divider { height: 1px; background: var(--c-line); margin: var(--s-4) 0; border: 0; }
