/* ============================================================
   site.css — structure and surface for scarletsystems.co.nz
   One paper surface, one scarlet accent, hairline rules.
   Receipts belong to product pages; the landing page opens with a
   lab statement and a hairline facts rail.
   Legacy class names (.glass-card, .gradient-band, .eyebrow) are
   kept as quiet aliases so older pages do not break mid-migration.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--scarlet-dark);
  outline-offset: 3px;
}
::selection { background: var(--div-accent-bg); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--fg1);
  color: var(--aotearoa-bone);
  padding: 10px 16px;
  border-radius: 0 0 var(--r-button) 0;
}
.skip-link:focus { left: 0; }

.wrap { max-width: 1180px; width: 100%; margin: 0 auto; padding: 0 24px; }
.prose-wrap { max-width: 820px; width: 100%; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--header-bg);
  backdrop-filter: saturate(1.2) blur(6px);
}
.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand-link { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-signet { width: 34px; height: 34px; flex: none; display: block; object-fit: contain; }
.brand-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--fg);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.brand-region {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  font-weight: 400;
}
.brand-sub { display: none; }
.nav-toggle {
  display: none;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border-default);
  border-radius: var(--r-button);
  min-height: 44px;
  padding: 8px 14px;
  font: 500 0.82rem var(--font-mono);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.main-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 10px 11px;
  border-radius: var(--r-badge);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-muted);
  border-bottom: 1px solid transparent;
  transition: color 0.15s var(--ease);
}
.nav-link:hover { color: var(--fg); }
.nav-link.active, .nav-link[aria-current="page"] {
  color: var(--fg);
  border-bottom-color: var(--div-accent);
  background: transparent;
}
@media (max-width: 940px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .main-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 24px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .main-nav.open { display: flex; }
  .nav-link { min-height: 46px; display: flex; align-items: center; border-bottom: 1px solid var(--border-subtle); border-radius: 0; }
  .nav-link:last-child { border-bottom: none; }
}

main { flex: 1; }

/* ---------- type ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.025em;
  margin-top: 0;
}
h1 { font-size: clamp(2.5rem, 5.6vw, 4.4rem); line-height: 1.0; margin-bottom: 24px; text-wrap: balance; max-width: 18ch; }
h2 { font-size: clamp(1.55rem, 2.9vw, 2.3rem); line-height: 1.1; margin-bottom: 14px; text-wrap: balance; max-width: 28ch; }
h3 { font-size: 1.18rem; line-height: 1.3; margin-bottom: 8px; font-family: var(--font-sans); letter-spacing: -0.01em; }
h4 { font-size: 1rem; margin-bottom: 8px; }
p { margin: 0 0 1rem; text-wrap: pretty; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.6; color: var(--fg-muted); max-width: 56ch; margin-bottom: 28px; }
.muted { color: var(--fg-muted); }
.small { font-size: 0.84rem; line-height: 1.55; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.grad { color: inherit; }

code, pre { font-family: var(--font-mono); }
code {
  font-size: 0.86em;
  background: var(--inset);
  border: 1px solid var(--border-subtle);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  color: var(--fg1);
}
pre {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-button);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--fg1);
}
pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }

/* ---------- header inside a page ---------- */
.page-head { padding: clamp(48px, 8vw, 96px) 0 clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--border-subtle); }
.page-head h1 { max-width: 20ch; }
.page-head .lead { margin-bottom: 0; }

/* ---------- hero ---------- */
.hero-banner {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg);
  padding: clamp(48px, 8vw, 104px) 0 clamp(36px, 5vw, 56px);
}
.hero-banner-content { position: relative; display: block; padding: 0; }
.hero-copy { max-width: 100%; }
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin: 0 0 26px;
}
.hero-note {
  margin: 26px 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--fg-dim);
}
.hero-facts {
  display: none;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0 0 0 28px;
  border-left: 1px solid var(--border-subtle);
}
.hero-facts > div { padding: 14px 0; border-bottom: 1px solid var(--border-subtle); }
.hero-facts strong { display: block; font-family: var(--font-mono); font-size: 1.05rem; color: var(--fg); }
.hero-facts span { display: block; margin-top: 5px; font-size: 0.76rem; line-height: 1.45; color: var(--fg-dim); }

