:root {
  --bg-color: #fdfbf6;
  --dot-color: #e0ded5;
  --text-main: #1a1a1a;
  --text-muted: #6c757d;
  --accent: #2b59c3;
  --highlight: #f4d35e;
  --panel-bg: #ffffff;
  --border-color: rgba(0, 0, 0, 0.1);

  --font-display: "Syne", sans-serif;
  --font-body: "Inter", sans-serif;
}

body.dark-mode {
  --bg-color: #0f0f0f;
  --dot-color: #2a2a2a;
  --text-main: #fdfbf6;
  --text-muted: #a0a0a0;
  --accent: #4d7bf3;
  --panel-bg: #1a1a1a;
  --border-color: rgba(255, 255, 255, 0.1);
}

/* LENIS SMOOTH SCROLL */
html.lenis {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none;
  margin: 0;
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 30px 30px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- LOADING SCREEN --- */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}
.loading-sticker {
  width: clamp(240px, 42vw, 520px);
  animation: float 4s ease-in-out infinite;
}
.loading-sticker img {
  width: 100%;
  height: auto;
  display: block;
  transform-origin: center;
  animation: spin 1.2s linear infinite;
}
.loading-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- ACCESSIBLE FOCUS STYLES --- */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
.gallery-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
.btn-link,
.nav-link {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
p {
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-main);
}
.text-muted {
  color: var(--text-muted) !important;
}

/* --- CURSOR --- */
#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;

  /* Color sólido para que se vea siempre (Rojo intenso) */
  background: #ff595e;

  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s;

  border-radius: 2px;

  /* Borde blanco para que resalte sobre fondos oscuros */
  border: 2px solid #ffffff;

  /* IMPORTANTE: Hemos quitado 'mix-blend-mode' para que el color no cambie */
}
#cursor.hovered {
  width: 40px;
  height: 40px;
  background-color: transparent;
  opacity: 0, 3;
  border: 2px solid #ffffff;
}
#cursor.drawing {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border: none;
}

/* --- NAVBAR --- */
.navbar {
  padding: 2rem 3rem;
  z-index: 1000;
  transition: padding 0.3s;
  /* CAMBIO CLAVE: Fondo blanco al 85% para que se lea el texto */
  background: rgba(255, 255, 255, 0.85);

  /* Efecto cristal */
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);

  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
/* Corrección para Modo Oscuro */
body.dark-mode .navbar {
  /* Fondo Negro semitransparente */
  background: rgba(10, 10, 10, 0.85) !important;
  /* Borde más sutil */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.navbar-brand,
.nav-link,
.navbar-btn {
  color: var(--text-main) !important;
}
.nav-link {
  position: relative;
  margin-left: 1.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-main);
  transition: width 0.3s ease;
}
.nav-link:hover::after {
  width: 100%;
}

/* --- HERO & CANVAS --- */
#hero {
  height: 100dvh;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 800px;
  overflow: hidden;
}

#drawing-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  touch-action: none;
  /* IMPORTANTE: Desactivado por defecto para scroll suave */
  pointer-events: none;
}

/* Clase que activa el dibujo */
body.drawing-enabled #drawing-canvas {
  pointer-events: auto;
}
body.drawing-enabled {
  overflow: hidden;
} /* Bloquea scroll al dibujar */

.hero-text-container {
  position: relative;
  z-index: 3;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-content-hidden {
  opacity: 0 !important;
  transform: scale(0.9);
  pointer-events: none;
}

.big-title {
  font-size: 13vw;
  line-height: 0.9;
  color: var(--text-main);
  opacity: 0;
  transform: translateY(100px);
}
#tea-A {
  display: inline-block;
  position: relative;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-top: 2rem;
  opacity: 0;
  display: inline-block;
  border: 1px solid var(--text-main);
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  color: var(--text-main);
}

