/* ============================================================================
   APEX — kit.css. All block/component styles ride semantic/component tokens.
   No primitive hexes here. Sharp corners, 2px borders, diagonal energy.
   ============================================================================ */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--dur) var(--ease-out),
              color var(--dur) var(--ease-out);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
hr { border: 0; border-top: var(--border-hair) solid var(--hairline); margin: var(--space-6) 0; }

/* ---- Layout primitives ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--space-5); }
.wrap--narrow { max-width: var(--maxw-narrow); }
.section { padding-block: var(--space-9); }
.section--tight { padding-block: var(--space-7); }
.stack > * + * { margin-top: var(--space-4); }
.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---- Type ---- */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  margin: 0;
}
.mega { font-size: var(--fs-mega); }
h1, .h1 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: var(--tracking-display); margin: 0; }
h2, .h2 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: var(--fs-h2); line-height: var(--lh-snug); margin: 0; }
h3, .h3 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: var(--fs-h3); line-height: var(--lh-snug); margin: 0; }
.h4 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: var(--fs-h4); letter-spacing: 0.02em; margin: 0; }
p { margin: 0; }
.lead { font-size: var(--fs-lg); color: var(--text-muted); max-width: 56ch; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.accent-text { color: var(--accent); }
.skew { display: inline-block; transform: skewX(var(--skew)); }
.skew > * { display: inline-block; transform: skewX(calc(-1 * var(--skew))); }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--eyebrow-color);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: var(--border-w);
  background: var(--accent);
  transform: skewX(var(--skew));
}

/* The recurring diagonal accent rule */
.rule {
  height: 4px;
  width: 64px;
  background: var(--rule-accent);
  transform: skewX(var(--skew));
  margin-block: var(--space-3);
}
.rule--full { width: 100%; height: var(--border-w); transform: none; background: var(--border); }

/* ---- Top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bar-bg);
  border-bottom: var(--border-w) solid var(--bar-border);
  backdrop-filter: saturate(1.1);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 64px;
  padding-inline: var(--space-5);
  max-width: var(--maxw);
  margin-inline: auto;
}
.brandmark { display: inline-flex; align-items: center; gap: var(--space-3); }
.brandmark__emblem {
  width: 28px; height: 28px; flex: none;
}
.brandmark__word {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  line-height: 1;
}
.brandmark__word b { color: var(--accent); font-weight: 800; }
.topbar__spacer { flex: 1; }
.topbar__controls { display: flex; align-items: center; gap: var(--space-3); }

/* Track switcher (segmented, diagonal) */
.trackswitch {
  display: inline-flex;
  border: var(--border-w) solid var(--border);
  background: var(--surface-raised);
}
.trackswitch__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 12px;
  transition: color var(--dur-fast), background var(--dur-fast);
  border-right: var(--border-hair) solid var(--hairline);
}
.trackswitch__btn:last-child { border-right: 0; }
.trackswitch__btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
}
.trackswitch__btn:not([aria-pressed="true"]):hover { color: var(--text); }

/* Theme toggle */
.themetoggle {
  appearance: none;
  border: var(--border-w) solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  width: 44px; height: 38px;
  display: inline-grid; place-items: center;
  font-size: 1rem;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.themetoggle:hover { border-color: var(--accent); }
.themetoggle .icon-sun { display: none; }
[data-theme="light"] .themetoggle .icon-sun { display: inline; }
[data-theme="light"] .themetoggle .icon-moon { display: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--fs-sm);
  padding: 14px 22px;
  border: var(--border-w) solid transparent;
  border-radius: var(--radius-1);
  transition: transform var(--dur-fast) var(--ease-snap),
              background var(--dur-fast), border-color var(--dur-fast),
              box-shadow var(--dur-fast), color var(--dur-fast);
  position: relative;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); border-color: var(--btn-primary-bg); }
