/* ============================================================
   chandhan.com
   Type-specimen portfolio. Paper ground, white surfaces, no
   accent colour — the only colours are classification states,
   used exclusively where something is being classified.
   ============================================================ */

:root {
  /* ground */
  --paper:   #f2f3f5;
  --surface: #ffffff;
  --ink:     #0d1117;
  --muted:   #55606e;
  --rule:    #d6dae0;
  --rule-2:  #e4e7eb;
  --grid:    rgba(13, 17, 23, 0.062);
  --lift-1:  0 1px 2px rgba(13, 17, 23, 0.05);
  --lift-2:  0 1px 2px rgba(13, 17, 23, 0.05), 0 10px 28px -14px rgba(13, 17, 23, 0.22);
  --lift-3:  0 2px 4px rgba(13, 17, 23, 0.06), 0 18px 40px -18px rgba(13, 17, 23, 0.28);

  /* classification states */
  --clean:   #12705a;
  --ai:      #5b3fa8;
  --flag:    #b4400a;
  --unknown: #98a1ac;

  /* type */
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  /* modular scale — 12 14 16 18 24 32 48 */
  --t-xs:   0.75rem;   /* 12 */
  --t-sm:   0.875rem;  /* 14 */
  --t-base: 1rem;      /* 16 */
  --t-md:   1.125rem;  /* 18 */
  --t-lg:   1.5rem;    /* 24 */
  --t-xl:   2rem;      /* 32 */
  --t-2xl:  3rem;      /* 48 */
  --t-read: 1.0625rem; /* 17 — long-form prose on case studies */

  /* space */
  --s-1: 4px;  --s-2: 8px;  --s-3: 16px;
  --s-4: 24px; --s-5: 40px; --s-6: 64px; --s-7: 96px;

  --wide: 1080px;
  --measure: 62ch;

  /* motion tokens — duration scales with distance, not one value everywhere */
  --dur-1: 120ms;  /* colour, opacity */
  --dur-2: 240ms;  /* small movement */
  --dur-3: 460ms;  /* entrances */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);   /* decelerate on arrival */
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;

  /* light source at the top, plus two faint blooms drawn from the
     classification palette so the depth stays inside the page's colours */
  background-color: var(--paper);
  background-image:
    radial-gradient(105% 62% at 50% -6%, rgba(255, 255, 255, 0.98), transparent 60%),
    radial-gradient(58% 48% at 86% 4%, rgba(91, 63, 168, 0.11), transparent 70%),
    radial-gradient(54% 44% at 4% 20%, rgba(18, 112, 90, 0.09), transparent 70%),
    radial-gradient(44% 36% at 78% 62%, rgba(180, 64, 10, 0.05), transparent 72%);
  background-attachment: fixed;
}

/* engineering grid — strongest behind the specimen, gone by the time
   the reading starts */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,0.35) 45%, transparent 80%);
          mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,0.35) 45%, transparent 80%);
}

.nav, main, footer { position: relative; z-index: 1; }

/* case studies get a content column plus a sticky index rail */
@media (min-width: 1120px) {
  .detail main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    column-gap: var(--s-6);
    align-items: start;
  }
  .detail main > :not(.toc) { grid-column: 1; }
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--ai); outline-offset: 3px; }

main { max-width: var(--wide); margin: 0 auto; padding: 0 var(--s-4); }

/* utility: monospace label */
.nav-name, .nav-links a, .spec-meta, .col-label, .tag, .job-date,
.job-link, .row-head, .proof-k, .repo-kind, .repo-meta, .repo-more,
.stack dt, .btn, footer, .back, .d-kind, .fact dt, .m-kind, .diagram-note {
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

/* ---------------- nav ---------------- */
.nav {
  max-width: var(--wide);
  margin: 0 auto;
  padding: var(--s-4) var(--s-4) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.nav-name {
  font-size: var(--t-sm);
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--ink);
  padding: 3px 7px;
  letter-spacing: 0.1em;
}
.nav-links { display: flex; gap: var(--s-4); flex-wrap: wrap; }
.nav-links a {
  font-size: var(--t-xs);
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-1) var(--ease-std), border-color var(--dur-1) var(--ease-std);
}
.nav-links a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------------- hero: name as type specimen ---------------- */
.hero { padding: var(--s-6) 0 var(--s-7); border-top: 0; position: relative; }

