/* ==========================================================================
   Kunal Sharma — portfolio
   Accent (#00ff99) is SIGNAL ONLY: active state, numerals, hover, links,
   kickers. Never paragraph text, never a large filled area.
   ========================================================================== */

:root {
  --bg:          #1c1c22;
  --bg-alt:      #232329;   /* terminal card only — it's a window object, not a band */
  /* Every raised surface on the page is the SAME translucent lift over the one
     continuous background. Opaque section bands would cut the grid into patches. */
  --card:        rgba(255, 255, 255, .03);
  --card-hover:  rgba(255, 255, 255, .06);
  --accent:      #00ff99;
  --accent-soft: rgba(0, 255, 153, .12);
  --accent-line: rgba(0, 255, 153, .34);
  --fg:          #ffffff;
  --fg-dim:      rgba(255, 255, 255, .64);   /* 7.6:1 on --bg */
  --fg-faint:    rgba(255, 255, 255, .52);   /* 5.1:1 on --bg — AA floor for body text */
  --fg-ghost:    rgba(255, 255, 255, .36);   /* large decorative numerals only, 3.1:1 */
  --line:        rgba(255, 255, 255, .10);   /* decorative hairlines */
  --line-strong: rgba(255, 255, 255, .18);
  --line-ui:     rgba(255, 255, 255, .36);   /* borders that ARE a control's boundary — 3:1 */

  --r-sm:   8px;
  --r-card: 12px;
  --r-lg:   16px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --container: 1160px;
  --section-y: clamp(72px, 8vw, 104px);
  --header-h: 68px;

  --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ============================== RESET ============================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: rgba(255, 255, 255, .22) var(--bg); }

/* Dark scrollbar — the Windows default paints a bright white strip down a dark page. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .28); }

body {
  position: relative;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Background grid — one tiled SVG cell rather than hairline gradients. The
   tile's viewBox is 32 units drawn at 100px, so its 1-unit stroke renders ~3px
   wide and soft instead of a hard 1px line; the radial mask fades it out toward
   the edges so it reads as texture, not graph paper. Runs the whole page. */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='100' height='100' fill='none' stroke='rgb(255 255 255 / 0.03)'%3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e");
  /* Stroke alpha and mask lifted verbatim from the reference site: .03 lines,
     radial fade from page centre to transparent at the corners. */
  -webkit-mask-image: radial-gradient(#000 20%, transparent 100%);
  mask-image: radial-gradient(#000 20%, transparent 100%);
}

/* Content sits above the grid layer. */
.site-header, main, .site-footer, .skip { position: relative; z-index: 1; }
.site-header { z-index: 60; }

ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }

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

/* Text selection in brand green instead of the browser's default blue. */
::selection { background: var(--accent); color: #14141a; }
::-moz-selection { background: var(--accent); color: #14141a; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--bg);
  padding: 10px 18px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600;
  transition: top .2s var(--ease);
}
.skip:focus { top: 12px; }

/* ============================== TYPE ============================== */
h1 { font-size: clamp(38px, 5.4vw, 62px); line-height: 1.08; font-weight: 600; letter-spacing: -.02em; }
h2 { font-size: clamp(26px, 3.6vw, 40px); line-height: 1.12; font-weight: 600; letter-spacing: -.015em; }
h3 { font-size: clamp(17px, 1.8vw, 21px);  line-height: 1.35; font-weight: 600; }

.accent { color: var(--accent); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }

/* ============================== LAYOUT ============================== */
.wrap { max-width: var(--container); margin-inline: auto; padding-inline: clamp(20px, 5vw, 48px); }

.section { padding-block: var(--section-y); }
/* No alternating section bands — one uninterrupted surface from hero to footer,
   so the grid never breaks into rectangles. Cards carry all the separation. */
.section--alt { background: transparent; }
section[id] { scroll-margin-top: 92px; }

.kicker {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--accent);
  text-transform: uppercase; letter-spacing: .14em;
}
.rule { display: block; width: 40px; height: 1px; background: var(--accent); flex: none; }

