/* =============================================================================
   IPER — hoja única de estilos (tokens + componentes custom).
   Tailwind (Play CDN) cubre el layout; aquí vive lo que Tailwind no expresa:
   el escenario del carrusel Spotlight, sus tarjetas 3D y los microefectos.
   ========================================================================== */

/* === Design tokens ======================================================== */
:root {
  --ink:          #1c1917;
  --ink-soft:     #57534e;
  --ink-mute:     #a8a29e;
  --stage-50:     #fdfcfa;
  --stage-100:    #faf8f4;
  --stage-200:    #efece5;
  --stage-300:    #e2ddd2;
  --gold:         #f5b301;

  --font-display: "Fraunces", Georgia, serif;
  --font-sans:    "Inter", system-ui, sans-serif;

  --radius-card:  22px;
  --radius-full:  9999px;

  --shadow-card:        0 18px 40px -18px rgba(28,25,23,.35), 0 4px 12px -4px rgba(28,25,23,.12);
  --shadow-card-active: 0 40px 70px -24px rgba(28,25,23,.45), 0 10px 24px -8px rgba(28,25,23,.18);

  --ease-standard: cubic-bezier(.4,0,.2,1);
  --ease-out:      cubic-bezier(.16,1,.3,1);
  --duration-fast: .2s;
  --duration-base: .45s;

  /* Tamaño de tarjeta — el JS lo lee del DOM, no hace falta duplicarlo. */
  --card-w: clamp(190px, 23vw, 300px);
  --card-h: calc(var(--card-w) * 1.32);
}

html { scroll-behavior: smooth; }
body { background: var(--stage-100); overflow-x: hidden; }
.font-display { font-family: var(--font-display); }

/* === Navegación / botones ================================================= */
.nav-link {
  padding: 8px 14px; border-radius: var(--radius-full);
  color: inherit; text-decoration: none;
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast);
}
.nav-link:hover { background: var(--stage-200); color: var(--ink); }

.btn-ink {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink); color: var(--stage-50);
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast);
}
.btn-ink:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(28,25,23,.6); }

.serinfotech-link {
  display: inline-flex; padding: 2px 10px; border-radius: var(--radius-full);
  color: inherit; text-decoration: none;
  box-shadow: 0 0 0 1px var(--stage-300);
  transition: all var(--duration-fast) var(--ease-standard);
}
.serinfotech-link:hover { background: var(--ink); color: var(--stage-50); }

.nav-link:focus-visible, .btn-ink:focus-visible, .serinfotech-link:focus-visible,
.spotlight-arrow:focus-visible, .spotlight-dot:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* === Spotlight: escenario ================================================= */
.spotlight {
  position: relative;
  overflow: hidden;
  padding: 56px 0 64px;
  /* Escenario claro con un "foco" de luz detrás de la tarjeta central. */
  background:
    radial-gradient(ellipse 55% 48% at 50% 52%, #ffffff 0%, rgba(255,255,255,.65) 40%, transparent 72%),
    linear-gradient(180deg, var(--stage-100) 0%, var(--stage-200) 100%);
}

.spotlight-eyebrow {
  font-size: .75rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.spotlight-stage {
  position: relative;
  margin: 40px auto 0;
  outline: none;
}

/* Sin JS: fila horizontal con scroll-snap (todo sigue siendo accesible). */
.spotlight-stage:not(.is-ready) {
  display: flex; gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 20px max(16px, calc(50% - var(--card-w) / 2));
}
.spotlight-stage:not(.is-ready) .spotlight-card { scroll-snap-align: center; }

/* Con JS: tarjetas apiladas en el centro, el JS las reparte sobre el arco. */
.spotlight-stage.is-ready {
  height: calc(var(--card-h) * 1.22);
  touch-action: pan-y;          /* el scroll vertical de la página sigue funcionando */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.spotlight-stage.is-ready.is-dragging { cursor: grabbing; }
.spotlight-stage.is-ready:focus-visible { box-shadow: inset 0 0 0 2px rgba(28,25,23,.15); border-radius: 24px; }

.spotlight-floor {
  position: absolute; left: 50%; bottom: 2%;
  width: calc(var(--card-w) * 1.6); height: 46px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(28,25,23,.28) 0%, transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}
.spotlight-stage:not(.is-ready) .spotlight-floor { display: none; }

/* === Spotlight: tarjetas ================================================== */
.spotlight-card {
  --focus: 1;                    /* 1 = al frente, 0 = lejos (lo escribe el JS) */
  position: relative;
  flex: 0 0 auto;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--c3, #1c1917);
  box-shadow: var(--shadow-card);
  color: #fff;
}
.spotlight-stage.is-ready .spotlight-card {
  position: absolute;
  left: 50%; top: 50%;
  margin-left: calc(var(--card-w) / -2);
  margin-top:  calc(var(--card-h) / -2);
  will-change: transform, opacity;
  backface-visibility: hidden;
  filter: saturate(calc(.55 + .45 * var(--focus))) brightness(calc(.86 + .14 * var(--focus)));
}
.spotlight-card.is-active { box-shadow: var(--shadow-card-active); }

.spotlight-card-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Arte de respaldo cuando no hay foto: degradado de la paleta + anillos. */
.spotlight-card-art {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 28% 18%, var(--c1) 0%, transparent 55%),
    radial-gradient(circle at 85% 90%, rgba(255,255,255,.18) 0%, transparent 40%),
    linear-gradient(160deg, var(--c2) 0%, var(--c3) 100%);
}
.spotlight-card-art::before,
.spotlight-card-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
}
.spotlight-card-art::before { width: 78%; aspect-ratio: 1; }
.spotlight-card-art::after  { width: 52%; aspect-ratio: 1; border-color: rgba(255,255,255,.3); }
.spotlight-card-art i {
  font-size: calc(var(--card-w) * .26);
  color: rgba(255,255,255,.88);
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.25));
}

