/* ══════════════════════════════════════════════════
   GURSAHIB SINGH — PORTFOLIO V3
   Aesthetic: "Noir Editorial Zine"
   Palette:  Near-black + cream + chartreuse accent
   Fonts:    Unbounded (display) · Newsreader (serif) · JetBrains Mono
   ══════════════════════════════════════════════════ */

/* ─── TOKENS ─── */
:root {
  --black: #0a0a0a;
  --black-2: #111111;
  --black-3: #181818;
  --black-4: #222222;
  --border: #2a2a2a;
  --border-lite: #333333;
  --cream: #f0ece2;
  --cream-dim: #beb9ad;
  --cream-muted: #7a776e;
  --lime: #c8ff00;
  --lime-dim: rgba(200, 255, 0, 0.10);
  --lime-glow: rgba(200, 255, 0, 0.05);
  --red: #ff4e33;
  --teal: #00c9b7;
  --display: 'Unbounded', sans-serif;
  --serif: 'Newsreader', Georgia, serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 6px;
  /* transition for theme swap */
  --theme-transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* ═══════════ LIGHT THEME ═══════════ */
[data-theme="light"] {
  --black: #faf8f4;
  --black-2: #ffffff;
  --black-3: #f0ede6;
  --black-4: #e8e5dc;
  --border: #ddd9cf;
  --border-lite: #ccc8bc;
  --cream: #1a1918;
  --cream-dim: #3d3b36;
  --cream-muted: #8a867c;
  --lime: #2d7a3a;
  --lime-dim: rgba(45, 122, 58, 0.08);
  --lime-glow: rgba(45, 122, 58, 0.04);
  --red: #d93a20;
  --teal: #0a8f7f;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--serif);
  background: var(--black);
  color: var(--cream);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: var(--theme-transition);
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--lime);
  color: var(--black);
}

/* ─── NOISE ─── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px;
}

/* ─── SCROLL REVEAL ─── */
.rv {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.rv.in {
  opacity: 1;
  transform: translateY(0);
}

.rv-d1 {
  transition-delay: 0.1s;
}

.rv-d2 {
  transition-delay: 0.2s;
}

.rv-d3 {
  transition-delay: 0.3s;
}

.rv-d4 {
  transition-delay: 0.4s;
}

.rv-d5 {
  transition-delay: 0.5s;
}

/* ─── LAYOUT ─── */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 4vw, 3.5rem);
}

/* ══════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.3rem 0;
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.4s;
  mix-blend-mode: normal;
}

.nav.stuck {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
}

[data-theme="light"] .nav.stuck {
  background: rgba(250, 248, 244, 0.85);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 4vw, 3.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.nav-logo .accent {
  color: var(--lime);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cream-muted);
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--lime);
}

.nav-links .btn-talk {
  color: var(--black);
  background: var(--lime);
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  font-weight: 500;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}

.nav-links .btn-talk:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(200, 255, 0, 0.25);
  color: var(--black);
}

.burger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.burger span {
  width: 22px;
  height: 1.5px;
  background: var(--cream);
  border-radius: 2px;
  transition: 0.3s;
}

/* ─── Theme Toggle Switch ─── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0;
  background: none;
  border: none;
  color: var(--cream-muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.3s;
}

.theme-toggle:hover {
  color: var(--lime);
}

.toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 100px;
  background: var(--border);
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--lime);
  transition: transform 0.3s var(--ease), background 0.3s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .toggle-track::after {
  transform: translateX(18px);
}

.toggle-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* ══════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

/* Ambient gradient orb */
.hero::before {
  content: '';
  position: absolute;
  top: 10%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--lime-glow) 0%, transparent 65%);
  pointer-events: none;
  filter: blur(80px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 4rem;
  align-items: center;
  padding: 8rem 0 5rem;
}

.hero-text .eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--lime);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.eyebrow .line {
  width: 32px;
  height: 1px;
  background: var(--lime);
}

.hero-text h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}

.hero-text h1 .serif-i {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--lime);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--cream-dim);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.9rem 2rem;
  border-radius: 2px;
  cursor: pointer;
  border: none;
  transition: all 0.35s var(--ease);
}

.btn-fill {
  background: var(--lime);
  color: var(--black);
}

.btn-fill:hover {
  box-shadow: 0 6px 28px rgba(200, 255, 0, 0.3);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--border-lite);
}