.btn--primary:hover { background: var(--btn-primary-bg-hover); border-color: var(--btn-primary-bg-hover); }
.btn--primary:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 2px; }
.btn--ghost { background: transparent; color: var(--btn-ghost-text); border-color: var(--btn-ghost-border); }
.btn--ghost:hover { background: var(--btn-ghost-bg-hover); border-color: var(--accent); }
.btn--lg { padding: 18px 30px; font-size: var(--fs-md); }
.btn--block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn__arrow { transition: transform var(--dur-fast) var(--ease-snap); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---- Tags / chips / badges ---- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  color: var(--tag-text); background: var(--tag-bg);
  border: var(--border-hair) solid var(--tag-border);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 600;
  padding: 5px 12px;
  border: var(--border-w) solid var(--border);
  color: var(--text-muted);
  background: var(--surface-base);
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: var(--accent); color: var(--accent-contrast);
  transform: skewX(var(--skew));
}
.badge > span { transform: skewX(calc(-1 * var(--skew))); }
.divider { height: var(--border-hair); background: var(--hairline); }

/* ---- Cards / frames ---- */
.card {
  background: var(--card-bg);
  border: var(--border-w) solid var(--card-border);
  border-radius: var(--radius-1);
  padding: var(--space-6);
  transition: border-color var(--dur), transform var(--dur) var(--ease-out);
}
.card--hover:hover { border-color: var(--card-border-hover); transform: translateY(-3px); }
.card__kicker { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-faint); font-weight: 700; }

/* Pair frame for kit showcase: side-by-side light/dark */
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}
@media (max-width: 980px) { .pair { grid-template-columns: 1fr; } }
.pairframe {
  border: var(--border-w) solid var(--p-ink-700);
  border-radius: var(--radius-1);
  overflow: hidden;
}
.pairframe__label {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 8px 12px;
}
.pairframe__body { padding: var(--space-5); }
/* The pairframe forces its own theme context regardless of page theme */
.theme-dark { background: var(--p-ink-850); color: var(--p-paper-100); }
.theme-light { background: var(--p-gallery-050); color: var(--p-gallery-900); }

/* ---- Imagery treatment (duotone / chiaroscuro, accent-pulled) ---- */
.media {
  position: relative;
  overflow: hidden;
  background: var(--img-bg);
  border-radius: var(--radius-1);
  isolation: isolate;
}
.media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: var(--img-filter);
  transition: filter var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
/* Accent duotone wash pulled through the per-track accent */
.media::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent);
  mix-blend-mode: var(--img-blend);
  opacity: var(--img-accent-opacity);
  pointer-events: none;
  z-index: 1;
  transition: background var(--dur), opacity var(--dur);
}
/* Directional scrim so type holds in both themes */
.media::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--img-scrim);
  z-index: 2;
  pointer-events: none;
}
.media--ratio-169 { aspect-ratio: 16 / 9; }
.media--ratio-32 { aspect-ratio: 3 / 2; }
.media--ratio-34 { aspect-ratio: 3 / 4; }
.media--hover:hover img { transform: scale(1.03); filter: var(--img-filter) saturate(1.1); }
.media__caption {
  position: absolute; left: 0; bottom: 0; z-index: 3;
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-sm);
}
.media__caption .tag { margin-bottom: 6px; }
/* halftone dot texture option (subtle), via radial-gradient */
.media--halftone::before {
  background:
    radial-gradient(circle, rgba(0,0,0,0.0) 0.5px, transparent 1px) 0 0 / 4px 4px,
    var(--img-scrim);
}

