/* ============================================================
   Arun Kumar - Portfolio
   Refined technical dark. Hand-written, no framework.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Default surface: warm paper, not white. Dark is the opt-in below. */
  --bg:          #FBF7F1;
  --bg-2:        #F3EDE4;
  --surface:     #FFFFFF;
  --surface-2:   #FCF9F5;
  --raised:      #FFFFFF;

  --line:        rgba(60,42,24,.11);
  --line-strong: rgba(60,42,24,.19);

  --tx:          #1A1510;
  --tx-2:        #4A4136;
  --tx-3:        #786E60;
  --band:        rgba(60,42,24,.030);

  --acc:         #A15E0A;
  --acc-soft:    rgba(161,94,10,.09);
  --acc-line:    rgba(161,94,10,.30);
  --acc-deep:    #824C06;
  --good:        #3C7A2E;
  --acc-lift:    #C2410C;

  --on-acc:      #FFF8EC;

  --scroll-cue:  rgba(60,42,24,.16);
  --shadow-sm: 0 1px 2px rgba(60,42,24,.07);
  --shadow-md: 0 10px 26px -14px rgba(60,42,24,.26);
  --shadow-lg: 0 30px 70px -36px rgba(60,42,24,.32);
  --display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1320px;        /* main container */
  --wrap-text: 720px;    /* readable measure for prose */
  --r-sm: 8px;
  --r-lg: 18px;
  --ease: cubic-bezier(.2,.7,.3,1);
  --t-fast: .16s var(--ease);
}

html[data-theme="dark"] {
  /* Ember - warm charcoal ground, brown-black rather than blue-black. */
  --bg:          #15110D;
  --bg-2:        #1A1611;
  --surface:     #201B15;
  --surface-2:   #262019;
  --raised:      #2E271F;

  --line:        rgba(255,238,214,.085);
  --line-strong: rgba(255,238,214,.16);

  --tx:          #F5EFE4;
  --tx-2:        #CFC5B5;
  --tx-3:        #9C9284;
  --band:        rgba(255,238,214,.026);

  --acc:         #E8A33D;
  --acc-soft:    rgba(232,163,61,.13);
  --acc-line:    rgba(232,163,61,.34);
  --acc-deep:    #C97B24;
  --good:        #8FBF6E;
  --acc-lift:    #F7D291;

  /* Ink laid on top of an accent fill. Warm, so filled buttons do not
     punch a cold hole in a warm page. */
  --on-acc:      #1B1206;

  --scroll-cue:  rgba(0,0,0,.45);
  --shadow-sm: 0 1px 2px rgba(12,7,2,.45);
  --shadow-md: 0 8px 24px -10px rgba(12,7,2,.7);
  --shadow-lg: 0 28px 70px -32px rgba(12,7,2,.88);

  --r:    12px;

  --t: .28s var(--ease);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.012em; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
/* dd carries a 40px UA margin-inline-start and dl a 1em block margin. Any rule
   that sets margin-top as a longhand leaves those in place, which indents the
   value away from its own label. Clear both at the reset. */
dl, dd { margin: 0; }
code { font-family: var(--mono); font-size: .9em; color: var(--tx); background: var(--acc-soft); padding: .1em .38em; border-radius: 4px; }
::selection { background: var(--acc); color: var(--on-acc); }

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

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(16px, 4.5vw, 24px); }

/* Grid and flex children may shrink below their content. Without this a single
   wide child (the architecture SVG) widens its whole column past the viewport. */
.dive > *, .eval-grid > *, .case-pair > *, .skills > *, .principles > *,
.contact > *, .metric-row > *, .limits > *, .stack-flow > *, .pipeline > *,
.tl-item > *, .fnd-item > *, .footer-inner > *, .edu > *, .stats > *,
.case, .panel, .chart, .diagram, .case-body, .tl-card, .skill-card { min-width: 0; }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  background: var(--acc); color: var(--on-acc); padding: 10px 16px;
  border-radius: var(--r-sm); font-weight: 600; font-size: .875rem;
  transform: translateY(-160%); transition: transform var(--t);
}
.skip-link:focus { transform: none; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background var(--t);
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: clamp(10px, 2vw, 24px);
  height: clamp(56px, 3vw + 44px, 68px);
}

/* Explicit columns: when .nav-links is display:none on mobile it leaves the grid
   entirely, and auto-placement would otherwise pull the controls into the middle. */
