:root {
  /* ── Core palette ── */
  --bg:          #000000;
  --surface:     #08080a;
  --surface-2:   #111114;
  --border:      #1a1a1f;
  --border-hover:#2a2a32;
  --primary:     #00f3ff;
  --primary-dim: rgba(0, 243, 255, 0.12);
  --primary-glow:rgba(0, 243, 255, 0.25);
  --accent:      #8b5cf6;
  --accent-dim:  rgba(139, 92, 246, 0.12);
  --text:        #f0f0f5;
  --text-dim:    #6b6b78;
  --text-muted:  #44444f;
  --success:     #22c55e;

  /* ── Typography ── */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* ── Spacing ── */
  --section-py:  clamp(5rem, 12vh, 8rem);
  --content-max: 1100px;

  /* ── Transitions ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color .2s, opacity .2s;
}
a:hover { opacity: .85; }

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

::selection {
  background: var(--primary);
  color: var(--bg);
}

/* ═══════════════════════════════════════════
   GRID BACKGROUND
   ═══════════════════════════════════════════ */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: .18;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 100%);
}

/* ═══════════════════════════════════════════
   GLOW ORB (ambient light)
   ═══════════════════════════════════════════ */
.glow-orb {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .07;
  pointer-events: none;
  z-index: 0;
  transition: transform 8s var(--ease-out);
}
.glow-orb--cyan  { background: var(--primary); top: -10%; left: 20%; }
.glow-orb--violet { background: var(--accent); bottom: -10%; right: 10%; }

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: .75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  background: rgba(0, 0, 0, .6);
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: transform .3s var(--ease-out), background .3s;
}
.nav.hidden { transform: translateY(-100%); }

.nav__logo {
  font-family: var(--font-mono);
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.nav__logo .dot {
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2.5s infinite;
}

.nav__links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav__links a {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  position: relative;
  padding-bottom: 2px;
}
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--primary);
  transition: width .3s var(--ease-out);
}
.nav__links a:hover { color: var(--text); opacity: 1; }
.nav__links a:hover::after { width: 100%; }

/* Mobile hamburger */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__burger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-dim);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.nav__burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile drawer */
.mobile-drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 98;
  opacity: 0;
  transition: opacity .3s;
}
.mobile-drawer-overlay.active { display: block; opacity: 1; }

.mobile-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(320px, 85vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 99;
  transform: translateX(100%);
  transition: transform .35s var(--ease-out);
  padding: 5rem 2rem 2rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.mobile-drawer.open { transform: translateX(0); }

.mobile-drawer a {
  display: block;
  padding: .9rem 0;
  font-size: 1rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  transition: color .2s, padding-left .2s;
}
.mobile-drawer a:hover {
  color: var(--primary);
  padding-left: .5rem;
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
}

/* ═══════════════════════════════════════════
   SECTION UTILITY
   ═══════════════════════════════════════════ */
.section {
  position: relative;
  z-index: 1;
  padding: var(--section-py) 1.5rem;
  max-width: var(--content-max);
  margin: 0 auto;
}

.section__label {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section__label::before {
  content: '//';
  color: var(--text-muted);
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -.02em;
}

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 0 1.5rem;
  max-width: var(--content-max);
  margin: 0 auto;
}

.hero__status {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 2.5rem;
}
.hero__status .dot {
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2.5s infinite;
}

.hero__name {
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 50%, var(--accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease infinite;
  margin-bottom: 1.5rem;
}

.hero__tagline {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--text-dim);
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: .8rem;
}

.hero__typing {
  font-family: var(--font-mono);
  font-size: clamp(.8rem, 1.5vw, .95rem);
  color: var(--primary);
  margin-bottom: 3rem;
  min-height: 1.5em;
}
.hero__typing .cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--primary);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.8rem;
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .5px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .25s var(--ease-out);
  border: none;
  text-decoration: none;
}
.btn--primary {
  background: var(--primary);
  color: var(--bg);
}
.btn--primary:hover {
  box-shadow: 0 0 24px var(--primary-glow);
  transform: translateY(-1px);
  opacity: 1;
}
.btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-2);
  opacity: 1;
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  color: var(--text-muted);
  font-size: .65rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: float 3s ease-in-out infinite;
}
.hero__scroll svg {
  width: 16px; height: 16px;
  stroke: var(--text-muted);
}

/* ═══════════════════════════════════════════
   ABOUT / METRICS
   ═══════════════════════════════════════════ */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.8rem 1.5rem;
  text-align: center;
  transition: border-color .3s, transform .3s var(--ease-out);
}
.metric-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}
.metric-card__value {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.metric-card__label {
  font-size: .78rem;
  color: var(--text-dim);
  margin-top: .4rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

.about__text {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 700px;
  line-height: 1.8;
}
.about__text strong {
  color: var(--text);
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   PROJECTS BENTO GRID
   ═══════════════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.project-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.8rem;
  overflow: hidden;
  transition: border-color .3s, transform .3s var(--ease-out), box-shadow .3s;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, var(--primary-dim) 50%, var(--accent-dim) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.project-card:hover {
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}
.project-card:hover::before { opacity: 1; }

.project-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.project-card__badge {
  font-family: var(--font-mono);
  font-size: .65rem;
  padding: .25rem .6rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.project-card__badge--live {
  background: rgba(34, 197, 94, .1);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, .2);
}
.project-card__badge--live .dot {
  width: 5px; height: 5px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.project-card__domain {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-muted);
}

.project-card__name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.project-card__desc {
  font-size: .88rem;
  color: var(--text-dim);
  line-height: 1.6;
  flex: 1;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
}
.project-card__tag {
  font-family: var(--font-mono);
  font-size: .65rem;
  padding: .2rem .55rem;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--primary);
  margin-top: .5rem;
  transition: gap .2s;
}
.project-card__link:hover { gap: .7rem; opacity: 1; }
.project-card__link svg { width: 14px; height: 14px; }

/* ═══════════════════════════════════════════
   TECH STACK
   ═══════════════════════════════════════════ */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

.stack-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.3rem;
  text-align: center;
  transition: border-color .3s, transform .3s var(--ease-out);
}
.stack-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.stack-item__icon {
  font-size: 1.8rem;
  margin-bottom: .5rem;
}
.stack-item__name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}
.stack-item__role {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: .2rem;
  font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════ */
.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 3rem;
  text-align: center;
  margin-top: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.contact-box__email {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--primary);
  margin: 1.5rem 0;
  word-break: break-all;
}

.contact-box__desc {
  color: var(--text-dim);
  font-size: .92rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.contact-box__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface-2);
  border: 1px solid var(--success);
  color: var(--success);
  font-family: var(--font-mono);
  font-size: .8rem;
  padding: .6rem 1.2rem;
  border-radius: 8px;
  z-index: 200;
  opacity: 0;
  transition: transform .4s var(--ease-out), opacity .4s;
  pointer-events: none;
}
.copy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  border-top: 1px solid var(--border);
}
.footer__text {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.footer__text span { color: var(--primary); }

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

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

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

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

/* Fade-in on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .hero__name {
    font-size: clamp(2.8rem, 14vw, 5rem);
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-box {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .metrics {
    grid-template-columns: 1fr;
  }
  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero__cta {
    flex-direction: column;
  }
  .btn { width: 100%; justify-content: center; }
}

@media (max-width: 320px) {
  html { font-size: 14px; }
  .hero__name { font-size: 2.4rem; }
  .section { padding-left: 1rem; padding-right: 1rem; }
}
