/* ==========================================================================
   Saurav Chauhan — portfolio
   Single stylesheet, shared by every page.

   Structure:
     1. Tokens          design system, the only place raw values live
     2. Reset & base
     3. Layout          container, section rhythm
     4. Header / nav
     5. Hero
     6. Prose & headings
     7. Experience timeline
     8. Project cards
     9. Skills
    10. Project detail pages
    11. Footer
    12. Motion & reveal
   ========================================================================== */


/* 1. Tokens ================================================================ */

:root {
  /* Palette — near-black base, one accent used sparingly */
  --bg:          #0b0d0e;
  --surface:     #121618;
  --surface-2:   #171c1f;
  --border:      #232a2e;
  --border-lit:  #313a3f;
  --text:        #e4ebee;
  --muted:       #8a979d;
  --accent:      #4dd4ac;
  --accent-dim:  #2a6b5a;

  /* One step between --bg and --surface. Used only by the measurement band. */
  --surface-plate: #101416;
  /* The 24px ground plane under EVERY generated SVG. Sharing it is what makes
     five unrelated drawings read as one system. */
  --grid-line:     rgba(228, 235, 238, 0.055);
  --accent-soft:   rgba(77, 212, 172, 0.12);
  /* BUDGET: exactly two uses site-wide — the leaked store_id in the console, and
     the SECURITY kicker. A third use means the identity has drifted. 7.2:1 on --bg. */
  --signal-warn:   #e2795a;

  /* Type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;

  /* Spacing — 8px rhythm */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-6: 3rem;
  --s-8: 4rem;
  --s-12: 6rem;
  --s-16: 8rem;

  /* Measure */
  --container: 68rem;
  --prose: 44rem;

  --fs-micro: 0.6875rem;

  --radius: 4px;
  /* Three curves, no more. A fourth means the animation is wrong. */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);          /* hover, colour, state only */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);    /* every entrance and settle   */
  /* Symmetric in-out, reserved for a measurement travelling a fixed distance and
     stopping: stroke draws, the mask sweep, the 7→90 bar. The symmetry is what
     makes those read as mechanical rather than organic. */
  --ease-meas: cubic-bezier(0.65, 0, 0.35, 1);
}


/* 2. Reset & base ========================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Sticky header is ~4.5rem; keep anchored sections clear of it */
  scroll-padding-top: 6rem;
}

/* main.js runs its own eased scrolling and animates anchor jumps itself.
   Native smooth scrolling would fight it, so it is switched off once JS is in. */
html.js-scroll { scroll-behavior: auto; }

body {
  /* clip, never hidden — hidden creates a scroll container and silently breaks
     position:sticky on every descendant, which this page now depends on */
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Faint top-left glow so the near-black never reads as flat */
  background-image:
    radial-gradient(60rem 40rem at 15% -10%, rgba(77, 212, 172, 0.055), transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 150ms var(--ease);
}

a:hover { color: var(--text); }

/* Visible focus on every interactive element — dark themes lose these easily */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.skip-link {
  position: absolute;
  left: var(--s-2);
  top: -4rem;
  z-index: 100;
  padding: var(--s-1) var(--s-2);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  border-radius: var(--radius);
  transition: top 150ms var(--ease);
}

.skip-link:focus {
  top: var(--s-2);
  color: var(--bg);
}


/* 3. Layout ================================================================ */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-3);
}

@media (min-width: 48rem) {
  .container { padding-inline: var(--s-4); }
}

.section {
  padding-block: var(--s-12);
  border-top: 1px solid var(--border);
}

.section:first-of-type { border-top: 0; }

.prose { max-width: var(--prose); }


/* 4. Header / nav ========================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 14, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.brand:hover { color: var(--accent); }

/* On narrow phones the résumé button and menu toggle leave no room for the full
   name — drop to the SC mark. The <h1> two lines down still says it in full. */
.brand-name { display: none; }

@media (min-width: 26rem) {
  .brand-name { display: inline; white-space: nowrap; }
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
}

.nav {
  display: none;
  align-items: center;
  gap: var(--s-3);
}

/* Six numbered links + brand + résumé button need real room before unstacking */
@media (min-width: 64rem) {
  .nav { display: flex; }
}