.brand { grid-column: 1; justify-self: start; display: flex; align-items: center; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 9px;
  color: var(--acc); background: var(--surface);
  transition: border-color var(--t), transform var(--t);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand:hover .brand-mark { border-color: var(--acc-line); transform: translateY(-1px); }

.nav-links { grid-column: 2; justify-self: center; position: relative; display: flex; gap: 4px; }
.nav-links a {
  position: relative; padding: 8px 13px; border-radius: 7px;
  font-size: .875rem; color: var(--tx-2); font-weight: 500;
  transition: color var(--t-fast);
}
.nav-links a:hover { color: var(--tx); }
.nav-links a.is-active { color: var(--tx); }
.nav-ind {
  position: absolute; bottom: -1px; height: 2px; border-radius: 2px;
  background: var(--acc); opacity: 0; pointer-events: none;
  transition: transform var(--t), width var(--t), opacity var(--t);
}

.nav-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: clamp(6px, 1.4vw, 10px); }
/* Theme switch. Sized for a comfortable tap target on touch screens. */
.theme-switch {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 2px; background: none; border: 0; flex: none;
}
.ts-track {
  position: relative; display: block; width: 46px; height: 26px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  transition: background var(--t), border-color var(--t);
}
.theme-switch:hover .ts-track { border-color: var(--acc-line); }
.ts-thumb {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--raised); border: 1px solid var(--line-strong);
  color: var(--tx-2);
  transition: transform var(--t), color var(--t-fast), background var(--t);
}
.ts-thumb svg { width: 12px; height: 12px; }
.ts-sun { display: none; }
html[data-theme="dark"] .ts-thumb { transform: translateX(20px); color: var(--acc); }
html[data-theme="dark"] .ts-sun { display: block; }
html[data-theme="dark"] .ts-moon { display: none; }

.nav-progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--acc-deep), var(--acc));
  transition: width .1s linear;
}

.menu-btn { display: none; width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; }
.menu-btn span { display: block; height: 1.5px; background: var(--tx); border-radius: 2px; transition: transform var(--t), opacity var(--t); }
.menu-btn span + span { margin-top: 5px; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.2px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.2px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 9px;
  font-size: .885rem; font-weight: 550; letter-spacing: -.005em;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--acc); color: var(--on-acc); box-shadow: 0 6px 18px -10px var(--acc); }
.btn-primary:hover { background: var(--acc-deep); color: var(--on-acc); }
.btn-ghost { border-color: var(--line-strong); color: var(--tx); background: var(--surface); }
.btn-ghost:hover { border-color: var(--acc-line); background: var(--surface-2); }

/* ---------- Drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); opacity: 0; transition: opacity var(--t); }
.drawer-scrim.is-open { opacity: 1; }
.drawer {
  position: fixed; z-index: 96; top: 0; right: 0; bottom: 0; width: min(340px, 86vw);
  background: var(--bg-2); border-left: 1px solid var(--line);
  padding: 92px 26px 26px; transform: translateX(100%); transition: transform var(--t);
  display: flex; flex-direction: column; justify-content: space-between;
}
.drawer.is-open { transform: none; }
.drawer-links a {
  display: flex; align-items: baseline; gap: 14px;
  padding: 15px 0; border-bottom: 1px solid var(--line);
  font-size: 1.05rem; font-weight: 500; color: var(--tx-2); transition: color var(--t-fast);
}
.drawer-links a:hover { color: var(--acc); }
.dnum { font-family: var(--mono); font-size: .72rem; color: var(--tx-3); }
.drawer-foot { display: grid; gap: 10px; }
.drawer-foot .btn { width: 100%; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(96px, 13vw, 168px) 0 clamp(16px, 3vw, 32px); }
main, .footer { position: relative; z-index: 1; }
.hero-inner { position: relative; }

/* Copy and portrait share a row; .stats spans the full width beneath them. */
.hero-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(240px, 24vw, 330px);
  gap: clamp(30px, 4.5vw, 60px);
  align-items: start;
}
.hero-copy { min-width: 0; }

.hero-portrait { margin: 44px 0 0; position: relative; justify-self: end; width: 100%; }
/* Warm bloom behind the frame, the same light the photograph was shot in. */

.hero-portrait img {
  position: relative; z-index: 1;
  width: 100%; height: auto; aspect-ratio: 596 / 614; object-fit: cover;
  border-radius: 3px;
  filter: saturate(.96);
}
.hero-portrait figcaption {
  position: relative; z-index: 1;
  margin-top: 14px; padding-left: 2px;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .04em;
  color: var(--tx-3); text-align: right;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--tx-3);
  border: 0; background: none; padding: 0; border-radius: 0;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }

