/* Vivaan Jain — Portfolio v5
   Dark, eye-catching, motion-forward. Vanilla only.
   Content-first, details/summary for expand. */

:root {
  --sans: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', Consolas, monospace;

  /* ── Slate base ── */
  --bg:      #0b0d10;
  --bg2:     #0e1116;
  --panel:   #11141a;
  --panel2:  #151920;
  --line:    #1e222b;
  --line2:   #2b313d;

  /* ── Ink ── */
  --white:   #e6e4e0;
  --g50:     #e0ded9;
  --g100:    #d5d2cc;
  --g200:    #bdbab4;
  --g300:    #a5a19b;
  --g400:    #7d8189;
  --g500:    #9b978f;
  --g600:    #a9a59d;
  --g700:    #c2beb7;
  --g900:    #e6e4e0;

  /* ── One accent, muted slate-blue. Everything else is grey. ── */
  --cyan:    #7c93b8;
  --teal:    #8fa4c6;
  --violet:  #7c93b8;
  --blue:    #7c93b8;
  --sky:     #7c93b8;
  --pink:    #9fb0cc;
  --green:   #7f9e87;   /* desaturated, positive */
  --amber:   #a89a7c;   /* desaturated, neutral emphasis */
  --red:     #b08585;   /* desaturated, negative */

  --blue-bg: rgba(124,147,184,.10);
  --blue-bd: rgba(124,147,184,.30);
  --grn-bg:  rgba(127,158,135,.12);
  --grn-bd:  rgba(127,158,135,.30);
  --pur-bg:  rgba(124,147,184,.10);
  --amb-bg:  rgba(168,154,124,.12);
  --red-bg:  rgba(176,133,133,.12);

  /* Flat, not gradients. Kept as a variable so old rules resolve to a solid. */
  --grad:  linear-gradient(90deg, var(--cyan), var(--cyan));
  --grad2: linear-gradient(90deg, var(--cyan), var(--cyan));

  --nav-h:   58px;
  --r:       4px;
  --r2:      5px;
  --sh:      none;
  --sh2:     none;
  --glow:    0 0 0 1px var(--blue-bd);

  /* Modular scale, ratio 1.5 */
  --s1: 8px;  --s2: 12px; --s3: 18px; --s4: 27px; --s5: 40px; --s6: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  font-family: var(--sans); color: var(--g700);
  background: var(--bg); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Lattice. A static dot grid, the way squared paper is ruled. ── */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(230,228,224,.055) 1px, transparent 0);
  background-size: 24px 24px;
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 90% 70% at 50% 0%, transparent 55%, rgba(11,13,16,.85) 100%);
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: none; color: var(--white); }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::marker { display: none; }

/* Kept as a hook. The paper design has no gradient text. */
.grad-text { color: var(--white); }

/* Scroll reveal (gentle lift) */
[data-reveal] { opacity: 0; transform: perspective(1400px) rotateX(4deg) translateY(24px); transform-origin: 50% 100%; transition: opacity .9s cubic-bezier(.16,.8,.3,1), transform .9s cubic-bezier(.16,.8,.3,1); will-change: opacity, transform; }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal].d1 { transition-delay: .09s; }
[data-reveal].d2 { transition-delay: .18s; }
[data-reveal].d3 { transition-delay: .27s; }

/* ── NAV ──────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h); background: rgba(9,10,17,.72);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 40px;
}
.nav-inner { max-width: 1160px; width: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.nav-name { font-weight: 700; font-size: 15px; color: var(--white); display: flex; align-items: center; gap: 9px; }
.nav-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: center top; border: 1px solid var(--line2); box-shadow: 0 0 12px rgba(124,147,184,.35); }
.nav-name span { font-weight: 500; font-size: 13px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a { font-size: 13.5px; display: inline-flex; align-items: baseline; gap: 6px; color: var(--g400); font-weight: 500; padding: 6px 12px; border-radius: 8px; transition: background .15s, color .15s; position: relative; }
.nav-links a:hover { background: rgba(255,255,255,.05); color: var(--white); }
.nav-links a.active { color: var(--white); }
.nav-links a.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 1px; height: 2px; border-radius: 2px; background: var(--grad); }
.nav-resume { font-size: 13px; font-weight: 600; background: var(--grad); background-size: 160% auto; color: #06070c; border: none; border-radius: 8px; padding: 8px 18px; margin-left: 10px; cursor: pointer; transition: transform .15s, box-shadow .15s, background-position .4s; }
.nav-resume:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,147,184,.4); background-position: right center; }
.nav-hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px; flex-shrink: 0; }
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--g200); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── PAGE ─────────────────────────────────────── */
.page { max-width: 1160px; margin: 0 auto; padding: 0 40px; position: relative; z-index: 1; }
section { padding: 84px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }
.section-eyebrow {
  display: block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 2px; color: var(--cyan); margin-bottom: 6px;
}
.sec-sign { opacity: .6; margin-right: 3px; }
.section-title {
  font-size: 30px; font-weight: 700; color: var(--white);
  letter-spacing: -.4px; margin-bottom: 10px;
}
.section-sub {
  font-size: 15.5px; color: var(--g500); line-height: 1.7;
  margin-bottom: var(--s5); max-width: 64ch; font-style: italic;
}
section { padding: var(--s6) 0; }
.section-title { font-size: 32px; font-weight: 800; color: var(--white); letter-spacing: -.8px; margin-bottom: 12px; }
.section-sub { font-size: 15px; color: var(--g400); line-height: 1.7; margin-bottom: 44px; max-width: 560px; }