.sec-head { margin-bottom: 44px; }
.sec-head h2 { margin-top: 14px; }
.sec-head__lede { margin-top: 14px; color: var(--fg-dim); max-width: 56ch; }

/* ============================== ICONS ============================== */
.ic {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}
.ic--sm { width: 14px; height: 14px; }
.ic--lg { width: 26px; height: 26px; }

/* ============================== BUTTONS ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 28px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background .24s var(--ease), color .24s var(--ease),
              border-color .24s var(--ease), transform .24s var(--ease);
}
.btn--sm { height: 40px; padding: 0 20px; font-size: 13.5px; }

.btn--solid { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
.btn--solid:hover { background: #b8ffe0; border-color: #b8ffe0; transform: translateY(-2px); }

.btn--outline { border-color: var(--accent); color: var(--accent); }
.btn--outline:hover { background: var(--accent); color: var(--bg); transform: translateY(-2px); }

.tlink {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--accent);
  border-bottom: 1px solid transparent; padding-bottom: 2px;
  transition: border-color .2s var(--ease);
}
.tlink:hover { border-bottom-color: var(--accent); }
.tlink .ic { transition: transform .2s var(--ease); }
.tlink:hover .ic { transform: translate(2px, -2px); }

/* ============================== CHIPS ============================== */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-size: 12.5px; line-height: 1.4; padding: 5px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--fg-faint);
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.chip:hover { border-color: var(--accent-line); color: var(--accent); }

/* ============================== HEADER ============================== */
.site-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 60;
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
/* The blur lives on a pseudo-element, not on .site-header itself. A non-none
   backdrop-filter makes the element a containing block for position:fixed
   descendants — which would collapse the mobile menu overlay (a fixed child
   of this header) to the header's own 68px height. */
.site-header::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(28, 28, 34, .72);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  transition: background .2s var(--ease);
}
body.is-scrolled .site-header { border-bottom-color: var(--line); }
body.is-scrolled .site-header::before { background: rgba(28, 28, 34, .9); }

.header-inner {
  position: relative; z-index: 1;
  height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

.wordmark { display: flex; align-items: baseline; font-size: 17px; font-weight: 600; }
.wordmark__short { display: none; }
.wordmark__block { width: 6px; height: 6px; background: var(--accent); margin-left: 4px; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__list { display: flex; gap: 28px; }

.nav__link { position: relative; font-size: 14px; color: var(--fg-dim); transition: color .2s var(--ease); }
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .26s var(--ease);
}
.nav__link:hover { color: var(--fg); }
.nav__link.is-active { color: var(--accent); }
.nav__link.is-active::after { transform: scaleX(1); }

.burger { display: none; width: 44px; height: 44px; position: relative; margin-right: -10px; }
.burger span {
  position: absolute; left: 13px; width: 18px; height: 1px;
  background: var(--accent); border-radius: 1px;
  transition: transform .26s var(--ease);
}
.burger span:nth-child(1) { top: 19px; }
.burger span:nth-child(2) { top: 25px; }
.burger.is-open span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.burger.is-open span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

/* ============================== HERO ============================== */
.hero { position: relative; padding: 128px 0 84px; overflow: hidden; }
/* Accent glow only — the grid itself now lives on <body> and runs the whole page. */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(460px 340px at 76% 24%, rgba(0, 255, 153, .07), transparent 70%);
}
.hero > .wrap { position: relative; }

.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: center; }
.hero__copy { max-width: 620px; }

.hero__eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--accent);
  text-transform: uppercase; letter-spacing: .16em;
}
.hero__eyebrow .rule { width: 28px; }

.hero h1 { margin-top: 20px; }
.hero__hello { display: block; font-size: .58em; font-weight: 500; color: var(--fg-dim); letter-spacing: 0; }
.hero h1 .hl { display: block; color: var(--accent); }

.hero__tagline { margin-top: 22px; font-size: 15.5px; line-height: 1.78; color: var(--fg-dim); max-width: 56ch; }
.hero__cta { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }

.socials { margin-top: 30px; display: flex; gap: 12px; }
.socials a {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line-ui); border-radius: 50%; color: var(--fg-dim);
  transition: border-color .24s var(--ease), color .24s var(--ease), transform .24s var(--ease);
}
.socials a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* --- terminal identity card --- */
.term {
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.term__bar {
  height: 40px; display: flex; align-items: center; gap: 7px;
  padding: 0 14px; border-bottom: 1px solid var(--line); position: relative;
}
.term__dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.18); }
.term__dot--on { background: rgba(0, 255, 153, .55); }
.term__title {
  position: absolute; left: 0; right: 0; text-align: center;
  font-size: 12px; color: var(--fg-faint); pointer-events: none;
}
.term__body { padding: 20px; font-size: 13px; line-height: 1.95; }
.term__prompt { color: var(--accent); margin-right: 8px; }
.term__cmd { color: var(--fg-dim); }
.term__out { color: var(--fg); min-height: 1.9em; }

.term__rows { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.term__rows > div { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 8px; }
.term__rows dt { color: var(--fg-faint); }
.term__rows dd { color: var(--fg); word-break: break-word; }

.term__caret { display: inline-block; width: 8px; height: 16px; background: var(--accent); vertical-align: -3px; margin-top: 6px; }
html.js:not(.no-motion) .term__caret { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============================== STATS ============================== */
/* No band and no rules — the old border-block drew two full-width lines that
   sliced straight across the page grid. The counters float on the grid itself. */
.stats { padding-block: 4px; }
/* space-between instead of 4 equal columns: the tiles have very different
   widths, so equal tracks left ragged, uneven gaps between pairs. */
.stats__grid {
  display: flex; justify-content: space-between; align-items: center;
  gap: 28px 48px; flex-wrap: wrap;
}
.stat { display: flex; align-items: center; gap: 16px; }
.stat__value { font-size: clamp(30px, 3.4vw, 44px); font-weight: 700; line-height: 1; letter-spacing: -.02em; white-space: nowrap; color: var(--accent); }
.stat__label { font-size: 13px; color: var(--fg-faint); line-height: 1.45; }

/* ============================== SERVICES ============================== */
/* Separate bordered cards rather than one panel split by 1px gaps — the gap
   trick needs an opaque parent, which would punch a rectangle out of the grid. */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.svc {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 32px 26px 36px;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.svc:hover { background: var(--card-hover); border-color: var(--accent-line); }

.svc__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.svc__num { font-size: 42px; font-weight: 700; line-height: 1; color: var(--fg-ghost); transition: color .3s var(--ease); }
.svc:hover .svc__num { color: var(--accent); }
.svc__arrow {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 50%; background: var(--fg); color: var(--bg);
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.svc:hover .svc__arrow { background: var(--accent); transform: rotate(45deg); }
.svc h3 { margin-bottom: 10px; transition: color .3s var(--ease); }
.svc:hover h3 { color: var(--accent); }
.svc p { font-size: 14px; color: var(--fg-dim); }

/* ============================== RESUME TABS ============================== */
.resume-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 44px; align-items: start; }
.tabs { display: grid; gap: 14px; align-content: start; }
.tab {
  padding: 17px 18px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--fg-dim); font-size: 15px; text-align: center;
  transition: background .24s var(--ease), color .24s var(--ease), border-color .24s var(--ease);
}
.tab:hover { color: var(--fg); border-color: var(--line-strong); }
.tab.is-active {
  background: var(--accent); border-color: var(--accent);
  color: var(--bg); font-weight: 600;
}

.panels { min-height: 380px; }
.panel { animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
html.no-motion .panel { animation: none; }
.panel__lede { color: var(--fg-dim); max-width: 68ch; margin-bottom: 28px; }

.rows { display: grid; gap: 16px; }
.row {
  display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 2px solid var(--accent); border-radius: var(--r-card);
  padding: 24px 26px;
  transition: background .24s var(--ease), transform .24s var(--ease);
}
.row:hover { background: var(--card-hover); transform: translateX(4px); }
.row__date { font-size: 13px; color: var(--accent); }
.row h3 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row__org { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--fg-faint); margin-top: 6px; }
.row__note { font-size: 14px; color: var(--fg-dim); margin-top: 8px; }
.row .chips { margin-top: 16px; }

.pill-current {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 500;
}
.pill-current i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
html.js:not(.no-motion) .pill-current i { animation: dim 2s var(--ease) infinite; }
@keyframes dim { 50% { opacity: .35; } }

.blist { margin-top: 14px; display: grid; gap: 10px; }
.blist li {
  position: relative; padding-left: 20px;
  font-size: 14.5px; line-height: 1.7; color: var(--fg-dim);
}
.blist li::before {
  content: ""; position: absolute; left: 0; top: .6em;
  width: 6px; height: 6px; background: rgba(0, 255, 153, .55);
}
.blist--sm li { font-size: 14px; }

.certlist { margin-top: 12px; display: grid; }
.certlist li { border-bottom: 1px solid var(--line); }
.certlist li:last-child { border-bottom: 0; }
.certlist a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 0; font-size: 14px;
  transition: color .18s var(--ease), transform .18s var(--ease);
}
.certlist a:hover { color: var(--accent); transform: translateX(4px); }
.tag {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--fg-faint); flex: none;
}
.tag--badge { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* 2x2 group grid with bold headings, like the reference's Frontend / Backend split. */
.sgroups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 48px; }
.sgroup__label { font-size: 19px; font-weight: 600; color: var(--fg); margin-bottom: 16px; }
.sgroup .chip { font-size: 13px; padding: 8px 14px; color: rgba(255, 255, 255, .72); }

