/* ==========================================================================
   Pranav Azad — portfolio
   "Paper & ink" toon style: black and white, 2px ink outlines, hard offset
   shadows. Greys for structure, one blue accent for the thing that matters.
   One stylesheet for every page.
   ========================================================================== */

:root {
  --paper: #f7f7f5;   /* page background */
  --card: #ffffff;    /* cards, panels */
  --gray-1: #efefed;  /* tracks, covers, subtle fills */
  --gray-2: #d6d6d3;  /* default chart bars, secondary fills */
  --ink: #111111;
  --ink-soft: #4d4d4d;
  --ink-faint: #8c8c8c;
  --dot: #dededb;

  --accent: #5a96ff;  /* the only colour: highlights and key numbers */

  --border: 2px solid var(--ink);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);

  --font-head: "Rubik", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-hand: "Caveat", cursive;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --max: 1120px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0; }
p { margin: 0 0 1rem; }
ul { margin: 0; }
::selection { background: var(--accent); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.hand { font-family: var(--font-hand); font-size: 1.45rem; line-height: 1.1; color: var(--ink-soft); }
.mono { font-family: var(--font-mono); }
.ico { width: 1.05em; height: 1.05em; fill: currentColor; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: var(--border);
}
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 20px;
  height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; text-decoration: none;
}
.logo-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--accent); border: var(--border); border-radius: 10px; box-shadow: var(--shadow-sm);
  font-size: .95rem; transform: rotate(-4deg);
}
.nav-links { display: flex; align-items: center; gap: .3rem; list-style: none; padding: 0; margin: 0; }
.nav-links a {
  display: block; padding: .4rem .75rem; border-radius: 8px; border: 2px solid transparent;
  text-decoration: none; font-weight: 700; font-size: .95rem;
}
.nav-links a:hover, .nav-links a.active { border-color: var(--ink); background: var(--card); }
.nav-toggle {
  display: none; background: var(--card); border: var(--border); border-radius: 10px;
  box-shadow: var(--shadow-sm); padding: .4rem .7rem; font: 700 .95rem var(--font-head); cursor: pointer;
}

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.15rem; border: var(--border); border-radius: 11px; box-shadow: var(--shadow);
  background: var(--card); color: var(--ink); text-decoration: none;
  font: 700 .98rem var(--font-head); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-accent { background: var(--accent); }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; box-shadow: var(--shadow-sm); border-radius: 9px; }
.btn-sm:hover { box-shadow: var(--shadow); }

.chip {
  display: inline-block; padding: .15rem .6rem; border: 1.5px solid var(--ink); border-radius: 999px;
  background: var(--card); font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Section panels ---------- */
main { padding: 2.5rem 0 1rem; }
.panel {
  position: relative;
  margin: 3.4rem 0;
  padding: 2.4rem 2rem 2rem;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.panel-tab {
  position: absolute; top: -20px; left: 22px;
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .3rem .85rem .3rem .4rem;
  background: var(--ink); color: #fff; border: var(--border); border-radius: 10px;
  font: 800 .95rem var(--font-head); text-transform: uppercase; letter-spacing: .04em;
}
.panel-tab .num {
  display: grid; place-items: center; width: 26px; height: 26px;
  background: var(--accent); color: var(--ink); border-radius: 7px; font-size: .78rem;
}
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem 2rem; margin-bottom: 1.6rem; }
.panel-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; }
.panel-head p { margin: .35rem 0 0; color: var(--ink-soft); max-width: 60ch; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: center; padding: 2.5rem 0 1rem; }
.hero-hi { display: inline-block; margin-bottom: .6rem; transform: rotate(-2deg); }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 3.9rem); font-weight: 800; letter-spacing: -.02em; }
.hero h1 .mark { background: linear-gradient(transparent 58%, var(--accent) 58% 90%, transparent 90%); padding: 0 .1em; }
.hero-lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; margin: 1.1rem 0 1.6rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: 1.5rem; font-size: .92rem; color: var(--ink-soft); }
.hero-meta span::before { content: "● "; color: var(--ink); }

