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

@keyframes bounceDown {
  0%, 100% { transform: translateY(0);}
  50% { transform: translateY(10px);}
}

body, html {
  cursor: none !important;
  scrollbar-width: thin;
  scrollbar-color: #ffe066 #1a181b;
  background-color: #1a1a1b;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 15dvh;
}

a, button, input, textarea, select, label {
  cursor: none !important;
}

.body-no-scroll {
  overflow: hidden !important;
  height: 100vh !important;
}

#loader-overlay ~ #custom-cursor {
  display: none !important;
}

#loader-overlay.show ~ #custom-cursor {
  display: none !important;
}

/* Background Styles */
#three-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Social Media Icons */
.group:hover svg {
  transform: rotate(15deg) scale(1.1);
  transition: transform 0.3s cubic-bezier(.4,2,.6,1);
}

/* Time Zone Styles */
.tz-hide-on-scroll {
  opacity: 0;
  pointer-events: none;
  display: none;
  transition: opacity 0.4s;
}

#tz-group {
  transition: opacity 0.4s;
}

#tz-available {
  transition: margin 0.7s cubic-bezier(.77,0,.18,1), opacity 0.7s cubic-bezier(.77,0,.18,1);
}

.tz-group-hidden #tz-available {
  margin-bottom: 0;
}

/* Menu Toggle Styles */
#menu-toggle .menuline {
  height: 1px;
  background: #fff;
  display: block;
  border-radius: 2px;
  margin-bottom: 6px;
  transition: all 0.3s cubic-bezier(.4,2,.6,1);
}

#menu-toggle .line1 {
  width: 28px;
}

#menu-toggle .line2 {
  width: 24px;
}

#menu-toggle .line3 {
  width: 32px;
}

#menu-toggle .line3 {
  margin-bottom: 0;
}

#menu-toggle.open .line1 {
  transform: translateY(10px) rotate(45deg);
  width: 28px;
}

#menu-toggle.open .line2 {
  opacity: 0;
}

#menu-toggle.open .line3 {
  transform: translateY(-4px) rotate(-45deg);
  width: 28px;
}

#menu-toggle.open:hover .line1,
#menu-toggle.open:hover .line3,
#menu-toggle:not(.open):hover .line1,
#menu-toggle:not(.open):hover .line2,
#menu-toggle:not(.open):hover .line3  {
  background: #ffe066;
}

#menu-toggle:not(.open):hover .line1 {
  transform: translateX(4px) rotate(6deg);
}

#menu-toggle:not(.open):hover .line2 {
  transform: translateX(8px) rotate(-6deg);
}

#menu-toggle:not(.open):hover .line3 {
  transform: translateX(4px) rotate(3deg);
}

/* Fullscreen Navigation Styles */
.fullscreen-nav-link {
  position: relative;
  overflow: hidden;
  text-align: left;
  width: 100%;
  padding: 0.5em;
  color: #fff !important;
  z-index: 1;
}

.fullscreen-nav-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #ffe066;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(.4,2,.6,1);
  z-index: -1;
  pointer-events: none;
}

.fullscreen-nav-link:hover::before,
.fullscreen-nav-link:focus::before {
  transform: scaleX(1);
}

.fullscreen-nav-link:hover,
.fullscreen-nav-link:focus {
  color: #18181b !important;
}

.fullscreen-social-link {
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  line-height: 1.1;
}

/* Language Switcher Styles */
.language-switcher {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 9996;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
}

.switch-track {
  position: relative;
  width: 64px;
  height: 36px;
  background: transparent;
  backdrop-filter: blur(4px);
  border-radius: 999px;
  border: 1px solid #e0e0e050;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  transition: background 0.3s;
}

.switch-label {
  position: relative;
  z-index: 2;
  font-weight: bold;
  font-size: 13px;
  color: #888;
  transition: color 0.3s, opacity 0.3s;
  opacity: 0.6;
  pointer-events: none;
}

.switch-label.active {
  color: #222;
  opacity: 1;
}

.switch-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  background: linear-gradient(180deg, #fff 70%, #eaeaea 100%);
  border-radius: 50%;
  box-shadow: 0 4px 16px 0 rgba(0,0,0,1), 0 1.5px 0 #e0e0e0 inset;
  border: 1.5px solid #e0e0e0;
  transition: transform 0.3s cubic-bezier(.77,0,.18,1), background 0.3s;
  z-index: 1;
  overflow: hidden;
}

.switch-knob::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 50%;
  border-radius: 50% 50% 0 0/60% 60% 0 0;
  background: rgba(255,255,255,0.7);
  filter: blur(2px);
  pointer-events: none;
}

