/* STACK primitives — bar, card, tile, chip, stack meter, category tag. README §1, §5, §8. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--char);
  color: var(--bone);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  padding-bottom: 84px; /* bottom nav clearance */
}

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

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input, select {
  font-family: inherit;
  color: var(--bone);
  background: var(--char-raised);
  border: none;
}

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

/* ---- Type scale (README §1) ---- */
.display-xl {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 6vw, 80px);
  letter-spacing: -0.045em;
  line-height: 0.82;
}
.display-l {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  letter-spacing: -0.035em;
  line-height: 0.85;
}
.display-m {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.body-l { font-size: 18px; font-weight: 400; line-height: 1.55; }
.body { font-size: 15px; font-weight: 400; line-height: 1.5; }
.label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.numeric { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- Primitives ---- */
.bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 52px;
  border-radius: var(--r-tile);
  padding: 0 20px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  width: 100%;
}
.bar-primary { background: var(--volt); color: var(--char); }
.bar-char { background: var(--char); color: var(--bone); }

.card {
  background: var(--char-raised);
  border-radius: var(--r-card);
  padding: 18px;
}

.tile { border-radius: var(--r-tile); }

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-chip);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--char);
}

.category-pantry { color: var(--haze); }
.category-fridge, .category-freezer { color: var(--chill); }
.category-budget { color: var(--beam); }
.category-expiring { color: var(--ember); }

/* ---- Stack meter — five pills, fills upward (README §5) ---- */
.stack-meter {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}
.stack-meter .pip {
  width: 12px;
  height: 14px;
  border-radius: var(--r-container);
  background: var(--slate);
}
.stack-meter .pip.filled { background: var(--volt); }

/* ---- Landing motion (README §6): everything lands, no fades ---- */
@keyframes land {
  from { transform: translateY(-16px); opacity: 0; }
  60% { transform: translateY(3px); opacity: 1; }
  to { transform: translateY(0); opacity: 1; }
}
.land {
  animation: land 240ms cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}

/* ---- Bottom nav ---- */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 68px;
  background: var(--char-raised);
  border-top: 2px solid var(--slate);
}
.bottom-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--slate-mid);
}
.bottom-nav button.active { color: var(--volt); }

.screen {
  padding: 26px 20px 20px;
}
