/* ==========================================================================
   Hedi Rizgar — Portfolio
   Direction: "Checkpoint" — an inspection record set in an editorial voice.
   One ink, one paper, one signal colour. Hairlines instead of cards.
   ========================================================================== */

/* ---------- Fonts (self-hosted, Latin subset, variable where available) -- */
@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("../fonts/plex-sans.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ------------------------------------------------------ */
:root {
  color-scheme: dark;

  /* colour — near-black graphite, warm light ink, one signal orange */
  --paper: #0b0d0f;
  --paper-2: #121518;
  --paper-3: #191d21;
  --surface-4: #22272c;
  --ink: #eeebe4;
  --ink-2: #aeb2b7;
  --ink-3: #8a8f95;
  --rule: #23282d;
  --line-strong: #353b42;
  --control: #6a7077;
  --signal: #ff6b3d;
  --signal-tint: rgba(255, 107, 61, 0.1);
  --glow: rgba(255, 107, 61, 0.16);
  --radius-lg: 18px;

  /* type */
  --serif: "Bricolage", "Helvetica Neue", Arial, system-ui, sans-serif;
  --sans: "Plex Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-label: 0.75rem;
  --fs-small: 0.875rem;
  --fs-body: 1.0625rem;
  --fs-lead: clamp(1.1875rem, 1.05rem + 0.55vw, 1.4375rem);
  --fs-h3: clamp(1.25rem, 1.12rem + 0.5vw, 1.5rem);
  --fs-h2: clamp(2rem, 1.45rem + 2.3vw, 3.25rem);
  --fs-h1: clamp(2.6rem, 1.5rem + 4.6vw, 5.5rem);
  --fs-num: clamp(2.5rem, 1.8rem + 2.8vw, 4.25rem);

  /* space — 4px base, named by use */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --section: clamp(4.5rem, 3rem + 6vw, 9rem);

  /* grid */
  --max: 1320px;
  --margin: clamp(1.25rem, 4.5vw, 4rem);
  --gutter: clamp(1rem, 2vw, 1.75rem);
  --header: 4rem;

  /* shape */
  --radius: 10px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 160ms;
  --t-mid: 420ms;
  --t-slow: 900ms;
}

/* ---------- Reset & base ----------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header) + 1.5rem);
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
svg,
canvas {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
h4,
p,
ol,
ul,
dl,
dd,
figure,
blockquote {
  margin: 0;
}
ol,
ul {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
::selection {
  background: var(--ink);
  color: var(--paper);
}
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--margin);
  top: -100px;
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: var(--fs-small);
  text-decoration: none;
}
.skip-link:focus {
  top: var(--s-3);
}

/* Cross-document page transitions (progressive enhancement) */
@view-transition {
  navigation: auto;
}
.site-header {
  view-transition-name: site-header;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 260ms;
  animation-timing-function: var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ---------- Layout ------------------------------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--margin);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}

/* ---------- Typography primitives -------------------------------------- */
.label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.4;
}
.label-num {
  color: var(--signal);
  margin-right: 0.75em;
}
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.022em;
  line-height: 1.02;
}
h2.display {
  font-size: var(--fs-h2);
  line-height: 1.06;
  text-wrap: balance;
}
.lede {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 38em;
  text-wrap: pretty;
}
.muted {
  color: var(--ink-3);
}
em.serif,
.serif-italic {
  font-family: var(--serif);
  font-style: italic;
}

/* ---------- Header & navigation ---------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.1) blur(6px);
  -webkit-backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header);
  gap: var(--s-5);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 22px;
  height: 22px;
  color: var(--ink);
}
.brand-mark .tick {
  stroke: var(--signal);
}
.brand-role {
  font-family: var(--mono);
  font-weight: 400;
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-transform: uppercase;
  padding-left: 0.6rem;
  border-left: 1px solid var(--rule);
}
.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2rem);
}
.nav-list a {
  position: relative;
  text-decoration: none;
  font-size: var(--fs-small);
  font-weight: 500;
  padding-block: 0.4rem;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--t-mid) var(--ease);
}
.nav-list a:hover::after,
.nav-list a[aria-current]::after {
  transform: scaleX(1);
  transform-origin: left;
}
.nav-list a[aria-current] {
  color: var(--ink);
}
.nav-list .nav-cta {
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  transition: background var(--t-fast) var(--ease);
}
.nav-list .nav-cta::after {
  display: none;
}
.nav-list .nav-cta:hover {
  background: var(--signal);
}
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.nav-toggle-lines {
  position: relative;
  width: 16px;
  height: 10px;
}
.nav-toggle-lines::before,
.nav-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--t-mid) var(--ease), top var(--t-mid) var(--ease);
}
.nav-toggle-lines::before {
  top: 1px;
}
.nav-toggle-lines::after {
  top: 7px;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-lines::before {
  top: 4px;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-lines::after {
  top: 4px;
  transform: rotate(-45deg);
}

/* Reading progress — a single signal hairline under the header */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
}

@media (max-width: 860px) {
  .brand-role {
    display: none;
  }
  .js .nav-toggle {
    display: inline-flex;
  }
  .js .site-nav {
    position: fixed;
    inset: var(--header) 0 0 0;
    background: var(--paper);
    border-top: 1px solid var(--rule);
    padding: var(--s-6) var(--margin);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease),
      visibility 0s linear var(--t-mid);
    overflow-y: auto;
  }
  .js .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
  }
  .js .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .js .nav-list li {
    border-bottom: 1px solid var(--rule);
  }
  .js .nav-list a {
    display: flex;
    justify-content: space-between;
    padding-block: 1.1rem;
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: -0.02em;
  }
  .js .nav-list a::after {
    display: none;
  }
  .js .nav-list .nav-cta {
    margin-top: var(--s-6);
    justify-content: center;
    font-family: var(--sans);
    font-size: var(--fs-body);
    font-weight: 500;
    letter-spacing: 0;
    padding: 1rem;
  }
  .js .nav-list li:last-child {
    border-bottom: 0;
  }
  /* Without JS the nav simply wraps under the brand */
  html:not(.js) .site-header .wrap {
    height: auto;
    flex-wrap: wrap;
    padding-block: var(--s-3);
  }
  html:not(.js) .nav-list {
    flex-wrap: wrap;
  }
  body.nav-open {
    overflow: hidden;
  }
}

/* ---------- Buttons & links ------------------------------------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4) var(--s-6);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  font-size: var(--fs-body);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}
.btn:hover {
  background: var(--signal);
  border-color: var(--signal);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.btn .icon-arrow,
.link-arrow .icon-arrow {
  transition: transform var(--t-mid) var(--ease);
}
.btn:hover .icon-arrow,
.link-arrow:hover .icon-arrow {
  transform: translateX(4px);
}
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.35em;
  transition: text-decoration-color var(--t-fast) var(--ease);
}
.link-arrow:hover {
  text-decoration-color: var(--ink);
}
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.icon-arrow {
  width: 18px;
  height: 18px;
}

/* ---------- Sections --------------------------------------------------- */
.section {
  padding-block: var(--section);
}
.section + .section {
  padding-top: 0;
}
/* Every section opens with a full-measure ink rule, drawn on entry */
.section > .wrap::before {
  content: "";
  grid-column: 1 / -1;
  height: 1px;
  margin-bottom: var(--s-6);
  background: var(--line-strong);
  transform-origin: left;
}
.js .section > .wrap::before {
  transform: scaleX(0);
  transition: transform 1100ms var(--ease-in-out);
}
.js .section.is-in > .wrap::before {
  transform: scaleX(1);
}
.section-label {
  grid-column: 1 / 4;
  padding-top: 0.55rem;
}
.section-body {
  grid-column: 4 / 13;
  min-width: 0;
}
.section-head {
  margin-bottom: var(--s-8);
}
.section-head .lede {
  margin-top: var(--s-5);
}
@media (max-width: 900px) {
  .section-label,
  .section-body {
    grid-column: 1 / -1;
  }
  .section-label {
    padding-top: 0;
    margin-bottom: var(--s-5);
  }
  .section-head {
    margin-bottom: var(--s-7);
  }
}

/* ---------- Reveal motion --------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Hero ------------------------------------------------------- */
.hero {
  padding-top: clamp(3rem, 2rem + 5vw, 7rem);
  padding-bottom: clamp(3rem, 2rem + 4vw, 6rem);
}
.hero .grid {
  row-gap: var(--s-7);
  align-items: end;
}
.hero-text {
  grid-column: 1 / 8;
}
.hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-bottom: var(--s-6);
}
.hero h1 {
  font-size: var(--fs-h1);
  text-wrap: balance;
  max-width: 13ch;
}
.hero h1 .line {
  display: block;
}
.hero h1 em {
  font-style: italic;
  color: var(--signal);
}
.hero-intro {
  margin-top: var(--s-6);
  max-width: 34em;
}
.hero .actions {
  margin-top: var(--s-6);
}
.hero-figure {
  grid-column: 8 / 13;
}
.hero-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
  border-top: 1px solid var(--rule);
  padding-top: var(--s-4);
}
.hero-meta dt {
  margin-bottom: 0.15rem;
}
.hero-meta dd {
  font-size: var(--fs-small);
  color: var(--ink-2);
}
.js .hero-load {
  opacity: 0;
  transform: translateY(16px);
}
.js.is-loaded .hero-load {
  opacity: 1;
  transform: none;
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms + 60ms);
}
@media (max-width: 1020px) {
  .hero-text,
  .hero-figure {
    grid-column: 1 / -1;
  }
  .hero-figure {
    max-width: 560px;
  }
  .hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--s-4);
  }
}

/* Case field — the hero instrument: one square = one case */
.instrument {
  position: relative;
  padding: var(--s-5);
  background: var(--paper);
}
/* registration / crop marks — borrowed from print packaging proofs */
.crop {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--ink);
  border-style: solid;
  border-width: 0;
}
.crop.tl {
  top: 0;
  left: 0;
  border-top-width: 1px;
  border-left-width: 1px;
}
.crop.tr {
  top: 0;
  right: 0;
  border-top-width: 1px;
  border-right-width: 1px;
}
.crop.bl {
  bottom: 0;
  left: 0;
  border-bottom-width: 1px;
  border-left-width: 1px;
}
.crop.br {
  bottom: 0;
  right: 0;
  border-bottom-width: 1px;
  border-right-width: 1px;
}
.instrument-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
}
.instrument-count {
  font-family: var(--serif);
  font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
}
.instrument-count small {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-left: 0.4rem;
}
.case-field {
  width: 100%;
  aspect-ratio: 50 / 46;
}
.instrument-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-4);
}
.instrument figcaption {
  margin-top: var(--s-4);
  font-size: var(--fs-small);
  color: var(--ink-3);
  line-height: 1.5;
}
.legend {
  display: flex;
  gap: var(--s-4);
  font-family: var(--mono);
  font-size: var(--fs-label);
  color: var(--ink-3);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.legend i {
  width: 8px;
  height: 8px;
  background: var(--ink);
}
.legend i.sig {
  background: var(--signal);
}
.legend i.empty {
  background: transparent;
  outline: 1px solid var(--rule);
  outline-offset: -1px;
}

/* Segmented control (radio-based, keyboard-native) */
.segmented {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 2px;
  margin: 0;
  min-inline-size: 0;
}
.segmented legend {
  /* fieldset legend is visually hidden; class kept for semantics */
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented label {
  padding: 0.4rem 0.75rem;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 1px;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.segmented input:checked + label {
  background: var(--ink);
  color: var(--paper);
}
.segmented input:focus-visible + label {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* ---------- Evidence ledger ------------------------------------------- */
.ledger {
  border-top: 1px solid var(--rule);
}
.ledger li {
  border-bottom: 1px solid var(--rule);
}
.ledger-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 12rem) minmax(0, 1fr) minmax(0, 15rem) 1.5rem;
  gap: var(--s-2) var(--gutter);
  align-items: baseline;
  padding: var(--s-5) var(--s-3);
  margin-inline: calc(var(--s-3) * -1);
  text-decoration: none;
  transition: background var(--t-fast) var(--ease);
}
.ledger-num {
  font-family: var(--serif);
  font-size: var(--fs-num);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums lining-nums;
}
.ledger-what {
  font-size: var(--fs-lead);
  line-height: 1.35;
  text-wrap: pretty;
}
.ledger-src {
  color: var(--ink-3);
}
.ledger-row .icon-arrow {
  align-self: center;
  color: var(--ink-3);
  transition: transform var(--t-mid) var(--ease), color var(--t-fast) var(--ease);
}
.ledger-row:hover {
  background: var(--paper-2);
}
.ledger-row:hover .icon-arrow {
  color: var(--signal);
  transform: translateX(4px);
}
@media (max-width: 760px) {
  .ledger-row {
    grid-template-columns: minmax(0, 1fr) 1.5rem;
  }
  .ledger-num {
    grid-column: 1 / 2;
  }
  .ledger-row .icon-arrow {
    grid-column: 2;
    grid-row: 1;
  }
  .ledger-what,
  .ledger-src {
    grid-column: 1 / -1;
  }
}

/* ---------- Selected work -------------------------------------------- */
.cases {
  border-top: 1px solid var(--line-strong);
  position: relative;
}
.cases li {
  border-bottom: 1px solid var(--rule);
}
.case-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) minmax(0, 16rem) 1.5rem;
  gap: var(--s-3) var(--gutter);
  align-items: start;
  padding: var(--s-6) 0;
  text-decoration: none;
}
.case-index {
  padding-top: 0.6rem;
}
.case-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 1.25rem + 1.5vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  transition: transform var(--t-mid) var(--ease);
}
.case-sum {
  margin-top: var(--s-3);
  color: var(--ink-2);
  max-width: 36em;
}
.case-meta {
  padding-top: 0.6rem;
  display: grid;
  gap: var(--s-2);
}
.case-tags {
  font-size: var(--fs-small);
  color: var(--ink-2);
  line-height: 1.5;
}
.case-row .icon-arrow {
  margin-top: 0.7rem;
  transition: transform var(--t-mid) var(--ease), color var(--t-fast) var(--ease);
}
.case-row:hover .case-title {
  transform: translateX(6px);
}
.case-row:hover .icon-arrow {
  transform: translateX(4px);
  color: var(--signal);
}
.case-row:hover .case-index .label-num {
  text-decoration: underline;
}
@media (max-width: 900px) {
  .case-row {
    grid-template-columns: minmax(0, 1fr) 1.5rem;
  }
  .case-index {
    grid-column: 1 / -1;
    padding-top: 0;
  }
  .case-main {
    grid-column: 1 / 2;
  }
  .case-row .icon-arrow {
    grid-column: 2;
    grid-row: 2;
  }
  .case-meta {
    grid-column: 1 / -1;
    padding-top: 0;
  }
}
/* Floating evidence card that follows the pointer over the work list */
.case-preview {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  width: 15rem;
  padding: var(--s-4) var(--s-4) var(--s-3);
  background: var(--ink);
  color: var(--paper);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(0.96);
  transition: opacity var(--t-fast) var(--ease);
  will-change: transform;
}
.case-preview.is-on {
  opacity: 1;
}
.case-preview-num {
  font-family: var(--serif);
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.03em;
}
.case-preview-label {
  margin-top: var(--s-2);
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c9c5b7;
}
@media (hover: none), (pointer: coarse), (max-width: 1100px) {
  .case-preview {
    display: none;
  }
}