/* ── FIRST SCREEN: title, abstract, key facts, contents ── */
#hero { padding: var(--s6) 0 var(--s5); border-bottom: 1px solid var(--line); }

.paper-head { margin-bottom: var(--s4); }
.hero-name {
  font-size: 46px; font-weight: 700; color: var(--white);
  letter-spacing: -.5px; line-height: 1.1; margin-bottom: 6px;
}
.hero-role { font-size: 16px; color: var(--g300); font-style: italic; margin-bottom: var(--s2); }
.hero-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .4px; color: var(--green);
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

/* The abstract is set narrower than the page, the way a paper sets it */
.abstract { max-width: 66ch; margin-bottom: var(--s4); }
.abstract p { font-size: 16.5px; line-height: 1.75; color: var(--g600); }
.abstract-label { font-weight: 700; color: var(--white); }
.abstract-meta {
  font-family: var(--mono); font-size: 12px; color: var(--g400);
  margin-top: var(--s2); letter-spacing: .2px;
}

/* Key facts read as a results row, hairline-ruled, never boxed */
.keyfacts {
  display: grid; grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2);
  margin-bottom: var(--s1);
}
.kf { padding: var(--s2) var(--s2) var(--s2) 0; border-right: 1px solid var(--line); }
.kf:last-child { border-right: none; }
.kf dt {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--g400); margin-bottom: 5px;
}
.kf dd {
  font-family: var(--mono); font-size: 19px; font-weight: 600; color: var(--white);
  font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.kf dd.pos { color: var(--green); }
.kf dd.neg { color: var(--red); }
.keyfacts-note { font-size: 12.5px; color: var(--g400); font-style: italic; margin-bottom: var(--s4); }

.hero-ctas { display: flex; gap: var(--s1); flex-wrap: wrap; margin-bottom: var(--s5); }

/* ── Contents: a plain index, aligned on the numbers ── */
.contents { border-top: 1px solid var(--line2); padding-top: var(--s3); }
.contents-h {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 2.2px; text-transform: uppercase; color: var(--g400);
  margin-bottom: var(--s2);
}
.toc { list-style: none; max-width: 74ch; }
.toc-section { margin-bottom: var(--s2); }
.toc a {
  display: grid; grid-template-columns: 3.2em 1fr; align-items: baseline;
  gap: 12px; color: var(--g300); padding: 3px 0;
}
.toc a:hover { color: var(--white); }
.toc-section > a { color: var(--white); font-size: 16px; font-weight: 600; padding-bottom: 5px; }
.toc-num {
  font-family: var(--mono); font-size: 12px; color: var(--g400);
  font-variant-numeric: tabular-nums;
}
.toc-section > a .toc-num { color: var(--cyan); }
.toc-cards { list-style: none; margin: 0 0 var(--s2); }
.toc-cards a { font-size: 14.5px; padding: 2px 0; }
.toc-name { color: inherit; }
.toc-lede { display: block; font-size: 12.5px; color: var(--g400); font-style: italic; }

/* ── PROJECTS ─────────────────────────────────── */
.proj-list { display: flex; flex-direction: column; gap: 14px; }
details.proj-card { border: 1px solid var(--line); border-radius: var(--r2); background: linear-gradient(160deg, var(--panel), var(--bg2)); transition: border-color .25s, box-shadow .25s, transform .25s; overflow: hidden; scroll-margin-top: 80px; }
details.proj-card:hover { border-color: var(--line2); box-shadow: var(--sh); }
details.proj-card[open] { border-color: var(--blue-bd); box-shadow: var(--glow); }

.proj-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 28px; cursor: pointer; transition: background .2s; }
.proj-summary:hover { background: rgba(255,255,255,.02); }
details.proj-card[open] .proj-summary { background: rgba(124,147,184,.05); }
.ps-left { display: flex; align-items: flex-start; gap: 20px; flex: 1; min-width: 0; }
.proj-num { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--g400); padding-top: 3px; flex-shrink: 0; width: 28px; transition: color .2s; }
details.proj-card:hover .proj-num, details.proj-card[open] .proj-num { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.proj-info { flex: 1; min-width: 0; }
.proj-info::before {
  content: '◆ tearsheet';
  display: inline-block; font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--teal);
  background: rgba(124,147,184,.08); border: 1px solid rgba(124,147,184,.22);
  border-radius: 5px; padding: 2px 8px; margin-bottom: 10px;
}
details.proj-card { position: relative; }
details.proj-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--grad); opacity: .45; }
.proj-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.proj-name { font-size: 19px; font-weight: 700; color: var(--white); letter-spacing: -.4px; }
.badge { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 3px 11px; border-radius: 99px; }
.badge.live      { background: var(--grn-bg); color: var(--green); border: 1px solid var(--grn-bd); box-shadow: 0 0 16px rgba(127,158,135,.2); }
.badge.research  { background: var(--pur-bg); color: var(--sky); border: 1px solid rgba(124,147,184,.35); }
.badge.progress  { background: var(--amb-bg); color: var(--amber); border: 1px solid rgba(124,147,184,.35); }
.badge.published { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-bd); }
.badge.freelance { background: rgba(255,255,255,.05); color: var(--g300); border: 1px solid var(--line2); }
.badge.intern    { background: var(--red-bg); color: var(--red); border: 1px solid rgba(176,133,133,.35); }
.proj-tagline { font-size: 14px; color: var(--g500); margin-bottom: 12px; line-height: 1.55; }
.proj-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-family: var(--mono); font-size: 11px; color: var(--g300); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 5px; padding: 3px 9px; }
.expand-label { font-size: 13px; font-weight: 600; color: var(--cyan); background: rgba(124,147,184,.08); border: 1px solid rgba(124,147,184,.3); border-radius: var(--r); padding: 9px 17px; white-space: nowrap; flex-shrink: 0; cursor: pointer; transition: background .15s, box-shadow .15s; }
.expand-label:hover { background: rgba(124,147,184,.16); box-shadow: 0 0 20px rgba(124,147,184,.2); }
.expand-label .open-text { display: none; }
.expand-label .close-text { display: inline; }
details.proj-card[open] .expand-label .open-text { display: inline; }
details.proj-card[open] .expand-label .close-text { display: none; }