/* --- MASCOT (GHOST) --- */
.mascot-container {
  position: absolute;
  bottom: 15%;
  right: 15%;
  width: 150px;
  height: 180px;
  z-index: 4;
  pointer-events: none;
  animation: float 4s ease-in-out infinite;
  opacity: 1; /* Forzamos visibilidad */
  transition: opacity 0.5s ease;
}

.mascot-body {
  width: 100%;
  height: 100%;
  background: var(--accent);
  border-radius: 50% 50% 0 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.1);
}
.mascot-body::before,
.mascot-body::after {
  content: "";
  position: absolute;
  top: 40%;
  width: 15px;
  height: 25px;
  background: #fff;
  border-radius: 50px;
  animation: blink 4s infinite;
}
.mascot-body::before {
  left: 35%;
}
.mascot-body::after {
  right: 35%;
}
.mascot-legs {
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 20px;
  background-size: 30px 30px;
  background-image: radial-gradient(
    circle at 15px 0,
    var(--accent) 15px,
    transparent 16px
  );
  background-repeat: repeat-x;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}
@keyframes blink {
  0%,
  96%,
  100% {
    height: 25px;
  }
  98% {
    height: 2px;
  }
}

/* --- UI ELEMENTS --- */
#pencil-toggle-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--text-main);
  color: var(--bg-color);
  border: none;
  z-index: 101;
  font-size: 1.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, background 0.3s;
}
#pencil-toggle-btn:hover {
  transform: scale(1.1);
}
#pencil-toggle-btn.active {
  background: var(--accent);
  color: #fff;
  transform: rotate(15deg);
}

#exit-playground-btn {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  z-index: 99;
  transition: all 0.3s ease;
}
#exit-playground-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.tools-panel {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  background: var(--panel-bg);
  padding: 10px 25px;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.3s;
  border: 1px solid var(--border-color);
}
.tools-panel.hidden {
  transform: translateX(-50%) translateY(150px);
  opacity: 0;
  pointer-events: none;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: none;
  border: 2px solid transparent;
  transition: transform 0.2s;
}
.color-dot:hover {
  transform: scale(1.2);
}

/* --- SECTIONS SPACING FIX --- */
section {
  position: relative;
  z-index: 5;
  pointer-events: none;
}

/* Allow interactions inside the archive gallery section */
#archive {
  pointer-events: auto;
}

/* ESPACIADO CORREGIDO: Evita que el texto del hero se solape con about */
#about {
  padding-top: 20vh;
  padding-bottom: 10vh;
}

/* Improve contrast for About download buttons in dark mode */
body.dark-mode #about .btn-outline-dark {
  color: var(--text-main);
  border-color: var(--text-main);
}
body.dark-mode #about .btn-outline-dark:hover,
body.dark-mode #about .btn-outline-dark:focus-visible {
  background-color: var(--text-main);
  color: var(--bg-color);
  border-color: var(--text-main);
}

.sticker-container {
  position: absolute;
  top: 50%;
  right: 10%;
  /* Canvas size for the sticker - adjust if needed */
  width: 320px;
  height: auto;
  z-index: 40; /* ensure sticker sits above hero text */
  pointer-events: none;
  display: block;
  -webkit-font-smoothing: antialiased;
  --sticker-offset-x: -150px;
  --sticker-offset-y: -120px;
  --eyes-x: 140px;
  --eyes-y: 55px;
  --eyes-width: 50%;
  --eyes-wink-offset-x: 12px;
  --eyes-wink-offset-y: -6px;
}

.sticker-container .capa {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  display: block;
}

.sticker-container .base {
  z-index: 1;
}
.sticker-container .eyes-open {
  z-index: 2;
}
.sticker-container .eyes-wink {
  z-index: 3;
}
.sticker-container .eyes-open,
.sticker-container .eyes-wink {
  left: var(--eyes-x);
  top: var(--eyes-y);
  width: var(--eyes-width);
  height: auto;
  transform: translateX(-50%);
}
.sticker-container .eyes-wink {
  left: calc(var(--eyes-x) + var(--eyes-wink-offset-x));
  top: calc(var(--eyes-y) + var(--eyes-wink-offset-y));
  transform: translateX(-52%) scale(1.12);
  transform-origin: center;
}