/* ---------- Method --------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-7) var(--gutter);
  counter-reset: step;
}
.step {
  border-top: 1px solid var(--rule);
  padding-top: var(--s-4);
}
.step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s-6);
}
.step-check {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
}
.step-check .tick {
  stroke: var(--signal);
  stroke-width: 2;
  stroke-dasharray: 16;
  stroke-dashoffset: 0;
}
.js .step-check .tick {
  stroke-dashoffset: 16;
  transition: stroke-dashoffset 520ms var(--ease);
  transition-delay: calc(var(--i, 0) * 160ms + 300ms);
}
.js .is-in .step-check .tick,
.js .step.is-in .step-check .tick {
  stroke-dashoffset: 0;
}
.step h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-h3);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: var(--s-3);
}
.step p {
  color: var(--ink-2);
  font-size: var(--fs-small);
  line-height: 1.6;
}
.step .step-proof {
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--rule);
  font-family: var(--mono);
  font-size: var(--fs-label);
  color: var(--ink-3);
  line-height: 1.5;
}
@media (max-width: 1020px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .steps {
    grid-template-columns: 1fr;
  }
  .step-head {
    margin-bottom: var(--s-4);
  }
}

/* ---------- Leadership crews ----------------------------------------- */
.crews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
}
.crew {
  border-left: 1px solid var(--rule);
  padding-left: var(--s-5);
}
.crew-num {
  font-family: var(--serif);
  font-size: var(--fs-num);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-block: var(--s-4) var(--s-3);
}
.crew h3 {
  font-size: var(--fs-body);
  font-weight: 600;
  margin-bottom: var(--s-2);
}
.crew p:last-child {
  color: var(--ink-2);
  font-size: var(--fs-small);
}
.checkpoint {
  margin-top: var(--s-8);
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--s-6) var(--gutter);
  align-items: start;
  padding: var(--s-6);
  background: var(--paper-2);
  position: relative;
}
.checkpoint blockquote {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 1.15rem + 1vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}
.checkpoint .label {
  margin-bottom: var(--s-3);
}
.checkpoint-list li {
  display: flex;
  gap: var(--s-3);
  padding-block: var(--s-3);
  border-bottom: 1px solid var(--paper-3);
  font-size: var(--fs-small);
  color: var(--ink-2);
}
.checkpoint-list li:last-child {
  border-bottom: 0;
}
.checkpoint-list .icon {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  color: var(--signal);
}
@media (max-width: 900px) {
  .crews {
    grid-template-columns: 1fr;
    gap: var(--s-6);
  }
  .checkpoint {
    grid-template-columns: 1fr;
    padding: var(--s-5);
  }
}

/* ---------- Capabilities --------------------------------------------- */
.caps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
}
.cap {
  padding: var(--s-5) var(--s-5) var(--s-6) 0;
  border-bottom: 1px solid var(--rule);
}
.cap + .cap {
  padding-left: var(--s-5);
}
.cap:nth-child(4n + 1) {
  padding-left: 0;
}
.cap:not(:nth-child(4n + 1)) {
  border-left: 1px solid var(--rule);
}
.cap .icon {
  margin-bottom: var(--s-5);
  transition: color var(--t-fast) var(--ease);
}
.cap:hover .icon {
  color: var(--signal);
}
.cap h3 {
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--s-2);
}
.cap-proof {
  font-size: var(--fs-small);
  color: var(--ink-2);
  margin-bottom: var(--s-4);
}
.cap-items {
  font-family: var(--mono);
  font-size: var(--fs-label);
  line-height: 1.7;
  color: var(--ink-3);
}
.cap-items li {
  display: inline;
}
.cap-items li:not(:last-child)::after {
  content: " / ";
  color: var(--rule);
}
@media (max-width: 1020px) {
  .caps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cap:nth-child(n) {
    padding-left: var(--s-5);
    border-left: 1px solid var(--rule);
  }
  .cap:nth-child(2n + 1) {
    padding-left: 0;
    border-left: 0;
  }
}
@media (max-width: 560px) {
  .caps {
    grid-template-columns: 1fr;
  }
  .cap:nth-child(n) {
    padding-left: 0;
    border-left: 0;
  }
}

/* ---------- Contact -------------------------------------------------- */
.contact .grid {
  row-gap: var(--s-7);
}
.contact-head {
  grid-column: 1 / 8;
}
.contact-head h2 {
  font-size: var(--fs-h1);
  line-height: 1;
  max-width: 12ch;
}
.contact-head .lede {
  margin-top: var(--s-5);
}
.contact-details {
  grid-column: 9 / 13;
  align-self: end;
}
.contact-details dl > div {
  padding-block: var(--s-4);
  border-top: 1px solid var(--rule);
}
.contact-details dl > div:last-child {
  border-bottom: 1px solid var(--rule);
}
.contact-details dd {
  margin-top: 0.2rem;
}
.email-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
}
.email-line a {
  font-weight: 500;
  word-break: break-all;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: transparent;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.copy-btn:hover {
  border-color: var(--ink);
}
.copy-btn .icon {
  width: 14px;
  height: 14px;
}
.copy-btn.is-done {
  border-color: var(--signal);
  color: var(--signal);
}
.compose {
  grid-column: 1 / 8;
  display: grid;
  gap: var(--s-5);
  padding: var(--s-6);
  border: 1px solid var(--line-strong);
  position: relative;
}
.compose-title {
  font-family: var(--serif);
  font-size: var(--fs-h3);
  line-height: 1.2;
}
.field {
  display: grid;
  gap: var(--s-2);
}
.field label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field select,
.field textarea,
.field input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: var(--fs-body);
  line-height: 1.5;
  transition: border-color var(--t-fast) var(--ease);
}
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}
.field textarea {
  min-height: 8rem;
  resize: vertical;
}
.field select:hover,
.field textarea:hover,
.field input:hover {
  border-color: var(--ink-3);
}
.field select:focus-visible,
.field textarea:focus-visible,
.field input:focus-visible {
  border-color: var(--ink);
  outline-offset: 1px;
}
.compose-note {
  font-size: var(--fs-small);
  color: var(--ink-3);
}
.compose .actions {
  justify-content: space-between;
}
@media (max-width: 1020px) {
  .contact-head,
  .contact-details,
  .compose {
    grid-column: 1 / -1;
  }
  .compose {
    padding: var(--s-5);
  }
}

/* ---------- Footer --------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line-strong);
  padding-block: var(--s-6) var(--s-7);
  font-size: var(--fs-small);
  color: var(--ink-2);
}
.site-footer .wrap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--s-5);
}
.footer-name {
  grid-column: 1 / 5;
}
.footer-name strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
}
.footer-nav {
  grid-column: 5 / 9;
}
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
}
.footer-nav a {
  text-decoration-color: var(--rule);
}
.footer-nav a:hover {
  text-decoration-color: var(--ink);
}
.footer-colophon {
  grid-column: 9 / 13;
  color: var(--ink-3);
}
.to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--s-2);
}
@media (max-width: 900px) {
  .footer-name,
  .footer-nav,
  .footer-colophon {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   Inner pages: About + case studies
   ========================================================================== */
.page-hero {
  padding-top: clamp(3rem, 2rem + 4vw, 6rem);
  padding-bottom: var(--s-8);
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--s-6);
}
.crumbs a {
  color: var(--ink-3);
  text-decoration-color: var(--rule);
}
.crumbs a:hover {
  color: var(--ink);
}
.crumbs [aria-current] {
  color: var(--ink);
}
.page-hero h1 {
  font-size: var(--fs-h1);
  max-width: 16ch;
  text-wrap: balance;
}
.page-hero .lede {
  margin-top: var(--s-6);
}

/* Record strip — the case "inspection record" */
.record {
  margin-top: var(--s-7);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--rule);
}
.record > div {
  padding: var(--s-4) var(--s-4) var(--s-4) 0;
}
.record > div + div {
  padding-left: var(--s-4);
  border-left: 1px solid var(--rule);
}
.record dd {
  margin-top: 0.3rem;
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.4;
}
@media (max-width: 620px) {
  .record {
    grid-template-columns: 1fr 1fr;
  }
  .record > div {
    padding: var(--s-3) var(--s-3) var(--s-3) 0 !important;
    border-left: 0 !important;
    border-bottom: 1px solid var(--rule);
  }
  .record > div:nth-child(even) {
    padding-left: var(--s-3) !important;
    border-left: 1px solid var(--rule) !important;
  }
}

