/* site.css: layout and components. Brand-neutral: every colour, face and size comes from brand.css. */

/* Roles, built from brand tokens. Stark: white and ink, the brand colour only where it means something. */
:root {
  --bg: var(--white);
  --fg: var(--ink);
  --fg-2: color-mix(in srgb, var(--n-600) 72%, var(--ink));
  --fg-3: var(--n-600);
  --fg-quiet: var(--n-500);   /* large type only: 4.4:1 on white */
  --rule: var(--n-200);
  --rule-strong: var(--ink);
  --pill-bg: var(--ink);
  --pill-fg: var(--white);
  --accent: var(--brand);
  --accent-text: var(--brand-text);
  --focus: var(--brand-500);
  --mark-filter: none;          /* wordmark file is white; shown dark on light */
  --wordmark-filter: brightness(0);

  --gutter: clamp(1.25rem, 0.6rem + 2.6vw, 3rem);   /* 20 to 48 */
  --max: 90rem;                                     /* 1440, as the source's container */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: clamp(3rem, 2rem + 3vw, 5rem);
  --space-6: clamp(5rem, 3rem + 7vw, 10rem);
  --nav-h: 4rem;
  --ease: cubic-bezier(0.17, 0.17, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--ink);
    --fg: var(--paper);
    --fg-2: var(--n-300);
    --fg-3: var(--n-400);
    --fg-quiet: var(--n-400);
    --rule: #2a2a29;
    --rule-strong: var(--paper);
    --pill-bg: var(--paper);
    --pill-fg: var(--ink);
    --accent: var(--brand-400);
    --accent-text: var(--brand-text-dark);
    --focus: var(--brand-400);
    --wordmark-filter: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--nav-h); }
@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-text);
  font-size: var(--step-0);
  line-height: 1.5;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
table { border-collapse: collapse; }

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

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

.skip {
  position: absolute; left: var(--gutter); top: 0.5rem; z-index: 100;
  padding: 0.6rem 1rem; background: var(--pill-bg); color: var(--pill-fg);
  border-radius: var(--radius-pill); text-decoration: none; font-size: var(--step--1);
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }

.wordmark { height: 1.25rem; width: auto; filter: var(--wordmark-filter); }

/* Nav: almost nothing. Sticks, gains a hairline once the page moves. */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--rule); }
.nav__inner { height: var(--nav-h); display: flex; align-items: center; gap: var(--space-4); }
.nav__brand { display: inline-flex; padding: 0.5rem 0; margin-right: auto; }
.nav__links { display: flex; gap: var(--space-3); }
.nav__links a {
  font-size: var(--step--1); text-decoration: none; color: var(--fg-2);
  padding: 0.5rem 0; transition: color 0.2s var(--ease);
}
.nav__links a:hover { color: var(--fg); }

/* Actions */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--pill-bg); color: var(--pill-fg);
  font-size: var(--step--1); font-weight: var(--weight-display);
  text-decoration: none; white-space: nowrap;
  transition: opacity 0.2s var(--ease);
}
.pill:hover { opacity: 0.82; }
.pill--small { min-height: 2.25rem; padding: 0 1rem; }
.textlink {
  display: inline-flex; align-items: center; gap: 0.45rem;
  min-height: 2.75rem; font-size: var(--step--1); text-decoration: none; color: var(--fg);
}
.textlink:hover { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
.arrow { width: 0.75rem; height: 0.75rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.actions--center { justify-content: center; }

.eyebrow {
  display: flex; gap: 0.5rem; font-size: var(--step--1); color: var(--fg-2);
}
.note { font-size: var(--step--1); color: var(--fg-3); }

/* 1. Hero: headline block, then the plate fills the rest of the first screen */
.hero {
  display: flex; flex-direction: column;
  min-height: calc(100svh - var(--nav-h));
}
.hero__head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-3); row-gap: var(--space-3);
  padding-top: clamp(2.5rem, 1rem + 5vw, 5.5rem);
  padding-bottom: clamp(2rem, 1rem + 3vw, 3.5rem);
  align-items: end;
}
.hero__eyebrow { grid-column: 1 / -1; }
.hero__title {
  grid-column: 1 / span 9;
  font-family: var(--font-display); font-weight: var(--weight-display);
  font-size: var(--step-6); line-height: 0.96; letter-spacing: var(--tracking-display);
  font-feature-settings: "pnum" 1;
  text-wrap: balance;
}
.hero__title .ln { display: inline-block; }
.hero__aside { grid-column: 10 / -1; display: grid; gap: var(--space-3); padding-bottom: 0.4em; }
.hero__lede { font-size: var(--step-0); line-height: 1.4; color: var(--fg-2); max-width: 26em; text-wrap: pretty; }

