:root {
  --bg: #0a0e1a;
  --bg-deep: #060a14;
  --surface: rgba(15, 22, 42, 0.75);
  --surface-2: rgba(20, 30, 55, 0.6);
  --ink: #e8edf5;
  --muted: #8b9cc0;
  --accent: #00d4ff;
  --accent-2: #f5a623;
  --cern-blue: #0033A0;
  --line: rgba(0, 212, 255, 0.12);
  --line-strong: rgba(0, 212, 255, 0.25);
  --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.15);
  --glow-gold: 0 0 20px rgba(245, 166, 35, 0.12);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  --radius: 18px;
  --radius-sm: 12px;
  --max-width: 1120px;
  --nav-height: 76px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }
html { scroll-behavior: smooth; }

body {
  font-family: "Sora", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.03em;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.section { padding-block: clamp(5rem, 10vw, 8rem); }

h1, h2, h3, p, ul, ol { margin: 0; }
h1, h2, h3 { line-height: 1.1; }

h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  max-width: 18ch;
  background: linear-gradient(135deg, var(--ink) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  max-width: 22ch;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
p { color: var(--muted); max-width: 66ch; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }

/* ── Particle Canvas ── */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
}

/* ── Grid Overlay ── */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── Navigation ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(10, 14, 26, 0.92), rgba(10, 14, 26, 0.7));
  border-bottom: 1px solid var(--line);
}

.nav {
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
}

.brand-dot { color: var(--accent); }

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

.nav-links a {
  font-size: 0.94rem;
  color: var(--muted);
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after { width: 100%; }

.nav-links a:hover,
.nav-links a:focus-visible { color: var(--ink); }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(15, 22, 42, 0.8);
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  cursor: pointer;
}

.nav-toggle span {
  width: 16px;
  height: 2px;
  background: var(--ink);
  display: block;
  transition: transform 0.2s ease;
}

/* ── Hero ── */
.hero {
  padding-top: clamp(4rem, 8vw, 8rem);
  display: grid;
  gap: 1.5rem;
}

.eyebrow,
.section-kicker,
.hero-note {
  text-transform: uppercase;
  font-size: 0.76rem;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

.lead { font-size: clamp(1rem, 1.5vw, 1.2rem); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-note {
  color: var(--accent-2);
  text-shadow: 0 0 12px rgba(245, 166, 35, 0.3);
}

/* ── CERN Badge ── */
.cern-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(0, 51, 160, 0.4);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 51, 160, 0.15), rgba(0, 212, 255, 0.08));
  font-size: 0.82rem;
  color: var(--accent);
  box-shadow: 0 0 24px rgba(0, 51, 160, 0.15);
  animation: badge-pulse 3s ease-in-out infinite;
}

.cern-badge svg {
  width: 18px;
  height: 18px;
  fill: var(--accent);
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(0, 51, 160, 0.15); }
  50% { box-shadow: 0 0 32px rgba(0, 212, 255, 0.25); }
}

/* ── Social ── */
.social-row {
  display: flex;
  align-items: center;
  gap: 0.56rem;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 22, 42, 0.6);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.social-link svg {
  width: 17px;
  height: 17px;
  fill: var(--muted);
  transition: fill 0.2s ease;
}

.social-link:hover,
.social-link:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--glow-cyan);
}

.social-link:hover svg { fill: var(--accent); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.72rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.btn:hover,
.btn:focus-visible { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0099cc);
  color: var(--bg);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.25);
}

.btn-primary:hover { box-shadow: 0 14px 40px rgba(0, 212, 255, 0.35); }

.btn-secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(15, 22, 42, 0.5);
}

.btn-secondary:hover {
  border-color: var(--accent);
  box-shadow: var(--glow-cyan);
}

/* ── Stat Cards ── */
.stats-grid {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--glow-cyan);
}

.stat-number {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 16px rgba(0, 212, 255, 0.3);
}

.stat-label {
  font-size: 0.9rem;
  margin-top: 0.25rem;
  color: var(--muted);
}

/* ── Section Heads ── */
.section-head {
  display: grid;
  gap: 1.2rem;
  margin-bottom: 3rem;
}

/* ── About ── */
.about-grid { display: grid; gap: 3rem; }

.capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.capability-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  background: var(--surface);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.capability-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.capability-card h3 {
  margin-bottom: 0.5rem;
  color: var(--ink);
}

/* ── CERN Fit Matrix ── */
.fit-grid {
  display: grid;
  gap: 0.8rem;
}