/* Case-study body: sticky index + article */
.case-body {
  padding-bottom: var(--section);
}
.case-body .grid {
  align-items: start;
}
.case-index-nav {
  grid-column: 1 / 4;
  position: sticky;
  top: calc(var(--header) + var(--s-6));
}
.case-index-nav ol {
  border-left: 1px solid var(--rule);
}
.case-index-nav a {
  display: flex;
  gap: 0.75rem;
  padding: 0.4rem 0 0.4rem var(--s-4);
  margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: var(--fs-small);
  color: var(--ink-3);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.case-index-nav a span {
  font-family: var(--mono);
  font-size: var(--fs-label);
  padding-top: 0.15rem;
}
.case-index-nav a:hover {
  color: var(--ink);
}
.case-index-nav a.is-current {
  color: var(--ink);
  border-left-color: var(--signal);
}
.case-index-nav a.is-current span {
  color: var(--signal);
}
.case-article {
  grid-column: 4 / 12;
  min-width: 0;
}
.case-sec {
  padding-top: var(--s-7);
}
.case-sec:first-child {
  padding-top: 0;
}
.case-sec > h2 {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.4rem + 1.3vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}
.case-sec > h2 .label-num {
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.06em;
  margin: 0;
}
.prose p,
.prose ul {
  max-width: 40em;
  color: var(--ink-2);
}
.prose p + p,
.prose p + ul,
.prose ul + p {
  margin-top: var(--s-4);
}
.prose strong {
  color: var(--ink);
  font-weight: 600;
}
.ticks li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: var(--s-3);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.5em;
  width: 0.8rem;
  height: 0.45rem;
  border-left: 1.5px solid var(--signal);
  border-bottom: 1.5px solid var(--signal);
  transform: rotate(-45deg);
}
.process {
  counter-reset: p;
  border-left: 1px solid var(--line-strong);
  margin-left: 0.5rem;
}
.process li {
  position: relative;
  padding: 0 0 var(--s-6) var(--s-6);
  max-width: 42em;
}
.process li:last-child {
  padding-bottom: 0;
}
.process li::before {
  counter-increment: p;
  content: counter(p, decimal-leading-zero);
  position: absolute;
  left: -0.85rem;
  top: 0;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
}
.process h3 {
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.7rem;
  margin-bottom: var(--s-1);
}
.process p {
  color: var(--ink-2);
}
.decisions > div {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--s-2) var(--gutter);
  padding-block: var(--s-5);
  border-bottom: 1px solid var(--rule);
}
.decisions > div:first-child {
  border-top: 1px solid var(--rule);
}
.decisions dt {
  font-family: var(--serif);
  font-size: var(--fs-h3);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.decisions dd {
  color: var(--ink-2);
}
@media (max-width: 700px) {
  .decisions > div {
    grid-template-columns: 1fr;
  }
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--gutter);
}
.fact {
  border-top: 1px solid var(--line-strong);
  padding-top: var(--s-4);
}
.fact-num {
  font-family: var(--serif);
  font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums lining-nums;
}
.fact p {
  margin-top: var(--s-2);
  font-size: var(--fs-small);
  color: var(--ink-2);
}
.fact-word {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.note {
  margin-top: var(--s-5);
  padding-left: var(--s-4);
  border-left: 2px solid var(--rule);
  font-size: var(--fs-small);
  color: var(--ink-3);
  max-width: 40em;
}
.skill-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  font-size: var(--fs-small);
  border-top: 1px solid var(--rule);
}
.skill-line li {
  padding: var(--s-3) var(--s-4) var(--s-3) 0;
  margin-right: var(--s-4);
  border-bottom: 1px solid var(--rule);
  flex: 1 1 14rem;
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
}
.skill-line li span {
  font-family: var(--mono);
  font-size: var(--fs-label);
  color: var(--signal);
}
.reflection {
  padding: var(--s-6);
  background: var(--paper-2);
}
.reflection p {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 32em;
  text-wrap: pretty;
}
.reflection p + p {
  margin-top: var(--s-4);
}

/* Diagrams */
.diagram {
  margin-block: var(--s-7);
  position: relative;
  padding: var(--s-6) var(--s-5) var(--s-5);
  background: var(--paper);
}
.diagram-head {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
}
.diagram svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.diagram figcaption {
  margin-top: var(--s-5);
  font-size: var(--fs-small);
  color: var(--ink-3);
  max-width: 44em;
}
.dg-box {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1;
}
.dg-box-fill {
  fill: var(--ink);
}
.dg-box-sig {
  fill: var(--paper);
  stroke: var(--signal);
  stroke-width: 1.5;
}
.dg-box-soft {
  fill: var(--paper-2);
  stroke: none;
}
.dg-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
}
.dg-line-sig {
  fill: none;
  stroke: var(--signal);
  stroke-width: 1.5;
}
.dg-dash {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.dg-t {
  font-family: var(--sans);
  font-size: 13px;
  fill: var(--ink);
}
.dg-t-strong {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  fill: var(--ink);
}
.dg-t-inv {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  fill: var(--paper);
}
.dg-t-mono {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  fill: var(--ink-3);
  text-transform: uppercase;
}
.dg-t-sig {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  fill: var(--signal);
  text-transform: uppercase;
}
.dg-t-num {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: -0.02em;
  fill: var(--ink);
}
.dg-arrowhead {
  fill: var(--ink);
}
.js .diagram .dg-draw {
  stroke-dasharray: var(--len, 400);
  stroke-dashoffset: var(--len, 400);
  transition: stroke-dashoffset 1200ms var(--ease-in-out);
  transition-delay: calc(var(--i, 0) * 120ms + 200ms);
}
.js .diagram.is-in .dg-draw {
  stroke-dashoffset: 0;
}
.diagram-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.diagram-scroll svg {
  min-width: 620px;
}
.scroll-hint {
  display: none;
  margin-top: var(--s-3);
}
@media (max-width: 700px) {
  .scroll-hint {
    display: block;
  }
  .diagram {
    padding-inline: var(--s-4);
  }
}

/* Next-case block */
.next-case {
  border-top: 1px solid var(--line-strong);
}
.next-case a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-4);
  align-items: end;
  padding-block: var(--s-7);
  text-decoration: none;
}
.next-case .display {
  font-size: var(--fs-h2);
  margin-top: var(--s-3);
  transition: transform var(--t-mid) var(--ease);
}
.next-case .icon-arrow {
  width: 40px;
  height: 40px;
  stroke-width: 1;
  transition: transform var(--t-mid) var(--ease), color var(--t-fast) var(--ease);
}
.next-case a:hover .display {
  transform: translateX(8px);
}
.next-case a:hover .icon-arrow {
  transform: translateX(6px);
  color: var(--signal);
}

@media (max-width: 1020px) {
  .case-index-nav {
    display: none;
  }
  .case-article {
    grid-column: 1 / -1;
  }
}

/* ---------- About: parallel tracks timeline -------------------------- */
.chapters {
  display: grid;
  gap: var(--s-8);
}
.chapter {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--s-4);
}
.chapter-when {
  grid-column: 1 / 4;
  padding-top: 0.5rem;
}
.chapter-text {
  grid-column: 4 / 11;
}
.chapter-text h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-4);
}
@media (max-width: 900px) {
  .chapter-when,
  .chapter-text {
    grid-column: 1 / -1;
  }
}

.tracks {
  --months: 96;
  position: relative;
}
.tracks-axis,
.track {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  column-gap: var(--gutter);
}
.tracks-axis {
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line-strong);
}
.axis-years {
  position: relative;
  height: 1.2rem;
}
.axis-years span {
  position: absolute;
  left: calc(var(--m) / var(--months) * 100%);
  transform: translateX(-1px);
  padding-left: 0.35rem;
  border-left: 1px solid var(--rule);
  line-height: 1.2rem;
}
.track {
  align-items: center;
  padding-block: var(--s-4);
  border-bottom: 1px solid var(--rule);
}
.track-label strong {
  display: block;
  font-weight: 600;
  font-size: var(--fs-small);
  line-height: 1.35;
}
.track-label span {
  display: block;
  font-size: var(--fs-small);
  color: var(--ink-3);
  line-height: 1.4;
}
.track-lane {
  position: relative;
  height: 1.5rem;
  background-image: repeating-linear-gradient(
    to right,
    var(--rule) 0 1px,
    transparent 1px calc(100% / 8)
  );
  background-size: 100% 100%;
}
.track-bar {
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  left: calc(var(--s) / var(--months) * 100%);
  width: calc((var(--e) - var(--s)) / var(--months) * 100%);
  background: var(--ink);
  transform-origin: left;
}
.track-bar.is-open::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  border: 5px solid transparent;
  border-left: 6px solid var(--line-strong);
  transform: translateY(-50%);
}
.track-bar.is-sig {
  background: var(--signal);
}
.track-bar.is-sig.is-open::after {
  border-left-color: var(--signal);
}
.track-bar.is-cert {
  background: transparent;
  border: 1px dashed var(--ink);
}
.js .tracks .track-bar {
  transform: scaleX(0);
  transition: transform 900ms var(--ease-in-out);
  transition-delay: calc(var(--i, 0) * 120ms + 200ms);
}
.js .tracks.is-in .track-bar {
  transform: scaleX(1);
}
.tracks-overlap {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
}
.overlap-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--signal-tint);
  border-inline: 1px dashed var(--signal);
}
.tracks-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-4);
  font-size: var(--fs-small);
  color: var(--ink-3);
}
.tracks-caption .sig {
  color: var(--signal);
}
@media (max-width: 760px) {
  .tracks-axis,
  .track {
    grid-template-columns: 1fr;
    row-gap: var(--s-2);
  }
  .tracks-axis > :first-child {
    display: none;
  }
  .axis-years span:nth-child(even) {
    visibility: hidden;
  }
}

.facts-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
}
.facts-row > div {
  border-top: 1px solid var(--line-strong);
  padding-top: var(--s-4);
}
.facts-row h3 {
  font-size: var(--fs-body);
  font-weight: 600;
  margin-bottom: var(--s-3);
}
.facts-row li {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: var(--s-2);
  border-bottom: 1px solid var(--rule);
  font-size: var(--fs-small);
}
.facts-row li span:last-child {
  color: var(--ink-3);
  text-align: right;
}
@media (max-width: 900px) {
  .facts-row {
    grid-template-columns: 1fr;
    gap: var(--s-6);
  }
}

/* ---------- 404 ----------------------------------------------------- */
.lost {
  min-height: 60vh;
  display: grid;
  align-content: center;
}

/* ---------- Reduced motion ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .js .reveal,
  .js .hero-load {
    opacity: 1;
    transform: none;
  }
  .js .section > .wrap::before,
  .js .tracks .track-bar {
    transform: none;
  }
  .js .diagram .dg-draw,
  .js .step-check .tick {
    stroke-dashoffset: 0;
  }
  .case-preview {
    display: none;
  }
}

/* ---------- Print: the site prints as a clean record ---------------- */
@media print {
  .site-header,
  .nav-toggle,
  .compose,
  .case-index-nav,
  .case-preview,
  .copy-btn,
  .segmented {
    display: none !important;
  }
  .js .reveal,
  .js .hero-load {
    opacity: 1 !important;
    transform: none !important;
  }
  body {
    background: #fff;
  }
}

/* ---------- Additions: timeline overlap + index label ---------------- */
.tracks-overlap {
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  column-gap: var(--gutter);
}
.overlap-lane {
  position: relative;
}
.overlap-band {
  left: calc(var(--s) / var(--months) * 100%);
  width: calc((var(--e) - var(--s)) / var(--months) * 100%);
}
@media (max-width: 760px) {
  .tracks-overlap {
    grid-template-columns: 1fr;
  }
  .tracks-overlap > span:first-child {
    display: none;
  }
}
.case-index-nav .label {
  margin-bottom: var(--s-4);
}
.case-index-nav li {
  list-style: none;
}
.case-main,
.case-title,
.case-sum {
  display: block;
}
.contact-head > .label {
  margin-bottom: var(--s-5);
}
.prose .diagram p + p,
.prose .diagram-head p {
  margin-top: 0;
}
.diagram-head {
  align-items: baseline;
}
/* evidence numbers must win over generic .fact p / .prose p rules */
.fact .fact-num,
.fact .fact-word {
  margin-top: 0;
  color: var(--ink);
  font-family: var(--serif);
  letter-spacing: -0.02em;
}
.fact .fact-num {
  font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.fact .fact-word {
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
  line-height: 1.1;
}
.prose .skill-line {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  column-gap: var(--gutter);
  max-width: none;
}
.prose .skill-line li {
  margin-right: 0;
  padding-right: 0;
}
/* WCAG 1.4.11 — interactive boundaries need ≥ 3:1 against the paper */
.field select,
.field textarea,
.field input,
.copy-btn {
  border-color: var(--ink-3);
}
.field select:hover,
.field textarea:hover,
.field input:hover,
.copy-btn:hover {
  border-color: var(--ink);
}
/* keep timeline text above the shaded overlap band */
.tracks-overlap {
  z-index: 0;
}
.tracks-axis,
.track {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   DARK LANDING THEME (v2)
   ========================================================================== */

/* ---- global dark adjustments ---------------------------------------- */
.display,
h2.display {
  font-weight: 600;
  letter-spacing: -0.035em;
}
.btn {
  border-radius: 999px;
  border-color: transparent;
}
.nav-list .nav-cta {
  border-radius: 999px;
  padding-inline: 1.1rem;
}
.site-header {
  border-bottom-color: var(--rule);
}
.copy-btn {
  border-color: var(--control);
  border-radius: 999px;
}
.accent {
  color: var(--signal);
}

/* ---- hero ----------------------------------------------------------- */
.lp-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100svh - var(--header));
  padding-block: clamp(3rem, 8vh, 6rem);
  overflow: hidden;
}
.lp-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 70% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 70% at 70% 40%, #000 20%, transparent 75%);
  opacity: 0.55;
}
.lp-hero::after {
  content: "";
  position: absolute;
  width: 760px;
  height: 760px;
  right: -160px;
  top: -120px;
  background: radial-gradient(circle, var(--glow), transparent 62%);
  pointer-events: none;
}
.lp-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper-2);
  font-size: var(--fs-small);
  color: var(--ink-2);
}
.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-tint);
}
.lp-title {
  margin-top: var(--s-6);
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(3rem, 1.5rem + 5.8vw, 6.75rem);
  line-height: 0.94;
  letter-spacing: -0.048em;
  text-wrap: balance;
}
.lp-sub {
  margin-top: var(--s-6);
  max-width: 34em;
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink-2);
}
.lp-hero .actions {
  margin-top: var(--s-7);
  gap: var(--s-3);
}
.btn-accent {
  background: var(--signal);
  color: #160803;
}
.btn-accent:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn.btn-ghost:hover {
  background: var(--paper-3);
  border-color: var(--ink-3);
  color: var(--ink);
}
.btn-lg {
  min-height: 3.75rem;
  padding: 1rem 1.6rem;
  font-size: 1.0625rem;
}
.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: var(--s-7);
  font-size: var(--fs-small);
  color: var(--ink-2);
}
.hero-proof li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.hero-proof .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  color: var(--signal);
}

