/* ===== Reset & Root ===== */
:root {
  --bg: #0B1120;
  --bg-2: #0a0f1c;
  --surface: #111827;
  --surface-2: #131b2e;
  --line: rgba(148, 163, 184, 0.10);
  --line-strong: rgba(148, 163, 184, 0.18);
  --text: #F8FAFC;
  --muted: #94A3B8;
  --muted-2: #64748B;
  --accent: #4F46E5;
  --accent-2: #06B6D4;
  --accent-glow: rgba(79, 70, 229, 0.35);
  --cyan-glow: rgba(6, 182, 212, 0.30);
  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* ===== Background ===== */
.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(to right, rgba(148,163,184,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148,163,184,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
.bg-orbs {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  will-change: transform;
}
.orb.a {
  width: 520px; height: 520px; left: -120px; top: -160px;
  background: radial-gradient(circle, rgba(79,70,229,0.55), transparent 60%);
  animation: drift1 22s ease-in-out infinite;
}
.orb.b {
  width: 460px; height: 460px; right: -100px; top: 30%;
  background: radial-gradient(circle, rgba(6,182,212,0.40), transparent 60%);
  animation: drift2 28s ease-in-out infinite;
}
.orb.c {
  width: 380px; height: 380px; left: 30%; bottom: -120px;
  background: radial-gradient(circle, rgba(99,102,241,0.32), transparent 60%);
  animation: drift3 32s ease-in-out infinite;
}
@keyframes drift1 { 0%,100% { transform: translate(0,0) } 50% { transform: translate(40px,30px) } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) } 50% { transform: translate(-30px,40px) } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) } 50% { transform: translate(20px,-30px) } }

.bg-noise {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

.cursor-glow {
  position: fixed;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79,70,229,0.18), transparent 60%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity 600ms var(--ease);
  will-change: left, top;
  opacity: 0;
}
body.has-cursor .cursor-glow { opacity: 1; }

/* ===== Layout ===== */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: rgba(11, 17, 32, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 400ms var(--ease), background 400ms var(--ease);
}
.nav.scrolled {
  background: rgba(11, 17, 32, 0.75);
  border-bottom-color: var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: 'Space Grotesk';
  font-weight: 600; font-size: 18px;
  letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  white-space: nowrap;
}
.logo-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset, 0 8px 24px -8px var(--accent-glow);
  display: grid; place-items: center;
  font-size: 14px; color: white; font-weight: 700;
  font-family: 'Space Grotesk';
  flex-shrink: 0;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--muted); text-decoration: none;
  font-size: 14px; font-weight: 500;
  position: relative;
  transition: color 240ms var(--ease);
  white-space: nowrap;
}
.nav-links a::after {
  content: ''; position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px; background: var(--text);
  transform: scaleX(0); transform-origin: left;
  transition: transform 360ms var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-strong);
  color: var(--text) !important;
  transition: background 240ms var(--ease), border-color 240ms var(--ease);
}
.nav-cta:hover { background: rgba(255,255,255,0.10) !important; border-color: rgba(148,163,184,0.30); }
.nav-cta::after { display: none !important; }

/* ===== Hamburger ===== */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: 51;
  position: relative;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 320ms var(--ease), opacity 320ms var(--ease);
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ===== Mobile Nav Overlay ===== */
.mobile-nav {
  position: fixed; inset: 0;
  background: rgba(10, 15, 28, 0.97);
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  z-index: 49;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 340ms var(--ease);
}
.mobile-nav.open {
  opacity: 1;
  pointer-events: all;
}
.mobile-nav-links a {
  opacity: 0;
  transform: translateY(16px);
  transition: color 200ms var(--ease), background 200ms var(--ease),
              opacity 400ms var(--ease), transform 400ms var(--ease);
}
.mobile-nav.open .mobile-nav-links a {
  opacity: 1;
  transform: none;
}
.mobile-nav.open .mobile-nav-links a:nth-child(1) { transition-delay: 60ms; }
.mobile-nav.open .mobile-nav-links a:nth-child(2) { transition-delay: 110ms; }
.mobile-nav.open .mobile-nav-links a:nth-child(3) { transition-delay: 160ms; }
.mobile-nav.open .mobile-nav-links a:nth-child(4) { transition-delay: 210ms; }
.mobile-nav.open .mobile-nav-links a:nth-child(5) { transition-delay: 260ms; }
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0 32px;
}
.mobile-nav-links a {
  font-family: 'Space Grotesk';
  font-size: 32px; font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 12px;
  text-align: center;
  width: 100%;
}
.mobile-nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.mobile-nav-links .nav-cta {
  margin-top: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 16px; font-weight: 500;
  letter-spacing: 0;
  padding: 14px 32px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-strong);
  color: var(--text);
  width: auto;
}
.mobile-nav-links .nav-cta:hover { background: rgba(255,255,255,0.10); color: var(--text); }

