:root {
  --bg: #05060a;
  --bg-2: #0a0d16;
  --ink: #e9edf6;
  --muted: #8b93a7;
  --cyan: #00f0ff;
  --violet: #8b5cf6;
  --magenta: #ff2d92;
  --line: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.03);
  --max: 1100px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- BACKGROUND LAYERS ---------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  pointer-events: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(50% 50% at 90% 10%, rgba(0, 240, 255, 0.12), transparent 60%),
    radial-gradient(60% 60% at 50% 110%, rgba(255, 45, 146, 0.10), transparent 60%);
  pointer-events: none;
}

.scanline {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 3px
  );
  opacity: 0.35;
  mix-blend-mode: overlay;
}

/* ---------- NAV ---------- */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 5vw, 3rem);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: rgba(5, 6, 10, 0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--cyan);
  font-size: 1rem;
  text-shadow: 0 0 18px rgba(0, 240, 255, 0.5);
}
.nav-links { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.nav-links a {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: color 0.25s;
  position: relative;
}
.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--cyan);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
  border: 1px solid var(--line);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  color: var(--ink) !important;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.nav-cta:hover {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.25);
}
.nav-links a:nth-child(1), .nav-links a:nth-child(2), .nav-links a:nth-child(3) { display: inline-block; }
@media (max-width: 560px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ---------- HERO ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem clamp(1.2rem, 5vw, 3rem) 4rem;
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
}
.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.6rem;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.title {
  font-size: clamp(3.2rem, 13vw, 9rem);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1.4rem;
}
.title .line { display: block; }
.title .line:first-child {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(233, 237, 246, 0.55);
}
.title .line:last-child {
  background: linear-gradient(110deg, var(--cyan), var(--violet) 55%, var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.role {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.95rem, 2.6vw, 1.35rem);
  color: var(--cyan);
  margin-bottom: 1.6rem;
  min-height: 1.6em;
}
.caret { animation: blink 1s steps(1) infinite; color: var(--cyan); }
@keyframes blink { 50% { opacity: 0; } }
.lede {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.18rem);
  margin-bottom: 2.4rem;
}
.lede strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 3.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: transform 0.25s var(--ease), box-shadow 0.3s, background 0.3s, border-color 0.3s;
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(110deg, var(--cyan), var(--violet));
  color: #05060a;
  font-weight: 600;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.25);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 40px rgba(0, 240, 255, 0.45); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: rgba(0, 240, 255, 0.5); transform: translateY(-3px); box-shadow: 0 0 24px rgba(0, 240, 255, 0.18); }

.stats { display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 5vw, 3.5rem); }
.stat { display: flex; flex-direction: column; }
.stat .num {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 500;
  background: linear-gradient(110deg, var(--ink), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.stat .lbl { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; }

.scroll-hint {
  position: absolute;
  bottom: 1.8rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  writing-mode: vertical-rl;
  animation: float 2.4s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* ---------- SECTIONS ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) clamp(1.2rem, 5vw, 3rem);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
}
.section-index {
  font-family: "JetBrains Mono", monospace;
  color: var(--cyan);
  font-size: 0.9rem;
  opacity: 0.8;
}
.section-head h2 {
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* reveal animation */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.5rem; }
.about-copy p { color: var(--muted); margin-bottom: 1.2rem; font-size: 1.05rem; }
.about-copy strong { color: var(--ink); }
.about-target { color: var(--ink) !important; }
.about-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.6rem;
  background: var(--glass);
  backdrop-filter: blur(8px);
  height: fit-content;
}
.card-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.card-row:last-child { border-bottom: none; }
.card-row span:first-child { color: var(--muted); }
.online { color: var(--cyan); display: inline-flex; align-items: center; gap: 0.4rem; }
.online::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2s infinite;
}
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }

/* TIMELINE */
.timeline { list-style: none; position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(var(--cyan), var(--violet), transparent);
}
.t-item { position: relative; padding: 0 0 2.6rem 1.8rem; }
.t-item:last-child { padding-bottom: 0; }
.t-dot {
  position: absolute;
  left: -1.5rem; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.6);
}
.t-when {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  color: var(--cyan);
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}
.t-body h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.15rem; }
.t-org { color: var(--violet); font-weight: 500; font-size: 0.95rem; margin-bottom: 0.5rem; }
.t-body p:last-child { color: var(--muted); font-size: 0.98rem; }
.t-body strong { color: var(--ink); }

/* SKILLS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}
.skill {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem;
  background: var(--glass);
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}
.skill::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(0, 240, 255, 0.12), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s;
}
.skill:hover { transform: translateY(-5px); border-color: rgba(0, 240, 255, 0.35); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4); }
.skill:hover::before { opacity: 1; }
.skill-ico {
  font-size: 1.5rem;
  color: var(--cyan);
  display: block;
  margin-bottom: 0.9rem;
  text-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
}
.skill h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; position: relative; }
.skill p { color: var(--muted); font-size: 0.92rem; position: relative; }

/* CONTACT */
.contact-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(139, 92, 246, 0.12), transparent 60%),
    var(--glass);
  backdrop-filter: blur(10px);
}
.contact-card .eyebrow { justify-content: center; }
.contact-card h2 { font-size: clamp(1.8rem, 6vw, 3.2rem); font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.8rem; }
.contact-lede { color: var(--muted); font-size: 1.1rem; margin-bottom: 2rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* FOOTER */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem clamp(1.2rem, 5vw, 3rem) 3.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-family: "JetBrains Mono", monospace;
}
.footer-mark { color: var(--cyan); }

/* GLITCH */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  background: var(--bg);
  overflow: hidden;
  clip-path: inset(0 0 0 0);
}
.glitch::before { left: 2px; text-shadow: -2px 0 var(--magenta); animation: glitch-a 3.5s infinite linear alternate-reverse; }
.glitch::after { left: -2px; text-shadow: -2px 0 var(--cyan); animation: glitch-b 2.8s infinite linear alternate-reverse; }
@keyframes glitch-a {
  0%, 92%, 100% { clip-path: inset(0 0 100% 0); }
  93% { clip-path: inset(20% 0 50% 0); }
  95% { clip-path: inset(60% 0 10% 0); }
}
@keyframes glitch-b {
  0%, 90%, 100% { clip-path: inset(100% 0 0 0); }
  91% { clip-path: inset(40% 0 40% 0); }
  94% { clip-path: inset(10% 0 70% 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