/* ---------- buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 22px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--r-button);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { background: var(--hover); border-color: var(--fg-dim); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--div-accent);
  border-color: var(--div-accent);
  color: var(--on-accent);
}
.btn-primary:hover { background: var(--div-accent-dark); border-color: var(--div-accent-dark); color: var(--on-accent); }
.btn-gold { background: transparent; border-color: var(--border-default); color: var(--fg); }
.btn-gold:hover { border-color: var(--fg-dim); }
.btn-teal { background: var(--success); border-color: var(--success); color: #fff; }
.btn-teal:hover { background: var(--engine-online); border-color: var(--engine-online); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 9px 14px; font-size: 0.82rem; }

.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.4;
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--fg-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.pill.crimson { border-color: var(--div-accent-border); color: var(--div-accent-dark); }
.pill.gold { border-color: var(--border-gold); color: var(--gold); }
.pill.teal { border-color: var(--border-teal); color: var(--teal); }
.pill.emerald { border-color: rgba(4, 120, 87, 0.3); color: var(--success); }

/* ---------- sections ---------- */
.section { padding: clamp(52px, 8vw, 96px) 0; border-bottom: 1px solid var(--border-subtle); }
.section:last-of-type { border-bottom: none; }
.section-tight { padding: clamp(36px, 5vw, 60px) 0; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 34px;
}
.section-head h2 { margin-bottom: 0; }
.section-head .btn { margin-top: 0; }
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin: 0 0 14px;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border-subtle); border: 1px solid var(--border-subtle); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border-subtle); border: 1px solid var(--border-subtle); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border-subtle); border: 1px solid var(--border-subtle); }
.grid-2 > *, .grid-3 > *, .grid-4 > * { background: var(--bg-card); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 681px) and (max-width: 960px) {
  /* A three-up grid with an odd last panel leaves a bare gutter cell at two columns. */
  .grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .grid-3 > .panel:last-child:nth-child(odd) > p { max-width: 64ch; }
  .grid-3 > .offer:last-child:nth-child(odd) {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    column-gap: clamp(24px, 4vw, 40px);
    align-content: start;
  }
  .grid-3 > .offer:last-child:nth-child(odd) > * { grid-column: 1; }
  .grid-3 > .offer:last-child:nth-child(odd) > ul {
    grid-column: 2;
    grid-row: 2 / span 4;
    align-self: center;
    margin: 0;
  }
  .grid-3 > .offer:last-child:nth-child(odd) > .btn {
    justify-self: start;
    margin-top: 18px;
    padding-inline: 26px;
  }
}
@media (max-width: 680px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.panel, .glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: clamp(22px, 3vw, 34px);
  transition: none;
}
.panel:hover, .glass-card:hover { border-color: var(--border-subtle); transform: none; box-shadow: none; }
.panel.gold-border, .glass-card.gold-border { border-color: var(--border-gold); }
.panel.teal-border, .glass-card.teal-border { border-color: var(--border-teal); }
.panel-flat { background: transparent; border: none; padding: 0; }
.band, .gradient-band, .teal-band {
  background: var(--bg-darker);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: clamp(26px, 4vw, 44px);
}

/* ---------- the receipt ---------- */
.receipt {
  background: var(--bg-card);
  border: 1px solid var(--fg1);
  padding: clamp(22px, 3.4vw, 40px);
  font-variant-numeric: tabular-nums;
}
.receipt-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--fg1);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.receipt-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1.6fr);
  gap: 10px 28px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: baseline;
}
.receipt-row:last-of-type { border-bottom: none; }
.receipt-value {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--fg);
}
.receipt-value small { display: block; font-family: var(--font-mono); font-size: 0.66rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim); margin-top: 7px; }
.receipt-meaning { font-size: 0.98rem; line-height: 1.5; color: var(--fg-2); }
.receipt-basis { font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.5; color: var(--fg-muted); }
.receipt-basis a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.receipt-foot { padding-top: 16px; border-top: 1px solid var(--fg1); font-size: 0.8rem; color: var(--fg-muted); }
@media (max-width: 780px) {
  .receipt-row { grid-template-columns: 1fr; gap: 8px; padding: 18px 0; }
  .receipt-meaning { font-size: 0.94rem; }
}

