/* ─── Tipografía ─────────────────────────────────────────── */
@font-face { font-family: 'Trebuchet'; src: url('../fonts/Trebuchet MS.ttf') format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Trebuchet'; src: url('../fonts/Trebuchet MS Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'Trebuchet'; src: url('../fonts/Trebuchet MS Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'Trebuchet'; src: url('../fonts/Trebuchet MS Bold Italic.ttf') format('truetype'); font-weight: 700; font-style: italic; }

/* ─── Variables: desktop ─────────────────────────────────── */
:root {
  --c-main:              #cd91c0;
  --c-white:             #fff;
  --font-primary:        'Trebuchet', sans-serif;
  --font-size:           10px;
  --bg:                  #fff;
  --text:                #fff;
  --shadow-pink:         drop-shadow(0 0 0.8rem #cd91c0);
  --popup-bg:            rgba(255, 248, 255, 0.97);
  --popup-border:        var(--c-main);
  --titlebar:            transparent;

  --padd-btn:            0.6rem 2.4rem;
  --btn-font-size:       1.6rem;
  --btn-font-weight:     400;
  --btn-line-height:     1.2;
  --btn-letter-spacing:  0.01em;
  --btn-bg:              var(--c-main);
  --btn-border:          var(--c-white);
  --btn-border-width:    0.3rem;
  --btn-hover:           rgba(255, 255, 255, 0.22);

  --cursor-txt-bg:            var(--c-white);
  --cursor-txt-color:         var(--c-main);
  --cursor-txt-padding:       0.6rem 1.6rem;
  --cursor-txt-font-size:     1.6rem;
  --cursor-txt-letter-spacing: 0.01em;
}

/* ─── Variables: tablet ──────────────────────────────────── */
@media (max-width: 1020px) {
  :root {
    --padd-btn:           0.5rem 1.8rem;
    --btn-font-size:      1.4rem;
    --btn-border-width:   0.25rem;
    --cursor-txt-font-size: 1.3rem;
    --cursor-txt-padding: 0.5rem 1.4rem;
  }
}

/* ─── Variables: mobile ──────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --padd-btn:           0.4rem 1.4rem;
    --btn-font-size:      1.4rem;
    --btn-border-width:   0.2rem;
    --cursor-txt-font-size: 1.2rem;
    --cursor-txt-padding: 0.4rem 1.2rem;
  }
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font-primary); font-size: var(--font-size); cursor: none; user-select: none; }

/* ─── Custom cursor ──────────────────────────────────────── */
#cursor { position: fixed; pointer-events: none; z-index: 99999; transform: translate(-50%, -50%); }
#cursor svg { display: block; height: 4rem; width: auto; filter: var(--shadow-pink); }
#cursor svg * { fill: var(--c-main); stroke: var(--c-white); }
#cursor .cursor-txt { position: absolute; left: 4.8rem; top: 50%; transform: translateY(-50%) scale(0); transform-origin: left center; opacity: 0; visibility: hidden; max-width: 0; white-space: nowrap; display: flex; align-items: center; border-radius: 100rem; background: var(--cursor-txt-bg); color: var(--cursor-txt-color); font-size: var(--cursor-txt-font-size); letter-spacing: var(--cursor-txt-letter-spacing); padding: var(--cursor-txt-padding); filter: var(--shadow-pink); border: var(--btn-border-width) solid var(--c-main); font-family: var(--font-primary); transition: all 0.2s ease; }
#cursor.txt .cursor-txt { opacity: 1; visibility: visible; transform: translateY(-50%) scale(1); max-width: max-content; }

/* ─── Intro ──────────────────────────────────────────────── */
#intro { position: fixed; inset: 0; z-index: 1000; background: var(--bg); transition: opacity 1s ease; will-change: opacity; overflow: hidden; }
#intro.fade-out { opacity: 0; pointer-events: none; }
#intro-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: bottom center; display: block; filter: blur(0.4rem); }
#intro-title { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); margin: auto; width: auto; height: auto; max-width: 55vw; object-fit: contain; display: block; opacity: 0; transition: opacity 0.8s ease; pointer-events: none; }

@media (max-width: 768px) { 
  #intro-title { max-width: 70vw;}
}

/* ─── Main: desktop ──────────────────────────────────────── */
#main { position: relative; width: 100vw; height: 100dvh; overflow: hidden; }
#main-inner { position: relative; width: 100%; height: 100%; }
#main-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; display: block; }
#places { position: absolute; inset: 0; display: flex; }

.place { flex: 1; position: relative; cursor: none; transition: backdrop-filter 0.35s ease;}
.place:last-child { border-right: none; }
.place-overlay { position: absolute; inset: 0; }
.place-name { display: none; position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); padding: var(--padd-btn); font-size: var(--btn-font-size); font-weight: var(--btn-font-weight); line-height: var(--btn-line-height); letter-spacing: var(--btn-letter-spacing); font-family: var(--font-primary); background: var(--btn-bg); border: var(--btn-border-width) solid var(--btn-border); color: var(--text); border-radius: 100rem; white-space: nowrap; }
html.mobile-device .place-name { display: block; }

#main.has-hover .place:not(.hovered) { backdrop-filter: blur(0.125rem);}

/* ─── Fixed title ────────────────────────────────────────── */
#fixed-title { position: fixed; left: 50%; top: 40%; z-index: 400; transform: translate(-50%, -50%); margin: auto; width: auto; height: auto; max-width: 55vw; object-fit: contain; display: block; pointer-events: none; }
#fixed-title img { height: auto; width: auto; display: block; max-width: 55vw;}

@media (max-width: 768px) { 
  #fixed-title,
  #fixed-title img { max-width: 70vw;}
}

/* ─── Fixed top-right buttons ────────────────────────────── */
#fixed-buttons { position: fixed; top: 1.5rem; right: 1.5rem; z-index: 800; display: flex; gap: 0.6rem; align-items: center; }
.fixed-btn { cursor: none; padding: var(--padd-btn); font-size: var(--btn-font-size); font-weight: var(--btn-font-weight); line-height: var(--btn-line-height); letter-spacing: var(--btn-letter-spacing); font-family: var(--font-primary); background: var(--btn-bg); backdrop-filter: blur(1rem); border: var(--btn-border-width) solid var(--btn-border); color: var(--text); border-radius: 100rem; transition: background 0.2s, border-color 0.2s; }
.fixed-btn:hover { background: var(--btn-hover); border-color: rgba(255, 255, 255, 0.4); }
.fixed-btn.primary { background: var(--c-white); color: var(--c-main); border-color: var(--c-main);}
.fixed-btn.primary:hover { filter: brightness(1.1); }

/* ─── Sims menu ──────────────────────────────────────────── */
#sims-menu { position: fixed; z-index: 10000; display: none; pointer-events: none; }
#sims-menu.active { display: block; pointer-events: all; }
#sims-dot { position: absolute; width: 0.8rem; height: 0.8rem; background: var(--c-main); border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 1rem var(--c-main); pointer-events: none; }

.sims-item { position: absolute; white-space: nowrap; transform: translate(-50%, -50%); padding: var(--padd-btn); font-size: var(--btn-font-size); font-weight: var(--btn-font-weight); line-height: var(--btn-line-height); letter-spacing: var(--btn-letter-spacing); font-family: var(--font-primary); background: var(--btn-bg); border: var(--btn-border-width) solid var(--c-white); color: var(--text); border-radius: 100rem; cursor: none; transition: all 0.4s ease-in-out; opacity: 0; animation: simsItemIn 0.25s ease forwards; }
.sims-item:hover { color: var(--c-main); background: var(--c-white); border-color: var(--c-main); transform: translate(-50%, -50%) scale(1.05); }
.sims-item:nth-child(2) { animation-delay: 0.00s; }
.sims-item:nth-child(3) { animation-delay: 0.04s; }
.sims-item:nth-child(4) { animation-delay: 0.08s; }

@keyframes simsItemIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ─── Popup windows ──────────────────────────────────────── */
.popup-window { position: fixed; z-index: 750; background: var(--popup-bg); border: 0.25rem solid var(--c-main); border-radius: 2rem; box-shadow: 0 1.2rem 5rem rgba(180, 120, 180, 0.18); display: flex; flex-direction: column; overflow: hidden; min-width: 32rem; min-height: 20rem; max-width: 72vw; max-height: 82dvh; resize: both; animation: popupIn 0.22s ease forwards; }
.popup-titlebar { display: flex; align-items: center; justify-content: space-between; margin: 1.2rem 1.2rem 0; padding: 0 1.6rem; background: var(--c-main); cursor: move; flex-shrink: 0; border: 3px solid var(--c-main); border-radius: 2.4rem;}
.popup-close { width: 2.4rem; height: 2.4rem; background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--c-white); font-size: 2rem; line-height: 1; opacity: 0.7; transition: opacity 0.15s; flex-shrink: 0; }
.popup-close:hover { opacity: 1; }
.popup-body { flex: 1; overflow: auto; padding: 0; scrollbar-width: thin; scrollbar-color: rgba(200, 162, 232, 0.3) transparent; margin: 1.2rem; border: 3px solid var(--c-main); border-radius: 1.2rem;}

/* info text */
.popup-info-text { padding: 2rem 2.4rem; }
.popup-info-text h3 { font-size: 1.8rem; font-weight: 400; letter-spacing: 0.06em; color: var(--c-main); margin-bottom: 1.2rem; }
.popup-info-text p { font-size: 1.35rem; line-height: 1.9; color: var(--c-main); opacity: 0.85; }

/* gallery fullwidth */
.popup-gallery-wrap { height: 100%; }
.popup-gallery-wrap .gallery-carousel { height: 100%; }

/* activities */
.popup-activities-wrap { padding: 2rem 2.4rem; }
.popup-activities-wrap h3 { font-size: 1.8rem; font-weight: 400; letter-spacing: 0.06em; color: var(--c-main); margin-bottom: 1.2rem; }
.popup-activities-wrap p, .popup-activities-wrap li { font-size: 1.35rem; line-height: 1.9; color: var(--c-main); opacity: 0.85; }
.popup-activities-wrap ul { padding-left: 1.6rem; }
.popup-activities-wrap li { margin-bottom: 0.4rem; }

/* shared gallery */
.gallery-carousel { width: 100%; }
.flickity-viewport { height: 100% !important; }
.gallery-cell { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gallery-cell a { display: block; width: 100%; height: 100%; }
.gallery-cell img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.flickity-prev-next-button { width: 3.2rem !important; height: 3.2rem !important; background: rgba(255, 248, 255, 0.85) !important; border: 0.3rem solid var(--c-main) !important; border-radius: 50% !important; box-shadow: none !important; }
.flickity-prev-next-button:hover { background: rgba(255, 248, 255, 1) !important; }
.flickity-prev-next-button .flickity-button-icon { display: none; }
.flickity-prev-next-button::after { content: ''; display: block; width: 0.9rem; height: 0.9rem; border-right: 0.25rem solid var(--c-main); border-top: 0.25rem solid var(--c-main); position: absolute; top: 50%; left: 50%; }
.flickity-prev-next-button.previous::after { transform: translate(-30%, -50%) rotate(-135deg); }
.flickity-prev-next-button.next::after { transform: translate(-70%, -50%) rotate(45deg); }
.flickity-page-dots .dot { background: var(--c-main) !important; opacity: 0.35; }
.flickity-page-dots .dot.is-selected { opacity: 1; }

@keyframes popupIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── Scroll arrow ───────────────────────────────────────── */
#scroll-arrow { display: none; position: fixed; right: 2rem; top: 50%; transform: translateY(-50%); z-index: 100; pointer-events: none; opacity: 0; transition: opacity 0.6s ease;}
#scroll-arrow::before { content: ''; display: block; width: 4rem; height: 4rem; border-radius: 50%; background-color: var(--c-main); opacity: .2; filter: blur(.8rem); position: absolute; top: 0; left: 0; z-index: 1; animation: arrowPulse 1.4s ease-in-out infinite; }
#scroll-arrow.visible { opacity: 1; }
#scroll-arrow.hidden { opacity: 0; }
#scroll-arrow svg { width: 4rem; height: 4rem; stroke: var(--c-white); position: relative; z-index: 2;  animation: arrowPulse 1.4s ease-in-out infinite; }

@keyframes arrowPulse {
  0%, 100% { transform: translateX(0); opacity: 0.7; }
  50% { transform: translateX(0.6rem); opacity: 1; }
}

@media (max-width: 1020px) {
  #scroll-arrow { display: block; }
}

/* ─── Audio popup ────────────────────────────────────────── */
.audio-popup-wrap { padding: 2rem 2.4rem; }
.audio-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.audio-item-title { font-size: 1.2rem; letter-spacing: 0.18em; color: var(--c-main); opacity: 0.6; margin-bottom: 0.4rem; }
.audio-item audio { width: 100%; height: 3.2rem; }

/* ─── Video popup ────────────────────────────────────────── */
.video-popup .popup-body { overflow: hidden; }
.video-wrapper { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-wrapper iframe, .video-wrapper video { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ─── Backdrop ───────────────────────────────────────────── */
#backdrop { position: fixed; inset: 0; z-index: 690; display: none; }
#backdrop.active { display: block; }
.scroll-hint { display: none; }

/* ─── Star menu (mobile only) ────────────────────────────── */
#star-menu { display: none; position: fixed; top: 1rem; right: 1rem; z-index: 800; align-items: flex-end; flex-direction: column; gap: 0.6rem; }
#star-menu-btn { position: relative; background: none; border: none; cursor: pointer; padding: 0; width: 4rem; height: 4rem; display: flex; align-items: center; justify-content: center; }
#star-menu-btn::before { content:''; display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c-main); border: 0.3rem solid var(--c-white); transition: all 0.2s; }
#star-menu-btn svg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; height: 100%; }
#star-menu-btn svg polygon { fill: var(--c-white); transition: fill 0.2s; }

#star-menu-btn.open::before { background: var(--c-white); border: 0.3rem solid var(--c-main);}
#star-menu-btn.open svg polygon { fill: var(--c-main); }
#star-menu-dropdown { display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; overflow: hidden; max-height: 0; opacity: 0; transition: max-height 0.3s ease, opacity 0.25s ease; }
#star-menu-dropdown.open { max-height: 20rem; opacity: 1; }

/* ─── Interacciones: solo dispositivos táctiles ───────────── */
html.mobile-device, html.mobile-device body { cursor: auto; }
html.mobile-device #cursor { display: none; }
html.mobile-device .fixed-btn, html.mobile-device .place { cursor: pointer; }
html.mobile-device #sims-menu { display: none !important; }
html.mobile-device #main { touch-action: pan-x; }

/* ─── Tablet (layout only) ───────────────────────────────── */
@media (max-width: 1020px) {
  #main { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; width: 100vw; }
  #main::-webkit-scrollbar { display: none; }

  #main-inner { width: 165vw; height: 100dvh; }
  #main-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
  #places { position: absolute; inset: 0; }
  .place { scroll-snap-align: start; }

  #fixed-buttons { top: 1rem; right: 1rem; gap: 0.4rem; }
}

/* ─── Mobile ─────────────────────────────────────────────── */
@media (max-width: 768px) { 
  #main-inner { width: 300vw; }
  #intro-video { width: 300vw; height: 100%; inset: auto; top: 0; left: 50%; transform: translateX(-50%); object-position: center bottom; }
  .place { scroll-snap-align: start; }
  #fixed-buttons { display: none; }
  #star-menu { display: flex; }

  #mobile-sheet { position: fixed; bottom: 0; left: 0; right: 0; z-index: 700; background: var(--popup-bg); border: 0.3rem solid var(--c-main); border-bottom: none; border-radius: 2rem 2rem 0 0; padding: 0.8rem 1.6rem 3rem; transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1); }
  #mobile-sheet.open { transform: translateY(0); }

  .mobile-sheet-handle { width: 3.6rem; height: 0.4rem; background: rgba(200, 162, 232, 0.35); border-radius: 0.2rem; margin: 0 auto 1.4rem; }
  .mobile-sheet-place { font-size: 1.1rem; letter-spacing: 0.25em; color: var(--c-main); opacity: 0.5; margin-bottom: 0.3rem; }
  .mobile-sheet-title { font-size: 2rem; font-weight: 300; letter-spacing: 0.06em; margin-bottom: 1.6rem; color: var(--c-main); }
  .mobile-sheet-options { display: flex; flex-direction: column; gap: 0.8rem; }
  .mobile-sheet-btn { padding: 0.8rem 1.4rem; font-size: var(--btn-font-size); font-weight: var(--btn-font-weight); line-height: var(--btn-line-height); letter-spacing: var(--btn-letter-spacing); font-family: var(--font-primary); background: transparent; border: var(--btn-border-width) solid var(--c-main); color: var(--c-main); border-radius: 100rem; cursor: pointer; text-align: center; transition: background 0.15s; }
  .mobile-sheet-btn:active { background: rgba(200, 162, 232, 0.15); }

  /* popup como bottom sheet */
  .popup-window { width: 100vw !important; max-width: 100vw !important; min-width: 0 !important; height: 88dvh !important; max-height: 88dvh !important; min-height: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important; border-radius: 2rem 2rem 0 0; border: none; border: 0.3rem solid var(--c-main); border-bottom: none; box-shadow: 0 -0.8rem 4rem rgba(180, 120, 180, 0.2); resize: none; animation: mobilePopupIn 0.35s cubic-bezier(0.32, 0.72, 0, 1) forwards; }
  .popup-window.popup-closing { animation: mobilePopupOut 0.32s cubic-bezier(0.32, 0.72, 0, 1) forwards; }
  .popup-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .popup-gallery-wrap .gallery-carousel { height: 42rem; }
  .place-name { font-size: 1.1rem !important; padding: 0.3rem 1rem !important; }

  #mobile-sheet-backdrop { position: fixed; inset: 0; z-index: 695; background: rgba(0, 0, 0, 0.5); display: none; }
  #mobile-sheet-backdrop.active { display: block; }


  .scroll-hint { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); opacity: 0.35; display: flex; align-items: center; pointer-events: none; transition: opacity 0.5s; z-index: 100; visibility: visible; }
  .scroll-hint.hidden { opacity: 0; }
  .scroll-hint-dots { display: flex; gap: 0.4rem; }
  .scroll-hint-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: rgba(255, 255, 255, 0.4); transition: background 0.3s, transform 0.3s; }
  .scroll-hint-dot.active { background: var(--c-main); transform: scale(1.4); }

  @keyframes mobilePopupIn {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  @keyframes mobilePopupOut {
    from { transform: translateY(0); }
    to   { transform: translateY(100%); }
  }
}