.language-switcher.es .switch-knob {
  transform: translateX(28px);
}

.language-switcher.en .switch-knob {
  transform: translateX(0);
}

.language-switcher.en #lang-en {
  color: #222;
  opacity: 1;
}

.language-switcher.en #lang-es {
  color: #888;
  opacity: 0.6;
}

.language-switcher.es #lang-es {
  color: #222;
  opacity: 1;
}

.language-switcher.es #lang-en {
  color: #888;
  opacity: 0.6;
}

/* Section Styles */
.about-section {
  position: relative; 
  z-index: 30; 
  margin-top: 100vh;
  background: transparent;
  backdrop-filter: blur(4px);
}

/* Hero Section Styles */
#hero-content {
  transition: transform 0.3s cubic-bezier(.25,.46,.45,.94);
  will-change: transform;
}

#hero-content h1 {
  font-size: 4rem;
  line-height: 6rem;
  color: white;
  font-weight: 800;
}

#hero-content p {
  font-size: 1.3rem;
  line-height: 3.5rem;
  color: white;
  font-weight: 300;
}

.hero-button {
  color: white;
  background: linear-gradient(90deg, rgba(106,17,203,0.1), rgba(37,117,252,0.4));
  filter: blur(0px);
}

.hero-button:hover {
  color: white;
  background: linear-gradient(90deg, rgba(106,17,203,0.2), rgba(37,117,252,0.5));
}

.hero {
  transition: opacity 0.5s;
}

body.scrolled .hero {
  opacity: 0;
  pointer-events: none;
}

/* Typing Effect Styles */
.typing-cursor {
  display: inline-block;
  color: #fff;
  animation: blink 1s steps(1) infinite;
  font-weight: bold;
}

/* About Section Styles */
#naip-stack {
  perspective: 1200px;
  width: 370px;
  height: 540px;
  min-height: 420px;
  margin: 0 auto;
  position: relative;
}

.naip-card {
  background: url('data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="40" height="40" fill="white"/><circle cx="20" cy="20" r="1.5" fill="%23ffe066" fill-opacity="0.18"/><circle cx="10" cy="10" r="1.5" fill="%23ffe066" fill-opacity="0.13"/><circle cx="30" cy="30" r="1.5" fill="%23ffe066" fill-opacity="0.13"/><circle cx="30" cy="10" r="1.5" fill="%23ffe066" fill-opacity="0.09"/><circle cx="10" cy="30" r="1.5" fill="%23ffe066" fill-opacity="0.09"/></svg>') repeat;
  background-size: 40px 40px;
  background-blend-mode: lighten;
  border-radius: 1.5rem;
  box-shadow: 0 6px 32px 0 #ffe06644, 0 1.5px 8px 0 #18181b11;
  transition: 
    box-shadow 0.3s cubic-bezier(.4,2,.6,1),
    transform 0.4s cubic-bezier(.4,2,.6,1),
    z-index 0s,
    opacity 0.3s;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem 2rem 1.5rem;
  width: 350px; 
  height: 520px;
  min-width: 220px;
  min-height: 400px;
  max-width: 90vw;
  max-height: 80vh;
  cursor: pointer;
  position: absolute;
  left: 0; 
  top: 0;
}

#naip-stack .naip-card {
  opacity: 0.85;
  filter: blur(0.5px) grayscale(10%);
  pointer-events: auto;
}

#naip-stack .naip-card.active {
  z-index: 20 !important;
  box-shadow: 0 12px 48px 0 #ffe06688, 0 3px 16px 0 #18181b22;
  transform: scale(1.04) rotate(0deg) translateY(0px) !important;
  opacity: 1;
  filter: none;
}

#naip-stack .naip-card:not(.active):nth-child(1) {
  transform: scale(0.96) rotate(-5deg) translateY(32px) translateX(-18px);
  z-index: 10;
  opacity: 0.92;
  filter: blur(0.5px) grayscale(10%);
}

#naip-stack .naip-card:not(.active):nth-child(2) {
  transform: scale(0.93) rotate(2deg) translateY(48px) translateX(48px);
  z-index: 9;
  opacity: 0.88;
  filter: blur(1px) grayscale(18%);
}

.naip-card:hover {
  box-shadow: 0 12px 48px 0 #ffe06688, 0 3px 16px 0 #18181b22;
  opacity: 1;
  filter: none;
}