.hero-title {
  margin: 30px 0 0;
  font-family: var(--display);
  font-size: clamp(2.4rem, 5.6vw, 4.6rem);
  font-weight: 600; letter-spacing: -.02em; line-height: 1.06;
  font-optical-sizing: auto;
}
.hero-lede {
  margin-top: 30px; max-width: 58ch;
  font-size: clamp(1.02rem, 1.15vw, 1.2rem); color: var(--tx-2); line-height: 1.75;
}
.hero-lede strong { color: var(--tx); font-weight: 550; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; align-items: center; }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: clamp(20px, 4vw, 44px); margin: clamp(38px, 7vw, 62px) 0 0;
  padding-top: 26px; border-top: 1px solid var(--line);
}
.stat { padding: 4px 24px 4px 0; }

.stat dt { font-size: .74rem; color: var(--tx-3); letter-spacing: .01em; }
.stat dd { margin: 6px 0 0; font-family: var(--mono); font-size: 1.55rem; font-weight: 500; letter-spacing: -.03em; color: var(--tx); }
.stat .suf { font-size: .95rem; color: var(--tx-2); }
 }

/* ---------- Section scaffolding ---------- */
.section { padding: clamp(58px, 9vw, 108px) 0; position: relative; }
.section-alt { background: var(--band); border-block: 1px solid var(--line); }

/* A band breaks the single-column rhythm: it runs the full viewport width
   and carries its own ground, so the page has more than one surface. */
.section-band {
  background: var(--bg-2);
  border-block: 1px solid var(--line);
}
.section-band .sec-tag { color: var(--acc-deep); }

/* Ink band - the one section that inverts, so the page has a single
   dominant moment rather than seven equal ones.

   Redefine the tokens for this scope rather than overriding components
   one at a time: everything inside inherits correctly, including things
   added later. Overriding piecemeal left --acc-soft and --line at their
   light-theme values, which washed out on a dark ground. */
.section-ink {
  --bg:          #17130E;
  --bg-2:        #1D1812;
  --surface:     #221C15;
  --surface-2:   #282118;
  --raised:      #2F271D;
  --line:        rgba(255,238,214,.10);
  --line-strong: rgba(255,238,214,.19);
  --tx:          #F6F1E7;
  --tx-2:        #CFC5B5;
  --tx-3:        #A09687;
  --band:        rgba(255,238,214,.03);
  --acc:         #E8A33D;
  --acc-soft:    rgba(232,163,61,.15);
  --acc-line:    rgba(232,163,61,.36);
  --acc-deep:    #C97B24;
  --acc-lift:    #F7D291;
  --good:        #8FBF6E;
  --on-acc:      #1B1206;
  --shadow-md: 0 8px 24px -10px rgba(0,0,0,.6);
  --shadow-lg: 0 28px 70px -32px rgba(0,0,0,.8);

  background: var(--bg);
  color: var(--tx);
  border-block: 0;
}

.sec-head { max-width: var(--wrap-text); margin-bottom: clamp(32px, 5.5vw, 52px); }
.sec-tag {
  display: block; font-family: var(--mono); font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3);
  margin-bottom: 20px;
}
.sec-title {
  font-family: var(--display); font-optical-sizing: auto;
  font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.018em; font-weight: 600;
  max-width: 20ch;
}
.sec-lede { margin-top: 20px; color: var(--tx-2); font-size: 1.04rem; line-height: 1.78; max-width: 62ch; }

/* ---------- Case studies ---------- */
/* Projects are editorial rows, not cards. A rule and space separate them;
   the flagship gets width and scale rather than a heavier border. */
.case {
  position: relative;
  padding: clamp(30px, 4vw, 48px) 0 clamp(26px, 3.6vw, 40px);
  border-top: 1px solid var(--line);
}
.case[hidden] { display: none; }

.stack-flow {
  margin-top: 26px;
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch;
  padding: clamp(13px, 3.2vw, 20px); border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface-2), var(--bg));
}
.sf-node {
  display: flex; flex-direction: column; gap: 5px;
  padding: 15px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--bg);
  transition: border-color var(--t), transform var(--t);
}
.sf-node:hover { border-color: var(--acc-line); transform: translateY(-2px); }
.sf-lang { font-family: var(--mono); font-size: .85rem; font-weight: 600; }
.sf-py .sf-lang  { color: var(--acc); }
.sf-cpp .sf-lang { color: var(--tx); }
.sf-c .sf-lang { color: var(--good); }
.sf-desc { font-size: .8rem; color: var(--tx-2); line-height: 1.5; }