.nav a {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
}

.nav a:hover { color: var(--text); }

/* Scroll-spy state, set by main.js */
.nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-num {
  color: var(--accent-dim);
  margin-right: 0.375rem;
}

.nav a:hover .nav-num,
.nav a.is-active .nav-num { color: var(--accent); }

/* Resume button — the one persistent call to action */
.btn-resume {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.875rem;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  white-space: nowrap;
  transition: background 150ms var(--ease), border-color 150ms var(--ease),
              color 150ms var(--ease), transform 200ms var(--ease-out);
}

.btn-resume:hover {
  background: rgba(77, 212, 172, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* Mobile menu toggle */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid var(--border-lit);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.4375rem 0.75rem;
  cursor: pointer;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}

.nav-toggle:hover { color: var(--text); border-color: var(--accent-dim); }

@media (min-width: 64rem) {
  .nav-toggle { display: none; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

/* Mobile drawer */
.nav-mobile {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.nav-mobile.is-open { display: block; }

@media (min-width: 64rem) {
  .nav-mobile.is-open { display: none; }
}

.nav-mobile ul {
  list-style: none;
  padding: var(--s-2) 0;
  margin: 0;
}

.nav-mobile a {
  display: block;
  padding: 0.625rem var(--s-3);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--muted);
}

.nav-mobile a:hover { color: var(--accent); background: var(--surface); }


/* 5. Hero ================================================================== */

.hero {
  padding-block: clamp(var(--s-8), 12vw, var(--s-16)) var(--s-12);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-3);
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 212, 172, 0.15);
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin-bottom: var(--s-3);
}

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(0.875rem, 2vw, 1rem);
  color: var(--accent);
  letter-spacing: 0.01em;
  margin-bottom: var(--s-3);
}

.hero-role .sep { color: var(--border-lit); margin-inline: 0.5rem; }

.hero-summary {
  max-width: var(--prose);
  font-size: clamp(1.0625rem, 2vw, 1.1875rem);
  color: var(--muted);
  margin-bottom: var(--s-4);
}

.hero-summary strong { color: var(--text); font-weight: 500; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  border: 1px solid var(--border-lit);
  color: var(--text);
  transition: background 150ms var(--ease), border-color 150ms var(--ease),
              color 150ms var(--ease), transform 200ms var(--ease-out);
}

.btn:hover { border-color: var(--accent-dim); color: var(--accent); background: var(--surface); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 500;
}

.btn-primary:hover {
  background: #5ee0b8;
  border-color: #5ee0b8;
  color: var(--bg);
}


/* 6. Prose & headings ====================================================== */

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
}

.section-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.section-head h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 650;
}

/* Hairline that runs to the right edge of the heading row */
.section-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
  transform: translateY(-0.4em);
}

.lead { font-size: 1.125rem; }

p + p { margin-top: var(--s-2); }

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

.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}


/* 7. Experience timeline =================================================== */

.timeline {
  display: grid;
  gap: var(--s-8);
}

.job {
  display: grid;
  gap: var(--s-2);
}

@media (min-width: 56rem) {
  .job {
    grid-template-columns: 11rem 1fr;
    gap: var(--s-4);
  }
}

.job-date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding-top: 0.3rem;
}

.job-body {
  position: relative;
  padding-left: var(--s-3);
  border-left: 1px solid var(--border);
}

/* Node on the timeline rail */
.job-body::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 0.7rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

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

.job-role {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  margin-bottom: var(--s-2);
}

.job-role .sep { color: var(--border-lit); margin-inline: 0.5rem; }

.job-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: var(--s-2);
}

.bullets {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--s-2);
  max-width: var(--prose);
}

.bullets li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--muted);
}

.bullets li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent-dim);
  font-size: 0.875rem;
}

.bullets strong { color: var(--text); font-weight: 550; }


/* 8. Project cards ========================================================= */

.card-grid {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: 1fr;
}

@media (min-width: 44rem) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 68rem) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 200ms var(--ease), background 200ms var(--ease), transform 200ms var(--ease);
}

.card:hover {
  border-color: var(--accent-dim);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.card-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-dim);
  letter-spacing: 0.08em;
}