/* product-shot style widget around the case field */
.widget {
  position: relative;
  background: linear-gradient(180deg, var(--paper-3), var(--paper-2));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 50px 120px -50px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.widget-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--rule);
}
.widget-dots {
  display: flex;
  gap: 6px;
}
.widget-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface-4);
}
.widget-body {
  padding: var(--s-5);
}
.widget .instrument-count {
  font-weight: 650;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.widget-caption {
  padding: 0 var(--s-5) var(--s-5);
  font-size: var(--fs-small);
  color: var(--ink-3);
  line-height: 1.5;
}
.segmented {
  border-color: var(--line-strong);
  border-radius: 999px;
}
.segmented label {
  border-radius: 999px;
}
.legend i {
  background: var(--signal);
}
.legend i.sig {
  background: var(--ink);
}

/* ---- organisations strip -------------------------------------------- */
.strip {
  padding-block: var(--s-6);
  border-block: 1px solid var(--rule);
  background: var(--paper);
}
.strip .wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-7);
}
.strip-label {
  flex: none;
}
.strip-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) clamp(1.5rem, 3.5vw, 3.25rem);
}
.strip-list li {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.05rem, 0.9rem + 0.55vw, 1.35rem);
  letter-spacing: -0.02em;
  color: var(--ink-3);
  transition: color var(--t-fast) var(--ease);
}
.strip-list li:hover {
  color: var(--ink);
}

/* ---- stats ---------------------------------------------------------- */
.lp-stats {
  padding-top: clamp(4rem, 3rem + 4vw, 7rem);
}
.stats-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat {
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
.stat + .stat {
  border-left: 1px solid var(--rule);
}
.stat-num {
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(2.5rem, 1.5rem + 3.2vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.stat:first-child .stat-num {
  color: var(--signal);
}
.stat-label {
  margin-top: 0.7rem;
  font-size: var(--fs-small);
  color: var(--ink-2);
}

/* ---- section scaffolding ------------------------------------------- */
.lp-sec {
  padding-block: clamp(5rem, 3rem + 7vw, 9rem) 0;
}
.lp-cta-sec {
  padding-bottom: clamp(5rem, 3rem + 7vw, 9rem);
}
.lp-head {
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
}
.lp-head-row {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: var(--s-5) var(--s-8);
}
.lp-head-row .lp-lede {
  max-width: 28rem;
  margin-top: 0;
}
.lp-head-center {
  text-align: center;
  margin-inline: auto;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: var(--s-4);
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}
.lp-h2 {
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(2.25rem, 1.4rem + 3.3vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.muted-h {
  color: var(--ink-3);
}
.lp-lede {
  margin-top: var(--s-5);
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---- services ------------------------------------------------------- */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
}
.svc,
.work-card {
  position: relative;
  isolation: isolate;
}
.svc::before,
.work-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--glow), transparent 45%);
  opacity: 0;
  transition: opacity var(--t-mid) var(--ease);
  pointer-events: none;
}
.svc:hover::before,
.work-card:hover::before {
  opacity: 1;
}
.svc {
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  transition: border-color var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.svc:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
}
.svc-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--s-6);
  border-radius: 12px;
  background: var(--signal-tint);
  color: var(--signal);
}
.svc h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: var(--s-3);
}
.svc > p {
  color: var(--ink-2);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: var(--s-5) var(--s-6);
}
.chips li {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.svc .svc-proof {
  margin-top: auto;
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
  font-size: var(--fs-small);
  color: var(--ink-3);
}
.svc-proof strong {
  margin-right: 0.3rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* ---- work cards ----------------------------------------------------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}
.work-card {
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.work-card.work-wide {
  grid-column: span 7;
}
.work-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
}
.work-art {
  position: relative;
  aspect-ratio: 600 / 340;
  background: radial-gradient(120% 90% at 50% 0%, var(--paper-3), var(--paper-2));
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.work-art svg {
  width: 100%;
  height: 100%;
  transition: transform 900ms var(--ease);
}
.work-card:hover .work-art svg {
  transform: scale(1.035);
}
.work-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(1.25rem, 2vw, 2rem);
}
.work-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.work-card h3 {
  margin: var(--s-4) 0 var(--s-3);
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.work-body > p:not(.work-meta) {
  color: var(--ink-2);
  max-width: 36em;
}
.work-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: var(--s-6);
}
.metric {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--signal-tint);
  font-size: var(--fs-small);
  color: var(--ink-2);
}
.metric strong {
  font-family: var(--serif);
  font-weight: 650;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--signal);
}
.work-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  font-size: var(--fs-small);
}
.work-link .icon-arrow {
  transition: transform var(--t-mid) var(--ease);
}
.work-card:hover .work-link .icon-arrow {
  transform: translateX(4px);
}
.art-note {
  margin-top: var(--s-5);
  font-size: var(--fs-small);
  color: var(--ink-3);
}

/* artwork primitives */
.art-on { fill: #353c44; }
.art-off { fill: #1b1f24; }
.art-sig { fill: var(--signal); }
.art-scan { fill: var(--signal); opacity: 0.85; }
.art-dot { fill: #4a525b; transition: fill 600ms var(--ease); }
.work-card:hover .art-dot { fill: #8a929b; }
.art-stage, .art-node, .art-lead { fill: var(--signal); }
.art-line { fill: none; stroke: #4a525b; stroke-width: 1.5; }
.art-panel { fill: var(--paper-2); stroke: var(--line-strong); }
.art-row { fill: var(--surface-4); }
.art-row-sig { fill: var(--signal-tint); stroke: var(--signal); }
.art-text { font-family: var(--sans); font-size: 15px; font-weight: 500; fill: var(--ink); }
.art-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; fill: var(--ink-3); }
.art-label-sig { fill: var(--signal); }
.art-label-dark { fill: #160803; font-weight: 500; }
.art-die path { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.art-fold { fill: none; stroke: var(--ink-3); stroke-dasharray: 3 4; }

/* ---- process flow --------------------------------------------------- */
.flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
}
.flow::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 28px;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, var(--signal), var(--line-strong) 60%);
}
.flow-step {
  position: relative;
  padding-right: var(--s-4);
}
.flow-num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--s-5);
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--signal);
}
.flow-step:first-child .flow-num {
  background: var(--signal);
  border-color: var(--signal);
  color: #160803;
}
.flow h3 {
  margin-bottom: var(--s-2);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: -0.03em;
}
.flow p {
  font-size: var(--fs-small);
  color: var(--ink-2);
}

/* ---- leadership ----------------------------------------------------- */
.lead-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}
.lead-copy .link-arrow {
  margin-top: var(--s-6);
}
.lead-list li {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: var(--s-5);
  align-items: center;
  padding-block: var(--s-6);
  border-top: 1px solid var(--rule);
}
.lead-list li:last-child {
  border-bottom: 1px solid var(--rule);
}
.lead-list strong {
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(2.5rem, 2rem + 2vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--signal);
}
.lead-list span {
  color: var(--ink-2);
}
.lead-list b {
  font-weight: 600;
  color: var(--ink);
}

/* ---- tools marquee -------------------------------------------------- */
.marquee {
  margin-top: clamp(5rem, 3rem + 7vw, 9rem);
  padding-block: var(--s-6);
  border-block: 1px solid var(--rule);
  background: var(--paper-2);
  overflow: hidden;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 45s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
.marquee-list {
  display: flex;
  flex-shrink: 0;
}
.marquee-list li {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
  padding-right: clamp(1.25rem, 2.5vw, 2.5rem);
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.5rem);
  letter-spacing: -0.035em;
  color: var(--ink-3);
  white-space: nowrap;
}
.marquee-list li::after {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--signal);
  transform: rotate(45deg);
}
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---- CTA ------------------------------------------------------------ */
.cta-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 2rem + 5vw, 7rem) clamp(1.5rem, 5vw, 5rem);
  text-align: center;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
}
.cta-glow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -70%;
  height: 130%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 107, 61, 0.22), transparent 70%);
  pointer-events: none;
}
.cta-panel > :not(.cta-glow) {
  position: relative;
}
.cta-title {
  max-width: 14ch;
  margin-inline: auto;
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(2.5rem, 1.3rem + 4.8vw, 5.75rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  text-wrap: balance;
}
.cta-panel .lp-lede {
  max-width: 36rem;
  margin-inline: auto;
}
.cta-actions {
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-7);
}
.cta-actions .copy-btn {
  min-height: 3.75rem;
  padding: 0 1.4rem;
  font-size: var(--fs-label);
}
.cta-actions .btn-lg {
  word-break: break-all;
}
.cta-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin-top: var(--s-6);
  font-size: var(--fs-small);
  color: var(--ink-3);
}
.lp-footer {
  border-top-color: var(--rule);
}

/* ---- inner pages on dark ------------------------------------------- */
.diagram {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.diagram .crop {
  display: none;
}
.dg-box { fill: var(--paper-3); stroke: var(--control); }
.dg-box-fill { fill: var(--surface-4); stroke: var(--line-strong); }
.dg-t-inv { fill: var(--ink); }
.dg-box-sig { fill: var(--paper-3); }
.dg-box-soft { fill: var(--surface-4); }
.dg-line { stroke: var(--ink-3); }
.dg-arrowhead { fill: var(--ink-3); }
.dg-arrowhead-sig { fill: var(--signal); }
.reflection,
.checkpoint {
  border-radius: var(--radius-lg);
  border: 1px solid var(--rule);
}
.record {
  border-top-color: var(--line-strong);
}
.process li::before {
  border-radius: 50%;
}
.next-case .display {
  font-weight: 650;
}
.page-hero h1 {
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

/* ---- responsive ----------------------------------------------------- */
@media (max-width: 1020px) {
  .lp-hero {
    min-height: auto;
  }
  .lp-hero-grid {
    grid-template-columns: 1fr;
  }
  .widget {
    max-width: 560px;
  }
  .svc-grid {
    grid-template-columns: 1fr;
  }
  .work-card,
  .work-card.work-wide {
    grid-column: 1 / -1;
  }
  .flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--s-7);
  }
  .flow::before {
    display: none;
  }
  .lead-split {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .stats-panel {
    grid-template-columns: 1fr 1fr;
  }
  .stat:nth-child(3) {
    border-left: 0;
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--rule);
  }
  .flow {
    grid-template-columns: 1fr;
  }
  .lead-list li {
    grid-template-columns: 4.75rem minmax(0, 1fr);
    gap: var(--s-4);
  }
  .work-meta {
    flex-direction: column;
    gap: 0.2rem;
  }
  .strip .wrap {
    gap: var(--s-3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none !important;
    width: auto;
  }
  .marquee-list[aria-hidden="true"] {
    display: none;
  }
  .marquee-list {
    flex-wrap: wrap;
    flex-shrink: 1;
    padding-inline: var(--margin);
  }
  .svc:hover,
  .work-card:hover {
    transform: none;
  }
}
/* v2 refinements */
.lp-hero {
  min-height: min(calc(100svh - var(--header)), 940px);
}
.lp-title {
  letter-spacing: -0.032em;
  line-height: 0.96;
}
.lp-h2,
.cta-title,
.stat-num,
.lead-list strong {
  letter-spacing: -0.03em;
}
.svc h3,
.work-card h3,
.flow h3,
.strip-list li,
.marquee-list li {
  letter-spacing: -0.015em;
}
.case-sec > h2,
.chapter-text h3,
.decisions dt,
.next-case .display,
.page-hero h1,
h2.display,
.fact .fact-num,
.fact .fact-word,
.compose-title {
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* ==========================================================================
   v3 — BACKEND DEVELOPER COMPONENTS
   ========================================================================== */
:root {
  --code-key: #ff9a6b;
  --code-str: #b9d98f;
  --code-num: #8cc8ff;
}
.brand {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.9375rem;
  gap: 0;
}
.brand-prompt {
  color: var(--signal);
}
.dev .lp-title {
  font-size: clamp(2.8rem, 1.4rem + 5.2vw, 6rem);
}
.stack-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--s-7);
}
.stack-inline li {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}

