/* Dhruvraj Singh Shekhawat - engineering portfolio
   Visual language: road vernacular. Asphalt surfaces, lane-paint text, kerb
   hairlines, road-sign plates. Colour carries meaning:
     sign blue   = wayfinding          signal blue = links, focus
     V2V violet  = live / connected    hazard amber = warnings, active state */

:root {
  --asphalt: #16191e;
  --asphalt-deep: #101317;
  --shoulder: #1e2228;
  --shoulder-2: #252a32;
  --kerb: #333a44;
  --kerb-soft: #262b33;
  --paint: #ece6d6;
  --paint-dim: #a6abb2;
  --paint-faint: #6c727b;
  --sign: #2f5fd0;
  --signal: #7aa5ff;
  --v2v: #a994ff;
  --hazard: #ffb13d;
  --danger: #ff8a7a;

  --font-body: "Barlow", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.28rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.5rem + 1.6vw, 2.5rem);
  --step-4: clamp(2.5rem, 1.8rem + 3vw, 3.6rem);
  --step-5: clamp(2.8rem, 1.9rem + 3.6vw, 4.4rem);

  --shell: 1200px;
  --gutter: clamp(1.1rem, 3vw, 2rem);
  --radius: 4px;
  --head-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 16px); }
body {
  margin: 0;
  background: var(--asphalt);
  color: var(--paint);
  font: 400 var(--step-0)/1.6 var(--font-body);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; outline: none; }
img, svg { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; }
h1, h2 { font-family: var(--font-display); letter-spacing: -0.005em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-family: var(--font-body); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--signal); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--paint); }
code { font-size: .92em; background: var(--shoulder); padding: .1em .35em; border-radius: 3px; }
strong { font-weight: 600; }
small, .small { font-size: var(--step--1); }
.muted { color: var(--paint-dim); }
::selection { background: var(--sign); color: #fff; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--sign); color: #fff; padding: .6rem 1rem; border-radius: var(--radius);
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.1rem;
  font: 500 var(--step-0)/1.1 var(--font-body);
  color: var(--paint); background: transparent;
  border: 1px solid var(--kerb); border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
  transition: border-color .15s, background-color .15s, color .15s;
}
.btn:hover { border-color: var(--paint-dim); color: var(--paint); background: var(--shoulder); }
.btn-primary { background: var(--sign); border-color: var(--sign); color: #fff; }
.btn-primary:hover { background: #3a6ce0; border-color: #3a6ce0; color: #fff; }
.btn-quiet { border-color: transparent; color: var(--signal); padding-inline: 0; }
.btn:disabled { opacity: .55; cursor: default; }
.text-link { font-weight: 500; white-space: nowrap; }

/* ---------- header & route navigation ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(22, 25, 30, .97);
  border-bottom: 1px solid var(--kerb-soft);
  view-transition-name: site-head;
}
.head-row { display: flex; align-items: center; gap: 1.5rem; min-height: var(--head-h); }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--paint); text-decoration: none; flex-shrink: 0; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--sign); color: #fff; border-radius: 6px;
  outline: 1.5px solid #fff; outline-offset: -4px;
  font: 600 .95rem/1 var(--font-display); letter-spacing: .02em;
}
.brand-name { font: 600 1.15rem/1.1 var(--font-display); }

.menu-toggle {
  display: none; margin-left: auto; align-items: center; gap: .6rem;
  min-height: 44px; padding: 0 .9rem; color: var(--paint); background: none;
  border: 1px solid var(--kerb); border-radius: var(--radius); font: 500 1rem var(--font-body); cursor: pointer;
}
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after {
  display: block; width: 16px; height: 2px; background: currentColor; position: relative; content: "";
}
.menu-toggle-bars::before { position: absolute; top: -5px; }
.menu-toggle-bars::after { position: absolute; top: 5px; }

.route { position: relative; margin-left: auto; flex: 1; max-width: 820px; }
.route-stops { display: grid; grid-template-columns: repeat(8, 1fr); position: relative; }
/* The road: a hairline with lane dashes, running under the stops. */
.route-stops::before {
  content: ""; position: absolute; left: 6.25%; right: 6.25%; bottom: 9px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--kerb) 0 10px, transparent 10px 16px);
}
.route-stops a {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding: .55rem .15rem 1.45rem; text-decoration: none; color: var(--paint-dim); text-align: center;
  transition: color .15s;
}
.route-stops a::after { /* stop marker */
  content: ""; position: absolute; left: 50%; bottom: 6px; width: 8px; height: 8px; margin-left: -4px;
  border-radius: 50%; background: var(--asphalt); border: 2px solid var(--kerb);
}
.route-stops a:hover { color: var(--paint); }
.route-stops a:hover::after { border-color: var(--paint-dim); }
.route-stops a[aria-current="page"] { color: var(--paint); }
.stop-label { font: 500 .98rem/1.2 var(--font-body); }
.stop-place { font-size: .72rem; line-height: 1.2; color: var(--paint-faint); white-space: nowrap; }
.route-stops a[aria-current="page"] .stop-place { color: var(--paint-dim); }

