/* ============================================
   Portafolio — TOPIN
   ============================================ */

:root {
  --bg: #07070f;
  --bg-soft: #0d0d1a;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.09);
  --text: #eceaf6;
  --text-dim: #9b98b0;
  --accent-1: #8b5cf6;
  --accent-2: #ec4899;
  --accent-3: #22d3ee;
  --gradient: linear-gradient(100deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));
  --ig-gradient: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888);
  --radius: 20px;
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
}

::selection { background: var(--accent-1); color: #fff; }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 28px;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-name { display: flex; gap: 6px; }
.preloader-name span {
  font-family: var(--font-display); font-size: clamp(2.4rem, 8vw, 4rem);
  font-weight: 800; letter-spacing: 4px;
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(30px) scale(0.8);
  animation: letterIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards, shine 4s linear infinite;
}
.preloader-name span:nth-child(1) { animation-delay: 0.05s, 0s; }
.preloader-name span:nth-child(2) { animation-delay: 0.15s, 0s; }
.preloader-name span:nth-child(3) { animation-delay: 0.25s, 0s; }
.preloader-name span:nth-child(4) { animation-delay: 0.35s, 0s; }
.preloader-name span:nth-child(5) { animation-delay: 0.45s, 0s; }
@keyframes letterIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.preloader-bar {
  width: min(240px, 60vw); height: 3px; border-radius: 3px;
  background: rgba(255,255,255,0.08); overflow: hidden;
}
.preloader-fill {
  height: 100%; width: 0; border-radius: 3px;
  background: var(--gradient);
  animation: loadbar 1.4s cubic-bezier(0.65, 0, 0.35, 1) 0.2s forwards;
}
@keyframes loadbar { to { width: 100%; } }

/* ---------- Fondo ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
}

.bg-orbs { position: fixed; inset: 0; z-index: -2; overflow: hidden; }

.orb {
  position: absolute; border-radius: 50%;
  filter: blur(110px); opacity: 0.35;
  animation: float 18s ease-in-out infinite alternate;
}
.orb-1 { width: 480px; height: 480px; background: var(--accent-1); top: -12%; left: -8%; }
.orb-2 { width: 420px; height: 420px; background: var(--accent-2); top: 45%; right: -10%; animation-delay: -6s; }
.orb-3 { width: 380px; height: 380px; background: var(--accent-3); bottom: -15%; left: 28%; animation-delay: -12s; opacity: 0.22; }

@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(70px, 45px) scale(1.15); }
}

#particles { position: fixed; inset: 0; z-index: -1; }

/* ---------- Cursor ---------- */
.cursor-glow {
  position: fixed; width: 420px; height: 420px;
  border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.10), transparent 65%);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}
.cursor-dot {
  position: fixed; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-3); pointer-events: none; z-index: 300;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px var(--accent-3);
  transition: width 0.2s, height 0.2s, background 0.2s;
}
.cursor-dot.big { width: 26px; height: 26px; background: rgba(34, 211, 238, 0.25); }
@media (hover: none) { .cursor-glow, .cursor-dot { display: none; } }