/* ---------- the lab ---------- */
.lab-intro { max-width: 48rem; }
.lab-mark { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.lab-mark .section-label { margin: 0; }
.lab-crest { width: 64px; height: 64px; flex: none; }
@media (max-width: 640px) {
  .lab-mark { gap: 12px; margin-bottom: 14px; }
  .lab-crest { width: 52px; height: 52px; }
}
.lab-statement {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.08;
  max-width: 22ch;
  margin-bottom: 20px;
}
.lab-lead {
  font-size: clamp(1.08rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 54ch;
  margin: 0;
}
.lab-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  margin-top: clamp(34px, 4vw, 52px);
  padding-top: clamp(26px, 3vw, 36px);
  border-top: 1px solid var(--border-subtle);
}
.lab-copy p { max-width: 62ch; font-size: 1rem; }
.lab-copy p:last-child { margin-bottom: 0; }
.lab-facts { margin: 0; }
.lab-facts > div {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.lab-facts > div:first-child { padding-top: 0; }
.lab-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.lab-facts dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding-top: 2px;
}
.lab-facts dd { margin: 0; font-size: 0.9rem; line-height: 1.45; color: var(--fg-2); }
.nowrap { white-space: nowrap; }
.offer li, .tier li { text-wrap: pretty; }
@media (max-width: 760px) {
  .lab-body { grid-template-columns: 1fr; }
  .lab-facts > div { grid-template-columns: 1fr; gap: 3px; }
}

/* ---------- offers ---------- */
.offer { display: flex; flex-direction: column; }
.offer h3 { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: -0.02em; }
.offer-kicker { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 12px; }
.offer ul { margin: 10px 0 20px; padding: 0; list-style: none; display: grid; gap: 9px; }
.offer li { font-size: 0.92rem; color: var(--fg-muted); padding-left: 16px; position: relative; }
.offer li::before { content: "—"; position: absolute; left: 0; color: var(--fg-dim); }
.offer-price { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; color: var(--fg); margin: 0 0 2px; }
.offer-price span { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 400; letter-spacing: 0.04em; color: var(--fg-dim); }
.offer-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--fg-dim); margin-bottom: 16px; }
.offer .btn { margin-top: auto; }

/* ---------- dispatch status, sign-in and archive ---------- */
.status-banner {
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--fg-dim);
  background: var(--bg-card);
  padding: 15px 18px;
}
.status-banner[data-state="ok"] { border-left-color: var(--success); }
.status-banner[data-state="pending"] { border-left-color: var(--gold); }
.status-banner[data-state="late"],
.status-banner[data-state="no_run"],
.status-banner[data-state="failed"],
.status-banner[data-state="unavailable"],
.status-banner[data-state="unconfigured"] { border-left-color: var(--warning); }
.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--fg-2);
}
.status-row strong { color: var(--fg); font-weight: 600; }
.status-label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-dim); }
.status-banner p { margin: 7px 0 0; font-size: 0.82rem; color: var(--fg-muted); }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fg-dim);
  flex: none;
}
[data-state="ok"] .status-dot { background: var(--success); }
[data-state="pending"] .status-dot { background: var(--gold); }
[data-state="late"] .status-dot,
[data-state="no_run"] .status-dot,
[data-state="failed"] .status-dot,
[data-state="unavailable"] .status-dot,
[data-state="unconfigured"] .status-dot { background: var(--warning); }
.status-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-muted);
}
.signin-form {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  padding: clamp(20px, 3vw, 30px);
  max-width: 760px;
}
.signin-form label { display: block; font-weight: 500; color: var(--fg); margin-bottom: 6px; }
.signin-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.signin-row input {
  flex: 1 1 280px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-input);
  background: var(--bg-card);
  color: var(--fg1);
  font: inherit;
}
.archive-list { list-style: none; margin: 18px 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.archive-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 18px; padding: 13px 0; border-bottom: 1px solid var(--border-subtle); }
.archive-list a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; color: var(--fg); }
.archive-meta { font-family: var(--font-mono); font-size: 0.7rem; color: var(--fg-dim); }

