/* CMX V3 · One Signal, Drawn
   A drawing sheet the signal travels through.
   Every rule here traces to a Phase 0 artifact:
   sheet, panel, set column, trace, maker's mark. */

/* ---------- fonts ---------- */

@font-face {
  font-family: "InterVariable";
  src: url("../assets/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
/* metric-matched fallback so the swap does not shift layout */
@font-face {
  font-family: "Inter-fallback";
  src: local("Helvetica Neue"), local("Arial");
  ascent-override: 96.9%;
  descent-override: 24.1%;
  line-gap-override: 0%;
  size-adjust: 100.9%;
}

/* ---------- base ---------- */

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

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

body {
  margin: 0;
  background: var(--ground-0);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-m);
  line-height: 1.6;
  font-feature-settings: "cv11" 1, "ss01" 1;
  overflow-x: clip;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  color: var(--ink-hi);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

p { max-width: 62ch; }

a {
  color: var(--ink-hi);
  text-decoration-color: var(--rule-bright);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--t-fast) var(--ease-register);
}
a:hover { text-decoration-color: var(--signal); }

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

::selection { background: var(--signal); color: var(--signal-ink); }

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
}

.skip-link {
  position: absolute;
  left: var(--s-2); top: var(--s-2);
  z-index: 100;
  background: var(--ground-1);
  color: var(--ink-hi);
  padding: 0.6rem 1rem;
  border: 1px solid var(--rule);
  transform: translateY(-200%);
  transition: transform var(--t-fast);
}
.skip-link:focus { transform: none; }

/* ---------- the sheet frame · drawing sheet ---------- */

.frame {
  position: fixed;
  inset: var(--frame-inset);
  border: 1px solid var(--rule-soft);
  pointer-events: none;
  z-index: 40;
}
/* corner registration ticks */
.frame::before, .frame::after {
  content: "";
  position: absolute;
  width: 9px; height: 9px;
}
.frame::before {
  top: -1px; left: -1px;
  border-top: 1px solid var(--rule-bright);
  border-left: 1px solid var(--rule-bright);
}
.frame::after {
  bottom: -1px; right: -1px;
  border-bottom: 1px solid var(--rule-bright);
  border-right: 1px solid var(--rule-bright);
}

/* ---------- layout · the lane and the column ---------- */

.wrap {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: calc(var(--lane) + var(--gutter)) var(--gutter);
}

main { position: relative; }

/* the signal lives behind content, in front of the ground */
#signal-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
#signal-svg path, #signal-svg circle { will-change: auto; }
.signal-path {
  fill: none;
  stroke: var(--signal);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.signal-ghost {
  fill: none;
  stroke: var(--rule-soft);
  stroke-width: 1;
}
.signal-tip {
  fill: var(--signal);
  filter: drop-shadow(0 0 6px oklch(from var(--signal) l c h / 0.9));
}

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

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: oklch(from var(--ground-0) l c h / 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: 56px;
}
.brand {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  color: var(--ink-hi);
  text-decoration: none;
}
.brand .x { color: var(--ink-hi); }
.site-nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.5vw, 1.8rem); }
.site-nav a {
  text-decoration: none;
  font-size: var(--text-s);
  color: var(--ink);
}
.site-nav a:hover { color: var(--ink-hi); }
.site-nav a[aria-current="page"] {
  color: var(--ink-hi);
  border-bottom: 1px solid var(--signal);
  padding-bottom: 2px;
}

.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-s);
  font-weight: 600;
  color: var(--ink-hi);
  background: var(--ground-1);
  border: 1px solid var(--rule-bright);
  border-radius: var(--radius);
  padding: 0.65rem 1.15rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-register),
              background var(--t-fast) var(--ease-register),
              color var(--t-fast) var(--ease-register);
}
.btn:hover { border-color: var(--signal); }
.btn-signal {
  background: var(--ground-2);
  border-color: var(--rule-bright);
}
.btn-signal:hover { border-color: var(--signal); color: var(--signal); }
/* the terminal state: only ever one of these lit at a time */
.btn-signal.is-live {
  border-color: var(--signal);
}

.head-actions { display: flex; align-items: center; gap: 0.75rem; }
.tel-link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink-2);
  white-space: nowrap;
}
.tel-link:hover { color: var(--ink-hi); }

/* mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink-hi);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--ground-0);
    border-bottom: 1px solid var(--rule);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    width: 100%;
    padding: 0.9rem calc(var(--lane) + var(--gutter));
    border-top: 1px solid var(--rule-soft);
    font-size: var(--text-m);
  }
  .site-nav a[aria-current="page"] { border-bottom: none; border-left: 2px solid var(--signal); }
  .head-actions .tel-link { display: none; }
}

/* ---------- stations ---------- */

