/* Hallmark · pre-emit critique: P5 H5 E5 S5 R4 V5
 * Hallmark · genre: modern-minimal · macrostructure: Split Studio · theme: Coral
 * enrichment: none (real report output, no invented visuals) · nav: N9 · footer: Ft5
 * tone: technical · audience: ML engineers · anchor hue: warm 32
 */

@import url("tokens.css");

/* ---------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 620;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  overflow-wrap: anywhere;
  min-width: 0;
  margin: 0;
}
p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------- layout -- */
.page { max-width: var(--page-max); margin-inline: auto; padding-inline: var(--page-pad); }
.rule { border: 0; border-top: var(--rule-hair) solid var(--color-rule); margin: 0; }

section { padding-block: var(--space-3xl); }
section + section { border-top: var(--rule-hair) solid var(--color-rule-soft); }

/* Split Studio: the diptych. Text half + proof half, alternating direction. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(2rem, 5vw, 5.5rem);
  align-items: start;
}
/* Flipping the diptych must not shrink the proof: swap the track sizes too,
   so the proof half keeps the wider column in both directions. */
.split--flip { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }
.split--flip > .split__text { order: 2; }
.split--flip > .split__proof { order: 1; }
.split__text > * + * { margin-top: var(--space-lg); }
.split__proof { min-width: 0; }

@media (max-width: 60rem) {
  .split { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
  .split--flip > .split__text,
  .split--flip > .split__proof { order: initial; }
}

.lede { font-size: var(--text-xl); color: var(--color-ink-2); max-width: var(--measure); }
.body { color: var(--color-muted); max-width: var(--measure); }
.body + .body { margin-top: var(--space-md); }
.body strong { color: var(--color-ink); font-weight: 560; }

h2 { font-size: var(--text-3xl); max-width: 22ch; }
h3 { font-size: var(--text-2xl); font-weight: 600; }

/* --------------------------------------------------------------- header -- */
/* N9 · edge-aligned minimal */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding-block: var(--space-lg);
}
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-weight: 640;
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark::before {
  content: "";
  width: 0.5rem; height: 0.5rem;
  background: var(--color-accent);
  border-radius: 1px;
  translate: 0 -0.05em;
}
.wordmark span { color: var(--color-neutral); font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 400; }
.masthead nav { display: flex; gap: clamp(1rem, 3vw, 2rem); flex-wrap: wrap; }
.masthead nav a {
  font-size: var(--text-md);
  color: var(--color-muted);
  text-decoration: none;
  padding-block: var(--space-xs);
  border-bottom: 1.5px solid transparent;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.masthead nav a:hover { color: var(--color-ink); border-bottom-color: var(--color-accent); }

/* ----------------------------------------------------------------- hero -- */
/* H2 Split Diptych */
.hero { padding-block: clamp(3rem, 9vw, 7rem) var(--space-3xl); }
.hero h1 {
  font-size: var(--text-display);
  font-weight: 660;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  max-width: 13ch;
}
.hero .lede { margin-top: var(--space-lg); }
.hero__meta {
  margin-top: var(--space-xl);
  display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-neutral);
  font-variant-numeric: tabular-nums;
}
.hero__meta b { color: var(--color-ink); font-weight: 500; }

/* ---------------------------------------------------------------- proof -- */
/* Real output, no re-drawn window chrome: a hairline figure and a caption. */
figure { margin: 0; }
figure pre, .code {
  margin: 0;
  padding: var(--space-lg);
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.62;
  overflow-x: auto;
  color: var(--color-ink-2);
  tab-size: 2;
}
figcaption {
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-neutral);
}
.code b { color: var(--color-ink); font-weight: 500; }
.code .k { color: var(--color-accent-deep); }
.code .c { color: var(--color-neutral); }
.code .e { color: var(--color-accent); font-weight: 500; }

/* --------------------------------------------------------------- badges -- */
.sev {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  white-space: nowrap;
}
.sev::before { content: ""; width: 0.55em; height: 0.55em; border-radius: 1px; }
.sev--error   { color: var(--color-sev-error); }
.sev--error::before   { background: var(--color-sev-error); }
.sev--warning { color: var(--color-sev-warning); }
.sev--warning::before { background: linear-gradient(135deg, var(--color-sev-warning) 0 50%, transparent 50% 100%); box-shadow: inset 0 0 0 1px var(--color-sev-warning); }
.sev--info    { color: var(--color-sev-info); }
.sev--info::before    { box-shadow: inset 0 0 0 1px var(--color-sev-info); }