/* Two columns, label over value, no rules — the reference's layout exactly. */
.about { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 40px; }
.about div { display: flex; flex-direction: column; gap: 4px; }
.about dt { color: var(--fg-faint); font-size: 13.5px; }
.about dd { font-size: 16px; font-weight: 500; word-break: break-word; }
.about dd a:hover { color: var(--accent); }

/* ============================== PROJECTS ============================== */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.filter {
  padding: 9px 22px; border-radius: 999px;
  border: 1px solid var(--line-ui); color: var(--fg-dim); font-size: 13px;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.filter:hover { color: var(--fg); border-color: var(--fg-faint); }
.filter.is-active { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.pcard {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden;
  transition: border-color .24s var(--ease), transform .24s var(--ease);
}
.pcard:hover { border-color: var(--accent-line); transform: translateY(-4px); }
.pcard.is-hidden { display: none; }

/* Swap the inline <svg> for <img src="assets/…"> — both fill this 16:9 box. */
.pcard__img {
  aspect-ratio: 16 / 9; overflow: hidden;
  border-bottom: 1px solid var(--line); background: #1a1a20;
}
.pcard__img > * { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard__img svg { transition: transform .5s var(--ease); }
.pcard:hover .pcard__img svg { transform: scale(1.04); }

.pcard__body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.pcard__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pcard__tag {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 4px; padding: 4px 10px;
}
.pcard__top a { color: var(--fg-faint); transition: color .2s var(--ease); }
.pcard__top a:hover { color: var(--accent); }
.pcard h3 { transition: color .24s var(--ease); }
.pcard:hover h3 { color: var(--accent); }
.pcard p { font-size: 13.5px; color: var(--fg-dim); margin-top: 8px; flex: 1; }
.pcard .chips { margin-top: 18px; }
.pcard__link {
  margin-top: 16px; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--accent); align-self: flex-start;
}
.pcard__link:hover { text-decoration: underline; }
.pgrid__empty { margin-top: 24px; color: var(--fg-faint); }

/* ============================== RESEARCH ============================== */
.pub {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  gap: 44px; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(24px, 3vw, 38px);
  transition: border-color .24s var(--ease);
}
.pub + .pub { margin-top: 22px; }
.pub:hover { border-color: var(--accent-line); }
.pub--flip .pub__text { order: 2; }

.pub__top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.pill-pre {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 4px 11px;
}
.pub__year { font-size: 12px; color: var(--fg-faint); }
.pub__venue {
  font-size: 11.5px; color: var(--fg-faint);
  padding-left: 14px; border-left: 1px solid var(--line);
}
.pub h3 { max-width: 30ch; }
/* Numbers and named results carry the emphasis in the findings list. */
.blist strong { color: var(--fg); font-weight: 600; }
.pub__fig figcaption b { color: var(--accent); font-weight: 600; }
.pub__text > p { margin-top: 12px; color: var(--fg-dim); font-size: 14.5px; max-width: 60ch; }
.pub .blist { margin-top: 18px; }
.pub__links { margin-top: 24px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

.pub__fig { display: grid; gap: 14px; justify-items: center; }
.dg { width: 100%; max-width: 360px; height: auto; color: var(--fg-dim); }
.pub__fig figcaption { font-size: 12px; color: var(--fg-faint); text-align: center; max-width: 34ch; line-height: 1.5; }

.dg-node rect { fill: rgba(255, 255, 255, .02); stroke: rgba(255, 255, 255, .3); stroke-width: 1; }
.dg-node text {
  font-family: var(--font); font-size: 10px; fill: var(--fg-dim);
  text-anchor: middle; dominant-baseline: middle;
}
.dg-node--hot rect { stroke: var(--accent-line); fill: rgba(0, 255, 153, .05); }
.dg-node--hot text { fill: var(--accent); }
.dg-node--opt rect { stroke: rgba(255, 255, 255, .22); stroke-dasharray: 3 3; }
.dg-mini { font-size: 8px; fill: var(--fg-faint); }

.dg-group rect { fill: rgba(255, 255, 255, .02); stroke: rgba(255, 255, 255, .18); stroke-width: 1; stroke-dasharray: 4 4; }
.dg-grouplab {
  font-family: var(--font); font-size: 9px; fill: var(--fg-faint);
  text-anchor: middle; dominant-baseline: middle; letter-spacing: .06em;
}

.dg-links path, .dg-dash { fill: none; stroke: rgba(255, 255, 255, .3); stroke-width: 1.25; }
.dg-links .dg-hot { stroke: var(--accent-line); }
.dg-dash { stroke-dasharray: 4 4; }
.dg-arrow { fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

html.js:not(.no-motion) .pub:hover .dg-links path { stroke-dasharray: 4 6; animation: flow 2.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }

.scholar {
  margin-top: 22px;
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(120deg, rgba(0, 255, 153, .06), transparent 60%), var(--card);
  border: 1px dashed var(--accent-line); border-radius: var(--r-card);
  padding: 22px 26px; color: var(--fg);
  transition: border-color .24s var(--ease), transform .24s var(--ease);
}
.scholar:hover { border-color: var(--accent); transform: translateY(-2px); }
.scholar > .ic--lg { color: var(--accent); }
.scholar span { display: grid; flex: 1; }
.scholar strong { font-size: 16px; font-weight: 600; }
.scholar small { font-size: 13px; color: var(--fg-faint); }
.scholar > .ic:last-child { color: var(--accent); transition: transform .2s var(--ease); }
.scholar:hover > .ic:last-child { transform: translate(2px, -2px); }

/* ============================== CONTACT ============================== */
.panel-c {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: clamp(30px, 4vw, 56px);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 52px; align-items: start;
}
.panel-c::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 300px at 94% 6%, rgba(0, 255, 153, .08), transparent 70%);
}
.panel-c > * { position: relative; }
.panel-c h2 { margin-top: 14px; }
.panel-c .panel__lede { margin-top: 14px; max-width: 44ch; margin-bottom: 0; }
.panel-c .socials { margin-top: 28px; }

.crow {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center; gap: 14px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.crow:last-child { border-bottom: 0; }
.crow__ic { color: rgba(0, 255, 153, .7); }
.crow__ic .ic { width: 20px; height: 20px; }
.crow__body { display: grid; gap: 2px; min-width: 0; }
.crow__label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-faint); }
.crow__val { font-size: 15px; word-break: break-all; transition: color .2s var(--ease); }
a.crow__val:hover { color: var(--accent); }

.copy {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; padding: 7px 13px; min-height: 34px;
  border: 1px solid var(--line-ui); border-radius: 999px; color: var(--fg-dim);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.copy:hover { border-color: var(--accent); color: var(--accent); }
.copy.is-done { color: var(--accent); border-color: var(--accent-line); }

/* ============================== FOOTER ============================== */
/* No border-top — a full-width rule slices across the background grid,
   the same problem the stats bar had. */
.site-footer { padding: 32px 0 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--fg-faint); }
.totop { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-faint); transition: color .2s var(--ease); }
.totop:hover { color: var(--accent); }
.totop .ic { transition: transform .2s var(--ease); }
.totop:hover .ic { transform: translateY(-2px); }

