/* PRAXIS main stylesheet. Layout, components, motion. Tokens live in tokens.css. */

/* ---------- base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-variation-settings: "wdth" var(--wdth-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

::selection { background: var(--accent); color: var(--paper); }
[data-theme="ink"] ::selection { background: var(--signal-ink); color: var(--paper); }

/* focus geometry follows the site's own grid: square ring on hairline
   components, pill ring on pill components */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0;
}
.btn:focus-visible,
.header-cta:focus-visible,
.skip-link:focus-visible { border-radius: var(--r-pill); }

/* anchors clear the fixed chrome; tuned per target depth */
:where([id]) { scroll-margin-top: 5.5rem; }
:where(.section[id]) { scroll-margin-top: 2.5rem; }
#top { scroll-margin-top: 0; }

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

.skip-link {
  position: fixed;
  top: var(--s-3);
  left: var(--s-3);
  z-index: var(--z-skip);
  padding: var(--s-3) var(--s-5);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(calc(-100% - 1.5rem));
}
.skip-link:focus-visible { transform: none; }

/* ---------- text roles ---------- */
.display,
.h1, .h2, .h3 {
  font-variation-settings: "wdth" var(--wdth-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: var(--lh-heading);
  text-wrap: balance;
}
.display {
  font-size: var(--t-display);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}
.h1 { font-size: var(--t-h1); line-height: 0.98; }
.h2 { font-size: var(--t-h2); }
.h3 { font-size: var(--t-h3); }

.lead {
  font-size: var(--t-lead);
  line-height: 1.4;
  max-width: var(--measure);
  text-wrap: pretty;
}
.body-copy { max-width: var(--measure); color: var(--muted); text-wrap: pretty; }

.mono {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
}
.mono--muted { color: var(--muted); }
.mono--accent { color: var(--accent); }

/* bracketed micro label: [ 01 / FIELD ] */
.tag { display: inline-flex; gap: 0.6em; align-items: baseline; }
.tag::before { content: "["; color: var(--muted); }
.tag::after { content: "]"; color: var(--muted); }

.accent { color: var(--accent); }
.dim { color: var(--muted); }

/* outline display treatment (used sparingly) */
.ghost-fill {
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
}

/* ---------- layout primitives ---------- */
.wrap {
  width: min(100% - 2 * var(--edge), var(--max-w));
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: var(--section-pad);
  background: var(--bg);
  color: var(--fg);
}
.section--flush { padding-block: 0; }
.section--hairline { border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}

/* watermark type behind a section head */
.watermark {
  position: absolute;
  inset-inline: 0;
  top: 0.1em;
  z-index: 0;
  font-size: clamp(6rem, 22vw, 22rem);
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
  opacity: 0.045;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

/* ---------- header + HUD ---------- */
/* The fixed chrome re-themes by observation: main.js flags .over-ink while an
   ink section is under it. No blend modes, so contrast stays computable. */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: var(--z-hud);
  color: var(--ink);
  transition: color var(--dur-2) ease;
}
.site-header.over-ink { color: var(--paper); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--s-4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  font-weight: 800;
  font-variation-settings: "wdth" 122;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
  text-transform: uppercase;
}
.brand svg { width: 22px; height: 22px; }

.site-nav { display: flex; gap: var(--s-6); }
.site-nav a {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.75;
  transition: opacity var(--dur-1) ease;
}
.site-nav a:hover, .site-nav a[aria-current="true"] { opacity: 1; }
.site-nav a[aria-current="true"]::before { content: "\25CF  " / ""; font-size: 0.5em; vertical-align: 0.25em; }

.header-cta {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 600;
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  text-decoration: none;
  padding: var(--s-2) var(--s-4);
  border: 1px solid currentColor;
  border-radius: var(--r-pill);
  transition: background-color var(--dur-1) ease, color var(--dur-1) ease;
}
.site-header:not(.over-ink) .header-cta:hover { background: var(--ink); color: var(--paper); }
.site-header.over-ink .header-cta:hover { background: var(--paper); color: var(--ink); }
.header-right { display: flex; align-items: center; gap: var(--s-4); }

.menu-btn {
  display: none;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  padding: var(--s-2) var(--s-4);
  border: 1px solid currentColor;
  border-radius: var(--r-pill);
}

/* bottom HUD: section readout + status. Hidden on small screens. */
.hud {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: var(--z-hud);
  color: var(--ink);
  transition: color var(--dur-2) ease;
  pointer-events: none;
}
.hud.over-ink { color: var(--paper); }
.hud .wrap {
  display: flex;
  justify-content: space-between;
  padding-block: var(--s-4);
}
.hud-readout { min-width: 12ch; }

/* reading-progress hairline: scroll-linked, present on long-read pages */
.read-line {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  pointer-events: none;
}
.read-line span {
  display: block;
  height: 100%;
  background: var(--signal-ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.site-header.over-ink .read-line span { background: var(--signal); }

/* mobile menu overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  background: var(--ink);
  color: var(--paper);
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--s-8)) var(--edge) var(--s-6);
}
.menu-overlay.is-open { display: flex; overflow-y: auto; overscroll-behavior: contain; }
.menu-overlay nav { display: flex; flex-direction: column; gap: var(--s-2); }
.menu-overlay nav a {
  font-size: clamp(1.8rem, 8vw, 4rem);
  font-weight: 800;
  font-variation-settings: "wdth" 120;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
}
.menu-overlay nav a .mono { color: var(--muted); }
.menu-close {
  position: absolute;
  top: var(--s-5);
  right: var(--edge);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 1.05em 1.9em;
  border-radius: var(--r-pill);
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 600;
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  text-decoration: none;
  transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-1) ease;
}
.btn .btn-arrow { transition: transform var(--dur-2) var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--fg); }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-block: calc(var(--s-8) + var(--s-6)) var(--s-8);
  overflow: clip;
}
.hero-field {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-field canvas { width: 100%; height: 100%; }
.hero > .wrap { position: relative; z-index: 1; }

.hero-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.hero-wordmark {
  width: 100%;
  height: auto;
  user-select: none;
}

.hero-base {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--s-6);
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.hero-base .lead { max-width: 34rem; }
.hero-ctas { display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* ---------- manifesto ---------- */
.manifesto-lede {
  font-size: clamp(1.8rem, 4.2vw, 3.6rem);
  font-weight: 720;
  font-variation-settings: "wdth" 112;
  line-height: 1.14;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  max-width: 22ch;
  text-wrap: balance;
}
.manifesto .dim { color: var(--gray); }
.manifesto-note {
  margin-top: var(--s-7);
  max-width: var(--measure);
  color: var(--muted);
}
/* deliberate asymmetry: the note steps off the lede's axis */
@media (min-width: 64rem) {
  .manifesto-note { margin-left: 38%; }
}

/* ---------- capabilities ---------- */
.cap-list { border-top: 1px solid var(--line); }
.cap-row {
  display: grid;
  grid-template-columns: 6ch 1fr 2fr auto;
  gap: var(--gutter);
  align-items: baseline;
  padding-block: clamp(1.4rem, 3vh, 2.2rem);
  border-bottom: 1px solid var(--line);
  transition: background-color var(--dur-2) ease;
}
.cap-row:hover { background: var(--bg-2); }
.cap-row h3 { font-size: var(--t-h3); }
.cap-row .cap-desc { color: var(--fg); max-width: 44ch; }
.cap-row .cap-num { color: var(--accent); }
.cap-tags { display: flex; flex-direction: column; gap: var(--s-1); text-align: right; }

/* fit filter: two-sided qualification */
.fit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 6rem);
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}
.fit-grid h3 { margin-bottom: var(--s-4); }
.fit-list { display: grid; gap: var(--s-3); }
.fit-list li { padding-left: 1.4em; position: relative; text-wrap: pretty; }
.fit-list li::before {
  content: "+";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
}
.fit-list--no li { color: var(--muted); }
.fit-list--no li::before { content: "\00d7"; color: var(--muted); }

/* ---------- work ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.work-card { text-decoration: none; display: block; }
.work-card:nth-child(1) { grid-column: 1 / span 7; }
.work-card:nth-child(2) { grid-column: 9 / span 4; margin-top: var(--s-10); }
.work-card:nth-child(3) { grid-column: 2 / span 4; margin-top: calc(-1 * var(--s-9)); }
.work-card:nth-child(4) { grid-column: 7 / span 6; margin-top: var(--s-7); }

.work-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-2);
  background: var(--bg-2);
}
.work-media img {
  width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.05);
  transition: transform var(--dur-4) var(--ease-out), filter var(--dur-3) ease;
}
.work-card:hover .work-media img,
.work-card:focus-visible .work-media img {
  transform: scale(1.035);
  filter: grayscale(0.15) contrast(1.02);
}
.work-chip {
  position: absolute;
  top: var(--s-3);
  left: var(--s-3);
  padding: 0.45em 0.9em;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  color: var(--paper);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.work-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  padding-top: var(--s-4);
  flex-wrap: wrap;
}
.work-scope {
  width: 100%;
  margin: 0;
  font-size: var(--t-small);
  color: var(--fg);
}
/* touch devices never hover: wake the imagery on scroll instead */
@media (hover: none) {
  .work-card.is-inview .work-media img { filter: grayscale(0.15) contrast(1.02); }
}
.work-meta h3 { font-size: var(--t-h3); }
.work-card:hover .work-meta h3 { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 6px; }

/* ---------- process ---------- */
.process-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gutter);
  counter-reset: step;
}
.process-step {
  position: relative;
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.process-step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent);
  transition: width var(--dur-4) var(--ease-out);
}
.process-step.is-inview::before { width: 3.5rem; }
.process-step .mono { display: block; margin-bottom: var(--s-4); }
.process-step h3 { font-size: var(--t-h3); margin-bottom: var(--s-3); }
.process-step p { color: var(--muted); font-size: var(--t-small); }