/* ---- editor / API response ----------------------------------------- */
.editor,
.terminal {
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 50px 120px -50px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.editor-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-3);
}
.editor-tab {
  font-family: var(--mono);
  font-size: var(--fs-label);
  color: var(--ink-2);
}
.editor-req {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.8125rem;
  min-width: 0;
}
.http-verb {
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: rgba(140, 200, 255, 0.12);
  color: var(--code-num);
  font-weight: 500;
}
.http-path {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.http-status {
  margin-left: auto;
  color: var(--code-str);
  white-space: nowrap;
}
.http-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--code-str);
  vertical-align: 1px;
}
.code {
  margin: 0;
  padding: 1.25rem 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: clamp(0.75rem, 0.68rem + 0.25vw, 0.9rem);
  line-height: 1.85;
  color: var(--ink-3);
  overflow-x: auto;
  counter-reset: line;
}
.code .ln {
  display: inline;
}
.code .k { color: var(--code-key); }
.code .s { color: var(--code-str); }
.code .n { color: var(--code-num); }
.js .code .ln {
  opacity: 0;
}
.js.is-loaded .code .ln {
  opacity: 1;
  transition: opacity 300ms var(--ease);
  transition-delay: calc(var(--l, 0) * 70ms + 500ms);
}
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 0.2em;
  vertical-align: -0.2em;
  background: var(--signal);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ---- modules (what I build) ---------------------------------------- */
.modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
}
.module {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.module:hover {
  border-color: var(--signal);
  transform: translateY(-3px);
}
.module-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-3);
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.module-path {
  color: var(--ink);
}
.module-path .dim {
  color: var(--ink-3);
}
.module-path::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 9px;
  margin-right: 0.6rem;
  border: 1.5px solid var(--signal);
  border-radius: 2px;
  vertical-align: 0;
}
.module-lang {
  color: var(--ink-3);
  font-size: var(--fs-label);
}
.module-body {
  padding: clamp(1.25rem, 2.5vw, 2rem);
}
.module h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-3);
}
.module-body > p:not(.module-kv) {
  color: var(--ink-2);
}
.module-kv {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px dashed var(--line-strong);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.module-kv .k {
  color: var(--code-key);
  margin-right: 0.6rem;
}
.module-kv .k::after {
  content: ":";
  color: var(--ink-3);
}

/* ---- project explorer (tabs) --------------------------------------- */
.explorer {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.explorer-list {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  gap: 0.25rem;
  border-right: 1px solid var(--rule);
  background: var(--paper-3);
}
.explorer-tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.explorer-tab:hover {
  background: var(--paper-2);
  color: var(--ink);
}
.explorer-tab[aria-selected="true"] {
  background: var(--paper);
  border-color: var(--line-strong);
  color: var(--ink);
}
.tab-idx {
  color: var(--ink-3);
}
.explorer-tab[aria-selected="true"] .tab-idx {
  color: var(--signal);
}
.tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tab-type {
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: var(--surface-4);
  font-size: 0.6875rem;
  color: var(--ink-2);
}
.explorer-panels {
  min-width: 0;
}
.explorer-panel {
  padding: clamp(1.5rem, 3vw, 2.75rem);
}
.js .explorer-panel[hidden] {
  display: none;
}
html:not(.js) .explorer-panel + .explorer-panel {
  border-top: 1px solid var(--rule);
}
.js .explorer-panel:not([hidden]) {
  animation: panel-in 380ms var(--ease);
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
}
.panel-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.explorer-panel h3 {
  margin: var(--s-4) 0 var(--s-3);
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.panel-desc {
  max-width: 40em;
  color: var(--ink-2);
}
.panel-points {
  margin-top: var(--s-5);
  display: grid;
  gap: 0.6rem;
}
.panel-points li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--ink-2);
}
.panel-points li::before {
  content: "›";
  position: absolute;
  left: 0.2rem;
  color: var(--signal);
  font-family: var(--mono);
}
.panel-points code,
.prose code {
  padding: 0.05rem 0.4rem;
  border-radius: 5px;
  background: var(--surface-4);
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--code-key);
}
.panel-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--s-6);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
}
.panel-stats > div {
  padding: var(--s-4) var(--s-5);
}
.panel-stats > div + div {
  border-left: 1px solid var(--rule);
}
.panel-stats strong {
  display: block;
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.25rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.panel-stats > div:first-child strong {
  color: var(--signal);
}
.panel-stats span {
  display: block;
  margin-top: 0.4rem;
  font-size: var(--fs-small);
  color: var(--ink-3);
}
.panel-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-6);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tags li {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--signal-tint);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--code-key);
}

/* ---- git log principles -------------------------------------------- */
.principles-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.principles-split .lp-head {
  position: sticky;
  top: calc(var(--header) + 2rem);
}
.gitlog {
  position: relative;
}
.gitlog::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.9rem;
  bottom: 0.9rem;
  width: 2px;
  background: linear-gradient(var(--signal), var(--line-strong));
}
.commit {
  position: relative;
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: var(--s-4);
  padding: var(--s-5) 0 var(--s-5) 2.25rem;
  border-bottom: 1px solid var(--rule);
}
.commit:last-child {
  border-bottom: 0;
}
.commit::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--s-5) + 0.35rem);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--signal);
}
.commit:first-child::before {
  background: var(--signal);
}
.commit-hash {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--code-num);
  padding-top: 0.15rem;
}
.commit-msg {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ink);
}
.ctype {
  color: var(--code-key);
}
.commit-body {
  margin-top: 0.4rem;
  color: var(--ink-2);
  font-size: var(--fs-small);
}

/* ---- contact terminal ---------------------------------------------- */
.contact-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.terminal-body {
  padding: 1.5rem 1.5rem 1.75rem;
  font-family: var(--mono);
  font-size: 0.875rem;
}
.term-line {
  color: var(--ink);
}
.prompt {
  color: var(--code-str);
  margin-right: 0.4rem;
}
.term-dl {
  margin: 1rem 0 1.25rem;
  display: grid;
  gap: 0.6rem;
}
.term-dl > div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
}
.term-dl dt {
  color: var(--code-key);
}
.term-dl dd {
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  min-width: 0;
}
.term-dl a {
  color: var(--ink);
  word-break: break-all;
}
.terminal .copy-btn {
  padding: 0.15rem 0.6rem;
  font-size: 0.6875rem;
}

/* ---- responsive ---------------------------------------------------- */
@media (max-width: 1020px) {
  .modules {
    grid-template-columns: 1fr;
  }
  .explorer {
    grid-template-columns: 1fr;
  }
  .explorer-list {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .explorer-tab {
    flex: none;
    width: auto;
    grid-template-columns: auto auto;
  }
  .explorer-tab .tab-type {
    display: none;
  }
  .principles-split,
  .contact-split {
    grid-template-columns: 1fr;
  }
  .principles-split .lp-head {
    position: static;
  }
}
@media (max-width: 560px) {
  .panel-stats {
    grid-template-columns: 1fr;
  }
  .panel-stats > div + div {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
  .commit {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .term-dl > div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
  .editor-req .http-status {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .caret {
    animation: none;
  }
  .js .code .ln {
    opacity: 1;
  }
}
.dev .lp-title { letter-spacing: -0.022em; }
.dev .lp-h2 { letter-spacing: -0.018em; }

/* ---- career timeline ----------------------------------------------- */
.career-split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.career-head {
  position: sticky;
  top: calc(var(--header) + 2rem);
}
.career-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--s-6);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
}
.career-summary > div {
  padding: var(--s-4) var(--s-4);
  background: var(--paper-2);
}
.career-summary > div + div {
  border-left: 1px solid var(--rule);
}
.career-summary dt {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.career-summary dd {
  margin-top: 0.35rem;
  font-family: var(--serif);
  font-weight: 650;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.career {
  --date-col: 8.5rem;
  --rail: calc(var(--date-col) + 1.25rem);
  position: relative;
}
.career::before {
  content: "";
  position: absolute;
  left: var(--rail);
  top: 1.75rem;
  bottom: 1.75rem;
  width: 1px;
  background: linear-gradient(var(--signal), var(--line-strong) 45%, var(--rule));
}
.job {
  position: relative;
  display: grid;
  grid-template-columns: var(--date-col) minmax(0, 1fr);
  column-gap: 2.5rem;
  padding-bottom: var(--s-5);
}
.job::before {
  content: "";
  position: absolute;
  left: calc(var(--rail) - 5px);
  top: 1.55rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line-strong);
}
.job:has(.badge-live)::before {
  background: var(--signal);
  border-color: var(--signal);
  box-shadow: 0 0 0 5px var(--signal-tint);
}
.job.job-feature-row::before,
.job:has(.job-feature)::before {
  border-color: var(--signal);
}
.job-when {
  padding-top: 1.3rem;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-3);
}
.job-card {
  padding: clamp(1.25rem, 2vw, 1.75rem);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  transition: border-color var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.job-card:hover {
  border-color: var(--line-strong);
  transform: translateX(4px);
}
.job-feature {
  border-color: rgba(255, 107, 61, 0.45);
  background: linear-gradient(135deg, rgba(255, 107, 61, 0.07), var(--paper-2) 55%);
}
.job-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.6rem;
}
.job-top h3 {
  margin-right: 0.25rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.45rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  color: var(--ink-2);
}
.badge-live {
  border-color: transparent;
  background: rgba(185, 217, 143, 0.1);
  color: var(--code-str);
}
.badge-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.job-org {
  margin-top: 0.3rem;
  font-weight: 500;
  color: var(--ink-2);
}
.job-points {
  display: grid;
  gap: 0.45rem;
  margin-top: var(--s-4);
}
.job-points li {
  position: relative;
  padding-left: 1.4rem;
  font-size: var(--fs-small);
  color: var(--ink-2);
}
.job-points li::before {
  content: "›";
  position: absolute;
  left: 0.2rem;
  font-family: var(--mono);
  color: var(--signal);
}
.job-card .tags {
  margin-top: var(--s-4);
}
.job-edu .job-card {
  background: transparent;
  border-style: dashed;
  padding-block: 1.1rem;
}
@media (max-width: 1020px) {
  .career-split {
    grid-template-columns: 1fr;
  }
  .career-head {
    position: static;
  }
}
@media (max-width: 640px) {
  .career {
    --rail: 5px;
  }
  .career::before {
    top: 0.5rem;
  }
  .job {
    grid-template-columns: 1fr;
    padding-left: 1.75rem;
  }
  .job::before {
    top: 0.3rem;
  }
  .job-when {
    padding: 0 0 0.5rem;
    text-align: left;
  }
  .job-card:hover {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .job-card:hover {
    transform: none;
  }
}
.career { --date-col: 9.75rem; }
.job-when { white-space: nowrap; font-size: 0.78rem; }
@media (max-width: 640px) { .career { --date-col: 100%; } }

/* ==========================================================================
   v4 — APPS & WEBSITES SHOWCASE · SKILLS & LANGUAGES
   ========================================================================== */

/* ---- showcase ------------------------------------------------------- */
.showcase {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.show {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(1.25rem, 3vw, 2.75rem);
  background: radial-gradient(120% 120% at 0% 0%, rgba(255, 107, 61, 0.08), transparent 45%), var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
}
.show-flip {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  background: radial-gradient(120% 120% at 100% 0%, rgba(140, 200, 255, 0.08), transparent 45%), var(--paper-2);
}
.show-flip .show-visual {
  order: 2;
}
.show-visual {
  position: relative;
  perspective: 1400px;
}
.show-visual::before {
  content: "";
  position: absolute;
  inset: 12% 8% -6%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 107, 61, 0.22), transparent);
  filter: blur(30px);
}
.show-flip .show-visual::before {
  background: radial-gradient(closest-side, rgba(140, 200, 255, 0.18), transparent);
}
.browser {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transform: rotateY(5deg) rotateX(2deg);
  transform-origin: left center;
  transition: transform 700ms var(--ease);
}
.show-flip .browser {
  transform: rotateY(-5deg) rotateX(2deg);
  transform-origin: right center;
}
.show:hover .browser {
  transform: none;
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule);
}
.browser-bar .widget-dots i:nth-child(1) { background: #ff6b3d; opacity: 0.8; }
.browser-bar .widget-dots i:nth-child(2) { background: #e8b44c; opacity: 0.7; }
.browser-bar .widget-dots i:nth-child(3) { background: #b9d98f; opacity: 0.7; }
.browser-url {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  max-width: 22rem;
  margin-inline: auto;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
}
.browser-url .icon {
  width: 12px;
  height: 12px;
  flex: none;
  color: var(--code-str);
}
.browser-body {
  aspect-ratio: 16 / 10;
}
.show-badge {
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(11, 13, 15, 0.8);
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* mock UI primitives (illustrative, not screenshots) */
.app-admin {
  display: grid;
  grid-template-columns: 30% 1fr;
}
.ui-side {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--rule);
  background: var(--paper-2);
}
.ui-logo {
  width: 42%;
  height: 0.7rem;
  margin: 0 0 0.8rem 0.4rem;
  border-radius: 4px;
  background: var(--signal);
}
.ui-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.5rem;
  border-radius: 7px;
  font-family: var(--sans);
  font-size: clamp(0.55rem, 0.45rem + 0.3vw, 0.75rem);
  color: var(--ink-3);
  white-space: nowrap;
}
.ui-nav i {
  width: 0.6rem;
  height: 0.6rem;
  flex: none;
  border-radius: 3px;
  background: var(--surface-4);
}
.ui-nav.is-on {
  background: var(--signal-tint);
  color: var(--ink);
}
.ui-nav.is-on i {
  background: var(--signal);
}
.ui-main {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.1rem;
}
.ui-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
.ui-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(0.75rem, 0.6rem + 0.5vw, 1.05rem);
}
.ui-btn {
  width: 18%;
  height: 0.95rem;
  border-radius: 999px;
  background: var(--signal);
}
.ui-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper-2);
}
.ui-avatar {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  border-radius: 50%;
  background: var(--surface-4);
}
.ui-line {
  display: block;
  height: 0.42rem;
  border-radius: 99px;
  background: #2c3238;
}
.w35 { width: 35%; } .w40 { width: 40%; } .w45 { width: 45%; } .w50 { width: 50%; }
.w55 { width: 55%; } .w60 { width: 60%; } .w70 { width: 70%; }
.ui-pill {
  width: 2.6rem;
  height: 0.75rem;
  margin-left: auto;
  border-radius: 99px;
}
.p-orange { background: rgba(255, 107, 61, 0.35); }
.p-blue { background: rgba(140, 200, 255, 0.3); }
.p-green { background: rgba(185, 217, 143, 0.3); }

