/* ==========================================================================
   base.css
   Reset, type scale, layout primitives, focus, motion policy.
   Token-driven only. No literal colors, fonts, or copy.
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Sticky header plus the category rail must not cover a scrolled-to heading */
  scroll-padding-top: calc(var(--header-h) + 3.5rem);
}

body {
  min-height: 100svh;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: var(--weight-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Mobile-first hard requirement: nothing may scroll sideways at 375px */
  overflow-x: hidden;
}

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

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

p,
li,
dd {
  overflow-wrap: break-word;
}

a {
  color: inherit;
}

table {
  border-collapse: collapse;
}

dialog {
  border: 0;
  padding: 0;
  max-width: 100%;
  max-height: 100%;
  color: inherit;
  background: transparent;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

[hidden] {
  display: none !important;
}

:target {
  scroll-margin-top: calc(var(--header-h) + 3.5rem);
}

/* --- Focus ---------------------------------------------------------------
   A ring that survives any theme. Two-tone: the outline carries the accent,
   the inset shadow separates it from whatever sits underneath. Never removed. */

:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-sm);
}

.on-ink :focus-visible,
.on-ink:focus-visible {
  outline-color: var(--color-focus-on-ink);
}

/* Some browsers still paint the UA ring on dialogs when opened. */
dialog:focus,
dialog:focus-visible {
  outline: none;
}

/* --- Type ----------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-weight: var(--weight-strong);
  line-height: var(--leading-snug);
  text-wrap: balance;
}

/* The display face is reserved. Only these classes may reach for it. */
.display,
.h-hero,
.h-section,
.h-category,
.price {
  font-family: var(--font-display);
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-display);
}

.h-hero {
  font-size: var(--step-5);
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

.h-section {
  font-size: var(--step-3);
  line-height: var(--leading-snug);
}

.h-category {
  font-size: var(--step-2);
  line-height: var(--leading-snug);
  text-transform: uppercase;
}

.price {
  font-size: var(--step-1);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--color-chile);
}

/* Mono is reserved: the ticket, order numbers, pickup times. */
.mono {
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-mono);
  font-variant-numeric: tabular-nums;
}

.lede {
  font-size: var(--step-1);
  line-height: var(--leading-body);
  max-width: var(--measure);
}

.prose {
  max-width: var(--measure);
  line-height: var(--leading-loose);
}

.muted {
  color: var(--color-text-muted);
}

.eyebrow {
  font-size: var(--step--1);
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* Inline text links: underline, no decorative arrows (house rule). */
.link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--color-chile);
  transition: color var(--dur-base) var(--ease),
              text-decoration-color var(--dur-base) var(--ease);
}

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

.on-ink .link {
  text-decoration-color: var(--color-on-ink-muted);
}

.on-ink .link:hover {
  color: var(--color-surface);
  text-decoration-color: currentColor;
}

/* --- Layout primitives ---------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: var(--wrap-gutter);
}

.wrap--narrow {
  max-width: 48rem;
}

.stack > * + * {
  margin-block-start: var(--stack-gap, var(--space-4));
}

.stack-2 > * + * { margin-block-start: var(--space-2); }
.stack-3 > * + * { margin-block-start: var(--space-3); }
.stack-5 > * + * { margin-block-start: var(--space-5); }
.stack-6 > * + * { margin-block-start: var(--space-6); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--space-3));
}

.section {
  padding-block: var(--space-7);
}

.section--tight {
  padding-block: var(--space-6);
}

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

.on-ink .muted {
  color: var(--color-on-ink-muted);
}

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

.on-paper .muted {
  color: var(--color-on-paper-muted);
}

/* Horizontal scrollers (category rail) keep their overflow to themselves. */
.scroller {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  overscroll-behavior-inline: contain;
}

.scroller::-webkit-scrollbar {
  display: none;
}

/* --- Utility -------------------------------------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-3);
  inset-block-start: var(--space-3);
  z-index: calc(var(--z-header) + 1);
  transform: translateY(-200%);
  background: var(--color-chile);
  color: var(--color-on-chile);
  padding: var(--space-3) var(--space-4);
  font-weight: var(--weight-strong);
  border-radius: var(--radius-sm);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.5em; height: 1.5em; }

.divider {
  border: 0;
  border-block-start: var(--border-hair) solid var(--color-line);
}

.on-ink .divider {
  border-block-start-color: var(--color-line-on-ink);
}

/* --- Motion policy -------------------------------------------------------
   One orchestrated moment (the ticket print) lives in components.css.
   Reduced motion disables it entirely and flattens everything else. */

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

  .scroller {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Print ---------------------------------------------------------------
   The confirmation ticket is a real artifact. Let people print it. */

@media print {
  .site-header,
  .site-footer,
  .demo-dock,
  .viewbar,
  .no-print {
    display: none !important;
  }
}