/* spotlight lifting the specimen off the grid */
.hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4%;
  height: 72%;
  z-index: -1;
  pointer-events: none;
  /* spread lives in the gradient, not in negative insets — insets would
     push past the viewport and create horizontal overflow */
  background: radial-gradient(78% 76% at 42% 46%, rgba(255, 255, 255, 0.92), transparent 70%);
}

.spec-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  font-size: var(--t-xs);
  text-transform: uppercase;
  color: var(--muted);
  padding: var(--s-2) 0;
}
.spec-top    { border-bottom: 1px solid var(--ink); }
.spec-bottom { border-top: 1px solid var(--ink); margin-bottom: var(--s-5); }

.specimen {
  margin: var(--s-4) 0;
  font-variation-settings: "wdth" 118;
  font-weight: 800;
  font-size: clamp(2.75rem, 12vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.specimen .line { display: block; }

/* ---- the one orchestrated moment: the specimen sets itself ----
   Rules draw outward, name lines rise into a clip, metadata settles.
   Runs once on load, ~900ms end to end. */
@keyframes rule-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes line-set  {
  from { clip-path: inset(105% 0 0 0); transform: translateY(0.14em); }
  to   { clip-path: inset(-20% 0 0 0); transform: none; }
}
@keyframes settle    { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero .spec-top,
.hero .spec-bottom { transform-origin: left center; }
.hero .spec-top    { animation: rule-draw var(--dur-3) var(--ease-out) both; }
.hero .spec-bottom { animation: rule-draw var(--dur-3) var(--ease-out) 360ms both; }

.specimen .line { animation: line-set 700ms var(--ease-out) both; }
.specimen .line:nth-child(1) { animation-delay: 100ms; }
.specimen .line:nth-child(2) { animation-delay: 210ms; }

.hero .lede       { animation: settle var(--dur-3) var(--ease-out) 460ms both; }
.hero .hero-links { animation: settle var(--dur-3) var(--ease-out) 560ms both; }

.lede {
  max-width: var(--measure);
  font-size: var(--t-md);
  color: var(--muted);
  margin: 0 0 var(--s-4);
}
.lede strong { color: var(--ink); font-weight: 600; }

.hero-links { display: flex; gap: var(--s-4); flex-wrap: wrap; margin: 0; font-size: var(--t-sm); }
.hero-links a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 3px;
  transition: border-color var(--dur-1) var(--ease-std);
}
.hero-links a:hover { border-bottom-color: var(--ink); }

/* ---------------- sections ---------------- */
section { padding: var(--s-6) 0; border-top: 1px solid var(--rule); }

.sec-head { margin-bottom: var(--s-4); }
.sec-head:has(p) { margin-bottom: var(--s-5); }
h2 {
  margin: 0 0 var(--s-2);
  font-variation-settings: "wdth" 112;
  font-weight: 700;
  font-size: var(--t-xl);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.sec-head p { margin: 0; max-width: var(--measure); color: var(--muted); }

/* two-column label/body split */
.split { display: grid; grid-template-columns: 160px 1fr; gap: var(--s-5); }
.col-label {
  margin: 0;
  font-size: var(--t-xs);
  text-transform: uppercase;
  color: var(--muted);
}
.col-body { max-width: var(--measure); }
.col-body p { margin: 0 0 var(--s-3); }
.col-body p:last-child { margin-bottom: 0; }

/* ---------------- experience ---------------- */
.job {
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--lift-2);
  padding: var(--s-4) var(--s-5) var(--s-5);
  margin-bottom: var(--s-3);
}
.job:last-of-type { margin-bottom: 0; }

.job-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--rule-2);
}
.tag {
  border: 1px solid var(--rule);
  padding: 3px 8px;
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.tag-now { border-color: var(--clean); color: var(--clean); }
.job-date { font-size: var(--t-xs); color: var(--muted); text-transform: uppercase; }
.job-link {
  margin-left: auto;
  font-size: var(--t-xs);
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  white-space: nowrap;
  transition: border-color var(--dur-1) var(--ease-std);
}
.job-link:hover { border-bottom-color: var(--ink); }

.job-name {
  margin: var(--s-4) 0 var(--s-4);
  font-variation-settings: "wdth" 110;
  font-weight: 700;
  font-size: var(--t-xl);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.job-name span {
  display: block;
  margin-top: 2px;
  font-variation-settings: "wdth" 100;
  font-weight: 400;
  font-size: var(--t-base);
  letter-spacing: 0;
  color: var(--muted);
}

.rows { display: flex; flex-direction: column; }
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
  padding: var(--s-3) 0;
  border-top: 1px solid var(--rule-2);
}
.row-head {
  font-size: var(--t-xs);
  text-transform: uppercase;
  color: var(--muted);
  border-top: 0;
  padding: 0 0 var(--s-1);
}
.claim { margin: 0; font-size: var(--t-sm); }
.claim strong { font-weight: 600; }
.proof {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-sm);
  border-left: 2px solid var(--rule-2);
  padding-left: var(--s-3);
}
.proof-k {
  display: none;
  color: var(--clean);
  margin-bottom: var(--s-1);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------------- repos ---------------- */
.repos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
}
.repo { display: flex; }
.repo a {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left-width: 3px;
  padding: var(--s-4);
  text-decoration: none;
  box-shadow: var(--lift-2);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.repo a:hover { transform: translateY(-3px); box-shadow: var(--lift-3); }
.repo-clean   a { border-left-color: var(--clean); }
.repo-ai      a { border-left-color: var(--ai); }
.repo-flag    a { border-left-color: var(--flag); }
.repo-unknown a { border-left-color: var(--unknown); }

/* system glyph: the shape of the architecture, legible at card size */
.repo-glyph {
  display: block;
  width: 100%;
  height: 56px;
  margin-bottom: var(--s-1);
  color: var(--muted);
  opacity: 0.85;
  transition: opacity 150ms ease;
}
.repo a:hover .repo-glyph { opacity: 1; }
.repo-clean   .repo-glyph { color: var(--clean); }
.repo-ai      .repo-glyph { color: var(--ai); }
.repo-flag    .repo-glyph { color: var(--flag); }
.repo-unknown .repo-glyph { color: var(--muted); }

.repo-kind { font-size: var(--t-xs); text-transform: uppercase; color: var(--muted); }
.repo-clean   .repo-kind { color: var(--clean); }
.repo-ai      .repo-kind { color: var(--ai); }
.repo-flag    .repo-kind { color: var(--flag); }

.repo h3 {
  margin: 0;
  font-variation-settings: "wdth" 108;
  font-weight: 700;
  font-size: var(--t-md);
  letter-spacing: -0.01em;
}
.repo p { margin: 0; color: var(--muted); font-size: var(--t-sm); }
.repo-meta { font-size: var(--t-xs); color: var(--muted); margin-top: auto; padding-top: var(--s-2); }
.repo-more { font-size: var(--t-xs); text-transform: uppercase; color: var(--muted); }
.repo-clean   .repo-more { color: var(--clean); }
.repo-ai      .repo-more { color: var(--ai); }
.repo-flag    .repo-more { color: var(--flag); }
.repo-unknown .repo-more { color: var(--ink); }

/* ---------------- stack ---------------- */
.stack {
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--lift-2);
  padding: var(--s-2) var(--s-5) var(--s-4);
}
.stack-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--s-5);
  align-items: start;
  padding: var(--s-3) 0;
  border-top: 1px solid var(--rule-2);
}
.stack-row:first-child { border-top: 0; }
.stack-label {
  margin: 0;
  padding-top: 5px;
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  font-size: var(--t-xs);
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 5px 10px;
  white-space: nowrap;
}
.chips-plain li {
  background: transparent;
  border: 0;
  padding: 5px 0;
  color: var(--muted);
  font-size: var(--t-sm);
  white-space: normal;
}
.chips-plain { gap: 0 var(--s-4); }