.app-dash {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
}
.ui-tabs {
  display: flex;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: clamp(0.55rem, 0.45rem + 0.3vw, 0.72rem);
  color: var(--ink-3);
}
.ui-tabs span {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
}
.ui-tabs .is-on {
  background: rgba(140, 200, 255, 0.14);
  border-color: transparent;
  color: var(--code-num);
}
.ui-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
.ui-kpis > div {
  display: grid;
  gap: 0.5rem;
  padding: 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper-2);
}
.ui-kpi {
  display: block;
  width: 65%;
  height: 0.95rem;
  border-radius: 5px;
  background: var(--ink-2);
  opacity: 0.85;
}
.ui-kpis > div:first-child .ui-kpi {
  background: var(--code-num);
}
.ui-chart {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 4%;
  padding: 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: repeating-linear-gradient(to top, transparent 0 24%, var(--rule) 24% calc(24% + 1px)), var(--paper-2);
}
.ui-chart i {
  flex: 1;
  height: var(--h);
  border-radius: 3px 3px 0 0;
  background: linear-gradient(to top, rgba(140, 200, 255, 0.25), var(--code-num));
  transform-origin: bottom;
  transition: transform 700ms var(--ease);
}
.js .show:not(.is-in) .ui-chart i {
  transform: scaleY(0.2);
}
.ui-chart i:nth-child(n) {
  transition-delay: calc(var(--n, 0) * 40ms);
}

/* info column */
.show-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.show-kicker li {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-2);
}
.show-kicker li:first-child {
  border-color: transparent;
  background: var(--signal-tint);
  color: var(--code-key);
}
.show-flip .show-kicker li:first-child {
  background: rgba(140, 200, 255, 0.12);
  color: var(--code-num);
}
.show-info h3 {
  margin: var(--s-4) 0 var(--s-3);
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.75rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.show-desc {
  color: var(--ink-2);
}
.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1rem;
  margin-top: var(--s-5);
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--fs-small);
  color: var(--ink);
}
.feature-list li::before {
  content: "";
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--signal-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6b3d' stroke-width='3'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 70% no-repeat;
}
.spec {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--s-6);
  border-top: 1px solid var(--rule);
}
.spec > div {
  padding-top: var(--s-4);
}
.spec dt {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.spec dd {
  margin-top: 0.3rem;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink);
}
.show-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-6);
}

/* career case links */
.job-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--s-4);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.job-link .icon-arrow {
  width: 16px;
  height: 16px;
  color: var(--signal);
  transition: transform var(--t-mid) var(--ease);
}
.job-link:hover .icon-arrow {
  transform: translateX(4px);
}
.job-card .tags + .job-link {
  margin-left: 0;
}

/* ---- skills --------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}
.sk-card {
  grid-column: span 3;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  transition: border-color var(--t-mid) var(--ease);
}
.sk-card:hover {
  border-color: var(--line-strong);
}
.sk-core {
  grid-column: span 8;
  background: radial-gradient(90% 120% at 0% 0%, rgba(255, 107, 61, 0.09), transparent 55%), var(--paper-2);
}
.sk-langs {
  grid-column: span 4;
}
.sk-label {
  margin-bottom: var(--s-5);
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tech-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.tech-tiles li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.85rem;
  align-items: center;
  padding: 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper);
  transition: border-color var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.tech-tiles li:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.glyph {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.8rem;
}
.g-orange { background: var(--signal-tint); color: var(--code-key); }
.g-blue { background: rgba(140, 200, 255, 0.12); color: var(--code-num); }
.g-green { background: rgba(185, 217, 143, 0.12); color: var(--code-str); }
.tech-tiles b {
  font-weight: 600;
  line-height: 1.2;
}
.tech-tiles small {
  font-size: 0.78rem;
  color: var(--ink-3);
}
.lang-list {
  display: grid;
  gap: var(--s-5);
}
.lang-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.lang-top b {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
}
.lang-top span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}
.cefr {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.cefr i {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-4);
}
.cefr i.on {
  background: var(--signal);
}
.cefr-scale {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--line-strong);
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--ink-3);
  text-align: center;
}
.sk-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: var(--s-4);
  border-radius: 12px;
  background: var(--signal-tint);
  color: var(--signal);
}
.sk-card h3 {
  margin-bottom: var(--s-4);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip-list li {
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--ink-2);
}

/* ---- responsive ----------------------------------------------------- */
@media (max-width: 1020px) {
  .show,
  .show-flip {
    grid-template-columns: 1fr;
  }
  .show-flip .show-visual {
    order: 0;
  }
  .browser,
  .show-flip .browser {
    transform: none;
  }
  .sk-core,
  .sk-langs {
    grid-column: 1 / -1;
  }
  .sk-card {
    grid-column: span 6;
  }
}
@media (max-width: 640px) {
  .tech-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sk-card {
    grid-column: 1 / -1;
  }
  .spec {
    grid-template-columns: 1fr 1fr;
  }
  .feature-list {
    grid-template-columns: 1fr;
  }
  .app-admin {
    grid-template-columns: 34% 1fr;
  }
}
@media (max-width: 420px) {
  .tech-tiles {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .browser,
  .show-flip .browser {
    transform: none !important;
  }
  .js .show:not(.is-in) .ui-chart i {
    transform: none;
  }
}
.sk-core {
  display: flex;
  flex-direction: column;
}
.core-foot {
  margin-top: auto;
  padding-top: var(--s-5);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.sk-core .tech-tiles {
  margin-bottom: var(--s-5);
}
.core-foot .k {
  color: var(--code-key);
  margin-right: 0.5rem;
}
.core-foot .k::after {
  content: ":";
  color: var(--ink-3);
}
@media (max-width: 420px) {
  .tech-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .tech-tiles li { grid-template-columns: 1fr; row-gap: 0.5rem; padding: 0.75rem; }
  .glyph { grid-row: auto; width: 2.25rem; height: 2.25rem; }
}

/* ==========================================================================
   ROOT NODE SYSTEM — back-to-top control + scrollbar "route"
   Shared language: 14px node radius, 2px route line, signal-orange
   "active connection", the same ease curve, one dark surface.
   ========================================================================== */
:root {
  --route-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --sb-track: var(--paper);
  --sb-route: #1c2025;
  --sb-thumb: #3d444c;
  --sb-node: #6a7077;
}
html.is-scrolling,
html.route-lit {
  --sb-route: rgba(255, 107, 61, 0.28);
  --sb-thumb: #4b535c;
  --sb-node: var(--signal);
}

/* ---- scrollbar: a slim server route with a live node on the thumb -- */
::-webkit-scrollbar {
  width: 14px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background:
    linear-gradient(to right, transparent calc(50% - 1px), var(--sb-route) calc(50% - 1px), var(--sb-route) calc(50% + 1px), transparent calc(50% + 1px)),
    var(--sb-track);
}
::-webkit-scrollbar-track:horizontal {
  background:
    linear-gradient(to bottom, transparent calc(50% - 1px), var(--sb-route) calc(50% - 1px), var(--sb-route) calc(50% + 1px), transparent calc(50% + 1px)),
    var(--paper-2);
}
::-webkit-scrollbar-thumb {
  min-height: 56px;
  border: 4px solid transparent;
  border-radius: 99px;
  /* the leading 12px is the "node": status-lit while the connection is active */
  background:
    linear-gradient(var(--sb-node), var(--sb-node)) top / 100% 12px no-repeat,
    var(--sb-thumb);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:horizontal {
  min-width: 56px;
  background:
    linear-gradient(to right, var(--sb-node), var(--sb-node)) left / 12px 100% no-repeat,
    var(--sb-thumb);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  border-width: 3px;
  --sb-thumb: #5a626b;
  --sb-node: var(--signal);
}
::-webkit-scrollbar-thumb:active {
  --sb-thumb: #6a7077;
  --sb-node: var(--signal);
}
::-webkit-scrollbar-corner {
  background: var(--paper);
}
/* Browsers without ::-webkit-scrollbar (Firefox): native thin scrollbar in
   system colours. Chrome 121+ would ignore the webkit rules above if
   scrollbar-color were set, so it is scoped to those browsers only. */
@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--sb-thumb) var(--sb-track);
  }
  html.is-scrolling,
  html.route-lit {
    scrollbar-color: #8a5a48 var(--sb-track);
  }
}

/* ---- back to top: the root node ------------------------------------ */
.root-node {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  z-index: 45;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: rgba(18, 21, 24, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 14px 34px -14px rgba(0, 0, 0, 0.9);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.94);
  transition: opacity 320ms var(--route-ease), transform 460ms var(--route-ease), box-shadow 260ms var(--route-ease),
    visibility 0s linear 460ms;
}
.root-node.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 320ms var(--route-ease), transform 460ms var(--route-ease), box-shadow 260ms var(--route-ease),
    visibility 0s;
}
.root-node:hover,
.root-node:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 61, 0.55), 0 0 0 5px var(--signal-tint), 0 14px 34px -14px rgba(0, 0, 0, 0.9);
}
.root-node:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}
body.nav-open .root-node {
  opacity: 0;
  visibility: hidden;
}