.sticker-container img {
  max-width: 100%;
  height: auto;
  display: block;
}

.gallery-item {
  flex-shrink: 0;
  cursor: none;
  pointer-events: auto; /* Permitir interacciones (scroll / drag) */
  transition: transform 0.3s ease;
}
.gallery-item:hover {
  transform: translateY(-10px);
}
.gallery-meta {
  width: 100%;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.gallery-meta h4 {
  flex: 1 1 auto;
  min-width: 0;
}
.gallery-meta .badge {
  flex-shrink: 0;
}
.gallery-img-wrapper {
  width: 100%;
  height: 450px;
  background: #ddd;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  margin-bottom: 1.5rem;
}
.gallery-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}
.gallery-img-wrapper.is-collage {
  background: #f5f2ea;
}
.gallery-img-wrapper.is-collage .gallery-collage-item {
  position: absolute;
  width: var(--w, 34%);
  left: var(--x, 0);
  top: var(--y, 0);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transform: rotate(var(--r, 0deg));
  object-fit: cover;
  height: auto;
  pointer-events: none;
}
.gallery-img-wrapper.is-collage .gallery-collage-item-1 {
  --x: -2%;
  --y: 6%;
  --w: 36%;
  --r: -5deg;
  z-index: 4;
}
.gallery-img-wrapper.is-collage .gallery-collage-item-2 {
  --x: 26%;
  --y: -2%;
  --w: 38%;
  --r: 4deg;
  z-index: 3;
}
.gallery-img-wrapper.is-collage .gallery-collage-item-3 {
  --x: 56%;
  --y: 4%;
  --w: 30%;
  --r: -2deg;
  z-index: 2;
}
.gallery-img-wrapper.is-collage .gallery-collage-item-4 {
  --x: 6%;
  --y: 32%;
  --w: 34%;
  --r: 2deg;
  z-index: 3;
}
.gallery-img-wrapper.is-collage .gallery-collage-item-5 {
  --x: 28%;
  --y: 20%;
  --w: 26%;
  --r: -6deg;
  z-index: 6;
}
.gallery-img-wrapper.is-collage .gallery-collage-item-6 {
  --x: 46%;
  --y: 28%;
  --w: 34%;
  --r: 1deg;
  z-index: 4;
}
.gallery-img-wrapper.is-collage .gallery-collage-item-7 {
  --x: 70%;
  --y: 30%;
  --w: 24%;
  --r: 5deg;
  z-index: 6;
}
.gallery-img-wrapper.is-collage .gallery-collage-item-8 {
  --x: 12%;
  --y: 56%;
  --w: 32%;
  --r: -3deg;
  z-index: 2;
}
.gallery-img-wrapper.is-collage .gallery-collage-item-9 {
  --x: 40%;
  --y: 54%;
  --w: 34%;
  --r: 2deg;
  z-index: 3;
}
.gallery-img-wrapper.is-collage .gallery-collage-item-10 {
  --x: 64%;
  --y: 56%;
  --w: 28%;
  --r: -4deg;
  z-index: 5;
}
.gallery-img-wrapper.is-collage .gallery-collage-item-11 {
  --x: 44%;
  --y: 10%;
  --w: 22%;
  --r: 6deg;
  z-index: 7;
}
.gallery-img-wrapper.is-collage .gallery-collage-item-12 {
  --x: 10%;
  --y: 14%;
  --w: 22%;
  --r: 1deg;
  z-index: 7;
}
.gallery-img-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  display: block;
  transition: transform 0.7s ease;
}
.gallery-item:hover .gallery-img-wrapper img {
  transform: scale(1.1);
}
.gallery-item:hover .gallery-img-wrapper iframe {
  transform: scale(1.1);
}

