/* =========================================================
   Minakshee Narayankar — portfolio
   Editorial system: paper + ink, a single vermilion accent,
   Fraunces display / Inter Tight text / JetBrains Mono meta.
   ========================================================= */

/* ---------- Fonts (self-hosted, latin subset, SIL OFL) ---------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 300 500;
  font-display: swap;
  src: url("../fonts/fraunces-italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/inter-tight-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
}

/* Metric-matched fallbacks, so the swap from system font to web font does not shift layout */
@font-face {
  font-family: "Fraunces Fallback";
  font-style: normal;
  src: local("Georgia");
  size-adjust: 82.4%;
  ascent-override: 119%;
  descent-override: 31.5%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Fraunces Fallback";
  font-style: italic;
  src: local("Georgia Italic"), local("Georgia-Italic");
  size-adjust: 80.7%;
  ascent-override: 121%;
  descent-override: 32%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Inter Tight Fallback";
  src: local("Arial"), local("Helvetica");
  size-adjust: 96.9%;
  ascent-override: 100%;
  descent-override: 24.8%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #F3F0E8;
  --bg-elev: #FAF8F3;
  --ink: #151413;
  --ink-soft: #2E2C29;
  --muted: #5F5B54;
  --rule: #D6D0C2;
  --rule-strong: #B9B2A2;
  --accent: #B93A20;
  --accent-ink: #FFFFFF;
  --hl: #F6D9CF;
  --header-bg: rgba(243, 240, 232, 0.86);

  --serif: "Fraunces", "Fraunces Fallback", Georgia, serif;
  --sans: "Inter Tight", "Inter Tight Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1320px;
  --header-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --radius: 2px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0F0E;
    --bg-elev: #171715;
    --ink: #ECE8DF;
    --ink-soft: #D3CEC3;
    --muted: #A39E94;
    --rule: #2C2B28;
    --rule-strong: #46443F;
    --accent: #FF7A5C;
    --accent-ink: #0F0F0E;
    --hl: #3A1F17;
    --header-bg: rgba(15, 15, 14, 0.82);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0F0F0E;
  --bg-elev: #171715;
  --ink: #ECE8DF;
  --ink-soft: #D3CEC3;
  --muted: #A39E94;
  --rule: #2C2B28;
  --rule-strong: #46443F;
  --accent: #FF7A5C;
  --accent-ink: #0F0F0E;
  --hl: #3A1F17;
  --header-bg: rgba(15, 15, 14, 0.82);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

h1, h2, h3, h4, p, ul, ol, dl, dd, blockquote, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
strong, b { font-weight: 600; }
em { font-style: italic; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

::selection { background: var(--accent); color: var(--accent-ink); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section[id], [id^="project-"] { scroll-margin-top: calc(var(--header-h) + 16px); }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  font: 500 .875rem var(--sans);
}
.skip-link:focus { top: 12px; }

/* ---------- Shared type ---------- */
.eyebrow,
.section-num,
.tl-when,
.tl-kicker,
.feature-tag,
.card-tag,
.edu-when,
.recog-year,
.cl-label,
.legend,
.section-note {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title,
.hero-title,
.contact-title,
.project-title,
.card-title,
.tl-role,
.edu-title,
.big,
.feature-metric .big {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.section-title em,
.hero-title em,
.contact-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  min-height: 48px;
  padding: 0 1.4em;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font: 500 .9375rem/1 var(--sans);
  letter-spacing: .005em;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn .arrow { display: inline-block; transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn:hover .arrow-down { transform: translateY(3px); }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

.btn-small { min-height: 36px; padding: 0 1em; font-size: .8125rem; border-color: var(--rule-strong); }
.btn-small:hover { border-color: var(--ink); background: var(--ink); color: var(--bg); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--ink);
  transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .3s var(--ease);
}
.icon-btn:hover { border-color: var(--rule-strong); }

/* animated underline for inline links */
.u-link,
.primary-nav a,
.to-top {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .35s var(--ease), color .2s var(--ease);
}
.u-link:hover,
.primary-nav a:hover,
.primary-nav a[aria-current="true"],
.to-top:hover { background-size: 100% 1px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font: 500 .75rem/1 var(--mono);
  letter-spacing: .02em;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.brand:hover .brand-mark { background: var(--ink); color: var(--bg); }
.brand-name { font: 500 .9375rem var(--sans); }

.primary-nav ul { display: flex; gap: clamp(16px, 2.4vw, 32px); }
.primary-nav a { font: 500 .875rem var(--sans); padding-block: 4px; }
.primary-nav a[aria-current="true"] { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle .i-moon { display: none; }
.theme-toggle[aria-pressed="true"] .i-sun { display: none; }
.theme-toggle[aria-pressed="true"] .i-moon { display: block; }
.theme-toggle:hover { transform: rotate(-12deg); }

.menu-toggle { display: none; }
.menu-bars,
.menu-bars::before,
.menu-bars::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform .3s var(--ease), opacity .2s;
}
.menu-bars { position: relative; }
.menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
.menu-bars::before { top: -6px; }
.menu-bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1000px) {
  /* visually hidden but still the link's accessible name */
  .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .menu-toggle { display: inline-grid; }
  .primary-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 8px var(--gutter) 24px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s linear .25s;
  }
  .menu-open .primary-nav {
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
  }
  .primary-nav ul { flex-direction: column; gap: 0; }
  .primary-nav li + li { border-top: 1px solid var(--rule); }
  .primary-nav a {
    display: block;
    padding: 14px 0;
    font: 400 1.5rem var(--serif);
    background-image: none;
  }
  /* without JS the menu button does nothing, so keep nav reachable inline */
  html:not(.js) .menu-toggle { display: none; }
  html:not(.js) .primary-nav { position: static; opacity: 1; visibility: visible; transform: none; padding: 0; border: 0; background: none; }
  html:not(.js) .primary-nav ul { flex-direction: row; gap: 12px; }
  html:not(.js) .primary-nav li + li { border: 0; }
  html:not(.js) .primary-nav a { font: 500 .8125rem var(--sans); padding: 0; }
}

@media (max-width: 420px) {
  .btn-small { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 6vw, 80px) clamp(48px, 7vw, 96px); }

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 2vw, 24px);
  row-gap: clamp(28px, 4vw, 48px);
}

.hero-eyebrow {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
}
.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { transform: scale(.6); opacity: .9; }
  100% { transform: scale(1.8); opacity: 0; }
}