/* ---------- tiers ---------- */
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border-subtle); border: 1px solid var(--border-subtle); }
@media (max-width: 900px) { .tiers { grid-template-columns: 1fr; } }
.tier { background: var(--bg-card); padding: 28px; display: flex; flex-direction: column; }
.tier.featured { background: var(--bg-card); box-shadow: inset 0 3px 0 var(--div-accent); }
.tier-name { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 14px; }
.tier-price { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--fg); }
.tier-price small { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 400; letter-spacing: 0.04em; color: var(--fg-dim); display: block; margin-top: 8px; }
.tier ul { list-style: none; margin: 20px 0 24px; padding: 0; display: grid; gap: 9px; }
.tier li { font-size: 0.9rem; color: var(--fg-2); padding-left: 16px; position: relative; }
.tier li::before { content: "—"; position: absolute; left: 0; color: var(--fg-dim); }
.tier .btn { margin-top: auto; }
.tier-flag { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--div-accent-dark); margin-bottom: 10px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); background: var(--bg-card); margin: 22px 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
th { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--fg-muted); background: var(--bg-darker); font-weight: 500; }
tr:last-child td { border-bottom: none; }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- lists ---------- */
.list-clean { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 9px; }
.list-clean li { padding-left: 18px; position: relative; color: var(--fg-2); font-size: 0.94rem; }
.list-clean li::before { content: "—"; position: absolute; left: 0; color: var(--fg-dim); }
.list-tight li { font-size: 0.88rem; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: step; }
.checklist li { counter-increment: step; position: relative; padding-left: 30px; font-size: 0.92rem; color: var(--fg-2); }
.checklist li::before { content: counter(step); position: absolute; left: 0; top: 0.1em; font-family: var(--font-mono); font-size: 0.72rem; color: var(--fg-dim); border: 1px solid var(--border-default); border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; }

/* ---------- sample dossier ---------- */
.dossier { border: 1px solid var(--border-subtle); background: var(--bg-card); }
.dossier-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: baseline; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-darker); }
.dossier-id { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--fg-muted); }
.dossier-body { padding: 22px; }
.dossier-body h3 { font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 6px; }
.dossier-meta { font-family: var(--font-mono); font-size: 0.74rem; color: var(--fg-muted); display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 18px; }
.dossier-body h4 { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--fg-dim); margin: 22px 0 8px; }
.dossier-body p { font-size: 0.94rem; }
.sev-critical { border-color: var(--critical); color: var(--critical); }
.sev-high { border-color: var(--warning); color: var(--warning); }

/* ---------- prose ---------- */
.prose { font-size: 1.02rem; line-height: 1.72; color: var(--fg-2); }
.prose h2 { margin-top: 2.4rem; padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle); max-width: none; }
.prose h3 { margin-top: 1.8rem; color: var(--fg); }
.prose p { margin: 1rem 0; }
.prose ul, .prose ol { margin: 0.9rem 0; padding-left: 1.3rem; }
.prose li { margin: 0.45rem 0; }
.prose blockquote { margin: 1.4rem 0; padding: 1rem 1.2rem; border-left: 2px solid var(--div-accent); background: var(--inset); color: var(--fg); }
.prose table { margin: 1.4rem 0; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--fg-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: var(--r-input);
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  color: var(--fg1);
  font: inherit;
  font-size: 1rem;
}

