/* ============================================
   STIVIJOES.COM — STYLES
   ============================================ */

:root {
  --negro: #0d0d0b;
  --blanco: #f5f2ee;
  --tab-w: 110px;
  --logo-w: 200px;
  --logo-zone: calc(200px + 34px);
  --icon-filter: invert(1) brightness(0.96) sepia(0.04);
  --sat: env(safe-area-inset-top, 0px);
}

@font-face {
  font-family: 'Printvetica';
  src: url('fonts/printvetica.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'StiviBody';
  src: url('fonts/helvetica-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'StiviBody';
  src: url('fonts/helvetica-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'StiviBody';
  src: url('fonts/helvetica-oblique.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: 'StiviBody';
  src: url('fonts/helvetica-bold-oblique.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
}
@font-face {
  font-family: 'StiviBody';
  src: url('fonts/helvetica-light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--negro);
  color: var(--blanco);
  font-family: 'StiviBody', sans-serif;
  overscroll-behavior: none;
}


/* ── PULL-TO-REFRESH INDICATOR ── */

#pull-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--logo-w) / 1.875 + 30px + var(--sat));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  transform: translateY(-100%);
  background: var(--negro);
  pointer-events: none;
}

@media (max-width: 1024px) {
  #pull-indicator {
    height: calc(min(160px, 40vw) / 1.875 + 33px + var(--sat));
  }
}

#pull-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(245, 242, 238, 0.25);
  border-top-color: var(--blanco);
}

@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

#pull-spinner.spinning {
  animation: ptr-spin 0.6s linear infinite;
}


/* ── CUBRE VIDEO DURANTE ANIMACIONES ── */

#anim-cover {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--negro);
  z-index: 10;
  pointer-events: none;
}

body.panel-animating #anim-cover {
  display: block;
}

body.resizing .tab-strip,
body.resizing .tab-bg,
body.resizing .tab-mobile,
body.resizing .tab-mobile-bg,
body.resizing .panel {
  transition: none !important;
}




/* ── SCROLL CONTAINER ── */

#scroll-container {
  position: fixed;
  inset: 0;
  overflow-y: hidden;
  scrollbar-width: none;
}

#scroll-container::-webkit-scrollbar { display: none; }

#scroll-inner {
  width: 100%;
}


/* ── SECCIÓN 1: LANDING ── */

#section-landing {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

#bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

#video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 11, 0.38);
  z-index: 1;
}


/* ── TOP BAR (protege logo en bio) ── */

#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--logo-w) / 1.875 + 24px + var(--sat));
  background: transparent;
  z-index: 100;
  pointer-events: none;
}

body.bio-mode #top-bar {
  background: var(--negro);
}


/* ── LOGO + FLECHA ── */

#logo-wrap {
  position: fixed;
  top: calc(16px + var(--sat));
  right: 17px;
  z-index: 1000;
  cursor: pointer;
}

#logo-svg {
  display: block;
  width: var(--logo-w);
  height: auto;
  color: var(--blanco);
  transition: transform 0.15s ease;
}

#logo-wrap:hover #logo-svg {
  transform: scale(1.06);
}

#flecha-wrap {
  position: absolute;
  bottom: 6%;
  right: 6%;
}

@keyframes flecha-idle {
  0%   { transform: translate(0, 0); }
  15%  { transform: translate(-2px, -2px); }
  30%  { transform: translate(0, 0); }
  50%  { transform: translate(-2px, -2px); }
  65%  { transform: translate(0, 0); }
  100% { transform: translate(0, 0); }
}

#flecha-wrap.idle-anim {
  animation: flecha-idle 2s ease;
}

#flecha-svg {
  display: block;
  width: 28px;
  height: auto;
  color: var(--blanco);
  transition: transform 0.15s ease;
}

#flecha-svg.rotated {
  transform: rotate(180deg);
}


/* ── TABS DESKTOP ── */

.tab-strip {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--tab-w);
  background: var(--negro);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 300;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;

}

.tab-bg {
  position: fixed;
  top: -60px;
  bottom: -60px;
  left: 0;
  width: calc(var(--tab-w) + 500px);
  margin-left: -500px;
  background: var(--negro);
  z-index: 5;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-strip span {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  font-family: 'Printvetica', sans-serif;
  font-size: 87px;
  letter-spacing: 0;
  color: var(--blanco);
  white-space: nowrap;
}

#tab-bar-mobile {
  display: none;
}

.tab-mobile-bg {
  display: none;
}


/* ── PANELES ── */

.panel {
  position: fixed;
  top: -60px;
  bottom: -60px;
  background: var(--negro);
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 116px 44px 116px 44px;
}
.panel::-webkit-scrollbar { display: none; }