.hero-title {
  grid-column: 1 / span 11;
  font-size: clamp(2.5rem, 6.6vw, 6rem);
  line-height: .98;
  letter-spacing: -0.035em;
  font-variation-settings: "SOFT" 0, "WONK" 0;
  text-wrap: balance;
}

.hero-side {
  grid-column: 1 / span 5;
  align-self: start;
  display: grid;
  gap: 18px;
  padding-top: 8px;
  border-top: 1px solid var(--ink);
}
.hero-lede {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 46ch;
  padding-top: 12px;
}
.hero-visa {
  font: 500 .75rem var(--mono);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px; }

.proof {
  grid-column: 7 / span 6;
  align-self: start;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}
.metric {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px clamp(12px, 2vw, 24px) 18px 0;
}
.metric:nth-child(even) { padding-left: clamp(12px, 2vw, 24px); border-left: 1px solid var(--rule); }
.metric:nth-child(n+3) { border-top: 1px solid var(--rule); }
.metric dd {
  font: 300 clamp(2.4rem, 5vw, 4.4rem)/1 var(--serif);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
.metric .unit { font-size: .5em; letter-spacing: 0; margin-left: .08em; color: var(--accent); vertical-align: .55em; }
.metric .unit-pre { margin: 0 .06em 0 0; }
.metric dt { font-size: .875rem; line-height: 1.4; color: var(--muted); max-width: 22ch; }

@media (max-width: 900px) {
  .hero-title { grid-column: 1 / -1; }
  .hero-side { grid-column: 1 / span 10; }
  .proof { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .hero-side { grid-column: 1 / -1; }
  .cta-row .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(72px, 10vw, 140px); border-top: 1px solid var(--rule); }

.section-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 2vw, 24px);
  row-gap: 16px;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.section-num { grid-column: 1 / span 3; padding-top: .9em; }
.section-num span { color: var(--accent); margin-right: .9em; }
.section-num span::after { content: " —"; color: var(--rule-strong); }
.section-title {
  grid-column: 4 / span 9;
  font-size: clamp(2rem, 4.6vw, 4rem);
  line-height: 1.02;
  text-wrap: balance;
}
.section-note { grid-column: 4 / span 9; text-transform: none; letter-spacing: 0; font-size: .8125rem; }

@media (max-width: 760px) {
  .section-num, .section-title, .section-note { grid-column: 1 / -1; }
  .section-num { padding-top: 0; }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 2vw, 24px);
  row-gap: 48px;
}
.about-body {
  grid-column: 4 / span 6;
  display: grid;
  gap: 1.3em;
  font-size: clamp(1.0625rem, 1.25vw, 1.1875rem);
  line-height: 1.7;
  color: var(--ink-soft);
}
.dropcap::first-letter {
  float: left;
  font: 400 4.4em/.82 var(--serif);
  margin: .06em .1em 0 -.03em;
  color: var(--accent);
}
.pull {
  margin: .6em 0 .6em clamp(-120px, -8vw, 0px);
  padding-left: 0;
  border: 0;
}
.pull p {
  font: italic 300 clamp(1.6rem, 3vw, 2.5rem)/1.15 var(--serif);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
.facts { grid-column: 10 / span 3; align-self: start; position: sticky; top: calc(var(--header-h) + 24px); }
.facts dl { display: grid; }
.facts dl > div { padding: 14px 0; border-top: 1px solid var(--rule); }
.facts dl > div:last-child { border-bottom: 1px solid var(--rule); }
.facts dt { font: 400 .6875rem var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.facts dd { font-size: .9375rem; line-height: 1.45; }

@media (max-width: 1000px) {
  .about-body { grid-column: 1 / span 8; }
  .facts { grid-column: 9 / -1; }
  .pull { margin-left: 0; }
}
@media (max-width: 760px) {
  .about-body, .facts { grid-column: 1 / -1; }
  .facts { position: static; }
}

/* ---------- Experience timeline ---------- */
.timeline { position: relative; display: grid; gap: clamp(48px, 6vw, 80px); }

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 2vw, 24px);
}
.tl-when {
  grid-column: 1 / span 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  color: var(--ink-soft);
}
.tl-where { color: var(--muted); }