/* ---- Hero ---- */
/* Sticky topbar effective height: 64px min-height + 2px (--border-w) bottom border */
:root { --header-h: 66px; }
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: flex-end; /* intentional: full-bleed image, text sits at bottom */
  overflow: hidden;
  border-bottom: var(--border-w) solid var(--border);
}
.hero__media { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
/* Fill the absolute-inset container without letting aspect-ratio compute a
   huge intrinsic width: the source image is ~1590px wide and would otherwise
   escape the page at narrow widths. Force width to the container, drop the
   ratio so cover-fit governs sizing. */
.hero__media .media { width: 100%; height: 100%; max-width: 100%; aspect-ratio: auto; border-radius: 0; }
.hero__media .media img { width: 100%; height: 100%; max-width: 100%; object-fit: cover; filter: var(--img-filter) brightness(0.78); }
.hero__inner { position: relative; z-index: 3; padding-block: clamp(2rem, 6vh, 6rem); width: 100%; }
/* The hero eyebrow sits over the photo: give it its own row with a clear,
   generous gap below so the giant display headline can never ride up into it. */
.hero .eyebrow {
  display: flex;
  margin-bottom: var(--space-5);
}
.hero__title {
  font-size: var(--fs-mega);
  max-width: 16ch;
  margin-top: 0;
  /* lh-tight (0.92) lets the cap line ride above its content box; the skew also
     nudges the first line up-left. Pad the top by the line-height shortfall so
     the headline clears the eyebrow regardless of viewport-scaled font size. */
  padding-top: 0.08em;
  /* The hero photo is dark in BOTH themes — pin the headline to a light value
     so it never inherits the near-black light-theme --text and dissolve into
     the image. Dark theme already resolves to this same light tone. */
  color: var(--p-paper-100);
}
.hero__title em { font-style: normal; color: var(--accent); }
.hero__sub { margin-top: var(--space-5); max-width: 48ch; font-size: var(--fs-lg); color: var(--p-mist-200); }
/* Subhead & eyebrow sit on the same dark photo — keep them light in both
   themes (default eyebrow accent stays the red accent, which reads fine). */
[data-theme="light"] .hero__sub { color: var(--p-mist-200); }
.hero__cta { margin-top: var(--space-6); display: flex; gap: var(--space-4); flex-wrap: wrap; }
/* Ghost button sits over the dark hero photo — the default steel border can read
   faint against the image. Give it a visible light border + label and a subtle
   scrim so it clears WCAG-AA contrast over imagery in both themes. */
.hero__cta .btn--ghost {
  border-color: var(--p-paper-100);
  color: var(--p-paper-100);
  background: rgba(5, 5, 6, 0.30);
  backdrop-filter: blur(1px) saturate(1.1);
}
.hero__cta .btn--ghost:hover { border-color: var(--accent); background: rgba(5, 5, 6, 0.45); }
[data-theme="light"] .hero__cta .btn--ghost {
  border-color: var(--p-gallery-900);
  color: var(--p-gallery-900);
  background: rgba(255, 255, 255, 0.55);
}
[data-theme="light"] .hero__cta .btn--ghost:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.7); }
.hero__tape {
  margin-top: var(--space-7);
  display: flex; flex-wrap: wrap; gap: var(--space-6);
  border-top: var(--border-hair) solid var(--hairline);
  padding-top: var(--space-5);
}

/* ---- Tale of the tape / stat strip ---- */
.statstrip { display: flex; flex-wrap: wrap; gap: 0; border: var(--border-w) solid var(--border); background: var(--surface-base); }
.stat {
  flex: 1 1 0;
  min-width: 160px;
  padding: var(--space-5) var(--space-5);
  border-right: var(--border-hair) solid var(--hairline);
}
.stat:last-child { border-right: 0; }
.stat__value { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h2); line-height: 1; color: var(--stat-value); }
.stat__value b { color: var(--accent); }
.stat__label { margin-top: var(--space-2); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--stat-label); }

/* Tale-of-the-tape row (two-column versus layout) */
.tape { border: var(--border-w) solid var(--border); }
.tape__row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: var(--border-hair) solid var(--hairline); }
.tape__row:last-child { border-bottom: 0; }
.tape__cell { padding: 12px 18px; font-weight: 700; }
.tape__cell--r { text-align: right; }
.tape__mid { padding: 8px 14px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-faint); background: var(--surface-base); }

/* ---- Four principles ---- */
.principle {
  position: relative;
  border-top: var(--border-w) solid var(--border);
  padding-top: var(--space-5);
}
.principle__num { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h3); color: var(--accent); line-height: 1; }
.principle__title { margin-top: var(--space-3); }
.principle__body { margin-top: var(--space-3); color: var(--text-muted); font-size: var(--fs-sm); }

/* ---- Lineage as evidence ---- */
.lineage { position: relative; }
.lineage__track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: var(--border-w) solid var(--border);
}
@media (max-width: 860px) { .lineage__track { grid-template-columns: 1fr; } }
.lineage__node {
  position: relative;
  padding: var(--space-6);
  border-right: var(--border-hair) solid var(--hairline);
}
.lineage__node:last-child { border-right: 0; }
.lineage__year { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.08em; color: var(--accent); font-weight: 700; }
.lineage__name { margin-top: var(--space-3); }
.lineage__role { margin-top: var(--space-2); font-size: var(--fs-sm); color: var(--text-muted); }
.lineage__handoff {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: var(--space-4); font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-faint); font-weight: 700;
}
.lineage__arrow { color: var(--accent); }