/* ============================== LOADING CURTAIN ============================== */
/* After the reference: five #166534 bars fall with a stagger, then a
   page-coloured backdrop fades out. Gated on html.js so a broken script never
   leaves the page hidden; pointer-events none so it can never trap a click;
   script.js removes the node when the fade ends. */
.loader { display: none; }

html.js:not(.no-motion) .loader {
  display: flex;
  position: fixed; inset: 0; z-index: 300;
  overflow: hidden;               /* falling bars must not create a scrollbar */
  pointer-events: none;
}
html.js:not(.no-motion) .loader__back {
  position: absolute; inset: 0; z-index: 1;
  background: var(--bg);
  animation: loader-back 1.6s 1.6s forwards;
}
html.js:not(.no-motion) .loader__bar {
  position: relative; z-index: 2;
  width: 12.5%; height: 100%;   /* 8 bars, like the reference */
  background: #166534;
  animation: loader-bars .8s cubic-bezier(.4, .84, .44, 1) var(--d, 0s) forwards;
}
@keyframes loader-back { to { opacity: 0; } }
@keyframes loader-bars { to { transform: translateY(100%); } }

/* ============================== REVEAL ============================== */
html.js:not(.no-motion) [data-reveal] {
  opacity: 0; transform: translateY(16px);
  transition: opacity .48s var(--ease), transform .48s var(--ease);
  transition-delay: calc(var(--i, 0) * 60ms);
}
html.js:not(.no-motion) [data-reveal].is-visible { opacity: 1; transform: none; }