/* --- HORIZONTAL SWIPE GALLERY --- */
.swipe-gallery-container {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  padding: 2rem 0;
  pointer-events: auto; /* Reactiva el scroll horizontal dentro de la sección */
  cursor: grab;
  scroll-snap-type: x mandatory;
  scroll-padding: 1.5rem;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
}

.gallery-track {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding: 0 1.5rem;
}

.gallery-item {
  width: 360px; /* fixed card width for desktop */
  scroll-snap-align: start;
  pointer-events: auto; /* Asegura que cada tarjeta reciba eventos táctiles/ratón */
}

.swipe-gallery-container.dragging {
  cursor: grabbing;
}

/* --- OVERLAY --- */
.project-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  z-index: 2000;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.project-overlay.active {
  transform: translateY(0);
}
.project-overlay.gallery-only #project-header {
  margin-bottom: 2rem;
}
.project-embed {
  height: 60vh;
  border: 0;
  border-radius: 20px;
  display: block;
}
.project-embed[hidden] {
  display: none;
}
.embed-caption {
  margin-top: 10px;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.project-media {
  display: grid;
  gap: 20px;
}
.project-primary-media {
  display: grid;
  gap: 10px;
}
.project-media.is-split {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
}
.project-media.is-split .project-primary-media {
  grid-column: 1;
}
.project-media.is-split .project-extra-media {
  grid-column: 2;
  align-self: start;
}
.project-extra-media {
  display: grid;
  gap: 1.5rem;
}
.project-extra-media[hidden] {
  display: none;
}
.project-extra-media.is-flex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 200px));
  gap: 1rem;
  align-items: stretch;
  justify-content: center;
}
.project-extra-media.is-flex-grid.is-grid-4x2 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.project-extra-media.is-flex-grid.is-grid-portrait {
  grid-template-columns: repeat(auto-fit, minmax(140px, 180px));
}
.project-extra-media.is-flex-grid.is-grid-portrait .project-extra-item {
  aspect-ratio: 3 / 4;
}
.project-extra-media.is-flex-grid .project-extra-item {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 16px;
}
.project-extra-media.is-flex-grid .project-extra-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  cursor: zoom-in;
}
.project-extra-media.is-flex-grid .project-extra-item figcaption {
  display: none;
}
.collage-viewer {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2100;
}
.collage-viewer.is-active {
  display: flex;
}
.collage-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.78);
}
.collage-viewer-figure {
  position: relative;
  margin: 0;
  max-width: min(92vw, 1100px);
  max-height: 85vh;
  z-index: 1;
}
.collage-viewer-figure img {
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.collage-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  color: #111111;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  z-index: 2;
}
.collage-viewer-nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.collage-viewer-prev {
  left: 24px;
}
.collage-viewer-next {
  right: 24px;
}
.collage-viewer-indicator {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #111111;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  z-index: 2;
}
.collage-viewer-indicator.is-hidden {
  display: none;
}
.collage-viewer-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  color: #111111;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.project-extra-media.is-collage {
  position: relative;
  display: block;
  width: 100%;
  min-height: 520px;
  height: min(72vh, 720px);
  padding: 2rem;
  background: #f7f5ef;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}
.project-extra-media.is-collage .collage-item {
  position: absolute;
  width: var(--w, 20%);
  left: var(--x, 0);
  top: var(--y, 0);
  z-index: var(--z, 1);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  transform: rotate(var(--r, 0deg));
  transform-origin: center;
  object-fit: cover;
  height: auto;
  max-width: 100%;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}