/* The plate: the brand gradient, light from the upper left, a deeper floor, grain. Built in code. */
.plate {
  position: relative; flex: 1 1 auto;
  min-height: 24rem;
  display: grid; place-items: center;
  overflow: hidden; isolation: isolate;
  color: var(--on-brand);
  background: var(--brand-grad-bottom);
}
.plate__ground {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 95% at 12% -10%, rgb(255 255 255 / 0.26), rgb(255 255 255 / 0) 55%),
    linear-gradient(180deg, rgb(0 0 0 / 0) 50%, rgb(0 0 0 / 0.3) 100%),
    var(--brand-grad);
}
/* The photographed plate (identity 5's frosted glass, graded per identity) layers over the code plate.
   If the file is missing the code plate shows through. Its own light and grain replace the code highlight and grain. */
.plate[data-photo] .plate__ground {
  background:
    linear-gradient(180deg, rgb(0 0 0 / 0) 55%, rgb(0 0 0 / 0.26) 100%),
    var(--plate-wide) center 40% / cover no-repeat,
    var(--brand-grad);
}
.plate[data-photo] .plate__ground::after { opacity: 0; }
.plate[data-photo] .plate__haze { opacity: 0.22; }
.plate__ground::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
}
.plate__haze {
  position: absolute; width: 130%; aspect-ratio: 1; right: -48%; top: -38%;
  opacity: 0.34;
  color: var(--on-brand);
}
.plate__haze canvas { width: 100%; height: 100%; filter: none; }
.plate__mark svg { width: 100%; height: 100%; fill: currentColor; overflow: visible; }
.plate__mark {
  position: absolute; left: 50%; top: 47%;
  height: min(78%, 44vw, 40rem);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  will-change: transform;
  display: grid; place-items: center;
}
.plate__fallback {
  width: 83%; height: auto;
  filter: brightness(0) invert(1);
}
.plate__mark.is-drawn .plate__fallback { display: none; }
.plate__mark svg { position: absolute; inset: 0; }
.plate__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding-top: var(--space-5);
  /* a floor under the caption so white text passes 4.5:1 wherever the light falls (checked on Rubine's bright end) */
  background: linear-gradient(180deg, rgb(0 0 0 / 0), rgb(0 0 0 / 0.16));
  display: flex; justify-content: space-between; gap: var(--space-3);
  padding-bottom: var(--space-3);
  font-size: var(--step--1); color: var(--on-brand);   /* full white: no tint passes on the gradient's bright end */
}

/* 2. The claim */
.claim { padding-block: var(--space-6) var(--space-5); }
.claim__text {
  max-width: 17em;
  font-family: var(--font-display); font-weight: var(--weight-display);
  font-size: var(--step-5); line-height: 1.02; letter-spacing: var(--tracking-display);
  text-wrap: balance;
}
.claim__rest { color: var(--fg-quiet); }
.claim__text .w { transition: color 0.5s var(--ease); }
.claim__text .w.is-on { color: var(--fg); }

/* Rail: a label column and a body column, as an index page reads */
.section { padding-block: var(--space-5); }
.rail {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-3);
  border-top: 1px solid var(--rule-strong); padding-top: var(--space-3);
}
.rail__label {
  grid-column: 1 / span 3;
  font-size: var(--step-0); font-weight: var(--weight-display); letter-spacing: -0.005em;
}
.rail__body { grid-column: 4 / -1; display: grid; gap: var(--space-5); }
.section__intro, .section__title {
  font-family: var(--font-display); font-weight: var(--weight-display);
  font-size: var(--step-3); line-height: 1.08; letter-spacing: var(--tracking-heading);
  max-width: 20em; text-wrap: balance;
}

/* 3. How it works */
.flow { display: grid; gap: var(--space-2); }
.flow__svg { width: 100%; height: auto; overflow: visible; }
.flow__line { fill: none; stroke: var(--fg); stroke-width: 1.5; }
.flow__node { fill: var(--bg); stroke: var(--fg); stroke-width: 1.5; }
.flow__node--key { fill: var(--fg); }
.flow__bound { fill: none; stroke: var(--accent); stroke-width: 2; }
.flow__err { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.flow__t { font-family: var(--font-display); font-weight: var(--weight-display); font-size: 26px; fill: var(--fg); dominant-baseline: central; }
.flow__t--s { font-size: 19px; }
.flow__t--xs { font-size: 17px; }
.flow__svg--v { display: none; max-width: 22rem; margin-inline: auto; }
.flow__t--key { fill: var(--bg); }
.flow__k { font-family: var(--font-text); font-size: 18px; fill: var(--accent-text); }
.flow__line, .flow__bound { vector-effect: non-scaling-stroke; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-3); row-gap: var(--space-4); }
.step { display: grid; gap: var(--space-1); align-content: start; border-top: 1px solid var(--rule); padding-top: var(--space-2); }
.step__n { font-size: var(--step--1); color: var(--fg-3); font-feature-settings: "tnum" 1; }
.step__t { font-size: var(--step-1); font-weight: var(--weight-display); letter-spacing: -0.01em; line-height: 1.25; }
.step p { color: var(--fg-2); max-width: 24em; text-wrap: pretty; }