.panel.open {
  transform: translateX(0);
}

.panel-title {
  font-family: 'Printvetica', sans-serif;
  font-size: 40px;
  letter-spacing: 0.06em;
  color: var(--blanco);
  margin-bottom: 36px;
}

/* overlay para cierre al click fuera */
#panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
}
#panel-overlay.active { display: block; }


/* ── PANEL: CONCIERTOS ── */

.conciertos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.concierto-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transform: translateZ(0);
}

.concierto-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s ease;
}

.concierto-card.agotado::after {
  content: 'AGOTADO';
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 11, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'StiviBody', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.22em;
  color: var(--blanco);
  transition: opacity 0.2s ease;
}


/* ── PANEL: TIENDA ── */

.tienda-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.merch-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: block;
  text-decoration: none;
}

.merch-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s ease;
}

.merch-card:hover img {
  opacity: 0;
}

.merch-info {
  position: absolute;
  inset: 0;
  background: var(--blanco);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 16px;
  text-align: center;
}

.merch-card:hover .merch-info {
  opacity: 1;
}

.merch-nombre {
  font-family: 'StiviBody', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--negro);
  margin-bottom: 5px;
}

.merch-precio {
  font-family: 'StiviBody', sans-serif;
  font-size: 13px;
  color: var(--negro);
}


/* ── PANEL: CONTACTO ── */

.contacto-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px 60px;
}

.contacto-marcos-wrap {
  position: relative;
  display: inline-block;
  padding: 60px 80px;
  margin-bottom: 40px;
}

.marco-img {
  position: absolute;
  width: min(130px, 10vw);
  height: auto;
  filter: var(--icon-filter);
  pointer-events: none;
}

.marco-img.tl {
  top: -14px;
  left: 16px;
}

.marco-img.br {
  bottom: -14px;
  right: 16px;
  transform: rotate(180deg);
}

.contacto-bloques {
  display: flex;
  flex-direction: column;
  gap: 36px;
  text-align: center;
  margin-bottom: 0;
  width: 100%;
}

.contacto-bloque h3 {
  font-family: 'Printvetica', sans-serif;
  font-weight: 400;
  font-size: 32px;
  letter-spacing: 0;
  margin-bottom: 6px;
  color: var(--blanco);
}

.contacto-bloque a {
  font-family: 'StiviBody', sans-serif;
  font-weight: 400;
  font-size: 24px;
  color: var(--blanco);
  text-decoration: none;
}

.contacto-bloque a:hover { opacity: 1; }

.contacto-social {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 100px;
  margin-bottom: 28px;
}

.contacto-social a {
  display: flex;
  align-items: center;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.contacto-social a:hover { opacity: 1; }

.contacto-social img {
  width: 20px;
  height: auto;
  filter: var(--icon-filter);
}

.contacto-footer {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-family: 'StiviBody', sans-serif;
  font-size: 11px;
  opacity: 0.4;
}

.contacto-footer a {
  color: var(--blanco);
  text-decoration: none;
}

.contacto-footer a:hover { opacity: 1; text-decoration: underline; }


/* ── SECCIÓN 2: BIO ── */

#section-bio {
  min-height: 100vh;
  background: var(--negro);
  padding-top: calc(var(--logo-w) / 1.875 + 76px + var(--sat));
  padding-bottom: 80px;
  padding-left: calc(3 * var(--tab-w) + 20px);
  padding-right: 20px;
}

.bio-layout {
  display: grid;
  grid-template-columns: 45% 1fr;
  gap: 40px;
  margin-bottom: 56px;
  align-items: stretch;
}

.bio-texto {
  font-family: 'StiviBody', sans-serif;
  font-weight: 400;
  font-size: 9px;
  line-height: 1.90;
  color: var(--blanco);
}

.bio-texto p + p { margin-top: 36px; }

.bio-fotos-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 3fr 2fr 3fr 2fr 3fr;
  gap: 6px;
}

.bio-fotos-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bio-fotos-mosaic img:nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
.bio-fotos-mosaic img:nth-child(2) { grid-column: 1; grid-row: 3; }
.bio-fotos-mosaic img:nth-child(3) { grid-column: 1; grid-row: 4 / 6; }
.bio-fotos-mosaic img:nth-child(4) { grid-column: 2; grid-row: 1; }
.bio-fotos-mosaic img:nth-child(5) { grid-column: 2; grid-row: 2 / 5; }
.bio-fotos-mosaic img:nth-child(6) { grid-column: 2; grid-row: 5; }

.media-section {
  margin-bottom: 32px;
}

.spotify-wrap {
  margin-top: 48px;
}