.tl-body {
  grid-column: 4 / span 9;
  position: relative;
  padding-left: clamp(20px, 3vw, 40px);
  border-left: 1px solid var(--rule);
}
.tl-body::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 10px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--ink);
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.tl-item:hover .tl-body::before { background: var(--accent); border-color: var(--accent); }
.tl-edu .tl-body::before { border-style: dashed; }

.tl-kicker { color: var(--accent); margin-bottom: 8px; }
.tl-role { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.05; }
.tl-org { margin-top: 6px; font-weight: 500; }
.tl-summary { margin-top: 14px; max-width: 62ch; color: var(--ink-soft); }
.tl-foot { margin-top: 28px; padding-top: 18px; border-top: 1px dashed var(--rule-strong); font-size: .9375rem; color: var(--muted); max-width: 70ch; }
.tl-foot strong { color: var(--ink); }

.chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 28px 0 32px;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.chips li {
  padding: 16px 16px 14px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: .8125rem;
  line-height: 1.35;
  color: var(--muted);
  transition: background-color .25s var(--ease);
}
.chips li:hover { background: var(--bg-elev); }
.chips b {
  display: block;
  font: 300 clamp(1.75rem, 3vw, 2.5rem)/1 var(--serif);
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 6px;
  font-variant-numeric: lining-nums;
}
@media (max-width: 560px) { .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.tracks { display: grid; border-top: 1px solid var(--ink); }
.track { border-bottom: 1px solid var(--rule); }
.track-head { font: inherit; }
.track-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 32px 1fr 24px;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  text-align: left;
}
.track-idx { font: 500 .75rem var(--mono); color: var(--accent); }
.track-name { font: 400 clamp(1.15rem, 1.8vw, 1.4rem)/1.2 var(--serif); letter-spacing: -0.01em; transition: color .2s; }
.track-meta { display: block; margin-top: 4px; font: 400 .75rem var(--mono); letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.track-btn:hover .track-name { color: var(--accent); }
.track-icon { position: relative; width: 14px; height: 14px; justify-self: end; }
.track-icon::before, .track-icon::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  transition: transform .3s var(--ease);
}
.track-icon::after { transform: rotate(90deg); }
.track-btn[aria-expanded="true"] .track-icon::after { transform: rotate(0deg); }