.sf-link { position: relative; display: grid; place-items: center; min-width: 132px; padding: 0 12px; }
.sf-link::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 1px;
  background: linear-gradient(90deg, var(--acc-line), var(--line-strong));
}
.sf-link::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 5px; height: 5px;
  border-top: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong);
  transform: translateY(-50%) rotate(45deg);
}
.sf-link span {
  position: relative; font-family: var(--mono); font-size: .66rem; color: var(--tx-2);
  background: var(--surface); padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px;
}

.case-body { padding: clamp(20px, 4.4vw, 38px) clamp(20px, 4.4vw, 38px) clamp(20px, 4vw, 34px); }
.case-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.badge {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--tx-3);
  border: 0; border-radius: 0; padding: 0; background: none;
}
.badge-accent { color: var(--acc); }

.case-title {
  font-family: var(--display); font-optical-sizing: auto;
  font-size: 1.7rem; letter-spacing: -.012em; font-weight: 600;
}
.case-title .alias { font-size: .82rem; font-weight: 400; color: var(--tx-3); letter-spacing: 0; }
.case-sub { margin-top: 8px; font-size: .95rem; color: var(--tx-2); font-weight: 500; }
.case-text { margin-top: 16px; color: var(--tx-2); line-height: 1.78; font-size: 1rem; }

.case-points { margin-top: 20px; display: grid; gap: 11px; }
.case-points li {
  position: relative; padding-left: 22px; font-size: .92rem;
  color: var(--tx-2); line-height: 1.72;
}
.case-points li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--acc); opacity: .75;
}
.case-points strong { color: var(--tx); font-weight: 550; }

/* Technology labels support comprehension; they are not the visual event.
   One line, dot-separated, instead of a wall of pills. */
.case-tags { margin-top: 20px; font-family: var(--mono); font-size: .74rem; line-height: 1.9; color: var(--tx-3); }
.tag {
  display: inline; font-family: inherit; font-size: inherit; color: inherit;
  border: 0; border-radius: 0; padding: 0; background: none;
}
/* Tags sit adjacent in the markup with no whitespace, so the separator has
   to be generated rather than relying on a space between elements. */
.tag + .tag::before { content: " \00B7 "; color: var(--line-strong); }

.case-links { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.link-arrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .875rem; font-weight: 550; color: var(--acc);
  transition: gap var(--t-fast);
}
.link-arrow svg { width: 15px; height: 15px; }
.link-arrow:hover { gap: 12px; }

.case-pair { display: block; }
.case-sm { padding: clamp(26px, 3.2vw, 38px) 0 clamp(22px, 2.8vw, 30px); }
.case-sm .case-title { font-size: 1.24rem; }

/* ---------- Foundations ---------- */
.foundations { margin-top: 58px; }
.foundations[hidden] { display: none; }
.fnd-head { max-width: 620px; margin-bottom: 26px; }
.fnd-head h3 { font-size: 1.22rem; letter-spacing: -.025em; }
.fnd-head p { margin-top: 10px; color: var(--tx-2); font-size: .93rem; line-height: 1.7; }

.fnd-list { border-top: 1px solid var(--line); }
.fnd-item {
  display: grid; grid-template-columns: 190px 1fr; gap: 30px;
  padding: 26px 4px; border-bottom: 1px solid var(--line);
  transition: background var(--t);
}
.fnd-item[hidden] { display: none; }
.fnd-item:hover { background: var(--surface); }
.fnd-meta { display: flex; flex-direction: column; gap: 3px; }
.fnd-year { font-family: var(--mono); font-size: .78rem; color: var(--acc); }
.fnd-org { font-size: .78rem; color: var(--tx-3); }
.fnd-body h4 { font-size: 1.02rem; letter-spacing: -.02em; }
.fnd-body p { margin-top: 8px; color: var(--tx-2); font-size: .92rem; line-height: 1.74; }
.fnd-body .case-tags { margin-top: 14px; }
.fnd-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

/* Call-to-action into a project page. These were plain text links and got
   skipped, so they are now chips that breathe: a slow sheen crosses them and
   the arrow drifts. Both are long-cycle and low-contrast on purpose - enough
   to catch the eye in passing, not enough to pull at it while reading. */
.btn-detail {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 16px; border-radius: 999px;
  font-size: .84rem; font-weight: 600; letter-spacing: -.005em;
  color: var(--acc);
  border: 1px solid var(--acc-line); background: var(--acc-soft);
  transition: color var(--t-fast), border-color var(--t-fast),
              background var(--t-fast), transform var(--t-fast);
}
.btn-detail svg { width: 14px; height: 14px; flex: none; }
.btn-detail.is-ghost { color: var(--tx-2); border-color: var(--line-strong); background: transparent; }