/* ---------- legacy bits still referenced ---------- */
.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--fg-dim);
  margin-bottom: 14px;
}
.eyebrow::before { content: none; }
.eyebrow.crimson { color: var(--div-accent-dark); }
.eyebrow.teal { color: var(--teal); }
.ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--fg1); margin-top: 10px; }
.ledger > div { padding: 20px 20px 12px 0; border-right: 1px solid var(--border-subtle); }
.ledger > div + div { padding-left: 20px; }
.ledger > div:last-child { border-right: none; }
.ledger strong { display: block; font-family: var(--font-display); font-size: 1.7rem; color: var(--fg); }
.ledger .unit { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim); }
.ledger p { margin: 6px 0 0; font-size: 0.84rem; color: var(--fg-muted); }
.product-card { display: flex; flex-direction: column; }
.product-card > a { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-subtle); display: block; font-size: 0.86rem; }
.product-card > a:hover { color: var(--div-accent-dark); }
.product-plate { width: 100%; height: auto; border-radius: 2px; margin-bottom: 16px; border: 1px solid var(--border-subtle); }
.page-plate { width: 100%; max-width: 640px; height: auto; border-radius: 2px; margin: 0 0 22px; border: 1px solid var(--border-subtle); }
.tab-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.tab-btn { min-height: 44px; padding: 8px 14px; border-radius: 3px; border: 1px solid var(--border-subtle); background: transparent; color: var(--fg-muted); font-size: 0.82rem; font-weight: 500; cursor: pointer; }
.tab-btn.active { border-color: var(--fg-dim); color: var(--fg); }
.stage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.stage-btn { text-align: left; padding: 12px 14px; border-radius: 3px; border: 1px solid var(--border-subtle); background: transparent; color: var(--fg-muted); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.stage-btn span { font-family: var(--font-mono); font-size: 0.64rem; color: var(--fg-dim); letter-spacing: 0.07em; }
.stage-btn strong { font-size: 0.82rem; color: var(--fg); font-weight: 500; }
.stage-btn.active { border-color: var(--div-accent); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg);
  padding: 56px 0 36px;
  margin-top: auto;
  font-size: 0.84rem;
  color: var(--fg-muted);
}
.footer-grid { display: grid; grid-template-columns: 1.7fr repeat(3, minmax(0, 1fr)); gap: 32px; margin-bottom: 30px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-brand img { width: 40px; height: 40px; flex: none; }
.footer-col .footer-brand h4 { margin: 0; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-dim); margin: 0 0 12px; font-weight: 500; }
.footer-col a { display: flex; align-items: center; min-height: 44px; padding: 4px 0; color: var(--fg-muted); }
.footer-col a:hover { color: var(--fg1); }
.footer-col p { margin: 0 0 10px; }
.footer-bottom { padding-top: 18px; border-top: 1px solid var(--border-subtle); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.02em; }

/* ---------- links in body copy ---------- */
main a:not(.btn):not(.pill):not(.nav-link) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-default);
}
main a:not(.btn):hover { text-decoration-color: var(--div-accent); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff !important; color: #111 !important; }
  .site-header, .site-footer, .no-print { display: none !important; }
  .panel, .glass-card, .band { border-color: #ccc !important; background: #fff !important; color: #111 !important; }
}

@media (max-width: 640px) {
  .header-inner { min-height: 64px; gap: 12px; }
  .brand-link { gap: 8px; }
  .brand-signet { width: 28px; height: 28px; }
  .brand-title { font-size: 0.72rem; letter-spacing: 0.08em; }
  .brand-region { display: none; }
}

section[id], main[id] { scroll-margin-top: 92px; }


@media (max-width: 680px) {
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap th, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 14px 0; border-bottom: 1px solid var(--border-subtle); }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { border: 0; padding: 3px 0; }
  .table-wrap td::before { content: attr(data-label); display: block; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 3px; }
  .table-wrap td[data-label=""]::before { display: none; }
}

/* ============================================================
   HOME VISUAL PASS — index.html only (.hero-banner and .section.lab
   appear on no other page). Copy and markup are untouched: this
   block only gives the shopfront a dark stage, a real accent, and
   price numbers that carry weight.
   ============================================================ */