.route-car-track { position: absolute; left: 0; right: 0; bottom: 3px; height: 16px; pointer-events: none; }
.route-car-slot {
  width: 12.5%; height: 100%; display: flex; justify-content: center;
  transform: translateX(calc(var(--at, 0) * 100%));
  transition: transform .42s var(--ease);
  view-transition-name: route-car;
}
.route:not([data-at]) .route-car-track { display: none; }
.route[data-at="0"] { --at: 0; } .route[data-at="1"] { --at: 1; } .route[data-at="2"] { --at: 2; }
.route[data-at="3"] { --at: 3; } .route[data-at="4"] { --at: 4; } .route[data-at="5"] { --at: 5; }
.route[data-at="6"] { --at: 6; } .route[data-at="7"] { --at: 7; }
.route-car { width: 26px; height: 13px; fill: var(--hazard); }

@media (max-width: 999px) {
  .menu-toggle { display: inline-flex; }
  .route {
    display: none; position: fixed; inset: var(--head-h) 0 auto 0; max-width: none;
    background: var(--asphalt); border-bottom: 1px solid var(--kerb);
    padding: .5rem var(--gutter) 1.25rem; max-height: calc(100vh - var(--head-h)); overflow-y: auto;
  }
  .route.is-open { display: block; }
  .route-stops { grid-template-columns: 1fr; padding-left: 1.4rem; }
  .route-stops::before {
    left: 5px; right: auto; top: 12px; bottom: 12px; width: 2px; height: auto;
    background: repeating-linear-gradient(180deg, var(--kerb) 0 10px, transparent 10px 16px);
  }
  .route-stops a { flex-direction: row; align-items: baseline; gap: .75rem; padding: .7rem 0; text-align: left; }
  .route-stops a::after { left: -1.4rem; top: 50%; bottom: auto; margin: -4px 0 0 1px; }
  .route-stops a[aria-current="page"]::after { background: var(--hazard); border-color: var(--hazard); }
  .stop-label { font-size: 1.15rem; }
  .route-car-track { display: none; }
}
@media (min-width: 1000px) {
  .route-stops a[aria-current="page"]::after { border-color: transparent; background: transparent; }
}
@media (max-width: 420px) { .brand-name { font-size: 1rem; } }