/* ===== Reveal animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
  transition: opacity 900ms var(--ease), transform 900ms var(--ease), filter 900ms var(--ease);
}
.reveal.in { opacity: 1; transform: none; filter: none; }
.stagger > * {
  opacity: 0; transform: translateY(18px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(1)  { transition-delay: 0ms; }
.stagger.in > *:nth-child(2)  { transition-delay: 70ms; }
.stagger.in > *:nth-child(3)  { transition-delay: 140ms; }
.stagger.in > *:nth-child(4)  { transition-delay: 210ms; }
.stagger.in > *:nth-child(5)  { transition-delay: 280ms; }
.stagger.in > *:nth-child(6)  { transition-delay: 350ms; }
.stagger.in > *:nth-child(7)  { transition-delay: 420ms; }
.stagger.in > *:nth-child(8)  { transition-delay: 490ms; }
.stagger.in > *:nth-child(9)  { transition-delay: 560ms; }
.stagger.in > *:nth-child(10) { transition-delay: 630ms; }
.stagger.in > *:nth-child(11) { transition-delay: 700ms; }
.stagger.in > *:nth-child(12) { transition-delay: 770ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .stagger > * { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .orb { animation: none !important; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 96px 0 120px;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-strong);
  font-size: 12px; color: var(--muted);
  letter-spacing: 0.01em;
}
.pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.16);
  animation: pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.55 } }

h1.hero-title {
  font-family: 'Space Grotesk';
  font-weight: 600;
  font-size: clamp(44px, 7.5vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 24px 0 0;
  text-wrap: balance;
}
.hero-title .grad {
  background: linear-gradient(120deg, #ffffff 20%, #94A3B8 55%, #4F46E5 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  color: var(--muted);
  font-size: 19px;
  max-width: 620px;
  margin: 24px 0 0;
  text-wrap: pretty;
}
.hero-sub strong { color: var(--text); font-weight: 500; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 24px 36px;
  margin-top: 36px;
  color: var(--muted-2);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}
.hero-meta span b { color: var(--text); font-weight: 500; }

.cta-row { display: flex; gap: 12px; margin-top: 40px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease), background 240ms var(--ease), border-color 240ms var(--ease);
  will-change: transform;
  border: 1px solid transparent;
  position: relative; overflow: hidden;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, #5A52F0 0%, #4F46E5 100%);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,0.10) inset, 0 12px 30px -12px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 18px 36px -12px var(--accent-glow); }
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.16), transparent 70%);
  transform: translateX(-100%);
  transition: transform 700ms var(--ease);
}
.btn-primary:hover::after { transform: translateX(100%); }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(148,163,184,0.30); transform: translateY(-1px); }
.btn .arrow { transition: transform 240ms var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ===== Hero grid & code card ===== */
.hero-grid { position: relative; }
.hero-content { position: relative; z-index: 2; max-width: 720px; }