/* 4. Results table */
.results { width: 100%; text-align: left; font-feature-settings: "tnum" 1; }
.results caption { caption-side: bottom; text-align: left; padding-top: var(--space-2); }
.results th, .results td { padding: 0; vertical-align: middle; }
.results thead th {
  font-size: var(--step--1); font-weight: var(--weight-text); color: var(--fg-3);
  padding-bottom: var(--space-2); border-bottom: 1px solid var(--rule-strong);
}
.results tbody tr { border-bottom: 1px solid var(--rule); }
.results tbody th, .results tbody td { padding-block: clamp(0.9rem, 0.6rem + 1vw, 1.5rem); }
.results tbody th { font-weight: var(--weight-text); color: var(--fg-2); width: 30%; }
.results__v {
  font-family: var(--font-display); font-weight: var(--weight-display);
  font-size: var(--step-4); line-height: 1; letter-spacing: var(--tracking-heading);
  width: 38%; white-space: nowrap;
}
.results td:last-child { color: var(--fg-2); }

/* Figure 1: the bit block, drawn at build time */
.bf { display: grid; gap: var(--space-2); }
.bf__plot { overflow: hidden; }
.bf__svg { display: block; width: 100%; height: auto; overflow: visible; }
.bf__svg--wide { max-width: 51.75rem; } /* the view box at 1:1 */
.bf__strips { display: none; }
.bf__svg .b1 { fill: var(--fg-quiet); }
.bf__svg .b0 { fill: none; stroke: var(--rule); stroke-width: 1; }
.bf__svg .d1 { fill: var(--accent); }
.bf__svg .d0 { fill: none; stroke: var(--accent); stroke-width: 2; }
.bf__svg rect { shape-rendering: crispEdges; }
.bf__title { font-family: var(--font-display); font-weight: var(--weight-display); font-size: 15px; fill: var(--fg); }
.bf__lab, .bf__tick { font-family: var(--font-text); font-size: 12px; fill: var(--fg-3); font-feature-settings: "tnum" 1; }
.bf__cap { font-size: var(--step--1); color: var(--fg-3); max-width: 44em; text-wrap: pretty; }
.bf__no { color: var(--fg); font-weight: var(--weight-display); margin-right: 0.35em; }

/* 5. Candour */
.candour { padding-block: var(--space-6); text-align: center; display: grid; gap: var(--space-3); justify-items: center; }
.candour__big {
  font-family: var(--font-display); font-weight: var(--weight-display);
  font-size: max(var(--step-6), 5.5rem); line-height: 0.9; letter-spacing: var(--tracking-display);
  font-feature-settings: "pnum" 1;
}
.candour__line { font-size: var(--step-1); color: var(--fg-2); }

/* 6. Notes */
.notes { display: grid; }
.notes__row {
  display: grid; grid-template-columns: clamp(4.5rem, 3rem + 5vw, 8rem) 1fr; gap: var(--space-3);
  align-items: center; padding-block: var(--space-2); border-bottom: 1px solid var(--rule);
}
.notes__row:first-child { padding-top: 0; }
.notes__art {
  aspect-ratio: 1; position: relative; overflow: hidden;
  background:
    radial-gradient(120% 95% at 12% -10%, rgb(255 255 255 / 0.24), rgb(255 255 255 / 0) 55%),
    var(--brand-grad);
  color: var(--on-brand);
  border-radius: var(--radius);
}
.notes__art svg { position: absolute; inset: 18%; width: 64%; height: 64%; fill: currentColor; overflow: visible; }
.notes__text { display: grid; gap: 0.35rem; }
.notes__title { font-size: var(--step-2); font-weight: var(--weight-display); letter-spacing: var(--tracking-heading); line-height: 1.15; }
.notes__meta { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: var(--step--1); color: var(--fg-3); }
.tag { color: var(--fg-2); border: 1px solid var(--rule); border-radius: var(--radius-pill); padding: 0 0.55rem; line-height: 1.5; }