.fit-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  background: var(--surface);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.fit-row:hover {
  border-color: var(--accent);
  box-shadow: var(--glow-cyan);
}

.fit-need {
  font-size: 0.92rem;
  color: var(--muted);
}

.fit-connector {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  position: relative;
  flex-shrink: 0;
}

.fit-connector::before {
  content: '→';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-2);
  font-size: 0.8rem;
}

.fit-proof {
  font-size: 0.92rem;
  color: var(--accent);
  font-weight: 500;
}

/* ── Projects ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.8rem;
  transform-style: preserve-3d;
  transition: transform 0.15s linear, box-shadow 0.3s ease, border-color 0.3s ease;
}



.project-card:hover {
  box-shadow: 0 26px 48px rgba(0, 0, 0, 0.5);
  border-color: var(--line-strong);
}

.project-link:hover .project-cta { color: var(--accent-2); }

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(245, 166, 35, 0.3);
  color: var(--accent-2);
  background: rgba(245, 166, 35, 0.1);
  font-size: 0.76rem;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  color: var(--muted);
  transition: border-color 0.2s ease;
}

.tag-list li:hover { border-color: var(--accent); }

/* ── Skill Bars ── */
.skills-bars {
  display: grid;
  gap: 0.7rem;
}

.skill-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 1.5rem;
}

.skill-name {
  font-size: 0.88rem;
  color: var(--ink);
}

.skill-track {
  height: 8px;
  background: rgba(0, 212, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), rgba(0, 212, 255, 0.6));
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-fill.filled {
  /* width set by JS via data-level */
}

.skill-level {
  font-size: 0.72rem;
  color: var(--accent);
  text-align: right;
}

/* ── Tools Grid ── */
.tools-grid {
  margin-top: 2rem;
}

.tools-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tool-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.74rem;
  color: var(--muted);
  background: var(--surface);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.tool-chip:hover {
  border-color: var(--accent);
  color: var(--ink);
}

/* ── Timeline ── */
.timeline {
  position: relative;
  display: grid;
  gap: 1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), rgba(0, 212, 255, 0.1));
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  background: var(--surface);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--glow-cyan);
}

.timeline-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(130deg, var(--accent), var(--accent-2));
  margin-top: 0.1rem;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

.timeline-meta {
  font-size: 0.75rem;
  margin-top: 0.3rem;
  margin-bottom: 0.4rem;
  color: var(--accent);
}

.timeline-progression {
  display: grid;
  gap: 0.35rem;
  margin: 0.6rem 0 0.7rem;
}

.timeline-progression li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  width: fit-content;
  max-width: 100%;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface-2);
}

/* ── Education ── */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.edu-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  background: var(--surface);
  display: grid;
  gap: 0.3rem;
  transition: border-color 0.3s ease;
}

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

.edu-degree {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.edu-school {
  font-size: 0.88rem;
  color: var(--accent);
}

.edu-detail {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Languages ── */
.lang-row {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.lang-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.84rem;
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lang-chip .lang-level {
  color: var(--accent);
  font-size: 0.72rem;
}

/* ── Publications / Writing ── */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.writing-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  background: var(--surface);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 0.5rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.writing-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.writing-meta {
  font-size: 0.72rem;
  color: var(--accent);
}

/* ── CTA Footer ── */
.cta-section {
  padding-block: clamp(5rem, 10vw, 8rem);
  text-align: center;
  display: grid;
  gap: 2rem;
  justify-items: center;
}

.cta-section h2 {
  max-width: 24ch;
  background: linear-gradient(135deg, var(--ink), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta-quote {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 50ch;
}

.cta-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 1.4rem;
}

.footer-inner {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-inner p { font-size: 0.72rem; }

/* ── Reveal Animations ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .project-grid,
  .writing-grid { grid-template-columns: 1fr; }
  .capability-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-row { grid-template-columns: 140px 1fr; gap: 1rem; }
  .fit-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .fit-connector { width: 100%; height: 2px; }
  .edu-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }

  .nav-links {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    width: min(240px, calc(100% - 2rem));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.2s ease;
  }

  .nav-links li { border-top: 1px solid var(--line); }
  .nav-links li:first-child { border-top: 0; }
  .nav-links a { display: block; padding: 0.8rem 1rem; }
  .nav-links a::after { display: none; }
  .nav-links.is-open { max-height: 400px; opacity: 1; pointer-events: auto; }
  .hero { padding-top: clamp(3.2rem, 8vw, 4.5rem); }
  .stats-grid { grid-template-columns: 1fr; }
  .section { padding-block: clamp(3.2rem, 10vw, 4.8rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