/* ---------------------------------------------------------------- table -- */
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
}
th, td { text-align: left; padding: var(--space-sm) var(--space-md) var(--space-sm) 0; vertical-align: baseline; }
thead th {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 400;
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--color-neutral);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  padding-bottom: var(--space-xs);
}
tbody td { border-bottom: var(--rule-hair) solid var(--color-rule-soft); color: var(--color-muted); }
tbody td:first-child { font-family: var(--font-mono); color: var(--color-ink); white-space: nowrap; }
.family-row td {
  padding-top: var(--space-lg);
  font-family: var(--font-display); font-weight: 600; color: var(--color-ink);
  border-bottom-color: var(--color-rule);
}
.family-row .count { color: var(--color-neutral); font-weight: 400; font-family: var(--font-mono); font-size: var(--text-sm); }
.basis { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-neutral); white-space: nowrap; }
.basis--d { color: var(--color-ink-2); }

/* ------------------------------------------------------------- contrast -- */
.contrast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  gap: var(--space-lg);
}
.panel {
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  background: var(--color-paper-2);
}
.panel--signal { background: var(--color-accent-wash); border-color: var(--color-accent-line); }
.panel h4 { font-size: var(--text-lg); margin-bottom: var(--space-xs); }
.panel p { font-size: var(--text-md); color: var(--color-muted); }
.panel dl { margin: var(--space-md) 0 0; display: grid; gap: var(--space-xs); font-size: var(--text-sm); }
.panel dt { font-family: var(--font-mono); color: var(--color-ink-2); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; }
.panel dd { margin: 0 0 var(--space-xs); color: var(--color-muted); }

/* ---------------------------------------------------------------- lists -- */
.states { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-md); }
.states li {
  display: grid;
  grid-template-columns: minmax(0, 10rem) minmax(0, 1fr);
  gap: var(--space-sm) var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: var(--rule-hair) solid var(--color-rule-soft);
  font-size: var(--text-md);
  color: var(--color-muted);
}
.states b { font-family: var(--font-display); font-weight: 580; color: var(--color-ink); font-size: var(--text-lg); }
@media (max-width: 40rem) { .states li { grid-template-columns: minmax(0, 1fr); } }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); font-size: var(--text-md); color: var(--color-muted); }
.checklist li { padding-left: 1.5rem; position: relative; }
.checklist li::before { content: "—"; position: absolute; left: 0; color: var(--color-neutral); }

/* ------------------------------------------------------------- statement -- */
.statement { background: var(--color-ink); color: var(--color-paper); }
.statement h2 { color: var(--color-paper); max-width: 20ch; }
.statement .body { color: var(--color-paper-on-ink); }
.statement .body strong { color: var(--color-paper); }
.statement .checklist { color: var(--color-muted-on-ink); }
.statement .checklist li::before { color: var(--color-accent); }
.statement a { color: var(--color-paper); text-decoration-color: var(--color-accent); }

/* ------------------------------------------------------------------ cta -- */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  min-height: 44px; padding: 0 var(--space-lg);
  border: 1.5px solid var(--color-ink);
  border-radius: var(--radius-pill);
  font-size: var(--text-md); font-weight: 500;
  text-decoration: none; white-space: nowrap;
  background: transparent; color: var(--color-ink);
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.chip:hover { background: var(--color-ink); color: var(--color-paper); }
.chip:active { translate: 0 1px; }

/* --------------------------------------------------------------- footer -- */
/* Ft5 · statement close */
.colophon { padding-block: var(--space-2xl) var(--space-3xl); border-top: var(--rule-hair) solid var(--color-rule); }
.colophon p { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 560; max-width: 34ch; letter-spacing: var(--tracking-tight); }
.colophon .meta {
  margin-top: var(--space-xl);
  display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg);
  font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-neutral);
}

/* ------------------------------------------------------------------ misc -- */
.tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--color-neutral);
  margin-bottom: var(--space-sm);
}
.inline-code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: var(--color-paper-3); padding: 0.1em 0.35em; border-radius: var(--radius-sm);
  color: var(--color-ink-2);
}
.body a, .lede a { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--space-md); top: var(--space-md); z-index: var(--z-sticky); background: var(--color-paper); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); }

/* ============================================================================
 * docs-platform reconciliation
 * The shared shell owns page width, gutters, the top bar, code blocks,
 * tables, callouts and motion. These rules retire the parts of this sheet
 * that would fight it and keep this site's own patterns working inside it.
 * ========================================================================== */

/* .page supplies width + gutter; inside the shell that job belongs to the
 * shell, so it becomes a no-op there. It still works for the hero and footer,
 * which sit outside the document column. */
.dp-main .page { max-width: none; margin-inline: 0; padding-inline: 0; }

/* The two-column split collapses to one column inside the narrower document
 * column — two columns there would leave neither readable. */
@media (min-width: 64rem) {
  .dp-main .split { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }
}
.dp-main .split__text, .dp-main .split__proof { max-width: var(--measure); }
.dp-main .split__proof .dp-quick { max-width: none; }

/* Severity keeps carrying meaning by label and marker first, colour second. */
.sev { display: inline-flex; align-items: center; gap: 0.4ch; }

@media (prefers-reduced-motion: reduce) {
  .reveal, [class*="reveal"] { opacity: 1 !important; transform: none !important; }
}