.id-card {
  position: relative; background: var(--card); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 1.3rem; transform: rotate(1.2deg);
}
.id-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.id-card-top .label { font: 700 .75rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.dots { display: flex; gap: 5px; }
.dots i { width: 11px; height: 11px; border: 1.5px solid var(--ink); border-radius: 50%; }
.dots i:nth-child(1) { background: var(--ink); } .dots i:nth-child(2) { background: var(--accent); } .dots i:nth-child(3) { background: var(--card); }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.kpi {
  border: var(--border); border-radius: var(--radius-sm); padding: .75rem .85rem;
  background: var(--card);
}
.kpi-grid .kpi:first-child, .kpi-row .kpi:first-child { background: var(--accent); }
.kpi b { display: block; font: 800 1.75rem/1 var(--font-head); letter-spacing: -.02em; }
.kpi span { display: block; margin-top: .3rem; font-size: .8rem; line-height: 1.3; color: var(--ink); }
.id-note {
  position: absolute; right: -14px; bottom: -58px; transform: rotate(-4deg);
  display: flex; align-items: center; gap: .3rem;
}
.id-note svg { width: 46px; height: 34px; }

/* ---------- Project cards ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.5rem; }
.filter {
  padding: .35rem .85rem; border: var(--border); border-radius: 999px; background: var(--card);
  font: 700 .88rem var(--font-head); cursor: pointer;
}
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.project {
  display: flex; flex-direction: column;
  background: var(--card); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: transform .14s ease, box-shadow .14s ease;
}
.project:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-lg); }
.project[hidden] { display: none; }
.project-cover {
  display: block; position: relative; aspect-ratio: 16 / 9; border-bottom: var(--border);
  background: var(--gray-1);
}
.project-cover svg { width: 100%; height: 100%; }
.project-cover .cover-label {
  position: absolute; left: 10px; top: 10px; padding: .1rem .5rem;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 6px;
  font: 700 .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .05em;
}
.project-body { display: flex; flex-direction: column; gap: .6rem; padding: 1.05rem 1.1rem 1.15rem; flex: 1; }
.project-body h3 { font-size: 1.2rem; font-weight: 800; }
.project-body h3 a { text-decoration: none; }
.project-body h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.project-result { margin: 0; font-size: .94rem; color: var(--ink-soft); }
.project-result strong { color: var(--ink); }
.project-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding-top: .4rem; }
.text-link { font-weight: 700; font-size: .9rem; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.text-link:hover { text-decoration-thickness: 4px; }

/* ---------- Experience ---------- */
.gantt { margin-bottom: 2rem; }
.gantt-axis, .gantt-row { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 1rem; }
.gantt-axis .ticks { position: relative; height: 1.3em; font: 600 .75rem var(--font-mono); color: var(--ink-soft); }
.gantt-axis .ticks span { position: absolute; left: var(--x); }
.gantt-row { margin-top: .45rem; }
.gantt-row .name { font-size: .85rem; font-weight: 700; text-align: right; }
.gantt-track {
  position: relative; height: 22px; border-radius: 6px;
  background: repeating-linear-gradient(90deg, var(--dot) 0 1.5px, transparent 1.5px 25%);
}
.gantt-bar {
  position: absolute; top: -1.5px; bottom: -1.5px; left: var(--start); width: var(--len);
  background: var(--tint, var(--gray-2)); border: var(--border); border-radius: 6px;
}
.gantt-bar.ongoing { border-right-style: dashed; border-top-right-radius: 0; border-bottom-right-radius: 0; }

.jobs { display: grid; gap: 1.2rem; }
.job {
  display: grid; grid-template-columns: 170px 1fr; gap: 1.4rem;
  padding: 1.3rem; border: var(--border); border-radius: var(--radius); background: var(--paper);
}
.job-when { font: 700 .82rem var(--font-mono); color: var(--ink-soft); }
.job-when .where { display: block; margin-top: .3rem; font-family: var(--font-body); font-weight: 400; }
.job h3 { font-size: 1.2rem; font-weight: 800; }
.job .org { font-weight: 700; color: var(--ink-soft); margin: .15rem 0 .8rem; }
.job ul { padding-left: 1.1rem; display: grid; gap: .45rem; }
.job li::marker { color: var(--ink-faint); }
.sub-head { font-size: 1.25rem; font-weight: 800; margin: 2rem 0 1rem; }
.job.edu { background: var(--card); }
.job-stats { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.stat-pill {
  display: inline-flex; align-items: baseline; gap: .35rem; padding: .25rem .65rem;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 8px; font-size: .82rem;
}
.stat-pill b { font: 800 1rem var(--font-head); }

/* ---------- Toolbox matrix ---------- */
.matrix-wrap { overflow-x: auto; border: var(--border); border-radius: var(--radius); background: var(--paper); }
.matrix { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 900px; }
.matrix th, .matrix td { padding: .5rem .55rem; text-align: center; border-bottom: 1.5px solid var(--dot); }
.matrix thead th {
  font: 700 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft);
  vertical-align: bottom; border-bottom: var(--border);
}
.matrix tbody th { text-align: left; font-weight: 700; white-space: nowrap; }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { border-bottom: 0; }
.matrix tbody tr:hover { background: var(--gray-1); }
.matrix .dot { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 50%; background: var(--ink); }
.matrix .count { font: 800 .95rem var(--font-head); }
.matrix .count-bar { display: inline-block; height: 10px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--accent); vertical-align: middle; margin-left: .35rem; width: calc(var(--n) * 12px); }
.also-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.4rem; }
.also { border: var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem; background: var(--card); }
.also h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .55rem; }

