/* ============================================================================
   Stitch Brand System - guide stylesheet
   Tokens and chrome follow the Pulse reskin and the performance-marketing
   generator. Light is the ground; dark is opt-in via [data-theme="dark"].
   ============================================================================ */

/* ---- type ---------------------------------------------------------------- */

@font-face {
  font-family: 'Suisse Intl';
  src: url('./fonts/SuisseIntl-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Suisse Intl';
  src: url('./fonts/SuisseIntl-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* No Medium cut is licensed - 500 is aliased to Regular. */
@font-face {
  font-family: 'Suisse Intl';
  src: url('./fonts/SuisseIntl-Regular.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Suisse Intl';
  src: url('./fonts/SuisseIntl-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Suisse Intl';
  src: url('./fonts/SuisseIntl-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ---- tokens - light ------------------------------------------------------ */

:root,
html[data-theme='light'] {
  /* neutrals - nine steps, white to ink. The names hold; the values move. */
  --white: #ffffff;
  --paper: #fcfbfb;
  --platinum: #f5f4f4;
  --silver: #dddcdd;
  --titanium: #b5b3b6;
  --steel: #56545a;
  --graphite: #2e2b33;
  --carbon: #16131c;
  --ink: #0f0c15;

  /* accents */
  --brand: #6e2cff;
  --amber: #ff5b00;
  --signal: #daff35;
  --electric: #59fcf9;
  /* Accent ramps. Fixed in both themes, like the accents they extend. */
  --indigo: #221244;
  --lavender: #c4c0ff;
  --mist: #e3deff;

  --bronze: #3f1711;
  --peach: #fddcc9;

  --slate: #0e242c;
  --spring: #f8ffda;
  --ice: #d1fffe;

  /* Type on an accent. Each one is the dark end of its own ramp. */
  --brand-ink: var(--indigo);
  --amber-ink: var(--bronze);
  --signal-ink: var(--slate);
  --danger: var(--amber);

  /* derived ink */
  --ink2: color-mix(in srgb, var(--ink) 62%, transparent);
  --ink3: var(--steel);
  --muted: color-mix(in srgb, var(--ink) 45%, transparent);

  /* surfaces */
  --bg: var(--paper);
  --raised: var(--white);
  --surface-glass: color-mix(in srgb, var(--white) 62%, transparent);
  --chrome-glass: color-mix(in srgb, var(--white) 78%, transparent);
  --surface3: color-mix(in srgb, var(--platinum) 80%, transparent);
  --lift: color-mix(in srgb, var(--ink) 3%, transparent);
  --lift2: color-mix(in srgb, var(--ink) 6%, transparent);
  --grid: color-mix(in srgb, var(--ink) 8%, transparent);
  --shadow: 0 18px 40px rgba(15, 12, 21, 0.06);

  /* the inset hairline */
  --inset-edge: color-mix(in srgb, var(--ink) 20%, transparent);
  --inset-edge-strong: color-mix(in srgb, var(--ink) 30%, transparent);
  --inset:
    inset -0.75px -0.75px 0.5px 0 var(--inset-edge),
    inset 0.75px 0.75px 0.5px 0 var(--inset-edge);
  --inset-strong:
    inset -0.75px -0.75px 0.5px 0 var(--inset-edge-strong),
    inset 0.75px 0.75px 0.5px 0 var(--inset-edge-strong);

  /* accents */
  --accent: var(--ink);
  --accent2: var(--steel);
  --accent-s: color-mix(in srgb, var(--ink) 8%, transparent);
  --accent-m: color-mix(in srgb, var(--ink) 16%, transparent);
  --accent-l: color-mix(in srgb, var(--ink) 28%, transparent);
  --warn: var(--amber);
  --warn-s: color-mix(in srgb, var(--amber) 11%, transparent);
  --ink-reversed: #f5f4f4;

  /* sequential (ink / grey) */
  --s0: #0f0c15;
  --s1: #16131c;
  --s2: #2e2b33;
  --s3: #56545a;
  --s4: #8e8d93;
  --s5: #b5b3b6;
  --s6: #dddcdd;

  /* categorical (violet) - the brand ramp, interpolated to seven steps */
  --c0: #221244;
  --c1: #33156f;
  --c2: #6e2cff;
  --c3: #896fff;
  --c4: #aca3ff;
  --c5: #c4c0ff;
  --c6: #e3deff;

  --bar-fade: var(--ink);

  /* shape + type */
  --sans: 'Suisse Intl', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Suisse Intl', -apple-system, BlinkMacSystemFont, sans-serif;
  --r: 1.5rem;
  --r-m: 16px;
  --r-s: 12px;
  --sidebar-w: 268px;
}

/* ---- tokens - dark ------------------------------------------------------- */

html[data-theme='dark'] {
  color-scheme: dark;

  --white: #16131c;
  --paper: #0f0c15;
  --platinum: #2e2b33;
  --silver: #56545a;
  --titanium: #56545a;
  --steel: #2e2b33;
  --graphite: #2e2b33;
  --carbon: #16131c;
  --ink: #f5f4f4;

  --ink2: color-mix(in srgb, #f5f4f4 62%, transparent);
  --ink3: #b5b3b6;
  --muted: color-mix(in srgb, #f5f4f4 45%, transparent);

  --bg: var(--paper);
  --raised: var(--white);
  --surface-glass: color-mix(in srgb, var(--white) 68%, transparent);
  --chrome-glass: color-mix(in srgb, var(--white) 84%, transparent);
  --surface3: color-mix(in srgb, #2e2b33 80%, transparent);
  --lift: color-mix(in srgb, #f5f4f4 3.5%, transparent);
  --lift2: color-mix(in srgb, #f5f4f4 7%, transparent);
  --grid: color-mix(in srgb, #f5f4f4 9%, transparent);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.4);

  --accent2: #b5b3b6;
  --accent-s: color-mix(in srgb, #f5f4f4 10%, transparent);
  --accent-m: color-mix(in srgb, #f5f4f4 18%, transparent);
  --accent-l: color-mix(in srgb, #f5f4f4 32%, transparent);
  --warn-s: color-mix(in srgb, var(--amber) 16%, transparent);
  --ink-reversed: #0f0c15;

  /* Inverted, like the categorical ramp. --s3 is the pivot and does not move. */
  --s0: #dddcdd;
  --s1: #b5b3b6;
  --s2: #8e8d93;
  --s3: #56545a;
  --s4: #2e2b33;
  --s5: #16131c;
  --s6: #0f0c15;

  /* Inverted, so --c0 is the step that carries against the stage in either
     theme and --c6 is always the quietest. --c3 is the pivot and does not move. */
  --c0: #e3deff;
  --c1: #c4c0ff;
  --c2: #aca3ff;
  --c3: #896fff;
  --c4: #6e2cff;
  --c5: #33156f;
  --c6: #221244;

  --bar-fade: var(--titanium);
}

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

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Emphasis is Semibold. There is no 700 cut, so an unset `bold` resolves
   upward to Black - every strong in the system has to say 600 explicitly. */
strong,
b {
  font-weight: 600;
}

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

body {
  margin: 0;
  min-width: 320px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: -0.011em;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--signal) 55%, transparent);
  color: var(--signal-ink);
}

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

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

a {
  color: var(--ink);
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-l);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
}

code,
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

code {
  white-space: nowrap;
}

/* ---- type scale ---------------------------------------------------------- */

.t-hero {
  font-size: 4rem;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
}

.t-page {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.t-section {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.t-card {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.t-kpi {
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: lining-nums;
}

.t-label,
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--ink2);
  text-transform: uppercase;
}

.t-body {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: -0.011em;
}

.t-small {
  font-size: 0.8125rem;
  letter-spacing: -0.008em;
  color: var(--ink2);
}

.lede {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink2);
  max-width: 62ch;
}

/* ---- shell --------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.75rem 1rem 1.25rem;
  background: var(--raised);
  box-shadow: inset -0.75px 0 0.5px 0 var(--inset-edge);
  z-index: 20;
}

.sidebar__mark {
  display: block;
  color: var(--ink);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.6rem;
  color: var(--ink);
  text-decoration: none;
}

.sidebar__brand svg {
  width: 128px;
  height: auto;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  margin-top: 0.25rem;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.nav-group {
  padding: 0.9rem 0.75rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  color: var(--ink2);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.nav-item:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
}

/* Selection is platinum, like a selected card. Platinum sits only 2% off the white
   sidebar, so the pill needs the hairline to hold its shape. */
.nav-item.is-active {
  background: var(--platinum);
  box-shadow: var(--inset);
  color: var(--ink);
  font-weight: 600;
}

.nav-item__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
  flex: none;
}

/* Signal was legible on an ink pill; on platinum it disappears. Ink carries it. */
.nav-item.is-active .nav-item__dot {
  background: var(--ink);
  opacity: 1;
}

.sidebar__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 0;
}

/* ---- theme toggle -------------------------------------------------------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0;
}

.theme-toggle__track {
  position: relative;
  display: block;
  width: 48px;
  height: 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--platinum) 50%, transparent);
  overflow: hidden;
  transition: background 180ms ease, box-shadow 180ms ease;
  box-shadow:
    inset -0.75px -0.75px 0.5px 0 color-mix(in srgb, var(--ink) 10%, transparent),
    inset 0.75px 0.75px 0.5px 0 color-mix(in srgb, var(--ink) 10%, transparent);
}

.theme-toggle:hover .theme-toggle__track {
  box-shadow: var(--inset);
}

.theme-toggle[aria-checked='true'] .theme-toggle__track {
  background: var(--brand);
  box-shadow: var(--inset);
}

.theme-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 18px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(15, 12, 21, 0.12);
  transition: left 180ms ease, background 180ms ease;
  z-index: 1;
}

.theme-toggle[aria-checked='true'] .theme-toggle__thumb {
  left: 20px;
  background: #f5f4f4;
}

.theme-toggle__icon {
  position: absolute;
  top: 50%;
  z-index: 0;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  color: #0f0c15;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 180ms ease;
}

.theme-toggle__icon--sun {
  left: 5px;
  opacity: 0;
}

.theme-toggle__icon--moon {
  right: 5px;
  opacity: 0.3;
}

.theme-toggle[aria-checked='true'] .theme-toggle__icon--sun {
  opacity: 0.5;
}

.theme-toggle[aria-checked='true'] .theme-toggle__icon--moon {
  opacity: 0;
}

/* ---- stage --------------------------------------------------------------- */

.stage {
  min-width: 0;
  padding: 0 clamp(1.25rem, 3.5vw, 3.5rem) 6rem;
}

.section {
  scroll-margin-top: 1.5rem;
  margin-top: 7rem;
  padding: 3.5rem 0 0;
  max-width: 1180px;
}

/* Title and headline read as one block: same size and weight, split by colour. */
.section__head {
  display: grid;
  gap: 0;
  margin-bottom: 1.75rem;
}

.section__head .lede {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--muted);
  max-width: 46ch;
}

.subhead {
  margin: 3.5rem 0 1.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: baseline;
  gap: 1.5rem;
}

/* The eyebrow variant stacks - the note is a caption under its label, not
   a second column beside it. */
.subhead--tight {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem;
  margin: 1.35rem 0 0.7rem;
}

.subhead--tight p {
  max-width: 62ch;
}

.subhead h4 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink3);
}

.subhead h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.subhead p {
  color: var(--ink2);
  font-size: 0.8125rem;
}

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

.hero {
  padding: 3.5rem 0 1rem;
  display: grid;
  gap: 1.25rem;
  max-width: 1180px;
}

/* Title left, secondary action right, both hanging off the top edge. */
.hero__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ---- cards --------------------------------------------------------------- */

/* Tier 1 - content cards. Solid white on the paper stage. No shadow. */
.card {
  background: var(--raised);
  border-radius: var(--r);
  padding: 1.5rem;
  color: var(--ink);
}

/* Tier 2 - chrome. Glass fill plus the inset hairline. */
.card--glass {
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--inset);
}

.card--glass-strong {
  background: var(--chrome-glass);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: var(--inset-strong);
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card--pad-s {
  padding: 1rem;
}

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card__title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card__note {
  color: var(--ink2);
  font-size: 0.8125rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

/* ---- pills, chips, buttons ----------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4em 0.75em 0.35em;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  background: color-mix(in srgb, var(--paper) 20%, transparent);
  box-shadow: var(--inset);
  color: var(--ink2);
}

.pill--ink {
  background: var(--ink);
  color: var(--ink-reversed);
  box-shadow: none;
}

.pill--ok {
  background: color-mix(in srgb, var(--signal) 55%, transparent);
  color: var(--signal-ink);
  box-shadow: none;
}

.pill--warn {
  background: var(--warn-s);
  color: var(--amber);
  box-shadow: none;
}

.pill--flat {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink2);
  box-shadow: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: var(--ink);
  color: var(--ink-reversed);
  text-decoration: none;
  transition: opacity 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  opacity: 0.86;
}

/* Calls to action only. Never an interface action, and never --brand. */
/* Amber and neon hold the same value in both themes, so their labels are frozen
   at the light-mode values of --ink-reversed and --ink instead of swapping. */
.btn--b2b {
  background: var(--amber);
  color: #f5f4f4;
}

.btn--b2c {
  background: var(--signal);
  color: #0f0c15;
}

/* Secondary is hollow. The inset hairline is the whole button. */
.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: var(--inset);
}

.btn--ghost:hover {
  opacity: 1;
  box-shadow: var(--inset-strong);
}

.btn__glyph {
  font-size: 0.9em;
  line-height: 1;
  opacity: 0.7;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---- chips --------------------------------------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 1.3rem;
}

/* The label a chip row answers to. Kantha calls this content-points__head. */
.chips__head {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Directly under a label, the chips belong to it - close the gap. */
.chips--tight {
  margin-top: 0.25rem;
}

/* Padding is em-based so it holds its proportions when the type steps down. */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4em 0.75em 0.35em;
  border: none;
  border-radius: 999px;
  background: none;
  box-shadow: var(--inset);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* In a card the chips are a footer: pinned to the bottom, one step quieter.
   The card has to be a column before the auto margin can push them down. */
.card--chips {
  display: flex;
  flex-direction: column;
}

.card--chips .chips {
  margin-top: auto;
  padding-top: 0.75em;
}

.card--chips .chip {
  font-size: 0.6875rem;
}

/* ---- rules and callouts -------------------------------------------------- */

.rules {
  display: grid;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.rules li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.8125rem;
  color: var(--ink2);
  line-height: 1.5;
}

.rules li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.28rem;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

.rules--do li::before {
  content: '\2713';
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 900;
  background: color-mix(in srgb, var(--signal) 55%, transparent);
  color: var(--signal-ink);
}

.rules--dont li::before {
  content: '\2715';
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 900;
  background: var(--warn-s);
  color: var(--amber);
}

.callout {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--r-s);
  background: color-mix(in srgb, var(--paper) 20%, transparent);
  box-shadow: var(--inset);
  font-size: 0.8125rem;
  color: var(--ink2);
}

.callout strong {
  color: var(--ink);
  font-weight: 600;
}

.callout--warn {
  background: var(--warn-s);
  box-shadow: none;
}

.callout--warn strong {
  color: var(--amber);
}

/* ---- tables -------------------------------------------------------------- */

/* The one place figures have to line up vertically. */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.tbl th {
  text-align: left;
  padding: 0.65rem 0.9rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink3);
  box-shadow: inset 0 -0.75px 0.5px 0 var(--inset-edge);
}

.tbl td {
  padding: 0.65rem 0.9rem;
  color: var(--ink2);
  vertical-align: middle;
}

.tbl td:first-child {
  color: var(--ink);
  font-weight: 500;
}

.tbl tbody tr:nth-child(even) {
  background: var(--surface3);
}

.tbl tbody tr:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.tbl .mono {
  font-size: 0.75rem;
  color: var(--ink2);
}

/* A falling figure in a column. The minus sign carries the meaning; amber is the
   second signal, which is why it never appears without one. */
.tbl .neg {
  color: var(--amber);
}

/* ---- asset card ---------------------------------------------------------- */
/* The plate is full-bleed and carries the card's own radius, so the card shows
   through at its two lower corners. The inset hairline is drawn by ::after so it
   sits above the plate rather than behind it. */

.asset {
  position: relative;
  border-radius: var(--r);
  background: var(--raised);
  color: var(--ink);
  text-align: left;
}

.asset::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--inset);
  pointer-events: none;
}

.asset__plate {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 220px;
  padding: 1.75rem;
  border-radius: var(--r);
  overflow: hidden;
}

.asset__plate svg,
.asset__plate img {
  width: min(230px, 84%);
  height: auto;
}

.asset__plate--paper {
  background: #fcfbfb;
  color: #0f0c15;
}

.asset__plate--ink {
  background: #0f0c15;
  color: #fcfbfb;
  /* Ink sits on carbon in dark mode, so the plate needs its own edge. */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fcfbfb 16%, transparent);
}

.asset__plate--brand {
  background: var(--brand);
  color: #fcfbfb;
}

/* Split ground: one titanium file has to hold on both sides of the seam. */
.asset__plate--muted {
  background: linear-gradient(90deg, #fcfbfb 0 50%, #0f0c15 50% 100%);
  color: #b5b3b6;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fcfbfb 16%, transparent);
}

/* Follows the theme, for specimens that are not about a fixed background. */
.asset__plate--surface {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  color: var(--ink);
}

.asset__label {
  display: grid;
  gap: 0;
  padding: 1.1rem 1.25rem 1.25rem;
  line-height: 1.3;
}

.asset__title {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.asset__sub {
  font-size: 0.875rem;
  letter-spacing: -0.015em;
  color: var(--muted);
}

.asset__token {
  margin-top: 0.3rem;
  font-size: 0.6875rem;
  color: var(--ink3);
}

/* ---- clear space diagram ------------------------------------------------- */

.clearspace {
  --x: 26px;
  display: grid;
  place-items: center;
  padding: 2.75rem 2rem;
  border-radius: var(--r-s);
  background: var(--raised);
  box-shadow: var(--inset);
}

.clearspace__frame {
  position: relative;
  width: min(620px, 100%);
  padding: var(--x);
  outline: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent);
}

.clearspace__mark {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
}

.clearspace__x {
  position: absolute;
  font-size: 0.6875rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1;
  color: var(--ink3);
}

.clearspace__x--tl {
  top: calc(var(--x) / 2);
  left: calc(var(--x) / 2);
  transform: translate(-50%, -50%);
}

.clearspace__x--br {
  bottom: calc(var(--x) / 2);
  right: calc(var(--x) / 2);
  transform: translate(50%, 50%);
}

/* ---- minimum sizes ------------------------------------------------------- */

.sizes {
  display: grid;
  gap: 1.15rem;
}

.size-spec {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.15rem;
  box-shadow: inset 0 -0.75px 0.5px 0 var(--inset-edge);
}

.size-spec:last-child {
  padding-bottom: 0;
  box-shadow: none;
}

.size-spec svg {
  flex: 0 0 auto;
  color: var(--ink);
}

.size-spec__meta {
  display: grid;
  gap: 0.2rem;
}

/* ---- placement diagrams -------------------------------------------------- */

.placement {
  display: grid;
  gap: 0.9rem;
}

.placement__frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-s);
  background: var(--raised);
  box-shadow: var(--inset);
  overflow: hidden;
}

.placement__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* The 8% safe margin the mark sits on. */
.placement__safe {
  position: absolute;
  inset: 8%;
  outline: 1px dashed color-mix(in srgb, var(--ink) 22%, transparent);
}

.placement__mark {
  position: absolute;
  width: 36%;
  height: auto;
  color: var(--ink);
}

.placement__mark--tl {
  top: 8%;
  left: 8%;
}

.placement__mark--bl {
  bottom: 8%;
  left: 8%;
}

/* Optical centre sits 4% above true centre. */
.placement__mark--c {
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.placement__note {
  position: absolute;
  right: 0.55rem;
  bottom: 0.45rem;
  font-size: 0.625rem;
  color: var(--ink3);
}

/* ---- colour section ------------------------------------------------------ */

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.75rem;
}

/* The nine neutral steps hold one row so they read as a ramp, not a wrap. */
.swatches--ramp {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

.swatch {
  /* Button reset. The default padding was insetting the colour plate. */
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;

  width: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  aspect-ratio: 1 / 1;
  border-radius: var(--r-s);
  overflow: hidden;
  cursor: pointer;
  transition: transform 160ms ease;
}

.swatch:hover {
  transform: translateY(-2px);
}

.swatch:hover::after {
  box-shadow: var(--inset-strong);
}

.swatch .asset__plate {
  position: relative;
  padding: 0;
  max-height: none;
  border-radius: var(--r-s);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
}

.swatch .asset__label {
  padding: 0.35rem 0.55rem 0.4rem;
  align-content: start;
  line-height: 1.2;
}

.swatch .asset__title,
.swatch .asset__sub {
  font-size: 0.6875rem;
  letter-spacing: -0.005em;
}

.swatch__hex {
  text-transform: uppercase;
}

.swatch__copied {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--signal) 90%, transparent);
  color: var(--signal-ink);
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 140ms ease;
  pointer-events: none;
}

.swatch.is-copied .swatch__copied {
  opacity: 1;
}

/* Accent rank row. Width is the hierarchy: four columns of eight for primary,
   two for secondary, one for each tertiary. */
.accents {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.accents__group {
  grid-column: span var(--span);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.5rem;
}

.accents__rank {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink3);
}

.accents .swatches {
  grid-template-columns: minmax(0, 1fr);
}

.accents__group--pair .swatches {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Only the narrowest rank keeps the square. It sets the height of the row and
   the wider ranks stretch to meet it, so the bottom edge stays flush. */
.accents .swatch {
  aspect-ratio: auto;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
}

.accents__group--pair .swatch {
  aspect-ratio: 1 / 1;
  height: auto;
}

.accents .swatch .asset__plate {
  aspect-ratio: auto;
  min-height: 0;
}

/* Ramp strips for sequential / categorical scales */
.ramp {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: 52px;
  border-radius: var(--r-s);
  overflow: hidden;
  box-shadow: var(--inset);
}

.ramp__step {
  display: grid;
  place-items: end center;
  padding-bottom: 0.4rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ---- typography section -------------------------------------------------- */

.specimen {
  display: grid;
  gap: 0;
}

.specimen__row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: baseline;
  padding: 1rem 0;
  box-shadow: inset 0 -0.75px 0.5px 0 var(--inset-edge);
}

.specimen__row:last-child {
  box-shadow: none;
}

.specimen__key {
  display: grid;
  gap: 0.1rem;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink3);
}

.specimen__sample {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aa__glyph {
  font-size: 4.5rem;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.aa__sets {
  display: grid;
}

.aa__set {
  font-size: 2rem;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0;
  word-break: break-all;
}

/* ---- download list ------------------------------------------------------- */

.dl {
  display: grid;
  gap: 0;
}

.dl__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
  box-shadow: inset 0 -0.75px 0.5px 0 var(--inset-edge);
}

.dl__row:last-child {
  box-shadow: none;
}

.dl__name {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.dl__name strong {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.dl__name span {
  font-size: 0.75rem;
  color: var(--ink3);
}

.dl__files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.dl__file {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink2);
  background: color-mix(in srgb, var(--paper) 20%, transparent);
  box-shadow: var(--inset);
  transition: box-shadow 160ms ease, color 160ms ease;
}

.dl__file:hover {
  box-shadow: var(--inset-strong);
  color: var(--ink);
}

/* ---- inset-shadow anatomy ------------------------------------------------ */

.anatomy {
  display: grid;
  gap: 1rem;
}

.anatomy__demo {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 2rem;
  border-radius: var(--r-s);
  background: var(--bg);
}

.demo-card {
  width: min(280px, 100%);
  padding: 1.25rem;
  border-radius: var(--r-m);
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--inset);
  display: grid;
  gap: 0.5rem;
}

.demo-card > .pill,
.demo-card > .kpi__val {
  justify-self: start;
}

.demo-card--zoom {
  box-shadow:
    inset -3px -3px 2px 0 var(--inset-edge),
    inset 3px 3px 2px 0 var(--inset-edge);
}

.demo-card--none {
  box-shadow: none;
  background: var(--raised);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.demo-card--border {
  box-shadow: none;
  border: 1px solid var(--silver);
  background: var(--raised);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.demo-card--drop {
  box-shadow: 0 8px 24px rgba(15, 12, 21, 0.18);
  background: var(--raised);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.code {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: var(--r-s);
  background: var(--platinum);
  box-shadow: var(--inset);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--ink2);
  overflow-x: auto;
  white-space: pre;
  letter-spacing: 0;
}

/* Platinum is a light-mode surface. In dark it sits too close to the card, so the
   block falls back to a transparent lift off whatever it is sitting on. */
html[data-theme='dark'] .code {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.code .tok {
  color: var(--ink);
  font-weight: 600;
}

.code .cm {
  color: var(--muted);
}

.copy-code {
  position: relative;
}

.copy-code__btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
}

/* ---- charts -------------------------------------------------------------- */

.chart {
  display: grid;
  gap: 0.9rem;
}

.chart__svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart text {
  font-family: var(--sans);
  fill: var(--ink3);
  font-size: 10.5px;
  letter-spacing: 0;
}

.chart .grid-line {
  stroke: var(--grid);
  stroke-width: 1;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--ink2);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend__sw {
  width: 16px;
  height: 8px;
  border-radius: 999px;
  flex: none;
}

/* Horizontal stat bars */
.bars {
  display: grid;
  gap: 0.85rem;
}

.bar {
  display: grid;
  gap: 0.35rem;
}

.bar__top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.bar__label {
  color: var(--ink2);
}

/* Bar values stack in a right-aligned column, so they align like a table. */
.bar__val {
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.bar__track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  overflow: hidden;
}

.bar__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--silver);
}

/* The fade: violet and amber fills run solid at the tip to 15% at the origin. */
.bar__fill--violet {
  background: linear-gradient(
    270deg,
    var(--brand) 0%,
    color-mix(in srgb, var(--brand) 15%, transparent) 100%
  );
}

.bar__fill--amber {
  background: linear-gradient(
    270deg,
    var(--amber) 0%,
    color-mix(in srgb, var(--amber) 15%, transparent) 100%
  );
}

.bar__fill--steel {
  background: var(--s3);
}

.bar__ref {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 1.5px;
  background: var(--ink2);
}

/* Heatmap */
.heat {
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.heat__cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--hcolor);
  opacity: calc(0.1 + var(--i) * 0.9);
  transition: outline-color 120ms ease;
  outline: 1.5px solid transparent;
}

.heat__cell:hover {
  outline-color: var(--ink);
}

.heat-scale {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  color: var(--ink3);
}

.heat-scale__bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--electric), var(--signal), var(--amber));
}

