/* ==========================================================================
   Mechanicus Magus Consulting — "Shop Ledger"
   Charcoal ink on warm paper, single copper accent.
   ==========================================================================

   FONTS — self-hosted WOFF2, latin subset. No third-party requests, so no
   Google/Fontshare CDN call, nothing to disclose in a privacy notice, and the
   site renders identically offline. Source Serif 4 and JetBrains Mono are
   variable files serving their whole weight range from one download.
   ========================================================================== */

@font-face {
  font-family: 'Switzer';
  src: url('../fonts/switzer-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Switzer';
  src: url('../fonts/switzer-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('../fonts/source-serif-4-var.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-var.woff2') format('woff2-variations');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  --text-xl: clamp(1.375rem, 1.15rem + 1vw, 1.75rem);
  --text-2xl: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);

  /* Spacing — 4px base */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Measure */
  --measure: 66ch;
  --gutter: clamp(var(--space-5), 5vw, var(--space-12));
  --page-max: 76rem;

  /* Fonts */
  --font-display: 'Switzer', 'Satoshi', 'Helvetica Neue', sans-serif;
  --font-body: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* Light — paper */
  --ink: #1f1e1b;
  --ink-muted: #5e5b54;
  --ink-faint: #6b6860;
  --paper: #f4f1ea;
  --paper-alt: #eae6dc;
  --rule: #cfc9bb;
  --rule-soft: #e0dbcf;
  --copper: #8c5a2b;
  --copper-hover: #6e4520;
  --grain-opacity: 0.035;
}

[data-theme='dark'] {
  --ink: #d8d4cb;
  --ink-muted: #97938b;
  --ink-faint: #8f8b82;
  --paper: #17171a;
  --paper-alt: #1e1e21;
  --rule: #3a393c;
  --rule-soft: #2a2a2d;
  --copper: #c08552;
  --copper-hover: #d69a66;
  --grain-opacity: 0.05;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #d8d4cb;
    --ink-muted: #97938b;
    --ink-faint: #8f8b82;
    --paper: #17171a;
    --paper-alt: #1e1e21;
    --rule: #3a393c;
    --rule-soft: #2a2a2d;
    --copper: #c08552;
    --copper-hover: #d69a66;
    --grain-opacity: 0.05;
  }
}

/* --- Reset ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}
ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}
img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Base ---------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  font-feature-settings: 'kern' 1, 'liga' 1, 'onum' 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Paper grain — very faint, texture not decoration */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * {
  position: relative;
  z-index: 1;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.18;
  text-wrap: balance;
}

/* Negative tracking is a display-size correction only. Applied to the 17px h3
   it closes up the word space, so multi-word run-in headings read as one word
   ("problem precisely" -> "problemprecisely"). Keep it above 24px. */
h1,
h2 {
  letter-spacing: -0.015em;
}
h3,
h4 {
  letter-spacing: normal;
  /* Switzer's space glyph is narrow at weight 500. At 17px a multi-word run-in
     heading closes up without this; the display sizes do not need it. */
  word-spacing: 0.09em;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: var(--copper);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--copper) 38%, transparent);
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}
a:hover {
  color: var(--copper-hover);
  border-bottom-color: var(--copper-hover);
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection {
  background: color-mix(in srgb, var(--copper) 25%, transparent);
}

/* --- Utilities ----------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--ink);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--rule);
  z-index: 100;
}
.skip:focus {
  left: var(--gutter);
  top: var(--space-3);
}

.label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 400;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}

.measure {
  max-width: var(--measure);
}

.lede {
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--ink);
}

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

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* --- Header -------------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-4);
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border: 0;
  color: var(--ink);
}
.wordmark:hover {
  color: var(--ink);
}
/* Type-only wordmark. The compass monogram is an unapproved draft and is not used
   anywhere on the site; this copper hairline is a typographic rule, not a mark. */
.wordmark::before {
  content: '';
  width: 2px;
  align-self: stretch;
  background: var(--copper);
  flex: none;
}
.wordmark svg {
  width: 30px;
  height: 30px;
  color: var(--copper);
  flex: none;
}
.wordmark__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.wordmark__name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.wordmark__sub {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(var(--space-3), 2vw, var(--space-6));
  flex-wrap: wrap;
}
.nav a {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--rule);
}
.nav a[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: var(--copper);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink-muted);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}
.theme-toggle:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
}
.theme-toggle svg {
  width: 15px;
  height: 15px;
}
[data-theme='dark'] .theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}
[data-theme='dark'] .theme-toggle .icon-moon {
  display: block;
}