/* ---- Certify-to-teach track cards ---- */
.trackcard {
  border: var(--border-w) solid var(--border);
  background: var(--surface-raised);
  border-radius: var(--radius-1);
  overflow: hidden;
  transition: border-color var(--dur), transform var(--dur) var(--ease-out);
}
.trackcard.is-active { border-color: var(--accent); }
.trackcard:hover { transform: translateY(-3px); border-color: var(--accent); }
.trackcard__bar { height: 6px; background: var(--accent); transform-origin: left; }
.trackcard__body { padding: var(--space-5); }
.trackcard__name { margin-top: var(--space-2); }
.trackcard__unlock { margin-top: var(--space-4); font-size: var(--fs-sm); color: var(--text-muted); }
.trackcard__meta { margin-top: var(--space-4); display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* Track feature header (re-skins per accent) */
.trackfeature {
  position: relative;
  border: var(--border-w) solid var(--border);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
@media (max-width: 860px) { .trackfeature { grid-template-columns: 1fr; } }
.trackfeature__media { position: relative; min-height: 320px; }
.trackfeature__media .media { position: absolute; inset: 0; border-radius: 0; }
.trackfeature__panel { padding: var(--space-7); display: flex; flex-direction: column; justify-content: center; gap: var(--space-4); background: var(--surface-raised); }
.trackfeature__accentlabel { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent); letter-spacing: 0.1em; }

/* ---- Fighter's ascent / record (signature mechanic) ---- */
.ascent {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-7);
  /* Size each column to its own content and top-align. The ladder is short
     (~content height); stretching it to match the tall record left a large
     empty void above the bottom-collected rungs. */
  align-items: start;
}
@media (max-width: 920px) { .ascent { grid-template-columns: 1fr; } }

.ladder {
  display: flex;
  flex-direction: column-reverse; /* climb upward: chalk bottom → gold top */
  border: var(--border-w) solid var(--border);
  background: var(--surface-base);
}
.rung {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--border-hair) solid var(--hairline);
  cursor: pointer;
  background: transparent;
  border-left: 0; border-right: 0; border-top: 0;
  text-align: left;
  width: 100%;
  color: var(--rung-inactive-text);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.rung:first-child { border-bottom: 0; }
.rung:hover { background: var(--surface-raised); }
.rung:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rung__pip {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: var(--border-w) solid currentColor;
  border-radius: var(--radius-pill);
  font-family: var(--font-display); font-weight: 800; font-size: 1rem;
  color: var(--rung-color, var(--text-faint));
  transition: all var(--dur-fast);
}
.rung__label { display: flex; flex-direction: column; gap: 2px; }
.rung__rank { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 1.05rem; letter-spacing: 0.02em; color: var(--text); opacity: 0.55; transition: opacity var(--dur-fast); }
.rung__tier { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); }
/* Light theme: --text-faint (#c4c6cb) on white is ~1.7 contrast for these
   body-size rung labels. Bump to a legible muted tone (≥4.5) without touching
   dark theme. Also lift the inactive rank's low opacity so it stays readable. */
[data-theme="light"] .rung__tier { color: var(--p-gallery-600); }
[data-theme="light"] .rung__rank { color: var(--p-gallery-600); opacity: 1; }
[data-theme="light"] .rung.is-achieved .rung__rank,
[data-theme="light"] .rung.is-current .rung__rank { color: var(--p-gallery-900); }
/* lit & achieved states */
.rung.is-achieved .rung__pip { color: var(--rung-color); border-color: var(--rung-color); background: color-mix(in srgb, var(--rung-color) 16%, transparent); }
.rung.is-achieved .rung__rank { opacity: 1; }
.rung.is-current {
  background: var(--surface-raised);
}
.rung.is-current .rung__pip {
  color: var(--accent-contrast);
  background: var(--rung-color);
  border-color: var(--rung-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--rung-color) 30%, transparent);
}
.rung.is-current .rung__rank { opacity: 1; color: var(--text); }
.rung.is-current::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--rung-color);
}
.rung__connector {
  position: absolute; left: calc(var(--space-5) + 19px); top: -50%; height: 100%;
  width: var(--border-w);
  background: var(--hairline);
  z-index: -1;
}