/* ---------- principles accordion ---------- */
.prin-list { border-top: 1px solid var(--line); }
.prin-item { border-bottom: 1px solid var(--line); }
.prin-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: 6ch 1fr auto;
  gap: var(--gutter);
  align-items: baseline;
  padding-block: clamp(1.3rem, 2.6vh, 2rem);
  text-align: left;
}
.prin-trigger:hover .prin-title { color: var(--accent); }
.prin-title {
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  font-weight: 780;
  font-variation-settings: "wdth" 114;
  text-transform: uppercase;
  transition: color var(--dur-1) ease;
}
.prin-icon {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  line-height: 1;
  transition: transform var(--dur-2) var(--ease-out);
}
.prin-trigger[aria-expanded="true"] .prin-icon { transform: rotate(45deg); }
.prin-panel { overflow: hidden; }
.prin-panel[hidden] { display: none; }
.prin-panel-inner {
  padding: 0 0 var(--s-6) calc(6ch + var(--gutter));
  color: var(--muted);
  max-width: 52rem;
}

/* ---------- stats ---------- */
.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
}
.stat {
  padding: var(--s-6) var(--s-5);
  border-inline-start: 1px solid var(--line);
}
.stat:first-child { border-inline-start: 0; }
.stat-value {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 800;
  font-variation-settings: "wdth" 120;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-value .accent { font-variation-settings: "wdth" 120; }
.stat .mono { display: block; margin-top: var(--s-3); }
.stat-note {
  display: block;
  margin-top: var(--s-2);
  font-size: var(--t-small);
  color: var(--fg);
  max-width: 24ch;
}

/* ---------- forms ---------- */
.form {
  display: grid;
  gap: var(--s-5);
}
.field { display: grid; gap: var(--s-2); }
.field label {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 600;
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
}
.field-hint { font-size: var(--t-small); color: var(--muted); margin: 0; }
.field input,
.field textarea {
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  padding: var(--s-3) 0;
  transition: border-color var(--dur-1) ease;
}
.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-bottom: 2px solid var(--accent);
}
.field textarea { resize: vertical; min-height: 7rem; }
.field select {
  font: inherit;
  color: var(--fg);
  background-color: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  padding: var(--s-3) 1.6rem var(--s-3) 0;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2377756E' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  transition: border-color var(--dur-1) ease;
}
.field select:focus-visible { outline: none; border-bottom: 2px solid var(--accent); }
[data-theme="ink"] .field select option { color: var(--ink); background: var(--paper); }
.field.is-invalid input,
.field.is-invalid textarea { border-bottom-color: var(--accent); }
.field-error {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.form-errors {
  border: 1px solid var(--accent);
  border-radius: var(--r-2);
  padding: var(--s-4) var(--s-5);
}
.form-errors p { margin: 0 0 var(--s-2); }
.form-errors ul { margin: 0; padding-left: 1.2em; display: grid; gap: var(--s-1); }
.form-errors a { color: var(--accent); }
.form-status:empty { display: none; }
.form-note { max-width: var(--measure); }
/* no-JS route: the scripted path never renders it; the html.js gate reveals it */
.form-nojs { display: none; }
html:not(.js) .form-nojs {
  display: block;
  margin: 0;
  max-width: var(--measure);
  font-size: var(--t-small);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: var(--s-4) var(--s-5);
}
html:not(.js) .form-nojs a { color: var(--accent); }
/* the display rule below would defeat the hidden attribute without this */
.form-fallback[hidden] { display: none; }
.form-fallback {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: var(--s-5);
  display: grid;
  gap: var(--s-4);
}
.form-fallback textarea {
  font-family: var(--font-mono);
  font-size: var(--t-small);
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: var(--s-3);
  width: 100%;
  resize: vertical;
}
.form-fallback-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }
/* steps ladder beside the form */
.next-steps { display: grid; gap: var(--s-3); }
.next-steps li { display: flex; gap: var(--s-3); align-items: baseline; }
.next-steps .mono { color: var(--accent); }
.form-status { color: var(--fg); max-width: var(--measure); }
.form[aria-busy="true"] .btn { opacity: 0.6; pointer-events: none; }
/* honeypot: visually gone, skipped by keyboard and assistive tech */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  margin-top: var(--s-8);
  align-items: start;
}
.contact-aside { display: grid; gap: var(--s-5); justify-items: start; }