/* --- Page structure ------------------------------------------------------ */

main {
  flex: 1 0 auto;
}

.section {
  padding-block: clamp(var(--space-10), 6vw, var(--space-20));
  border-bottom: 1px solid var(--rule-soft);
}
.section:last-of-type {
  border-bottom: 0;
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.section__head h2 {
  font-size: var(--text-xl);
}
.section__head::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--rule);
  transform: translateY(-0.35em);
}

/* Page header with archival metadata gutter */
.pagehead {
  padding-block: clamp(var(--space-10), 6vw, var(--space-16));
  border-bottom: 1px solid var(--rule);
}
.pagehead__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}
@media (min-width: 62rem) {
  .pagehead__grid {
    grid-template-columns: minmax(0, 1fr) 13rem;
    gap: var(--space-12);
    align-items: start;
  }
}
.pagehead h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-5);
}
.pagehead .lede {
  max-width: var(--measure);
}

.meta {
  border-top: 1px solid var(--rule);
  padding-top: var(--space-3);
  display: grid;
  gap: var(--space-2);
}
.meta div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.meta dt,
.meta span:first-child {
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.meta span:last-child {
  color: var(--ink-muted);
  text-align: right;
}

/* --- Hero (home) --------------------------------------------------------- */

.hero {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
/* graph-paper grid, hero only */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--rule-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule-soft) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.55;
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / 0.9), transparent 78%);
}
.hero h1 {
  font-size: var(--text-2xl);
  max-width: 34ch;
  margin-bottom: var(--space-6);
}
.hero .label {
  display: block;
  margin-bottom: var(--space-5);
}
.hero p {
  max-width: var(--measure);
}
.hero p + p {
  margin-top: var(--space-4);
}

/* --- Two-column editorial ------------------------------------------------ */

.split {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 56rem) {
  .split {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: clamp(var(--space-8), 5vw, var(--space-16));
    align-items: start;
  }
  .split--wide {
    grid-template-columns: minmax(0, 1fr) 22rem;
  }
}
.split__aside {
  position: sticky;
  top: var(--space-6);
}

/* --- Domain / entry lists ------------------------------------------------ */

.entries {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.entry {
  display: grid;
  gap: var(--space-2) var(--space-6);
  grid-template-columns: minmax(0, 1fr);
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--rule-soft);
}
@media (min-width: 48rem) {
  .entry {
    grid-template-columns: 9rem minmax(0, 1fr);
  }
}
.entry__id {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--copper);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  padding-top: 0.35em;
}
.entry__id span {
  display: block;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  margin-top: var(--space-1);
}
.entry h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}
.entry h3 a {
  color: var(--ink);
  border-bottom-color: transparent;
}
.entry h3 a:hover {
  color: var(--ink);
  border-bottom-color: var(--copper);
}
.entry p {
  max-width: var(--measure);
  color: var(--ink-muted);
}
.entry dl {
  margin-top: var(--space-4);
  display: grid;
  gap: var(--space-3);
  max-width: var(--measure);
}
.entry dt {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: var(--space-1);
}
.entry dd {
  color: var(--ink-muted);
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid var(--rule);
  padding: 0.15em 0.55em;
  margin-top: var(--space-3);
}

.tk {
  color: var(--ink-faint);
  border-left: 2px solid var(--rule);
  padding-left: var(--space-4);
  font-style: italic;
  max-width: var(--measure);
}