.project-extra-media.is-collage .collage-item.is-dragging {
  z-index: 6;
  cursor: grabbing;
}
.project-extra-media.is-collage .collage-item-1 {
  --x: 6%;
  --y: 8%;
  --w: 22%;
  --z: 2;
  --r: -2deg;
}
.project-extra-media.is-collage .collage-item-2 {
  --x: 28%;
  --y: 4%;
  --w: 30%;
  --z: 1;
  --r: 1deg;
}
.project-extra-media.is-collage .collage-item-3 {
  --x: 64%;
  --y: 6%;
  --w: 20%;
  --z: 3;
  --r: 2deg;
}
.project-extra-media.is-collage .collage-item-4 {
  --x: 12%;
  --y: 34%;
  --w: 28%;
  --z: 2;
  --r: -1deg;
}
.project-extra-media.is-collage .collage-item-5 {
  --x: 50%;
  --y: 32%;
  --w: 32%;
  --z: 1;
  --r: 0deg;
}
.project-extra-media.is-collage .collage-item-6 {
  --x: 34%;
  --y: 42%;
  --w: 22%;
  --z: 4;
  --r: 1deg;
}
.project-extra-media.is-collage .collage-item-7 {
  --x: 6%;
  --y: 62%;
  --w: 24%;
  --z: 2;
  --r: 2deg;
}
.project-extra-media.is-collage .collage-item-8 {
  --x: 34%;
  --y: 66%;
  --w: 26%;
  --z: 2;
  --r: -1deg;
}
.project-extra-media.is-collage .collage-item-9 {
  --x: 64%;
  --y: 60%;
  --w: 24%;
  --z: 2;
  --r: -2deg;
}
.project-extra-media.is-collage .collage-item-10 {
  --x: 46%;
  --y: 18%;
  --w: 18%;
  --z: 5;
  --r: -3deg;
}
.project-extra-media.is-collage .collage-item-11 {
  --x: 20%;
  --y: 18%;
  --w: 16%;
  --z: 4;
  --r: 2deg;
}
.project-extra-media.is-collage .collage-item-12 {
  --x: 74%;
  --y: 24%;
  --w: 16%;
  --z: 4;
  --r: -2deg;
}
.project-extra-media.is-collage .collage-item-13 {
  --x: 22%;
  --y: 78%;
  --w: 16%;
  --z: 3;
  --r: 1deg;
}
.project-extra-media.is-collage .collage-item-14 {
  --x: 70%;
  --y: 78%;
  --w: 16%;
  --z: 3;
  --r: 1deg;
}
.project-extra-media.is-collage .collage-item-15 {
  --x: 80%;
  --y: 40%;
  --w: 14%;
  --z: 3;
  --r: 4deg;
}
.project-extra-media.is-collage .collage-item-16 {
  --x: 52%;
  --y: 52%;
  --w: 14%;
  --z: 5;
  --r: -4deg;
}
.project-extra-item {
  margin: 0;
}
.project-extra-item img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  display: block;
}
.project-extra-item figcaption {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
@media (max-width: 991px) {
  .project-media.is-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .project-extra-media.is-flex-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 160px));
  }
  .project-extra-media.is-flex-grid.is-grid-4x2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-extra-media.is-flex-grid.is-grid-portrait {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .collage-viewer-nav {
    width: 38px;
    height: 38px;
  }
  .collage-viewer-prev {
    left: 12px;
  }
  .collage-viewer-next {
    right: 12px;
  }
  .collage-viewer-indicator {
    bottom: 14px;
  }
}

.close-btn {
  position: fixed;
  top: 30px;
  right: 30px;
  font-size: 2rem;
  cursor: none;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  z-index: 2001;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}
.close-btn:hover {
  transform: rotate(90deg);
  color: var(--accent);
}

/* --- FOOTER --- */
footer {
  background: var(--accent);
  color: #fff;
  padding: 100px 0;
  text-align: center;
  z-index: 10;
  position: relative;
  pointer-events: auto;
  transition: background 0.3s;
}