/* ---------- hero: Basalt Night stage ---------- */
.hero-banner {
  position: relative;
  overflow: hidden;
  background: var(--basalt-night);
  color: var(--aotearoa-bone);
  border-bottom: 0;
  padding: clamp(76px, 11vw, 148px) 0 clamp(58px, 7vw, 88px);
}
.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 420px at 12% -10%, rgba(225, 29, 72, 0.20), transparent 62%),
    repeating-linear-gradient(90deg, rgba(245, 245, 247, 0.055) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(245, 245, 247, 0.035) 0 1px, transparent 1px 96px);
}
.hero-banner > .wrap { position: relative; z-index: 1; }
.hero-banner .hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--scarlet-light);
  margin-bottom: 28px;
}
.hero-banner .hero-kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
}
.hero-banner h1 {
  color: #F5F5F7;
  max-width: 19ch;
  font-size: clamp(2.7rem, 5.4vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: 26px;
}
.hero-banner .lead {
  color: #C7CAD6;
  max-width: 54ch;
  font-size: clamp(1.06rem, 1.5vw, 1.22rem);
  line-height: 1.6;
  margin-bottom: 34px;
}
.hero-banner .hero-sub {
  color: #A6A9BA;
  max-width: 54ch;
  font-size: clamp(0.98rem, 1.25vw, 1.06rem);
  line-height: 1.62;
  margin: -16px 0 34px;
}
.hero-banner .hero-note {
  color: #8C8FA0;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(245, 245, 247, 0.10);
  max-width: 54ch;
}
.hero-banner .btn:not(.btn-primary) {
  border-color: rgba(245, 245, 247, 0.30);
  color: #F5F5F7;
}
.hero-banner .btn:not(.btn-primary):hover {
  background: rgba(245, 245, 247, 0.10);
  border-color: rgba(245, 245, 247, 0.55);
}
@media print {
  .hero-banner { background: #fff !important; color: #111 !important; }
  .hero-banner::before { display: none !important; }
  .hero-banner h1, .hero-banner .lead, .hero-banner .hero-sub, .hero-banner .hero-note { color: #111 !important; }
}

/* ---------- section labels get a lead-in rule ---------- */
.section-label { display: flex; align-items: center; gap: 11px; }
.section-label::before {
  content: "";
  width: 20px;
  height: 2px;
  flex: none;
  background: var(--div-accent);
}

/* ---------- core-work cards: hairline grid, no double borders ---------- */
.grid-2 > .panel,
.grid-3 > .panel {
  border: 0;
  border-radius: 0;
  padding: clamp(26px, 3.2vw, 42px);
}
.grid-2 > .panel h3,
.grid-3 > .panel h3 { font-size: 1.24rem; margin-bottom: 12px; }
.grid-2 > .panel .section-label { margin-bottom: 16px; }
.grid-2 > .panel ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.grid-2 > .panel li { position: relative; padding-left: 18px; font-size: 0.94rem; color: var(--fg-muted); }
.grid-2 > .panel li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 1px; background: var(--div-accent); }
.grid-2 > .panel > p:last-child { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.grid-2 > .panel > p:last-child a { color: var(--scarlet-dark); font-weight: 500; }

/* ---------- licences: a tinted tier, prices carry the weight ---------- */
.section.lab {
  background: var(--bg-darker);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: clamp(56px, 8vw, 104px) 0;
}
.section.lab .grid-3 { background: var(--border-subtle); }
.section.lab .offer { padding: clamp(24px, 2.8vw, 34px); }
.section.lab .offer:first-child { box-shadow: inset 0 3px 0 var(--div-accent); }
.offer-price {
  font-size: clamp(1.8rem, 2.6vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 6px;
}
.offer-price span {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  margin-left: 4px;
}
.offer-meta { margin-bottom: 18px; }

/* ---------- footer: a settled base, not a grey afterthought ---------- */
.site-footer {
  background: var(--bg-darker);
  border-top: 1px solid var(--border-default);
  padding: 64px 0 34px;
}
.footer-col h4 { color: var(--fg-muted); }

/* Header rides on the dark stage on the one page that has it, using the
   dark-surface brand master instead of the light one. */
body:has(.hero-banner) .site-header {
  background: rgba(10, 10, 20, 0.88);
  border-bottom-color: rgba(245, 245, 247, 0.12);
}
body:has(.hero-banner) .site-header .brand-title { color: #F5F5F7; }
body:has(.hero-banner) .site-header .brand-region { color: #9EA1B2; }
body:has(.hero-banner) .site-header .nav-link { color: #C7CAD6; }
body:has(.hero-banner) .site-header .nav-link:hover,
body:has(.hero-banner) .site-header .nav-link[aria-current="page"] { color: #F5F5F7; }
body:has(.hero-banner) .site-header .nav-toggle {
  color: #F5F5F7;
  border-color: rgba(245, 245, 247, 0.32);
  background: transparent;
}
body:has(.hero-banner) .site-header .main-nav { border-bottom-color: rgba(245, 245, 247, 0.12); }
body:has(.hero-banner) .brand-signet { content: url("../img/brand/scarlet-mark-dark.svg"); }
@media (max-width: 940px) {
  body:has(.hero-banner) .site-header .main-nav { background: var(--basalt-night); }
  body:has(.hero-banner) .site-header .nav-link { border-bottom-color: rgba(245, 245, 247, 0.12); }
}
.hero-banner h1 { max-width: 22ch; }
