/* site.css: layout and roles. No brand values here; every colour, face and size comes from brand.css. */

/* ---------- Roles ---------- */
:root {
  color-scheme: light dark;
  --bg: var(--paper);
  --raised: var(--paper-raised);
  --fg: var(--ink);
  --muted: var(--n-600);
  --subtle: var(--n-500);
  --rule: var(--n-200);
  --rule-strong: var(--fg);
  --node: var(--n-300);
  --accent: var(--brand);
  --accent-text: var(--brand-text);
  --pill: var(--n-100);
  --pill-hover: var(--n-200);
  --focus: var(--brand-focus);

  --measure: 41.25rem;  /* 660 px, the long-form column */
  --wide: 61rem;        /* figures */
  --max: 82rem;         /* header and footer */
  --gutter: clamp(1rem, 0.4rem + 2.6vw, 2.5rem);
  --space-sec: clamp(6.5rem, 4rem + 8vw, 11rem);
  --ease-out: cubic-bezier(0.16, 0.84, 0.24, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--ink);
    --raised: var(--ink-raised);
    --fg: var(--paper);
    --muted: var(--n-300);
    --subtle: var(--n-400);
    --rule: var(--n-800);
    --node: var(--n-600);
    --accent: var(--brand-mark-dark);
    --accent-text: var(--brand-text-dark);
    --pill: var(--n-800);
    --pill-hover: var(--n-700);
    --focus: var(--brand-focus-dark);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-weight: var(--weight-regular);
  font-size: var(--step-0);
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: inherit; }
b, strong { font-weight: var(--weight-medium); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.g-from { stop-color: var(--brand-grad-from); }
.g-mid { stop-color: var(--brand-grad-mid); }
.g-to { stop-color: var(--brand-grad-to); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: var(--gutter); top: 0.75rem; z-index: 10;
  padding: 0.5rem 0.875rem; border-radius: var(--radius-pill);
  background: var(--fg); color: var(--bg); text-decoration: none; font-size: var(--step--1);
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  max-width: var(--max); margin-inline: auto; height: 4rem; padding-inline: var(--gutter);
  background: var(--bg);
}
.top::after {  /* hairline that only shows once the page scrolls under */
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: var(--rule);
  opacity: 0; transition: opacity 200ms;
}
.top.is-stuck::after { opacity: 1; }
.logo { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; border-radius: 4px; }
.logo picture, .foot__lockup picture { display: block; }
.logo__mark { width: 25px; height: 22px; }
.logo__word { width: 73px; height: 18px; }
.nav ul { display: flex; gap: clamp(1rem, 0.5rem + 1.2vw, 2rem); }
.nav a {
  font-size: var(--step--1); color: var(--fg); text-decoration: none;
  padding-block: 0.375rem; border-bottom: 1px solid transparent;
}
.nav a:hover { border-bottom-color: currentColor; }
@media (max-width: 47.99rem) {
  .nav li:not(:last-child) { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(1.5rem, 1rem + 1.5vw, 2.5rem) var(--gutter) 0;
}
.fig1 { width: min(100%, 54rem); margin-bottom: clamp(2.5rem, 1.5rem + 2.5vw, 3.5rem); }
.fig1-svg { width: 100%; height: auto; overflow: visible; }
.fig1-narrow { display: none; }
@media (max-width: 47.99rem) {
  .fig1-wide { display: none; }
  .fig1-narrow { display: block; }
}
.fig1 figcaption, .flow figcaption {
  max-width: 44rem; margin: 1.25rem auto 0; font-size: var(--step--1); line-height: 1.5; color: var(--subtle);
  text-align: center; text-wrap: pretty;
}
.fig-n { color: var(--fg); font-weight: var(--weight-medium); }
.cap-narrow { display: none; }
@media (max-width: 47.99rem) { .cap-wide { display: none; } .cap-narrow { display: inline; } }
.brand-colour-name::before { content: var(--brand-colour-name); color: var(--accent-text); }

/* figure marks */
.fig1 text { font-family: var(--font-text); fill: var(--subtle); font-size: 12.5px; }
.fig1 .grp { fill: var(--fg); font-weight: var(--weight-medium); font-size: 13px; }
.fig1 .fld-accent { fill: var(--accent-text); }
.fig1 .rule { stroke: var(--rule); stroke-width: 1; }
.fig1 .b1 { fill: var(--fg); }
.fig1 .b0 { fill: var(--node); }
.fig1 .now { fill: var(--accent); }
.fig1 .now.hollow { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.fig1 .tick { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 3; }
.fig1 .brk { fill: none; stroke: var(--node); stroke-width: 1; }
.fig1 .brk-accent { stroke: var(--accent); }
.fig1 .d .was { opacity: 0; }

/* Moment 1: on load, the patched unit's differing bits turn, one after another. */
@media (prefers-reduced-motion: no-preference) {
  .fig1 .d .was { animation: bit-was 240ms ease-in both; animation-delay: calc(700ms + var(--i) * 150ms); }
  .fig1 .d .now {
    transform-box: fill-box; transform-origin: center;
    animation: bit-now 520ms var(--ease-out) both; animation-delay: calc(700ms + var(--i) * 150ms);
  }
  .fig1 .tick { animation: tick-in 600ms var(--ease-out) both; animation-delay: 1800ms; }
}
@keyframes bit-was { from { opacity: 1; } to { opacity: 0; } }
@keyframes bit-now { from { opacity: 0; transform: rotate(-90deg) scale(0.3); } to { opacity: 1; transform: none; } }
@keyframes tick-in { from { opacity: 0; } to { opacity: 1; } }

h1 {
  font-family: var(--font-display); font-weight: var(--weight-regular);
  font-size: var(--step-6); line-height: 1.04; letter-spacing: var(--display-tracking);
  font-variant-numeric: proportional-nums; max-width: 17ch; text-wrap: balance;
}
.lede {
  max-width: 38rem; margin-top: 1.25rem; color: var(--muted);
  font-size: var(--step-0); line-height: 1.55; text-wrap: pretty;
}
.actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.75rem 1.75rem; margin-top: 2rem; }
.pill {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1.375rem;
  border-radius: var(--radius-pill); background: var(--pill); color: var(--fg);
  font-weight: var(--weight-medium); font-size: var(--step-0); text-decoration: none;
  transition: background-color 160ms;
}
.pill:hover { background: var(--pill-hover); }
.pill--solid { background: var(--brand); color: #fff; background-image: var(--brand-grad); }
.pill--solid:hover { background: var(--brand-700); }
.more { display: inline-flex; gap: 0.5rem; align-items: baseline; text-decoration: none; padding-block: 0.5rem; }
.more span { color: var(--subtle); transition: transform 160ms var(--ease-out); }
.more:hover span { transform: translateX(3px); }

/* ---------- Sections ---------- */
.sec {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--space-sec) var(--gutter) 0;
}
.glyph { width: clamp(4.5rem, 3.6rem + 3vw, 6.5rem); aspect-ratio: 1; margin-bottom: 2rem; color: var(--accent); }
.glyph svg { width: 100%; height: 100%; fill: currentColor; }
h2 {
  font-family: var(--font-display); font-weight: var(--weight-regular);
  font-size: var(--step-3); line-height: 1.15; letter-spacing: -0.012em; max-width: 22ch; text-wrap: balance;
}
.sec__lede { max-width: 32rem; margin-top: 1rem; color: var(--muted); text-wrap: pretty; }

/* Moment 2: each section's Rim turns into its frame as it arrives; down the page they make one half-turn. */
@media (prefers-reduced-motion: no-preference) {
  .js .glyph svg { transition: transform 1400ms var(--ease-out), opacity 500ms linear; }
  .js .glyph:not(.is-in) svg { transform: rotate(-45deg); opacity: 0; }
}

/* How it works: Figure 2 */
.flow { width: min(100%, var(--wide)); margin-top: clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.flow__steps { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: start; gap: 4rem; text-align: left; }
.node {
  position: relative; display: flex; flex-direction: column; gap: 0.375rem;
  padding: 1.375rem 1.5rem 1.5rem; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--raised);
}
.node__k { font-size: var(--step--1); color: var(--subtle); }
.node__t { font-weight: var(--weight-medium); font-size: var(--step-1); line-height: 1.25; }
.node__d { color: var(--muted); font-size: var(--step--1); line-height: 1.5; }
.node--core { border-color: var(--accent); }
.node--core .node__k { color: var(--accent-text); }
.node__glyph { position: absolute; top: 1.125rem; right: 1.25rem; width: 1.75rem; height: 1.75rem; color: var(--accent); }
.node__glyph svg { width: 100%; height: 100%; fill: currentColor; }
.node__list { margin-top: 0.25rem; }
.node__list li { display: grid; grid-template-columns: 7px 1fr; column-gap: 0.625rem; padding-block: 0.625rem; }
.node__list li + li { border-top: 1px solid var(--rule); }
.node__list li::before { content: ""; width: 7px; height: 7px; margin-top: 0.6em; background: var(--accent); }
.node__list b { line-height: 1.35; }
.node__list span { grid-column: 2; color: var(--muted); font-size: var(--step--1); line-height: 1.45; }
/* connectors: a hairline across each gap, with one node on it */
.node:not(:last-child)::after, .node:not(:last-child)::before { content: ""; position: absolute; }
.node:not(:last-child)::after {
  top: 2.375rem; left: 100%; width: 4rem; height: 1px; background: var(--node);
}
.node:not(:last-child)::before {
  top: calc(2.375rem - 3px); left: calc(100% + 2rem - 3.5px); width: 7px; height: 7px;
  border-radius: 50%; background: var(--node); z-index: 1;
}
@media (max-width: 47.99rem) {
  .flow__steps { grid-template-columns: 1fr; gap: 2.5rem; }
  .node:not(:last-child)::after { top: 100%; left: 2rem; width: 1px; height: 2.5rem; }
  .node:not(:last-child)::before { top: calc(100% + 1.25rem - 3.5px); left: calc(2rem - 3px); }
}

.aside { margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem); font-size: var(--step-2); line-height: 1.3; }

/* Result */
.claim {
  max-width: 20ch; font-family: var(--font-display); font-size: var(--step-5); line-height: 1.06;
  letter-spacing: var(--display-tracking); text-wrap: balance;
}
.table-wrap { width: min(100%, var(--measure) + 8rem); margin-top: clamp(3rem, 2rem + 3vw, 4.5rem); overflow-x: auto; }
.results { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
.results caption {
  caption-side: top; text-align: left; padding-bottom: 1rem; font-size: var(--step--1); color: var(--subtle);
}
.results thead th {
  padding: 0.625rem 0; font-size: var(--step--1); font-weight: var(--weight-regular); color: var(--subtle);
  border-top: 1.5px solid var(--rule-strong); border-bottom: 1px solid var(--rule);
}
.results tbody th, .results td { padding: 1.125rem 1rem 1.125rem 0; vertical-align: baseline; border-bottom: 1px solid var(--rule); }
.results tbody tr:last-child > * { border-bottom: 1.5px solid var(--rule-strong); }
.results tbody th { font-weight: var(--weight-medium); width: 9rem; }
.results td:not(.num) { color: var(--muted); }
.results .num { text-align: right; padding-right: 0; white-space: nowrap; }
.results td.num { font-family: var(--font-display); font-size: var(--step-2); letter-spacing: -0.01em; }
.results .num--word { color: var(--fg); }
.candour { width: min(100%, var(--measure) + 8rem); margin-top: 1.5rem; text-align: left; }
@media (max-width: 34.99rem) {
  .results thead { display: none; }
  .results, .results tbody, .results tr { display: block; }
  .results tr { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
  .results tbody tr:first-child { border-top: 1.5px solid var(--rule-strong); }
  .results tbody tr:last-child { border-bottom: 1.5px solid var(--rule-strong); }
  .results tbody th, .results td { padding: 0; border: 0 !important; width: auto; }
  .results td:not(.num) { grid-column: 1 / -1; grid-row: 2; font-size: var(--step--1); }
  .results td.num { grid-column: 2; grid-row: 1; }
  .results caption { display: block; }
}

/* Notes */
.notes { width: min(100%, var(--measure)); margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem); text-align: left; border-top: 1px solid var(--rule); }
.notes li {
  display: grid; grid-template-columns: 3rem 1fr auto; align-items: baseline; gap: 1rem;
  padding-block: 1.125rem; border-bottom: 1px solid var(--rule);
}
.notes__n { font-size: var(--step--1); color: var(--subtle); }
.notes__t { font-size: var(--step-1); line-height: 1.3; }
.tag {
  font-size: 0.75rem; color: var(--subtle); padding: 0.125rem 0.5rem; border: 1px solid var(--rule); border-radius: var(--radius-pill);
}

/* Founders */
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; width: min(100%, var(--measure)); margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem); text-align: left; }
.people li { display: grid; gap: 0.375rem; padding-top: 1.25rem; border-top: 1px solid var(--rule-strong); }
.people__name { font-size: var(--step-2); line-height: 1.2; }
.people a, .foot a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.people a { justify-self: start; }
@media (max-width: 34.99rem) { .people { grid-template-columns: 1fr; gap: 2rem; } }