/* ---------- pull quote ---------- */
.pullquote {
  border-left: 3px solid var(--accent);
  padding-left: clamp(1.25rem, 3vw, 2.5rem);
  max-width: 46rem;
  display: grid;
  gap: var(--s-4);
}
.pullquote blockquote {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 640;
  font-variation-settings: "wdth" 108;
  line-height: 1.3;
  text-wrap: pretty;
}
.pullquote figcaption { display: flex; gap: var(--s-3); align-items: baseline; flex-wrap: wrap; }

/* ---------- case page ---------- */
.case-hero {
  padding-top: calc(var(--section-pad) + var(--s-7));
}
.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gutter);
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.case-meta > div { display: grid; gap: var(--s-2); }
.case-figure { margin: 0; display: grid; gap: var(--s-3); }
.case-figure img { width: 100%; height: auto; border-radius: var(--r-2); }
.case-figure figcaption { color: var(--muted); font-size: var(--t-small); }
.case-figures-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}
.case-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(2rem, 5vw, 6rem);
  align-items: start;
}
.case-copy h2 { position: sticky; top: var(--s-8); }
.case-copy .body-copy + .body-copy { margin-top: var(--s-4); }

.next-case {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s-4);
  padding-block: var(--s-7);
  border-top: 1px solid var(--line);
}
.next-case a {
  text-decoration: none;
  font-size: var(--t-h2);
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  text-transform: uppercase;
  letter-spacing: -0.015em;
}
.next-case a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 8px; }

