/* ==========================================================================
   BASE — reset, type defaults, controls
   §6.2 materials: radius 0 everywhere, no shadow, no blur, no gradient,
   no glass. Separation is surface value plus hairline.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
}

/* No double-tap zoom delay on the controls, and the tap flash is the page's
   own press state rather than the platform's blue box. */
button,
input,
label,
a,
summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
figure,
dl {
  margin: 0;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--accent-tint);
  color: var(--ink);
}

/* --- Type roles (§5.4) --------------------------------------------------- */

.display {
  font-size: var(--t-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.h2 {
  font-size: var(--t-h2);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.h3 {
  font-size: var(--t-h3);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.008em;
}

.body {
  max-width: var(--measure);
  line-height: 1.6;
}

.small {
  font-size: var(--t-small);
  line-height: 1.5;
}

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

/* Every mono element carries .mono. The slashed zero rides on the base class
   so anything printing a domain or a number gets it (§5.6, check 12). */
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "zero" 1;
  font-variant-numeric: tabular-nums;
}

/* The one permitted uppercase mono: a field label sitting beside its datum
   (§5.4, §6.4). Never above a heading. */
.mono-label {
  font-size: var(--t-mono-label);
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.mono-body {
  font-size: var(--t-mono-body);
  line-height: 1.55;
}

.mono-note {
  font-size: var(--t-mono-label);
  line-height: 1.5;
  color: var(--ink-muted);
}

/* --- Controls ------------------------------------------------------------ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 var(--s-5);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-sans);
  /* 19px/700 clears the WCAG large-text threshold, which is what makes the
     dark-mode label-on-accent pair legal. See tokens.css --on-accent. */
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  transition: background-color 90ms linear, border-color 90ms linear,
    transform 60ms linear;
}

.button:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.button:active {
  transform: scale(0.99);
}

.button-quiet {
  min-height: 2.5rem;
  padding: 0 var(--s-4);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 600;
}

.button-quiet:hover {
  background: var(--accent-tint);
  border-color: var(--border);
}

.field-input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0 var(--s-4);
  border: 1px solid var(--border);
  background: var(--sheet);
  color: var(--ink);
  font-family: var(--font-mono);
  font-feature-settings: "zero" 1;
  font-size: 1rem;
  line-height: 1.2;
  transition: border-color 90ms linear, background-color 90ms linear;
}

.field-input::placeholder {
  color: var(--ink-muted);
  opacity: 1;
}

.field-input:hover {
  border-color: var(--ink-muted);
}

.link {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: text-decoration-thickness 90ms linear;
}

.link:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Structure ----------------------------------------------------------- */

.rule {
  height: 1px;
  border: 0;
  background: var(--rule);
}

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

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  z-index: 10;
  padding: var(--s-2) var(--s-3);
  background: var(--sheet);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: var(--t-small);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Build scaffolding. Every one of these is an open item from DIRECTION §10
   and each is labeled in place so nothing ships unnoticed. */
.placeholder {
  border: 1px dashed var(--border);
  padding: var(--s-4);
  color: var(--ink-muted);
  background: transparent;
}

.placeholder > * + * {
  margin-top: var(--s-2);
}