.contact-dropdown-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  cursor: none;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.contact-dropdown-btn:hover {
  background: #fff;
  color: var(--accent);
}
.contact-dropdown-btn.active i {
  transform: rotate(180deg);
}
.contact-form-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s ease-in-out, opacity 0.6s;
  opacity: 0;
  max-width: 600px;
  margin: 0 auto;
}
.contact-form-container.open {
  max-height: 800px;
  opacity: 1;
  margin-top: 2rem;
}
.form-control-custom {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  padding: 1rem 0;
  border-radius: 0;
}
.form-control-custom:focus {
  background: transparent;
  color: #fff;
  border-color: #fff;
  box-shadow: none;
}
.form-control-custom::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

@media (max-width: 767px) {
  .navbar {
    padding: 1rem !important;
  }
  .navbar .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .navbar-brand {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 48px);
  }
  .navbar-toggler {
    margin-left: auto;
  }
  .navbar-collapse {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 1rem;
    margin-top: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }
  .big-title {
    font-size: 16vw;
  }
  .gallery-item {
    width: 85vw;
  }
  /* Contenedor principal del personaje */
  .sticker-container {
    width: min(45vw, 200px);
    position: absolute;
    right: 6vw;
    bottom: 10vh;
    top: auto;
    left: auto;
    --sticker-offset-x: -120px;
    --sticker-offset-y: -140px;
    --eyes-x: 44%;
    --eyes-y: 14%;
    --eyes-width: 52%;
    --eyes-wink-offset-x: 4px;
    --eyes-wink-offset-y: -4px;
  }

  /* IMPORTANTE: Asegúrate de que la sección HERO (donde está el texto) tenga position: relative */
  .hero-section {
    /* O como se llame tu contenedor del texto "HOLA SOY TEA" */
    position: relative;
  }

  /* El resto del CSS interno del sticker se mantiene igual */
  .capa {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    display: block;
  }
  .base {
    position: relative;
    z-index: 1;
  }
  .eyes-open {
    z-index: 2;
  }
  .eyes-wink {
    z-index: 3;
    opacity: 0;
  }
  .tools-panel {
    width: 90%;
    justify-content: space-around;
    padding: 10px;
  }
  .section-title {
    font-size: 2.5rem;
    margin-left: 1rem;
  }
  #pencil-toggle-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  #about {
    padding-top: 15vh;
  }
}

@media (max-width: 767px) {
  .sticker-container {
    --eyes-y: calc(14% + 34px);
  }
}

@media (pointer: coarse) {
  .swipe-gallery-container {
    touch-action: pan-x;
  }
}

@media (max-width: 991px) {
  .project-extra-media.is-collage {
    height: auto;
    min-height: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .project-extra-media.is-collage .collage-item {
    position: static;
    width: 100%;
    transform: none;
  }
}

@media (min-width: 768px) {
  .navbar-toggler {
    display: none !important;
  }
  .navbar .container-fluid {
    flex-wrap: nowrap;
  }
}
.hover-trigger {
  cursor: none;
}

/* --- CONTACT TOAST --- */
.form-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2500;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.form-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.form-toast-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}
.form-toast-close {
  background: var(--text-main);
  color: var(--bg-color);
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: none;
}

/* --- REPRODUCTOR DE MÚSICA (CD) --- */
#music-widget {
  position: fixed;
  bottom: 90px; /* Un poco más arriba del botón de idioma */
  left: 30px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 15px;
}

.cd-player {
  position: relative;
  width: 50px;
  height: 50px;
  cursor: none;
  transition: transform 0.3s ease;
}

.cd-player:hover {
  transform: scale(1.1);
}

/* El disco de vinilo */
.cd-disk {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  /* Animación pausada por defecto */
  animation: spin 3s linear infinite;
  animation-play-state: paused;
}