.btn-ghost:hover {
  border-color: var(--lime);
  color: var(--lime);
  transform: translateY(-2px);
}

/* ── Hero badges ── */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.8rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--cream-dim);
  transition: border-color 0.3s, color 0.3s;
}

.badge:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.badge.accent {
  border-color: var(--lime);
  color: var(--lime);
  background: var(--lime-dim);
}

/* ── Hero photo ── */
.hero-photo-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo-frame {
  width: 340px;
  height: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  background: var(--black-2);
}

.hero-photo-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, var(--black) 100%);
  pointer-events: none;
  transition: background 0.4s;
}

.hero-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.photo-placeholder .initials {
  font-family: var(--display);
  font-size: 4rem;
  font-weight: 800;
  color: var(--border-lite);
  line-height: 1;
}

.photo-placeholder .lbl {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-muted);
}

/* Decorative corner brackets on photo */
.hero-photo-frame::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 40px;
  height: 40px;
  border-top: 2px solid var(--lime);
  border-left: 2px solid var(--lime);
  z-index: 2;
  border-radius: var(--radius) 0 0 0;
}

.corner-br {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 40px;
  height: 40px;
  border-bottom: 2px solid var(--lime);
  border-right: 2px solid var(--lime);
  z-index: 2;
  border-radius: 0 0 var(--radius) 0;
}

/* ══════════════════════════════════════════════════
   SECTION HEADERS
   ══════════════════════════════════════════════════ */
.sec {
  padding: 6rem 0;
  border-bottom: 1px solid var(--border);
}

.sec-tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-muted);
  margin-bottom: 0.6rem;
}

.sec-h {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.sec-h .it {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--lime);
}

.sec-rule {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 2rem 0 2.5rem;
}

/* ══════════════════════════════════════════════════
   EXPERIENCE — STACKED ROWS
   ══════════════════════════════════════════════════ */
.exp-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.4s;
  align-items: start;
}

.exp-row:last-child {
  border-bottom: none;
}

.exp-row:hover {
  background: var(--black-2);
}

.exp-left .exp-org {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lime);
  margin-bottom: 0.2rem;
}

.exp-left .exp-date {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--cream-muted);
}

.exp-right h3 {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.exp-right p,
.exp-right li {
  font-size: 0.9rem;
  color: var(--cream-dim);
  line-height: 1.7;
}

.exp-right ul {
  margin-top: 0.6rem;
}

.exp-right li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.35rem;
}

.exp-right li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--lime);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════
   RESEARCH — FUNDING CARDS
   ══════════════════════════════════════════════════ */
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.r-card {
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.4s;
}

.r-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-lite);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.r-card .r-amount {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--lime);
  margin-bottom: 0.6rem;
  line-height: 1;
}

.r-card h3 {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.r-card p {
  font-size: 0.85rem;
  color: var(--cream-dim);
  line-height: 1.7;
}

.r-card .r-award {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--red);
  border-radius: 100px;
}

/* Decorative corner line on research cards */
.r-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--lime);
  border-radius: 0 0 var(--radius) 0;
}

/* ══════════════════════════════════════════════════
   PROJECTS — HORIZONTAL SCROLL
   ══════════════════════════════════════════════════ */
.proj-scroll-wrap {
  overflow: visible;
  margin-top: 2.5rem;
}

.proj-track {
  display: flex;
  gap: 1.2rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1.5rem;
  cursor: grab;
}

.proj-track:active {
  cursor: grabbing;
}

.proj-track::-webkit-scrollbar {
  height: 4px;
}

.proj-track::-webkit-scrollbar-track {
  background: var(--black-2);
  border-radius: 2px;
}

.proj-track::-webkit-scrollbar-thumb {
  background: var(--border-lite);
  border-radius: 2px;
}

.proj-track::-webkit-scrollbar-thumb:hover {
  background: var(--lime);
}

.p-card {
  min-width: 380px;
  max-width: 420px;
  flex-shrink: 0;
  scroll-snap-align: start;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem;
  position: relative;
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.4s;
}

.p-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-lite);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
}

.p-card .p-num {
  font-family: var(--display);
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--black-3);
  margin-bottom: 0.8rem;
  transition: color 0.3s;
}

.p-card:hover .p-num {
  color: var(--border);
}

.p-card .p-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.65rem;
  border-radius: 3px;
  background: var(--lime);
  color: var(--black);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.p-card h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
  line-height: 1.25;
}

