/* ═══════════════════════════════════════════════════
   DESIGN SYSTEM — Dark Space Theme
   ═══════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  /* Colors */
  --bg-primary: #0a0a1a;
  --bg-secondary: #0f0f2a;
  --bg-card: rgba(15, 15, 42, 0.6);
  --bg-nav: rgba(10, 10, 26, 0.85);

  --text-primary: #e4e4f0;
  --text-secondary: #9494b8;
  --text-muted: #6a6a8e;

  --accent: #00d4ff;
  --accent-rgb: 0, 212, 255;
  --violet: #7c3aed;
  --violet-rgb: 124, 58, 237;
  --green: #22c55e;
  --yellow: #facc15;
  --red: #ef4444;

  --gradient-hero: linear-gradient(
    135deg,
    #0a0a1a 0%,
    #1a1a3e 50%,
    #0a0a1a 100%
  );
  --gradient-text: linear-gradient(135deg, var(--accent), var(--violet));
  --gradient-card: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.08),
    rgba(124, 58, 237, 0.08)
  );

  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-bg: rgba(255, 255, 255, 0.03);

  /* Spacing */
  --section-gap: 8rem;
  --container-max: 1200px;

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 0.3s var(--ease-out);

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--violet);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

::selection {
  background: rgba(var(--accent-rgb), 0.3);
  color: #fff;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.5);
}

/* ── Utilities ── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ═══════════════════════════════════════════════════
   PARTICLE CANVAS (behind everything)
   ═══════════════════════════════════════════════════ */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition:
    background var(--transition),
    box-shadow var(--transition),
    padding var(--transition);
}

.navbar.scrolled {
  background: var(--bg-nav);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 var(--glass-border);
  padding: 0.6rem 0;
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary) !important;
  letter-spacing: -0.5px;
}

.logo-bracket {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary) !important;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-text);
  border-radius: 1px;
  transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent) !important;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ═══════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════ */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem 4rem;
  background: var(--gradient-hero);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 30% 50%,
      rgba(var(--accent-rgb), 0.06) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 70% 50%,
      rgba(var(--violet-rgb), 0.06) 0%,
      transparent 60%
    );
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 600px;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 1px;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.typed-prefix {
  color: var(--text-muted);
}

.typed-cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent);
  font-weight: 300;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-description {
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
  max-width: 520px;
}

/* Hero Buttons */
.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--gradient-text);
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.35);
  color: #fff !important;
}

.btn-ghost {
  background: var(--glass-bg);
  color: var(--text-primary) !important;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.3);
  color: var(--accent) !important;
  transform: translateY(-2px);
}

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: 2.5rem;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-suffix {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.2rem;
}

/* Hero Code Window */
.hero-visual {
  position: relative;
  flex-shrink: 0;
}

.code-window {
  background: rgba(15, 15, 42, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  width: 380px;
  max-width: 100%;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--glass-border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red {
  background: var(--red);
}
.dot.yellow {
  background: var(--yellow);
}
.dot.green {
  background: var(--green);
}

.code-title {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.code-body {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.8;
  overflow-x: auto;
}

.code-body .kw {
  color: #c678dd;
}
.code-body .type {
  color: #e5c07b;
}
.code-body .prop {
  color: #61afef;
}
.code-body .str {
  color: #98c379;
}
.code-body .var {
  color: #e06c75;
}

/* ═══════════════════════════════════════════════════
   SECTION — Shared
   ═══════════════════════════════════════════════════ */
.section {
  position: relative;
  z-index: 1;
  padding: var(--section-gap) 0;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--glass-border), transparent);
  margin-left: 1rem;
}

/* ═══════════════════════════════════════════════════
   ABOUT
   ═══════════════════════════════════════════════════ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-size: 0.98rem;
}

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

.highlight-card {
  padding: 1.25rem;
  background: var(--gradient-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.highlight-card:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.08);
}

.highlight-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.highlight-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.highlight-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   SKILLS
   ═══════════════════════════════════════════════════ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.skill-category {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  transition: all var(--transition);
}

.skill-category:hover {
  border-color: rgba(var(--accent-rgb), 0.25);
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.06);
}

.skill-category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.skill-icon {
  font-size: 1.5rem;
}

.skill-category-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(var(--accent-rgb), 0.06);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 999px;
  transition: all var(--transition);
  cursor: default;
}

.skill-tag:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.3);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  position: relative;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  transition: all var(--transition);
  overflow: hidden;
}

.project-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-text);
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card:hover {
  border-color: rgba(var(--accent-rgb), 0.2);
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.project-card:hover .project-card-glow {
  opacity: 1;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.project-icon {
  color: var(--accent);
}

.project-links a {
  color: var(--text-muted) !important;
  transition: color var(--transition);
}

.project-links a:hover {
  color: var(--accent) !important;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.project-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tech span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  background: rgba(var(--violet-rgb), 0.08);
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════
   EXPERIENCE / TIMELINE
   ═══════════════════════════════════════════════════ */
.timeline {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--accent),
    var(--violet),
    transparent
  );
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-bottom: 3rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 3px solid var(--bg-primary);
  border-radius: 50%;
  transform: translateX(-5px);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5);
}

.timeline-content {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.timeline-content:hover {
  border-color: rgba(var(--accent-rgb), 0.2);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.timeline-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.timeline-company {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.timeline-tasks {
  padding-left: 1.2rem;
}

.timeline-tasks li {
  position: relative;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
  list-style: disc;
}

.timeline-tasks li::marker {
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════════════ */
.contact {
  text-align: center;
}

.contact-content {
  max-width: 550px;
  margin: 0 auto;
}

.contact-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary) !important;
  font-size: 0.95rem;
  transition: all var(--transition);
  min-width: 280px;
  justify-content: center;
}

.contact-link svg {
  flex-shrink: 0;
  color: var(--accent);
  stroke: var(--accent);
}

.contact-link:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.05);
  color: var(--accent) !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(var(--accent-rgb), 0.1);
}

/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer strong {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-sub {
  margin-top: 0.3rem;
  font-size: 0.78rem;
}

/* ═══════════════════════════════════════════════════
   REVEAL ANIMATIONS
   ═══════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
}

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

/* Hero staggered */
.animate-fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.7s var(--ease-out) forwards;
}

.delay-1 {
  animation-delay: 0.15s;
}
.delay-2 {
  animation-delay: 0.3s;
}
.delay-3 {
  animation-delay: 0.45s;
}
.delay-4 {
  animation-delay: 0.6s;
}
.delay-5 {
  animation-delay: 0.75s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-description {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-title {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  :root {
    --section-gap: 5rem;
  }

  /* Mobile nav */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right var(--transition);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-link {
    font-size: 1.1rem;
  }

  /* Grids -> single column */
  .about-grid,
  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

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

  .code-window {
    width: 100%;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .contact-link {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-stats {
    gap: 1.5rem;
  }

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

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    justify-content: center;
  }
}
