:root {
  --bg: #020617;
  --bg-alt: #050816;
  --glass: rgba(15, 23, 42, 0.92);
  --border: rgba(148, 163, 184, 0.35);
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.1);
  --accent-strong: rgba(34, 197, 94, 0.65);
  --accent-pink: #ec4899;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow-soft: 0 20px 45px rgba(0, 0, 0, 0.5);
}

/* Reset-ish */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0b1120 0, #020617 40%, #000 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background canvas & noise overlay */

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1600 800' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='noStitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

/* Layout helpers */

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
  position: relative;
}

.section-alt {
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.96), rgba(3, 7, 18, 0.96));
  backdrop-filter: blur(16px);
}

/* Header / Nav */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(3, 7, 18, 0.98), rgba(3, 7, 18, 0.7));
  border-bottom: 1px solid rgba(31, 41, 55, 0.8);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.logo-mark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--accent) 0, #166534 70%);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.8);
}

.logo-text {
  color: var(--muted);
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: 1.25rem;
  position: relative;
  transition: color 0.12s ease, transform 0.12s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--accent), var(--accent-pink));
  transition: width 0.16s ease;
}

.nav-links a:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Hero */

.hero-section {
  padding-top: 4.5rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr);
  gap: 2.5rem;
  align-items: center;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(75, 85, 99, 0.8);
  color: var(--muted);
  font-size: 0.75rem;
}

.hero-title {
  margin: 1.2rem 0 0.4rem;
  font-size: clamp(2.3rem, 4vw, 3rem);
  line-height: 1.1;
}

.hero-title span:last-child {
  color: var(--accent);
}

.hero-subtitle {
  max-width: 32rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.hero-sub-subtitle {
  max-width: 35rem;
  color: #cbd5f5;
  font-size: 0.95rem;
}

.accent {
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.14s ease;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-pink));
  color: #020617;
  box-shadow: 0 16px 40px rgba(34, 197, 94, 0.4);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 48px rgba(34, 197, 94, 0.55);
}

.btn.ghost {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--muted);
}

.btn.ghost:hover {
  color: var(--text);
  border-color: rgba(248, 250, 252, 0.8);
}

.btn.subtle {
  border-color: transparent;
  background: rgba(15, 23, 42, 0.6);
  color: var(--muted);
}

.btn.subtle:hover {
  color: var(--text);
}

/* Hero meta */

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-top: 1.8rem;
}

.meta-card {
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.9);
  padding: 0.7rem 0.9rem;
}

.meta-label {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.2rem;
}

.meta-value {
  margin: 0;
  font-size: 0.9rem;
}

/* Hero right */

.hero-right {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  align-items: center;
}

.photo-orb {
  position: relative;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, rgba(34, 197, 94, 0.4), rgba(15, 23, 42, 0.95));
  box-shadow: var(--shadow-soft);
  overflow: visible;
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  animation: spin 14s linear infinite;
}

.orb-ring-outer {
  width: 260px;
  height: 260px;
}

.orb-ring-inner {
  width: 210px;
  height: 210px;
  animation-direction: reverse;
  animation-duration: 18s;
}

.photo-wrapper {
  width: 170px;
  height: 170px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(34, 197, 94, 0.6);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
  width: 100%;
}

.hero-stat-card {
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(31, 41, 55, 0.9);
  padding: 0.8rem 0.9rem;
  font-size: 0.85rem;
}

.hero-stat-label {
  color: var(--muted);
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
}

.hero-stat-value {
  margin: 0 0 0.2rem;
  font-weight: 600;
}

.hero-stat-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Sections */

.section-header {
  margin-bottom: 1.8rem;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-header h2 {
  margin: 0.3rem 0 0.3rem;
  font-size: 1.6rem;
}

.section-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 32rem;
}

/* About */

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.1fr);
  gap: 2rem;
}

.about-main p {
  margin-top: 0;
  margin-bottom: 0.9rem;
  color: #e5e7eb;
}

.about-side {
  display: grid;
  gap: 1rem;
}

.about-card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: var(--radius-md);
  padding: 1rem 1rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.about-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.about-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.about-card ul li {
  margin-bottom: 0.3rem;
}

/* Skills */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.4rem;
}

.card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.1rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 1rem;
}

.card ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.card ul li {
  margin-bottom: 0.3rem;
}

.card pre {
  margin: 0;
}

.code-card .code-block {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
}

/* Code blocks */

.code-block {
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.1), rgba(15, 23, 42, 1));
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 0.7rem 0.8rem;
  color: #a5b4fc;
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* Projects */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}

.project-card .project-tag {
  display: inline-flex;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card h3 {
  margin-top: 0.8rem;
}

.project-card .project-goal {
  color: var(--muted);
  font-size: 0.9rem;
}

.project-card ul {
  font-size: 0.9rem;
  color: var(--muted);
}

.project-card li {
  margin-bottom: 0.3rem;
}

.tech {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #a5b4fc;
}

/* Research */

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}

/* Timeline */

.timeline {
  border-left: 2px solid rgba(55, 65, 81, 0.9);
  margin-top: 1.4rem;
  padding-left: 1.4rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.8rem;
}

.timeline-dot {
  position: absolute;
  left: -1.1rem;
  top: 0.2rem;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.4);
}

.timeline-content {
  padding: 0.3rem 0;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.2rem;
}

.timeline-content h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.timeline-content p {
  margin: 0 0 0.4rem;
  color: var(--muted);
}

.timeline-content ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Contact */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
  gap: 2rem;
  align-items: flex-start;
}

.contact-info p {
  margin: 0 0 0.3rem;
  color: var(--muted);
}

.contact-info a {
  color: #a5b4fc;
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.contact-form-wrapper h3 {
  margin-top: 0;
}

.contact-form {
  display: grid;
  gap: 0.7rem;
}

.form-row input,
.form-row textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.95);
  padding: 0.7rem 0.9rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  padding: 1.2rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Glitch effect */

.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  clip-path: inset(0 0 0 0);
}

.glitch::before {
  left: 1px;
  text-shadow: -2px 0 #22c55e;
  animation: glitch-1 2.5s infinite linear alternate-reverse;
}

.glitch::after {
  left: -1px;
  text-shadow: 2px 0 #ec4899;
  animation: glitch-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-1 {
  0% { clip-path: inset(0 0 85% 0); }
  20% { clip-path: inset(0 0 10% 0); }
  40% { clip-path: inset(30% 0 35% 0); }
  60% { clip-path: inset(60% 0 5% 0); }
  80% { clip-path: inset(10% 0 50% 0); }
  100% { clip-path: inset(0 0 80% 0); }
}

@keyframes glitch-2 {
  0% { clip-path: inset(80% 0 0 0); }
  20% { clip-path: inset(5% 0 55% 0); }
  40% { clip-path: inset(40% 0 20% 0); }
  60% { clip-path: inset(20% 0 60% 0); }
  80% { clip-path: inset(70% 0 5% 0); }
  100% { clip-path: inset(85% 0 0 0); }
}

/* Animations */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */

@media (max-width: 960px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hero-right {
    order: -1;
    margin-bottom: 1.4rem;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .site-header {
    border-bottom-color: transparent;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 3rem 0;
  }

  .hero-section {
    padding-top: 3.5rem;
  }

  .hero-title {
    font-size: 2rem;
  }
}
