/* Aurelux v2 · base.css
 * What every site shares: the reset, the floor rules, the container, and the
 * few components that appear on more than one page (buttons, forms, prose).
 * Colour, type and texture come from tokens-<site>.css; the page comes from
 * site-<site>.css. Nothing here may set a colour literal.
 */

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); scroll-padding-top: var(--space-3xl); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 22%, transparent); color: var(--color-ink); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
img, video { max-width: 100%; height: auto; display: block; }
svg { display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }

h1, h2, h3, h4 {
  margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 700);
  font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.05;
  overflow-wrap: break-word; min-width: 0; text-wrap: balance;
}
h1 { max-width: 20ch; font-size: var(--text-display); }
h2 { max-width: 30ch; font-size: var(--text-section); }
h3 { max-width: 40ch; font-size: var(--text-title); line-height: 1.2; }
p { margin: 0; text-wrap: pretty; }
p:not([class]) { max-width: 65ch; }
.lead { font-size: var(--text-lead); line-height: 1.45; max-width: 52ch; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; }
.section { padding-block: var(--section-gap); }
.section-tight { padding-block: var(--section-gap-s); }
.band { background: var(--color-paper-2); color: var(--color-ink); padding-block: var(--section-gap-s); }

.skip {
  position: absolute; left: var(--space-md); top: -4rem; z-index: var(--z-toast);
  background: var(--color-ink); color: var(--color-paper); padding: var(--space-sm) var(--space-md);
  text-decoration: none; transition: top var(--dur-short) var(--ease-out);
}
.skip:focus-visible { top: var(--space-md); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num, .figure, td.num { font-variant-numeric: tabular-nums; }

/* buttons: one filled primary, secondaries outlined. Sites may restyle. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: 48px; padding-inline: var(--space-lg);
  font-family: var(--font-body); font-size: var(--text-sm);
  background: var(--color-ink); color: var(--color-paper);
  border: var(--rule-hair) solid var(--color-ink); border-radius: var(--radius-card);
  text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.btn:hover { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.btn:active { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; background: var(--color-muted); border-color: var(--color-muted); }
.btn-quiet { background: transparent; color: var(--color-ink); border-color: var(--color-rule-ink); }
.btn-quiet:hover { background: var(--color-paper-2); color: var(--color-ink); border-color: var(--color-ink); }

/* forms */
.field { display: grid; gap: var(--space-2xs); }
.field label, label { font-size: var(--text-sm); color: var(--color-ink-2); }
input[type="text"], input[type="email"], input[type="tel"], input[type="search"], input[type="number"], select, textarea {
  min-height: 52px; padding-inline: var(--space-md); padding-block: var(--space-sm);
  background: var(--color-paper); color: var(--color-ink);
  border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-card);
  transition: background-color var(--dur-micro) var(--ease-out);
  width: 100%;
}
textarea { min-height: 96px; resize: vertical; background: var(--color-paper-2); }
select { background: var(--color-paper-2); }
input:hover, select:hover, textarea:hover { background: var(--color-paper-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; background: var(--color-paper-2); color: var(--color-muted); }
input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: var(--color-error); }
.hint { font-size: var(--text-xs); color: var(--color-muted); }

/* prose pages: about, terms, the shop's own text */
.prose { max-width: none; }
.prose .page-head { margin-bottom: var(--space-xl); }
.prose .entry-body { max-width: 68ch; font-size: var(--text-lg); line-height: 1.7; }
.prose .entry-body p + p { margin-top: var(--space-md); }
.prose .entry-body h2 { margin-top: var(--space-2xl); margin-bottom: var(--space-md); font-size: var(--text-2xl); }
.prose .entry-body h3 { margin-top: var(--space-xl); margin-bottom: var(--space-sm); font-size: var(--text-xl); }
.prose .entry-body ul, .prose .entry-body ol { padding-left: var(--space-lg); }
.prose .entry-body li + li { margin-top: var(--space-xs); }
.entry + .entry { margin-top: var(--space-2xl); padding-top: var(--space-xl); border-top: var(--rule-hair) solid var(--color-rule); }
.page-numbers { display: inline-block; padding: var(--space-xs) var(--space-sm); }

@media (max-width: 60rem) {
  :root { --gutter: 24px; --section-gap-s: 80px; --section-gap: 96px; --section-gap-l: 120px; }
}
@media (max-width: 40rem) {
  :root { --gutter: 16px; --section-gap-s: 56px; --section-gap: 72px; --section-gap-l: 96px; --gap-columns: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}