.station {
  padding-block: var(--s-6);
  border-top: 1px solid var(--rule-soft);
}
.station:first-of-type { border-top: none; }

.station-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: var(--s-3);
}
.station-label .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 1px solid var(--ink-2);
  background: transparent;
  transition: background var(--t-med) var(--ease-register),
              border-color var(--t-med) var(--ease-register);
}
.station.is-live .station-label .dot {
  background: var(--signal);
  border-color: var(--signal);
}

.station h2 { font-size: var(--text-xl); max-width: 24ch; }
.station .lede {
  font-size: var(--text-l);
  line-height: 1.4;
  color: var(--ink-hi);
  font-weight: 480;
  max-width: 34ch;
  letter-spacing: -0.012em;
}

/* invisible geometry the signal traverses */
.sig-underline {
  display: block;
  height: 1px;
  width: min(220px, 55%);
  margin-top: 0.9rem;
}

/* two-column station body on wide screens */
.station-cols {
  display: grid;
  gap: var(--s-3) var(--s-5);
  margin-top: var(--s-4);
}
@media (min-width: 860px) {
  .station-cols { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(2.5rem, 6vh, 5rem) var(--s-5);
  border-top: none;
}

.hero-mark {
  position: relative;
  width: fit-content;
  margin-bottom: clamp(1.5rem, 4vh, 3rem);
}
.wordmark {
  font-size: clamp(6rem, 30vw, 17rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.86;
  color: var(--ink-hi);
  user-select: none;
}
.wordmark .x { position: relative; display: inline-block; }
/* the lamp comes alive once measured */
.wordmark.is-live .x { color: var(--signal); }
.wordmark .x { transition: color 600ms var(--ease-register); }

/* dimension chains, drawn by JS around the wordmark */
#dim-svg {
  position: absolute;
  /* placed and sized in pixels by main.js so coordinates stay 1:1 */
  max-width: none;
  pointer-events: none;
  overflow: visible;
}
#dim-svg line {
  stroke: var(--rule-bright);
  stroke-width: 1;
}
#dim-svg text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--ink-2);
  letter-spacing: 0.06em;
}