/* Contact */
.contact__title { font-size: var(--step-5); line-height: 1.06; letter-spacing: var(--display-tracking); }

/* ---------- Footer ---------- */
.foot { margin-top: var(--space-sec); padding: 0 var(--gutter) 2rem; }
.band {
  display: flex; justify-content: space-between; align-items: center;
  max-width: var(--max); margin: 0 auto; padding-block: 2.5rem; border-top: 1px solid var(--rule);
}
.band svg { width: clamp(1.5rem, 0.9rem + 2.6vw, 3.75rem); aspect-ratio: 1; fill: url(#g-brand); }
@media (max-width: 47.99rem) { .band svg:nth-child(odd) { display: none; } }
@media (prefers-color-scheme: dark) { .band svg { fill: var(--accent); } }  /* the gradient is too dark to read on ink */
.foot__grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem;
  max-width: var(--max); margin: 0 auto; padding-top: 2.5rem; border-top: 1px solid var(--rule);
  font-size: var(--step--1);
}
.foot__lockup { display: flex; align-items: center; gap: 0.5rem; }
.foot__id p { max-width: 22rem; margin-top: 1rem; color: var(--muted); }
.foot__h { color: var(--subtle); margin-bottom: 0.75rem; }
.foot__col ul { display: grid; gap: 0.5rem; }
.foot__col a { color: var(--fg); text-decoration: none; }
.foot__col a:hover { text-decoration: underline; }
.foot__base {
  display: flex; justify-content: space-between; max-width: var(--max); margin: 3.5rem auto 0;
  font-size: var(--step--1); color: var(--subtle);
}
@media (max-width: 47.99rem) {
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__id { grid-column: 1 / -1; }
}