/* ---------- contact / footer ---------- */
.contact { overflow: clip; }
.contact-cta {
  font-size: var(--t-display);
  line-height: 0.95;
}
.contact-cta a {
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 0.06em;
  background-position: 0 96%;
  transition: background-size var(--dur-3) var(--ease-out);
}
.contact-cta a:hover, .contact-cta a:focus-visible { background-size: 100% 0.06em; }
.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--s-6);
  margin-top: var(--s-8);
}

.site-footer {
  background: var(--bg);
  color: var(--fg);
  padding-top: var(--s-9);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--gutter);
  padding-block: var(--s-7);
  border-top: 1px solid var(--line);
}
.footer-grid h3 { margin-bottom: var(--s-4); }
.footer-grid ul { display: grid; gap: var(--s-2); list-style: none; padding: 0; margin: 0; }
.footer-grid a { text-decoration: none; color: var(--muted); transition: color var(--dur-1) ease; }
.footer-grid a:hover { color: var(--fg); }
.footer-watermark {
  display: block;
  width: 100%;
  height: auto;
  margin-top: var(--s-7);
  opacity: 0.14;
  user-select: none;
}
.footer-legal {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding-block: var(--s-5);
}

/* telemetry strip: the stats band's receipt, stamped at deploy */
.footer-telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.footer-telemetry-v { color: var(--fg); }