/* ── PROJECT DETAIL ─ */
.proj-detail {
  border-top: 1px solid var(--line);
  padding: 38px 28px 38px 76px;
  background: rgba(0,0,0,.2);
  grid-template-columns: 1fr 270px;
  gap: 48px;
}
details[open] .proj-detail { display: grid; animation: detail-in .5s ease; }
@keyframes detail-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.detail-h { font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--cyan); margin-bottom: 12px; }
.detail-block { margin-bottom: 30px; }
.detail-block:last-child { margin-bottom: 0; }
.detail-text { font-size: 15px; line-height: 1.85; color: var(--g500); }
.detail-text p + p { margin-top: 12px; }
.detail-bullets { display: flex; flex-direction: column; gap: 11px; }
.detail-bullets li { font-size: 14.5px; color: var(--g500); line-height: 1.7; padding-left: 18px; position: relative; }
.detail-bullets li::before { content: ''; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 8px rgba(124,147,184,.5); }

/* Architecture */
.arch-diagram { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.arch-flow { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.arch-node { background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 9px 14px; font-family: var(--mono); font-size: 12px; color: var(--g300); white-space: nowrap; line-height: 1.4; text-align: center; transition: transform .2s, border-color .2s; }
.arch-node:hover { transform: translateY(-2px); border-color: var(--blue-bd); }
.arch-node small { display: block; color: var(--g400); font-size: 10px; margin-top: 2px; }
.arch-node.key { border-color: var(--blue-bd); color: var(--cyan); background: rgba(124,147,184,.1); font-weight: 600; box-shadow: 0 0 18px rgba(124,147,184,.12); }
.arch-node.key small { color: rgba(124,147,184,.7); }
.arch-arr { color: var(--blue); font-size: 20px; flex-shrink: 0; align-self: center; }
.arch-plus { color: var(--violet); font-weight: 700; flex-shrink: 0; font-size: 16px; align-self: center; }
.arch-note { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; color: var(--g400); line-height: 1.8; }

/* Detail sidebar */
.sidebar-block { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 12px; }
.sidebar-block:last-child { margin-bottom: 0; }
.sb-label { font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--g400); margin-bottom: 12px; }
.sb-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-link { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--g200); border: 1px solid var(--line2); border-radius: 8px; padding: 10px 13px; margin-bottom: 8px; transition: border-color .15s, color .15s, background .15s; }
.sb-link:last-child { margin-bottom: 0; }
.sb-link:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(124,147,184,.06); }
.sb-link span { color: var(--g400); font-size: 13px; }
.sb-metrics { display: flex; flex-direction: column; gap: 9px; }
.metric-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.metric-val { font-weight: 700; color: var(--white); }
.metric-label { color: var(--g400); }