.card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card h3 a { color: var(--text); }

.card:hover h3 a { color: var(--accent); }

.card p {
  color: var(--muted);
  font-size: 0.9375rem;
  flex: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  list-style: none;
  padding: 0;
}

.tags li {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 0.1875rem 0.5rem;
  border: 1px solid var(--border-lit);
  border-radius: 2px;
}

.card-links {
  display: flex;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding-top: var(--s-1);
  border-top: 1px solid var(--border);
}


/* 9. Skills ================================================================ */

.skills-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: 1fr;
}

@media (min-width: 44rem) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 68rem) {
  .skills-grid { grid-template-columns: repeat(3, 1fr); }
}

.skill-group h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-bottom: var(--s-1);
  margin-bottom: var(--s-2);
  border-bottom: 1px solid var(--border);
}

.skill-group ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.skill-group li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
}

/* Education / certifications */
.edu {
  display: grid;
  gap: var(--s-2);
  max-width: var(--prose);
}

@media (min-width: 56rem) {
  .edu { grid-template-columns: 11rem 1fr; gap: var(--s-4); max-width: none; }
}

.edu h3 { font-size: 1.125rem; font-weight: 600; }


/* 10. Project detail pages ================================================= */

.page-head {
  padding-block: var(--s-8) var(--s-6);
  border-bottom: 1px solid var(--border);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: var(--s-3);
}

.back-link:hover { color: var(--accent); }

.page-head h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin-bottom: var(--s-2);
}

.page-head .hero-summary { margin-bottom: var(--s-3); }

.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Numbered content blocks on detail pages */
.detail-block { padding-block: var(--s-6); border-top: 1px solid var(--border); }
.detail-block:first-of-type { border-top: 0; }

.detail-block h2 {
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.detail-block p,
.detail-block .bullets { color: var(--muted); }

.detail-block .prose p { margin-bottom: var(--s-2); }

/* Definition-style stack list: tool + why that tool */
.stack-list {
  display: grid;
  gap: var(--s-2);
  max-width: var(--prose);
  list-style: none;
  padding: 0;
}

.stack-list li {
  display: grid;
  gap: 0.25rem;
  padding: var(--s-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.stack-list dt,
.stack-list .stack-name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
}

.stack-list .stack-why { color: var(--muted); font-size: 0.9375rem; }

/* Outcome metrics */
.metrics {
  display: grid;
  gap: var(--s-2);
  grid-template-columns: 1fr;
  margin-bottom: var(--s-3);
}

@media (min-width: 34rem) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 44rem) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
}

.metric {
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -0.02em;
  /* Counters animate through many digit widths — tabular stops the layout jittering */
  font-variant-numeric: tabular-nums;
}

.metric-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.375rem;
}

/* Next/prev project navigation */
.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: space-between;
  padding-block: var(--s-6);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}


/* 11. Footer =============================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  /* Extra headroom above the content is the flight's airspace */
  padding-block: var(--s-12) var(--s-8);
  margin-top: var(--s-6);
}

.footer-top {
  display: grid;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}

@media (min-width: 56rem) {
  .footer-top { grid-template-columns: 1fr auto; align-items: end; }
}

/* The closing statement gets display scale — the page's second-largest type
   after the name, so the site ends as confidently as it opens. */
.footer-top h2 {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin-bottom: var(--s-2);
}

.footer-top h2 .tail { color: var(--accent); }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  list-style: none;
  padding: 0;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: space-between;
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}


/* 12. Motion =============================================================== */

/* --- Scroll progress bar --- */

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
  pointer-events: none;
}

/* --- Header hide on scroll down --- */

.site-header {
  transition: transform 350ms var(--ease-out);
  will-change: transform;
}

.site-header.is-hidden { transform: translateY(-100%); }

/* --- Entrance: hero and page headers, staggered via --d --- */

[data-enter] {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: var(--d, 0ms);
}

[data-enter].is-entered {
  opacity: 1;
  transform: none;
}

/* Masked line reveal — the text slides up out of a clipped box.
   Needs the padding, or descenders in "y" and "g" get shaved off. */
.mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}

.mask-inner {
  display: block;
  transform: translateY(110%);
  transition: transform 900ms var(--ease-out);
  transition-delay: var(--d, 0ms);
}