/* page-position ring traced along the node border, clockwise from 12 o'clock */
.root-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.root-ring-bar {
  fill: none;
  stroke: var(--signal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 120ms linear;
}

/* icon: an upward route terminating at the root line */
.root-icon {
  position: relative;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.root-line {
  stroke: var(--signal);
  stroke-width: 2;
  transition: opacity 260ms var(--route-ease);
}
.root-arrow {
  transition: transform 380ms var(--route-ease);
}
.root-node:hover .root-arrow,
.root-node:focus-visible .root-arrow {
  transform: translateY(-2px);
}
/* while travelling home, the root line pulses once like a handshake */
.root-node.is-routing .root-line {
  animation: root-handshake 700ms var(--route-ease) 1;
}
.root-node.is-routing .root-arrow {
  transform: translateY(-2px);
}
@keyframes root-handshake {
  0% { opacity: 1; }
  35% { opacity: 0.25; }
  100% { opacity: 1; }
}

/* command label: appears beside the node on hover / keyboard focus */
.root-label {
  position: absolute;
  right: calc(100% + 0.6rem);
  top: 50%;
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.7rem;
  border-radius: 8px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(6px, -50%);
  transition: opacity 220ms var(--route-ease), transform 320ms var(--route-ease);
}
.root-prompt {
  margin-right: 0.5em;
  color: var(--code-str);
}
.root-node:hover .root-label,
.root-node:focus-visible .root-label {
  opacity: 1;
  transform: translate(0, -50%);
}

/* the footer link becomes the no-JS fallback; keep the footer clear of the node */
.js .to-top {
  display: none;
}
.site-footer {
  padding-bottom: calc(var(--s-7) + 2.5rem);
}

/* touch / small screens: compact node, no label, no hover choreography */
@media (hover: none), (pointer: coarse) {
  .root-label {
    display: none;
  }
}
@media (max-width: 640px) {
  .root-node {
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(1rem + env(safe-area-inset-bottom));
    width: 2.875rem;
    height: 2.875rem;
    border-radius: 12px;
  }
  .root-icon {
    width: 20px;
    height: 20px;
  }
  .site-footer {
    padding-bottom: calc(var(--s-7) + 3.5rem);
  }
}
@media (prefers-reduced-motion: reduce) {
  .root-node,
  .root-node.is-visible {
    transform: none;
  }
  .root-ring-bar {
    transition: none;
  }
  .root-node.is-routing .root-line {
    animation: none;
  }
}
@media (forced-colors: active) {
  .root-node {
    border: 1px solid ButtonText;
  }
  .root-ring-bar,
  .root-line {
    stroke: Highlight;
  }
}
@media print {
  .root-node {
    display: none !important;
  }
}
.root-icon { width: 26px; height: 26px; stroke-width: 1.9; }
.root-line { stroke-width: 2.2; }
@media (max-width: 640px) { .root-icon { width: 23px; height: 23px; } }

/* ==========================================================================
   LOGOS — tech marks (Simple Icons, brand colours) + organisation badges
   ========================================================================== */
.tech-logo {
  width: 1em;
  height: 1em;
  flex: none;
  fill: var(--brand, currentColor);
}
.stack-inline li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.stack-inline .tech-logo {
  width: 15px;
  height: 15px;
}
.tech-glyph {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--code-str);
}
/* brand-coloured mark on a softly brand-tinted tile */
.glyph-logo {
  background: color-mix(in srgb, var(--paper-3) 82%, white 4%);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.glyph-logo .tech-logo {
  width: 1.45rem;
  height: 1.45rem;
}
/* dark-on-dark brand blues get a lift so the mark stays legible */
.glyph-logo .tech-logo[style*="#3776AB"],
.glyph-logo .tech-logo[style*="#4479A1"],
.stack-inline .tech-logo[style*="#3776AB"],
.stack-inline .tech-logo[style*="#4479A1"] {
  filter: brightness(1.35);
}
.tech-tiles li:hover .glyph-logo {
  box-shadow: inset 0 0 0 1px var(--brand-hover, var(--ink-3));
}

/* ---- organisation badges ------------------------------------------- */
.org-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9px;
  overflow: hidden;
}
/* official logos sit on a light plate so their own colours stay intact */
.org-plate {
  background: #f4f2ec;
  padding: 0.2rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.org-plate img,
.org-plate .org-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.org-plate .org-svg {
  fill: #4285f4;
  padding: 0.2rem;
}
.org-wide {
  width: auto;
  aspect-ratio: 512 / 160;
  padding: 0.25rem 0.45rem;
}
/* no verified official logo yet: neutral initials, clearly not a brand mark */
.org-mono {
  background: var(--paper-3);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

/* strip */
.orgs {
  padding-top: clamp(3rem, 2rem + 3vw, 5rem);
}
.orgs-label {
  margin-bottom: var(--s-5);
  text-align: center;
}
.org-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
.org-strip li {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper-2);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-2);
  transition: border-color var(--t-mid) var(--ease), color var(--t-mid) var(--ease);
}
.org-strip li:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.org-strip .org-badge {
  height: 2.5rem;
}
.org-strip .org-badge:not(.org-wide) {
  width: 2.5rem;
}
.org-strip li:has(.org-wide) {
  padding-right: 0.5rem;
}

/* in career + showcase cards */
.job-org,
.show-org {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.job-org .org-badge {
  width: 2rem;
  height: 2rem;
}
.job-org .org-wide {
  width: auto;
}
.show-org {
  margin: -0.25rem 0 var(--s-4);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-2);
}
.show-org .org-badge {
  width: 1.9rem;
  height: 1.9rem;
}
.credits {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.5;
}
.credits a {
  color: inherit;
}
@media (max-width: 640px) {
  .org-strip {
    justify-content: flex-start;
  }
  .orgs-label {
    text-align: left;
  }
}
/* logo wall: six equal cells, logo above name */
.org-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  overflow: hidden;
}
.org-strip li {
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.85rem;
  padding: 1.5rem 1rem 1.35rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  line-height: 1.35;
}
.org-strip li + li {
  border-left: 1px solid var(--rule);
}
.org-strip li:has(.org-wide) {
  padding-right: 1rem;
}
.org-strip .org-badge {
  height: 3rem;
}
.org-strip .org-badge:not(.org-wide) {
  width: 3rem;
}
.org-strip .org-wide {
  max-width: 100%;
}
.org-strip li:hover {
  background: var(--paper-3);
}
@media (max-width: 1020px) {
  .org-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .org-strip li:nth-child(4) {
    border-left: 0;
  }
  .org-strip li:nth-child(n + 4) {
    border-top: 1px solid var(--rule);
  }
}
@media (max-width: 560px) {
  .org-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .org-strip li:nth-child(n) {
    border-left: 0;
    border-top: 0;
  }
  .org-strip li:nth-child(even) {
    border-left: 1px solid var(--rule);
  }
  .org-strip li:nth-child(n + 3) {
    border-top: 1px solid var(--rule);
  }
}

/* ==========================================================================
   SYSTEM RAIL — the page as a route through a live backend system.
   Root (~/) at the top, exit 0 at the bottom, sections as service nodes,
   the thumb as the active process travelling between them.
   Only on fine pointers (html.has-rail); touch keeps native scrolling.
   ========================================================================== */
html.has-rail {
  scrollbar-width: none;
}
html.has-rail::-webkit-scrollbar {
  display: none;
  width: 0;
}
html.rail-dragging,
html.rail-dragging * {
  user-select: none !important;
  cursor: grabbing !important;
}

.rail {
  --rail-x: 13px;           /* centre line, from the right edge */
  --tw: 6px;                /* thumb width */
  --ok: var(--code-str);
  position: fixed;
  top: calc(var(--header) + 10px);
  bottom: 10px;
  right: 0;
  z-index: 44;
  width: 26px;              /* generous hit area around a 1px route */
  cursor: pointer;
  touch-action: none;
}
html:not(.has-rail) .rail {
  display: none;
}

/* layer 1: the route — hairline, fine ticks, travelled trail */
.rail-track {
  position: absolute;
  top: 22px;
  bottom: 22px;
  right: calc(var(--rail-x) - 0.5px);
  width: 1px;
  background: var(--line-strong);
  pointer-events: none;
}
.rail-ticks {
  position: absolute;
  inset: 0 -2px;
  background: repeating-linear-gradient(to bottom, var(--rule) 0 1px, transparent 1px 18px);
  opacity: 0.9;
  transition: opacity 400ms var(--route-ease), inset 400ms var(--route-ease);
}
.rail-trail {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 107, 61, 0.15), rgba(255, 107, 61, 0.65));
  transform-origin: top;
  transform: scaleY(0);
}

/* caps: root node and endpoint */
.rail-cap {
  position: absolute;
  right: calc(var(--rail-x) - 4px);
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 0.5rem;
  pointer-events: none;
}
.rail-root { top: 6px; }
.rail-end { bottom: 6px; }
.rail-cap i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  transition: background 400ms var(--route-ease), border-color 400ms var(--route-ease), box-shadow 400ms var(--route-ease);
}
.rail-root i { border-color: var(--signal); background: var(--signal-tint); }
.rail-cap b {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 300ms var(--route-ease), transform 300ms var(--route-ease), color 300ms;
}
/* at the top: connected to root */
.rail.is-top .rail-root i {
  background: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-tint);
}
.rail.is-top .rail-root b,
.rail:hover .rail-cap b {
  opacity: 1;
  transform: none;
}
/* at the end: the process exits cleanly */
.rail.is-bottom .rail-end i {
  background: var(--ok);
  border-color: var(--ok);
  box-shadow: 0 0 0 4px rgba(185, 217, 143, 0.14);
}
.rail.is-bottom .rail-end b {
  opacity: 1;
  transform: none;
  color: var(--ok);
}

/* layer 2: section nodes */
.rail-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.rail-mark {
  position: absolute;
  right: 0;
  top: var(--y, 0);
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.55rem;
  height: 18px;
  padding-right: calc(var(--rail-x) - 3.5px);
  transform: translateY(-50%);
  text-decoration: none;
  pointer-events: auto;
}
.rail-mark i {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--control);
  transition: background 360ms var(--route-ease), border-color 360ms var(--route-ease), transform 360ms var(--route-ease),
    box-shadow 360ms var(--route-ease);
}
.rail-mark.is-reached i {
  border-color: var(--signal);
  background: rgba(255, 107, 61, 0.35);
}
.rail-mark.is-current i {
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-tint);
}
/* hover the rail: the route map appears */
.rail-mark:hover i,
.rail-mark:focus-visible i {
  transform: scale(1.45);
  border-color: var(--signal);
}
.rail-mark:focus-visible {
  outline: none;
}

/* layer 3: the thumb — an active process with a layered surface */
.rail-thumb {
  position: absolute;
  top: 0;
  right: calc(var(--rail-x) - var(--tw) / 2);
  width: var(--tw);
  height: var(--th, 44px);
  border-radius: 99px;
  overflow: hidden;
  cursor: grab;
  background:
    radial-gradient(120% 40% at 50% var(--py, 50%), rgba(255, 255, 255, 0.16), transparent 70%),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 4px),
    linear-gradient(to bottom, rgba(255, 107, 61, 0.38), rgba(255, 107, 61, 0.14));
  box-shadow: inset 0 0 0 1px rgba(255, 107, 61, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 18px -6px rgba(0, 0, 0, 0.9);
  transition: width 320ms var(--route-ease), right 320ms var(--route-ease), box-shadow 320ms var(--route-ease),
    background-color 320ms;
  will-change: transform;
}
/* leading edge: a bright terminal line on the side you're travelling toward */
.rail-thumb::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: var(--signal);
  opacity: 0.55;
  transition: opacity 300ms var(--route-ease);
}
.rail.dir-up .rail-thumb::after {
  bottom: auto;
  top: 1px;
}
/* data particles inside the thumb, only while a scroll is in flight */
.rail-flow {
  position: absolute;
  inset: 2px 1px;
  background: radial-gradient(circle, rgba(255, 210, 190, 0.85) 0 0.8px, transparent 1.2px) 50% 0 / 100% 9px repeat-y;
  opacity: 0;
  transition: opacity 260ms var(--route-ease);
}
.rail.is-active .rail-flow {
  opacity: 0.8;
  animation: rail-flow-down 600ms linear infinite;
}
.rail.is-active.dir-up .rail-flow {
  animation-name: rail-flow-up;
}
.rail.is-active .rail-thumb::after {
  opacity: 1;
}
.rail.is-active .rail-ticks {
  inset: 0 -3px;
}
@keyframes rail-flow-down {
  to { background-position: 50% 9px; }
}
@keyframes rail-flow-up {
  to { background-position: 50% -9px; }
}
/* settle: one quiet pulse when the "request" completes */
.rail.is-settling .rail-thumb {
  animation: rail-settle 700ms var(--route-ease) 1;
}
@keyframes rail-settle {
  0% { box-shadow: inset 0 0 0 1px rgba(255, 107, 61, 0.9), 0 0 0 0 rgba(255, 107, 61, 0.35), 0 6px 18px -6px rgba(0, 0, 0, 0.9); }
  100% { box-shadow: inset 0 0 0 1px rgba(255, 107, 61, 0.55), 0 0 0 6px rgba(255, 107, 61, 0), 0 6px 18px -6px rgba(0, 0, 0, 0.9); }
}
/* end of page: the process locks in green */
.rail.is-bottom:not(.is-active) .rail-thumb {
  box-shadow: inset 0 0 0 1px rgba(185, 217, 143, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 18px -6px rgba(0, 0, 0, 0.9);
}
.rail.is-bottom:not(.is-active) .rail-thumb::after {
  background: var(--ok);
}
/* hover: wider, clearer, tactile */
.rail:hover {
  --tw: 10px;
}
.rail:hover .rail-thumb {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 61, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 0 4px rgba(255, 107, 61, 0.08), 0 8px 22px -6px rgba(0, 0, 0, 0.95);
}
.rail:hover .rail-ticks {
  opacity: 1;
  inset: 0 -3px;
}
html.rail-dragging .rail {
  --tw: 10px;
}
/* the back-to-top node lights the route home */
html.route-lit .rail-trail {
  background: linear-gradient(to bottom, rgba(255, 107, 61, 0.55), rgba(255, 107, 61, 0.9));
}
html.route-lit .rail-root i {
  background: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-tint);
}
html.route-lit .rail-root b {
  opacity: 1;
  transform: none;
}

/* status chip: follows the thumb while scrolling */
.rail-status {
  position: absolute;
  top: 0;
  right: 26px;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  background: rgba(18, 21, 24, 0.94);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 8px 20px -8px rgba(0, 0, 0, 0.9);
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--ink-2);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  margin-top: -0.75rem;
  transition: opacity 260ms var(--route-ease);
}
.rail.is-active:not(:hover) .rail-status {
  opacity: 1;
}
.rail.is-top .rail-status,
.rail.is-bottom .rail-status {
  opacity: 0 !important;
}

/* keep the back-to-top node clear of the rail */
html.has-rail .root-node {
  right: 34px;
}