.btn-detail::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 34%,
              color-mix(in srgb, var(--acc) 26%, transparent) 50%, transparent 66%);
  transform: translateX(-130%);
  pointer-events: none;
}
.js .btn-detail::after { animation: sheen 5.4s var(--ease) infinite; }
.btn-detail:nth-of-type(2)::after { animation-delay: 1.5s; }
@keyframes sheen {
  0%, 62% { transform: translateX(-130%); }
  92%, 100% { transform: translateX(130%); }
}

.js .btn-detail svg { animation: nudge 5.4s var(--ease) infinite; }
.btn-detail:nth-of-type(2) svg { animation-delay: 1.5s; }
@keyframes nudge {
  0%, 62%, 100% { transform: none; }
  74% { transform: translate(2.5px, -2.5px); }
  86% { transform: none; }
}

.btn-detail:hover {
  color: var(--on-acc); background: var(--acc); border-color: var(--acc);
  transform: translateY(-1px);
}
.btn-detail.is-ghost:hover { color: var(--on-acc); background: var(--acc); border-color: var(--acc); }
.btn-detail:hover::after, .btn-detail:hover svg { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .js .btn-detail::after, .js .btn-detail svg { animation: none; }
}

/* ---------- Deep dive ---------- */
.dive { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 22px; align-items: start; }
.panel {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); padding: clamp(20px, 4vw, 30px) clamp(20px, 4vw, 30px) clamp(18px, 3.5vw, 26px);
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.panel:hover { border-color: var(--acc-line); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.panel-wide { margin-top: 22px; }
.panel-head h3 { font-size: 1.18rem; letter-spacing: -.025em; }
.panel-head p { margin-top: 7px; font-size: .87rem; color: var(--tx-3); }
.panel-note { margin-top: 20px; font-size: .85rem; color: var(--tx-2); line-height: 1.7; padding-top: 18px; border-top: 1px solid var(--line); }

/* Execution path. Laid out for the width this panel actually gets: the column is
   473px on any desktop >=1140px, so the diagram is authored at 480 and renders
   essentially 1:1 there. No min-width, so it never forces a horizontal scroll,
   and max-width stops it upscaling into blur when the grid drops to one column. */
.diagram { margin-top: 22px; }
.diagram svg { display: block; width: 100%; max-width: 480px; height: auto; margin-inline: auto; }

.d-node rect { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1; }
.d-node text { fill: var(--tx); font-family: var(--sans); font-size: 15px; font-weight: 600; }
.d-node .d-sm { fill: var(--tx-2); font-size: 12px; font-weight: 400; font-family: var(--mono); }
.d-bridge rect { fill: var(--acc-soft); stroke: var(--acc-line); }
.d-core rect { stroke: var(--acc-line); }
.d-metal rect { stroke: color-mix(in srgb, var(--good) 45%, transparent); }
.d-metal text { fill: var(--tx); }
.d-line { stroke: var(--line-strong); stroke-width: 1.4; fill: none; }
.d-dash { stroke-dasharray: 4 4; opacity: .6; }
.d-arrow { fill: var(--tx-3); }
/* paint-order lets the label knock a gap in the return wire it sits on. */
.d-label {
  fill: var(--tx-3); font-family: var(--mono); font-size: 10.5px;
  paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round;
}

/* Chart */
.chart { margin-top: 24px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 14px; margin-bottom: 12px; }
.bar-label { font-size: .82rem; color: var(--tx-2); font-weight: 500; }
.bar-track { height: 34px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.bar {
  height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tx-3) 30%, transparent), color-mix(in srgb, var(--tx-3) 55%, transparent));
  display: flex; align-items: center; justify-content: flex-end;
  transition: width 1.05s var(--ease);
}
.bar span { font-family: var(--mono); font-size: .76rem; color: var(--tx); padding-right: 11px; white-space: nowrap; }
.bar-good { background: linear-gradient(90deg, var(--acc-deep), var(--acc)); }
.bar-good span { color: var(--on-acc); font-weight: 600; }
.chart-cap { margin-top: 12px; font-size: .78rem; color: var(--tx-3); line-height: 1.6; }

.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; margin-top: 24px; }
.metric { padding: 0; display: grid; gap: 4px; }
.metric:hover { border-color: var(--acc-line); transform: translateY(-2px); }
.m-val { font-family: var(--mono); font-size: 1.15rem; font-weight: 500; color: var(--acc); letter-spacing: -.02em; }
.m-key { font-size: .8rem; color: var(--tx); font-weight: 500; }
.m-note { font-size: .72rem; color: var(--tx-3); }