/* ---------- reveal motion ---------- */
.reveal {
  opacity: 1;
  transform: none;
}
.js .reveal {
  opacity: 0;
  transform: translateY(1.6rem);
  transition: opacity var(--dur-3) ease, transform var(--dur-3) var(--ease-out);
}
.js .reveal.is-inview { opacity: 1; transform: none; }
/* rescue valve: the main.js script tag removes .js onerror, restoring this rest state */
.js .reveal[data-delay="1"] { transition-delay: 90ms; }
.js .reveal[data-delay="2"] { transition-delay: 180ms; }
.js .reveal[data-delay="3"] { transition-delay: 270ms; }

/* ---------- styleguide page ---------- */
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--gutter); }
.sg-swatch {
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
}
.sg-swatch-color { height: 7rem; }
.sg-swatch dl { padding: var(--s-4); display: grid; gap: var(--s-1); margin: 0; }
.sg-swatch dt { font-family: var(--font-mono); font-size: var(--t-mono); letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--muted); }
.sg-swatch dd { margin: 0; font-family: var(--font-mono); font-size: var(--t-small); }
.sg-block { padding-block: var(--s-7); border-top: 1px solid var(--line); }
.sg-row { display: grid; grid-template-columns: 14rem 1fr; gap: var(--gutter); align-items: baseline; padding-block: var(--s-4); }
.sg-specimen-note { color: var(--muted); max-width: var(--measure); margin-top: var(--s-3); }
.sg-demo { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }

/* ---------- token lab (styleguide playground) ---------- */
.sg-lab {
  margin-top: var(--s-7);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--s-7) var(--gutter);
  align-items: start;
}
.sg-lab-controls { display: grid; gap: var(--s-5); justify-items: start; }
.sg-lab-controls .field { width: 100%; }
.sg-lab-controls input[type="color"] {
  inline-size: 6rem;
  block-size: 3rem;
  padding: var(--s-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  background: var(--bg);
  cursor: pointer;
}
.sg-lab-controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.sg-lab-read {
  margin: 0;
  width: 100%;
  display: grid;
  gap: var(--s-2);
}
.sg-lab-read > div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--s-2);
}
.sg-lab-read dt { color: var(--muted); }
.sg-lab-read dd { margin: 0; }
.sg-lab-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.sg-lab-out {
  font-family: var(--font-mono);
  font-size: var(--t-small);
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: var(--s-3);
  width: 100%;
  resize: vertical;
}
.sg-lab-proof {
  background: var(--bg);
  color: var(--fg);
  border-radius: var(--r-2);
  padding: var(--s-7);
  display: grid;
  gap: var(--s-4);
  justify-items: start;
}
.sg-lab-proof-rule {
  width: 100%;
  border-top: 1px solid var(--line);
}
/* the page's deliberate asymmetry: the proof panel drops off the control
   row's baseline and breaks the container toward the edge */