.is-entered .mask-inner,
.mask-inner.is-entered { transform: none; }

/* --- Section headings arrive the same way -------------------------------
   The hero h1's masked line reveal, systematized: JS wraps every section
   heading in the same .mask/.mask-inner pair and arms its container. The
   heading slides out of the clip and the rule draws to the edge beside it.
   No-JS and reduced motion never get armed, so the default is simply text. */

.mask-armed h2 .mask-inner {
  transform: translateY(110%);
  transition: transform 800ms var(--ease-out);
}

.mask-armed.is-visible h2 .mask-inner { transform: none; }

.mask-armed .section-rule {
  transform: translateY(-0.4em) scaleX(0);
  transform-origin: 0 50%;
  transition: transform 900ms var(--ease-meas) 200ms;
}

.mask-armed.is-visible .section-rule { transform: translateY(-0.4em) scaleX(1); }

/* --- Reveal on scroll --- */

/* Parametric: an element arrives from its own position in the layout, not from a
   generic nowhere. Direction and duration are set by markup, so a right-hand rail
   slides in from the right and a figure arrives after the text it illustrates —
   all for zero extra JavaScript. */
.reveal {
  opacity: 0;
  transform: translate3d(var(--rx, 0), var(--ry, 16px), 0);
  transition: opacity var(--rdur, 650ms) var(--ease-out),
              transform var(--rdur, 650ms) var(--ease-out);
  transition-delay: var(--d, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

[data-reveal="rail"]   { --rx: 20px; --ry: 0; --rdur: 850ms; }
[data-reveal="figure"] { --ry: 20px; --rdur: 850ms; }

/* --- SVG draw-on ---------------------------------------------------------
   Every animated stroke carries pathLength="100", so ONE dasharray value draws
   any geometry regardless of its real length. No getTotalLength, no measurement
   pass, no inline style writes from JS — and the diagrams stay hand-editable. */

[data-draw] .stroke {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 900ms var(--ease-meas);
  transition-delay: calc(var(--i, 0) * 45ms);
}

[data-draw].is-visible .stroke,
[data-draw].is-entered .stroke { stroke-dashoffset: 0; }

[data-draw] .fill {
  opacity: 0;
  transition: opacity 520ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 45ms);
}

[data-draw].is-visible .fill,
[data-draw].is-entered .fill { opacity: 1; }

/* SVG transform-origin resolves against the viewport unless this is set — the
   single most common silent failure in hand-written SVG animation. */
[data-draw] [class^="fx-"] { transform-box: fill-box; }

/* --- Marquee --- */

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--border);
  padding-block: 0.875rem;
  /* Fade the ends so items enter and leave instead of being chopped off */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 46s linear infinite;
  will-change: transform;
}

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track { animation-play-state: paused; }

.marquee-group {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-right: 2.5rem;
  flex-shrink: 0;
}

.marquee-group span {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: color 200ms var(--ease);
}

.marquee-group span::after {
  content: "·";
  margin-left: 2.5rem;
  color: var(--accent-dim);
}

.marquee:hover .marquee-group span { color: var(--text); }

/* The track holds two identical groups; -50% lands exactly on the seam */
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* --- Card hover sheen --- */

.card {
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(24rem 16rem at var(--mx, 50%) var(--my, 0%),
                              rgba(77, 212, 172, 0.07), transparent 60%);
  opacity: 0;
  transition: opacity 300ms var(--ease);
  pointer-events: none;
}

.card:hover::after { opacity: 1; }

/* --- Parallax --- */

[data-parallax] { will-change: transform; }

/* --- Fallbacks --- */

/* If main.js never runs, nothing may stay invisible or half-revealed */
.no-js .reveal,
.no-js [data-enter] { opacity: 1; transform: none; }

.no-js .mask-inner { transform: none; }

/* …including every generated diagram, which must render fully drawn */
.no-js [data-draw] .stroke { stroke-dashoffset: 0; }
.no-js [data-draw] .fill { opacity: 1; }
.no-js .mask-layer { clip-path: inset(0); }
.no-js .fx-candle { transform: scaleY(1); }
.no-js .fx-scan { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  [data-enter] { opacity: 1; transform: none; }

  .mask-inner { transform: none; }

  .marquee-track { animation: none; }

  .scroll-progress { display: none; }
}