/* 7. Team */
.team { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-3); }
.person { display: grid; gap: 0.2rem; border-top: 1px solid var(--rule); padding-top: var(--space-2); }
.person__name { font-size: var(--step-2); font-weight: var(--weight-display); letter-spacing: var(--tracking-heading); }
.person__role { color: var(--fg-3); font-size: var(--step--1); }
.person__mail { margin-top: var(--space-2); font-size: var(--step-0); text-decoration: none; justify-self: start; padding-block: 0.25rem; }
.person__mail:hover { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }

/* 8. CTA */
.cta { padding-block: var(--space-6); text-align: center; display: grid; gap: var(--space-3); justify-items: center; }
.cta__title {
  font-family: var(--font-display); font-weight: var(--weight-display);
  font-size: var(--step-5); line-height: 1; letter-spacing: var(--tracking-display);
  max-width: 13em; text-wrap: balance;
}
.cta__line { color: var(--fg-2); font-size: var(--step-1); max-width: 28em; text-wrap: balance; }
.cta .actions { margin-top: var(--space-2); }

/* Footer */
.foot { border-top: 1px solid var(--rule); }
.foot__inner {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-3); row-gap: var(--space-4);
  padding-block: var(--space-5) var(--space-4);
  font-size: var(--step--1);
}
.foot__brand { grid-column: 1 / span 6; display: grid; gap: var(--space-2); align-content: start; color: var(--fg-2); }
.foot__col { grid-column: span 3; display: grid; gap: 0.5rem; align-content: start; }
.foot__col a { text-decoration: none; color: var(--fg-2); justify-self: start; }
.foot__col a:hover { color: var(--fg); }
.foot__h { color: var(--fg); font-weight: var(--weight-display); }
.foot__legal { grid-column: 1 / -1; color: var(--fg-3); }

/* Tablet */
@media (max-width: 64rem) {
  .hero__title { grid-column: 1 / -1; }
  .hero__aside { grid-column: 1 / span 9; }
  .rail__label { grid-column: 1 / -1; margin-bottom: var(--space-4); }
  .rail__body { grid-column: 1 / -1; }
}
/* Phone: recomposed, not stacked */
@media (max-width: 40rem) {
  :root { --nav-h: 3.5rem; }
  .nav__links { display: none; }
  .wordmark { height: 1.1rem; }
  .hero { min-height: 0; }
  .hero__aside { grid-column: 1 / -1; }
  /* On a phone the caption leaves the gradient and sits under it on the page, as a figure caption */
  .plate { min-height: 0; aspect-ratio: 4 / 5; flex: none; background: var(--bg); --cap-h: 4.5rem; }
  .plate__ground { bottom: var(--cap-h); }
  .plate[data-photo] .plate__ground {
    background:
      linear-gradient(180deg, rgb(0 0 0 / 0) 60%, rgb(0 0 0 / 0.2) 100%),
      var(--plate-tall) center / cover no-repeat,
      var(--brand-grad);
  }
  .plate__mark { height: auto; width: 76%; top: calc((100% - var(--cap-h)) / 2); }
  .plate__haze { width: 200%; right: -110%; top: -30%; }
  .plate__caption {
    flex-direction: column; gap: 0.15rem; height: var(--cap-h); justify-content: center;
    padding: 0 var(--gutter); background: none; color: var(--fg-3);
  }
  .steps { grid-template-columns: 1fr; }
  .flow__svg--h { display: none; }
  .flow__svg--v { display: block; }
  .flow__k { font-size: 17px; }
  .results thead { display: none; }
  .results { display: flex; flex-direction: column; }
  .results tbody { display: block; order: 1; }
  .results caption { order: 2; }
  .results tbody tr {
    display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: var(--space-2);
    padding-block: var(--space-2);
  }
  .results tbody tr:first-child { border-top: 1px solid var(--rule-strong); }
  .results tbody th, .results tbody td { padding: 0; width: auto; }
  .results__v { grid-column: 2; grid-row: 1 / span 2; text-align: right; align-self: center; }
  .results td:last-child { grid-column: 1; grid-row: 2; font-size: var(--step--1); color: var(--fg-3); }
  .results tbody th { color: var(--fg); }
  .results tbody td, .results tbody th { vertical-align: baseline; }
  .bf__svg--wide { display: none; }
  .bf__strips { display: grid; gap: var(--space-3); }
  .bf__svg--narrow { max-width: 22rem; }
  .js .nav__cta { opacity: 0; visibility: hidden; transition: opacity 0.3s var(--ease), visibility 0.3s; }
  .js .nav.is-past .nav__cta { opacity: 1; visibility: visible; }
  .team { grid-template-columns: 1fr; row-gap: var(--space-4); }
  .foot__brand { grid-column: 1 / -1; }
  .foot__col { grid-column: span 6; }
}

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