/* Cohort cells */
.cohort {
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.cohort__cell {
  aspect-ratio: 1.6;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 600;
}

/* KPI block */
.kpi {
  display: grid;
  gap: 0.3rem;
}

.kpi__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink2);
}

.kpi__val {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums;
  color: var(--ink);
}

.kpi__delta {
  justify-self: start;
}

/* ---- back to top --------------------------------------------------------- */

.totop {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-reversed);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.totop.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

/* ---- mobile -------------------------------------------------------------- */

.sidebar__toggle {
  display: none;
}

/* Four ranks abreast need the full stage; below it, rank stacks. */
@media (max-width: 860px) {
  .accents {
    grid-template-columns: minmax(0, 1fr);
  }

  .accents__group {
    grid-column: 1 / -1;
  }

  .accents__group--pair .swatch {
    aspect-ratio: auto;
    height: 100%;
  }

  .accents .swatch {
    min-height: 128px;
  }
}

/* Nine across stops being legible before the sidebar collapses. */
@media (max-width: 1080px) {
  .swatches--ramp {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .subhead {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: none;
  }

  /* Clear the fixed hamburger, which sits over the drawer when open. */
  .sidebar__brand {
    padding-left: 2.9rem;
  }

  .sidebar__toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 30;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--chrome-glass);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    box-shadow: var(--inset);
    color: var(--ink);
  }

  .stage {
    padding-top: 3.5rem;
  }

  .specimen__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
  }

  .dl__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .dl__files {
    justify-content: flex-start;
  }
}

@media print {
  .sidebar,
  .totop,
  .sidebar__toggle {
    display: none;
  }
}