/* 404 ====================================================================== */

.error-page {
  min-height: 70vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: var(--s-3);
  padding-block: var(--s-12);
}

.error-code {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 12vw, 6rem);
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.04em;
}


/* 13. Instrument layer ===================================================== */

/* Shared ground plane. Every generated drawing sits on the same 24px grid —
   that is what makes unrelated diagrams read as one system. */
.grid-ground {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
}

.micro {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- Hero readout --------------------------------------------------------- */

.readout {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-2);
}

.readout svg { width: 100%; height: auto; }

.readout figcaption {
  margin-top: var(--s-1);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (min-width: 64rem) {
  .hero .container {
    display: grid;
    grid-template-columns: minmax(0, 34rem) minmax(0, 1fr);
    column-gap: var(--s-8);
    align-items: center;
  }
}

@media (max-width: 63.999rem) {
  .readout { max-width: 26rem; margin-top: var(--s-4); }
}

/* --- Measurement band ----------------------------------------------------- */

.plate {
  background: var(--surface-plate);
  border-block: 1px solid var(--border);
  padding-block: var(--s-8);
}

.plate .metrics { gap: 0; }

.plate .metric {
  padding: 0 var(--s-3);
  background: none;
  border: 0;
}

.plate .metric-value { font-size: clamp(2.25rem, 5vw, 3.5rem); }

@media (min-width: 44rem) {
  .plate .metric + .metric { border-left: 1px solid var(--border); }
}

/* The 7 → 90 window bar */
.bar {
  margin-top: var(--s-2);
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.bar-track {
  flex: 1;
  height: 2px;
  background: var(--border);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(var(--w, 0));
  transform-origin: left;
  transition: transform 400ms var(--ease-meas);
}

/* --- Odometer ------------------------------------------------------------- */

.odo {
  display: inline-flex;
  align-items: flex-start;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.odo-digit { display: block; height: 1em; overflow: hidden; }

.odo-strip {
  display: block;
  transform: translateY(calc(var(--i, 0) * -1em));
  transition: transform var(--odur, 1500ms) var(--ease-out);
  transition-delay: var(--d, 0ms);
}

.odo-cell,
.odo-lit { display: block; height: 1em; line-height: 1em; }

/* Literal cells carry the spaces in " days" and " / 10" — without pre they
   collapse and the value runs into its unit. */
.odo-lit { white-space: pre; }

/* --- Console -------------------------------------------------------------- */

.console {
  margin: var(--s-3) 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.console-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-1);
  padding: 0.5rem var(--s-2);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.console-title {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.console-tabs { display: flex; gap: 2px; }

.console-tabs button {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}

.console-tabs button:hover { color: var(--text); }

.console-tabs button[aria-selected="true"] {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-soft);
}

.console-body {
  margin: 0;
  padding: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--muted);
  overflow-x: auto;
}

.console-body .ln,
.console-body .row { display: block; white-space: pre; }

.console-body .kw { color: var(--text); }
.console-body .ok { color: var(--accent); }

/* A fixed em height on a known single line — not max-height, not 0fr→1fr.
   The target is exact, so the layout animation is one line tall and cheap. */
.ln--fix {
  height: 0;
  opacity: 0;
  overflow: hidden;
  padding-left: 0.5rem;
  border-left: 2px solid transparent;
  transition: height 320ms var(--ease-out),
              opacity 240ms var(--ease),
              border-color 240ms var(--ease);
}

[data-console][data-state="patched"] .ln--fix {
  height: 1.7em;
  opacity: 1;
  border-left-color: var(--accent);
}

.row--foreign {
  height: 1.7em;
  opacity: 1;
  overflow: hidden;
  transition: height 320ms var(--ease-out), opacity 240ms var(--ease);
}

[data-console][data-state="patched"] .row--foreign { height: 0; opacity: 0; }

.leak { color: var(--signal-warn); }   /* budget use 1 of 2 */

.console-count { position: relative; display: block; }
.console-count .c2 { display: none; }
[data-console][data-state="patched"] .console-count .c1 { display: none; }
[data-console][data-state="patched"] .console-count .c2 { display: block; }

.console figcaption {
  padding: 0 var(--s-2) var(--s-2);
  font-size: 0.875rem;
  color: var(--muted);
}

/* --- Experience kicker tags ----------------------------------------------- */

.bullets li.k { padding-left: 0; }
.bullets li.k::before { content: none; }

@media (min-width: 56rem) {
  .bullets li.k {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: var(--s-2);
  }
}

.kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dim);
  padding-top: 0.3em;
}