/* Per-rung identity colors set inline via --rung-color */

/* Record / unlock panel */
.record {
  border: var(--border-w) solid var(--border);
  background: var(--surface-raised);
  display: flex;
  flex-direction: column;
}
.record__head {
  padding: var(--space-5);
  border-bottom: var(--border-w) solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
}
.record__rank { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: var(--fs-h3); line-height: 1; }
.record__rank b { color: var(--rung-color, var(--accent)); }
.record__badge {
  font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.08em;
  padding: 4px 10px; border: var(--border-w) solid var(--rung-color, var(--accent));
  color: var(--rung-color, var(--accent));
}
.record__grid { display: grid; grid-template-columns: 1fr 1fr; }
.record__cell { padding: var(--space-5); border-right: var(--border-hair) solid var(--hairline); border-bottom: var(--border-hair) solid var(--hairline); }
.record__cell:nth-child(2n) { border-right: 0; }
.record__cell-value { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h3); line-height: 1; }
.record__cell-label { margin-top: 6px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.record__unlocks { padding: var(--space-5); }
.record__unlocks h4 { margin-bottom: var(--space-3); }
.unlock-list { list-style: none; margin: 0; padding: 0; }
.unlock-list li {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: var(--border-hair) solid var(--hairline);
  font-size: var(--fs-sm);
}
.unlock-list li:first-child { border-top: 0; }
.unlock-list .mark { color: var(--rung-color, var(--accent)); font-weight: 800; flex: none; transform: skewX(var(--skew)); }
.unlock-list .locked { color: var(--text-faint); }
.unlock-list .locked .mark { color: var(--text-faint); }
.record__cta { padding: var(--space-5); border-top: var(--border-w) solid var(--border); margin-top: auto; }

/* ---- Quote / endorsement ---- */
.quote {
  border-left: 4px solid var(--accent);
  padding: var(--space-2) 0 var(--space-2) var(--space-6);
}
.quote__text { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: var(--fs-h3); line-height: var(--lh-snug); }
.quote__attr { margin-top: var(--space-4); font-size: var(--fs-sm); color: var(--text-muted); }
.quote__attr b { color: var(--text); }

.endorse {
  display: grid; grid-template-columns: 64px 1fr; gap: var(--space-4); align-items: center;
  border: var(--border-w) solid var(--border); padding: var(--space-5); background: var(--surface-raised);
}
.endorse__avatar { width: 64px; height: 64px; border-radius: var(--radius-pill); overflow: hidden; background: var(--surface-overlay); }
.endorse__avatar .media { position: absolute; inset: 0; }
.endorse__avatar { position: relative; }

/* ---- CTA band ---- */
.ctaband {
  position: relative;
  border: var(--border-w) solid var(--accent);
  background: var(--surface-raised);
  padding: var(--space-8) var(--space-7);
  overflow: hidden;
}
.ctaband::before {
  content: "";
  position: absolute; right: -10%; top: -50%;
  width: 50%; height: 200%;
  background: var(--accent);
  opacity: 0.08;
  transform: skewX(var(--skew));
}
.ctaband__inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; }
.ctaband__title { font-size: var(--fs-h2); max-width: 18ch; }

/* ---- FAQ / accordion ---- */
.faq { border: var(--border-w) solid var(--border); }
.faq__item { border-bottom: var(--border-hair) solid var(--hairline); }
.faq__item:last-child { border-bottom: 0; }
.faq__q {
  width: 100%; text-align: left; background: transparent; border: 0;
  padding: var(--space-5); display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: var(--fs-h4);
  color: var(--text);
}
.faq__q:hover { color: var(--accent); }
.faq__sign { color: var(--accent); font-size: 1.4rem; transition: transform var(--dur) var(--ease-out); flex: none; }
.faq__item[aria-expanded="true"] .faq__sign { transform: rotate(45deg); }
.faq__a { max-height: 0; overflow: hidden; transition: max-height var(--dur) var(--ease-out); }
.faq__item[aria-expanded="true"] .faq__a { max-height: 320px; }
.faq__a-inner { padding: 0 var(--space-5) var(--space-5); color: var(--text-muted); }