@media (prefers-reduced-motion: reduce) {
  .rail.is-active .rail-flow {
    animation: none;
    opacity: 0.5;
  }
  .rail.is-settling .rail-thumb {
    animation: none;
  }
  .rail-thumb,
  .rail-cap b {
    transition: none;
  }
}
@media print {
  .rail {
    display: none !important;
  }
}
@media (forced-colors: active) {
  .rail-thumb {
    background: Highlight;
  }
  .rail-track {
    background: CanvasText;
  }
}
/* the rail ends just above the back-to-top node, so exit 0 is never covered */
.rail {
  bottom: calc(20px + 3.25rem + 14px);
}

/* ---- rail v2: persistent live path (~/section) ---------------------- */
.rail-root {
  top: 2px;
}
.rail-root i {
  width: 11px;
  height: 11px;
  border-radius: 3.5px;
}
.rail-root .rail-path {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 8px;
  background: rgba(18, 21, 24, 0.9);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 8px 20px -10px rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--ink);
  opacity: 1;
  transform: none;
  transition: box-shadow 400ms var(--route-ease);
}
.path-home {
  color: var(--signal);
  font-weight: 500;
}
.path-seg {
  position: relative;
  display: inline-grid;
  width: 0;
  overflow: hidden;
  transition: width 460ms var(--route-ease);
}
.path-seg .seg {
  grid-area: 1 / 1;
  white-space: nowrap;
  transition: transform 460ms var(--route-ease), opacity 360ms var(--route-ease), filter 460ms var(--route-ease);
}
.path-seg .from-below { transform: translateY(105%); opacity: 0; filter: blur(2px); }
.path-seg .from-above { transform: translateY(-105%); opacity: 0; filter: blur(2px); }
.path-seg .to-above { transform: translateY(-105%); opacity: 0; filter: blur(2px); }
.path-seg .to-below { transform: translateY(105%); opacity: 0; filter: blur(2px); }
/* while a scroll is in flight the path reads as "live" */
.rail.is-active .rail-path {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 61, 0.45), 0 0 0 4px rgba(255, 107, 61, 0.06), 0 8px 20px -10px rgba(0, 0, 0, 0.9);
}
.rail.is-bottom .rail-path {
  box-shadow: inset 0 0 0 1px rgba(185, 217, 143, 0.4), 0 8px 20px -10px rgba(0, 0, 0, 0.9);
}

/* while scrolling, the other stops surface along the route, then fade */
/* the root stop is already represented by the ~/ path */
.rail-status {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .path-seg,
  .path-seg .seg {
    transition: none;
  }
}

/* ---- rail v3: quiet route, one rotated label at a time -------------- */
/* Labels sit left of the rail, turned -90deg so the text's bottom edge
   faces the rail. Hidden by default; revealed by pointer proximity,
   hover / keyboard focus, or the thumb passing a stop while scrolling. */
.rail-mark span {
  position: absolute;
  top: 50%;
  right: calc(var(--rail-x) + 19px);
  padding: 0.24rem 0.55rem;
  border-radius: 6px;
  background: rgba(18, 21, 24, 0.94);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 6px 16px -8px rgba(0, 0, 0, 0.9);
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  /* centred on the node; slide in toward the rail (local -y = away) */
  transform: translate(50%, -50%) rotate(-90deg) translateY(-6px);
  transition: opacity 240ms var(--route-ease), transform 380ms var(--route-ease), color 200ms, box-shadow 200ms;
}
.rail-mark.is-pointer span,
.rail-mark:hover span,
.rail-mark:focus-visible span,
.rail.is-active .rail-mark.is-near span {
  opacity: 1;
  pointer-events: auto;
  transform: translate(50%, -50%) rotate(-90deg) translateY(0);
}
.rail-mark.is-current span {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 61, 0.55), 0 6px 16px -8px rgba(0, 0, 0, 0.9);
}
.rail-mark:hover span,
.rail-mark:focus-visible span {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 61, 0.8), 0 0 0 3px rgba(255, 107, 61, 0.08);
}
.rail-mark:focus-visible span {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}
/* the root stop is represented by the ~/ path chip */
.rail-marks li:first-child .rail-mark span {
  display: none;
}
/* the node itself answers to proximity too */
.rail-mark.is-pointer i,
.rail.is-active .rail-mark.is-near i {
  transform: scale(1.35);
  border-color: var(--signal);
}
/* compact root indicator */
.rail-root .rail-path {
  padding: 0.22rem 0.5rem;
  font-size: 0.78rem;
}
@media (prefers-reduced-motion: reduce) {
  .rail-mark span {
    transition: opacity 120ms linear;
  }
}

/* ---- path transition v3: shell-style backspace + retype ------------- */
.rail-root .path-seg {
  display: inline-flex;
  width: auto !important;
  overflow: visible;
  transition: none;
}
.path-seg .ch {
  display: inline-block;
  animation: path-type 520ms var(--route-ease) both;
}
/* fresh output arrives warm, then cools to the resting colour */
@keyframes path-type {
  0% { opacity: 0; transform: translateY(2px); color: var(--signal); }
  35% { opacity: 1; transform: none; color: #ffb08f; }
  100% { opacity: 1; transform: none; color: var(--ink); }
}
.path-caret {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 2px;
  border-radius: 1px;
  background: var(--signal);
  opacity: 0;
  transform: scaleY(0.6);
  transition: opacity 200ms var(--route-ease), transform 200ms var(--route-ease);
}
.rail.is-typing .path-caret {
  opacity: 1;
  transform: none;
}
/* once typing finishes, the caret blinks twice while it fades out */
.rail:not(.is-typing) .path-caret {
  transition: opacity 600ms var(--route-ease) 150ms, transform 300ms var(--route-ease);
}
@media (prefers-reduced-motion: reduce) {
  .path-seg .ch {
    animation: none;
  }
  .path-caret {
    display: none;
  }
}

/* ---- rail v4: one travelling label (shared-element / sliding indicator) */
/* per-stop text stays as the accessible link name, but is never painted */
.rail .rail-marks .rail-mark span {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  outline: none !important;
}
.rail-mark:focus-visible i {
  transform: scale(1.35);
  border-color: var(--signal);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--signal);
}

.rail-tag {
  --glide: cubic-bezier(0.22, 1, 0.36, 1); /* fast start, long soft landing */
  position: absolute;
  top: 0;
  right: calc(var(--rail-x) + 19px);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  /* centred on the stop, rotated so the text's bottom faces the rail */
  transform: translate(50%, calc(var(--ty, 0px) - 50%)) rotate(-90deg) translateY(-6px);
  transition: transform 560ms var(--glide), opacity 220ms var(--route-ease);
  will-change: transform;
}
.rail-tag.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: translate(50%, calc(var(--ty, 0px) - 50%)) rotate(-90deg) translateY(0);
}
.tag-box {
  display: grid;
  align-items: center;
  height: 1.6rem;
  border-radius: 7px;
  background: rgba(18, 21, 24, 0.95);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 6px 16px -8px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  transition: width 520ms var(--glide), box-shadow 300ms var(--route-ease);
}
.rail-tag.is-current .tag-box {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 61, 0.6), 0 6px 16px -8px rgba(0, 0, 0, 0.9);
}
.rail-tag:hover .tag-box {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 61, 0.85), 0 0 0 3px rgba(255, 107, 61, 0.08);
}
.rail-tag.is-focus .tag-box {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}
.tag-text {
  grid-area: 1 / 1;
  justify-self: center;
  padding: 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  white-space: nowrap;
  transition: opacity 280ms var(--route-ease), filter 380ms var(--glide), transform 520ms var(--glide);
}
.rail-tag.is-current .tag-text {
  color: var(--ink);
}
/* cross-blur in the direction of travel (--dx is set per move) */
.tag-text.is-in {
  opacity: 0;
  filter: blur(3px);
  transform: translateX(var(--dx, -9px));
}
.tag-text.is-out {
  opacity: 0;
  filter: blur(3px);
  transform: translateX(calc(var(--dx, -9px) * -1));
}
.rail-tag.no-glide,
.rail-tag.no-glide .tag-box {
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .rail-tag,
  .tag-box,
  .tag-text {
    transition: opacity 120ms linear !important;
  }
}

/* ==========================================================================
   RAIL v5 — section handoff: exit → signal → arrive
   ========================================================================== */
/* layering: stops always read above the thumb, the label above everything */
.rail-thumb { z-index: 1; }
.rail-signal { z-index: 2; }
.rail-marks { z-index: 3; }
.rail-tag { z-index: 4; }

/* the thumb stretches behind its direction of travel (scaleY set in JS) */
.rail.dir-down .rail-thumb { transform-origin: 50% 100%; }
.rail.dir-up .rail-thumb { transform-origin: 50% 0%; }
/* texture responds to movement: the scan lines tighten while active */
.rail.is-active .rail-thumb {
  background:
    radial-gradient(120% 40% at 50% var(--py, 50%), rgba(255, 255, 255, 0.16), transparent 70%),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 3px),
    linear-gradient(to bottom, rgba(255, 107, 61, 0.42), rgba(255, 107, 61, 0.16));
}

/* ---- 2. handoff signal: one pulse, bright head leading, tail fading ---- */
.rail-signal {
  position: absolute;
  top: 0;
  right: calc(var(--rail-x) - 1.5px);
  width: 3px;
  height: 34px;
  border-radius: 3px;
  background: linear-gradient(to bottom, rgba(255, 107, 61, 0), rgba(255, 107, 61, 0.55) 70%, #ffd2bf);
  box-shadow: 0 0 10px 1px rgba(255, 107, 61, 0.35);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.rail-signal.is-up {
  background: linear-gradient(to top, rgba(255, 107, 61, 0), rgba(255, 107, 61, 0.55) 70%, #ffd2bf);
}

/* ---- node states ------------------------------------------------------ */
.rail-mark i {
  position: relative;
}
/* "current" is semantic; the filled, glowing look belongs to the LIVE node,
   which only lights when the signal arrives */
.rail-mark.is-current:not(.is-live) i {
  background: rgba(255, 107, 61, 0.35);
  box-shadow: none;
}
.rail-mark.is-live i {
  background: var(--signal);
  border-color: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-tint);
}
/* 1. exit: glow contracts back to an outline, leaving a faint trace */
.rail-mark.is-leaving i {
  animation: node-leave 700ms var(--route-ease) both;
}
.rail-mark.is-leaving i::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 107, 61, 0.45);
  animation: node-trace 760ms var(--route-ease) both;
}
@keyframes node-leave {
  0% { background: var(--signal); box-shadow: 0 0 0 3px var(--signal-tint); transform: scale(1.1); }
  100% { background: rgba(255, 107, 61, 0.35); box-shadow: 0 0 0 0 rgba(255, 107, 61, 0); transform: scale(1); }
}
@keyframes node-trace {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.6); }
}
/* 3. arrive: the node expands, fills, and sheds a soft halo */
.rail-mark.is-arriving i {
  animation: node-arrive 620ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rail-mark.is-arriving i::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 107, 61, 0.7);
  animation: node-halo 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes node-arrive {
  0% { transform: scale(0.55); }
  60% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
@keyframes node-halo {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(3.1); }
}

/* ---- label: dims + contracts toward the rail during the handoff ------- */
.rail-tag {
  --off: -6px;
  --sc: 0.96;
  transform: translate(50%, calc(var(--ty, 0px) - 50%)) rotate(-90deg) translateY(var(--off)) scale(var(--sc));
  transition: transform var(--handoff, 520ms) cubic-bezier(0.65, 0, 0.35, 1), opacity 220ms var(--route-ease);
}
.rail-tag.is-on {
  --off: 0px;
  --sc: 1;
  transform: translate(50%, calc(var(--ty, 0px) - 50%)) rotate(-90deg) translateY(var(--off)) scale(var(--sc));
}
.rail-tag.is-on.is-handoff {
  --off: 3px;   /* local +y = toward the rail */
  --sc: 0.94;
  opacity: 0.7;
}
.rail-tag.is-handoff .tag-box {
  box-shadow: inset 0 0 0 1px var(--rule), 0 6px 16px -8px rgba(0, 0, 0, 0.9);
}
.rail-tag.is-handoff .tag-text {
  filter: blur(0.4px);
}
/* resolves crisp with the live border once the node has activated */
.rail-tag.is-current .tag-box {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 61, 0.6), 0 6px 16px -8px rgba(0, 0, 0, 0.9);
}
/* fine internal linework on the label surface */
.tag-box {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
    rgba(18, 21, 24, 0.95);
}

@media (prefers-reduced-motion: reduce) {
  .rail-signal { display: none; }
  .rail-mark.is-leaving i,
  .rail-mark.is-leaving i::after,
  .rail-mark.is-arriving i,
  .rail-mark.is-arriving i::after {
    animation: none;
  }
}
/* stops are drawn above the thumb but must never intercept a drag: pointer
   navigation goes through the travelling label and track clicks; keyboard
   users still tab to each stop's link */
.rail .rail-mark {
  pointer-events: none;
}

/* ---- CMS: real project screenshots inside the browser frame ---------- */
.browser-body.app-shot {
  display: block;
  padding: 0;
  overflow: hidden;
}
.browser-body.app-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