.kicker--warn { color: var(--signal-warn); }   /* budget use 2 of 2 */

/* --- Sticky rails --------------------------------------------------------- */

@media (min-width: 64rem) {
  .with-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 15rem;
    gap: var(--s-8);
    align-items: start;
  }
  .rail { position: sticky; top: 7rem; }
  .job-date { position: sticky; top: 7rem; }
}

.rail dl { margin: 0; display: grid; gap: var(--s-2); }
.rail dt { margin-bottom: 0.15rem; }
.rail dd { margin: 0; font-size: 0.875rem; color: var(--text); }
.rail dd + dt { margin-top: var(--s-2); }

/* --- Project card faces --------------------------------------------------- */

.card { padding-top: 0; }

.card-face {
  aspect-ratio: 16 / 9;
  margin: 0 calc(-1 * var(--s-3));
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.card-face svg { width: 100%; height: 100%; display: block; }

.card-index { padding-top: var(--s-3); }

.fx-candle {
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform 520ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 26ms);
}

[data-draw].is-visible .fx-candle { transform: scaleY(1); }

.mask-layer {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1150ms var(--ease-meas);
}

[data-draw].is-visible .mask-layer { clip-path: inset(0); }

.fx-scan {
  opacity: 0;
  transition: transform 1150ms var(--ease-meas), opacity 200ms linear 950ms;
}

[data-draw].is-visible .fx-scan { transform: translateX(268px); opacity: 1; }

/* --- Skills as architecture layers ---------------------------------------- */

.layer {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-2) 0;
  border-top: 1px solid var(--border);
}

@media (min-width: 56rem) {
  .layer { grid-template-columns: 9rem 1fr; gap: var(--s-3); align-items: baseline; }
}

.layer:last-child { border-bottom: 1px solid var(--border); }

.layer-name {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.layer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.layer li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}

.layer li:hover { color: var(--text); border-color: var(--accent-dim); }

/* --- Detail page pipeline figure + TOC ------------------------------------ */

.figure {
  margin: var(--s-3) 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-2) var(--s-2);
}

.figure svg { width: 100%; height: auto; }

.figure figcaption {
  margin-top: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc { display: none; }

@media (min-width: 68rem) {
  .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 11rem; gap: var(--s-8); align-items: start; }
  .toc { display: block; position: sticky; top: 7rem; }
}

.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }

.toc a {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 0.625rem;
  display: block;
}

.toc a:hover,
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); }


/* --- Scroll-linked image frames ------------------------------------------
   Three nested layers, because the three motions must not compete for one
   transform property:

     .shot         the frame  — clip-path wipe on enter   (one-shot, CSS)
     .shot-inner   the settle — scale 1.12 → 1 on enter   (one-shot, CSS)
     .shot img     the drift  — parallax                  (per-frame, from JS)

   If the scale and the drift shared an element, the per-frame transform write
   would clobber the CSS transition every frame and the settle would never play.

   The image is (100 + 2×drift)% of the frame's height and sits drift% above it,
   so a ±drift% travel never exposes an edge. --shot-drift is the single source
   of truth: CSS sizes the image from it, JS reads it back in the measure pass.

   Frame borrows the .console language — bar, border, radius — deliberately. A
   bright screenshot needs a bezel between it and a near-black page, and reusing
   the instrument frame already on the site beats inventing a second one. */

.shot {
  --shot-ar: 21 / 9;
  --shot-drift: 9;
  margin: var(--s-3) 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.shot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-1);
  padding: 0.5rem var(--s-2);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.shot-frame {
  position: relative;
  aspect-ratio: var(--shot-ar);
  overflow: hidden;
  background: var(--surface-2);
}