.code-card-wrap {
  position: absolute;
  top: calc(50% + 50px); right: -80px;
  width: 520px;
  transform: translateY(-50%) rotate(-2deg);
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
  filter: saturate(0.95);
  -webkit-mask-image: linear-gradient(to left, #000 60%, transparent 100%);
  mask-image: linear-gradient(to left, #000 60%, transparent 100%);
}
.code-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(180deg, rgba(148,163,184,0.22), rgba(148,163,184,0.04));
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.6), 0 0 80px -20px var(--accent-glow);
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
.code-card-inner {
  background: linear-gradient(180deg, #101828 0%, #0c1322 100%);
  border-radius: calc(var(--radius-lg) - 1px);
  overflow: hidden;
}
.code-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--muted-2);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(148,163,184,0.20); flex-shrink: 0; }
.dot.r { background: #ef4444aa; }
.dot.y { background: #f59e0baa; }
.dot.g { background: #22c55eaa; }
.code-head .file { margin-left: 10px; }
.code-body {
  padding: 18px 20px 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.75;
  color: #cbd5e1;
  overflow-x: auto;
  white-space: pre;
}
.code-body .ln { color: var(--muted-2); display: inline-block; width: 20px; user-select: none; }
.tk-key  { color: #c4b5fd; }
.tk-fn   { color: #93c5fd; }
.tk-str  { color: #67e8f9; }
.tk-num  { color: #fda4af; }
.tk-cmt  { color: #475569; font-style: italic; }
.tk-sym  { color: #94A3B8; }
.tk-prop { color: #f0abfc; }
.caret {
  display: inline-block; width: 8px; height: 14px;
  background: var(--accent-2); vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0 } }

/* ===== Scroll indicator ===== */
.scroll-ind {
  position: absolute; left: 50%; bottom: 12px;
  transform: translateX(-50%);
  color: var(--muted-2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  opacity: 0.7;
}
.scroll-line {
  width: 1px; height: 36px;
  background: linear-gradient(to bottom, transparent, var(--muted-2), transparent);
  background-size: 100% 200%;
  animation: scrollline 2.4s ease-in-out infinite;
}
@keyframes scrollline { 0% { background-position: 0 -100% } 100% { background-position: 0 100% } }

/* ===== Sections ===== */
section {
  padding: 120px 0;
  position: relative;
}
.sec-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sec-eyebrow::before {
  content: ''; width: 28px; height: 1px;
  background: linear-gradient(to right, var(--accent), transparent);
}
.sec-title {
  font-family: 'Space Grotesk';
  font-weight: 600;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 16px 0 0;
  max-width: 720px;
  text-wrap: balance;
}
.sec-lede { color: var(--muted); margin-top: 16px; max-width: 640px; font-size: 17px; }

/* ===== About ===== */
#about-eyebrow { margin-bottom: 32px; }

.about-layout {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: stretch;
}
.about-left {
  display: flex; flex-direction: column; gap: 40px;
}
.about-left .sec-title { margin: 0; }
.about-copy p { color: var(--muted); font-size: 17px; margin: 0 0 18px; }
.about-copy strong { color: var(--text); font-weight: 500; }

/* Portrait card */
.about-portrait {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  min-height: 280px;
  background: var(--surface);
}
.about-portrait-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  filter: brightness(0.82) saturate(0.70) contrast(1.05);
  transition: filter 600ms var(--ease), transform 800ms var(--ease);
}
.about-portrait:hover .about-portrait-img {
  filter: brightness(0.92) saturate(0.85) contrast(1.02);
  transform: scale(1.02);
}
.about-portrait-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, transparent 50%, rgba(11,17,32,0.80) 100%),
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(79,70,229,0.12), transparent 70%);
  pointer-events: none;
}

.about-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 40px;
}
.stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat { padding: 28px; background: var(--surface); }
.stat-num {
  font-family: 'Space Grotesk';
  font-size: 44px; font-weight: 600; line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff, #94A3B8);
  -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.stat-lbl { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 56px;
}
.skill-card {
  position: relative;
  padding: 22px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.005));
  border: 1px solid var(--line);
  transition: transform 360ms var(--ease), border-color 360ms var(--ease), background 360ms var(--ease);
  overflow: hidden;
  cursor: default;
}
.skill-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(79,70,229,0.10), transparent 40%);
  opacity: 0; transition: opacity 360ms var(--ease);
  pointer-events: none;
}
.skill-card:hover { transform: translateY(-3px); border-color: rgba(99,102,241,0.30); background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)); }
.skill-card:hover::before { opacity: 1; }
.skill-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.skill-name { font-family: 'Space Grotesk'; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.skill-cat { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.10em; color: var(--muted-2); text-transform: uppercase; white-space: nowrap; }
.skill-meter {
  margin-top: 18px;
  height: 2px; border-radius: 2px;
  background: rgba(148,163,184,0.10);
  overflow: hidden; position: relative;
}
.skill-meter::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--lvl, 80%);
  background: linear-gradient(to right, var(--accent), var(--accent-2));
  border-radius: 2px;
  transform: translateX(-100%);
  transition: transform 1200ms var(--ease);
}
.stagger.in .skill-card .skill-meter::after { transform: translateX(0); }
.skill-desc { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* ===== Experience timeline ===== */
.timeline {
  position: relative;
  margin-top: 56px;
  padding-left: 28px;
  list-style: none;
}
.timeline::before {
  content: ''; position: absolute;
  top: 6px; bottom: 6px; left: 6px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line-strong) 12%, var(--line-strong) 88%, transparent);
}
.tl-item { position: relative; padding: 0 0 40px 28px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute;
  left: -22px; top: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(79,70,229,0.10), 0 0 12px var(--accent-glow);
}
.tl-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.tl-role { font-family: 'Space Grotesk'; font-weight: 500; font-size: 19px; letter-spacing: -0.01em; }
.tl-co { color: var(--accent-2); font-size: 15px; }
.tl-when { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted-2); white-space: nowrap; }
.tl-desc { color: var(--muted); margin-top: 8px; font-size: 15px; max-width: 720px; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  color: var(--muted);
}