.media-label {
  font-family: 'Printvetica', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  opacity: 0.4;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.videos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.videos-grid iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  display: block;
}

.spotify-wrap iframe {
  width: 100%;
  height: 830px;
  border: none;
  display: block;
}

.bio-social {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 40px 0 0;
}

.bio-social a {
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.bio-social a:hover { opacity: 1; }

.bio-social img {
  width: 20px;
  height: auto;
  filter: var(--icon-filter);
}


/* ── MOBILE + TABLET (≤ 1024px) ── */

@media (max-width: 1024px) {

  #logo-wrap {
    top: calc(16px + var(--sat));
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
  }

  #logo-wrap:hover {
    transform: translateX(-50%);
  }

  #logo-svg {
    width: min(160px, 40vw);
  }

  #flecha-svg {
    width: 22px;
  }

  /* Ocultar tabs desktop */
  .tab-strip { display: none; }
  .tab-bg    { display: none; }

  /* Tab bar móvil — cada tab es fixed independiente */
  #tab-bar-mobile {
    display: block;
  }

  /* Fondo extendido hacia abajo (espejo de tab-bg desktop que extiende a la izquierda) */
  .tab-mobile-bg {
    display: block;
    position: fixed;
    left: -60px;
    right: -60px;
    top: 0;
    height: calc(56px + 700px);
    background: var(--negro);
    z-index: 5;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .tab-mobile {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Printvetica', sans-serif;
    font-size: clamp(24px, 6vw, 48px);
    color: var(--blanco);
    cursor: pointer;
    user-select: none;
    background: var(--negro);
    z-index: 300;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 0 var(--negro);
  }

  /* Pre-composición de paneles y sus imágenes para evitar latencia al abrir */
  .panel {
    will-change: transform;
  }
  .panel img {
    will-change: transform;
  }

  /* Paneles móvil: suben desde abajo al abrirse por primera vez */
  .panel {
    top: calc(min(220px, 56vw) / 1.875 + 66px);
    bottom: 168px;
    left: 0 !important;
    right: 0 !important;
    transform: translateY(calc(100% + 300px));
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 32px 24px !important;
  }

  /* padding-top fijo por panel para no invalidar GPU layer al abrir */
  #panel-conciertos { padding-top: 104px !important; }
  #panel-tienda     { padding-top: 176px !important; }
  #panel-contacto   { padding-top: 182px !important; }

  .panel.open {
    transform: translateY(0);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Top bar móvil */
  #top-bar {
    height: calc(min(160px, 40vw) / 1.875 + 27px + var(--sat));
  }

  /* Bio móvil */
  #section-bio {
    padding-top: calc(min(160px, 40vw) / 1.875 + 68px + var(--sat));
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: calc(168px + 32px);
  }

  .bio-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Mosaico móvil: sin altura explícita los fr-rows colapsan */
  .bio-fotos-mosaic {
    height: 120vw;
  }

  /* Espacio entre fotos y vídeos */
  .media-section {
    margin-top: 40px;
  }

  /* Contacto: compactar todo para que quepa sin scroll */
  .contacto-social {
    margin-top: 20px;
    margin-bottom: 16px;
  }

  .contacto-bloques {
    gap: 18px;
  }

  .contacto-bloque h3 {
    font-size: 18px !important;
    margin-bottom: 3px;
  }

  .contacto-bloque a {
    font-size: 13px !important;
  }

  .contacto-marcos-wrap {
    padding: 24px 28px !important;
    margin-bottom: 0 !important;
  }

  /* Spotify: altura reducida para no ocupar pantalla completa */
  .spotify-wrap iframe {
    height: 400px;
    touch-action: pan-y;
  }

}


/* ── MOBILE (≤ 768px) ── */

@media (max-width: 768px) {

  .videos-grid {
    grid-template-columns: 1fr;
  }

}


/* ── TABLET (769px – 1024px) ── */

@media (min-width: 769px) and (max-width: 1024px) {

  .conciertos-grid,
  .tienda-grid,
  .videos-grid {
    grid-template-columns: 1fr 1fr;
  }

  .bio-texto {
    font-size: 16px !important;
  }

  .contacto-marcos-wrap {
    width: auto;
    display: inline-block;
    padding: 40px 32px;
  }

  .marco-img {
    width: 60px;
  }

  .marco-img.tl {
    top: 8px;
    left: 8px;
  }

  .marco-img.br {
    bottom: 8px;
    right: 8px;
  }

  .contacto-bloque {
    text-align: center;
  }

  .contacto-bloque h3 {
    font-size: 22px;
  }

  .contacto-bloque a {
    font-size: 16px;
  }

}
