/* =====================================================================
   lab.bhasin.io — v4

   The page is a structure: a graph generated from the index, full-bleed
   behind the hero, with the copy sitting on it. Three accents, each with
   a job — cyan is structure, violet is a branch, green is live. Nothing
   here assumes what the lab contains.
   ===================================================================== */

@font-face{font-family:"Inter";font-weight:400;font-style:normal;font-display:swap;
  src:url("fonts/inter-latin-400-normal.woff2") format("woff2")}
@font-face{font-family:"Inter";font-weight:500;font-style:normal;font-display:swap;
  src:url("fonts/inter-latin-500-normal.woff2") format("woff2")}
@font-face{font-family:"Inter";font-weight:600;font-style:normal;font-display:swap;
  src:url("fonts/inter-latin-600-normal.woff2") format("woff2")}
@font-face{font-family:"Inter";font-weight:700;font-style:normal;font-display:swap;
  src:url("fonts/inter-latin-700-normal.woff2") format("woff2")}
@font-face{font-family:"Mono";font-weight:400;font-style:normal;font-display:swap;
  src:url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2")}

:root{
  /* Light first; dark overrides below. */
  --bg:#f5f6fa; --panel:#ffffff; --sunk:#eceef4;
  --line:rgba(10,12,22,.13); --line-soft:rgba(10,12,22,.07);
  --fg:#0a0c16; --dim:#4f5568; --faint:#7a8095;

  --cy:#0c7f96;      /* structure */
  --vi:#5b3fd8;      /* a branch */
  --live:#0d8a56;    /* shipped */

  --node-cy:9,98,118; --node-vi:91,63,216; --node-live:8,105,64; --node-base:100,110,135;

  --sans:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --mono:"Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --wrap:1180px; --pad:26px; --r:14px;
  --ease:cubic-bezier(.16,1,.3,1);
  color-scheme:light;
}
:root[data-theme="dark"]{
  --bg:#06070c; --panel:#0b0d14; --sunk:#08090f;
  --line:rgba(255,255,255,.11); --line-soft:rgba(255,255,255,.06);
  --fg:#eef1f8; --dim:#9199ad; --faint:#626a80;

  --cy:#5fe6ff; --vi:#a78bff; --live:#7cffb2;
  --node-cy:95,230,255; --node-vi:167,139,255; --node-live:124,255,178; --node-base:150,163,192;
  color-scheme:dark;
}

*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:84px;-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--fg);font-family:var(--sans);
  font-size:15.5px;line-height:1.6;letter-spacing:-.011em;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-x:hidden;
  transition:background .4s var(--ease),color .4s var(--ease)}
h1,h2,h3,h4{margin:0;font-weight:600;letter-spacing:-.038em;line-height:1.05}
p{margin:0}ul{margin:0;padding:0;list-style:none}
a{color:inherit;text-decoration:none}
::selection{background:var(--vi);color:#fff}
:focus-visible{outline:2px solid var(--cy);outline-offset:3px;border-radius:6px}
.dim{color:var(--faint)}

/* Present for assistive tech, absent on screen. */
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
  clip-path:inset(50%);white-space:nowrap;border:0}
/* The consent card. Deliberately the same shape as the link tiles rather than
   a full-width bar: it asks, it does not block. */
.consent{position:fixed;left:var(--pad);bottom:var(--pad);z-index:80;max-width:26rem;
  padding:16px 18px;border:1px solid var(--cy);border-radius:14px;background:var(--panel);
  box-shadow:0 18px 40px rgba(0,0,0,.45);color:var(--dim);font-size:.9rem;line-height:1.5}
.consent a{color:var(--fg);border-bottom:1px solid color-mix(in srgb,var(--cy) 55%,transparent)}
.consent-act{display:flex;gap:10px;margin-top:14px}
.consent-act button{flex:1;padding:9px 14px;border-radius:999px;border:1px solid var(--line);
  background:var(--sunk);color:var(--fg);font:inherit;font-size:.88rem;cursor:pointer;
  transition:border-color .2s var(--ease),background .2s var(--ease)}
