/* CPHR site styles. */

:root {
  /* Brand colours from the CPHR logo kit (CPHR-logo-final/COLOURS.txt). */
  --ink: #0A1020;
  --paper: #F3F5F8;
  --cursor-on-dark: #FFC928;   /* accent on dark grounds: 12.3:1 on ink */
  --cursor-on-light: #E5A800;  /* light grounds only, as a fill under ink text.
                                  Never as text or outline on paper: 1.9:1 fails AA. */

  /* Site tokens. The whole site sits on the dark ground. */
  --bg: var(--ink);
  --surface: #121A2C;
  --line: #1E2840;
  --line-strong: #2E3A54;
  --field-border: #6B7894;     /* input outlines: 4.3:1 on ink, passes the 3:1 UI rule */
  --text: var(--paper);
  --muted: #94A0B4;            /* 7.2:1 on ink, 6.6:1 on surface */
  --accent: var(--cursor-on-dark);
  --accent-hover: #FFD65C;
  --accent-ink: var(--ink);
  --error: #F0A58F;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1120px;
  --gutter: clamp(16px, 5vw, 48px);
  --section: clamp(72px, 11vw, 144px);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img, svg { display: block; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute; left: -9999px;
}
.skip:focus {
  left: 16px; top: 16px; z-index: 10;
  background: var(--accent); color: var(--accent-ink); padding: 8px 12px;
}

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

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px 32px;
  padding-top: 22px; padding-bottom: 22px;
}
.brand {
  display: flex; align-items: center;
  text-decoration: none;
}
.brand-mark { display: block; height: 24px; width: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.nav a {
  font-size: 15px; color: var(--muted); text-decoration: none;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--accent); }

/* Type */

.eyebrow {
  font-family: var(--mono); font-size: 13px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 20px;
}
h1, h2, h3 { font-weight: 500; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(36px, 5.6vw, 64px); line-height: 1.08; max-width: 18ch; }
h2 { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.2; }
h3 { font-size: 19px; line-height: 1.35; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }

/* Hero + answer-first */