/* ===== Education ===== */
.edu-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-top: 56px;
}
.edu-card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.005));
  border: 1px solid var(--line);
  transition: transform 360ms var(--ease), border-color 360ms var(--ease);
  overflow: hidden;
}
.edu-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(6,182,212,0.10), transparent 40%);
  opacity: 0; transition: opacity 360ms var(--ease);
  pointer-events: none;
}
.edu-card:hover { transform: translateY(-3px); border-color: rgba(6,182,212,0.30); }
.edu-card:hover::before { opacity: 1; }
.edu-head { display: flex; align-items: flex-start; gap: 16px; }
.edu-mark {
  width: 44px; height: 44px; flex: none;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79,70,229,0.18), rgba(6,182,212,0.10));
  border: 1px solid rgba(99,102,241,0.30);
  display: grid; place-items: center;
  color: var(--accent-2);
}
.edu-meta { flex: 1; min-width: 0; }
.edu-degree { font-family: 'Space Grotesk'; font-weight: 500; font-size: 18px; letter-spacing: -0.01em; line-height: 1.25; }
.edu-school { color: var(--accent-2); font-size: 14px; margin-top: 4px; }
.edu-when { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted-2); letter-spacing: 0.10em; margin-top: 4px; text-transform: uppercase; }
.edu-desc { color: var(--muted); font-size: 14px; margin: 16px 0 0; }

/* ===== Projects ===== */
.proj-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; margin-top: 56px;
}
.proj {
  position: relative;
  display: block;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.005));
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 500ms var(--ease), border-color 500ms var(--ease);
  will-change: transform;
}
.proj::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; padding: 1px;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(79,70,229,0.40), transparent 40%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 360ms var(--ease);
  pointer-events: none;
}
.proj:hover { transform: translateY(-4px); }
.proj:hover::before { opacity: 1; }

.proj-media {
  position: relative; aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #1a2138, #0f1626);
  border-bottom: 1px solid var(--line);
}
.proj-media .stripes {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(148,163,184,0.04) 0 12px, transparent 12px 24px);
  transition: transform 900ms var(--ease);
}
.proj:hover .proj-media .stripes { transform: scale(1.06); }
.proj-media .glow {
  position: absolute; inset: -1px;
  background: radial-gradient(60% 80% at 30% 20%, rgba(79,70,229,0.30), transparent 60%),
              radial-gradient(50% 70% at 80% 80%, rgba(6,182,212,0.20), transparent 60%);
  pointer-events: none;
}
.proj-mock {
  position: absolute; inset: 16% 14%;
  border-radius: 10px;
  background: linear-gradient(180deg, #0d1426, #080d1a);
  border: 1px solid rgba(148,163,184,0.18);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
  overflow: hidden;
  transition: transform 900ms var(--ease);
}
.proj:hover .proj-mock { transform: translateY(-4px) scale(1.02); }
.proj-mock-bar {
  height: 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 5px;
  padding: 0 10px;
}
.proj-mock-bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(148,163,184,0.25); display: block; }
.proj-mock-body {
  padding: 14px;
  display: grid; grid-template-columns: 80px 1fr;
  gap: 10px; height: calc(100% - 22px);
}
.proj-mock-body .side { display: flex; flex-direction: column; gap: 6px; }
.proj-mock-body .side i { height: 8px; border-radius: 3px; background: rgba(148,163,184,0.10); }
.proj-mock-body .side i:nth-child(1) { background: linear-gradient(to right, rgba(79,70,229,0.6), rgba(79,70,229,0.1)); }
.proj-mock-body .main { display: flex; flex-direction: column; gap: 8px; }
.proj-mock-body .main .row { display: flex; gap: 6px; }
.proj-mock-body .main .row i {
  flex: 1; height: 38px; border-radius: 6px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid var(--line);
}
.proj-mock-body .main .row i.acc { background: linear-gradient(135deg, rgba(79,70,229,0.3), rgba(6,182,212,0.15)); border-color: rgba(99,102,241,0.3); }
.proj-mock-body .main .bar { height: 8px; border-radius: 3px; background: rgba(148,163,184,0.10); }
.proj-mock-body .main .bar.short { width: 60%; }