.consent-act button:hover{border-color:var(--cy)}
.consent-act button[data-c="yes"]{background:var(--cy);color:#06070c;border-color:var(--cy);font-weight:600}
@media (max-width:700px){.consent{left:10px;right:10px;bottom:10px;max-width:none}}

.skip-link{position:absolute;top:-60px;left:16px;z-index:90;padding:9px 16px;border-radius:999px;
  background:var(--panel);border:1px solid var(--line);transition:top .2s var(--ease)}
.skip-link:focus{top:14px}

/* ------------------------------------------------------------- stage */

.stage{position:fixed;inset:0;width:100%;height:100%;display:block;z-index:0;
  touch-action:none;cursor:grab;opacity:0;transition:opacity 1.2s var(--ease)}
.stage.ready{opacity:1}
.stage.grabbing{cursor:grabbing}
.stage.overnode{cursor:pointer}
.veil{position:fixed;inset:0;z-index:1;pointer-events:none;
  background:radial-gradient(58% 50% at 20% 40%,var(--bg),color-mix(in srgb,var(--bg) 55%,transparent) 55%,transparent 78%)}

.nav,main,.foot{position:relative;z-index:2}
/* The canvas is fixed and lives inside main, so at equal z-index main —
   and the canvas with it — paints over the nav and eats its clicks. The
   nav has to outrank main, not merely match it. */
.nav{z-index:10}

/* The hero paints above the canvas, so its box would swallow every drag.
   Only the hero is made transparent to the pointer — the panels below
   keep normal behaviour, so scrolling past them cannot grab the graph. */
.hero{pointer-events:none}
.hero .stage,.hero a,.hero button{pointer-events:auto}

/* --------------------------------------------------------------- nav */

.nav{position:sticky;top:0;display:flex;align-items:center;gap:24px;height:64px;padding:0 var(--pad);
  background:color-mix(in srgb,var(--bg) 80%,transparent);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.brand{display:inline-flex;align-items:center;gap:10px;font-weight:600;letter-spacing:-.02em}
.brand-mark{width:13px;height:13px;border-radius:4px;background:var(--cy);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--cy) 22%,transparent)}
.nav-links{display:flex;align-items:center;gap:20px;font-size:14.5px;color:var(--dim)}
.nav-links a{transition:color .2s var(--ease)}
.nav-links a:hover{color:var(--fg)}
/* Icon only, and sitting with the links — the top right stays empty. */
.icon-btn{display:grid;place-items:center;width:30px;height:30px;margin-left:2px;padding:0;
  border-radius:50%;border:1px solid var(--line);background:none;color:var(--dim);cursor:pointer;
  transition:color .2s var(--ease),border-color .2s var(--ease),transform .3s var(--ease)}
.icon-btn:hover{color:var(--fg);border-color:var(--fg);transform:rotate(-18deg)}
.icon-btn svg{grid-area:1/1;width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round;transition:opacity .25s var(--ease),transform .25s var(--ease)}
.icon-btn .i-sun{opacity:0;transform:scale(.5) rotate(-90deg)}
:root[data-theme="dark"] .icon-btn .i-moon{opacity:0;transform:scale(.5) rotate(90deg)}
:root[data-theme="dark"] .icon-btn .i-sun{opacity:1;transform:none}
.btn{display:inline-flex;align-items:center;gap:8px;padding:8px 15px;border-radius:999px;
  border:1px solid var(--line);background:none;color:var(--fg);font:inherit;font-size:13.5px;
  cursor:pointer;transition:border-color .2s var(--ease),color .2s var(--ease)}
.btn:hover{border-color:var(--fg)}
#theme-name{color:var(--cy)}

/* -------------------------------------------------------------- hero */

.hero{position:relative;min-height:min(82vh,760px);display:flex;align-items:center;
  max-width:var(--wrap);margin:0 auto;padding:0 var(--pad)}
/* The canvas is positioned and comes later in the hero, so by default it
   paints over this block — which put the reset button underneath it and
   handed its clicks (and its grab cursor) to the canvas. Raising the copy
   fixes that; the text itself is still pointer-transparent, so dragging
   over the headline keeps working. */