.shot-inner { position: absolute; inset: 0; }

.shot img {
  position: absolute;
  left: 0;
  width: 100%;
  top: calc(var(--shot-drift) * -1%);
  height: calc(100% + var(--shot-drift) * 2%);
  object-fit: cover;
  display: block;
}

.shot figcaption {
  padding: var(--s-2);
  font-size: 0.875rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* The finished state is the default: with JS off or reduced motion on, the
   image is simply there — unclipped, unscaled, no half-played animation. Only
   .js-fx introduces a state to animate out of. */
.js-fx .shot-frame {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 900ms var(--ease-out);
}

.js-fx .shot.is-visible .shot-frame { clip-path: inset(0 0 0 0); }

.js-fx .shot-inner {
  transform: scale(1.12);
  transition: transform 1100ms var(--ease-out);
  will-change: transform;
}

.js-fx .shot.is-visible .shot-inner { transform: none; }


/* 14. Kinetic layer ======================================================== */
/* The four effects requested explicitly. Every one is gated on .js-fx (added
   only when reduced motion is off) and on a pointer/width guard, so none of it
   fires on a phone, with JS off, or for a reduced-motion visitor. */

/* --- Hero particle field --- */

.hero { position: relative; }
.hero-sticky { position: relative; }
.hero .container { position: relative; z-index: 1; }

/* width/height are load-bearing, not belt-and-braces: <canvas> is a replaced
   element, so an absolutely positioned one resolves to its intrinsic 300x150 and
   drops `bottom` from the equation. With inset:0 alone the particle field draws
   into a 300x150 box in the corner instead of filling the hero. */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 900ms var(--ease-out);
}

html.js-fx .hero-canvas.is-on { opacity: 1; }

/* --- Custom cursor ring ---
   The native cursor is deliberately NOT hidden: the ring is an accent that
   trails it, so pointer precision and accessibility are unaffected. */

.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border: 1px solid var(--accent-dim);
  border-radius: 50%;
  pointer-events: none;
  z-index: 90;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0);
  transition: opacity 250ms var(--ease),
              width 220ms var(--ease-out), height 220ms var(--ease-out),
              margin 220ms var(--ease-out),
              border-color 220ms var(--ease), background-color 220ms var(--ease);
}

html.js-fx .cursor.is-on { opacity: 1; }

.cursor.is-active {
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cursor-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0;
  transition: opacity 180ms var(--ease);
}

.cursor.is-active .cursor-label { opacity: 1; }

/* --- Page transition veil --- */

.veil {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  pointer-events: none;
  transform: scaleY(0);
  transform-origin: 50% 100%;
}

.veil.is-covering {
  transform: scaleY(1);
  transition: transform 420ms var(--ease-out);
}

.veil.is-lifting {
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform 520ms var(--ease-out);
}

/* --- Pinned horizontal projects ---
   DEFAULT (no JS, reduced motion, narrow, touch) is an ordinary responsive
   grid. The pinning is layered on top only when .js-pin is present. */

.pin-track {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}

@media (min-width: 44rem) {
  .pin-track { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 68rem) {
  .pin-track { grid-template-columns: repeat(3, 1fr); }
}

html.js-pin .pin-stage { height: var(--stage-h, 300vh); }

html.js-pin .pin-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

html.js-pin .pin-track {
  display: flex;
  grid-template-columns: none;
  width: max-content;
  gap: var(--s-4);
  transform: translate3d(calc(var(--px, 0) * -1px), 0, 0);
  will-change: transform;
}

html.js-pin .pin-track > .card { flex: 0 0 32rem; }

/* Wider cards need a shallower face, or the card cannot fit inside a 100vh
   stage alongside the section heading and the progress bar. */
html.js-pin .pin-track .card-face { aspect-ratio: 2.4 / 1; }

.pin-progress {
  display: none;
  height: 2px;
  margin-top: var(--s-4);
  background: var(--border);
}

html.js-pin .pin-progress { display: block; }

.pin-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(var(--pp, 0));
  transform-origin: left;
}