/* ---------- Barra de progreso ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--gradient); z-index: 200;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.7);
}

/* ---------- Navegación ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 18px 6vw;
  transition: background 0.35s, backdrop-filter 0.35s, box-shadow 0.35s, padding 0.35s;
}
.nav.scrolled {
  padding: 12px 6vw;
  background: rgba(7, 7, 15, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: var(--font-display); font-weight: 800; font-size: 1.35rem;
  color: var(--text); text-decoration: none; letter-spacing: 2px;
}
.logo-dot { color: var(--accent-2); animation: blink 1.2s step-end infinite; }

.nav-links {
  display: flex; gap: 34px; list-style: none; align-items: center;
}
.nav-links a {
  color: var(--text-dim); text-decoration: none; font-size: 0.92rem; font-weight: 500;
  position: relative; transition: color 0.25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:not(.nav-cta)::after {
  content: ''; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--gradient);
  transition: width 0.3s ease; border-radius: 2px;
}
.nav-links a:not(.nav-cta):hover::after { width: 100%; }

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 22px; border-radius: 99px;
  background: var(--ig-gradient); color: #fff !important; font-weight: 600;
  transition: transform 0.25s, box-shadow 0.25s;
}
.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(220, 39, 67, 0.4);
}
.ig-icon { flex-shrink: 0; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 130px 6vw 80px;
  position: relative;
}
.hero-grid {
  max-width: 1200px; width: 100%;
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: 40px; align-items: center;
}
.hero-content { text-align: left; }

.hero-tag {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.85rem; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 99px;
  padding: 7px 18px; margin-bottom: 28px;
  background: var(--surface);
  backdrop-filter: blur(8px);
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 800; line-height: 1.05; letter-spacing: -2px;
  margin-bottom: 18px;
}

.gradient-text {
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 5s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

/* Glitch sutil en el nombre */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0;
}
.glitch::before { animation: glitchA 6s infinite steps(1); }
.glitch::after  { animation: glitchB 6s infinite steps(1); }
@keyframes glitchA {
  0%, 92%, 100% { opacity: 0; transform: none; }
  93% { opacity: 0.75; transform: translate(3px, -2px); clip-path: inset(10% 0 55% 0); }
  95% { opacity: 0.75; transform: translate(-3px, 1px); clip-path: inset(50% 0 20% 0); }
  97% { opacity: 0; }
}
@keyframes glitchB {
  0%, 91%, 100% { opacity: 0; transform: none; }
  94% { opacity: 0.6; transform: translate(-4px, 2px); clip-path: inset(60% 0 5% 0); }
  96% { opacity: 0.6; transform: translate(4px, -1px); clip-path: inset(0 0 70% 0); }
  98% { opacity: 0; }
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 500; color: var(--accent-3);
  min-height: 2.2em; margin-bottom: 20px;
}
.typed-cursor { animation: blink 0.9s step-end infinite; color: var(--accent-2); }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  color: var(--text-dim); font-size: 1.05rem;
  max-width: 540px; margin-bottom: 34px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 48px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 30px; border-radius: 99px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s, border-color 0.25s;
  will-change: transform;
}
.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 12px 36px rgba(236, 72, 153, 0.45);
}
.btn-arrow { transition: transform 0.25s; }
.btn-primary:hover .btn-arrow { transform: translateX(5px); }
.btn-ghost {
  border: 1px solid var(--border); color: var(--text);
  background: var(--surface); backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: var(--accent-1); }

.btn-ig {
  background: var(--ig-gradient); color: #fff;
  box-shadow: 0 6px 24px rgba(220, 39, 67, 0.35);
}
.btn-ig:hover { box-shadow: 0 12px 36px rgba(220, 39, 67, 0.5); }
.btn-ig-big { font-size: 1.1rem; padding: 18px 40px; }

.hero-stats {
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; align-items: flex-start; }
.stat-top { display: flex; align-items: baseline; }
.stat-num, .stat-plus {
  font-family: var(--font-display); font-size: 2rem; font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }
.stat-divider { width: 1px; height: 44px; background: var(--border); }

/* ---------- Foto hero ---------- */
.hero-photo { display: flex; justify-content: center; }
.photo-scene {
  position: relative;
  width: min(360px, 78vw);
  aspect-ratio: 3 / 4;
}
.photo-frame {
  position: relative; width: 100%; height: 100%;
  border-radius: 30px; overflow: hidden;
  background: linear-gradient(180deg, rgba(139,92,246,0.25), rgba(236,72,153,0.15));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(139, 92, 246, 0.25);
  transform-style: preserve-3d;
  animation: photoFloat 6s ease-in-out infinite;
}
@keyframes photoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.photo-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  display: block;
  filter: saturate(1.05) contrast(1.03);
}
.photo-shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.16) 48%, transparent 62%);
  background-size: 250% 100%;
  animation: shineSweep 5.5s ease-in-out infinite;
}
@keyframes shineSweep {
  0%, 55% { background-position: 130% 0; }
  85%, 100% { background-position: -60% 0; }
}