/* ---- Content + media split ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-7); align-items: center; }
.split--rev { direction: rtl; }
.split--rev > * { direction: ltr; }
@media (max-width: 860px) { .split, .split--rev { grid-template-columns: 1fr; direction: ltr; } }

/* ---- Nav (in-page sample) + footer ---- */
.nav { display: flex; gap: var(--space-5); align-items: center; }
.nav a { font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.nav a:hover { color: var(--text); }
@media (max-width: 760px) { .nav { display: none; } }

.footer { border-top: var(--border-w) solid var(--border); background: var(--surface-base); }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-6); padding-block: var(--space-8); }
@media (max-width: 860px) { .footer__inner { grid-template-columns: 1fr 1fr; } }
.footer h5 { font-family: var(--font-display); text-transform: uppercase; font-size: var(--fs-sm); letter-spacing: 0.1em; margin: 0 0 var(--space-3); color: var(--text-faint); }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.footer a { font-size: var(--fs-sm); color: var(--text-muted); }
.footer a:hover { color: var(--accent); }
.footer__bottom { border-top: var(--border-hair) solid var(--hairline); padding-block: var(--space-4); font-size: var(--fs-xs); color: var(--text-faint); display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }

/* ---- Emblem (CSS Defendo evocation — circular ceremonial / slab) ---- */
.emblem { position: relative; }
.emblem svg { display: block; }

/* ---- Token / spec board (index showcase) ---- */
.specgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-3); }
.swatch { border: var(--border-hair) solid var(--hairline); border-radius: var(--radius-1); overflow: hidden; }
.swatch__chip { height: 56px; }
.swatch__meta { padding: 6px 8px; font-size: var(--fs-xs); }
.swatch__meta code { font-family: var(--font-mono); color: var(--text-muted); display: block; }
.typespec { display: flex; flex-direction: column; gap: var(--space-4); }
.typespec__row { display: flex; align-items: baseline; gap: var(--space-5); border-bottom: var(--border-hair) solid var(--hairline); padding-bottom: var(--space-3); }
.typespec__tag { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-faint); flex: none; width: 88px; }
.scaleboard { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.scaleboard .box { border: var(--border-hair) solid var(--hairline); padding: 10px; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }

/* index showcase section labels */
.sectlabel { display: flex; align-items: baseline; gap: var(--space-4); margin-bottom: var(--space-6); }
.sectlabel__no { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--accent); }
.sectlabel h2 { font-size: var(--fs-h3); }

/* utility */
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.wrap-flex { flex-wrap: wrap; }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }
.text-r { text-align: right; }

/* ============================================================================
   MOBILE — overflow containment (≤560px). Gated so desktop is untouched.
   Sources addressed: (1) topbar single non-wrapping row, (2) skewed display
   headings/badges bleeding past the right edge. Hero img is handled above
   (unconditional, safe) via overflow:hidden + cover-fit on .hero__media.
   ============================================================================ */
@media (max-width: 560px) {
  /* --- Topbar: let controls drop to a second row instead of overflowing --- */
  .topbar__inner {
    flex-wrap: wrap;
    gap: var(--space-3);
    min-height: 0;
    padding-block: var(--space-3);
    padding-inline: var(--space-4);
  }
  .brandmark { min-width: 0; }
  .brandmark__word { font-size: 0.95rem; letter-spacing: 0.02em; min-width: 0; }
  /* Spacer would force the controls onto their own full-width row; collapse it
     so brand + controls share the first row, wrapping only when needed. */
  .topbar__spacer { flex-basis: 100%; height: 0; }
  .topbar__controls { gap: var(--space-2); flex-wrap: wrap; }
  /* Shrink the track switcher so all three accents stay visible + usable. */
  .trackswitch__btn { padding: 7px 9px; font-size: 0.66rem; letter-spacing: 0.04em; }
  .themetoggle { width: 40px; height: 36px; }

  /* --- Skewed display headings / badges must not bleed sideways --- */
  /* A skewed wide element widens its bounding box; cap and wrap it. */
  .hero__title { max-width: 100%; overflow-wrap: anywhere; }
  .display.skew, .hero__title.skew { max-width: 100%; }
  .skew { max-width: 100%; }
  /* Badge sits on accent fill and is skewed — keep it from poking the edge. */
  .badge { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