/* ── EXPERIENCE ─────────────────────────────────── */
.exp-list { display: flex; flex-direction: column; gap: 16px; }
.exp-card { border: 1px solid var(--line); border-radius: var(--r2); background: linear-gradient(160deg, var(--panel), var(--bg2)); padding: 30px; display: grid; grid-template-columns: 200px 1fr; gap: 30px; align-items: start; transition: border-color .25s, box-shadow .25s, transform .25s; }
.exp-card:hover { border-color: var(--line2); box-shadow: var(--sh2); transform: translateY(-3px); }
.exp-badge { font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; display: inline-block; padding: 3px 11px; border-radius: 99px; margin-bottom: 12px; }
.exp-badge.intern { background: var(--red-bg); color: var(--red); border: 1px solid rgba(176,133,133,.35); }
.exp-badge.freelance { background: rgba(255,255,255,.05); color: var(--g300); border: 1px solid var(--line2); }
.exp-period { font-family: var(--mono); font-size: 12px; color: var(--g400); line-height: 1.6; }
.exp-title { font-size: 19px; font-weight: 700; color: var(--white); letter-spacing: -.3px; margin-bottom: 4px; }
.exp-company { font-size: 14px; color: var(--cyan); font-weight: 500; margin-bottom: 14px; }
.exp-company a { color: var(--cyan); }
.exp-desc { font-size: 15px; color: var(--g500); line-height: 1.8; margin-bottom: 14px; }
.exp-bullets { display: flex; flex-direction: column; gap: 8px; }
.exp-bullets li { font-size: 14px; color: var(--g500); line-height: 1.65; padding-left: 18px; position: relative; }
.exp-bullets li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }

/* ── EDUCATION ─────────────────────────────────── */
.edu-card { border: 1px solid var(--line); border-radius: var(--r2); background: linear-gradient(160deg, var(--panel), var(--bg2)); padding: 34px; display: grid; grid-template-columns: 200px 1fr; gap: 30px; align-items: start; transition: border-color .25s, box-shadow .25s, transform .25s; }
.edu-card:hover { border-color: var(--line2); box-shadow: var(--sh2); transform: translateY(-3px); }
.edu-badge { font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--cyan); background: rgba(124,147,184,.1); border: 1px solid rgba(124,147,184,.3); border-radius: 99px; display: inline-block; padding: 3px 11px; margin-bottom: 12px; }
.edu-period { font-family: var(--mono); font-size: 12px; color: var(--g400); line-height: 1.6; }
.edu-cgpa { margin-top: 12px; font-family: var(--mono); font-size: 12px; }
.edu-cgpa strong { font-size: 26px; font-weight: 800; letter-spacing: -1px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.edu-cgpa span { color: var(--g400); font-size: 11px; }
.edu-degree { font-size: 21px; font-weight: 700; color: var(--white); letter-spacing: -.3px; margin-bottom: 4px; }
.edu-degree span { color: var(--violet) !important; }
.edu-school { font-size: 15px; color: var(--cyan); font-weight: 500; margin-bottom: 14px; }
.edu-desc { font-size: 15px; color: var(--g500); line-height: 1.8; }

/* ── BLOG ──────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.blog-card { border: 1px solid var(--line); border-radius: var(--r2); background: linear-gradient(160deg, var(--panel), var(--bg2)); padding: 30px; display: flex; flex-direction: column; transition: border-color .25s, box-shadow .25s, transform .25s; }
.blog-card:hover { border-color: var(--line2); box-shadow: var(--sh2); transform: translateY(-4px); }
.blog-meta { font-family: var(--mono); font-size: 11px; color: var(--cyan); margin-bottom: 12px; }
.blog-title { font-size: 19px; font-weight: 700; color: var(--white); letter-spacing: -.3px; line-height: 1.35; margin-bottom: 14px; }
.blog-desc { font-size: 14px; color: var(--g500); line-height: 1.8; margin-bottom: 20px; flex: 1; }
.blog-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.blog-cta { font-size: 13px; font-weight: 600; color: var(--cyan); display: inline-flex; align-items: center; gap: 6px; transition: gap .2s; }
.blog-cta:hover { gap: 12px; color: var(--white); }

/* ── SKILLS ────────────────────────────────────── */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skill-group { border: 1px solid var(--line); border-radius: var(--r2); background: linear-gradient(160deg, var(--panel), var(--bg2)); padding: 24px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.skill-group:hover { border-color: var(--line2); transform: translateY(-3px); box-shadow: var(--sh); }
.sg-name { font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--cyan); margin-bottom: 14px; }
.sg-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.sg-tag { font-family: var(--mono); font-size: 12px; color: var(--g300); background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 6px; padding: 5px 11px; transition: border-color .15s, color .15s, background .15s; }
.sg-tag:hover { border-color: var(--blue-bd); color: var(--cyan); background: rgba(124,147,184,.08); }

/* ── CONTACT ───────────────────────────────────── */
#contact .contact-wrap { display: grid; grid-template-columns: 1fr 400px; gap: 56px; align-items: start; }
.contact-intro { font-size: 16px; color: var(--g500); line-height: 1.85; }
.contact-links { display: flex; flex-direction: column; gap: 11px; }
.contact-link { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(160deg, var(--panel), var(--bg2)); transition: border-color .2s, box-shadow .2s, transform .2s; }
.contact-link:hover { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(124,147,184,.1); transform: translateX(4px); }
.cl-l { display: flex; align-items: center; gap: 14px; }
.cl-icon { width: 38px; height: 38px; border-radius: 9px; background: rgba(124,147,184,.1); border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--cyan); flex-shrink: 0; }
.cl-label { font-size: 14px; font-weight: 600; color: var(--white); display: block; }
.cl-val { font-size: 12px; color: var(--g400); font-family: var(--mono); }
.cl-arr { color: var(--g400); font-size: 18px; }