/* ---------- page header: road-sign plate ---------- */
.page-head { padding: clamp(2rem, 5vw, 3.5rem) 0 2rem; max-width: 60rem; }
.page-head h1 { font-size: var(--step-4); line-height: 1; margin-bottom: .5rem; }
.lede { font-size: var(--step-1); color: var(--paint-dim); max-width: 42rem; line-height: 1.5; margin: .6rem 0 0; }
.sign {
  display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 1.1rem;
  padding: .42rem .8rem .42rem .45rem; background: var(--sign); color: #fff;
  border-radius: 7px; outline: 1.5px solid #fff; outline-offset: -4px;
  font: 500 1rem/1 var(--font-display);
}
.sign-exit { background: #fff; color: var(--sign); padding: .22rem .45rem; border-radius: 3px; font-weight: 600; font-size: .85rem; }
.breadcrumb { margin: 1.5rem 0 0; font-size: var(--step--1); color: var(--paint-dim); }
.breadcrumb + .page-head { padding-top: 1rem; }

/* ---------- home: hero ---------- */
.hero { display: grid; gap: 2rem; padding-top: clamp(1.5rem, 4vw, 3rem); padding-bottom: 2rem; align-items: start; }
@media (min-width: 1000px) { .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; } }
.hero-name { font-size: var(--step-5); line-height: .95; letter-spacing: -0.015em; margin-bottom: 1rem; }
.hero-role { font-size: var(--step-1); line-height: 1.35; margin-bottom: 1rem; }
.hero-areas { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.hero-areas li { font-size: .85rem; padding: .15rem .55rem; border: 1px solid var(--kerb); border-radius: 3px; color: var(--paint-dim); }
.hero-intro { max-width: 34rem; color: var(--paint); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }

/* ---------- home: drive interface ---------- */
.drive { min-width: 0; }
.drive-frame {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--asphalt-deep); border: 1px solid var(--kerb); border-radius: var(--radius);
}
@media (max-width: 640px) { .drive-frame { aspect-ratio: 4 / 3.4; } }
.drive-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.drive.is-driving .drive-canvas { touch-action: none; cursor: grab; }
.drive.is-driving .drive-frame { border-color: var(--signal); }
.drive-tag {
  position: absolute; top: .7rem; left: .75rem; margin: 0; padding: .15rem .5rem;
  font-size: .75rem; color: var(--paint-dim); background: rgba(16, 19, 23, .8); border: 1px solid var(--kerb-soft); border-radius: 3px;
}
.telemetry {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(16, 19, 23, .82); border-top: 1px solid var(--kerb-soft);
}
.telemetry div { padding: .45rem .75rem .5rem; border-left: 1px solid var(--kerb-soft); }
.telemetry div:first-child { border-left: 0; }
.telemetry dt { font-size: .7rem; color: var(--paint-dim); }
.telemetry dd { margin: 0; font: 600 1.35rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.telemetry small { font: 400 .72rem var(--font-body); color: var(--paint-dim); margin-left: .25rem; }
@media (max-width: 480px) {
  .telemetry div { padding: .35rem .5rem; }
  .telemetry dd { font-size: 1.1rem; }
  .telemetry small { display: none; }
}
.drive-banner { /* variable message sign */
  position: absolute; top: .6rem; right: .7rem; margin: 0; max-width: 70%;
  padding: .35rem .7rem; background: #0b0d10; border: 1px solid var(--kerb);
  color: var(--hazard); font: 600 .95rem/1.2 var(--font-display); letter-spacing: .01em;
}
.drive-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: .8rem; }
.btn-wheel[aria-pressed="true"] { border-color: var(--signal); color: var(--signal); }
.drive-help { flex: 1 1 16rem; margin: 0; font-size: var(--step--1); color: var(--paint-dim); line-height: 1.4; }
.keys-touch { display: none; }
@media (pointer: coarse) { .keys-desktop { display: none; } .keys-touch { display: inline; } }
.exits { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; width: 100%; }
.exits-label { font-size: var(--step--1); color: var(--paint-dim); margin-right: .25rem; }
.exit {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: .3rem .75rem;
  background: var(--sign); color: #fff; border-radius: 5px; outline: 1.5px solid #fff; outline-offset: -4px;
  font: 500 1rem/1 var(--font-display); text-decoration: none;
}
.exit:hover { color: #fff; background: #3a6ce0; }
.exit:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.exit-left::before { content: "\2196"; }
.exit-right::after { content: "\2197"; }
.touch-pad { display: grid; grid-template-columns: repeat(4, 52px); gap: .4rem; }
.touch-pad[hidden] { display: none; }
.touch-pad button {
  height: 48px; font-size: 1.1rem; color: var(--paint); background: var(--shoulder);
  border: 1px solid var(--kerb); border-radius: var(--radius); touch-action: manipulation; user-select: none;
}
.touch-pad button:active, .touch-pad button.is-held { background: var(--shoulder-2); border-color: var(--signal); }

/* ---------- status cluster ---------- */
.status { padding-top: 1rem; padding-bottom: 2.5rem; }
.cluster { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 0 1.25rem; margin: 0; }
.gauge { padding: .9rem 0 1rem; border-top: 1px solid var(--kerb); min-width: 0; }
.gauge dt { font-size: var(--step--1); color: var(--paint-dim); margin-bottom: .2rem; }
.gauge dd { margin: 0; }
.gauge-value { font: 600 2rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.gauge-value-sm { font-size: 1.45rem; }
.cluster-compact { margin-bottom: 2.5rem; }
.source { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--paint-dim); line-height: 1.35; }
.source::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--paint-faint); }
.source-live::before { background: var(--v2v); box-shadow: 0 0 0 3px rgba(169, 148, 255, .18); }
.source-stale::before { background: var(--hazard); }
.source-server::before { background: var(--signal); }
.source-offline::before { background: var(--danger); }
.gauge-note { margin-top: .3rem !important; font-size: .8rem; color: var(--paint-dim); line-height: 1.35; }
.gauge-empty { font: 400 .95rem/1.3 var(--font-body); color: var(--paint-dim); }