.p-card p {
  font-size: 0.85rem;
  color: var(--cream-dim);
  line-height: 1.7;
}

.p-card .p-stack {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.p-card .p-stack span {
  font-family: var(--mono);
  font-size: 0.6rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--cream-muted);
}

.proj-hint {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--cream-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.5rem;
  text-align: right;
}

/* ══════════════════════════════════════════════════
   SKILLS — ANIMATED PILLS
   ══════════════════════════════════════════════════ */
.skills-section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}

.skills-group {
  margin-bottom: 2rem;
}

.skills-group:last-child {
  margin-bottom: 0;
}

.skills-group-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-muted);
  margin-bottom: 0.8rem;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-pill {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.5rem 1.1rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--cream-dim);
  transition: border-color 0.3s, color 0.3s, background 0.3s, transform 0.3s var(--ease);
  cursor: default;
}

.skill-pill:hover {
  border-color: var(--lime);
  color: var(--lime);
  background: var(--lime-dim);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════
   EDUCATION
   ══════════════════════════════════════════════════ */
.edu-card {
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  transition: border-color 0.3s;
}

.edu-card:hover {
  border-color: var(--border-lite);
}

.edu-card h3 {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.edu-card .edu-sub {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--cream-muted);
  margin-bottom: 0.8rem;
}

.edu-card ul li {
  font-size: 0.9rem;
  color: var(--cream-dim);
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.3rem;
}

.edu-card ul li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--lime);
  font-size: 0.5rem;
  top: 0.4em;
}

.edu-icon {
  font-size: 3.5rem;
  opacity: 0.15;
}

/* ══════════════════════════════════════════════════
   CONTACT — SPLIT
   ══════════════════════════════════════════════════ */
.contact-sec {
  border-bottom: none;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-left h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.contact-left h2 .it {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--lime);
}

.contact-left p {
  font-size: 0.95rem;
  color: var(--cream-dim);
  line-height: 1.7;
}

.contact-left .loc {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--cream-muted);
  margin-top: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-right {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.c-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}

.c-link:hover {
  transform: translateX(8px);
  border-color: var(--lime);
  box-shadow: -4px 0 0 var(--lime);
}

.c-link .cl-name {
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 600;
}

.c-link .cl-val {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--cream-muted);
}

.c-link .cl-arrow {
  font-size: 0.9rem;
  color: var(--cream-muted);
  transition: color 0.25s, transform 0.25s;
}

.c-link:hover .cl-arrow {
  color: var(--lime);
  transform: translateX(3px);
}