/* ── FOOTER ────────────────────────────────────── */
footer { max-width: 1160px; margin: 0 auto; padding: 30px 40px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--g400); position: relative; z-index: 1; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--g400); }
.footer-links a:hover { color: var(--cyan); }

/* ── RESUME MODAL ───────────────────────────────── */
.modal-bd { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal-bd.open { opacity: 1; pointer-events: all; }
.modal { background: linear-gradient(160deg, var(--panel), var(--bg2)); border: 1px solid var(--line2); border-radius: 16px; width: 460px; padding: 30px; box-shadow: var(--sh2); transform: scale(.94); transition: transform .25s; }
.modal-bd.open .modal { transform: scale(1); }
.modal-title { font-size: 19px; font-weight: 700; color: var(--white); margin-bottom: 6px; }
.modal-sub { font-size: 14px; color: var(--g400); margin-bottom: 20px; font-family: var(--mono); }
.resume-opts { display: flex; flex-direction: column; gap: 9px; }
.resume-opt { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line2); border-radius: 10px; padding: 15px 17px; transition: border-color .15s, background .15s; }
.resume-opt:hover { border-color: var(--cyan); background: rgba(124,147,184,.06); }
.ro-name { font-size: 14px; font-weight: 600; color: var(--white); }
.ro-desc { font-size: 12px; color: var(--g400); margin-top: 2px; font-family: var(--mono); }
.ro-arr { color: var(--cyan); }
.modal-close { width: 100%; margin-top: 16px; padding: 11px; background: none; border: 1px solid var(--line2); border-radius: 8px; color: var(--g400); font-size: 14px; cursor: pointer; transition: background .15s, color .15s; }
.modal-close:hover { background: rgba(255,255,255,.04); color: var(--white); }

/* ── ACHIEVEMENTS ──────────────────────────────── */
.achievement-grid { border: 1px solid var(--line); border-radius: var(--r2); background: linear-gradient(160deg, var(--panel), var(--bg2)); padding: 30px; display: grid; grid-template-columns: 200px 1fr; gap: 30px; transition: border-color .25s, box-shadow .25s, transform .25s; }
.achievement-grid:hover { border-color: var(--line2); box-shadow: var(--sh2); transform: translateY(-3px); }
.achievement-badge-pill { font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; background: var(--amb-bg); color: var(--amber); border: 1px solid rgba(168,154,124,.35); border-radius: 99px; display: inline-block; padding: 3px 11px; margin-bottom: 12px; }
.achievement-type-label { font-family: var(--mono); font-size: 12px; color: var(--g400); }
.achievement-title { font-size: 19px; font-weight: 700; color: var(--white); letter-spacing: -.3px; margin-bottom: 4px; }
.achievement-subtitle { font-size: 14px; color: var(--cyan); font-weight: 500; margin-bottom: 12px; }
.achievement-desc { font-size: 15px; color: var(--g500); line-height: 1.8; }

