/* ============================================================
   Prajwal Hoblidar — portfolio
   Direction: chart-recorder (deal 1ca4b3ab, rank #3 of 7)
   All values come from DESIGN.md. Do not introduce near-duplicates.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  /* ground and surfaces */
  --ground: #12171A;
  --surface: #171E21;
  --surface-2: #1D2629;

  /* rules */
  --rule: #253034;
  --rule-2: #3B4A4F;
  --rail-line: #2C383C;

  /* ink */
  --ink: #E9E4D9;
  --ink-2: #A6B0AE;
  --ink-3: #98A3A1;

  /* pen (signal: the trace, the tick, the focus ring) */
  --pen: #F0603F;
  --pen-wash: rgba(240, 96, 63, 0.12);

  /* type */
  --face-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --face-text: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --face-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-h1: clamp(38px, 6.4vw, 82px);
  --fs-h2: clamp(27px, 3.4vw, 42px);
  --fs-h3: 22px;
  --fs-entry: 17px;
  --fs-body: 16px;
  --fs-small: 13.5px;
  --fs-micro: 12px;

  /* space */
  --s1: 4px;  --s2: 8px;   --s3: 12px;  --s4: 16px;
  --s5: 24px; --s6: 32px;  --s7: 48px;  --s8: 64px;
  --s9: 96px; --s10: 128px;

  /* geometry */
  --col: 1180px;
  --gut: clamp(20px, 4vw, 56px);
  --rail: 88px;
  --rail-pad: 40px;
  --head-h: 60px;
  --radius: 2px;

  /* motion roles (mapped from DESIGN.md) */
  --d-press: 80ms;
  --d-release: 520ms;
  --d-hover: 200ms;
  --d-focus: 160ms;
  --d-state: 260ms;
  --e-out: cubic-bezier(0.2, 0, 0, 1);
  --e-color: cubic-bezier(0.25, 0.1, 0.25, 1);
  --spring-pop: linear(0, 0.044, 0.155, 0.307, 0.475, 0.642, 0.794, 0.922, 1.023, 1.094, 1.139, 1.16, 1.162, 1.15, 1.129, 1.103, 1.075, 1.049, 1.025, 1.006, 0.991, 0.981, 0.976, 0.973, 0.974, 0.977, 0.981, 0.985, 0.989, 0.994, 0.997, 1, 1.002, 1.003, 1.004, 1.004, 1.004, 1.004, 1.003, 1.002, 1);
  --spring-snap: linear(0, 0.03, 0.105, 0.207, 0.32, 0.435, 0.545, 0.644, 0.732, 0.806, 0.867, 0.915, 0.953, 0.981, 1.001, 1.015, 1.023, 1.027, 1.028, 1.028, 1.026, 1.023, 1.02, 1.016, 1.013, 1.01, 1.008, 1.006, 1.004, 1.003, 1);

  --ui-focus-ring: var(--pen);
  --ui-highlight: rgba(233, 228, 217, 0.20);
  --ui-highlight-on-light: rgba(18, 23, 26, 0.12);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 24px); }
body {
  margin: 0;
  text-wrap: pretty;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--face-text);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, table { margin: 0; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; }
table { border-collapse: collapse; }
svg { display: block; }
::selection { background: var(--pen); color: var(--ground); }
:focus-visible { outline: 2px solid var(--ui-focus-ring); outline-offset: 3px; border-radius: 1px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: var(--s5); top: -60px; z-index: 20;
  background: var(--ink); color: var(--ground); padding: 10px 16px;
  font-size: var(--fs-small); border-radius: var(--radius);
  transition: top var(--d-focus) var(--e-out);
}
.skip:focus-visible { top: var(--s3); }