/* ---------- schematics ---------- */
.schematic { display: block; width: 100%; height: auto; font-family: var(--font-body); }
.schematic .sx-road { fill: #20242b; }
.schematic .sx-edge { fill: none; stroke: var(--paint-dim); stroke-width: 1.5; }
.schematic .sx-lane { fill: none; stroke: var(--paint-faint); stroke-width: 1.2; stroke-dasharray: 6 6; }
.schematic .sx-block { fill: var(--shoulder-2); stroke: var(--kerb); stroke-width: 1.2; }
.schematic .sx-accent { fill: none; stroke: var(--signal); stroke-width: 1.8; }
.schematic .sx-v2v { fill: none; stroke: var(--v2v); stroke-width: 1.6; stroke-dasharray: 4 4; }
.schematic .sx-packet { fill: var(--v2v); }
.schematic .sx-sight { fill: none; stroke: var(--paint-dim); stroke-width: 1.2; stroke-dasharray: 2 4; }
.schematic .sx-blocked { fill: none; stroke: var(--paint-faint); stroke-width: 1.2; stroke-dasharray: 2 4; }
.schematic .sx-x { stroke: var(--danger); stroke-width: 2; }
.schematic .sx-car { fill: var(--signal); }
.schematic .sx-car-a { fill: var(--paint); }
.schematic .sx-car-x { fill: var(--hazard); }
.schematic .sx-dot { fill: var(--paint); }
.schematic .sx-threshold { stroke: var(--hazard); stroke-width: 1.2; stroke-dasharray: 5 4; }
.schematic .sx-trace { fill: none; stroke: var(--signal); stroke-width: 1.8; stroke-linejoin: round; }
.schematic .sx-alarm { stroke: var(--hazard); stroke-width: 6; }
.schematic .sx-map { fill: #22324f; stroke: var(--kerb); }
.schematic .sx-map-region { fill: var(--v2v); opacity: .55; }
.schematic .sx-label { fill: var(--paint); font-size: 11px; }
.schematic .sx-label-dim { fill: var(--paint-dim); }
.schematic .sx-label-hazard { fill: var(--hazard); }
.schematic .sx-label-v2v { fill: var(--v2v); }

/* Bay floor: engineering-grid surface between painted bay lines. */
.bay-floor, .feature-figure, .bay-figure, .case-figure {
  margin: 0; padding: 1rem;
  background-color: var(--shoulder);
  background-image:
    linear-gradient(rgba(236, 230, 214, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 230, 214, .035) 1px, transparent 1px);
  background-size: 20px 20px;
  border-left: 3px solid rgba(236, 230, 214, .55);
  border-right: 3px solid rgba(236, 230, 214, .55);
}
figcaption { margin-top: .6rem; font-size: .8rem; color: var(--paint-dim); }

/* ---------- home: featured build ---------- */
.feature {
  display: grid; gap: 2rem; padding-top: 3rem; padding-bottom: 3rem;
  border-top: 1px solid var(--kerb-soft); align-items: center;
}
@media (min-width: 900px) { .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; } }
.bay-tag { font: 500 1rem/1 var(--font-display); color: var(--hazard); margin-bottom: .8rem; }
.feature-title { font-size: var(--step-4); line-height: 1; }
.feature-sub { font-size: var(--step-1); color: var(--paint-dim); margin: .3rem 0 1rem; }
.versus { margin: 1.5rem 0; }
.versus-row { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .65rem .9rem; background: var(--shoulder); margin-bottom: 2px; }
.versus-with { border-left: 3px solid var(--v2v); }
.versus-without { border-left: 3px solid var(--hazard); }
.versus-label { font: 600 1.05rem/1.3 var(--font-display); }
.versus-value { line-height: 1.35; }
.versus .source { margin-top: .6rem; }
@media (max-width: 480px) { .versus-row { grid-template-columns: 1fr; gap: .15rem; } }

/* ---------- section heads & lists ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.25rem; }
.selected, .writing { padding-top: 2.5rem; padding-bottom: 2.5rem; border-top: 1px solid var(--kerb-soft); }
.bay-row {
  display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; align-items: start;
  padding: 1.25rem 0; border-top: 1px solid var(--kerb-soft);
}
.bay-row:first-child { border-top: 0; }
.bay-row h3 a { color: var(--paint); text-decoration: none; }
.bay-row h3 a:hover { color: var(--signal); }
.bay-row p { margin: .3rem 0 0; color: var(--paint-dim); max-width: 44rem; }
.bay-num { font: 500 1rem/1.4 var(--font-display); color: var(--paint-dim); }
.bay-row-schematic { display: none; }
@media (min-width: 800px) {
  .bay-row { grid-template-columns: 4.5rem minmax(0, 1fr) 180px; }
  .bay-row-schematic { display: block; opacity: .85; }
}
.post-list li { padding: .8rem 0; border-top: 1px solid var(--kerb-soft); display: flex; flex-wrap: wrap; gap: .2rem 1rem; justify-content: space-between; }
.post-list li:first-child { border-top: 0; }
.post-cat { font-size: var(--step--1); color: var(--paint-dim); }

/* ---------- projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .75rem; }
.chip {
  display: inline-flex; align-items: center; min-height: 38px; padding: .25rem .85rem;
  border: 1px solid var(--kerb); border-radius: var(--radius); color: var(--paint-dim);
  text-decoration: none; font-weight: 500; font-size: .95rem; background: none; cursor: pointer;
}
.chip:hover { color: var(--paint); border-color: var(--paint-dim); }
.chip[aria-current="true"] { background: var(--paint); border-color: var(--paint); color: var(--asphalt); }
.filter-status { min-height: 1.4em; font-size: var(--step--1); margin-bottom: 1rem; }
.bays { display: grid; gap: 0; }
.bay { display: grid; gap: 1.5rem; padding: 2rem 0; border-top: 1px solid var(--kerb-soft); }
.bay[hidden] { display: none; }
@media (min-width: 820px) { .bay { grid-template-columns: 300px minmax(0, 1fr); gap: 2.5rem; } }
.bay-figure, .case-figure, .feature-figure { align-self: start; }
.bay-featured .bay-figure { border-color: var(--hazard); }
.bay-body .bay-num { margin-bottom: .25rem; }
.bay-featured .bay-num { color: var(--hazard); }
.bay-title { font-size: var(--step-3); line-height: 1.05; }
.bay-title a { color: var(--paint); text-decoration: none; }
.bay-title a:hover { color: var(--signal); }
.bay-sub { color: var(--paint-dim); margin: .25rem 0 .75rem; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 1rem; }
.tags li { font-size: .8rem; padding: .15rem .5rem; border: 1px solid var(--kerb); border-radius: 3px; color: var(--paint-dim); }
.tags-lg li { font-size: .95rem; padding: .3rem .7rem; color: var(--paint); }
.bay-gh { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1rem; }
.repo-meta { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; margin: 0; font-size: .85rem; }
.repo-meta div { display: flex; gap: .35rem; }
.repo-meta dt { color: var(--paint-dim); }
.repo-meta dd { margin: 0; font-variant-numeric: tabular-nums; }
.repo-section { padding: 2.5rem 0 1rem; border-top: 1px solid var(--kerb); margin-top: 1rem; }
.repo-section h2 { font-size: var(--step-2); }
.repo-list { display: grid; gap: .75rem; }
@media (min-width: 760px) { .repo-list { grid-template-columns: 1fr 1fr; } }
.repo { border: 1px solid var(--kerb-soft); padding: 1.1rem 1.2rem; }
.earlier li { padding: .75rem 0; border-top: 1px solid var(--kerb-soft); }
.earlier li:first-child { border-top: 0; }
.earlier-title { font-weight: 600; margin-right: .5rem; }
.repo h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.repo h3 a { text-decoration: none; }
.repo p { font-size: .95rem; margin-bottom: .6rem; }
.repo .text-link { font-size: .9rem; display: inline-block; margin-top: .5rem; }
.notice { padding: .75rem 1rem; border-left: 3px solid var(--signal); background: var(--shoulder); margin: 1rem 0; font-size: .95rem; }
.notice-draft { border-left-color: var(--hazard); }
.empty-state { padding: 2rem 0; color: var(--paint-dim); }

/* ---------- project detail ---------- */
.case-top { display: grid; gap: 2rem; padding-bottom: 2rem; }
@media (min-width: 900px) { .case-top { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 3rem; } }
.case-summary { font-size: var(--step-1); line-height: 1.5; max-width: 40rem; }
.spec { display: grid; gap: 0; margin: 1.25rem 0; }
.spec div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--kerb-soft); }
.spec dt { color: var(--paint-dim); font-size: .95rem; }
.spec dd { margin: 0; }
@media (max-width: 480px) { .spec div { grid-template-columns: 1fr; gap: .1rem; } }
.case-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.case-views { margin-top: .9rem; font-size: .9rem; }
.case-block { padding: 2.25rem 0; border-top: 1px solid var(--kerb-soft); max-width: 52rem; }
.case-block h2, .laps-heading { font-size: var(--step-2); margin-bottom: 1rem; }
.case-block .section-head h2 { margin-bottom: 0; }
.pipeline { counter-reset: stage; position: relative; }
.pipeline::before { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px; background: repeating-linear-gradient(180deg, var(--kerb) 0 8px, transparent 8px 13px); }
.pipeline li { counter-increment: stage; position: relative; padding: 0 0 1.1rem 3rem; display: grid; }
.pipeline li::before {
  content: counter(stage); position: absolute; left: 0; top: 0; width: 28px; height: 28px;
  display: grid; place-items: center; background: var(--asphalt); border: 1.5px solid var(--signal); border-radius: 50%;
  font: 600 .85rem/1 var(--font-display); color: var(--signal);
}
.stage-title { font-weight: 600; line-height: 1.75; }
.stage-detail { color: var(--paint-dim); }
.feature-list li { position: relative; padding: .35rem 0 .35rem 1.4rem; }
.feature-list li::before { content: ""; position: absolute; left: 0; top: .95em; width: .7rem; height: 2px; background: var(--signal); }
.feature-list-limits li::before { background: var(--hazard); }
.table-wrap { overflow-x: auto; border: 1px solid var(--kerb-soft); }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 34rem; }
.data-table th, .data-table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--kerb-soft); vertical-align: top; }
.data-table thead th { font-weight: 500; color: var(--paint-dim); background: var(--shoulder); font-size: .85rem; }
.data-table tbody th { font-weight: 500; }
.data-table td:nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--paint-dim); }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.sources { font-size: .85rem; padding-top: 1rem; }