/* Blog impressions pill */
.blog-impressions { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; color: var(--green); background: var(--grn-bg); border: 1px solid var(--grn-bd); letter-spacing: .3px; }

/* ── SCROLL PROGRESS BAR ── */
#scroll-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 300; background: var(--cyan); opacity: .55; transition: width .1s linear; }

/* ── RESPONSIVE ────────────────────────────────── */
@media (max-width: 900px) {
  .page { padding-left: 24px; padding-right: 24px; }
  nav { padding-left: 24px; padding-right: 24px; }
  #hero { grid-template-columns: 1fr; }
  .hero-sidebar { display: none; }
  .highlights { grid-template-columns: 1fr 1fr; }
  details[open] .proj-detail { grid-template-columns: 1fr; padding-left: 28px; }
  .exp-card { grid-template-columns: 1fr; }
  .edu-card { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  #contact .contact-wrap { grid-template-columns: 1fr; }
  .hero-name { font-size: 46px; }
}

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
  nav { overflow: visible; }
  .nav-links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: rgba(9,10,17,.98); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line); box-shadow: var(--sh2);
    flex-direction: column; padding: 8px 20px 20px; gap: 2px;
  }
  .nav-links.mobile-open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 15px; border-radius: 8px; }
  .nav-resume { width: 100%; margin-left: 0; margin-top: 8px; padding: 12px 16px; font-size: 14px; text-align: center; justify-content: center; }

  .page, nav { padding-left: 20px; padding-right: 20px; }
  section { padding: 56px 0; }
  #hero { padding: 52px 0 48px; }
  .hero-name { font-size: 40px; letter-spacing: -1.5px; }
  .hero-role { font-size: 15px; }
  .hero-bio { font-size: 15px; }

  .proj-summary { flex-wrap: wrap; gap: 16px; padding: 20px; }
  .expand-label { width: 100%; text-align: center; box-sizing: border-box; }
  .proj-detail { padding: 26px 20px; }
  .arch-node { white-space: normal; }
  .arch-flow { gap: 4px; }
  .achievement-grid { grid-template-columns: 1fr; }
  .modal { width: calc(100vw - 32px); max-width: 460px; }
  footer { flex-direction: column; gap: 16px; text-align: center; padding: 24px 20px; }
  .footer-links { justify-content: center; }
}

@media (max-width: 480px) {
  .page, nav { padding-left: 16px; padding-right: 16px; }
  section { padding: 44px 0; }
  #hero { padding: 36px 0 36px; }
  .hero-name { font-size: 34px; letter-spacing: -1px; }
  .highlights { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hl-num { font-size: 28px; }
  .hero-role { font-size: 14px; }
  .hero-bio { font-size: 14px; margin-bottom: 26px; }
  .btn-primary, .btn-outline { font-size: 13px; padding: 10px 16px; }
  .section-title { font-size: 26px; }
  .section-sub { font-size: 14px; margin-bottom: 30px; }
  .proj-name { font-size: 16px; }
  .proj-summary { padding: 16px; gap: 12px; }
  .proj-tagline { font-size: 13px; }
  .proj-detail { padding: 20px 15px; }
  .exp-card, .edu-card, .blog-card { padding: 20px 17px; }
  .exp-title { font-size: 17px; }
  .exp-desc { font-size: 14px; }
  .edu-degree { font-size: 18px; }
  .blog-title { font-size: 17px; }
  .skill-group { padding: 18px; }
  .sidebar-block { padding: 15px; }
  .contact-link { padding: 13px 15px; }
  footer { padding: 20px 16px; }
  .modal { padding: 22px; }
  .achievement-grid { padding: 22px; }
  .nav-links { padding: 8px 16px 16px; }
}

/* ── PRINT ─────────────────────────────────────── */
@media print {
  body { background: #fff; color: #000; }
  body::before, body::after, #hero-canvas, #scroll-progress { display: none; }
  nav { display: none; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  details.proj-card { border: 1px solid #ccc; break-inside: avoid; }
  details.proj-card .proj-detail { display: grid !important; }
  .modal-bd { display: none; }
}

/* ── Live from GitHub strip ─────────────────────────── */
.gh-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 26px;
  font-size: 13px;
  color: var(--g400);
}
.gh-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(124, 147, 184, .5);
  animation: gh-pulse 2.2s ease-out infinite;
}
@keyframes gh-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(124, 147, 184, .5); }
  70%  { box-shadow: 0 0 0 7px rgba(124, 147, 184, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 147, 184, 0); }
}
.gh-strip-label {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
}
.gh-stat b { color: var(--g100); font-weight: 700; }
.gh-sep { color: var(--line2); }
.gh-updated { font-variant-numeric: tabular-nums; }
.gh-recent {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}
.gh-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--g200);
  font-size: 12px;
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease;
}
.gh-item:hover { border-color: rgba(124, 147, 184, .4); color: var(--white); }
.gh-item-time { color: var(--g500); font-size: 11px; }


