:root {
  --bg: #07080c;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-hover: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaf0;
  --muted: #8a90a2;
  --dim: #525868;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --green: #4ade80;
  --grad: linear-gradient(100deg, #22d3ee 0%, #818cf8 50%, #c084fc 100%);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(34, 211, 238, 0.3); }

a { color: inherit; text-decoration: none; }

.container { width: min(1040px, 90%); margin: 0 auto; position: relative; z-index: 1; }

/* Background: faint grid that fades out, plus a soft glow behind the hero */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
}
.bg-glow {
  position: absolute; top: -220px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(99, 102, 241, 0.22), rgba(34, 211, 238, 0.08), transparent);
  filter: blur(20px);
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(7, 8, 12, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.logo { font-family: var(--mono); font-weight: 700; font-size: 1rem; color: var(--text); }
.logo .dim { color: var(--dim); }
.caret { color: var(--cyan); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav nav { display: flex; gap: 1.75rem; }
.nav nav a {
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
  transition: color 0.15s;
}
.nav nav a::before { content: "/"; color: var(--dim); margin-right: 2px; }
.nav nav a:hover { color: var(--cyan); }

/* Hero */
.hero { padding: 7.5rem 0 5rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
  padding: 0.4rem 0.85rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface);
}
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.prompt { font-family: var(--mono); color: var(--cyan); font-size: 0.95rem; margin-top: 2.25rem; }
.hero h1 {
  font-size: clamp(2.8rem, 8vw, 5.25rem); line-height: 1.02; font-weight: 800;
  letter-spacing: -0.04em; margin-top: 0.4rem;
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.role { font-family: var(--mono); color: var(--muted); font-size: 0.95rem; margin-top: 1rem; }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 600px; margin-top: 1.5rem; }

.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }
.cta.center { justify-content: center; }
.btn {
  font-family: var(--mono); font-size: 0.85rem; font-weight: 500;
  padding: 0.75rem 1.25rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn:hover { border-color: rgba(34, 211, 238, 0.5); background: var(--surface-hover); transform: translateY(-1px); }
.btn.primary {
  background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700;
}
.btn.primary:hover { box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18), 0 8px 30px rgba(99, 102, 241, 0.35); }

.stats {
  list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 4rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); max-width: 640px;
}
.stats li { padding: 1.25rem 1.5rem; }
.stats li + li { border-left: 1px solid var(--border); }
.stats strong { display: block; font-family: var(--mono); font-size: 1.75rem; font-weight: 700; }
.stats span { color: var(--muted); font-size: 0.82rem; }

/* Sections */
.section { padding: 5rem 0; }
.section h2 {
  display: flex; align-items: center; gap: 0.9rem;
  font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 2rem;
}
.section h2::after {
  content: ""; flex: 1; height: 1px; max-width: 320px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.section h2.center-h { justify-content: center; }
.section h2.center-h::after { display: none; }
.num { font-family: var(--mono); font-size: 0.85rem; font-weight: 500; color: var(--cyan); }
.num::after { content: " //"; color: var(--dim); }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1rem 2rem; }
#projects .grid.two { gap: 1rem; }

.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: 1rem;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}
.grid > .card { margin-bottom: 0; }
.card:hover { background: var(--surface-hover); border-color: rgba(129, 140, 248, 0.35); transform: translateY(-2px); }
.card h3 { font-size: 1.08rem; font-weight: 650; letter-spacing: -0.01em; }
.card h4 {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--dim); margin: 1.25rem 0 0.6rem;
}
.card h4:first-child { margin-top: 0; }
.card p { color: var(--muted); margin-top: 0.6rem; font-size: 0.95rem; }
.card ul { margin: 0.9rem 0 0; color: var(--muted); font-size: 0.92rem; list-style: none; }
.card ul li { position: relative; padding-left: 1.1rem; margin-bottom: 0.4rem; }
.card ul li::before { content: "›"; position: absolute; left: 0; color: var(--cyan); font-family: var(--mono); }
.card ul.plain li::before { content: "–"; color: var(--dim); }

.card-head, .item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem 1rem; flex-wrap: wrap; }
.meta { font-family: var(--mono); color: var(--dim); font-size: 0.75rem; white-space: nowrap; }

/* Award cards get a gradient top edge */
.award { display: flex; flex-direction: column; overflow: hidden; }
.award::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--grad); opacity: 0.7;
}
.award h3 { margin-top: 1rem; font-size: 1.3rem; }
.badge {
  align-self: flex-start; font-family: var(--mono); font-size: 0.7rem; font-weight: 500;
  padding: 0.3rem 0.6rem; border-radius: 6px;
  border: 1px solid var(--border); color: var(--muted);
}
.badge.gold { color: #fcd34d; border-color: rgba(252, 211, 77, 0.3); background: rgba(252, 211, 77, 0.06); }
.badge.bronze { color: #fdba74; border-color: rgba(253, 186, 116, 0.3); background: rgba(253, 186, 116, 0.06); }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.1rem; }
.card h4 + .tags { margin-top: 0; }
.tags span {
  font-family: var(--mono); font-size: 0.72rem; padding: 0.22rem 0.55rem; border-radius: 5px;
  color: var(--violet); background: rgba(167, 139, 250, 0.08); border: 1px solid rgba(167, 139, 250, 0.18);
}

/* Timeline */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before {
  content: ""; position: absolute; left: 0; top: 0.5rem; bottom: 0.5rem; width: 1px;
  background: linear-gradient(180deg, var(--cyan), rgba(192, 132, 252, 0.4), transparent);
}
.item { position: relative; padding-bottom: 2.5rem; }
.item:last-child { padding-bottom: 0; }
.item::before {
  content: ""; position: absolute; left: calc(-1.75rem - 4px); top: 0.55rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--cyan); box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}
.item h3 { font-size: 1.05rem; font-weight: 650; }
.item ul { margin: 0.6rem 0 0; color: var(--muted); list-style: none; font-size: 0.95rem; }
.item li { position: relative; padding-left: 1.1rem; margin-bottom: 0.35rem; }
.item li::before { content: "›"; position: absolute; left: 0; color: var(--dim); font-family: var(--mono); }

/* Contact */
.contact { text-align: center; }
.contact p { color: var(--muted); font-size: 1.05rem; }

.footer {
  padding: 2rem 0 3rem; text-align: center; font-family: var(--mono);
  color: var(--dim); font-size: 0.75rem; border-top: 1px solid var(--border);
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .caret, .dot { animation: none; }
}

@media (max-width: 720px) {
  .nav nav { gap: 1rem; }
  .nav nav a:nth-child(n+4) { display: none; }
  .hero { padding: 4.5rem 0 3rem; }
  .grid.two { grid-template-columns: 1fr; }
  .stats li { padding: 1rem; }
  .stats strong { font-size: 1.3rem; }
  .section { padding: 3.5rem 0; }
}