/* Private / enterprise project */
.proj-private { cursor: default; }
.proj-private:hover { transform: none; }

.proj-private-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 12px;
  pointer-events: none;
  z-index: 2;
}
.proj-private-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(10, 15, 28, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.proj-lock {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.08em;
  color: var(--muted-2);
  text-transform: uppercase;
}

/* Real project image */
.proj-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 900ms var(--ease), filter 600ms var(--ease);
  filter: brightness(0.88) saturate(0.9);
}
.proj:hover .proj-img {
  transform: scale(1.03);
  filter: brightness(0.96) saturate(1);
}

.proj-body { padding: 22px 24px 24px; }
.proj-title {
  font-family: 'Space Grotesk';
  font-size: 22px; font-weight: 500; letter-spacing: -0.01em;
  margin: 0;
  display: flex; align-items: center; gap: 10px;
}
.proj-title .ext { color: var(--muted-2); transition: transform 300ms var(--ease), color 300ms var(--ease); }
.proj:hover .proj-title .ext { transform: translate(2px, -2px); color: var(--text); }
.proj-kicker { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted-2); letter-spacing: 0.10em; text-transform: uppercase; margin-bottom: 10px; }
.proj-desc { color: var(--muted); font-size: 14px; margin: 10px 0 0; max-width: 50ch; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.proj-extra {
  max-height: 0; overflow: hidden;
  transition: max-height 600ms var(--ease), opacity 400ms var(--ease), margin-top 400ms var(--ease);
  opacity: 0;
}
.proj:hover .proj-extra { max-height: 80px; opacity: 1; margin-top: 16px; }
.proj-extra-list { display: flex; flex-wrap: wrap; gap: 14px 24px; color: var(--muted); font-size: 13px; }
.proj-extra-list b { color: var(--text); font-weight: 500; }

/* ===== Contact ===== */
.contact-card {
  margin-top: 56px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(79,70,229,0.06), rgba(6,182,212,0.03));
  padding: 56px 48px;
  position: relative;
  overflow: hidden;
}
.contact-card::after {
  content: ''; position: absolute; inset: -1px;
  border-radius: inherit;
  background: radial-gradient(80% 100% at 50% 0%, rgba(79,70,229,0.18), transparent 60%);
  pointer-events: none;
}
.contact-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 24px; align-items: flex-start;
}
.contact-h {
  font-family: 'Space Grotesk';
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.1; letter-spacing: -0.025em; font-weight: 600;
  margin: 0; max-width: 18ch;
  text-wrap: balance;
}
.contact-mail {
  font-family: 'Space Grotesk';
  font-size: 22px; color: var(--text); text-decoration: none;
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
}
.contact-mail::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--text);
  transform: scaleX(0); transform-origin: left;
  transition: transform 360ms var(--ease);
}
.contact-mail:hover::after { transform: scaleX(1); }
.contact-row { display: flex; gap: 24px; flex-wrap: wrap; }
.icon-link {
  color: var(--muted); text-decoration: none; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color 240ms var(--ease);
}
.icon-link:hover { color: var(--text); }
.icon-link svg { flex-shrink: 0; }

/* ===== Footer ===== */
footer.foot {
  padding: 48px 0 56px;
  border-top: 1px solid var(--line);
  margin-top: 80px;
}
.foot-inner {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted-2); font-size: 13px; gap: 16px; flex-wrap: wrap;
}
.foot-inner a { color: var(--muted); text-decoration: none; }
.foot-inner a:hover { color: var(--text); }

/* ===== Touch active states ===== */
@media (hover: none) {
  .btn:active { opacity: 0.75; transform: scale(0.97); }
  .proj:active { transform: translateY(-2px); }
  .icon-link:active { color: var(--text); }
  .mobile-nav-links a:active { color: var(--text); background: rgba(255,255,255,0.06); }
  .edu-card:active { transform: translateY(-2px); border-color: rgba(6,182,212,0.30); }
  .skill-card:active { transform: translateY(-2px); border-color: rgba(99,102,241,0.30); }
}

/* ===== Selection ===== */
::selection { background: rgba(79,70,229,0.50); color: white; }

/* ===================================================================
   RESPONSIVE
=================================================================== */