/* ═══════════════════════════════════════════════
   TERMINAL LAYER — tabular numerics, tape, tearsheet tables
   ═══════════════════════════════════════════════ */

/* Every number on the page reads like a terminal readout */
.hl-num, .metric-val, .edu-cgpa strong, .gh-updated, .gh-stat b,
.tape-val, .perf-table td, .stat-val {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
.metric-val { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.2px; }
.metric-val.pos { color: var(--green); }
.metric-val.neg { color: var(--red); }
.metric-val.flat { color: var(--g300); }
.metric-val.amber { color: var(--amber); }

/* ── Tape: the metrics ribbon under the hero ── */
.tape {
  position: relative; z-index: 1;
  margin-top: 26px; border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(160deg, var(--panel), var(--bg2));
  display: flex; flex-wrap: wrap; align-items: stretch; overflow: hidden;
}
.tape-item { flex: 1 1 auto; min-width: 148px; padding: 13px 18px; border-right: 1px solid var(--line); }
.tape-item:last-child { border-right: none; }
.tape-key { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--g400); margin-bottom: 5px; }
.tape-val { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--white); letter-spacing: -.4px; }
.tape-val.pos { color: var(--green); }
.tape-val.neg { color: var(--red); }
.tape-val.amber { color: var(--amber); }
.tape-note { font-size: 10.5px; color: var(--g400); margin-top: 3px; line-height: 1.35; }

/* ── Tearsheet result table (inside project details) ── */
.perf-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; margin-top: 4px; }
.perf-table caption { caption-side: top; text-align: left; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--g400); padding-bottom: 10px; }
.perf-table th { text-align: right; font-weight: 700; color: var(--g400); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; padding: 0 0 9px; border-bottom: 1px solid var(--line2); }
.perf-table th:first-child { text-align: left; }
.perf-table td { text-align: right; padding: 9px 0; color: var(--g300); border-bottom: 1px solid var(--line); }
.perf-table td:first-child { text-align: left; color: var(--g200); }
.perf-table tr:last-child td { border-bottom: none; }
.perf-table tr.hi td { color: var(--white); }
.perf-table tr.hi td:first-child { color: var(--amber); font-weight: 700; }
.perf-table .pos { color: var(--green); }
.perf-table .neg { color: var(--red); }
.perf-wrap { overflow-x: auto; }

/* ── Null-result callout: the thing a quant desk actually respects ── */
.null-box { border: 1px solid var(--line2); border-left: 3px solid var(--red); border-radius: 0 10px 10px 0; background: rgba(176,133,133,.05); padding: 16px 18px; }
.null-box .nb-label { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--red); margin-bottom: 8px; }
.null-box .detail-bullets li::before { background: var(--red); box-shadow: none; }
.null-box .detail-text { font-size: 14px; }

/* ── Section eyebrow reads like a desk ticker ── */

/* ── Ticker rule under the nav ── */
nav { border-bottom: 1px solid var(--line); box-shadow: inset 0 -1px 0 rgba(124,147,184,.10); }

@media (max-width: 900px) {
  .tape-item { min-width: 50%; border-right: none; border-bottom: 1px solid var(--line); }
  .tape-item:last-child { border-bottom: none; }
}
@media (max-width: 480px) {
  .tape-item { min-width: 100%; }
  .tape-val { font-size: 15px; }
}


/* ═══════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════ */

/* Keyboard users get the first stop in the tab order; pointer users never see it */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 400;
  background: var(--panel); color: var(--white);
  border: 1px solid var(--blue-bd); border-radius: 8px;
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

/* One visible focus treatment for every interactive element. :focus-visible so a
   mouse click does not leave a ring behind, but a Tab always does. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}
.proj-summary:focus-visible { outline-offset: -3px; }


/* ── Numbered nav ── */
.nav-num { font-family: var(--mono); font-size: 10.5px; color: var(--g400); }
.nav-links a.active .nav-num, .nav-links a:hover .nav-num { color: var(--cyan); }
.nav-links a.active::after { background: var(--cyan); }
.nav-resume { background: var(--cyan); }