/* --- Pinned hero: the request packet ---
   Same scaffold as the projects stage — a tall stage, a sticky viewport-height
   frame, one scroll-derived progress value. Layered on only when .js-hero-pin
   is present, so no-JS, reduced motion, and any viewport too short or narrow to
   hold the hero in 100vh all keep the ordinary hero. */

html.js-hero-pin .hero { height: var(--hero-stage-h, 190vh); }

html.js-hero-pin .hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

/* The packet only exists while the stage is pinned; without the pin there is no
   travel to map it onto, so it never appears rather than sitting inert. */
.packet { opacity: 0; }

html.js-hero-pin .packet {
  opacity: 0;
  transition: opacity 260ms var(--ease);
}

html.js-hero-pin .packet.is-on { opacity: 1; }

.packet-core { fill: var(--accent); }
.packet-halo { fill: var(--accent); opacity: 0.16; }

/* Direction carries meaning: a solid dot descending is the request, a hollow
   ring climbing back is the response. */
.packet.is-up .packet-core {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
}

.packet.is-up .packet-halo { opacity: 0.08; }

.packet-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  fill: var(--accent);
}

/* Stations light as the packet reaches them. Stroke only — opacity belongs to
   [data-draw], which owns the entrance, and the two must not fight. */
.station { transition: stroke 240ms var(--ease); }
.station.is-lit { stroke: var(--accent); }

/* --- Boot sequence ---
   Built entirely by JS, so no-JS visitors never see a cover they cannot lift.
   First visit per session only; any input skips it. The overlay lifts with the
   veil's easing so arriving and navigating share one motion. */

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 560ms cubic-bezier(0.65, 0, 0.35, 1);
}

.boot.is-lifting { transform: translateY(-101%); }

.boot-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1150ms var(--ease-meas);
}

.boot.is-running .boot-bar { transform: scaleX(1); }

.boot-panel {
  width: min(24rem, 82vw);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.boot-title {
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: var(--s-2);
}

.boot-line {
  display: flex;
  align-items: baseline;
  gap: 0.75em;
  margin-top: 0.55rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}

.boot-line.on { opacity: 1; transform: none; }

.boot-leader {
  flex: 1;
  border-bottom: 1px dotted var(--border-lit);
  transform: translateY(-0.25em);
}

.boot-ok,
.boot-done { color: var(--accent); }

/* --- Scroll-reactive tape ---
   When JS drives the marquee, the CSS loop stands down. Everything else about
   the tape (fade mask, hover colour) is unchanged. */

html.js-tape .marquee-track { animation: none; }

/* --- Contact flight ---
   A paper plane crosses the footer on a scroll-scrubbed flight path — the one
   vehicle this site can justify, since the section it flies over says "the
   fastest way to reach me is email". Scene DOM is JS-built; without JS or with
   reduced motion the footer is simply a footer. */

.site-footer {
  position: relative;
  overflow: hidden;
}

.site-footer .container { position: relative; z-index: 1; }

.flight {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms var(--ease);
}

.flight.is-on { opacity: 1; }

.flight-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Solid hairline rather than dashes: a dashed stroke cannot be progressively
   revealed with the dashoffset trick, and at this opacity it reads as a vapor
   trail either way. */
.flight-trail {
  fill: none;
  stroke: var(--accent-dim);
  stroke-width: 1;
  opacity: 0.55;
}

.flight-plane {
  position: absolute;
  top: 0;
  left: 0;
  width: 54px;
  height: 54px;
  transform-origin: 50% 50%;
  will-change: transform;
}

/* Reduced motion: the kinetic layer never initialises (JS gate), and anything
   that did render settles instantly. */
@media (prefers-reduced-motion: reduce) {
  .hero-canvas,
  .cursor,
  .veil { display: none !important; }

  .odo-strip,
  .bar-fill,
  .ln--fix,
  .row--foreign,
  .mask-layer,
  .fx-candle,
  .fx-scan,
  [data-draw] .stroke,
  [data-draw] .fill { transition: none !important; }

  [data-draw] .stroke { stroke-dashoffset: 0 !important; }
  [data-draw] .fill { opacity: 1 !important; }
  .mask-layer { clip-path: inset(0) !important; }
  .fx-candle { transform: scaleY(1) !important; }
  .fx-scan { display: none !important; }
}