/* ---------- layout ---------- */
.wrap {
  width: min(var(--col), 100% - (2 * var(--gut)));
  margin-inline: auto;
}
.wrap--rail {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
}
.band-body { padding-left: var(--rail-pad); min-width: 0; }
.rail { position: relative; }
.rail::before {
  content: ""; position: absolute; inset: 0 0 0 auto; width: 1px;
  background: var(--rail-line);
}
.rail::after {
  content: ""; position: absolute; right: 0; top: 10px;
  width: 14px; height: 2px; background: var(--pen);
}

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
  transition: border-color var(--d-hover) var(--e-color);
}
.site-head.is-scrolled { border-bottom-color: var(--rule-2); }
.head-row {
  display: flex; align-items: center; gap: var(--s5);
  height: var(--head-h);
}
.brand {
  font-family: var(--face-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.nav {
  display: flex; align-items: center; gap: var(--s5);
  margin-left: auto;
}
.nav-link {
  display: inline-flex; align-items: center;
  min-height: 42px; line-height: 1;
  font-size: var(--fs-small);
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { color: var(--ink); }
.clock {
  font-family: var(--face-mono);
  font-size: var(--fs-micro);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 5px;
  border-left: 1px solid var(--rule);
  padding-left: var(--s4);
  white-space: nowrap;
}
.clock-zone { color: var(--ink-3); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 var(--s5); line-height: 1;
  font-family: var(--face-text);
  font-size: var(--fs-small); font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn--primary {
  background: var(--ink);
  color: #10161A;
  border-color: var(--ink);
}

/* ---------- hero ---------- */
.hero { padding-top: clamp(48px, 7vw, 84px); }
.hero h1 {
  font-family: var(--face-display);
  font-weight: 800;
  font-size: var(--fs-h1);
  line-height: 0.94;
  letter-spacing: -0.022em;
  text-transform: uppercase;
  max-width: 19ch;
  text-wrap: balance;
}
.lead {
  margin-top: var(--s5);
  max-width: 46ch;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.55;
  color: var(--ink-2);
}
.hero-actions {
  display: flex; align-items: center; gap: var(--s6);
  margin-top: var(--s6);
  flex-wrap: wrap;
}
a.quiet-link {
  display: inline-flex; align-items: center;
  min-height: 42px;
  font-size: var(--fs-small); color: var(--ink-2);
  background-image: linear-gradient(var(--rule-2), var(--rule-2));
  background-size: 100% 1px;
  background-position: 0 100%;
}
a.quiet-link:hover, a.quiet-link:focus-visible {
  background-image: linear-gradient(currentColor, currentColor);
  color: var(--ink);
}

.meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s5);
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: var(--s5);
  border-top: 1px solid var(--rule);
}
.meta-cell dt {
  font-family: var(--face-mono);
  font-size: var(--fs-micro);
  color: var(--ink-3);
  margin-bottom: 6px;
}
.meta-cell dd { font-size: var(--fs-small); color: var(--ink); line-height: 1.45; }

/* ---------- index ---------- */
.index-wrap { margin-top: var(--s8); }
.index { width: 100%; }
.index thead th {
  font-family: var(--face-text);
  font-weight: 400;
  font-size: var(--fs-micro);
  color: var(--ink-3);
  text-align: left;
  padding: 0 0 var(--s3);
  border-bottom: 1px solid var(--rule);
}
.index tbody tr { border-bottom: 1px solid var(--rule); }
.index td, .index tbody th { padding: var(--s4) 0; vertical-align: baseline; text-align: left; }
.c-code {
  width: 84px;
  font-family: var(--face-mono);
  font-size: var(--fs-micro);
  color: var(--ink-3);
  font-weight: 400;
  letter-spacing: 0;
}
.c-name { font-weight: 500; font-size: var(--fs-h3); letter-spacing: -0.01em; }
.c-name a {
  display: inline-block;
  text-decoration: none;
  background: linear-gradient(var(--rule-2), var(--rule-2)) 0 100% / 100% 1px no-repeat;
  transition: background-size 320ms var(--e-out), color var(--d-hover) var(--e-color);
}
.c-name a:hover, .c-name a:focus-visible {
  background-image: linear-gradient(currentColor, currentColor);
}
.index .c-outcome, .index thead th.c-outcome {
  width: 240px;
  padding-right: var(--s6);
  text-align: right;
  font-size: var(--fs-micro);
  color: var(--ink-2);
  font-family: var(--face-mono);
}
.c-period, .index thead th.c-period {
  width: 120px; text-align: right;
  font-family: var(--face-mono); font-size: var(--fs-micro); color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.index tbody tr { transition: background-color var(--d-hover) var(--e-color); }
@media (hover: hover) and (pointer: fine) {
  .index tbody tr:hover { background: var(--surface); }
  .index tbody tr:hover .c-code { color: var(--pen); }
  .index tbody tr:hover .c-name a { color: var(--ink); }
}
.c-name a.ui-link { background-position: 0 100%; }

/* ---------- band ---------- */
.band {
  border-top: 1px solid var(--rule);
  padding-block: clamp(64px, 8vw, 104px);
}
.band h2 {
  font-family: var(--face-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.06;
  letter-spacing: -0.02em;
  max-width: 24ch;
}

/* ---------- strip: the recording ---------- */
.strip {
  margin-top: var(--s7);
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: var(--s5) var(--s5) var(--s6);
}
.strip-scale {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  font-family: var(--face-mono);
  font-size: var(--fs-micro);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--rule-2);
  padding-bottom: 6px;
}
.strip-scale span { position: relative; }
.strip-scale span::before {
  content: ""; position: absolute; left: 0; top: 100%; margin-top: 6px;
  width: 1px; height: 7px; background: var(--rule-2);
}
.strip-scale span:first-child::before { background: var(--ink-3); }
.strip-track { position: relative; margin-top: 26px; height: 34px; }
.strip-band {
  position: absolute; top: 0; height: 100%;
  left: calc(var(--s) * 1%);
  right: calc((100 - var(--e)) * 1%);
  background: var(--surface-2);
  border: 1px solid var(--rule-2);
  display: flex; align-items: center; padding: 0 var(--s3);
  overflow: hidden;
  animation: band-in 700ms var(--e-out) both;
}
.strip-band--live { border-color: var(--pen); }
.strip-band span {
  font-family: var(--face-mono);
  font-size: var(--fs-micro);
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.strip-band--live span { color: var(--ink); }
.strip-now {
  position: absolute; top: -6px; bottom: 0; right: 0; width: 1px;
  background: var(--pen);
}
.strip-now::after {
  content: "NOW";
  position: absolute; top: -16px; right: 0;
  font-family: var(--face-mono); font-size: 9.5px; letter-spacing: 0.08em;
  color: var(--pen);
}
.strip-list { display: none; }
.strip-list li {
  display: flex; gap: var(--s4); align-items: baseline;
  padding-block: var(--s3);
  border-top: 1px solid var(--rule);
  font-size: var(--fs-small); color: var(--ink);
}
.strip-list li:first-child { border-top: 0; }
.strip-list-when {
  font-family: var(--face-mono); font-size: var(--fs-micro);
  color: var(--ink-3); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@keyframes band-in {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* ---------- jobs ---------- */
.jobs { margin-top: var(--s7); }
.job {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: var(--s3) var(--s6);
  padding-block: var(--s6);
  border-top: 1px solid var(--rule);
}
.job:first-child { border-top: 0; padding-top: 0; }
.job-when {
  font-family: var(--face-mono);
  font-size: var(--fs-micro);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  grid-row: 1 / span 4;
  padding-top: 4px;
}
.job h3 {
  font-family: var(--face-display);
  font-weight: 600;
  font-size: var(--fs-h3);
  letter-spacing: -0.01em;
  grid-column: 2;
}
.job-where { grid-column: 2; font-size: var(--fs-small); color: var(--ink-3); font-family: var(--face-mono); }
.job-what { grid-column: 2; max-width: 56ch; color: var(--ink-2); font-size: var(--fs-body); }
.figures {
  grid-column: 2;
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6);
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--rule);
}
.figures li { font-size: var(--fs-small); color: var(--ink-3); }
.fig {
  font-family: var(--face-mono);
  font-size: 15px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}

/* ---------- entries ---------- */
.entry {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: var(--s3) var(--s4);
  margin-top: var(--s8); padding-top: var(--s6);
  border-top: 1px solid var(--rule);
}
.entry-main { display: grid; gap: var(--s5); min-width: 0; }
.entry:first-of-type { margin-top: var(--s7); }
.entry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--s4);
}
.entry-code {
  font-family: var(--face-mono); font-size: var(--fs-micro); color: var(--pen);
  padding-top: 4px;
}
.entry-title {
  font-family: var(--face-display);
  font-weight: 600;
  font-size: clamp(20px, 2.2vw, 26px);
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.entry-period {
  font-family: var(--face-mono); font-size: var(--fs-micro);
  color: var(--ink-3); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.entry-lede {
  grid-column: 1 / -1;
  max-width: 62ch;
  font-size: var(--fs-entry);
  line-height: 1.5;
  color: var(--ink);
}
.specs {
  display: grid; gap: 9px;
  max-width: 68ch;
}
.specs li {
  position: relative;
  padding-left: var(--s5);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.specs li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 5px; height: 1px; background: var(--rule-2);
}
.plate {
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: var(--s4);
  overflow-x: auto;
}
.plate svg { min-width: 460px; width: 100%; height: auto; }
.p-line path { fill: none; stroke: var(--rule-2); stroke-width: 1; }
.p-node rect { fill: var(--surface-2); stroke: var(--rule-2); stroke-width: 1; }
.p-node rect.pen { fill: var(--pen-wash); stroke: var(--pen); }
marker path { fill: none; stroke: var(--ink-3); stroke-width: 1.25; }
.p-label text, .p-note text {
  font-family: var(--face-mono); font-size: 10px; fill: var(--ink-2);
  letter-spacing: 0.04em; text-anchor: middle;
}
.p-note text { fill: var(--ink-3); font-size: 9px; letter-spacing: 0.02em; text-anchor: start; }

.entry-figs {
  display: flex; flex-wrap: wrap; gap: var(--s5) var(--s7);
  padding-top: var(--s4);
  border-top: 1px solid var(--rule);
}
.entry-figs dt { font-family: var(--face-mono); font-size: var(--fs-micro); color: var(--ink-3); }
.entry-figs dd {
  font-size: var(--fs-body); color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}

/* ---------- matrix ---------- */
.matrix { width: 100%; margin-top: var(--s6); }
.matrix tr { border-top: 1px solid var(--rule); }
.matrix tr:last-child { border-bottom: 1px solid var(--rule); }
.matrix th {
  text-align: left;
  font-weight: 400;
  font-size: var(--fs-small);
  color: var(--ink-3);
  width: 132px;
  padding: var(--s4) var(--s4) var(--s4) 0;
  vertical-align: baseline;
}
.matrix td { padding: var(--s4) 0; font-size: 15px; color: var(--ink-2); line-height: 1.55; }

/* ---------- credentials ---------- */
.creds { margin-top: var(--s6); }
.creds li {
  padding-block: var(--s5);
  border-top: 1px solid var(--rule);
}
.creds li:last-child { border-bottom: 1px solid var(--rule); }
.cred-name { font-size: var(--fs-entry); color: var(--ink); }
.cred-by { font-size: var(--fs-small); color: var(--ink-3); margin-top: 2px; }
.langs { margin-top: var(--s5); font-size: var(--fs-small); color: var(--ink-2); }
.langs-label {
  font-family: var(--face-mono); font-size: var(--fs-micro);
  color: var(--ink-3); margin-right: var(--s3);
}

/* ---------- contact ---------- */
.band--contact { padding-bottom: clamp(72px, 9vw, 120px); }
.mailto {
  display: inline-block;
  margin-top: var(--s5);
  font-family: var(--face-display);
  font-weight: 700;
  font-size: clamp(22px, 4.2vw, 50px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--rule-2);
  background: none;
  transition: border-color var(--d-hover) var(--e-color), opacity 120ms linear;
}
@media (hover: hover) and (pointer: fine) { .mailto:hover { border-color: var(--pen); } }
.mailto:focus-visible { border-color: var(--pen); }
.mailto:active { opacity: 0.6; transition-duration: 40ms; }
.contact-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s5);
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid var(--rule);
}
.contact-rows dt {
  font-family: var(--face-mono); font-size: var(--fs-micro);
  color: var(--ink-3); margin-bottom: 6px;
}
.contact-rows dd { font-size: var(--fs-small); color: var(--ink-2); }
.contact-rows a { text-decoration: none; color: var(--ink); }

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--rule);
  padding-block: var(--s7) var(--s8);
  background: var(--surface);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr 1.4fr;
  gap: var(--s6);
}
.foot-name {
  font-family: var(--face-display); font-weight: 700; font-size: var(--fs-small);
  letter-spacing: 0.13em; text-transform: uppercase;
}
.foot-line { margin-top: var(--s2); font-size: var(--fs-small); color: var(--ink-3); max-width: 30ch; }
.foot-label { font-family: var(--face-mono); font-size: var(--fs-micro); color: var(--ink-3); margin-bottom: var(--s3); }
.foot-grid ul { display: grid; gap: 6px; }
.foot-grid li a { font-size: var(--fs-small); color: var(--ink-2); text-decoration: none; }
.foot-note { font-size: var(--fs-micro); color: var(--ink-3); line-height: 1.5; }