/* Card numbers are 1.1, 1.2 ... so they need more room than 01 did */
.proj-num { width: 40px; font-variant-numeric: tabular-nums; }
.proj-info::before { content: none; }
details.proj-card::after { content: none; }
.hl-card::before { content: none; }

/* Flat panels, hairline rules, no glow */
details.proj-card, .exp-card, .edu-card, .blog-card, .skill-group, .achievement-grid, .contact-link, .modal {
  background: var(--panel); box-shadow: none;
}
details.proj-card[open] { border-color: var(--line2); box-shadow: none; }
.arch-node.key { box-shadow: none; }
.badge.live { box-shadow: none; }

@media (max-width: 900px) {
  .keyfacts { grid-template-columns: repeat(3, 1fr); }
  .kf:nth-child(3) { border-right: none; }
  .toc { columns: 1; }
  .hero-name { font-size: 38px; }
}
@media (max-width: 480px) {
  .keyfacts { grid-template-columns: repeat(2, 1fr); }
  .kf:nth-child(odd) { border-right: 1px solid var(--line); }
  .kf:nth-child(even) { border-right: none; }
  .hero-name { font-size: 31px; }
  .abstract p { font-size: 15.5px; }
  .toc-lede { display: none; }
}


/* ── Grades table inside Education ── */
.grades { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }
.grades-h {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 1.8px; text-transform: uppercase; color: var(--g400); margin-bottom: var(--s2);
}
.grades .perf-table { max-width: 420px; }
.grades-note { font-size: 13.5px; color: var(--g500); line-height: 1.7; margin-top: var(--s2); font-style: italic; }

/* ── Achievements as a numbered list, not cards ── */
.ach-list { list-style: none; counter-reset: ach; }
.ach {
  display: grid; grid-template-columns: 120px 1fr; gap: var(--s4);
  padding: var(--s3) 0; border-top: 1px solid var(--line);
}
.ach:last-child { border-bottom: 1px solid var(--line); }
.ach-left { display: flex; flex-direction: column; gap: 5px; }
.ach-year {
  font-family: var(--mono); font-size: 12px; color: var(--white);
  font-variant-numeric: tabular-nums;
}
.ach-kind {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--g400);
}
.ach-body .achievement-title { font-size: 17px; margin-bottom: 3px; }
.ach-body .achievement-subtitle { font-size: 13px; color: var(--g400); font-style: italic; margin-bottom: var(--s2); }
.ach-body .achievement-desc { font-size: 14.5px; max-width: 68ch; }
.ach-body .perf-wrap { margin-bottom: var(--s2); }
.ach-body .perf-table { max-width: 460px; }

@media (max-width: 900px) {
  .ach { grid-template-columns: 1fr; gap: var(--s2); }
  .ach-left { flex-direction: row; align-items: baseline; gap: 10px; }
}

.abstract-note {
  font-size: 15px; line-height: 1.75; color: var(--g500);
  margin-top: var(--s2); padding-left: var(--s2); border-left: 1px solid var(--line2);
}


/* ── Notation: the definitions the rest of the page leans on ── */
.notation {
  border: 1px solid var(--line); border-left: 2px solid var(--cyan);
  background: var(--bg2); padding: var(--s3); margin-bottom: var(--s4);
}
.notation-h {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 1.8px; text-transform: uppercase; color: var(--g400); margin-bottom: var(--s2);
}
.notation-list { display: grid; gap: 9px; }
.notation-list > div { display: grid; grid-template-columns: 5.5em 1fr; gap: var(--s2); align-items: baseline; }
.notation-list dt {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--cyan);
}
.notation-list dd { font-size: 14px; color: var(--g500); line-height: 1.6; }

/* The GitHub strip now sits above the footer, so it should read quietly */
.gh-strip { max-width: 1160px; margin: 0 auto; padding: var(--s3) 40px 0; }

@media (max-width: 700px) {
  .notation-list > div { grid-template-columns: 1fr; gap: 2px; }
  .toc a { grid-template-columns: 3em 1fr; gap: 8px; }
}


/* ── Headline numbers on the closed card ── */
.proj-figures {
  display: flex; flex-wrap: wrap; gap: 4px 22px;
  margin: 0 0 12px; padding: 9px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.fig { display: inline-flex; align-items: baseline; gap: 7px; }
.fig-label {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--g400);
}
.fig-val {
  font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--white);
  font-variant-numeric: tabular-nums;
}
.fig-val.pos { color: var(--green); }
.fig-val.neg { color: var(--red); }
.fig-val.flat, .fig-val.amber { color: var(--g300); }

/* Keep the closed card to a glanceable height */
.proj-tagline { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
details.proj-card[open] .proj-tagline { -webkit-line-clamp: unset; overflow: visible; }