/* Arte del disco */
.cd-art {
  width: 100%;
  height: 100%;
  background: repeating-radial-gradient(#111 0, #111 2px, #222 3px, #222 4px);
  opacity: 0.8;
  border-radius: 50%;
}

/* Agujero central */
.cd-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--bg-color);
  border-radius: 50%;
  z-index: 2;
  border: 1px solid #333;
}

/* Iconos Play/Pause */
#music-widget .fa-play,
#music-widget .fa-pause {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  z-index: 3;
  pointer-events: none;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

/* Clase activa: girar */
.cd-player.playing .cd-disk {
  animation-play-state: running;
}

/* Botón de Spotify */
.spotify-btn {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #1db954;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  text-decoration: none;
  transition: transform 0.3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: none;
}

.spotify-btn:hover {
  transform: scale(1.1) rotate(10deg);
  background: #1ed760;
  color: #fff;
}
.track-title {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.85rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 10px;
  border-radius: 999px;
}
.tracklist-panel {
  position: absolute;
  left: 0;
  bottom: 50px;
  width: 320px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#music-widget .tracklist-hint {
  margin-bottom: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
#music-widget .tracklist-hint + .track-title {
  margin-bottom: 6px;
}
#music-widget .tracklist-panel .track-title {
  background: rgba(255, 255, 255, 0.3);
}
body.dark-mode #music-widget .tracklist-panel {
  background: rgba(18, 18, 18, 0.35);
  border-color: rgba(255, 255, 255, 0.18);
}
body.dark-mode #music-widget .tracklist-panel .track-title {
  background: rgba(18, 18, 18, 0.28);
  border-color: rgba(255, 255, 255, 0.14);
}
#music-widget.tracklist-open .tracklist-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}
.tracklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.tracklist-heading {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tracklist-controls {
  display: flex;
  gap: 6px;
}
.track-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--text-main);
  color: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  transition: transform 0.2s ease;
}
.track-btn:hover {
  transform: scale(1.06);
}
.tracklist {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tracklist-item button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  cursor: none;
}
.tracklist-item button:hover {
  background: rgba(0, 0, 0, 0.06);
}
.tracklist-item.is-active button {
  background: var(--text-main);
  color: var(--bg-color);
  border-color: var(--text-main);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 767px) {
  #music-widget {
    bottom: 80px;
    left: 20px;
  }
  .tracklist-panel {
    width: 240px;
    bottom: 46px;
  }
  .track-title {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #cursor {
    display: none;
  }
  body {
    cursor: auto;
  }
  .cd-disk {
    animation: none !important;
  }
}

/* --- WIDGET IDIOMA (DESPLIEGUE HORIZONTAL) --- */
#lang-widget {
  position: fixed;
  bottom: 20px;
  left: 30px;
  z-index: 1001;
  display: flex;
  flex-direction: row; /* Alineación horizontal */
  align-items: center;
  gap: 15px;
}

/* Botón Principal */
#lang-toggle-btn {
  background: #1a1a1a;
  color: #fdfbf6;
  border: 1px solid #1a1a1a;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  cursor: none;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#lang-toggle-btn:hover {
  transform: scale(1.1);
}

/* Menú Desplegable Horizontal */
#lang-menu {
  display: flex;
  flex-direction: row; /* Opciones en fila */
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px); /* Animación desde la izquierda */
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#lang-widget.active #lang-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

#lang-widget.active #lang-toggle-btn {
  background: #fdfbf6;
  color: #1a1a1a;
  transform: rotate(90deg); /* Rotación para apertura lateral */
}

.lang-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fdfbf6;
  color: #1a1a1a;
  border: 1px solid #1a1a1a;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.lang-option:hover {
  background: #1a1a1a;
  color: #fdfbf6;
  transform: scale(1.1);
}

.lang-option.selected {
  background: #1a1a1a;
  color: #fdfbf6;
}

@media (max-width: 767px) {
  #lang-widget {
    bottom: 20px;
    left: 20px;
  }
}