/* ---------- likes ---------- */
.like {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .45rem .9rem;
  background: none; color: var(--paint); border: 1px solid var(--kerb); border-radius: var(--radius);
  font: 500 1rem var(--font-body); cursor: pointer;
}
.like:hover:not(:disabled) { border-color: var(--paint-dim); }
.like-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.like[aria-pressed="true"] { border-color: var(--hazard); color: var(--hazard); }
.like[aria-pressed="true"] .like-icon { fill: var(--hazard); }
.like-count { font-variant-numeric: tabular-nums; color: var(--paint-dim); }
.like[aria-pressed="true"] .like-count { color: var(--hazard); }
.like.is-busy { opacity: .7; }

/* ---------- comments ---------- */
.comments { padding: 2.5rem 0; border-top: 1px solid var(--kerb); max-width: 46rem; }
.comments h2 { font-size: var(--step-2); margin-bottom: .5rem; }
.comments-total { color: var(--paint-dim); font-family: var(--font-body); font-weight: 400; font-size: 1rem; }
.comment-form { display: grid; gap: 1rem; margin: 1.25rem 0 2rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 500; }
.field input, .field textarea {
  width: 100%; padding: .7rem .8rem; font: inherit; color: var(--paint);
  background: var(--asphalt-deep); border: 1px solid var(--kerb); border-radius: var(--radius);
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--signal); outline-offset: 0; border-color: transparent; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-hint { margin: 0; font-size: .82rem; color: var(--paint-dim); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.form-status { margin: 0; font-size: .95rem; }
.form-status.is-error { color: var(--danger); }
.form-status.is-ok { color: var(--v2v); }
.comment-state { color: var(--paint-dim); }
.comment-state.is-error { color: var(--danger); }
.comment-list { display: grid; gap: 0; }
.comment { padding: 1.1rem 0; border-top: 1px solid var(--kerb-soft); }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; margin-bottom: .35rem; }
.comment-name { font-weight: 600; }
.comment-time { font-size: .82rem; color: var(--paint-dim); }
.comment-body { white-space: pre-line; overflow-wrap: anywhere; margin: 0 0 .5rem; }
.comment.is-new { border-top-color: var(--v2v); }
.comment .like { min-height: 34px; padding: .2rem .6rem; font-size: .9rem; }
.comment .like-icon { width: 15px; height: 15px; }