.hero { padding: clamp(64px, 10vw, 128px) 0 clamp(48px, 7vw, 88px); }
.hero .sub {
  font-size: clamp(19px, 2vw, 22px); color: var(--muted);
  margin: 24px 0 0; max-width: 40ch;
}
.answer {
  margin-top: clamp(40px, 6vw, 64px);
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 24px;
  max-width: 68ch;
}
.answer p { margin: 0; font-size: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.btn {
  display: inline-block; text-decoration: none;
  font-size: 15px; font-weight: 500;
  padding: 13px 22px; border: 1px solid var(--field-border);
}
.btn:hover { border-color: var(--text); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Sections */

.section { padding: var(--section) 0; border-top: 1px solid var(--line); }
.section-head { max-width: 60ch; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head p { color: var(--muted); margin-top: 16px; }

.cols {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  background: var(--line); border: 1px solid var(--line);
}
.col { background: var(--bg); padding: 32px 28px; }
.col h3 { margin-bottom: 12px; }
.col p { color: var(--muted); margin: 0; }
.col .num {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  display: block; margin-bottom: 28px;
}

.service-link {
  display: flex; flex-direction: column; text-decoration: none;
}
.service-link:hover { background: var(--surface); }
.service-link .more {
  margin-top: auto; padding-top: 28px;
  font-size: 15px; color: var(--text);
}
.service-link .more::after { content: " \2192"; color: var(--accent); }

/* Two-column prose blocks on service pages */

.block {
  display: grid; gap: 16px 64px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  padding: clamp(40px, 6vw, 64px) 0;
  border-top: 1px solid var(--line);
}
.block:first-child { border-top: 0; }
.block h2 { font-size: 22px; }
.block .body { max-width: 62ch; }
.block .body > :last-child { margin-bottom: 0; }
@media (max-width: 760px) {
  .block { grid-template-columns: 1fr; }
}

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 14px 0 14px 28px; border-top: 1px solid var(--line); position: relative; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li::before {
  content: ""; position: absolute; left: 0; top: 25px;
  width: 8px; height: 8px; background: var(--accent);
}
.list li:first-child::before { top: 11px; }
.list.not li::before { background: none; border: 1px solid var(--muted); }

/* Facts strip */

.facts {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  background: var(--line); border: 1px solid var(--line);
  margin: 0;
}
.facts div { background: var(--surface); padding: 24px; }
.facts dt {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.facts dd { margin: 0; font-size: 17px; }

/* Ownership strip, restated on every service page */

.owned {
  background: var(--surface); border: 1px solid var(--line);
  padding: 28px; display: grid; gap: 8px 32px;
  grid-template-columns: auto 1fr; align-items: center;
}
.owned p { margin: 0; color: var(--muted); }
.owned strong { color: var(--text); font-weight: 500; }
@media (max-width: 640px) { .owned { grid-template-columns: 1fr; } }

/* FAQ */

.faq { border-top: 1px solid var(--line); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 22px 40px 22px 0; position: relative;
  font-size: 18px; font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 20px;
  font-family: var(--mono); font-size: 20px; color: var(--accent);
}
.faq details[open] summary::after { content: "\2212"; }
.faq .a { padding: 0 0 24px; color: var(--muted); max-width: 66ch; }
.faq .a p:last-child { margin-bottom: 0; }

/* CTA band */

.cta { padding: var(--section) 0; border-top: 1px solid var(--line); }
.cta h2 { max-width: 22ch; }
.cta p { color: var(--muted); max-width: 52ch; margin-top: 16px; }

/* Contact form */

.form { display: grid; gap: 20px; max-width: 640px; }
.form label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.form input, .form textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--field-border);
  padding: 12px 14px; border-radius: 0;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form textarea { min-height: 160px; resize: vertical; }
.form .row2 { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .form .row2 { grid-template-columns: 1fr; } }
.form button { justify-self: start; cursor: pointer; font-family: inherit; }
.form .hp { position: absolute; left: -9999px; }
.form-status { min-height: 1.6em; margin: 0; }
.form-status.ok { color: var(--accent); }
.form-status.err { color: var(--error); }

.emails { list-style: none; padding: 0; margin: 0; }
.emails li { padding: 12px 0; border-top: 1px solid var(--line); }
.emails li:first-child { border-top: 0; padding-top: 0; }
.emails span { display: block; font-size: 14px; color: var(--muted); }
.emails a { font-family: var(--mono); font-size: 16px; text-decoration: none; }
.emails a:hover { color: var(--accent); }

/* Footer */

.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* Calculator (reactivation section). Figures come only from the visitor. */

.calc { display: grid; gap: 0; max-width: 820px; border-top: 1px solid var(--line); }
.field {
  display: grid; gap: 8px 40px;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  padding: 32px 0; border-bottom: 1px solid var(--line);
}
@media (max-width: 680px) { .field { grid-template-columns: minmax(0, 1fr); } }
.field .step { font-family: var(--mono); font-size: 13px; color: var(--accent); display: block; margin-bottom: 8px; }
.field label { font-size: 19px; font-weight: 500; display: block; }
.field .explain { color: var(--muted); margin: 10px 0 0; font-size: 16px; }
.field .explain + .explain { margin-top: 6px; }
.field .input { align-self: end; }
.input-wrap {
  display: flex; align-items: stretch;
  border: 1px solid var(--field-border); background: var(--surface);
}
.input-wrap:focus-within { border-color: var(--accent); }
.input-wrap input {
  flex: 1; min-width: 0; width: 100%; font: inherit; font-family: var(--mono); font-size: 20px;
  color: var(--text); background: transparent; border: 0; padding: 14px 16px;
  text-align: right; outline: none;
}
.input-wrap .unit {
  font-family: var(--mono); font-size: 14px; color: var(--muted);
  padding: 0 16px; display: flex; align-items: center;
  border-left: 1px solid var(--line);
}
.input-wrap .unit.pre { border-left: 0; border-right: 1px solid var(--line); }
.field .error { color: var(--error); font-size: 14px; margin: 8px 0 0; min-height: 1.4em; }

.working { margin-top: clamp(40px, 6vw, 64px); max-width: 820px; }
.working h2 { font-size: 22px; margin-bottom: 8px; }
.working .waiting { color: var(--muted); }
.ledger { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 15px; margin-top: 24px; }
.ledger th, .ledger td { text-align: left; padding: 16px 0; border-top: 1px solid var(--line); vertical-align: top; }
.ledger th { font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: 15px; padding-right: 24px; width: 42%; }
.ledger .sum { color: var(--muted); display: block; margin-bottom: 4px; word-break: break-word; }
.ledger .res { color: var(--text); font-size: 17px; }
.ledger tr:last-child th, .ledger tr:last-child td { border-bottom: 1px solid var(--line); }
.whose {
  margin-top: 28px; padding: 20px 24px;
  border: 1px solid var(--line-strong); background: var(--surface);
}
.whose p { margin: 0 0 .6em; }
.whose p:last-child { margin-bottom: 0; color: var(--muted); }
.local-note { font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: .02em; }

.segment { margin: 32px 0 0; max-width: 68ch; color: var(--text); }
.local-note { margin: 20px 0 0; max-width: 90ch; }
.btn-plain { background: transparent; color: var(--text); font-family: inherit; cursor: pointer; }

.after { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 32px; }
.after h3 { margin-bottom: 6px; }
.after-row {
  display: grid; gap: 16px 40px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 28px 0; border-bottom: 1px solid var(--line);
}
@media (max-width: 680px) { .after-row { grid-template-columns: minmax(0, 1fr); } }
.after-title { font-weight: 500; margin: 0 0 6px; }
.after-note { color: var(--muted); font-size: 15px; margin: 0; }
.after-actions { display: flex; flex-wrap: wrap; gap: 12px; align-content: start; }
.after-form { display: grid; gap: 12px; align-content: start; }
.after-form label { font-size: 14px; color: var(--muted); }
.after-form .input-wrap input { text-align: left; font-family: var(--sans); font-size: 17px; }
.after-form button { justify-self: start; cursor: pointer; font-family: inherit; }
.after-form .hp { position: absolute; left: -9999px; }
.after-status { flex-basis: 100%; margin: 0; font-size: 14px; min-height: 1.4em; color: var(--muted); }
.after-status.ok { color: var(--accent); }
.after-status.err { color: var(--error); }
.direct { margin: 0; font-size: 18px; align-self: center; }
.direct a { font-family: var(--mono); color: var(--accent); text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }

/* One-line founder note on each service page */
.founder-line { margin-bottom: 24px; }
.founder-line p { max-width: 68ch; margin: 0; color: var(--muted); }
.founder-line .eyebrow { display: block; margin: 0 0 8px; }