.track-panel {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .4s var(--ease);
}
.track-inner { overflow: hidden; min-height: 0; padding-left: 44px; }
.track-inner > :last-child { margin-bottom: 24px; }
.track[data-open="false"] .track-panel { grid-template-rows: 0fr; }
.track[data-open="false"] .track-inner { visibility: hidden; transition: visibility 0s linear .4s; }
@media (max-width: 560px) { .track-inner { padding-left: 0; } }

.impact { display: grid; gap: 10px; margin-top: 4px; max-width: 70ch; }
.tl-body > .impact { margin-top: 16px; }
.impact li { position: relative; padding-left: 22px; color: var(--ink-soft); }
.impact li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); font-size: .875em; top: .1em; }
.impact strong { color: var(--ink); }

@media (max-width: 760px) {
  .tl-when { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 4px 12px; padding: 0 0 12px clamp(20px, 3vw, 40px); }
  .tl-body { grid-column: 1 / -1; }
  .timeline::before { display: none; }
}

/* ---------- Badges & tags (shared, cross-highlighting) ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.badges li,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font: 400 .75rem/1 var(--mono);
  letter-spacing: .01em;
  color: var(--ink-soft);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.badges li[data-tech] { cursor: default; }
.badges li:hover,
[data-tech].is-hl {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--hl);
}
[data-tech].is-hl { transform: translateY(-1px); }

/* ---------- Projects ---------- */
.feature {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 2vw, 24px);
  row-gap: 32px;
  padding-block: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--ink);
}
.feature + .feature { margin-top: clamp(24px, 4vw, 48px); }

.feature-aside {
  grid-column: 1 / span 4;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 32px);
}
.feature-main { grid-column: 6 / span 7; }
.feature-alt .feature-aside { grid-column: 9 / span 4; grid-row: 1; }
.feature-alt .feature-main { grid-column: 1 / span 7; grid-row: 1; }

.feature-tag { color: var(--accent); }
.feature-metric { display: grid; gap: 10px; }
.feature-metric .big {
  font-size: clamp(4rem, 9vw, 8.5rem);
  line-height: .85;
  letter-spacing: -0.05em;
  font-weight: 300;
  font-variant-numeric: lining-nums;
}
.feature-metric .big small { font-size: .3em; letter-spacing: 0; margin-left: .1em; color: var(--accent); }
.big-label { font-size: .875rem; color: var(--muted); line-height: 1.45; }

.mini-metrics { display: grid; border-top: 1px solid var(--rule); }
.mini-metrics li { display: flex; align-items: baseline; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: .875rem; color: var(--muted); }
.mini-metrics b { font: 400 1.25rem/1 var(--serif); color: var(--ink); min-width: 3.4em; }

.project-title { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; }
.project-desc { margin-top: 14px; font-size: 1.125rem; color: var(--ink-soft); max-width: 52ch; }

