
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { background: #000000; color: #e2e8f0; font-family: 'Inter', sans-serif; overflow-x: hidden; }
::selection { background: #60a5fa; color: #020617; }

/* Superficie punteada — cuadrícula animada de Three.js, capa más profunda */
.dotted-surface {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  opacity: 0.85;
  /* Desvanecimiento de arriba a abajo: los puntos se concentran en la mitad inferior (aspecto de horizonte marino) */
  mask-image: linear-gradient(to bottom, transparent 0%, black 28%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 28%, black 100%);
}
.dotted-surface canvas { display: block; }

/* Orbes ambientales en el fondo */
.bg-orb { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(80px); opacity: .5; mix-blend-mode: screen; }

/* Piscina ambiental reactiva al cursor (superposición fija que sigue al ratón) */
.cursor-pool {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(500px circle at var(--cx, 50%) var(--cy, 50%),
    rgba(255, 255, 255, 0.05), transparent 55%);
  transition: background 0.15s ease-out;
  mix-blend-mode: screen;
}

/* Tarjeta glassmorphism — escarchada con resaltado interno sutil */
.glass {
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: saturate(150%) blur(18px);
  -webkit-backdrop-filter: saturate(150%) blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 30px 60px -20px rgba(0, 0, 0, 0.5);
}
.glass-strong {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Brillo rastreado por cursor en .btn-glow */
.btn-glow { position: relative; overflow: hidden; isolation: isolate; transition: transform .35s cubic-bezier(.22,1,.36,1); }
.btn-glow::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(160px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.18), transparent 60%);
  opacity: 0; transition: opacity .35s ease;
}
.btn-glow:hover::before { opacity: 1; }
.btn-glow:hover { transform: translateY(-2px); }

/* Hero core: photo as central orb + orbital rings */
.core { position: relative; width: 360px; height: 360px; max-width: 88vw; max-height: 88vw; }
.core-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.18); animation: spin 24s linear infinite; }
.core-ring.r1 { inset: 0; border-style: dashed; }
.core-ring.r2 { inset: 8%; animation-duration: 18s; animation-direction: reverse; border-color: rgba(255, 255, 255, 0.12); }
.core-ring.r3 { inset: 16%; animation-duration: 12s; border-color: rgba(255, 255, 255, 0.08); }
.core-photo-wrap {
  position: absolute; inset: 22%; border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 0 60px rgba(255, 255, 255, 0.18),
    0 0 120px rgba(255, 255, 255, 0.08),
    inset 0 0 30px rgba(0, 0, 0, 0.4);
  animation: pulse 4.5s ease-in-out infinite;
}
.core-photo { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; filter: brightness(0.95) saturate(0.6); }
.core-particle { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; border-radius: 50%; background: #ffffff; box-shadow: 0 0 14px rgba(255,255,255,0.7); transform-origin: 0 0; }
.core-particle.p1 { animation: orbit1 9s linear infinite; }
.core-particle.p2 { animation: orbit2 12s linear infinite; opacity: 0.7; }
.core-particle.p3 { animation: orbit3 7s linear infinite; opacity: 0.5; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 60px rgba(255, 255, 255, 0.18), 0 0 120px rgba(255, 255, 255, 0.08), inset 0 0 30px rgba(0, 0, 0, 0.4); }
  50%      { box-shadow: 0 0 80px rgba(255, 255, 255, 0.28), 0 0 160px rgba(255, 255, 255, 0.12), inset 0 0 30px rgba(0, 0, 0, 0.4); }
}
@keyframes orbit1 { from { transform: rotate(0deg)   translateX(160px) rotate(0deg);   } to { transform: rotate(360deg) translateX(160px) rotate(-360deg); } }
@keyframes orbit2 { from { transform: rotate(120deg) translateX(125px) rotate(-120deg); } to { transform: rotate(480deg) translateX(125px) rotate(-480deg); } }
@keyframes orbit3 { from { transform: rotate(240deg) translateX(95px)  rotate(-240deg); } to { transform: rotate(600deg) translateX(95px)  rotate(-600deg); } }

/* Animación flotante para iconos tecnológicos */
.float-icon { animation: float 5.5s ease-in-out infinite; will-change: transform; }
.float-icon:nth-child(2n) { animation-duration: 6.8s; animation-delay: -2.1s; }
.float-icon:nth-child(3n) { animation-duration: 4.9s; animation-delay: -3.4s; }
.float-icon:nth-child(4n) { animation-duration: 7.4s; animation-delay: -1.6s; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-10px) rotate(2deg); } }