@media (max-width: 1100px) {
  .hero { padding: 64px 0 80px; }
  .code-card-wrap { right: -180px; width: 460px; opacity: 0.55; }
}

@media (max-width: 880px) {
  .about-layout { grid-template-columns: 1fr; gap: 24px; }
  .about-portrait { height: 220px; min-height: unset; }
  .about-portrait-img { object-position: top center; }
  .about-stats { grid-template-columns: 1fr 1fr; margin-top: 24px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .edu-grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
  .nav-inner { padding: 12px 20px; }
  .logo { font-size: 16px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .cursor-glow { display: none; }
  .code-card-wrap { display: none; }
  .scroll-ind { display: none; }

  section { padding: 72px 0; }
  .hero { padding: 40px 0 56px; }

  h1.hero-title { font-size: clamp(36px, 10vw, 52px); letter-spacing: -0.03em; }
  .hero-sub { font-size: 16px; margin-top: 18px; }
  .hero-meta { gap: 12px 20px; margin-top: 24px; font-size: 12px; }
  .cta-row { margin-top: 28px; }
  .pill { font-size: 11px; }

  .sec-title { font-size: clamp(26px, 7.5vw, 36px); }
  .sec-lede { font-size: 15px; }
  .sec-eyebrow { font-size: 11px; letter-spacing: 0.12em; }

  .about-layout { gap: 24px; }
  .about-left { gap: 24px; }
  .about-copy p { font-size: 16px; }
  .stat { padding: 22px; }
  .stat-num { font-size: 34px; }
  .stat-lbl { font-size: 12px; }

  .skills-grid { margin-top: 36px; gap: 12px; grid-template-columns: 1fr 1fr; }
  .skill-card { padding: 18px; }
  .skill-name { font-size: 16px; }
  .skill-desc { font-size: 12.5px; margin-top: 12px; }

  .timeline { margin-top: 36px; padding-left: 22px; }
  .tl-item { padding: 0 0 32px 22px; }
  .tl-row { gap: 4px 10px; }
  .tl-role { font-size: 16px; }
  .tl-co { font-size: 13px; display: block; width: 100%; }
  .tl-when { margin-left: 0; width: 100%; font-size: 11px; margin-top: 2px; }
  .tl-desc { font-size: 14px; }
  .tag { font-size: 10px; padding: 3px 8px; }

  .edu-grid { margin-top: 36px; gap: 14px; }
  .edu-card { padding: 22px; }
  .edu-mark { width: 38px; height: 38px; }
  .edu-degree { font-size: 16px; }
  .edu-school { font-size: 13px; }

  .proj-grid { margin-top: 36px; gap: 16px; }
  .proj-body { padding: 18px 20px 20px; }
  .proj-title { font-size: 19px; }
  .proj-desc { font-size: 13.5px; }
  .proj-extra { max-height: none !important; opacity: 1 !important; margin-top: 14px !important; }

  .contact-card { margin-top: 36px; padding: 32px 24px; }
  .contact-h { font-size: clamp(22px, 6.5vw, 30px); }
  .contact-mail { font-size: 18px; }
  .contact-row { gap: 16px 20px; }
  .icon-link { font-size: 13px; }

  footer.foot { padding: 32px 0 36px; margin-top: 48px; }
  .foot-inner { font-size: 12px; }

  .orb { filter: blur(60px); opacity: 0.28; }
  .orb.a { width: 360px; height: 360px; }
  .orb.b { width: 320px; height: 320px; }
  .orb.c { width: 280px; height: 280px; }
  .bg-grid { background-size: 48px 48px; }
}

@media (max-width: 520px) {
  .cta-row { flex-direction: column; }
  .cta-row .btn { width: 100%; justify-content: center; padding: 13px 16px; }
}

@media (max-width: 420px) {
  .wrap { padding: 0 16px; }
  .nav-inner { padding: 12px 16px; }

  .contact-card { padding: 28px 20px; }
  .contact-mail { font-size: 16px; }
  .contact-row { gap: 12px 16px; }

  .foot-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
  }

  .proj-body { padding: 16px 16px 18px; }
  .proj-title { font-size: 18px; }
}

@media (max-width: 360px) {
  .skills-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .mobile-nav-links a { font-size: 24px; }

  h1.hero-title { font-size: clamp(28px, 8.5vw, 38px); }
  .stat-num { font-size: 30px; }

  .edu-head { flex-direction: column; gap: 10px; }
}