/* ============================================================
   interaction kit (ported from better-design/assets/motion)
   press: compress ≤90ms + bloom from the point + spring release
   ============================================================ */
.ui-press {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transform: scale(1);
  transition:
    transform var(--d-release) var(--spring-pop),
    background-color var(--d-hover) var(--e-color),
    color var(--d-hover) var(--e-color),
    border-color var(--d-hover) var(--e-color),
    filter var(--d-hover) var(--e-color),
    outline-offset var(--d-focus) var(--e-out),
    outline-color var(--d-focus) var(--e-out);
}
.ui-press:active:not(:disabled), .ui-press[data-pressed] {
  transform: scale(var(--ui-press-scale, 0.96));
  filter: brightness(var(--ui-press-brightness, 0.92));
  transition-duration: var(--d-press);
  transition-timing-function: var(--e-out);
}
.btn--primary.ui-press { --ui-press-brightness: 0.93; --ui-hover-brightness: 0.96; }
.ui-press::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--ui-px, 50%) var(--ui-py, 50%),
    var(--ui-bloom, var(--ui-highlight-on-light)) 0%, transparent var(--ui-bloom-r, 70%));
  opacity: 0;
  transition: opacity 600ms var(--e-out);
}
.btn--primary.ui-press::after { --ui-bloom: var(--ui-highlight-on-light); }
.btn--primary.ui-press[data-pressed]::after { opacity: 1; transition-duration: 90ms; }
@media (hover: hover) and (pointer: fine) {
  .ui-press:hover { filter: brightness(var(--ui-hover-brightness, 1)); }
}