/* ══════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════ */
.foot {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--cream-muted);
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
  }

  .hero-photo-frame {
    width: 280px;
    height: 360px;
  }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-photo-col {
    justify-content: flex-start;
    margin-top: 2rem;
  }

  .exp-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .research-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .edu-card {
    grid-template-columns: 1fr;
  }

  .edu-icon {
    display: none;
  }

  .p-card {
    min-width: 300px;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    gap: 1.2rem;
    border-bottom: 1px solid var(--border);
  }

  [data-theme="light"] .nav-links.open {
    background: rgba(250, 248, 244, 0.97);
  }

  .burger {
    display: flex;
  }

  .sec {
    padding: 3.5rem 0;
  }

  .hero-grid {
    padding: 5.5rem 0 2.5rem;
  }

  .hero-photo-frame {
    width: 100%;
    height: 300px;
  }

  .p-card {
    min-width: 280px;
  }

  .hero-text h1 {
    font-size: 2rem;
  }

  .hero-sub {
    font-size: 0.92rem;
  }

  .hero-badges {
    gap: 0.4rem;
  }

  .badge {
    font-size: 0.58rem;
    padding: 0.28rem 0.6rem;
  }

  .sec-h {
    font-size: 1.5rem;
  }

  .hero-cta {
    flex-direction: column;
    gap: 0.7rem;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .exp-right h3 {
    font-size: 0.95rem;
  }

  .exp-right li {
    font-size: 0.82rem;
  }

  .r-card {
    padding: 1.5rem;
  }

  .r-card .r-amount {
    font-size: 1.5rem;
  }

  .r-card h3 {
    font-size: 0.85rem;
  }

  .r-card p {
    font-size: 0.8rem;
  }

  .skill-pill {
    font-size: 0.7rem;
    padding: 0.4rem 0.85rem;
  }

  .edu-card {
    padding: 1.8rem;
  }

  .edu-card h3 {
    font-size: 1.05rem;
  }

  .contact-left h2 {
    font-size: 1.6rem;
  }

  .c-link {
    padding: 0.9rem 1.1rem;
  }

  .c-link .cl-name {
    font-size: 0.78rem;
  }

  .c-link .cl-val {
    font-size: 0.65rem;
  }

  .foot {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .theme-toggle .toggle-label {
    display: none;
  }
}

/* ── Extra small screens ── */
@media (max-width: 400px) {
  .wrap {
    padding: 0 1rem;
  }

  .hero-text h1 {
    font-size: 1.7rem;
  }

  .hero-photo-frame {
    height: 240px;
  }

  .p-card {
    min-width: 250px;
    padding: 1.5rem;
  }

  .p-card .p-num {
    font-size: 3.5rem;
  }

  .p-card h3 {
    font-size: 1rem;
  }

  .nav-inner {
    padding: 0 1rem;
  }
}

/* ═══════════════════════════════════════════════════
   LIGHT THEME — COMPONENT OVERRIDES
   (for elements that need more than just variable swaps)
   ═══════════════════════════════════════════════════ */
[data-theme="light"] .hero-photo-frame {
  background: var(--black-3);
}

[data-theme="light"] .r-card:hover,
[data-theme="light"] .p-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .exp-row:hover {
  background: var(--black-3);
}

[data-theme="light"] .proj-track::-webkit-scrollbar-track {
  background: var(--black-3);
}

[data-theme="light"] .proj-track::-webkit-scrollbar-thumb {
  background: var(--border);
}

[data-theme="light"] .proj-track::-webkit-scrollbar-thumb:hover {
  background: var(--lime);
}

[data-theme="light"] ::selection {
  background: var(--lime);
  color: #fff;
}

[data-theme="light"] .btn-fill {
  color: #fff;
}

[data-theme="light"] .nav-links .btn-talk {
  color: #fff;
}

[data-theme="light"] .p-tag {
  color: #fff;
}

[data-theme="light"] .c-link:hover {
  box-shadow: -4px 0 0 var(--lime);
}

/* ══════════════════════════════════════════════════
   SUB-PAGES — SHARED STYLES
   ══════════════════════════════════════════════════ */

/* ── Page Hero Banner ── */
.page-hero {
  padding: 9rem 0 4rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--lime-glow) 0%, transparent 65%);
  pointer-events: none;
  filter: blur(80px);
}

.page-hero .eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--lime);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.page-hero .eyebrow .line {
  width: 32px;
  height: 1px;
  background: var(--lime);
}

.page-hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.page-hero h1 .serif-i {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--lime);
}

.page-hero .page-sub {
  font-size: 1rem;
  color: var(--cream-dim);
  max-width: 600px;
  line-height: 1.7;
}

.page-hero .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cream-muted);
  margin-bottom: 1.5rem;
  transition: color 0.3s;
}

.page-hero .back-link:hover {
  color: var(--lime);
}

/* ══════════════════════════════════════════════════
   LISTING GRID — Projects & Research pages
   ══════════════════════════════════════════════════ */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  padding: 4rem 0;
}

.listing-card {
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.4s;
  display: flex;
  flex-direction: column;
}

.listing-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-lite);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .listing-card:hover {
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.08);
}

.listing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--lime);
}

.listing-card .card-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.65rem;
  border-radius: 3px;
  background: var(--lime);
  color: var(--black);
  margin-bottom: 0.8rem;
  font-weight: 500;
  width: fit-content;
}

[data-theme="light"] .card-tag {
  color: #fff;
}

.listing-card .card-tag.tag-teal {
  background: var(--teal);
  color: #fff;
}

.listing-card .card-tag.tag-red {
  background: var(--red);
  color: #fff;
}

.listing-card h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
  line-height: 1.25;
}

.listing-card p {
  font-size: 0.88rem;
  color: var(--cream-dim);
  line-height: 1.7;
  flex: 1;
}

.listing-card .card-meta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-meta .card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.card-meta .card-stack span {
  font-family: var(--mono);
  font-size: 0.58rem;
  padding: 0.18rem 0.45rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--cream-muted);
}

.card-meta .card-link {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lime);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap 0.3s var(--ease);
  flex-shrink: 0;
}

.card-meta .card-link:hover {
  gap: 0.6rem;
}