/* --- Domain blocks ------------------------------------------------------- */

.domain {
  padding-block: clamp(var(--space-10), 5vw, var(--space-16));
  border-bottom: 1px solid var(--rule-soft);
  scroll-margin-top: var(--space-8);
}
.domain:last-child {
  border-bottom: 0;
}
.domain h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}
.domain__num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--copper);
  letter-spacing: 0.14em;
  display: block;
  margin-bottom: var(--space-3);
}
.domain p {
  max-width: var(--measure);
}
.domain p + p {
  margin-top: var(--space-4);
}

.cols {
  display: grid;
  gap: var(--space-8);
  margin-top: var(--space-8);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 48rem) {
  .cols--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cols--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.col h3,
.card h3 {
  font-size: var(--text-base);
  font-family: var(--font-display);
  margin-bottom: var(--space-3);
}
.col > .label {
  display: block;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--rule);
}

/* Plain bullet list, ledger style */
.list {
  display: grid;
  gap: var(--space-2);
  color: var(--ink-muted);
  max-width: var(--measure);
}
.list li {
  padding-left: var(--space-4);
  position: relative;
}
.list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  border-top: 1px solid var(--copper);
}

/* Numbered process steps */
.steps {
  counter-reset: step;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
  margin-top: var(--space-8);
}
.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: var(--space-4);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--rule-soft);
}
.step::before {
  content: '0' counter(step);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--copper);
  letter-spacing: 0.08em;
  padding-top: 0.35em;
}
.step h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}
.step p {
  color: var(--ink-muted);
  max-width: var(--measure);
}

/* --- Six Lenses -----------------------------------------------------------
   Deliberately a grid, NOT the numbered .steps list. The lenses are six
   simultaneous perspectives; a vertical numbered list would read as a sequence
   and misrepresent the method. The Process below uses .steps because it IS
   sequential. The visual difference carries that distinction.
   ------------------------------------------------------------------------- */

.lenses {
  display: grid;
  gap: 0;
  margin-top: var(--space-8);
  border-top: 1px solid var(--rule);
}
@media (min-width: 44rem) {
  .lenses {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-8);
  }
}
@media (min-width: 72rem) {
  .lenses {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.lens {
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--rule-soft);
}
.lens__no {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--copper);
  margin-bottom: var(--space-2);
}
.lens h3 {
  font-size: var(--text-base);
  font-family: var(--font-display);
  margin-bottom: var(--space-3);
}
.lens p {
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

/* --- Core principles ----------------------------------------------------- */

.principles {
  display: grid;
  row-gap: var(--space-12);
  column-gap: var(--space-16);
  margin-top: var(--space-8);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 44rem) {
  .principles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.principle h3 {
  font-size: var(--text-base);
  font-family: var(--font-display);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--copper);
}
.principle p {
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

/* --- Pull quote ---------------------------------------------------------- */

.pullquote {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
}
.pullquote p {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  line-height: 1.35;
  text-wrap: balance;
}
.pullquote cite {
  display: block;
  margin-top: var(--space-5);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* --- Scope note ---------------------------------------------------------- */

.scope {
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  padding: clamp(var(--space-5), 3vw, var(--space-8));
}
.scope > .label {
  display: block;
  margin-bottom: var(--space-4);
}
.scope p {
  max-width: var(--measure);
  color: var(--ink-muted);
}
.scope p + p {
  margin-top: var(--space-4);
}
.scope strong {
  color: var(--ink);
  font-weight: 600;
}

/* --- Figures / diagrams -------------------------------------------------- */

figure {
  margin-top: var(--space-8);
}
figure svg {
  width: 100%;
  height: auto;
  color: var(--ink-muted);
}

/* Diagrams keep their label legibility on narrow screens by scrolling sideways
   rather than shrinking into illegibility. */
.figscroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.figscroll svg {
  min-width: 40rem;
}
.figscroll:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 4px;
}
figcaption {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule-soft);
  max-width: 52ch;
}

/* --- Contact ------------------------------------------------------------- */

.contact p {
  max-width: var(--measure);
}
.contact__addr {
  margin-top: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-style: normal;
  display: grid;
  gap: var(--space-2);
}

/* --- Footer -------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--rule);
  padding-block: var(--space-10) var(--space-8);
  margin-top: var(--space-8);
}
.foot__grid {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 48rem) {
  .foot__grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--space-16);
  }
}
.foot p {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  max-width: 60ch;
}
.foot__nav {
  display: grid;
  gap: var(--space-2);
}
.foot__nav a {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  border-bottom-color: transparent;
}
.foot__nav a:hover {
  color: var(--ink);
}
.foot__colophon {
  margin-top: var(--space-10);
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule-soft);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

/* --- Motion -------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------------------------------------------------------------------
   Project inquiry form
   Built from the existing tokens only — no new colors, no new type sizes.
   Inputs sit on --paper (not --paper-alt) so the field reads as the writable
   surface and the page reads as the page. 1px --rule border, copper on focus.
   --------------------------------------------------------------------------- */

.form {
  max-width: 40rem;
}

.form__set {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-16) 0;
}

