/*
  Base: reset, typography and the accessibility basics (focus, selection, skip link, screen-reader text).
*/

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
  /* Smooth anchor scrolling only for people who did not ask for less motion. */
  scroll-behavior: smooth;
  interpolate-size: allow-keywords; /* lets <details> animate to "auto" height where supported */
  /* Scrollbars: a thin thumb on a clear track (every scroll area inherits the colours). Where they take
     room, the page's bar floats instead (html.has-floating-scrollbar below); otherwise its space is kept,
     so a page never jumps sideways when it grows long enough to scroll. */
  scrollbar-gutter: stable;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
/* thin in every scroll area (a component may still hide its bar: scrollbar-width: none) */
* { scrollbar-width: thin; }
/* Where the system's bars take room, the page's own bar is hidden and a floating one drawn over the
   content instead (ui/components/scrollbar.js): no gutter, nothing reserved, nothing jumps. */
html.has-floating-scrollbar { scrollbar-width: none; scrollbar-gutter: auto; }
html.has-floating-scrollbar::-webkit-scrollbar { display: none; }
.page-scrollbar {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-scrollbar); width: 14px;
  opacity: 0; transition: opacity var(--dur-panel) var(--ease);
}
.page-scrollbar.is-visible, .page-scrollbar:hover, .page-scrollbar.is-dragging { opacity: 1; }
.page-scrollbar__thumb {
  position: absolute; top: 0; right: 3px; width: 6px; border-radius: 6px;
  background: var(--scrollbar-thumb); box-shadow: 0 0 0 1px color-mix(in oklab, var(--bg) 55%, transparent);
  transition: width var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.page-scrollbar:hover .page-scrollbar__thumb, .page-scrollbar.is-dragging .page-scrollbar__thumb {
  width: 9px; background: color-mix(in oklab, var(--ink) 48%, transparent);
}
@media print { .page-scrollbar { display: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-body)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color var(--dur-panel) var(--ease), color var(--dur-panel) var(--ease);
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
[hidden] { display: none !important; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 {
  font-weight: var(--display-weight);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
  hyphenate-limit-chars: 10 4 4;
}
h1 { font-size: var(--t-h1); line-height: 1.05; }
h2 { font-size: var(--t-h2); line-height: 1.1; }
h3 { font-size: var(--t-h3); line-height: 1.2; }
p { text-wrap: pretty; }
strong { font-weight: 600; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
address { font-style: normal; }
code, kbd { font-family: var(--font-mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
table { border-collapse: collapse; width: 100%; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }

/* Focus: a clear ring for the keyboard, nothing for mouse clicks. */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-xs); }

::selection { background: color-mix(in oklab, var(--accent) 60%, transparent); color: var(--accent-ink); }

.lead { font-size: var(--t-lead); line-height: 1.5; }
.muted { color: var(--muted); }
.eyebrow { font-size: var(--t-label); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

.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;
}

.skip-link {
  position: fixed; left: var(--s-4); top: var(--s-3); z-index: 100;
  padding: 0 var(--s-5); height: var(--control-h); border: 0; border-radius: var(--r-btn);
  background: var(--action); color: var(--action-ink); font-weight: 500;
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus-visible { transform: none; }

.noscript { padding: var(--s-6); text-align: center; }

/* Boot state while the first page loads: the Z prints itself in a loop (motion.css "boot"). */
.boot { min-height: 70svh; display: grid; place-items: center; }

/* Values the shop has not confirmed yet: invisible normally, outlined in debug mode. */
:root[data-show-assumed="true"] [data-assumed] {
  background: color-mix(in oklab, #ff7a00 18%, transparent);
  box-shadow: 0 0 0 1px #ff7a00;
  border-radius: 3px;
}

/* Debug: the layout grid as an overlay. */
:root[data-grid="true"] body::after {
  content: ""; position: fixed; inset: 0 max(var(--gut), (100vw - var(--container)) / 2); z-index: 999; pointer-events: none;
  background: repeating-linear-gradient(to right, color-mix(in oklab, #ff3b7f 10%, transparent) 0 calc((100% - 11 * var(--gap)) / 12), transparent 0 calc((100% - 11 * var(--gap)) / 12 + var(--gap)));
}