.disclose { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.disclose summary {
  cursor: pointer; font-size: .84rem; font-weight: 550; color: var(--tx-2);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.disclose summary::-webkit-details-marker { display: none; }
.disclose summary::before { content: "+"; font-family: var(--mono); color: var(--acc); }
.disclose[open] summary::before { content: "−"; }
.disclose summary:hover { color: var(--tx); }
.disclose-body p { margin-top: 12px; font-size: .85rem; color: var(--tx-2); line-height: 1.75; }

.limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 20px; margin-top: 24px; }
.limit { border-left: 2px solid var(--line-strong); padding-left: 18px; transition: border-color var(--t); }
.limit:hover { border-left-color: var(--acc); }
.limit:first-child { border-left-color: var(--acc); }
.limit-tag { font-family: var(--mono); font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; color: var(--tx-3); }
.limit h4 { margin-top: 8px; font-size: 1rem; letter-spacing: -.02em; }
.limit p { margin-top: 9px; font-size: .89rem; color: var(--tx-2); line-height: 1.74; }

/* ---------- Principles ---------- */
.principles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: clamp(28px, 3.4vw, 44px) clamp(24px, 3vw, 48px);
}
.principle { padding: 22px 0 0; border-top: 1px solid var(--line); }

.p-num { font-family: var(--mono); font-size: .74rem; color: var(--acc); letter-spacing: .06em; }
.principle h3 { margin-top: 14px; font-size: 1.06rem; letter-spacing: -.02em; max-width: 26ch; }
.principle p { margin-top: 11px; color: var(--tx-2); font-size: .94rem; line-height: 1.76; }

/* ---------- Timeline ---------- */
.timeline { display: grid; gap: 18px; }
.tl-item { display: grid; grid-template-columns: 210px 1fr; gap: 30px; }
.tl-when { position: sticky; top: 100px; align-self: start; display: flex; flex-direction: column; gap: 4px; padding-top: 24px; }
.tl-range { font-family: var(--mono); font-size: .8rem; color: var(--acc); }
.tl-place { font-size: .78rem; color: var(--tx-3); }
.tl-card {
  padding: 2px 0 6px 26px;
  border-left: 1px solid var(--line);
}
.tl-card:hover { border-left-color: var(--acc-line); }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.tl-head h3 { font-size: 1.14rem; letter-spacing: -.025em; }
.tl-org { font-family: var(--mono); font-size: .78rem; color: var(--acc); }
.tl-intro { margin-top: 10px; color: var(--tx-2); font-size: .92rem; line-height: 1.7; }
.tl-card ul { margin-top: 16px; display: grid; gap: 9px; }
.tl-card ul li { position: relative; padding-left: 20px; font-size: .9rem; color: var(--tx-2); line-height: 1.72; }
.tl-card ul li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.tl-card .case-tags { margin-top: 18px; }

.edu { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 20px; margin-top: clamp(30px, 5vw, 44px); }
.edu-card {
  display: flex; flex-direction: column;
  padding: 2px 0 4px 26px; border-left: 1px solid var(--line);
}
/* One card's institution line wraps to two lines and the other's does not.
   Pinning the meta + link group to the bottom keeps both cards aligned on
   their last two rows instead of drifting apart by a line height. */
.edu-foot { margin-top: auto; padding-top: 18px; }
.edu-foot .edu-meta { margin-top: 0; }
.edu-card:hover { border-left-color: var(--acc-line); }
.edu-tag { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--acc); }
.edu-card h3 { margin-top: 10px; font-size: 1.04rem; letter-spacing: -.022em; }
.edu-card p { margin-top: 7px; font-size: .88rem; color: var(--tx-2); }
.edu-meta { font-family: var(--mono); font-size: .78rem; color: var(--tx-3) !important; }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.skill-card {
  padding: 4px 0 22px;
  border-bottom: 1px solid var(--line);
}