/* Anillos orbitando */
.photo-ring {
  position: absolute; inset: -22px;
  border-radius: 42px;
  border: 1.5px solid transparent;
  background: linear-gradient(var(--bg), var(--bg)) padding-box,
              conic-gradient(from 0deg, var(--accent-1), var(--accent-2), var(--accent-3), var(--accent-1)) border-box;
  opacity: 0.55;
  animation: ringSpin 10s linear infinite;
  pointer-events: none;
  background-clip: padding-box, border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}
.photo-ring.ring-2 {
  inset: -40px; border-radius: 56px; opacity: 0.28;
  animation-direction: reverse; animation-duration: 16s;
}
@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

/* Chips flotantes */
.float-chip {
  position: absolute;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 99px;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500;
  color: var(--text);
  background: rgba(13, 13, 26, 0.82);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: chipFloat 5s ease-in-out infinite;
  white-space: nowrap; z-index: 2;
}
.chip-1 { top: 6%; left: -16%; animation-delay: 0s; }
.chip-2 { top: 38%; right: -20%; animation-delay: -1.4s; }
.chip-3 { bottom: 24%; left: -20%; animation-delay: -2.8s; }
.chip-4 {
  bottom: -4%; right: -8%; animation-delay: -3.6s;
  background: var(--ig-gradient); border-color: transparent; color: #fff;
}
@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); }
.mouse {
  width: 26px; height: 42px; border: 2px solid var(--text-dim);
  border-radius: 14px; display: flex; justify-content: center; padding-top: 7px;
}
.wheel {
  width: 3px; height: 8px; background: var(--accent-3); border-radius: 3px;
  animation: wheel 1.6s ease infinite;
}
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { opacity: 0; }
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden; white-space: nowrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  background: rgba(255, 255, 255, 0.015);
  transform: rotate(-1deg) scale(1.02);
}
.marquee-track {
  display: inline-flex;
  animation: marquee 22s linear infinite;
}
.marquee-track span {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.15rem; letter-spacing: 3px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(236, 234, 246, 0.35);
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Secciones ---------- */
.section {
  max-width: 1200px; margin: 0 auto;
  padding: 110px 6vw;
  position: relative; z-index: 1;
}
.section-head { margin-bottom: 56px; }
.section-kicker {
  font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--accent-3); letter-spacing: 2px; text-transform: uppercase;
  display: block; margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 800; letter-spacing: -1px; line-height: 1.15;
}

/* ---------- Glass ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------- Sobre mí ---------- */
.about-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center;
}
.about-card { padding: 12px; }