/* Texto "gradiente" — ahora un gradiente sutil de blanco a gris (monocromo) */
.gradient-text {
  background: linear-gradient(180deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* Architecture flow arrow with traveling glow */
.flow-arrow { position: relative; height: 2px; background: rgba(255,255,255,0.12); border-radius: 2px; flex: 1; min-width: 24px; }
.flow-arrow::after {
  content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 30%;
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  border-radius: 2px; animation: flow 2.4s linear infinite;
}
@keyframes flow { from { transform: translateX(-30%); } to { transform: translateX(370%); } }

.scroll-cue { animation: scrollCue 2s ease-in-out infinite; }
@keyframes scrollCue { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(8px); opacity: 1; } }

/* Transición de expansión de proyecto (sin altura de sacudida de diseño) */
.proj-expand { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s cubic-bezier(.22,1,.36,1); }
.proj-expand > * { overflow: hidden; }
.project-card.expanded .proj-expand { grid-template-rows: 1fr; }
.project-card.expanded .proj-toggle-icon { transform: rotate(45deg); }

/* Revelación de división de palabras */
.word { display: inline-block; overflow: hidden; line-height: 1; padding-bottom: 0.12em; margin-bottom: -0.12em; vertical-align: bottom; }
.word > span { display: inline-block; transform: translateY(110%); }

/* Insignias de certificación — borde brillante */
.cert-badge {
  position: relative; width: 110px; height: 110px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 30%, #1e293b, #0f172a 70%);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.cert-badge::before {
  content: ''; position: absolute; inset: -2px; border-radius: 50%;
  background: conic-gradient(from var(--badge-angle, 0deg), transparent 0deg, var(--badge-color, #60a5fa) 90deg, transparent 180deg, var(--badge-color-2, #a855f7) 270deg, transparent 360deg);
  z-index: -1; animation: badgeSpin 4s linear infinite;
  filter: blur(1px);
}
.cert-badge::after {
  content: ''; position: absolute; inset: -10px; border-radius: 50%;
  background: radial-gradient(circle, var(--badge-color, #60a5fa), transparent 70%);
  z-index: -2; opacity: 0.35; filter: blur(20px); animation: badgeGlow 3s ease-in-out infinite;
}
@property --badge-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes badgeSpin { from { --badge-angle: 0deg; } to { --badge-angle: 360deg; } }
@keyframes badgeGlow { 0%, 100% { opacity: 0.3; transform: scale(1); } 50% { opacity: 0.55; transform: scale(1.06); } }
.cert-badge-cisco { --badge-color: #1ba0d7; --badge-color-2: #00bceb; }
.cert-badge-aws   { --badge-color: #ff9900; --badge-color-2: #f59e0b; }
.cert-badge-progress::before { animation-duration: 2.4s; }

/* Anillo de progreso de AWS (muestra finalización parcial) */
.cert-progress-ring { position: absolute; inset: -4px; pointer-events: none; }
.cert-progress-ring circle { fill: none; stroke-width: 3; transform: rotate(-90deg); transform-origin: 50% 50%; }
.cert-progress-ring .track { stroke: rgba(255,255,255,0.08); }
.cert-progress-ring .progress { stroke: url(#awsGrad); stroke-linecap: round; stroke-dasharray: 70 100; animation: progressPulse 2.4s ease-in-out infinite; }
@keyframes progressPulse { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; filter: drop-shadow(0 0 6px #ff9900); } }

/* Línea de tiempo del roadmap */
.roadmap { position: relative; }
.roadmap-line {
  position: absolute; top: 50%; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.15), rgba(255,255,255,0.4), rgba(255,255,255,0.15));
  transform: translateY(-50%); z-index: 0;
}
.roadmap-line::after {
  content: ''; position: absolute; top: -1px; left: 0; height: 4px; width: 30%;
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  border-radius: 4px; filter: blur(2px); animation: roadmapFlow 5s linear infinite;
}
@keyframes roadmapFlow { from { transform: translateX(-30%); } to { transform: translateX(370%); } }
.roadmap-node-dot { position: relative; }
.roadmap-node-dot::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  background: radial-gradient(circle, currentColor, transparent 65%); opacity: 0.4;
  animation: nodePulse 2.5s ease-in-out infinite;
}
@keyframes nodePulse { 0%, 100% { transform: scale(1); opacity: 0.3; } 50% { transform: scale(1.4); opacity: 0.7; } }

/* Móvil: eliminar efectos más pesados */
@media (max-width: 768px) {
  .bg-orb { filter: blur(50px); opacity: 0.35; }
  .core { width: 280px; height: 280px; }
  .btn-glow::before, .cursor-pool { display: none; }
  .roadmap-line {
    left: 50%; right: auto; top: 0; bottom: 0; width: 2px; height: auto;
    background: linear-gradient(180deg, rgba(96,165,250,0.4), rgba(168,85,247,0.5), rgba(34,211,238,0.5));
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: 0.01s !important; animation-iteration-count: 1 !important; transition-duration: 0.01s !important; }
  .word > span { transform: none !important; }
}
