/* TALOS primitives: reset, type, controls. Hairlines stay 1px. Radius caps at 2px. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 100%;
  font-weight: 400;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
}

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

[hidden] {
  display: none !important;
}

canvas {
  width: 100%;
  height: 100%;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

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

h1, h2, h3, h4, p, dl, dt, dd, ol, ul, figure, figcaption {
  margin: 0;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--track-display);
  line-height: 0.95;
  text-wrap: balance;
}

h1 { font-size: var(--t-5); font-weight: 700; }
h2 { font-size: var(--t-4); font-weight: 600; }
h3 { font-size: var(--t-3); font-weight: 600; }

.lede {
  font-size: var(--t-2);
  font-weight: 400;
  color: var(--ink);
  max-width: 62ch;
  margin-top: var(--space-4);
}

.lede-soft,
.note {
  color: var(--ink-soft);
}

.mono,
.panel-id,
.mono-label {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--t-1);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--accent);
}

.mono-label { color: var(--accent); }

button,
input,
select {
  font: inherit;
  color: inherit;
  background: var(--ground-sink);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

button {
  cursor: pointer;
  min-height: var(--touch);
  padding: 0 var(--space-4);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-size: var(--t-1);
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

input[type="number"],
input[type="text"] {
  min-height: var(--touch);
  width: 100%;
  padding: 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--t-2);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: var(--ground-sink);
}

input::placeholder {
  color: var(--ink-soft);
  opacity: 1;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  padding: 0;
  min-height: 4px;
  background: var(--hairline);
  border: 0;
  border-radius: var(--radius);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 1px solid var(--ground);
  border-radius: var(--radius);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 1px solid var(--ground);
  border-radius: var(--radius);
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0 var(--space-5);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: var(--ground-lift);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--t-1);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.btn:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: var(--ground);
  border-color: var(--accent);
}

.btn-primary:hover {
  color: var(--ground);
}

.btn-ghost {
  background: transparent;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--accent);
}

/* Intrinsic sizing must allow every grid and flex child to shrink. */
body, main, section, article, nav, footer, form, div, label, li { min-width: 0; }
h1, h2, h3, p, a, span, dd, dt, code { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
button, input, select, .btn { min-width: 0; max-width: 100%; }
button, .btn { white-space: normal; text-align: center; }
h1, h2, h3 { line-height: 1.08; }
.btn-primary, .btn-primary:hover { color: var(--ink); }
.mono, .mono-label, .field span, code, .prelaunch-mark { color: var(--ink-soft); }