.hero h1 {
  font-size: var(--text-2xl);
  max-width: 17ch;
  margin-bottom: var(--s-2);
}
.hero .sub {
  font-size: var(--text-l);
  color: var(--ink);
  max-width: 42ch;
  line-height: 1.45;
  margin-bottom: var(--s-4);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.quiet-link {
  font-size: var(--text-s);
  color: var(--ink);
}

/* ---------- title block · maker's mark ---------- */

.title-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  border: 1px solid var(--rule);
  margin-top: var(--s-5);
  background: var(--ground-1);
}
.title-block > div {
  padding: 0.55rem 0.85rem;
  border-inline-start: 1px solid var(--rule-soft);
  min-width: 0;
}
.title-block > div:first-child { border-inline-start: none; }
.title-block dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 0.15rem;
}
.title-block dd {
  margin: 0;
  font-size: var(--text-s);
  color: var(--ink-hi);
}
@media (min-width: 721px) {
  .title-block dd {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ---------- register rows · method, pricing ---------- */

.register { border-top: 1px solid var(--rule); margin-top: var(--s-4); }
.register-row {
  display: grid;
  grid-template-columns: minmax(64px, auto) 1fr;
  gap: var(--s-2) var(--s-4);
  padding-block: var(--s-3);
  border-bottom: 1px solid var(--rule-soft);
}
.register-row .no {
  font-family: var(--font-mono);
  font-size: var(--text-s);
  color: var(--ink-2);
  letter-spacing: 0.08em;
  padding-top: 0.3rem;
}
.register-row h3 { font-size: var(--text-l); margin-bottom: 0.4rem; }
.register-row p { color: var(--ink); }

/* ---------- divergence plates ---------- */

.plates {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
@media (min-width: 760px) {
  .plates { grid-template-columns: repeat(3, 1fr); }
}

.plate {
  border: 1px solid var(--rule);
  background: var(--ground-1);
  display: flex;
  flex-direction: column;
}
.plate-canvas {
  /* each plate carries its client's world inside a dark mount */
  height: 200px;
  margin: 10px;
  border: 1px solid var(--rule-soft);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.plate-meta {
  padding: 0.4rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.plate-meta .name { color: var(--ink-hi); font-weight: 600; font-size: var(--text-s); }
.plate-meta .fp {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  line-height: 1.7;
}
.plate-chips { display: flex; gap: 4px; margin-top: 0.4rem; }
.plate-chips i {
  width: 22px; height: 8px;
  border: 1px solid oklch(0% 0 0 / 0.25);
}

/* in-build rows under the plates */
.plate-pending {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.plate-pending:first-of-type { border-top: 1px solid var(--rule-soft); margin-top: var(--s-3); }

/* divergence branch traces */
#traces {
  width: 100%;
  height: auto;
  margin-top: var(--s-4);
}
#traces path {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: var(--len, 600);
  stroke-dashoffset: var(--len, 600);
  transition: stroke-dashoffset 1100ms var(--ease-register);
}
#traces .t-spine { stroke: var(--signal); }
.station.is-live #traces path { stroke-dashoffset: 0; }
#traces path:nth-child(2) { transition-delay: 120ms; }
#traces path:nth-child(3) { transition-delay: 240ms; }
#traces path:nth-child(4) { transition-delay: 360ms; }

/* ---------- work cards (register style, not icon cards) ---------- */

.case-flag {
  border: 1px solid var(--rule);
  background: var(--ground-1);
  padding: var(--s-4);
  margin-top: var(--s-4);
}
.case-flag h3 { font-size: var(--text-xl); }

.work-list { margin-top: var(--s-3); border-top: 1px solid var(--rule); }
.work-item {
  display: grid;
  grid-template-columns: minmax(56px, auto) 1fr auto;
  align-items: baseline;
  gap: var(--s-2) var(--s-3);
  padding-block: var(--s-3);
  border-bottom: 1px solid var(--rule-soft);
}
.work-item h3 { font-size: var(--text-l); }
.work-item .status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
}
.work-item p { grid-column: 2 / -1; }

/* ---------- pricing ---------- */

.tier {
  border: 1px solid var(--rule);
  background: var(--ground-1);
  margin-top: var(--s-3);
  padding: var(--s-4);
  display: grid;
  gap: var(--s-2) var(--s-5);
}
@media (min-width: 860px) {
  .tier { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .tier .tier-spec { grid-column: 2; grid-row: 1 / span 2; }
}
.tier-head { display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap; }
.tier-head h3 { font-size: var(--text-l); }
.tier .price {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-hi);
  font-variant-numeric: tabular-nums;
}
.tier .price small {
  font-size: var(--text-s);
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0;
}
.tier-spec { display: grid; gap: 0.45rem; align-content: start; }
.tier-spec li {
  display: flex;
  gap: 0.7rem;
  font-size: var(--text-s);
  line-height: 1.5;
}
.tier-spec li::before {
  content: "";
  flex: 0 0 14px;
  height: 1px;
  background: var(--rule-bright);
  margin-top: 0.7em;
}
.tier-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.tier.tier-care { border-color: var(--rule-bright); }

/* ---------- trust plate ---------- */

.trust-plate {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--rule);
  background: var(--ground-2);
  padding: 0.7rem 1rem;
  text-decoration: none;
  margin-top: var(--s-3);
}
.trust-plate .stars { display: flex; gap: 3px; }
.trust-plate .stars i {
  width: 14px; height: 14px;
  background: var(--ink-2);
  clip-path: polygon(50% 0, 63% 36%, 100% 38%, 70% 60%, 81% 100%, 50% 76%, 19% 100%, 30% 60%, 0 38%, 37% 36%);
  transition: background var(--t-med);
}
.trust-plate:hover .stars i { background: var(--ink-hi); }
.trust-plate span { font-size: var(--text-s); color: var(--ink); }

/* ---------- founder ---------- */

.founder blockquote {
  font-size: var(--text-l);
  line-height: 1.5;
  color: var(--ink-hi);
  font-weight: 480;
  max-width: 38ch;
  letter-spacing: -0.012em;
}
.founder .sig {
  margin-top: var(--s-3);
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
}
.founder .sig strong { color: var(--ink-hi); font-weight: 650; }

/* ---------- form ---------- */

.enquiry-form {
  display: grid;
  gap: var(--s-3);
  max-width: 560px;
  margin-top: var(--s-4);
}
.field { display: grid; gap: 0.4rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field input, .field textarea {
  background: var(--ground-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink-hi);
  font: inherit;
  font-size: var(--text-m);
  padding: 0.75rem 0.9rem;
  width: 100%;
  transition: border-color var(--t-fast) var(--ease-register);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--signal);
}
.field .err {
  font-size: var(--text-xs);
  color: oklch(78% 0.13 60);
  min-height: 1.1em;
  display: block;
}
.field.has-error input, .field.has-error textarea { border-color: oklch(60% 0.13 60); }

.form-send { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
#send-btn { padding: 0.85rem 1.6rem; font-size: var(--text-m); }
#send-btn.is-live {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--signal-ink);
}

.form-success {
  border: 1px solid var(--signal);
  background: var(--ground-2);
  padding: var(--s-4);
  max-width: 560px;
  margin-top: var(--s-4);
}
.form-success h3 { font-size: var(--text-l); margin-bottom: 0.5rem; }
.form-success .mono { color: var(--signal); }
[hidden] { display: none !important; }

.contact-direct {
  display: grid;
  gap: 0.5rem;
  margin-top: var(--s-4);
  font-size: var(--text-m);
}
.contact-direct a { font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--rule);
  margin-top: var(--s-6);
  padding-block: var(--s-5) calc(var(--s-5) + var(--frame-inset));
  background: var(--ground-2);
}
.foot-grid {
  display: grid;
  gap: var(--s-4);
}
@media (min-width: 760px) {
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.site-foot address {
  font-style: normal;
  font-size: var(--text-s);
  line-height: 1.8;
  color: var(--ink);
}
.site-foot nav { display: grid; gap: 0.5rem; align-content: start; }
.site-foot nav a { font-size: var(--text-s); text-decoration: none; color: var(--ink); }
.site-foot nav a:hover { color: var(--ink-hi); }
.foot-legal {
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--rule-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- reveals · registration, never dim at rest ---------- */

html.js .reveal {
  opacity: 0;
  translate: 0 10px;
  transition: opacity 480ms var(--ease-register), translate 480ms var(--ease-register);
}
html.js .reveal.is-set { opacity: 1; translate: 0 0; }

/* ---------- page banner for inner pages ---------- */

.page-head { padding-block: var(--s-5) var(--s-2); }
.page-head h1 { font-size: var(--text-2xl); max-width: 18ch; }
.page-head .sub { font-size: var(--text-l); color: var(--ink); max-width: 44ch; margin-top: var(--s-2); line-height: 1.45; }

.prose { display: grid; gap: var(--s-2); }
.prose h2 { font-size: var(--text-l); margin-top: var(--s-3); }
.prose ul { padding-left: 1.1rem; }
.prose li { margin-bottom: 0.35rem; }

/* ---------- plate specimens · each client's world inside a dark mount.
   These are designed placeholder frames standing in for real build
   screenshots, logged in IMAGERY-PLAN.md. They are content, not chrome:
   the CMX palette discipline applies to the site, plates carry the client. */

.plate-canvas .specimen {
  font-size: 4.2rem;
  line-height: 1;
  user-select: none;
}
.plate-canvas .mini {
  position: absolute;
  right: 10px; bottom: 10px;
  width: 46px; height: 30px;
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid oklch(0% 0 0 / 0.3);
}
.plate-canvas .mini i { display: block; }

.plate-penryn { background: #f3ede4; }
.plate-penryn .specimen {
  font-family: Georgia, "Times New Roman", serif;
  color: #2a211c;
  font-weight: 700;
}
.plate-penryn::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 7px;
  background: #b8553f;
}
.plate-penryn .mini-split i:first-child { flex: 1; background: #2a211c; }
.plate-penryn .mini-split i:last-child { flex: 1.4; background: #8a6a4f; }

.plate-getup { background: #0c0c0c; }
.plate-getup .specimen {
  color: #e8e4dc;
  font-weight: 900;
  letter-spacing: -0.05em;
  transform: scaleY(1.25);
  text-transform: uppercase;
}
.plate-getup::after {
  content: "";
  position: absolute;
  left: 14px; bottom: 14px;
  width: 34px; height: 5px;
  background: #d9a514;
}
.plate-getup .mini-bleed i { flex: 1; background: #3a3a3a; }

.plate-mclachlan { background: #f6f1ec; }
.plate-mclachlan .specimen {
  font-family: "Snell Roundhand", "Apple Chancery", "Segoe Script", "Brush Script MT", cursive;
  color: #7d6b58;
  font-size: 3.4rem;
}
.plate-mclachlan .mini-centre i { flex: 1; background: #c8b49a; }

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

/* ---------- reduced motion · the calm sheet ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html.js .reveal { opacity: 1; translate: 0 0; }
  #traces path { stroke-dashoffset: 0 !important; }
}