/* ---------- achievements: lap timeline ---------- */
.laps { position: relative; margin-bottom: 2.5rem; }
.laps::before { content: ""; position: absolute; left: 7px; top: .5rem; bottom: .5rem; width: 2px; background: var(--kerb); }
.lap { position: relative; display: grid; gap: .3rem 2rem; padding: 0 0 2rem 2.2rem; }
.lap::before { content: ""; position: absolute; left: 1px; top: .45rem; width: 14px; height: 14px; border-radius: 50%; background: var(--asphalt); border: 2px solid var(--signal); }
@media (min-width: 760px) { .lap { grid-template-columns: 9rem minmax(0, 1fr); } .laps-undated .lap { grid-template-columns: minmax(0, 1fr); } }
.laps-undated .lap-when:empty, .lap-when:empty { display: none; }
.laps-note { margin: -1rem 0 1.5rem; }
.lap-when { font: 500 1.05rem/1.6 var(--font-display); font-variant-numeric: tabular-nums; }
.lap-cat { font-size: .82rem; color: var(--paint-dim); margin: .15rem 0 .2rem; }
.lap-body h3 { margin-bottom: .35rem; }
.lap-body p { max-width: 42rem; }
.lap-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .9rem; }
.lap-draft::before { border-color: var(--hazard); border-style: dashed; }
.lap-draft .lap-body { opacity: .8; }
.drafts { border-top: 1px dashed var(--hazard); padding-top: 1.5rem; }