.skill-muted { background: var(--bg-2); }
.sk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sk-head h3 { font-size: 1rem; letter-spacing: -.022em; }
.sk-i { font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tx-3); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.sk-list { margin-top: 14px; display: grid; gap: 8px; }
.sk-list li { font-size: .89rem; color: var(--tx-2); display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; }
.sk-note { font-family: var(--mono); font-size: .7rem; color: var(--tx-3); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr .9fr; gap: 56px; align-items: start; }
.contact-copy .sec-title { margin-top: 0; }
.contact-list { display: grid; gap: 10px; }
.contact-list a {
  display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  padding: 15px 18px; transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.contact-list a:hover { border-color: var(--acc-line); background: var(--surface-2); transform: translateX(3px); }
.cl-ico { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--acc); }
.cl-ico svg { width: 17px; height: 17px; }
.cl-text { display: flex; flex-direction: column; font-size: .87rem; color: var(--tx-2); min-width: 0; }
.cl-text strong { font-size: .72rem; font-weight: 550; color: var(--tx-3); text-transform: uppercase; letter-spacing: .05em; }
.cl-text { overflow-wrap: anywhere; }
.cl-go { color: var(--tx-3); font-size: .9rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 34px 0; background: var(--band); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: center; }
.f-brand { display: flex; align-items: center; gap: 12px; text-align: center; }
/* Name and role read as one centred block; the rights line sits under it. */
.footer-inner { flex-direction: column; gap: 10px; }
.f-rights { font-family: var(--mono); font-size: .72rem; letter-spacing: .02em; color: var(--tx-3); }
.f-brand > div { display: flex; flex-direction: column; align-items: center; }
.f-brand strong { font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; }
.f-brand span { font-size: .82rem; color: var(--tx-3); }
.f-meta { display: flex; flex-direction: column; gap: 3px; text-align: right; font-size: .9rem; color: var(--tx-2); }
.f-meta a { color: var(--acc); }
.f-meta a:hover { text-decoration: underline; }

/* ---------- To top + toast ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px); color: var(--tx-2);
  box-shadow: var(--shadow-md);
  transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast), opacity var(--t);
}
.to-top svg { width: 18px; height: 18px; }
.to-top:hover { color: var(--acc); border-color: var(--acc-line); transform: translateY(-2px); }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Evaluation practice ---------- */
.pipeline { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step { position: relative; }
.step:last-child::after { content: none; }
.js .pipeline.is-drawn .step::after { transform: scaleX(1); }
.js .pipeline.is-drawn .step:nth-child(2)::after { transition-delay: .18s; }
.js .pipeline.is-drawn .step:nth-child(3)::after { transition-delay: .36s; }
.step-n {
  display: block;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .1em;
  color: var(--acc);
}
.step h3 { margin-top: 20px; font-size: 1.02rem; letter-spacing: -.022em; }
.step p { margin-top: 10px; font-size: .9rem; color: var(--tx-2); line-height: 1.74; }
.step .case-tags { margin-top: 14px; }

.eval-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 22px; margin-top: clamp(34px, 6vw, 56px); align-items: start; }
.agent-list { margin-top: 20px; display: grid; gap: 10px; }
.agent-list li {
  display: flex; align-items: center; gap: 11px;
  font-size: .9rem; color: var(--tx-2);
  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg);
  transition: border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.agent-list li:hover { border-color: var(--acc-line); color: var(--tx); transform: translateX(3px); }
.ag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); flex: none; opacity: .8; }
.eval-metrics { grid-template-columns: 1fr; gap: 10px; }

/* ---------- Motion layer ---------- */

/* Hero headline: lines rise out of their own box on load. */
.hero-title .ln { display: block; overflow: hidden; padding-bottom: .2em; margin-bottom: -.2em; }
.hero-title .ln > span { display: block; }
.js .hero-title .ln > span { transform: translateY(112%); opacity: 0; animation: lineUp .95s var(--ease) forwards; }
.js .hero-title .ln:nth-child(1) > span { animation-delay: .10s; }
.js .hero-title .ln:nth-child(2) > span { animation-delay: .22s; }
@keyframes lineUp { to { transform: none; opacity: 1; } }

/* Cursor-tracked wash on cards. Pointer devices only. */
.case, .panel, .skill-card, .tl-card { position: relative; }
@media (hover: hover) and (pointer: fine) {
  .hero-portrait img:hover { transform: rotate(0deg); box-shadow: var(--shadow-lg), 0 0 0 1px var(--acc-line); }

  .case::after, .panel::after, .skill-card::after, .tl-card::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), var(--acc-soft), transparent 60%);
    opacity: 0; transition: opacity .4s var(--ease);
  }
  .case:hover::after, .panel:hover::after, .skill-card:hover::after, .tl-card:hover::after { opacity: 1; }
}

/* Execution path: a pulse travels the wires while the diagram is on screen. */
/* Execution path: a pulse travels the wires while the diagram is on screen.
   Each wire carries its own delay in --pd, so the order does not depend on
   how the paths happen to be interleaved in the markup. */
.d-pulse { fill: none; stroke: var(--acc); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 6 100; opacity: 0; }
.js .diagram.is-live .d-pulse { opacity: 1; animation: wire 3.4s linear infinite; animation-delay: var(--pd, 0s); }
@keyframes wire { from { stroke-dashoffset: 6; } to { stroke-dashoffset: -100; } }