/* ---------------- contact ---------------- */
.contact { max-width: var(--measure); }
.contact h2 { font-size: var(--t-xl); margin-bottom: var(--s-4); }
.contact-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: 0; }
.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 11px 20px;
  text-decoration: none;
  font-size: var(--t-xs);
  text-transform: uppercase;
  border: 1px solid var(--ink);
  transition: background-color 150ms ease, color 150ms ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-quiet:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------------- footer ---------------- */
footer {
  max-width: var(--wide);
  margin: 0 auto;
  padding: var(--s-4) var(--s-4) var(--s-6);
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  font-size: var(--t-xs);
  color: var(--muted);
}

/* ============================================================
   DETAIL PAGES
   ============================================================ */

.detail { --accent: var(--muted); }
.detail-ai      { --accent: var(--ai); }
.detail-flag    { --accent: var(--flag); }
.detail-clean   { --accent: var(--clean); }
.detail-unknown { --accent: var(--unknown); }

.back {
  font-size: var(--t-xs);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color var(--dur-1) var(--ease-std);
}
.back:hover { color: var(--ink); }

/* reading progress — case studies are long, this says how much is left */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 20;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

.d-head { padding: var(--s-5) 0; border-bottom: 1px solid var(--ink); }
.d-kind {
  display: inline-block;
  font-size: var(--t-xs);
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid currentColor;
  padding: 3px 9px;
  margin-bottom: var(--s-3);
}
.d-head h1 {
  margin: 0 0 var(--s-4);
  font-variation-settings: "wdth" 114;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, var(--t-2xl));
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.d-lede { max-width: var(--measure); font-size: var(--t-md); color: var(--muted); margin: 0; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--s-4);
  margin: var(--s-4) 0 0;
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--lift-2);
}
.fact dt { font-size: var(--t-xs); text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-1); }
.fact dd { margin: 0; font-size: var(--t-sm); }