.ui-link {
  color: inherit;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 320ms var(--e-out), opacity 120ms linear,
    color var(--d-hover) var(--e-color);
}
@media (hover: hover) and (pointer: fine) { .ui-link:hover { background-size: 100% 1px; } }
.ui-link:focus-visible { background-size: 100% 1px; }
.ui-link:active { opacity: 0.6; transition-duration: 320ms, 40ms, var(--d-hover); }

.ui-dim {
  transition: opacity 320ms var(--e-out), color var(--d-hover) var(--e-color);
}
.ui-dim:active, .ui-dim[data-pressed] { opacity: 0.5; transition-duration: 40ms, var(--d-hover); }

/* ---------- reduced motion: keep state, drop travel ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ui-press, .ui-link, .ui-dim { transition-property: background-color, color, filter, opacity, background-size, outline-offset; }
  .ui-press:active:not(:disabled), .ui-press[data-pressed] { transform: none; }
  .strip-band { animation: none; }
  @keyframes band-in { from { clip-path: none; } to { clip-path: none; } }
}

/* ============================================================
   scroll motion — the recorder drawing itself in
   Reveals are opacity + 16px rise, staggered per group, one
   observer, and they never gate content: without JS (or with
   reduced motion) everything is simply visible.
   ============================================================ */