/* Timeline rail fills as the section scrolls past. */
.timeline { position: relative; }
.timeline::before,
.timeline::after { content: ""; position: absolute; left: 225px; width: 1px; top: 32px; }
.timeline::before { bottom: 32px; background: var(--line); }
.timeline::after {
  height: calc(var(--tl, 0) * (100% - 64px));
  background: linear-gradient(180deg, var(--acc), var(--acc-line));
}
.tl-item::before {
  content: ""; position: absolute; left: 221px; top: 32px; z-index: 1;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  transition: background var(--t), border-color var(--t), box-shadow var(--t);
}
.tl-item.is-in::before { background: var(--acc); border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .eval-metrics { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .step::after { display: none; }
}

@media (max-width: 860px) {
  .hero-lead { grid-template-columns: 1fr; gap: 34px; }
  .hero-portrait { justify-self: start; width: min(230px, 62%); }
  .hero-portrait figcaption { text-align: left; }
  .nav-links { display: none; }
  .menu-btn { display: block; }
  .section { padding: 80px 0; }
  .hero { padding-top: 124px; }
  .contact { grid-template-columns: 1fr; }
  .stack-flow { grid-template-columns: 1fr; }
  .sf-link { min-width: 0; padding: 14px 0; }
  .sf-link::before { left: 50%; right: auto; top: 6px; bottom: 6px; width: 1px; height: auto; background: linear-gradient(180deg, var(--acc-line), var(--line-strong)); }
  .sf-link::after { right: auto; left: 50%; top: auto; bottom: 6px; transform: translateX(-50%) rotate(135deg); }
  .pipeline { grid-template-columns: 1fr; row-gap: 30px; }
  .timeline::before, .timeline::after, .tl-item::before { display: none; }
  .contact { gap: 34px; }
  .tl-item, .fnd-item { grid-template-columns: 1fr; gap: 12px; }
  .tl-when { position: static; padding-top: 0; flex-direction: row; gap: 12px; align-items: baseline; }
  .fnd-meta { flex-direction: row; gap: 10px; align-items: baseline; }
  .sec-head { margin-bottom: 38px; }
}

@media (max-width: 560px) {
  .hero-cta .btn { width: 100%; }
  .footer-inner { flex-direction: column; align-items: center; }
  .to-top { right: 14px; bottom: 14px; }
}

/* ---------- Motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .hero-title .ln > span { transform: none; opacity: 1; animation: none; }
  .js .pipeline.is-drawn .step::after { transform: scaleX(1); }
  .js .diagram.is-live .d-pulse { animation: none; opacity: 0; }
  .hero-portrait img:hover { transform: rotate(-1.4deg); }
}

@media print {
  .nav, .drawer, .drawer-scrim, .to-top, .field, .marquee, .hero-grid, .filters, .case-links { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 24px 0; border: 0; }
  .case, .panel, .tl-card, .skill-card, .edu-card { border: 1px solid #ccc; break-inside: avoid; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .js .hero-title .ln > span { transform: none !important; opacity: 1 !important; animation: none !important; }
  .d-pulse, .timeline::after, .tl-item::before { display: none; }
  .hero-lead { display: block; }
  .hero-portrait { width: 150px; margin-bottom: 16px; }
  .hero-portrait::before { display: none; }
  .hero-portrait img { transform: none !important; box-shadow: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .75em; color: #555; }
}

/* Credential cards carry a link out to their own page. */
.edu-links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }


/* ---------- Project rows ---------- */
.case-sm {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  /* row gap stays tight - only the columns get the wide gutter */
  gap: 0 clamp(20px, 4vw, 56px);
  align-items: start;
}
.case-sm .case-top { grid-column: 1; margin: 0; }
.case-sm .case-title { grid-column: 2; grid-row: 1; font-size: clamp(1.3rem, 2vw, 1.75rem); }
.case-sm .case-sub,
.case-sm .case-text,
.case-sm .case-points,
.case-sm .case-tags,
.case-sm .case-links { grid-column: 2; }

.case-title {
  font-family: var(--display); font-optical-sizing: auto;
  font-size: clamp(1.7rem, 2.6vw, 2.3rem); letter-spacing: -.014em; font-weight: 600;
}
.case-text { max-width: 68ch; }
.case-points { max-width: 68ch; }

@media (max-width: 860px) {
  .case-sm { grid-template-columns: 1fr; gap: 14px; }
  .case-sm .case-top,
  .case-sm .case-title,
  .case-sm .case-sub,
  .case-sm .case-text,
  .case-sm .case-points,
  .case-sm .case-tags,
  .case-sm .case-links { grid-column: 1; }
  .case-sm .case-title { grid-row: auto; }
}