.d-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; padding: var(--s-4) 0 0; }

.block { padding: var(--s-5) 0; border-bottom: 1px solid var(--rule-2); }
.block:last-of-type { border-bottom: 0; }
.block h2 {
  font-size: var(--t-lg);
  margin-bottom: var(--s-4);
  padding-left: var(--s-3);
  border-left: 3px solid var(--accent);
  line-height: 1.2;
}

/* long-form reading measure: larger type, looser leading, more air
   between paragraphs than the marketing copy on the home page */
.block p,
.bullets li,
.d-lede {
  font-size: var(--t-read);
  line-height: 1.72;
}
.block p { max-width: var(--measure); }
.block p + p { margin-top: var(--s-4); }
.bullets li { margin-bottom: var(--s-3); }

/* callout: a finding worth stopping on */
.callout {
  max-width: var(--measure);
  margin: var(--s-4) 0;
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  box-shadow: var(--lift-1);
}
.callout p { margin: 0; }
.callout p + p { margin-top: var(--s-3); }
.callout-k {
  display: block;
  margin-bottom: var(--s-2);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* section index in the right gutter, which is otherwise 500px of nothing */
.toc {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: start;
  position: sticky;
  top: var(--s-4);
  padding-left: var(--s-4);
  border-left: 1px solid var(--rule);
}
.toc-k {
  display: block;
  margin-bottom: var(--s-3);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; margin-bottom: var(--s-2); }
.toc a {
  display: block;
  font-size: var(--t-sm);
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--dur-1) var(--ease-std);
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--rule);
  margin-right: 8px;
}
.toc a:hover { color: var(--ink); }
.toc a.here { color: var(--ink); font-weight: 600; }
.toc a.here::before { color: var(--accent); }
/* decisions table sits on its own surface inside the block */
.block .rows {
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--lift-2);
  padding: var(--s-2) var(--s-4) var(--s-4);
  margin-top: var(--s-4);
}
.block p + p { margin-top: var(--s-3); }
.block > p:first-of-type { margin-top: 0; }

.bullets { max-width: var(--measure); margin: 0; padding-left: 20px; }
.bullets li { margin-bottom: var(--s-2); }
.bullets li::marker { color: var(--accent); }