/* ---------- skills: instrument panels ---------- */
.panels { display: grid; gap: 1.25rem; padding-bottom: 3rem; }
@media (min-width: 820px) { .panels { grid-template-columns: 1fr 1fr; } }
.panel { background: var(--shoulder); border-top: 2px solid var(--signal); padding: 1.25rem 1.4rem 1rem; }
.panel h2 { font-size: var(--step-2); margin-bottom: .75rem; }
.readout { display: grid; gap: .1rem; padding: .7rem 0; border-top: 1px solid var(--kerb); }
.readout:first-child { border-top: 0; }
.readout-name { font-weight: 500; }
.readout-evidence { font-size: .9rem; color: var(--paint-dim); }
.readout-planned .readout-name { color: var(--paint-dim); }
.pill { display: inline-block; margin-left: .35rem; padding: 0 .4rem; border: 1px dashed var(--hazard); border-radius: 3px; color: var(--hazard); font-size: .75rem; font-weight: 500; vertical-align: .1em; }

/* ---------- about ---------- */
.about-grid { display: grid; gap: 2rem; padding-bottom: 1rem; }
@media (min-width: 900px) { .about-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 3.5rem; } }
.prose { max-width: 42rem; }
.prose p, .prose li { line-height: 1.7; }
.prose h2 { font-size: var(--step-2); margin: 2rem 0 .75rem; }
.prose h3 { margin: 1.5rem 0 .5rem; }
.prose ul { margin: 0 0 1em; }
.prose ul li { position: relative; padding-left: 1.2rem; margin-bottom: .4rem; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: .8em; width: .55rem; height: 2px; background: var(--paint-faint); }
.spec-card { background: var(--shoulder); padding: .5rem 1.25rem; align-self: start; }
.spec-card .spec { margin: 0; }
.spec-card .spec div:first-child { border-top: 0; }
.beyond { padding: 3rem 0; border-top: 1px solid var(--kerb-soft); margin-top: 1rem; }
.beyond h2 { font-size: var(--step-3); margin-bottom: .75rem; }
.beyond > p { max-width: 42rem; }
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.25rem 1rem; margin: 1.5rem 0; }
.poster img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 3px; background: var(--shoulder); }
.poster-title { margin: .5rem 0 0; font-size: .92rem; line-height: 1.3; }
.poster-rating { margin: 0; font: 600 1rem var(--font-display); color: var(--hazard); font-variant-numeric: tabular-nums; }