.hero-copy{position:relative;z-index:1;max-width:29rem}
.eyebrow{display:flex;align-items:center;gap:10px;font-family:var(--mono);font-size:11.5px;
  letter-spacing:.2em;text-transform:uppercase;color:var(--faint)}
.pip{width:6px;height:6px;border-radius:50%;background:var(--live);box-shadow:0 0 10px var(--live)}
h1{margin-top:20px;font-size:clamp(1.95rem,3.9vw,3.15rem);letter-spacing:-.045em}
.stats{margin-top:26px;font-family:var(--mono);font-size:12px;color:var(--faint);letter-spacing:.02em}
.stats b{color:var(--fg);font-weight:400}
.stats .on{color:var(--live)}
.hint{margin-top:18px;font-family:var(--mono);font-size:11px;color:var(--faint)}

/* The sub-line, promoted into a pill above the headline — it carries the
   accent the hero needs and reads better as an aside than as body copy. */
.quip{display:inline-flex;align-items:center;gap:10px;padding:8px 16px 8px 14px;
  border-radius:999px;border:1px solid color-mix(in srgb,var(--cy) 38%,transparent);
  background:color-mix(in srgb,var(--cy) 9%,transparent);color:var(--fg);font-size:14px}
.quip .dot{flex:0 0 auto;width:7px;height:7px;border-radius:50%;background:var(--cy);
  box-shadow:0 0 0 0 color-mix(in srgb,var(--cy) 50%,transparent);animation:ping 2.8s var(--ease) infinite}
@keyframes ping{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--cy) 45%,transparent)}
  70%{box-shadow:0 0 0 9px transparent}100%{box-shadow:0 0 0 0 transparent}}

/* Legend and the way back out. */
.hero-controls{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:30px}
.legend{display:flex;gap:14px;font-family:var(--mono);font-size:11px;color:var(--faint)}
.legend li{display:inline-flex;align-items:center;gap:6px}
.legend i{width:7px;height:7px;border-radius:50%}
.k-branch{background:var(--vi)}
.k-live{background:var(--live);box-shadow:0 0 8px color-mix(in srgb,var(--live) 60%,transparent)}
/* The same grey the canvas paints every node that is not live — in build,
   queued or planned all look alike out there, so the key says so once. */
.k-idle{background:rgb(var(--node-base))}
.reset{display:inline-flex;align-items:center;gap:7px;padding:6px 12px;border-radius:999px;
  border:1px solid var(--line);background:none;color:var(--faint);font:inherit;
  font-family:var(--mono);font-size:11px;cursor:pointer;
  transition:color .2s var(--ease),border-color .2s var(--ease),opacity .2s var(--ease)}
.reset svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round}
.reset:hover{color:var(--fg);border-color:var(--fg)}
/* The zoom pair: same pill, square, icon only. */
.zoomers{display:inline-flex;gap:6px}
.reset.sq{padding:6px;width:32px;height:32px;justify-content:center}
.reset.sq svg{width:12px;height:12px}
/* Lights up only when there is actually something to undo. */
.reset.live{color:var(--cy);border-color:color-mix(in srgb,var(--cy) 55%,transparent)}

/* ------------------------------------------------------------ panels */

.panel{background:var(--bg);border-top:1px solid var(--line);
  padding:clamp(50px,7vh,84px) 0;position:relative}
.wrap{max-width:var(--wrap);margin:0 auto;padding:0 var(--pad)}
.panel-head{max-width:62ch}
.panel-head h2{font-size:clamp(1.7rem,3.4vw,2.5rem);letter-spacing:-.042em}
.panel-note{margin-top:14px;color:var(--dim)}
.panel-note a,.about-lab p a{color:var(--fg);border-bottom:1px solid color-mix(in srgb,var(--cy) 55%,transparent);
  transition:color .2s var(--ease),border-color .2s var(--ease)}