.form__legend {
  display: block;
  width: 100%;
  padding: 0 0 var(--space-3) 0;
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.form__legend .label {
  margin-right: var(--space-3);
  color: var(--copper);
}

.field {
  margin-bottom: var(--space-8);
}

.field > label,
.radios > legend {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink);
  word-spacing: 0.06em;
}

.req,
.opt {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: var(--space-2);
}

.req { color: var(--copper); }
.opt { color: var(--ink-faint); }

.field input[type='text'],
.field input[type='email'],
.field input[type='tel'],
.field select,
.field textarea {
  width: 100%;
  padding: var(--space-3);
  font-family: var(--font-body, inherit);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.field textarea {
  resize: vertical;
  min-height: 6rem;
}

/* Native select arrow is removed by appearance:none, so it is drawn back in as
   a background chevron. Encoded stroke color cannot use a CSS variable, so the
   dark-mode variant is re-declared below. */
.field select {
  padding-right: var(--space-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%235e5b54' stroke-width='1.4'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--ink-faint);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 1px;
  border-color: var(--copper);
}

.field input:user-invalid,
.field select:user-invalid,
.field textarea:user-invalid {
  border-color: var(--copper);
  border-left-width: 3px;
}

.hint {
  margin: var(--space-2) 0 0 0;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.counter {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}

.counter[data-state='low'] { color: var(--copper); }

/* Radio group */
.radios {
  border: 0;
  padding: 0;
  margin: 0;
}

.radio {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-size: var(--text-base);
  cursor: pointer;
}

.radio input {
  width: 0.95rem;
  height: 0.95rem;
  accent-color: var(--copper);
  flex: none;
}

.radio input:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

/* Honeypot — off-screen rather than display:none, which some bots detect. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Terms of review */
.terms {
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  background: var(--paper-alt);
  border: 1px solid var(--rule);
}

.terms .label {
  display: block;
  margin-bottom: var(--space-3);
}

.terms p:last-child {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--ink);
}

.form__scope {
  margin: 0 0 var(--space-10) 0;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.form__actions {
  padding-top: var(--space-8);
  border-top: 1px solid var(--rule-soft);
}

.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-8);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  color: var(--paper);
  background: var(--copper);
  border: 1px solid var(--copper);
  border-radius: 0;
  cursor: pointer;
}

.btn:hover {
  background: var(--copper-hover);
  border-color: var(--copper-hover);
}

.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.form__actions .hint {
  margin-top: var(--space-4);
  max-width: 34rem;
}

/* Server-side validation summary, rendered by submit.php on the error path. */
.errsum {
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-10);
  background: var(--paper-alt);
  border: 1px solid var(--copper);
  border-left-width: 3px;
}