/* ============================== RESPONSIVE ============================== */
@media (min-width: 960px) and (max-height: 820px) {
  .hero { padding: 104px 0 68px; }
  .hero h1 { font-size: clamp(38px, 4.2vw, 50px); }
}

@media (max-width: 1040px) {
  .pub { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .pub--flip .pub__text { order: 0; }
  .pub__fig { justify-items: start; }
  .dg { max-width: 340px; }
  .pub__fig figcaption { text-align: left; }
}

@media (max-width: 960px) {
  .hero { padding: 104px 0 72px; }
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero__copy { max-width: none; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

@media (max-width: 880px) {
  .nav__list, .nav__cta { display: none; }
  .burger { display: block; }

  .nav.is-open {
    /* `safe center` degrades to start-alignment when the links are taller than
       the overlay (landscape phones); overflow-y keeps the rest reachable. */
    display: grid; place-content: safe center; gap: 22px;
    position: fixed; inset: var(--header-h) 0 0 0;
    padding: 24px 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: rgba(28, 28, 34, .97);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  }
  .nav.is-open .nav__list { display: grid; gap: 22px; text-align: center; }
  .nav.is-open .nav__cta { display: inline-flex; justify-self: center; }
  .nav.is-open .nav__link { font-size: 26px; color: var(--fg); }
  .nav.is-open .nav__link::after { display: none; }
  html.js:not(.no-motion) .nav.is-open li,
  html.js:not(.no-motion) .nav.is-open .nav__cta {
    animation: fadeup .34s var(--ease) both;
    animation-delay: calc(var(--i, 6) * 45ms);
  }
  @keyframes fadeup { from { opacity: 0; transform: translateY(10px); } }

  .stats__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .panels { min-height: 0; }
  .resume-body { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .tabs { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .sgroups { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .panel-c { grid-template-columns: minmax(0, 1fr); gap: 34px; }
}

@media (max-width: 560px) {
  .hero h1 { font-size: 34px; }
  .hero__cta .btn { flex: 1 1 100%; }
  .wordmark__full { display: none; }
  .wordmark__short { display: inline; }
  .stats__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .pgrid { grid-template-columns: minmax(0, 1fr); }
  .row { padding: 20px; }
  .about { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .footer-inner { flex-direction: column; gap: 12px; }
}

@media (max-width: 480px) {
  .crow { grid-template-columns: 34px minmax(0, 1fr); row-gap: 12px; }
  .copy { grid-column: 1 / -1; justify-content: center; min-height: 44px; }
}

/* Touch: standalone links that are only as tall as their text need a hit area. */
@media (hover: none) and (pointer: coarse) {
  .tlink, .totop, .certlist a, .pcard__link { min-height: 44px; }
  .tlink, .totop, .pcard__link { display: inline-flex; align-items: center; }
  .pcard__top a { display: grid; place-items: center; min-width: 44px; min-height: 44px; }
}

/* ============================== REDUCED MOTION ============================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ============================== PRINT ============================== */
/* This is the CV-download mechanism — no PDF ships with the three files.
   Every tab panel is forced visible so the printout is a complete résumé. */
@media print {
  :root {
    --fg: #000; --fg-dim: #222; --fg-faint: #555;
    --line: #ccc; --line-strong: #999; --line-ui: #999;
    --bg: #fff; --bg-alt: #fff; --card: #fff; --card-hover: #fff;
  }

  html, body { background: #fff !important; color: #000 !important; font-size: 10.5pt; line-height: 1.5; }
  body::before { display: none !important; }   /* drop the grid */

  .site-header, .burger, .term, .hero::before, .panel-c::before, .nav,
  .hero__cta, .socials, .copy, .totop, .skip, .filters, .svc__arrow,
  .tabs, .pub__fig, .scholar, .pcard__img, .loader, [data-print] { display: none !important; }
  .blist strong { font-weight: 700; }

  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .panel[hidden] { display: block !important; }   /* print every tab, not just the open one */
  .panel { animation: none !important; page-break-inside: auto; }
  .pcard.is-hidden { display: flex !important; }

  .section, .stats { padding-block: 12pt !important; background: #fff !important; border: 0 !important; }
  .wrap { max-width: none; padding-inline: 0; }
  .hero { padding: 0 0 10pt; }

  h1 { font-size: 20pt; } h2 { font-size: 14pt; margin-bottom: 4pt; } h3 { font-size: 12pt; }
  .accent, .kicker, .sgroup__label, .pill-pre, .pill-current, .pcard__tag,
  .row__date, .tlink, .pcard__link, .hero h1 .hl { color: #000 !important; background: none !important; }
  .rule { background: #000; }

  .hero__grid, .stats__grid, .services, .rows, .row, .pgrid, .pub, .panel-c, .crow, .about, .sgroups,
  .resume-body {
    display: block !important;
  }
  .svc, .row, .pcard, .pub, .panel-c, .stat {
    background: #fff !important; border: 0 !important; border-bottom: 1px solid #ccc !important;
    border-radius: 0 !important; padding: 6pt 0 !important; margin: 0 0 5pt !important;
    box-shadow: none !important;
    page-break-inside: avoid; break-inside: avoid;
  }
  .chip, .tag { border-color: #999 !important; color: #333 !important; }
  .blist li::before { background: #000 !important; }

  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; word-break: break-all; }
  a[href^="#"]::after, a[href^="mailto"]::after, a[href^="tel"]::after { content: ""; }

  .site-footer { border-top: 1px solid #ccc; padding: 6pt 0 0; }
}