/* ---------- Awards ---------- */
.awards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.award {
  border: var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm);
  padding: 1.1rem 1rem; display: flex; flex-direction: column; gap: .35rem;
}
.award:nth-child(odd) { transform: rotate(-1deg); }
.award:nth-child(even) { transform: rotate(1deg); }
.award .big { font: 800 1.9rem/1 var(--font-head); letter-spacing: -.02em; }
.award h3 { font-size: 1rem; font-weight: 800; }
.award p { margin: 0; font-size: .85rem; color: var(--ink-soft); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center; }
.contact h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 800; }
.contact-links { display: grid; gap: .7rem; }
.contact-links .btn { justify-content: space-between; }

.footer { padding: 2rem 0 3rem; text-align: center; color: var(--ink-soft); font-size: .9rem; }

/* ==========================================================================
   Chart components (pure HTML/CSS, filled by real project numbers)
   ========================================================================== */
.chart-card {
  border: var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
  padding: 1.2rem 1.25rem 1rem;
}
.chart-card h4 { font-size: 1.02rem; font-weight: 800; }
.chart-card .sub { font-size: .85rem; color: var(--ink-soft); margin: .2rem 0 1rem; }
.chart-card .note { font-size: .78rem; color: var(--ink-faint); margin: .8rem 0 0; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.chart-grid .wide { grid-column: 1 / -1; }

/* horizontal bars */
.hbars { display: grid; gap: .5rem; }
.hbar { display: grid; grid-template-columns: var(--label-w, 110px) 1fr auto; align-items: center; gap: .6rem; font-size: .85rem; }
.hbar .lbl { font-weight: 700; text-align: right; }
.hbar .track { height: 20px; border-radius: 5px; background: var(--gray-1); }
.hbar .fill {
  display: block; height: 100%; width: var(--v); background: var(--c, var(--gray-2));
  border: 1.5px solid var(--ink); border-radius: 5px;
  transform-origin: left; transition: transform .8s cubic-bezier(.2,.8,.2,1);
}
.hbar .val { font: 700 .82rem var(--font-mono); min-width: 3.4em; }

/* columns */
.cols { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 1.4rem; border-bottom: var(--border); }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.col .bar {
  width: 100%; height: var(--v); background: var(--c, var(--gray-2));
  border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 5px 5px 0 0;
  transform-origin: bottom; transition: transform .8s cubic-bezier(.2,.8,.2,1);
}
.col .top { position: absolute; bottom: calc(var(--v) + 3px); font: 600 .62rem var(--font-mono); white-space: nowrap; }
.col-labels { display: flex; gap: 6px; margin-top: .35rem; }
.col-labels span { flex: 1; text-align: center; font: 600 .7rem var(--font-mono); color: var(--ink-soft); }

/* diverging bars (% vs league average) */
.diverge { display: grid; gap: .65rem; }
.dv-row { display: grid; grid-template-columns: 170px 1fr; gap: .8rem; align-items: center; font-size: .84rem; }
.dv-row .lbl { font-weight: 700; text-align: right; line-height: 1.2; }
.dv-axis { position: relative; height: 46px; }
.dv-axis::before { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; border-left: 2px solid var(--ink); }
.dv-bar {
  position: absolute; height: 18px; display: flex; align-items: center;
  border: 1.5px solid var(--ink); border-radius: 4px; font: 700 .7rem var(--font-mono); white-space: nowrap;
  transition: transform .8s cubic-bezier(.2,.8,.2,1);
}
.dv-bar.pos { top: 2px; left: 50%; width: calc(var(--v) / 2); background: var(--accent); transform-origin: left; }
.dv-bar.neg { bottom: 2px; right: 50%; width: calc(var(--v) / 2); background: var(--gray-2); transform-origin: right; }
/* labels sit on the empty side of the axis so long bars never push them off-screen */
.dv-bar span { position: absolute; padding: 0 .45rem; }
.dv-bar.pos span { right: 100%; }
.dv-bar.neg span { left: 100%; }
.dv-legend { display: flex; justify-content: space-between; margin: .3rem 0 0 calc(170px + .8rem); font: 600 .72rem var(--font-mono); color: var(--ink-soft); }

/* pipeline flow */
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: .4rem; }
.flow-step {
  flex: 1 1 140px; border: var(--border); border-radius: var(--radius-sm); background: var(--card);
  padding: .75rem .8rem; font-size: .86rem; line-height: 1.35;
}
.flow-step b { display: block; font-family: var(--font-head); font-size: .95rem; margin-bottom: .2rem; }
.flow-step small { font-family: var(--font-mono); font-size: .68rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.flow-arrow { align-self: center; font: 800 1.3rem var(--font-head); }
.flow.vertical { flex-direction: column; gap: .55rem; }
.flow.vertical .flow-step { flex: none; }

/* animate-in state (set by main.js; skipped for reduced motion) */
.js-anim .hbar .fill, .js-anim .col .bar { transform: scaleX(0); }
.js-anim .col .bar { transform: scaleY(0); }
.js-anim .dv-bar { transform: scaleX(0); }
.js-anim .in-view .hbar .fill, .js-anim .in-view .dv-bar { transform: scaleX(1); }
.js-anim .in-view .col .bar { transform: scaleY(1); }

/* ==========================================================================
   Case-study pages
   ========================================================================== */
.crumbs { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; margin-bottom: 1.4rem; font-weight: 700; font-size: .92rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.cs-head { display: grid; grid-template-columns: 1.3fr .7fr; gap: 2rem; align-items: start; }
.cs-kicker { font: 700 .78rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.cs-head h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 800; letter-spacing: -.02em; margin: .4rem 0 .8rem; }
.cs-head .lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 54ch; }
.cs-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }
.cs-facts { background: var(--card); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; }
.cs-facts dl { margin: 0; display: grid; gap: .7rem; }
.cs-facts dt { font: 700 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.cs-facts dd { margin: .1rem 0 0; font-weight: 700; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 2.2rem 0 0; }
.kpi-row .kpi { box-shadow: var(--shadow-sm); }

.prose { max-width: 70ch; }
.prose h3 { font-size: 1.15rem; font-weight: 800; margin: 1.6rem 0 .5rem; }
.prose ul { padding-left: 1.2rem; display: grid; gap: .4rem; margin-bottom: 1rem; }

.findings { display: grid; gap: 1rem; counter-reset: f; }
.finding {
  display: grid; grid-template-columns: 44px 1fr; gap: 1rem; align-items: start;
  padding: 1rem 1.1rem; border: var(--border); border-radius: var(--radius-sm); background: var(--paper);
}
.finding::before {
  counter-increment: f; content: counter(f);
  display: grid; place-items: center; width: 40px; height: 40px;
  background: var(--accent); border: var(--border); border-radius: 50%;
  font: 800 1.1rem var(--font-head);
}
.finding h4 { font-size: 1.02rem; font-weight: 800; margin-bottom: .25rem; }
.finding p { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.finding p + p { margin-top: .35rem; }

.code {
  margin: 0; padding: 1rem 1.1rem; overflow-x: auto;
  background: var(--ink); color: #d6d6d3; border: var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  font: 500 .84rem/1.6 var(--font-mono);
}
.code .kw { color: var(--accent); font-weight: 700; }
.code .fn { color: #ffffff; }
.code .n { color: var(--accent); }
.code .c { color: var(--ink-faint); }

.stack { display: grid; gap: 1.4rem; }
.stack > *, .chart-grid > *, .split > * { min-width: 0; }
.archetypes { display: flex; flex-wrap: wrap; gap: .45rem; }
.archetypes .chip { font-size: .82rem; padding: .25rem .7rem; background: var(--card); }
.archetypes .chip b { font-family: var(--font-mono); margin-right: .3rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.feature { border: var(--border); border-radius: var(--radius-sm); padding: 1rem 1.1rem; background: var(--card); }
.feature h4 { font-size: 1rem; font-weight: 800; margin-bottom: .3rem; }
.feature p { margin: 0; font-size: .92rem; }

.shot { margin: 0; border: var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.shot img { width: 100%; border-bottom: var(--border); background: #fff; }
.shot figcaption { padding: .65rem .9rem; font-size: .85rem; color: var(--ink-soft); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.gallery .shot { box-shadow: var(--shadow-sm); }
.gallery .shot img { aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.gallery .shot a { display: block; }
.gallery figcaption { font-weight: 700; color: var(--ink); }

.next-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.next-nav a {
  display: block; padding: 1rem 1.2rem; border: var(--border); border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow); text-decoration: none; transition: transform .12s ease, box-shadow .12s ease;
}
.next-nav a:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.next-nav small { display: block; font: 700 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.next-nav b { font-family: var(--font-head); font-size: 1.05rem; }
.next-nav .next { text-align: right; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .projects { grid-template-columns: 1fr 1fr; }
  .awards { grid-template-columns: repeat(3, 1fr); }
  .kpi-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
  body { font-size: 16px; }
  .nav-toggle { display: inline-block; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .2rem; padding: .8rem 16px 1rem;
    background: var(--paper); border-bottom: var(--border);
  }
  .nav-links.open { display: flex; }
  .wrap, .nav-inner { padding: 0 16px; }
  .hero, .cs-head, .contact { grid-template-columns: 1fr; }
  .id-card { transform: none; margin-bottom: 3.4rem; }
  .hero > * { min-width: 0; }
  .kpi-grid .kpi b { font-size: clamp(1.25rem, 6vw, 1.75rem); }
  .id-note { right: 6px; }
  .panel { padding: 2.2rem 1.1rem 1.3rem; box-shadow: var(--shadow); }
  .projects, .chart-grid, .split, .next-nav { grid-template-columns: 1fr; }
  .awards { grid-template-columns: 1fr 1fr; }
  .also-list { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: .6rem; }
  .gantt-axis, .gantt-row { grid-template-columns: 96px 1fr; gap: .6rem; }
  .gantt-row .name { font-size: .74rem; }
  .dv-row { grid-template-columns: 1fr; gap: .2rem; }
  .dv-row .lbl { text-align: left; }
  .dv-legend { margin-left: 0; }
  .hbar { grid-template-columns: var(--label-w-sm, 78px) 1fr auto; font-size: .8rem; }
  .cols { height: 160px; gap: 3px; }
  .col-labels { gap: 3px; }
  .col .top { display: none; }
  .next-nav .next { text-align: left; }
  .flow { flex-direction: column; }
  .flow-step { flex: none; }
  .flow-arrow { transform: rotate(90deg); line-height: 1; }
}
@media (max-width: 420px) {
  .awards, .kpi-row { grid-template-columns: 1fr; }
  .award:nth-child(n) { transform: none; }
}

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

/* ==========================================================================
   Cube navigation
   The site is a cube: each section is a face. A small cube in the header
   turns to the face on screen, the map is the cube's unfolded net, and
   jumps between faces/pages turn the page like a cube layer.
   (js/cube.js adds .cube-on to <html> and builds these elements.)
   ========================================================================== */

/* -- sticker faces (shared by the header cube, map tiles and section tabs) -- */
.face-mini {
  display: inline-grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  width: 26px; height: 26px; padding: 2px;
  background: var(--ink); border-radius: 6px; flex: none;
}
.face-mini i { background: var(--card); border-radius: 2px; }
.face-mini i.on { background: var(--accent); }
.panel-tab .num.face-mini { width: 26px; height: 26px; padding: 3px; gap: 1.5px; place-items: stretch; background: var(--ink); box-shadow: inset 0 0 0 1.5px var(--card); }

kbd {
  display: inline-block; min-width: 1.5em; padding: 0 .35em; text-align: center;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 5px;
  box-shadow: 0 2px 0 var(--ink); font: 700 .72rem/1.5 var(--font-mono); vertical-align: 1px;
}

/* -- header cube button -- */
.cube-btn {
  display: none; align-items: center; gap: 1.1rem; padding: .3rem .65rem .3rem .45rem;
  background: var(--card); border: var(--border); border-radius: 12px; box-shadow: var(--shadow-sm);
  cursor: pointer; color: var(--ink); font: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.cube-btn:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow); }
.cube-on .cube-btn { display: inline-flex; }
.cube-on .nav-inner { justify-content: flex-start; }
.cube-on .nav-links { margin-left: auto; }
.cube-where { display: grid; text-align: left; line-height: 1.1; }
.cube-where b { font: 800 .82rem var(--font-head); }
.cube-where small { font: 600 .66rem var(--font-mono); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }

.cube-scene { width: 34px; height: 34px; perspective: 260px; display: grid; place-items: center; }
.cube-tilt { transform-style: preserve-3d; transform: translateX(-6px) rotateX(-24deg) rotateY(-32deg); } /* the tilt leans right; pull it back to centre */
.cube {
  --s: 22px;
  position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.65, 0, .35, 1);
}
.cube .face-mini { position: absolute; inset: 0; width: var(--s); height: var(--s); padding: 1.5px; gap: 1.5px; border-radius: 3px; backface-visibility: hidden; }
.cube .face-mini i { border-radius: 1px; }
.cube .f0 { transform: translateZ(calc(var(--s) / 2)); }
.cube .f1 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.cube .f2 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.cube .f3 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.cube .f4 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.cube .f5 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }

/* -- move hints -- */
.moves-hint { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin-top: 1.1rem; font-size: .88rem; color: var(--ink-soft); }
.crumbs kbd { margin-left: .25rem; }
.next-nav kbd { margin-right: .4rem; }
@media (hover: none) { .moves-hint .keys, .crumbs kbd, .next-nav kbd { display: none; } }
@media (hover: hover) { .moves-hint .tap { display: none; } }

/* -- cube map (the unfolded net) -- */
.cube-map {
  width: min(980px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; padding: 0;
  background: var(--paper); color: var(--ink);
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.1px); background-size: 22px 22px;
  border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: auto;
}
.cube-map::backdrop { background: rgba(17, 17, 17, .45); }
.map-inner { padding: 1.5rem 1.6rem 1.7rem; }
.map-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.4rem; }
.map-head h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; margin-top: .3rem; }
.map-body { display: grid; grid-template-columns: 1fr 230px; gap: 2rem; align-items: start; }

.net { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, auto); gap: 8px; perspective: 1400px; }
.net-tile {
  position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem;
  padding: .5rem; background: var(--card); border: var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  text-decoration: none; text-align: center; transition: transform .12s ease, box-shadow .12s ease;
}
.net-tile:hover, .net-tile:focus-visible { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.net-tile .face-mini { width: 44%; height: auto; aspect-ratio: 1; gap: 3px; padding: 3px; border-radius: 7px; }
.net-tile .t-label { font: 800 clamp(.72rem, 1.6vw, .98rem)/1.15 var(--font-head); }
.net-tile .t-pos { position: absolute; top: 6px; left: 8px; font: 700 .64rem var(--font-mono); color: var(--ink-faint); }
.net-tile.here { outline: 3px solid var(--accent); outline-offset: 3px; }
.net-tile.here::after {
  content: "you are here"; position: absolute; bottom: -11px; padding: 0 .4rem; white-space: nowrap;
  background: var(--accent); border: 1.5px solid var(--ink); border-radius: 999px; font: 700 .62rem/1.5 var(--font-mono);
}
.pos-U { grid-area: 1 / 2; } .pos-L { grid-area: 2 / 1; } .pos-F { grid-area: 2 / 2; }
.pos-R { grid-area: 2 / 3; } .pos-B { grid-area: 2 / 4; } .pos-D { grid-area: 3 / 2; }

/* unfolding: every tile starts folded against the front face and swings flat */
.cube-map.unfold .net-tile { animation: .5s cubic-bezier(.2, .8, .2, 1) both; }
.cube-map.unfold .pos-F { animation-name: tile-pop; }
.cube-map.unfold .pos-R { transform-origin: left center; animation-name: fold-r; animation-delay: .08s; }
.cube-map.unfold .pos-L { transform-origin: right center; animation-name: fold-l; animation-delay: .08s; }
.cube-map.unfold .pos-U { transform-origin: center bottom; animation-name: fold-u; animation-delay: .08s; }
.cube-map.unfold .pos-D { transform-origin: center top; animation-name: fold-d; animation-delay: .08s; }
.cube-map.unfold .pos-B { transform-origin: left center; animation-name: fold-r; animation-delay: .22s; }
@keyframes tile-pop { from { transform: scale(.92); } }
@keyframes fold-r { from { transform: rotateY(90deg); } }
@keyframes fold-l { from { transform: rotateY(-90deg); } }
@keyframes fold-u { from { transform: rotateX(90deg); } }
@keyframes fold-d { from { transform: rotateX(-90deg); } }

.map-side h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 .6rem; }
.map-side h4 + * { margin-bottom: 1.4rem; }
.moves { list-style: none; padding: 0; display: grid; gap: .45rem; font-size: .9rem; }
.moves kbd { margin-right: .45rem; }
.map-links { display: grid; gap: .5rem; }
.map-links .btn { justify-content: space-between; }

/* -- sticker flip when filtering projects -- */
.project.turn-in { animation: sticker-turn .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sticker-turn { from { transform: perspective(900px) rotateY(-90deg); opacity: .2; } }

/* -- page turns: same-page face jumps (up/down) and project-to-project (left/right) -- */
@view-transition { navigation: auto; }
.nav { view-transition-name: site-nav; }
::view-transition { background: var(--gray-2); }
html[data-turn]::view-transition-image-pair(root) { perspective: 2200px; isolation: auto; }
html[data-turn]::view-transition-old(root),
html[data-turn]::view-transition-new(root) {
  animation-duration: .62s; animation-timing-function: cubic-bezier(.65, 0, .35, 1); animation-fill-mode: both;
  mix-blend-mode: normal; backface-visibility: hidden;
}
html[data-turn="down"]::view-transition-old(root), html[data-turn="up"]::view-transition-old(root),
html[data-turn="down"]::view-transition-new(root), html[data-turn="up"]::view-transition-new(root) { transform-origin: 50% 50% -50vh; }
html[data-turn="r"]::view-transition-old(root), html[data-turn="l"]::view-transition-old(root),
html[data-turn="r"]::view-transition-new(root), html[data-turn="l"]::view-transition-new(root) { transform-origin: 50% 50% -50vw; }
html[data-turn="down"]::view-transition-old(root) { animation-name: turn-out-up; }
html[data-turn="down"]::view-transition-new(root) { animation-name: turn-in-below; }
html[data-turn="up"]::view-transition-old(root) { animation-name: turn-out-down; }
html[data-turn="up"]::view-transition-new(root) { animation-name: turn-in-above; }
html[data-turn="r"]::view-transition-old(root) { animation-name: turn-out-left; }
html[data-turn="r"]::view-transition-new(root) { animation-name: turn-in-right; }
html[data-turn="l"]::view-transition-old(root) { animation-name: turn-out-right; }
html[data-turn="l"]::view-transition-new(root) { animation-name: turn-in-left; }
@keyframes turn-out-up { to { transform: rotateX(90deg); filter: brightness(.7); } }
@keyframes turn-in-below { from { transform: rotateX(-90deg); filter: brightness(.7); } }
@keyframes turn-out-down { to { transform: rotateX(-90deg); filter: brightness(.7); } }
@keyframes turn-in-above { from { transform: rotateX(90deg); filter: brightness(.7); } }
@keyframes turn-out-left { to { transform: rotateY(-90deg); filter: brightness(.7); } }
@keyframes turn-in-right { from { transform: rotateY(90deg); filter: brightness(.7); } }
@keyframes turn-out-right { to { transform: rotateY(90deg); filter: brightness(.7); } }
@keyframes turn-in-left { from { transform: rotateY(-90deg); filter: brightness(.7); } }

@media (max-width: 980px) { .cube-where { display: none; } }
@media (max-width: 780px) {
  .cube-on .nav-toggle, .cube-on .nav-links { display: none !important; }
  .cube-on .cube-btn { margin-left: auto; }
  .map-inner { padding: 1.1rem 1rem 1.4rem; }
  .map-body { grid-template-columns: 1fr; gap: 1.6rem; }
  .net { gap: 6px; }
  .net-tile { padding: .3rem; gap: .3rem; }
  .net-tile .t-pos { display: none; }
  .net-tile.here::after { content: "here"; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .cube { transition: none; }
}
.map-body > *, .net > * { min-width: 0; }
.net-tile .t-label { max-width: 100%; hyphens: auto; }
@media (max-width: 780px) { .net-tile .t-label { font-size: .58rem; letter-spacing: -.01em; } .net-tile .face-mini { width: 52%; gap: 2px; padding: 2px; } }
@media (hover: none) { .map-side .moves, .map-side .moves-title, .map-close kbd { display: none; } }

/* ==========================================================================
   Character hero: the cube-solving character with the name plate under it
   ========================================================================== */
.hero.hero-stage { grid-template-columns: auto 1fr; gap: clamp(2rem, 4vw, 3.6rem); align-items: center; padding: 1.1rem 0 0; }
/* the character card sizes itself to the screen height, so the numbers strip stays above the fold */
.stage { margin: 0; display: flex; flex-direction: column; align-items: center; width: clamp(230px, 40vh, 340px); }
.stage-card {
  width: 100%; padding: 0; overflow: hidden; background: #fff;
  border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  transform: rotate(-1.5deg);
}
.stage-card img { display: block; width: 100%; height: auto; }
.nameplate { margin-top: .9rem; text-align: center; }
.hero .nameplate h1 {
  display: inline-block; font-size: clamp(1.8rem, 3.2vw, 2.4rem); font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(transparent 60%, var(--accent) 60% 88%, transparent 88%); padding: 0 .12em;
}
.nameplate .role {
  display: block; margin-top: .3rem; font: 700 .7rem var(--font-mono);
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft);
}

/* text column: wide, so the copy spreads across the right side in fewer lines */
.hero-copy { max-width: 780px; }
.hero-copy .hero-hi { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .1rem; }
.hero-copy .point { width: 40px; height: 30px; flex: none; }
.hero-title { margin: .1rem 0 0; font: 800 clamp(2rem, 3.5vw, 2.9rem)/1.1 var(--font-head); letter-spacing: -.02em; }
.hero-title .mark { background: linear-gradient(transparent 58%, var(--accent) 58% 90%, transparent 90%); padding: 0 .1em; }
.hero-stage .hero-lede { max-width: 68ch; font-size: 1.05rem; line-height: 1.55; margin: .8rem 0 1.1rem; }
.hero-stage .hero-meta { margin-top: .9rem; }
.hero-stage .moves-hint { margin-top: .55rem; }

/* the numbers card becomes a full-width strip under the hero */
.numbers-strip { margin: 1.5rem 0 1.4rem; padding: 1rem 1.1rem; transform: rotate(.4deg); }
.numbers-strip .id-card-top { margin-bottom: .7rem; }
.numbers-strip .kpi-grid { grid-template-columns: repeat(4, 1fr); }
.numbers-strip .kpi { padding: .6rem .8rem; }
.numbers-strip .kpi b { font-size: 1.55rem; }
.numbers-strip .id-note { bottom: -46px; right: 18px; }

@media (max-width: 980px) {
  .stage { width: clamp(220px, 30vw, 300px); }
}
@media (max-width: 780px) {
  .hero.hero-stage { grid-template-columns: 1fr; gap: 1.4rem; padding-top: 1.2rem; }
  .stage { width: min(320px, 100%); margin: 0 auto; }
  .hero-copy .point { transform: rotate(60deg); }          /* point up at the character */
  .numbers-strip { transform: none; margin-bottom: 3.4rem; }
  .numbers-strip .kpi-grid { grid-template-columns: 1fr 1fr; }
  .numbers-strip .id-note { right: 6px; }
}