[data-reveal] {
  transition:
    opacity 700ms var(--e-out),
    transform 820ms var(--e-out);
  transition-delay: calc(var(--ri, 0) * 70ms);
}
html.has-js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
}
html.has-js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}
/* headings are laid down from the top, like a line being written */
html.has-js [data-reveal="mask"] {
  opacity: 1;
  transform: none;
  clip-path: inset(-6% 0 104% 0);
  transition: clip-path 1000ms var(--e-out);
  transition-delay: 0ms;
}
html.has-js [data-reveal="mask"].is-in {
  clip-path: inset(-6% 0 -14% 0);
}
/* table rows animate opacity only: transforms on rows are unreliable */
html.has-js tr[data-reveal] { transform: none; }

/* the schematics draw their own connections once they are on screen */
.plate[data-draw] .p-line path {
  transition: stroke-dashoffset 900ms var(--e-out);
}
.plate[data-draw].is-in .p-line path { stroke-dashoffset: 0 !important; }

/* the pen filling the section spine as the reader advances */
.rail-pen {
  position: absolute;
  top: 0; right: -0.5px;
  width: 2px; height: 100%;
  background: var(--pen);
  transform: scaleY(0);
  transform-origin: top center;
  will-change: transform;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  /* no travel, no masks, no drawing — but the fade stays, so nothing pops in */
  [data-reveal] { transition: opacity 240ms linear; transition-delay: 0ms; }
  html.has-js [data-reveal] { transform: none; }
  html.has-js [data-reveal="mask"] { clip-path: none; }
  .plate[data-draw] .p-line path { transition: none; stroke-dashoffset: 0 !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  :root { --rail: 44px; --rail-pad: 24px; }
  .job { grid-template-columns: 1fr; }
  .job-when { grid-row: auto; padding-top: 0; }
  .job h3, .job-where, .job-what, .figures { grid-column: 1; }
  .foot-grid { grid-template-columns: 1fr 1fr; row-gap: var(--s7); }
  .entry { grid-template-columns: 1fr; }
  .entry-code { padding-top: 0; }
  .entry-head { grid-template-columns: 1fr; row-gap: var(--s1); }
}
@media (max-width: 780px) {
  .nav-link { display: none; }
  .clock { border-left: 0; padding-left: 0; }
}
@media (max-width: 720px) {
  .meta { grid-template-columns: 1fr; gap: var(--s4); }
  .contact-rows { grid-template-columns: 1fr; gap: var(--s4); }
  .index .c-outcome { display: none; }
  .c-code { width: 60px; }
  .c-name { font-size: 18px; }
  .c-period { width: 96px; }
  .creds li { grid-template-columns: 1fr; }
  .matrix th { display: block; width: auto; padding-bottom: 2px; }
  .matrix td { display: block; padding-top: 0; padding-bottom: var(--s4); }
  .matrix tr { display: block; padding-top: var(--s4); }
  .strip { padding: var(--s4); }
  .strip-scale, .strip-track { display: none; }
  .strip-list { display: block; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .clock { display: none; }
  .hero-actions { gap: var(--s5); }
  .index .c-period { width: 78px; }
  .strip-scale span:nth-child(even) { visibility: hidden; }
  /* break the address at the @ on a phone, never mid-domain */
  .mailto { font-size: 22px; letter-spacing: -0.025em; }
}
