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

:root {
  --bg:        #080c14;
  --surface:   #0d1220;
  --glass:     rgba(13,18,32,0.7);
  --cyan:      #00d4ff;
  --purple:    #7c3aed;
  --pink:      #f472b6;
  --text:      #e2e8f0;
  --muted:     #64748b;
  --border:    rgba(0,212,255,0.15);
  --glow:      0 0 30px rgba(0,212,255,0.25);
  --glow-lg:   0 0 60px rgba(0,212,255,0.35);
}

html { scroll-behavior: smooth; }

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

::selection { background: rgba(0,212,255,0.3); color: #fff; }

/* ─── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 3px; }

/* ─── Canvas Background ──────────────────────────────────────────────── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ─── Noise overlay ─────────────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}

/* ─── Layout helpers ────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; position: relative; z-index: 2; }
section { position: relative; z-index: 2; }

/* ─── NAV ────────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px);
  background: rgba(8,12,20,0.6);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.3s;
  position: relative;
}

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

.nav-links a:hover { color: var(--cyan); }
.nav-links a:hover::after { width: 100%; }

/* ─── HERO ────────────────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 0 4rem;
}

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

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
  animation: fadeSlideUp 0.8s ease both;
}

.hero-eyebrow .dot {
  width: 6px; height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.05;
  margin-bottom: 1rem;
  animation: fadeSlideUp 0.8s 0.15s ease both;
}

.hero-name span {
  display: block;
  background: linear-gradient(135deg, #fff 0%, var(--cyan) 50%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: shimmer 4s linear infinite;
}

.hero-roles {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  color: var(--muted);
  margin-bottom: 1.5rem;
  min-height: 2.4rem;
  animation: fadeSlideUp 0.8s 0.3s ease both;
}

.hero-roles .typed { color: var(--cyan); font-weight: 600; }
.cursor {
  display: inline-block;
  width: 3px;
  height: 1.2em;
  background: var(--cyan);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 550px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  animation: fadeSlideUp 0.8s 0.45s ease both;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeSlideUp 0.8s 0.6s ease both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,212,255,0.3);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0,212,255,0.06);
  transform: translateY(-2px);
}

/* scroll indicator */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: fadeSlideUp 1s 1s ease both;
}

.scroll-hint .mouse {
  width: 22px; height: 36px;
  border: 2px solid var(--muted);
  border-radius: 11px;
  display: flex;
  justify-content: center;
  padding-top: 5px;
}

.scroll-hint .wheel {
  width: 3px; height: 7px;
  background: var(--cyan);
  border-radius: 2px;
  animation: scrollWheel 1.5s ease infinite;
}

/* ─── SECTION HEADING ───────────────────────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 1rem;
}

.section-title span {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-desc {
  color: var(--muted);
  max-width: 520px;
  font-size: 1rem;
  line-height: 1.8;
}

.section-header { margin-bottom: 3.5rem; }

/* ─── SERVICES ──────────────────────────────────────────────────────── */
#services { padding: 6rem 0; }

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

.service-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  backdrop-filter: blur(16px);
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
}

.service-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.4s, border-color 0.4s;
}

.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,212,255,0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

.service-card:hover { border-color: rgba(0,212,255,0.4); box-shadow: var(--glow); }
.service-card:hover::before { opacity: 1; }

.service-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.service-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.service-card p { color: var(--muted); font-size: 0.95rem; line-height: 1.7; }

/* ─── TECH STACK ────────────────────────────────────────────────────── */
#stack { padding: 6rem 0; }

.stack-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 2rem;
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.18);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: default;
  transition: all 0.3s;
  opacity: 0;
  transform: scale(0.85);
}

.tag.visible {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.tag:hover {
  background: rgba(0,212,255,0.14);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(0,212,255,0.2);
  transform: translateY(-2px) scale(1.04);
}

.tag .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
}

/* ─── PROJECTS ──────────────────────────────────────────────────────── */
#projects { padding: 6rem 0; }

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

.project-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.75rem;
  backdrop-filter: blur(16px);
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.4s, border-color 0.4s;
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.project-card:hover { border-color: rgba(124,58,237,0.4); box-shadow: 0 0 30px rgba(124,58,237,0.2); }
.project-card:hover::after { transform: scaleX(1); }

.project-number {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--purple);
  margin-bottom: 0.75rem;
}

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text);
  line-height: 1.3;
}

.project-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.7; }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.2rem;
}

.project-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.7rem;
  border-radius: 2rem;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  color: #a78bfa;
}

/* ─── CONTACT ────────────────────────────────────────────────────────── */
#contact { padding: 6rem 0 8rem; }

.contact-box {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 4rem;
  backdrop-filter: blur(20px);
  text-align: center;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.contact-box.visible { opacity: 1; transform: translateY(0); }

.contact-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,212,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.contact-box h2 { font-size: clamp(1.8rem,4vw,2.6rem); font-weight: 800; margin-bottom: 1rem; }

.contact-box p { color: var(--muted); max-width: 480px; margin: 0 auto 2.5rem; line-height: 1.8; }

.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--cyan);
  text-decoration: none;
  padding: 1rem 2rem;
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: 0.75rem;
  background: rgba(0,212,255,0.06);
  transition: all 0.3s;
}

.contact-mail:hover { background: rgba(0,212,255,0.12); box-shadow: var(--glow); transform: translateY(-2px); }

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

footer strong { color: var(--cyan); }

/* ─── DIVIDER ─────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0;
}

/* ─── Animations ─────────────────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.6; }
}

@keyframes scrollWheel {
  0%   { transform: translateY(0); opacity: 1; }
  80%  { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  nav { padding: 1rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.8rem; }
  .contact-box { padding: 2.5rem 1.5rem; }
}

@media (max-width: 480px) {
  .nav-links { display: none; }
}