.errsum p {
  margin: 0 0 var(--space-3) 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink);
}

.errsum ul {
  margin: 0;
  padding-left: var(--space-5);
  font-size: var(--text-sm);
}

@media (max-width: 40rem) {
  .terms { padding: var(--space-5); }
  .btn { width: 100%; text-align: center; }
}

/* Dark-mode select chevron. The stroke color is baked into the data URI and
   cannot read a custom property, so both theme paths re-declare it. */
[data-theme='dark'] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%2397938b' stroke-width='1.4'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%2397938b' stroke-width='1.4'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  }
}

/* ---------------------------------------------------------------------------
   Rev. B additions — conversion components.
   Built only from existing tokens: no new colors, no new type sizes, no new
   fonts. Everything below is a new arrangement of what the sheet already had.
   --------------------------------------------------------------------------- */

/* Button row. Wraps on narrow screens; the .btn full-width rule under 40rem
   already stacks them, so the gap is all that is needed here. */
.ctarow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  margin-top: var(--space-8);
}

/* .btn already declares a full 1px border, which beats the global anchor
   underline. Only non-button links in the row need the underline suppressed. */
.ctarow a:not(.btn) {
  border-bottom: 0;
}

/* Secondary action. Outlined, so a page never shows two solid copper blocks
   competing for the same click. */
.btn--quiet {
  color: var(--copper);
  background: transparent;
  border-color: var(--rule);
}
.btn--quiet:hover {
  color: var(--copper-hover);
  background: var(--paper-alt);
  border-color: var(--copper);
}

/* Hero — three clarity statements under the primary action. */
.hero__points {
  margin-top: var(--space-8);
  font-size: var(--text-sm);
}

/* Card — the "is this you?" grid. A ruled block, not a shadowed box: the sheet
   uses hairlines for separation everywhere else. */
.card {
  border-top: 1px solid var(--rule);
  padding-top: var(--space-4);
}
.card > .label {
  display: block;
  margin-bottom: var(--space-3);
  color: var(--copper);
}
.card p {
  max-width: var(--measure);
}

/* Closing call to action. Sits on --paper-alt so it reads as the end of the
   page rather than one more section of text. */
.cta {
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--copper);
  padding: clamp(var(--space-6), 4vw, var(--space-12));
}
.cta h2 {
  font-size: var(--text-xl);
  max-width: 34ch;
  margin-bottom: var(--space-5);
}
.cta .lede {
  max-width: var(--measure);
  color: var(--ink-muted);
}
.cta .ctarow {
  margin-top: var(--space-8);
}

/* The services page reuses .domain for each offer; its <p><strong> intro needs
   the same emphasis treatment .scope gives. */
.domain strong {
  color: var(--ink);
  font-weight: 600;
}

/* Footer nav carries an external YouTube link at Rev. B. Keep it typographically
   identical to the internal items. */
.foot__nav a[rel~='external'] {
  color: var(--ink-muted);
}
.foot__nav a[rel~='external']:hover {
  color: var(--ink);
}

/* The 404 and the ledger status block put a .btn inside .scope. */
.scope .ctarow {
  margin-top: var(--space-6);
}
.scope .ctarow a:not(.btn) {
  border-bottom: 0;
}

/* .hero p and .cta .lede cap their text at --measure. The button row must not
   inherit that cap or two actions wrap onto separate lines, and the selector has
   to match their specificity to win. */
.hero .ctarow,
.cta .ctarow,
.scope .ctarow {
  max-width: none;
}

/* Client-side validation. Reuses .errsum, which submit.php also renders on the
   server error path, so a visitor sees one consistent error treatment either way. */
.errsum a {
  border-bottom-color: var(--copper);
}

.field[data-invalid] > label {
  color: var(--copper);
}

.field[data-invalid] input,
.field[data-invalid] textarea,
.field[data-invalid] select {
  border-color: var(--copper);
}

.field__err {
  display: block;
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  color: var(--copper);
}