@media (hover: hover) and (pointer: fine) {
  #naip-stack:hover .naip-card:not(.active) {
    transform: scale(0.95) rotate(8deg) translateY(48px) translateX(64px) !important;
    opacity: 0.7;
    filter: blur(1.5px) grayscale(20%);
    transition: 
      transform 0.4s cubic-bezier(.4,2,.6,1),
      opacity 0.4s cubic-bezier(.4,2,.6,1),
      filter 0.4s cubic-bezier(.4,2,.6,1);
  }

  #naip-stack:hover .naip-card.active {
    transform: scale(1.07) translateY(-16px) !important;
    box-shadow: 0 16px 64px 0 #ffe066aa, 0 6px 24px 0 #18181b33;
    opacity: 1;
    filter: none;
    transition: 
      transform 0.4s cubic-bezier(.4,2,.6,1),
      box-shadow 0.4s cubic-bezier(.4,2,.6,1);
  }
}

.naip-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  text-align: center;
}

.naip-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffe066;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 12px #ffe06633;
}

.naip-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 0.5rem;
  stroke: #18181b;
}

.naip-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #18181b;
  margin-bottom: 0.2rem;
  letter-spacing: 0.01em;
}

.naip-card p {
  font-size: 1rem;
  color: #23232a;
  opacity: 0.85;
}

@media (max-width: 640px) {
  #naip-stack {
    width: 100%;
    max-width: 100%;
    height: 100vw;
    position: relative;
    overflow-x: clip;
  }

  .naip-card {
    width: 70vw;
    max-width: 75vw;
    height: 100vw;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 0.5rem 1.2rem 0.5rem;
    border-radius: 1.1rem;
  }

  #naip-stack .naip-card:not(.active):nth-child(1) {
    transform: scale(0.97) rotate(-4deg) translateY(4vw) translateX(-2vw);
    z-index: 10;
  }

  #naip-stack .naip-card:not(.active):nth-child(2) {
    transform: scale(0.94) rotate(4deg) translateY(4vw) translateX(2vw);
    z-index: 9;
  }

  #naip-stack .naip-card.active {
    transform: scale(1.03) rotate(0deg) translateY(0px) translateX(-50%) !important;
    z-index: 20 !important;
  }

  .naip-inner {
    gap: 0.6rem;
  }

  .naip-card h3 {
    font-size: 1.1rem;
  }

  .naip-card p {
    font-size: 0.98rem;
  }

  .naip-avatar {
    width: 48px;
    height: 48px;
  }

  .naip-icon {
    width: 32px;
    height: 32px;
  }
}

/* Education horizontal scroll */
.education-section {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.education-timeline-outer {
  overflow: visible;
  width: 100vw;
  max-width: 100vw;
  position: relative;
  overflow-x: hidden !important;
}

.education-timeline {
  will-change: transform;
  transition: box-shadow 0.3s;
}

.edu-card {
  min-width: 340px !important;
  max-width: 340px !important;
}

.edu-card > div > div {
  width: 320px !important;
}

@media (max-width: 768px) {
  .education-timeline-outer {
    padding-left: 0;
    padding-right: 0;
  }
  .education-timeline {
    gap: 24px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* Footer Styles */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  padding-bottom: 3.5rem;
  margin: 0 auto;
}

.footer-link {
  color: #ffe066;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: white;
}

.footer-link-extra {
  color: #1f1f1f;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link-extra:hover {
  color: white;
  text-decoration: underline;
}

.footer svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease, color 0.3s ease;
}

.footer a:hover svg {
  transform: scale(1.2);
}

/* Top Scoll Button */
#scroll-top {
  transition: opacity 0.4s, transform 0.4s;
  opacity: 0.95;
  cursor: none;
}

#scroll-top:hover svg:first-child {
  filter: brightness(1.2);
}

#scroll-top:active {
  transform: scale(0.97) translateY(4px);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 10px;
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #ffe066 40%, #fbbf24 100%);
  border-radius: 8px;
  border: 2px solid #18181b;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #fee581 0%, #fde68a 100%);
}

::-webkit-scrollbar-track {
  background: #18181b;
  border-radius: 8px;
}

/* Custom Cursor Styles */
#custom-cursor {
  pointer-events: none;
  position: fixed;
  z-index: 99999;
  top: 0; left: 0;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: #ffe066;
  border-radius: 50%;
  position: absolute;
  left: 0; top: 0;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s;
  z-index: 2;
}

.cursor-dot.grow {
  width: 40px;
  height: 40px;
  background: #ffe06699;
}

.cursor-ring {
  width: 40px;
  height: 40px;
  border: 80px solid #9fddff30;
  border-radius: 50%;
  position: absolute;
  left: 0; top: 0;
  transform: translate(-50%, -50%);
  transition: border-color 0.2s;
  filter: blur(100px);
  z-index: 1;
}

@media (pointer: coarse), (max-width: 768px) {
  #custom-cursor {
    display: none !important;
  }
}