/* ---------- blog ---------- */
.posts { display: grid; margin-bottom: 2rem; }
.post-card { padding: 1.5rem 0; border-top: 1px solid var(--kerb-soft); max-width: 46rem; }
.post-card h2 { font-size: var(--step-2); margin: .2rem 0 .5rem; }
.post-card h2 a { color: var(--paint); text-decoration: none; }
.post-card h2 a:hover { color: var(--signal); }
.post .page-head h1 { font-size: var(--step-3); line-height: 1.1; }
.post-meta { margin-top: -1rem; margin-bottom: 2rem; font-size: .95rem; }
.post-body { font-size: 1.1rem; }
.post-actions { padding: 1rem 0 2rem; }

/* ---------- github ---------- */
.gh-provenance { margin-top: -1rem; margin-bottom: 1.5rem; }
.gh-grid { display: grid; gap: 2.5rem; padding-bottom: 1rem; }
@media (min-width: 900px) { .gh-grid { grid-template-columns: 1fr 1fr; gap: 3.5rem; } }
.gh-grid h2 { font-size: var(--step-2); margin-bottom: .4rem; }
.lang-bars { display: grid; gap: .6rem; margin-top: 1rem; }
.lang-bars li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 4.5rem; align-items: center; gap: .8rem; font-size: .95rem; }
.lang-bar { width: 100%; height: 6px; display: block; }
.lang-track { fill: var(--kerb-soft); }
.lang-fill { fill: var(--signal); }
.lang-count { color: var(--paint-dim); font-size: .85rem; text-align: right; font-variant-numeric: tabular-nums; }
.activity li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; padding: .6rem 0; border-top: 1px solid var(--kerb-soft); font-size: .95rem; }
.activity li:first-child { border-top: 0; }

/* ---------- contact ---------- */
.contact-list { display: grid; margin-bottom: 1.5rem; max-width: 40rem; }
.contact-list li { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--kerb-soft); }
.contact-kind { color: var(--paint-dim); }
@media (max-width: 480px) { .contact-list li { grid-template-columns: 1fr; gap: 0; } }

.error-page { padding-bottom: 5rem; }
.error-page .btn { margin: 0 .5rem .5rem 0; }

/* ---------- footer ---------- */
.site-foot { margin-top: 3rem; border-top: 1px solid var(--kerb-soft); padding: 2rem 0 2.5rem; font-size: .92rem; }
.foot-row { display: grid; gap: 1rem 2rem; }
@media (min-width: 800px) { .foot-row { grid-template-columns: 1fr auto; align-items: start; } }
.foot-name { font: 600 1.1rem var(--font-display); margin-bottom: .1rem; }
.foot-row p { margin: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.foot-counter { font-variant-numeric: tabular-nums; }

/* ---------- transitions ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out-fwd 240ms var(--ease) both; }
  ::view-transition-new(root) { animation: vt-in-fwd 340ms var(--ease) both; }
  html:active-view-transition-type(backward)::view-transition-old(root) { animation-name: vt-out-back; }
  html:active-view-transition-type(backward)::view-transition-new(root) { animation-name: vt-in-back; }
  ::view-transition-group(route-car) { animation-duration: 420ms; animation-timing-function: var(--ease); }
  .page-home.is-leaving main { transition: opacity .25s ease .3s; opacity: .35; }
}
@keyframes vt-out-fwd { to { opacity: 0; transform: translateX(-28px); } }
@keyframes vt-in-fwd { from { opacity: 0; transform: translateX(36px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(28px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-36px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