@media (min-width: 64rem) {
  .sg-lab-proof {
    margin-top: var(--s-8);
    margin-right: calc(-1 * var(--edge));
    border-radius: var(--r-2) 0 0 var(--r-2);
  }
}
/* rest state without JS: dead controls go, the manual instructions stay */
.sg-lab-nojs { display: none; }
html:not(.js) .sg-lab { display: none; }
html:not(.js) .sg-lab-nojs { display: block; }

/* ---------- error page ---------- */
.error-hero {
  min-height: 100svh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: var(--s-5);
}
.error-hero .display { font-size: clamp(6rem, 30vw, 22rem); }

/* ---------- responsive ---------- */
@media (max-width: 63.9rem) {
  .site-nav { display: none; }
  .menu-btn { display: inline-flex; }
  /* no-JS (or failed-JS) fallback: static nav returns, dead menu button goes */
  html:not(.js) .site-nav { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); justify-content: flex-end; }
  html:not(.js) .menu-btn { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .header-cta { display: none; }
  .case-meta { grid-template-columns: repeat(2, 1fr); row-gap: var(--s-5); }
  .case-copy { grid-template-columns: 1fr; }
  .case-copy h2 { position: static; }
  .case-figures-split { grid-template-columns: 1fr; }
  .cap-row { grid-template-columns: 5ch 1fr; }
  .cap-row .cap-desc { grid-column: 2; }
  .cap-tags { grid-column: 2; flex-direction: row; flex-wrap: wrap; gap: var(--s-1) var(--s-3); text-align: left; }
  .process-track { grid-template-columns: repeat(2, 1fr); row-gap: var(--s-7); }
  .fit-grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .stats-band { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-inline-start: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr 1fr; row-gap: var(--s-6); }
  .work-grid .work-card,
  .work-card:nth-child(n) { grid-column: 1 / -1; margin-top: 0; }
  .work-grid { row-gap: var(--s-7); }
  .sg-row { grid-template-columns: 1fr; }
  .sg-lab { grid-template-columns: 1fr; }
  .hud { display: none; }
}

@media (max-width: 40rem) {
  .process-track { grid-template-columns: 1fr; }
  .stats-band { grid-template-columns: 1fr; }
  .stat { border-inline-start: 0; }
  .stat:nth-child(n + 2) { border-top: 1px solid var(--line); }
  .prin-trigger { grid-template-columns: 4ch 1fr auto; }
  .prin-panel-inner { padding-left: 0; }
  .hero-base { flex-direction: column; align-items: flex-start; }
}

/* ---------- cross-page transitions (progressive enhancement) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

/* ---------- preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .btn .btn-arrow, .work-media img, .prin-icon,
  .process-step::before, .contact-cta a, .site-header, .hud { transition: none; }
  .process-step.is-inview::before { width: 3.5rem; }
}

@media (forced-colors: active) {
  .btn { border: 1px solid ButtonText; }
  .work-media img { filter: none; }
  .ghost-fill { color: CanvasText; -webkit-text-stroke: 0; }
}

/* ---------- print: the brief survives the printer ---------- */
@media print {
  .site-header, .hud, .menu-overlay, .skip-link, .hero-field,
  .read-line, .watermark, .footer-watermark, .menu-btn, .header-cta { display: none !important; }
  :root, [data-theme="ink"] {
    --bg: #fff;
    --bg-2: #fff;
    --fg: #000;
    --muted: #333;
    --line: #bbb;
    --line-strong: #666;
    --accent: #000;
  }
  body { background: #fff; color: #000; }
  .section { padding-block: 1.5rem; break-inside: avoid-page; }
  .reveal, .js .reveal { opacity: 1 !important; transform: none !important; }
  .prin-panel[hidden] { display: block; }
  .contact-cta a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #333; }
}