.spotlight-card-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, transparent 28%, transparent 58%, rgba(0,0,0,.55) 100%);
  pointer-events: none;
}

.spotlight-card-tag {
  position: absolute; top: 14px; left: 14px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: .7rem; font-weight: 600; letter-spacing: .04em;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.spotlight-card-foot {
  position: absolute; left: 16px; right: 16px; bottom: 14px;
  display: flex; align-items: flex-end; justify-content: space-between;
  font-size: .82rem; font-weight: 500;
}
.spotlight-card-num {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 600; line-height: 1;
  opacity: .85;
}

/* === Spotlight: pie sincronizado ========================================== */
.spotlight-caption { margin-top: 28px; min-height: 172px; }
.spotlight-caption.is-swapping > * { animation: captionIn var(--duration-base) var(--ease-out) both; }
.spotlight-caption.is-swapping > *:nth-child(2) { animation-delay: .04s; }
.spotlight-caption.is-swapping > *:nth-child(3) { animation-delay: .08s; }
.spotlight-caption.is-swapping > *:nth-child(4) { animation-delay: .12s; }
@keyframes captionIn {
  from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.spotlight-rating {
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .95rem;
}
.spotlight-stars { display: inline-flex; gap: 2px; color: var(--gold); }

/* === Spotlight: controles ================================================= */
.spotlight-controls {
  margin-top: 22px;
  display: flex; align-items: center; justify-content: center; gap: 18px;
}
.spotlight-arrow {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: var(--ink);
  border: 1px solid var(--stage-300);
  box-shadow: 0 4px 12px -6px rgba(28,25,23,.3);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-standard), background var(--duration-fast), color var(--duration-fast);
}
.spotlight-arrow:hover { background: var(--ink); color: var(--stage-50); transform: translateY(-2px); }

.spotlight-dots { display: flex; align-items: center; gap: 8px; }
.spotlight-dot {
  width: 8px; height: 8px; padding: 0;
  border: 0; border-radius: var(--radius-full);
  background: var(--stage-300);
  cursor: pointer;
  transition: width var(--duration-base) var(--ease-out), background var(--duration-fast);
}
.spotlight-dot:hover { background: var(--ink-mute); }
.spotlight-dot[aria-selected="true"] { width: 28px; background: var(--ink); }

@media (max-width: 640px) {
  :root { --card-w: clamp(170px, 58vw, 240px); }
  .spotlight { padding: 40px 0 48px; }
  .spotlight-caption { min-height: 196px; }
}

@media (prefers-reduced-motion: reduce) {
  .spotlight-caption.is-swapping > * { animation: none; }
  html { scroll-behavior: auto; }
}

/* === Páginas de error ===================================================== */
.error-page {
  min-height: 100vh; margin: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); color: var(--ink);
  background: radial-gradient(ellipse at 50% 40%, #fff 0%, var(--stage-200) 80%);
}
.error-box { max-width: 420px; padding: 24px 16px; text-align: center; }
.error-box h1 { font-family: var(--font-display); font-size: 2.2rem; margin: 0 0 8px; }
.error-box p  { color: var(--ink-soft); }
.error-box .btn-ink { margin-top: 16px; padding: 10px 18px; border-radius: var(--radius-full); }