/* architecture diagrams */
.diagram {
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--lift-1);
  padding: var(--s-4);
  margin: var(--s-4) 0 var(--s-2);
  overflow-x: auto;
}
.diagram svg { display: block; width: 100%; height: auto; min-width: 520px; }
.dg-box { fill: var(--paper); stroke: var(--rule); }
.dg-box-accent { fill: var(--paper); stroke: var(--accent); stroke-width: 1.6; }
.dg-t { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em; fill: var(--ink); }
.dg-s { font-family: var(--mono); font-size: 8px; fill: var(--muted); }
.dg-line { stroke: var(--rule); fill: none; }
.dg-arrow { fill: var(--muted); }
.dg-cap { font-family: var(--mono); font-size: 8px; fill: var(--muted); letter-spacing: 0.08em; }
.diagram-note { font-size: var(--t-sm); color: var(--muted); margin: 0; letter-spacing: 0; font-family: var(--sans); }

.more { padding: var(--s-5) 0 0; border-top: 1px solid var(--rule); }
.more-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s-2); margin-top: var(--s-3); }
.more-list a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left-width: 3px;
  box-shadow: var(--lift-2);
  padding: var(--s-3) var(--s-4);
  text-decoration: none;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.more-list a:hover { transform: translateY(-3px); box-shadow: var(--lift-3); }
.more-list .m-kind { display: block; font-size: var(--t-xs); text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-1); }
.more-list .m-name { font-weight: 600; font-size: var(--t-sm); }
.m-ai      { border-left-color: var(--ai); }
.m-flag    { border-left-color: var(--flag); }
.m-clean   { border-left-color: var(--clean); }
.m-unknown { border-left-color: var(--unknown); }

/* ---------------- read pass (Verita case study) ---------------- */
.pass {
  border: 1px solid var(--rule);
  background: var(--surface);
  box-shadow: var(--lift-1);
  padding: var(--s-3) var(--s-4);
  margin: var(--s-4) 0 var(--s-2);
}
.pass-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-3); }
.label { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pass-status { color: var(--ai); }
.pass-status.done { color: var(--clean); }

.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(9px, 1fr)); grid-auto-rows: 24px; gap: 3px; }
.frame { background: var(--rule-2); opacity: 0.55; transition: background-color 260ms ease, opacity 260ms ease; }
.frame.read { opacity: 1; }
.frame.read.f-clean   { background: var(--clean); }
.frame.read.f-ai      { background: var(--ai); }
.frame.read.f-flag    { background: var(--flag); }
.frame.read.f-unknown { background: var(--unknown); }

.legend { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-4); }
.leg { display: flex; align-items: center; gap: 7px; font-size: var(--t-sm); }
.swatch { width: 9px; height: 9px; flex: none; }
.leg-clean   .swatch { background: var(--clean); }
.leg-ai      .swatch { background: var(--ai); }
.leg-flag    .swatch { background: var(--flag); }
.leg-unknown .swatch { background: var(--unknown); }
.leg-name { color: var(--muted); }
.leg-num { font-family: var(--mono); font-size: var(--t-xs); }

/* ---------------- scroll reveal ----------------
   Applied by JS so content stays visible if the script never runs. */
.will-reveal { opacity: 0; transform: translateY(14px); }
.will-reveal.shown {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}

/* ---------------- motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame, .repo a, .repo-glyph, .btn, .nav-links a, .job-link, .hero-links a { transition: none; }
  .repo a:hover { transform: none; }
  /* render every entrance in its final state */
  .hero .spec-top, .hero .spec-bottom, .specimen .line,
  .hero .lede, .hero .hero-links { animation: none; }
  .will-reveal, .will-reveal.shown { opacity: 1; transform: none; transition: none; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .repos { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: var(--s-2); }
  .row-head { display: none; }
  .proof-k { display: block; }
  .stack-row, .split { grid-template-columns: 1fr; gap: var(--s-2); }
  .job { padding: var(--s-3) var(--s-4) var(--s-4); }
  .job-link { margin-left: 0; }
  .detail .proof { border-left: 2px solid var(--accent); padding-left: 14px; }
  .block .rows { padding: var(--s-2) var(--s-3) var(--s-3); }
  .toc { display: none; }
}

@media (max-width: 600px) {
  main, .nav, footer { padding-left: var(--s-3); padding-right: var(--s-3); }
  .hero { padding: var(--s-5) 0 var(--s-6); }
  section { padding: var(--s-5) 0; }
  .nav-links { gap: var(--s-3); }
  .spec-meta { font-size: 0.6875rem; }
  .strip { grid-auto-rows: 18px; }
}