.star { margin-top: 28px; display: grid; border-top: 1px solid var(--rule); }
.star > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  transition: background-color .25s var(--ease);
}
.star dt { display: flex; align-items: baseline; gap: 10px; font: 400 .75rem var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.star dt span { font: italic 400 1.4rem/1 var(--serif); color: var(--accent); text-transform: none; }
.star dd { font-size: .975rem; line-height: 1.6; color: var(--ink-soft); }
.star dd strong { color: var(--ink); }
.star > div:last-child dd { color: var(--ink); }

.project-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font: 500 .8125rem var(--sans);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.link-btn:hover { background: var(--ink); color: var(--bg); }
.link-btn[data-placeholder] { border-style: dashed; border-color: var(--rule-strong); color: var(--muted); }
.link-btn[data-placeholder]:hover { background: transparent; color: var(--ink); border-color: var(--ink); }
.soon { font: 400 .625rem var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--rule); }

@media (max-width: 900px) {
  .feature-aside, .feature-main,
  .feature-alt .feature-aside, .feature-alt .feature-main { grid-column: 1 / -1; grid-row: auto; }
  .feature-aside { position: static; }
}
@media (max-width: 560px) {
  .star > div { grid-template-columns: 1fr; gap: 6px; }
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(48px, 6vw, 80px);
  border-top: 1px solid var(--ink);
}
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px clamp(16px, 2vw, 28px) 32px;
  border-bottom: 1px solid var(--rule);
  transition: background-color .3s var(--ease), transform .3s var(--ease);
}
.card + .card { border-left: 1px solid var(--rule); }
.card:hover { background: var(--bg-elev); }
.card-tag { color: var(--accent); }
.card-title { font-size: clamp(1.5rem, 2.2vw, 1.9rem); line-height: 1.05; }
.card-metric { font-size: .875rem; color: var(--muted); }
.card-metric b { font: 300 2.25rem/1 var(--serif); letter-spacing: -0.03em; color: var(--ink); margin-right: 6px; vertical-align: -0.1em; }
.card-desc { color: var(--ink-soft); font-size: .9375rem; }
.card .badges { margin-top: auto; padding-top: 8px; }
.card .project-links { margin-top: 4px; }
.nda { font: 400 .6875rem var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.nda::before { content: ""; width: 14px; height: 1px; background: var(--rule-strong); }

.star-mini { border-top: 1px dashed var(--rule-strong); border-bottom: 1px dashed var(--rule-strong); }
.star-mini summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font: 400 .75rem var(--mono);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-soft);
}
.star-mini summary::-webkit-details-marker { display: none; }
.star-mini summary::after { content: "+"; font-size: 1rem; color: var(--accent); transition: transform .3s var(--ease); }
.star-mini[open] summary::after { transform: rotate(45deg); }
.star-mini summary:hover { color: var(--accent); }
.star-mini dl { display: grid; gap: 8px; padding-bottom: 14px; }
.star-mini dl > div { display: grid; grid-template-columns: 20px 1fr; gap: 8px; font-size: .875rem; line-height: 1.5; }
.star-mini dt { font: italic 400 1rem/1.3 var(--serif); color: var(--accent); }
.star-mini dd { color: var(--ink-soft); }

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  .card + .card { border-left: 0; }
  .card { padding-inline: 0; }
  .card:hover { background: transparent; }
}

/* ---------- Skills ---------- */
.legend {
  grid-column: 4 / span 9;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  text-transform: none;
  letter-spacing: 0;
  font-size: .8125rem;
  color: var(--ink-soft);
}
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend .tag { min-height: 22px; padding: 0 8px; font-size: .6875rem; }
html:not(.js) .hint-js { display: none; }