.terminal { border-radius: 14px; overflow: hidden; background: #0a0a14; border: 1px solid var(--border); }
.terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px; background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.t-dot { width: 11px; height: 11px; border-radius: 50%; }
.t-dot.red { background: #ff5f57; } .t-dot.yellow { background: #febc2e; } .t-dot.green { background: #28c840; }
.terminal-title { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); margin-left: 10px; }
.terminal-body { padding: 22px; font-family: var(--font-mono); font-size: 0.88rem; }
.terminal-body p { margin-bottom: 8px; }
.t-prompt { color: var(--accent-2); font-weight: 700; margin-right: 8px; }
.t-out { color: var(--text-dim); padding-left: 20px; }
.t-ok { color: #34d399; }
.t-blink { animation: blink 1s step-end infinite; color: var(--accent-3); }

.about-text p { color: var(--text-dim); margin-bottom: 18px; font-size: 1.02rem; }
.about-text strong { color: var(--text); }
.about-list { list-style: none; margin-top: 8px; }
.about-list li { padding: 7px 0; color: var(--text); font-weight: 500; }
.check {
  color: var(--accent-3); font-weight: 700; margin-right: 10px;
}

/* ---------- Habilidades ---------- */
.skills-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.skill-card {
  padding: 30px 26px;
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.skill-card:hover {
  transform: translateY(-8px);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 20px 50px rgba(139, 92, 246, 0.18);
}
.skill-icon { font-size: 2rem; margin-bottom: 14px; }
.skill-card h3 { font-family: var(--font-display); font-size: 1.12rem; margin-bottom: 8px; }
.skill-card p { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 18px; }
.skill-bar {
  height: 6px; border-radius: 6px; background: rgba(255,255,255,0.07); overflow: hidden;
}
.skill-fill {
  height: 100%; width: 0; border-radius: 6px;
  background: var(--gradient);
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}
.revealed .skill-fill { width: var(--w); }

/* ---------- Proyectos ---------- */
.projects-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.project-card {
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.project-card:hover {
  border-color: rgba(236, 72, 153, 0.45);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.project-visual {
  height: 170px; display: flex; align-items: center; justify-content: center;
  background: var(--pg); position: relative; overflow: hidden;
}
.project-visual::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(255,255,255,0.25), transparent 55%);
}
.project-emoji {
  font-size: 3.4rem; filter: drop-shadow(0 8px 18px rgba(0,0,0,0.4));
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.project-card:hover .project-emoji { transform: scale(1.18) rotate(-6deg); }
.project-body { padding: 26px; display: flex; flex-direction: column; flex: 1; }
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.project-tags span {
  font-family: var(--font-mono); font-size: 0.72rem;
  padding: 4px 12px; border-radius: 99px;
  background: rgba(139, 92, 246, 0.14); color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.25);
}
.project-body h3 { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 8px; }
.project-body p { color: var(--text-dim); font-size: 0.93rem; flex: 1; margin-bottom: 18px; }
.project-link {
  color: var(--accent-3); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.project-link span { transition: transform 0.25s; }
.project-link:hover span { transform: translateX(5px); }

/* ---------- Contacto ---------- */
.contact-card {
  text-align: center; padding: 80px 8vw; position: relative; overflow: hidden;
}
.contact-glow {
  position: absolute; top: -140px; left: 50%; transform: translateX(-50%);
  width: 560px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(188, 24, 136, 0.3), transparent 70%);
  pointer-events: none;
}
.contact-desc {
  color: var(--text-dim); max-width: 520px; margin: 18px auto 36px;
}
.contact-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer {
  text-align: center; padding: 36px 6vw;
  color: var(--text-dim); font-size: 0.88rem;
  border-top: 1px solid var(--border);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0; transform: translateY(34px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0s),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0s);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .preloader { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .chip-1 { left: -4%; }
  .chip-2 { right: -6%; }
  .chip-3 { left: -6%; }
  .chip-4 { right: -2%; }
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 70px; }
  .hero-content { text-align: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  .stat { align-items: center; }
  .hero-photo { order: -1; margin-top: 20px; }
  .photo-scene { width: min(280px, 70vw); }
  .skills-grid, .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 34px; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(78vw, 320px);
    flex-direction: column; justify-content: center; gap: 30px;
    background: rgba(10, 10, 20, 0.96); backdrop-filter: blur(20px);
    transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: -20px 0 60px rgba(0,0,0,0.5);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 1.1rem; }
  .skills-grid, .projects-grid { grid-template-columns: 1fr; }
  .stat-divider { display: none; }
  .hero-stats { gap: 26px; }
  .contact-card { padding: 60px 7vw; }
  .float-chip { font-size: 0.72rem; padding: 7px 12px; }
  .chip-1 { left: -8%; }
  .chip-2 { right: -10%; }
  .chip-3 { left: -10%; }
}
