/* ─── Base Reset ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: #08090F;
  color: #E8EAF0;
  font-family: 'Montserrat', sans-serif;
  overflow-x: hidden;
}

/* ─── Scanline Overlay ───────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.06) 2px,
    rgba(0,0,0,0.06) 4px
  );
}

/* ─── Noise Grain ────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.03;
  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)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ─── Background Radial Atmospherics ─────────── */
.bg-atmos {
  background:
    radial-gradient(ellipse 60% 50% at 10% 20%, rgba(77,217,204,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(255,45,122,0.05) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 50% 50%, rgba(255,92,53,0.03) 0%, transparent 80%),
    #08090F;
}

/* ─── Circuit Grid Pattern ───────────────────── */
.circuit-bg {
  background-image:
    linear-gradient(rgba(77,217,204,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77,217,204,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ─── Glitch Effect ──────────────────────────── */
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
}
.glitch:hover::before {
  animation: glitch-a 0.3s steps(2) forwards;
  color: #FF2D7A;
  clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
  transform: translateX(-3px);
  opacity: 1;
}
.glitch:hover::after {
  animation: glitch-b 0.3s steps(2) 0.1s forwards;
  color: #4DD9CC;
  clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
  transform: translateX(3px);
  opacity: 1;
}
@keyframes glitch-a {
  0%   { transform: translateX(-3px) scaleY(1); }
  50%  { transform: translateX(3px) scaleY(1.02); }
  100% { transform: translateX(-1px) scaleY(1); }
}
@keyframes glitch-b {
  0%   { transform: translateX(3px) scaleY(1); }
  50%  { transform: translateX(-3px) scaleY(0.98); }
  100% { transform: translateX(1px) scaleY(1); }
}

/* ─── Blinking Cursor ────────────────────────── */
.cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: #4DD9CC;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ─── Neon Glow Utilities ────────────────────── */
.glow-cyan   { text-shadow: 0 0 8px rgba(77,217,204,0.7), 0 0 20px rgba(77,217,204,0.4); }
.glow-magenta{ text-shadow: 0 0 8px rgba(255,45,122,0.7),  0 0 20px rgba(255,45,122,0.4); }
.glow-orange { text-shadow: 0 0 8px rgba(255,92,53,0.7),   0 0 20px rgba(255,92,53,0.4); }

.border-glow-cyan {
  box-shadow: 0 0 0 1px rgba(77,217,204,0.3), 0 0 12px rgba(77,217,204,0.12), inset 0 0 12px rgba(77,217,204,0.04);
}
.border-glow-magenta {
  box-shadow: 0 0 0 1px rgba(255,45,122,0.3), 0 0 12px rgba(255,45,122,0.12), inset 0 0 12px rgba(255,45,122,0.04);
}
.border-glow-orange {
  box-shadow: 0 0 0 1px rgba(255,92,53,0.3), 0 0 12px rgba(255,92,53,0.12), inset 0 0 12px rgba(255,92,53,0.04);
}

/* ─── Card Base ──────────────────────────────── */
.card {
  background: #111228;
  border: 1px solid #1A1E3A;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.25s cubic-bezier(0.34,1.56,0.64,1),
              border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
}
.card.hover-cyan:hover    { border-color: rgba(77,217,204,0.5); box-shadow: 0 8px 32px rgba(77,217,204,0.1), 0 0 0 1px rgba(77,217,204,0.2); }
.card.hover-magenta:hover { border-color: rgba(255,45,122,0.5); box-shadow: 0 8px 32px rgba(255,45,122,0.1), 0 0 0 1px rgba(255,45,122,0.2); }
.card.hover-orange:hover  { border-color: rgba(255,92,53,0.5);  box-shadow: 0 8px 32px rgba(255,92,53,0.1),  0 0 0 1px rgba(255,92,53,0.2); }

/* ─── Nav Link ───────────────────────────────── */
.nav-link {
  position: relative;
  color: #6B7299;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -3px;
  height: 1px; width: 0;
  background: #4DD9CC;
  box-shadow: 0 0 6px #4DD9CC;
  transition: width 0.2s ease;
}
.nav-link:hover { color: #E8EAF0; }
.nav-link:hover::after { width: 100%; }

/* ─── Skill Bar ──────────────────────────────── */
.skill-bar-fill {
  height: 100%;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.skill-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  animation: shimmer 2.5s ease infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ─── Terminal Block ─────────────────────────── */
.terminal {
  background: #08090F;
  border: 1px solid #1A1E3A;
  border-radius: 6px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.78rem;
  position: relative;
}
.terminal-bar {
  background: #0D0E1C;
  border-bottom: 1px solid #1A1E3A;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px 6px 0 0;
}
.terminal-dot {
  width: 10px; height: 10px; border-radius: 50%;
}

/* ─── Button ─────────────────────────────────── */
.btn-cyan {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #08090F;
  background: #4DD9CC;
  border: none;
  padding: 12px 28px;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.15s ease;
  box-shadow: 0 0 20px rgba(77,217,204,0.3);
}
.btn-cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 28px rgba(77,217,204,0.5);
}
.btn-cyan:active { transform: translateY(0); }

.btn-outline {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4DD9CC;
  background: transparent;
  border: 1px solid rgba(77,217,204,0.5);
  padding: 11px 28px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1),
              background 0.15s ease,
              box-shadow 0.15s ease;
}
.btn-outline:hover {
  background: rgba(77,217,204,0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(77,217,204,0.2);
}

/* ─── Section Label ──────────────────────────── */
.section-label {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #4DD9CC;
}

/* ─── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #08090F; }
::-webkit-scrollbar-thumb { background: #1A1E3A; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4DD9CC; }

/* ─── Tag Chip ───────────────────────────────── */
.tag {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
}

/* ─── Project image overlay ──────────────────── */
.proj-img-wrap {
  position: relative;
  overflow: hidden;
}
.proj-img-wrap img {
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.proj-img-wrap:hover img { transform: scale(1.04); }
.proj-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, #111228 100%);
}

/* ─── Float anim ─────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.float { animation: float 4s ease-in-out infinite; }

/* ─── Spin slow ──────────────────────────────── */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spin-slow { animation: spin-slow 12s linear infinite; }

/* ─── Fade in up ─────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
