/* ═══════════════════════════════════════════════════════════════
   Playa Dormida — estilo compartido
   Un proyecto de Domótica Group
   ═══════════════════════════════════════════════════════════════ */
:root {
  --night:   #0A1119;
  --night-2: #101B26;
  --plate:   #E8EDF2;
  --sand:    #E6D2B5;
  --sand-2:  #C9AE88;
  --led:     #FFB347;
  --led-hot: #FFD79A;
  --foam:    #7FB7B8;
  --paper:   #F2EDE4;
  --line:    rgba(230,210,181,0.16);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  overflow-x: hidden;
}

/* ambiente nocturno de fondo */
.room {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(58% 46% at 50% 30%, rgba(255,179,71,0.05) 0%, rgba(10,17,25,0) 70%),
    radial-gradient(120% 90% at 50% 120%, rgba(27,85,102,0.30) 0%, rgba(10,17,25,0) 65%),
    linear-gradient(176deg, #070D14 0%, var(--night) 45%, var(--night-2) 100%);
}

a { color: inherit; }

/* ---------- barra superior ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(18px, 5vw, 56px);
  max-width: 1200px;
  margin: 0 auto;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--sand);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 8px 14px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(232,237,242,0.03);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.back:hover { border-color: rgba(230,210,181,0.4); background: rgba(232,237,242,0.06); transform: translateX(-2px); }
.back .arrow { font-size: 1.05rem; line-height: 1; }
.mark {
  font-family: var(--serif);
  font-size: 0.98rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(242,237,228,0.62);
}
.mark em { font-style: italic; color: var(--sand); }

/* ---------- cabecera de página ---------- */
header.page {
  text-align: center;
  padding: clamp(10px, 3vw, 26px) 20px clamp(18px, 4vw, 34px);
}
header.page .eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(230,210,181,0.6);
}
header.page h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 7vw, 4.2rem);
  line-height: 1.02;
  margin: 0;
  letter-spacing: -0.01em;
}
header.page h1 em { font-style: italic; color: var(--sand); }
header.page .where {
  margin: 14px 0 0;
  color: rgba(242,237,228,0.72);
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
}
header.page .where span { color: var(--led-hot); }

/* ---------- rejilla de zonas (portada) ---------- */
.zones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(14px, 2.4vw, 22px);
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(10px, 3vw, 24px) clamp(18px, 5vw, 40px) 40px;
}
.zone {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  background: var(--night-2);
  isolation: isolate;
  transition: transform 0.28s cubic-bezier(.2,.7,.2,1), border-color 0.28s ease, box-shadow 0.28s ease;
}
.zone:hover, .zone:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(255,179,71,0.5);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,179,71,0.15);
  outline: none;
}
.zone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  filter: saturate(1.02) brightness(0.82);
  transition: transform 0.5s ease, filter 0.4s ease;
}
.zone:hover img { transform: scale(1.05); filter: saturate(1.06) brightness(0.9); }
.zone::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(7,13,20,0) 30%, rgba(7,13,20,0.55) 66%, rgba(7,13,20,0.92) 100%);
}
.zone .body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px 20px 22px;
}
.zone .kicker {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--led);
  margin-bottom: 8px;
}
.zone h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.55rem;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.zone p {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(242,237,228,0.72);
}
.zone .count {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: rgba(7,13,20,0.55);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  padding: 5px 11px;
  border-radius: 999px;
}

/* ---------- rejilla de medios (páginas de zona) ---------- */
.media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(14px, 2.2vw, 20px);
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(10px, 3vw, 20px) clamp(18px, 5vw, 40px) 30px;
}
.tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--night-2);
  color: inherit;
  cursor: pointer;
  aspect-ratio: 9 / 16;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.tile.wide { aspect-ratio: 16 / 10; }
.tile:hover, .tile:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(255,179,71,0.5);
  box-shadow: 0 16px 36px -18px rgba(0,0,0,0.7);
  outline: none;
}
.tile img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.86);
  transition: transform 0.5s ease, filter 0.35s ease;
}
.tile:hover img { transform: scale(1.04); filter: brightness(0.95); }
.tile .grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,13,20,0) 45%, rgba(7,13,20,0.82) 100%);
}
.tile .label {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  text-align: left;
}
.tile .label .t {
  display: block;
  font-family: var(--serif);
  font-size: 1.15rem;
  margin-bottom: 2px;
}
.tile .label .s {
  display: block;
  font-size: 0.8rem;
  color: rgba(242,237,228,0.72);
}
.tile .play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(7,13,20,0.5);
  border: 1px solid rgba(255,215,154,0.6);
  color: var(--led-hot);
  backdrop-filter: blur(6px);
  transition: transform 0.25s ease, background 0.25s ease;
}
.tile:hover .play { transform: translate(-50%, -50%) scale(1.08); background: rgba(255,179,71,0.22); }
.tile .play svg { width: 22px; height: 22px; margin-left: 3px; }

/* ---------- pie ---------- */
footer.page {
  text-align: center;
  padding: 26px 20px 40px;
  color: rgba(242,237,228,0.5);
}
footer.page a { color: var(--sand); text-decoration: none; }
footer.page a:hover { text-decoration: underline; }
footer.page .brand { margin: 0; font-size: 0.9rem; }

/* ---------- modal / reproductor ---------- */
.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5,9,14,0.7);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal.open { opacity: 1; }
.dialog {
  width: min(1000px, 96vw);
  max-height: 92vh;
  background: var(--night-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.32s cubic-bezier(.2,.7,.2,1);
  display: flex;
  flex-direction: column;
}
.modal.open .dialog { transform: none; }
.dialog.portrait { width: min(420px, 92vw); }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 14px 20px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dialog-head .tag {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--led);
  border: 1px solid rgba(255,179,71,0.35);
  padding: 3px 9px;
  border-radius: 999px;
}
.close {
  border: 1px solid var(--line);
  background: rgba(232,237,242,0.04);
  color: var(--paper);
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.close:hover { background: rgba(232,237,242,0.1); border-color: rgba(230,210,181,0.4); }
.video-slot {
  background: #000;
  display: grid;
  place-items: center;
  min-height: 200px;
}
.video-slot video, .video-slot img, .video-slot iframe {
  width: 100%;
  max-height: 82vh;
  display: block;
  border: 0;
}
.video-slot.portrait video, .video-slot.portrait img { max-height: 78vh; width: 100%; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
