:root {
  --bg: #050814;
  --panel: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e6ecff;
  --muted: #a6b2d6;
  --accent: #6ef0c2;
  --accent-2: #7a8cff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --blur: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

body[data-reduced-motion="true"] * {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0ms !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
  }
}

h1, h2, h3, h4 {
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

ul {
  padding-left: 1rem;
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

button {
  font-family: inherit;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: #0b1224;
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: top 0.2s ease;
  z-index: 1000;
}

.skip-link:focus {
  top: 16px;
}

.backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.gradient {
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
}

.gradient-primary {
  background: radial-gradient(circle at 30% 30%, rgba(110, 240, 194, 0.3), transparent 55%);
  top: -15%;
  left: -10%;
}

.gradient-secondary {
  background: radial-gradient(circle at 70% 60%, rgba(122, 140, 255, 0.35), transparent 60%);
  bottom: -20%;
  right: -10%;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 140px 140px;
  mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.8), transparent 70%);
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 240, 194, 0.45), transparent);
  animation: scan 8s linear infinite;
  opacity: 0.4;
}

@keyframes scan {
  0% { top: 0; }
  50% { top: 80%; }
  100% { top: 0; }
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: rgba(5, 8, 20, 0.9);
  backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6ef0c2, #7a8cff);
  box-shadow: 0 10px 30px rgba(110, 240, 194, 0.4);
}

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

.nav-link {
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: color 0.2s ease, background 0.2s ease, border 0.2s ease;
}

.nav-link.active {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.nav-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-actions .ghost-btn {
  display: inline-flex;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
}

.section {
  position: relative;
  z-index: 1;
  padding: 5rem 1.5rem;
}

.section-header {
  max-width: 900px;
  margin: 0 auto 2rem auto;
}

.section-sub {
  margin-top: -0.5rem;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  align-items: center;
  padding-top: 6rem;
}

.hero-content {
  max-width: 640px;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
}

.lead {
  font-size: 1.15rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(120deg, rgba(110, 240, 194, 0.2), rgba(122, 140, 255, 0.2));
  border-color: rgba(110, 240, 194, 0.35);
  box-shadow: 0 16px 40px rgba(110, 240, 194, 0.25);
}

.btn.ghost {
  background: transparent;
}

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

.ghost-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
}

.signal {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.signal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.hero-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur));
}

.panel-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.panel-value {
  color: var(--text);
  margin: 0;
}

.hero-visual {
  position: relative;
  min-height: 320px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(110, 240, 194, 0.07), rgba(122, 140, 255, 0.07));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.orb {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.8;
}

.orb-left { background: rgba(110, 240, 194, 0.35); top: 10%; left: -5%; }
.orb-right { background: rgba(122, 140, 255, 0.35); bottom: 5%; right: -10%; }

.ai-threads {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  opacity: 0.5;
}

.ai-threads span {
  display: block;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(110, 240, 194, 0.5), transparent);
  animation: pulse 6s ease-in-out infinite;
}

.ai-threads span:nth-child(odd) { animation-delay: 1s; }

@keyframes pulse {
  0%, 100% { transform: translateY(-4%); opacity: 0.6; }
  50% { transform: translateY(4%); opacity: 1; }
}

.floating-card {
  position: absolute;
  bottom: 18px;
  right: 18px;
  background: rgba(5, 8, 20, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
}

.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.pill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-list li,
.pill-list span {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-height: 200px;
}

.card-title {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-body {
  margin: 0;
}

.projects .section-sub {
  color: var(--muted);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.project-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-card .project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-card .project-tags span {
  font-size: 0.9rem;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  background: rgba(110, 240, 194, 0.08);
  border: 1px solid var(--border);
}

.pill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.timeline {
  position: relative;
  padding-left: 1rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(110, 240, 194, 0.35), transparent);
}

.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.timeline-marker {
  position: absolute;
  left: -3px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(110, 240, 194, 0.7);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  background: rgba(5, 8, 20, 0.9);
  position: relative;
  z-index: 1;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal.hidden { display: none; }

.modal-content {
  background: rgba(5, 8, 20, 0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  backdrop-filter: blur(var(--blur));
}

.modal .close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.modal-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.terminal {
  background: #060b16;
}

.terminal-output {
  min-height: 160px;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  font-family: 'Space Grotesk', monospace;
}

.terminal-line {
  margin: 0;
  color: var(--text);
}

.terminal-input {
  display: flex;
  gap: 0.65rem;
  margin-top: 1rem;
}

.terminal-input input {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-links a:focus-visible,
.btn:focus-visible,
.ghost-btn:focus-visible,
.nav-toggle:focus-visible,
.modal .close:focus-visible,
.terminal-input input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.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;
}

@media (max-width: 900px) {
  .top-nav {
    flex-wrap: wrap;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: rgba(5, 8, 20, 0.95);
    padding: 0.75rem 0;
    border-radius: 12px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-actions .ghost-btn {
    display: inline-flex;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .nav-toggle {
    display: inline-flex;
  }

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

@media (max-width: 600px) {
  .section {
    padding: 4rem 1rem;
  }

  .hero-cta {
    flex-direction: column;
  }

  .signal {
    width: 100%;
  }
}