.panel-note a:hover,.about-lab p a:hover{color:var(--cy);border-bottom-color:var(--cy)}

/* --------------------------------------------------------- branches */

.branches{display:flex;flex-wrap:wrap;gap:8px;margin-top:24px}
.chip{display:inline-flex;align-items:center;gap:8px;padding:7px 14px;border-radius:999px;
  border:1px solid var(--line);background:none;color:var(--dim);font:inherit;font-size:13.5px;
  cursor:pointer;transition:all .2s var(--ease)}
.chip:hover{color:var(--fg);border-color:var(--fg)}
.chip .count{font-family:var(--mono);font-size:11px;color:var(--faint)}
.chip[aria-pressed="true"]{background:var(--vi);border-color:var(--vi);color:#fff}
.chip[aria-pressed="true"] .count{color:rgba(255,255,255,.75)}
.chip[data-tag="all"][aria-pressed="true"]{background:var(--cy);border-color:var(--cy);color:#03131a}
.chip[data-tag="all"][aria-pressed="true"] .count{color:rgba(3,19,26,.7)}

/* ------------------------------------------------------------- rows */

.rows{margin-top:20px;border-top:1px solid var(--line)}
.row{border-bottom:1px solid var(--line-soft);transition:opacity .3s var(--ease)}
.row.muted{opacity:.3}
/* A table, not a sentence: the name gets its own column so every
   description starts at the same x. */
.row-face{display:grid;grid-template-columns:26px 18.5rem minmax(0,1fr) 5.5rem;gap:0 20px;
  align-items:baseline;padding:11px 10px;border-radius:8px;width:100%;text-align:left;
  transition:background .18s var(--ease),padding-left .18s var(--ease)}
a.row-face:hover,.row.hot .row-face{background:color-mix(in srgb,var(--cy) 8%,transparent);padding-left:18px}
.row.flash .row-face{animation:flash 1s var(--ease)}
@keyframes flash{0%{background:color-mix(in srgb,var(--cy) 30%,transparent)}100%{background:transparent}}
.r-n{font-family:var(--mono);font-size:11px;color:var(--faint)}
/* Fixed column, so a longer name than the column allows must clip rather
   than spill into the description. */
.r-name{font-weight:500;letter-spacing:-.022em;font-size:.99rem;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
.r-line{font-size:.9rem;color:var(--dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.r-state{font-family:var(--mono);font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;
  color:var(--faint);white-space:nowrap;text-align:right}
.row[data-state="live"] .r-state,.row[data-state="live"] .r-name{color:var(--live)}
.r-go{display:none}
.row[data-state="live"] .r-go{display:inline;color:var(--live)}

/* ------------------------------------------------------------- about */

/* Copy left, links right. The columns are sized so they meet — the earlier
   version capped the copy narrow and left a canyon before the links. */
/* The rule is the segregation between the two halves. */
/* The two halves sit side by side and top-aligned: the lab on the left rail,
   the person narrower on the right. Secondary by size and scale, not by a
   weaker colour — and no rule between them, the gap does that work. */
.about-grid{display:grid;grid-template-columns:minmax(0,34rem) minmax(0,26rem);
  justify-content:space-between;gap:clamp(34px,5vw,72px);align-items:start}
.about-person{display:flex;flex-direction:column;gap:16px}
/* Half one: the lab itself. Same measure as the column below it, so both
   halves share one left rail. */
.about-lab{max-width:34rem;display:flex;flex-direction:column;gap:15px;color:var(--dim)}
.about-copy{display:flex;flex-direction:column;gap:12px;color:var(--dim);font-size:.9rem}
.about-head{display:flex;align-items:center;gap:14px}
.avatar{width:54px;height:54px;border-radius:50%;object-fit:cover;flex:0 0 auto;
  border:1px solid var(--line);background:var(--sunk)}
.about-lab h2{font-size:clamp(1.7rem,3.4vw,2.5rem);letter-spacing:-.042em;color:var(--fg)}
.about-copy h2{font-size:clamp(1.25rem,2vw,1.45rem);letter-spacing:-.03em;color:var(--fg)}
.about-copy .panel-note{margin-top:0}
.about-copy strong{color:var(--fg);font-weight:600}

/* One line each, in a column the width of the copy above them. Cards
   stretched across the full page left dead space inside every one. */
.links{display:flex;flex-direction:column;gap:6px}
.links a{display:flex;align-items:center;gap:11px;padding:9px 13px;
  border:1px solid var(--line);border-radius:11px;background:var(--panel);
  transition:border-color .2s var(--ease),transform .2s var(--ease),background .2s var(--ease)}
.links a:hover{border-color:var(--cy);transform:translateX(3px);
  background:color-mix(in srgb,var(--cy) 6%,transparent)}
.link-icon{flex:0 0 auto;display:grid;place-items:center;width:26px;height:26px;border-radius:7px;
  border:1px solid var(--line);background:var(--sunk);color:var(--cy)}
.link-icon svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.6;
  stroke-linecap:round;stroke-linejoin:round}
/* Real site marks carry their own colours, so they must not inherit the
   stroke treatment the drawn icons use. */
.link-icon svg.mark{width:18px;height:18px;stroke:none}
.link-icon:has(.mark){background:none;padding:0}
/* A supplied logo fills its tile, clipped to the same radius. */
.link-icon.logo{background:#f4f4f4;border-color:rgba(0,0,0,.16);overflow:hidden;padding:0}
.link-icon.logo img{width:100%;height:100%;object-fit:cover;display:block}
.link-name{font-weight:500;font-size:.88rem;white-space:nowrap}
.link-note{font-family:var(--mono);font-size:11px;letter-spacing:.04em;color:var(--faint);
  margin-left:auto;padding-right:4px;
  /* On a phone "Personal site" wrapped to two lines and made that one card
     taller than the other three. The note is the part that gives way. */
  white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis}
.link-go{flex:0 0 auto;margin-left:auto;width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round;color:var(--faint);
  transition:transform .2s var(--ease),color .2s var(--ease)}
.links a:hover .link-go{transform:translate(3px,-3px);color:var(--cy)}

/* ------------------------------------------------------------ footer */

.foot{background:var(--bg);border-top:1px solid var(--line);padding:26px 0 44px}
.foot-inner{display:flex;align-items:center;justify-content:space-between;gap:16px;
  font-size:14px;color:var(--dim)}
.foot-links{display:flex;align-items:center;gap:18px}
.foot-links a:hover,.foot-top:hover{color:var(--cy)}

/* -------------------------------------------------------- responsive
   Below 700px the structure stops being a full-bleed backdrop and
   becomes a bounded panel under the copy. Shrinking the 3D instead
   makes it unreadable and unclickable at once. */

@media (max-width:700px){
  :root{--pad:18px}
  .stage{position:static;height:min(62vw,320px);margin:6px auto 0;max-width:520px;
    border:1px solid var(--line);border-radius:var(--r);background:var(--sunk)}
  .veil{display:none}
  .hero{min-height:0;padding-top:22px;padding-bottom:30px;display:block}
  /* The toggle is the only way to change theme, so it must not vanish with
     the links it happens to sit beside. */
  .nav-links{gap:14px;font-size:13.5px}
  .row-face{grid-template-columns:22px minmax(0,1fr);gap:2px 10px;padding:11px 8px}
  .r-state{grid-column:2;margin-top:3px;text-align:left}
  .r-name{grid-column:2;white-space:normal}
  .r-line{grid-column:2;white-space:normal;margin-top:2px}
  .about-grid{grid-template-columns:1fr;gap:28px}
  /* Stacked, the two halves need the rule back to stay distinct. */
  .about-person{border-top:1px solid var(--line);padding-top:26px}
  .hero-controls{gap:10px}
  /* Fingers, not cursors. */
  .reset.sq{width:42px;height:42px}
  .reset.sq svg{width:14px;height:14px}
  .legend{gap:11px}
  .foot-inner{flex-direction:column;align-items:flex-start;gap:8px}
  .foot-links{gap:16px}
}

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