.skill-groups { border-top: 1px solid var(--ink); }
.skill-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 2vw, 24px);
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}
.skill-cat { grid-column: 1 / span 3; font: 400 clamp(1.15rem, 1.8vw, 1.4rem)/1.2 var(--serif); letter-spacing: -0.01em; padding-top: 2px; }
.tags { grid-column: 4 / span 9; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { min-height: 34px; padding: 0 14px; font-size: .8125rem; }

.tag.tier-1 { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tag.tier-2 { background: transparent; border-color: var(--ink); color: var(--ink); }
.tag.tier-3 { background: transparent; border-style: dashed; border-color: var(--rule-strong); color: var(--muted); }

.tag.is-linked { cursor: pointer; }
.tag.is-linked::after { content: "↘"; margin-left: 6px; font-size: .85em; opacity: .55; transition: transform .25s var(--ease), opacity .2s; }
.tag.is-linked:hover::after,
.tag.is-linked:focus-visible::after { opacity: 1; transform: translate(2px, 2px); }
.tag.tier-1.is-hl,
.tag.tier-1:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tag.tier-2:hover, .tag.tier-3:hover,
.tag.tier-2.is-hl, .tag.tier-3.is-hl { border-color: var(--accent); color: var(--accent); background: var(--hl); }

@media (max-width: 760px) {
  .legend { grid-column: 1 / -1; }
  .skill-cat, .tags { grid-column: 1 / -1; }
  .skill-cat { margin-bottom: 14px; }
}

/* ---------- Education & recognition ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 4vw, 64px);
  row-gap: clamp(40px, 5vw, 64px);
}
.edu { padding-top: 20px; border-top: 1px solid var(--ink); }
.edu-when { color: var(--accent); }
.edu-title { margin-top: 12px; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.1; }
.edu-org { margin-top: 8px; font-weight: 500; }
.edu-detail { margin-top: 14px; color: var(--ink-soft); font-size: .9375rem; max-width: 60ch; }

.recog { border-top: 1px solid var(--rule-strong); padding-top: 20px; }
.recog-head { font: 400 .75rem var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.recog-list li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: .9375rem; color: var(--ink-soft); }
.recog-list strong { color: var(--ink); }
.recog-year { padding-top: 3px; color: var(--accent); }

@media (max-width: 760px) { .edu-grid { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(56px, 7vw, 96px); }
.contact .section-num { display: block; margin-bottom: 24px; padding-top: 0; }
.contact-title {
  font-size: clamp(2.8rem, 9vw, 8rem);
  line-height: .95;
  letter-spacing: -0.04em;
  max-width: 14ch;
}
.contact-lede { margin-top: 28px; max-width: 52ch; font-size: 1.125rem; color: var(--ink-soft); margin-left: auto; }

.contact-links { margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--ink); }
.contact-links li { position: relative; display: flex; align-items: center; padding-right: 52px; border-bottom: 1px solid var(--rule); }
.copy-btn { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.contact-link {
  flex: 1;
  display: grid;
  grid-template-columns: clamp(80px, 22vw, 300px) 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
  min-width: 0;
}
.cl-value {
  font: 400 clamp(1.15rem, 2.6vw, 2rem)/1.15 var(--serif);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  transition: color .2s var(--ease), transform .35s var(--ease);
}
.contact-link .arrow { font-size: 1.25rem; transition: transform .35s var(--ease), color .2s; }
.contact-link:hover .cl-value { color: var(--accent); transform: translateX(6px); }
.contact-link:hover .arrow { color: var(--accent); transform: translate(3px, -3px); }

@media (max-width: 560px) {
  .contact-link { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .cl-label { grid-column: 1 / -1; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding-block: 28px; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font: 400 .75rem var(--mono);
  color: var(--muted);
}
.to-top { color: var(--ink); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translate(-50%, 16px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 500 .8125rem var(--sans);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Flash (badge jump target) ---------- */
.is-flash { animation: flash 1.4s var(--ease); }
@keyframes flash {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  20% { box-shadow: 0 0 0 6px var(--hl); }
}

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- 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;
    transition-delay: 0s !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .pulse::after { display: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .toast, .cta-row, .project-links, .copy-btn, .to-top { display: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .track[data-open="false"] .track-panel { grid-template-rows: 1fr; }
  .track[data-open="false"] .track-inner { visibility: visible; }
  body { background: #fff; color: #000; }
}