/* ── Research listing extras ── */
.listing-card .card-amount {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--lime);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.listing-card .card-award {
  margin-top: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--red);
  border-radius: 100px;
}

/* empty state for "no link" */
.listing-card .card-status {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cream-muted);
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  width: fit-content;
  margin-top: 1rem;
}

/* ══════════════════════════════════════════════════
   PROJECT DETAIL PAGE
   ══════════════════════════════════════════════════ */

/* ── Detail Hero ── */
.detail-hero {
  padding: 9rem 0 3rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.detail-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--lime-glow) 0%, transparent 65%);
  pointer-events: none;
  filter: blur(80px);
}

.detail-hero .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cream-muted);
  margin-bottom: 2rem;
  transition: color 0.3s;
}

.detail-hero .back-link:hover {
  color: var(--lime);
}

.detail-hero .detail-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.75rem;
  border-radius: 3px;
  background: var(--lime);
  color: var(--black);
  margin-bottom: 1rem;
  font-weight: 500;
}

[data-theme="light"] .detail-tag {
  color: #fff;
}

.detail-hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.detail-hero .detail-sub {
  font-size: 1.05rem;
  color: var(--cream-dim);
  max-width: 700px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.detail-meta-item .dm-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cream-muted);
  margin-bottom: 0.2rem;
}

.detail-meta-item .dm-val {
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 600;
}

/* ── Screenshot / Gallery ── */
.detail-gallery {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.gallery-frame {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.gallery-frame .gallery-placeholder {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cream-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.gallery-placeholder .gp-icon {
  font-size: 2.5rem;
  opacity: 0.3;
}

.gallery-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbnails {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
}

.gallery-thumbnails .thumb {
  width: 120px;
  height: 70px;
  border-radius: 4px;
  background: var(--black-3);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-thumbnails .thumb.active,
.gallery-thumbnails .thumb:hover {
  border-color: var(--lime);
}

.thumb .thumb-label {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--cream-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Detail Sections ── */
.detail-section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-section:last-of-type {
  border-bottom: none;
}

.detail-section .sec-tag {
  margin-bottom: 0.6rem;
}

.detail-section .sec-h {
  margin-bottom: 0.4rem;
}

.detail-content {
  margin-top: 2rem;
}

.detail-content p {
  font-size: 0.95rem;
  color: var(--cream-dim);
  line-height: 1.8;
  margin-bottom: 1rem;
  max-width: 750px;
}

.detail-content ul {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.detail-content li {
  font-size: 0.92rem;
  color: var(--cream-dim);
  line-height: 1.7;
  position: relative;
  padding-left: 1.3rem;
  margin-bottom: 0.4rem;
}

.detail-content li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--lime);
  font-weight: 700;
}

/* ── Feature Grid ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: transform 0.35s var(--ease), border-color 0.3s;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-lite);
}

.feature-card .feat-icon {
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
}

.feature-card h4 {
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.feature-card p {
  font-size: 0.82rem;
  color: var(--cream-dim);
  line-height: 1.65;
  margin-bottom: 0;
}

/* ── Tech Stack Detail ── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-top: 2rem;
}

.stack-item {
  background: var(--black-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  transition: border-color 0.3s;
}

.stack-item:hover {
  border-color: var(--lime);
}

.stack-item .si-name {
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.stack-item .si-role {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--cream-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── CTA Banner ── */
.cta-banner {
  padding: 4rem 0;
  text-align: center;
}

.cta-banner h2 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.cta-banner h2 .it {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--lime);
}

.cta-banner p {
  color: var(--cream-dim);
  font-size: 0.92rem;
  margin-bottom: 2rem;
}

.cta-banner .btn-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Sub-page responsive ── */
@media (max-width: 900px) {
  .listing-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }

  .detail-meta-row {
    gap: 1.5rem;
  }

  .gallery-thumbnails {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .page-hero {
    padding: 7rem 0 2.5rem;
  }

  .page-hero h1 {
    font-size: 1.8rem;
  }

  .detail-hero {
    padding: 7rem 0 2rem;
  }

  .detail-hero h1 {
    font-size: 1.8rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .stack-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-thumbnails .thumb {
    width: 80px;
    height: 50px;
  }

  .listing-card {
    padding: 1.5rem;
  }

  .listing-card h3 {
    font-size: 1rem;
  }

  .cta-banner h2 {
    font-size: 1.4rem;
  }
}