/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0f;
  --bg-card: #0f0f1a;
  --bg-card-hover: #141428;
  --accent: #00d4ff;
  --accent-dim: rgba(0, 212, 255, 0.15);
  --accent-glow: rgba(0, 212, 255, 0.4);
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --border: rgba(0, 212, 255, 0.12);
  --border-hover: rgba(0, 212, 255, 0.35);
  --gradient-hero: linear-gradient(180deg, transparent 0%, rgba(10,10,15,0.85) 60%, #0a0a0f 100%);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ===== CANVAS (Three.js) ===== */
#hero-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 3rem;
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 212, 255, 0.06);
  transition: all 0.3s ease;
}

nav.scrolled {
  background: rgba(10, 10, 15, 0.92);
  border-bottom-color: var(--border);
}

.nav-logo {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-logo span {
  color: var(--text-muted);
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s ease;
  position: relative;
}

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

.nav-links a:hover {
  color: var(--accent);
}

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

.nav-cta {
  padding: 0.5rem 1.2rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent) !important;
  border-radius: 4px;
  transition: all 0.2s ease !important;
}

.nav-cta::after { display: none !important; }

.nav-cta:hover {
  background: var(--accent-dim) !important;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ===== HERO ===== */
#hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 2rem;
  max-width: 900px;
}

.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
}

#hero-name {
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 1.5rem;
  min-height: 1em;
}

#hero-name .cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  box-shadow: 0 0 12px var(--accent), 0 0 24px var(--accent-glow);
  animation: blink 1.1s step-end infinite;
}

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

.hero-tagline {
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  line-height: 1.5;
  opacity: 0;
  margin-bottom: 2.5rem;
}

.hero-tagline span {
  color: var(--text-dim);
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  background: var(--accent);
  color: #0a0a0f;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px rgba(0, 212, 255, 0.5);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
}

.scroll-indicator span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

/* ===== SECTIONS ===== */
section {
  position: relative;
  z-index: 2;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 600px;
  line-height: 1.7;
}

/* ===== ABOUT ===== */
#about {
  background: linear-gradient(180deg, var(--bg) 0%, #0c0c16 50%, var(--bg) 100%);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-top: 3rem;
}

.about-text p {
  color: var(--text-dim);
  line-height: 1.85;
  font-size: 1.05rem;
}

.about-text p + p {
  margin-top: 1.25rem;
}

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

.about-terminal {
  background: #0c0c1a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  position: relative;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

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

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-left: 0.5rem;
}

.terminal-line {
  display: flex;
  gap: 0.75rem;
}

.t-prompt { color: var(--accent); }
.t-cmd { color: #e2e8f0; }
.t-comment { color: var(--text-muted); }
.t-out { color: #a3e635; margin-left: 1.5rem; display: block; }
.t-out-dim { color: var(--text-muted); margin-left: 1.5rem; display: block; }

/* ===== PROJECTS ===== */
#projects {
  background: var(--bg);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 20px 60px rgba(0, 212, 255, 0.08), 0 0 0 1px rgba(0, 212, 255, 0.1);
}

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

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.card-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s;
  font-family: 'JetBrains Mono', monospace;
}

.card-link:hover { color: var(--accent); }

.card-link svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}

.card-link:hover svg {
  transform: translate(2px, -2px);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

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

.tag {
  padding: 0.2rem 0.6rem;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 3px;
  color: var(--accent);
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: all 0.2s;
}

.project-card:hover .tag {
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.25);
}

/* ===== CLIENTS ===== */
#clients {
  background: linear-gradient(180deg, var(--bg) 0%, #0c0c16 100%);
}

.clients-intro {
  max-width: 600px;
  margin-bottom: 3rem;
}

.clients-intro p {
  color: var(--text-muted);
  line-height: 1.7;
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.client-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.06);
}

.client-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.client-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== TECH STACK ===== */
#stack {
  background: var(--bg);
}

.stack-categories {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.stack-category-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stack-category-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.stack-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.stack-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
  transform: translateY(-2px);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
  flex-shrink: 0;
}

/* ===== CONTACT ===== */
#contact {
  background: linear-gradient(180deg, var(--bg) 0%, #0a0a14 100%);
  border-top: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  margin-top: 3rem;
}

.contact-items {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.contact-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.08);
}

.contact-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 1rem;
}

.contact-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.15rem;
}

.contact-value {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
}

.contact-note {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.contact-note strong {
  color: var(--accent);
  font-weight: 600;
}

/* ===== FOOTER ===== */
footer {
  position: relative;
  z-index: 2;
  background: var(--bg);
  border-top: 1px solid rgba(0, 212, 255, 0.06);
  padding: 2rem;
  text-align: center;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

/* ===== REVEAL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  nav {
    padding: 1rem 1.5rem;
  }

  .nav-links {
    display: none;
  }
}

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

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

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

  nav {
    padding: 1rem;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: center;
  }
}

/* ===== SELECTION ===== */
::selection {
  background: rgba(0, 212, 255, 0.25);
  color: white;
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  max-width: 1100px;
  margin: 0 auto;
}
