/* =========================================================
   Museo Almodóvar — identidad del panel museográfico
   RAL 6033 (menta) · RAL 2003 (naranja)
   Futura condensada + Archivo  ·  totem 9:16 / tablet / móvil
   ========================================================= */

:root {
  --ral-6033: #497e76;
  --ral-2003: #fa9835;
  --mint: #6fc2b5;
  --mint-pale: #8fd0c5;
  --mint-deep: #2f5e58;
  --orange: #fa9835;
  --gold: #f3bd60;
  --rust: #7c1b15;
  --ink: #111111;
  --ink-soft: #1c2e2b;
  --muted: #2a4a46;
  --cream: #f3f7f2;
  --frame: #3a241c;
  --glass: rgba(255, 255, 255, 0.34);
  --glass-border: rgba(17, 17, 17, 0.16);
  --shadow: 0 22px 48px rgba(20, 40, 38, 0.22);
  --radius: 6px;
  --font-display: "Futura Condensed", "Futura-CondensedMedium", "Archivo Condensed", "Archivo", sans-serif;
  --font-geo: "Futura", "Futura-Medium", "Jost", sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --header-h: 64px;
  --touch: 56px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shell-max: 1080px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --vh: 1vh;
  --stripe-w: 26px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--mint);
  color: var(--ink);
  min-height: 100%;
  min-height: calc(var(--vh, 1vh) * 100);
  overflow-x: hidden;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

body.is-totem {
  user-select: none;
  overflow: hidden;
  height: calc(var(--vh, 1vh) * 100);
}

body.is-totem main {
  overflow: hidden;
}

body::before,
body::after {
  display: none;
}

/* Franjas naranjas del panel, borde derecho */
.edge-stripes {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--stripe-w);
  z-index: 400;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      transparent 0 4px,
      var(--orange) 4px 9px,
      transparent 9px 13px,
      var(--orange) 13px 17px,
      transparent 17px 21px,
      var(--orange) 21px 26px
    );
}

.gold-rule {
  width: min(320px, 72%);
  height: 10px;
  margin: 0.65rem auto 0.7rem;
  background:
    linear-gradient(
      to bottom,
      var(--orange) 0 3px,
      transparent 3px 7px,
      var(--orange) 7px 10px
    );
}

.app-shell {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  min-height: calc(var(--vh, 1vh) * 100);
  display: flex;
  flex-direction: column;
  position: relative;
  background: transparent;
  padding-right: var(--stripe-w);
}

body.is-totem .app-shell {
  height: calc(var(--vh, 1vh) * 100);
  max-height: calc(var(--vh, 1vh) * 100);
}

@media (orientation: landscape) and (min-width: 900px) {
  :root {
    --shell-max: 1400px;
  }
}

img {
  max-width: 100%;
  display: block;
  pointer-events: none;
}

button,
a.btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.touch-target {
  min-height: var(--touch);
  min-width: var(--touch);
}

/* ========== Language switch ========== */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid var(--glass-border);
  gap: 2px;
}

.lang-btn {
  min-width: 52px;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border-radius: 2px;
  font-family: var(--font-geo);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.lang-btn:active {
  transform: scale(0.96);
}

.lang-btn.active {
  background: var(--orange);
  color: var(--ink);
}

body.is-totem .lang-btn {
  min-width: 64px;
  min-height: 52px;
  font-size: 0.95rem;
}

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: calc(0.55rem + var(--safe-top)) calc(clamp(0.75rem, 3vw, 1.5rem) + 4px) 0.7rem;
  background: rgba(111, 194, 181, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--orange);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 0;
  background: var(--mint);
  border: 2px solid var(--frame);
  box-shadow: 0 0 0 3px var(--orange);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-mark img {
  width: 160%;
  height: 160%;
  object-fit: cover;
  object-position: 48% 12%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.6vw, 1.55rem);
  letter-spacing: 0.01em;
  font-weight: 500;
  font-stretch: condensed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

.brand-text small {
  font-family: var(--font-geo);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--rust);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.header-meta {
  display: none;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.header-meta .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

@media (min-width: 520px) {
  .header-meta {
    display: flex;
  }
}

body.is-totem .header-meta {
  display: none;
}

body.is-totem {
  --header-h: 72px;
  --touch: 64px;
}

body.is-totem .brand-mark {
  width: 48px;
  height: 48px;
}

/* ========== Main ========== */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: var(--safe-bottom);
}

/* ========== Hero ========== */
.hero {
  padding: clamp(0.85rem, 2.6vh, 1.6rem) clamp(0.85rem, 4vw, 1.75rem) 0.25rem;
  text-align: center;
  flex-shrink: 0;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-body);
  font-size: clamp(0.68rem, 1.6vw, 0.8rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--rust);
  margin-bottom: 0.35rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.05rem, 7.4vw, 3.8rem);
  font-weight: 500;
  font-stretch: condensed;
  letter-spacing: -0.02em;
  line-height: 0.9;
  margin: 0 auto 0.15rem;
  max-width: 11ch;
  color: var(--ink);
  text-wrap: balance;
}

.hero h1::after {
  content: ".";
  color: var(--orange);
}

.hero-quote {
  font-family: var(--font-geo);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  color: var(--ink);
  margin: 0 auto 0.55rem;
  max-width: 28rem;
}

.hero-quote::before,
.hero-quote::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: var(--ink);
  margin: 0 0.55em;
  vertical-align: -0.05em;
}

.hero-lead {
  max-width: 34rem;
  margin: 0 auto 0.5rem;
  color: var(--muted);
  font-size: clamp(0.88rem, 2.2vw, 1.02rem);
  font-weight: 400;
}

body.is-totem .hero-lead {
  font-size: clamp(0.95rem, 2.2vh, 1.12rem);
  max-width: 90%;
}

.hero-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-geo);
  font-size: clamp(0.72rem, 1.8vw, 0.85rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mint-deep);
  animation: pulse-hint 2.4s ease-in-out infinite;
}

.hero-hint svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@keyframes pulse-hint {
  0%,
  100% {
    opacity: 0.55;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(3px);
  }
}

body.is-totem .hero {
  padding-top: 0.7rem;
  padding-bottom: 0.15rem;
}

body.is-totem .hero h1 {
  font-size: clamp(2.4rem, 5.8vh, 3.6rem);
}

@media (max-height: 860px) {
  .hero-lead,
  .hero-quote {
    display: none;
  }
  .hero h1 {
    font-size: clamp(1.7rem, 6vw, 2.5rem);
  }
  .gold-rule {
    margin: 0.4rem auto 0.45rem;
  }
}

/* ========== Filters ========== */
.filters {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 0.5rem clamp(0.75rem, 3vw, 1.25rem);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
  scroll-snap-type: x proximity;
}

.filters::-webkit-scrollbar {
  display: none;
}

body.is-totem .filters {
  justify-content: center;
  flex-wrap: wrap;
  overflow-x: visible;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
}

.chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.5rem 1rem 0.45rem;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(17, 17, 17, 0.22);
  background: rgba(255, 255, 255, 0.22);
  color: var(--ink-soft);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  scroll-snap-align: start;
  white-space: nowrap;
}

.chip:active {
  transform: scale(0.97);
}

.chip.active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
  box-shadow: none;
}

body.is-totem .chip {
  min-height: 52px;
  padding: 0.65rem 1.15rem;
  font-size: 0.88rem;
}

/* ========== Carousel ========== */
.carousel-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 0.25rem 0 0.75rem;
  position: relative;
}

.carousel-wrap {
  position: relative;
  width: 100%;
  padding: 0 3.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

body.is-totem .carousel-wrap {
  padding: 0 4rem;
}

.films-swiper {
  overflow: hidden;
  width: 100%;
  margin: 0 auto;
  padding: 0.9rem 0 1.1rem;
}

.films-swiper .swiper-slide {
  width: min(42vw, 220px);
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.4s var(--ease);
}

body.is-totem .films-swiper .swiper-slide {
  width: min(58vw, 280px);
}

@media (min-width: 600px) {
  .films-swiper .swiper-slide {
    width: min(36vw, 240px);
  }
}

@media (min-width: 900px) {
  body:not(.is-totem) .films-swiper .swiper-slide {
    width: 260px;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .hero h1 {
    font-size: 1.5rem;
  }
  .hero-lead,
  .hero-hint,
  .hero-quote,
  .gold-rule {
    display: none;
  }
  .films-swiper .swiper-slide {
    width: min(28vh, 160px);
  }
  .carousel-wrap {
    padding: 0 2.75rem;
  }
  .filters {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }
  .chip {
    min-height: 38px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
  }
}

.poster-card {
  position: relative;
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--frame);
  aspect-ratio: 2 / 3;
  border: 3px solid var(--frame);
  box-shadow:
    0 0 0 4px var(--orange),
    0 0 0 7px var(--frame),
    0 16px 32px rgba(20, 40, 38, 0.28);
  transition: box-shadow 0.3s, transform 0.25s var(--ease);
  outline: none;
  touch-action: manipulation;
}

.poster-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
  pointer-events: none;
}

.swiper-slide-active .poster-card,
.poster-card:focus-visible {
  box-shadow:
    0 0 0 4px var(--orange),
    0 0 0 7px var(--frame),
    0 22px 44px rgba(20, 40, 38, 0.38);
}

.swiper-slide-active .poster-card img {
  transform: scale(1.03);
}

@media (hover: hover) {
  .poster-card:hover {
    box-shadow:
      0 0 0 4px var(--orange),
      0 0 0 7px var(--frame),
      0 22px 44px rgba(20, 40, 38, 0.38);
  }
  .poster-card:hover img {
    transform: scale(1.04);
  }
}

.poster-card:active {
  transform: scale(0.98);
}

.films-swiper .swiper-slide-shadow-left,
.films-swiper .swiper-slide-shadow-right {
  background-image: linear-gradient(to left, rgba(20, 40, 38, 0.28), transparent);
}

.poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-align: center;
  background: linear-gradient(160deg, var(--accent, var(--orange)) 0%, var(--ral-6033) 72%);
  color: #fff;
}

.poster-fallback .year-big {
  font-family: var(--font-display);
  font-size: 2.6rem;
  letter-spacing: 0.05em;
}

.poster-fallback .title-fallback {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  margin-top: 0.4rem;
  line-height: 1.15;
}

.poster-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.25rem 0.85rem 0.9rem;
  background: linear-gradient(transparent, rgba(17, 17, 17, 0.88) 68%);
  pointer-events: none;
  color: #fff;
}

.poster-year {
  font-family: var(--font-geo);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.15rem;
}

.poster-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.8vw, 1.25rem);
  letter-spacing: 0.01em;
  line-height: 1.1;
  font-weight: 500;
  font-stretch: condensed;
}

.poster-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  font-family: var(--font-geo);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--orange);
  opacity: 0.35;
  transition: opacity 0.3s;
}

.swiper-slide-active .poster-cta {
  opacity: 1;
}

@media (hover: hover) {
  .poster-card:hover .poster-cta {
    opacity: 1;
  }
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-55%);
  z-index: 10;
  width: var(--touch);
  height: var(--touch);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--glass-border);
  display: grid;
  place-items: center;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  color: var(--ink);
}

.carousel-nav:active {
  transform: translateY(-55%) scale(0.94);
  background: var(--orange);
}

.carousel-nav.prev {
  left: 0.15rem;
}
.carousel-nav.next {
  right: 0.15rem;
}

.carousel-nav svg {
  width: 24px;
  height: 24px;
}

body.is-totem .carousel-nav {
  width: 64px;
  height: 64px;
}

.swiper-pagination-films {
  position: relative !important;
  bottom: 0 !important;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.swiper-pagination-films .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: var(--mint-deep);
  opacity: 0.35;
  border-radius: 2px;
  transition: width 0.3s, opacity 0.3s, background 0.3s;
}

.swiper-pagination-films .swiper-pagination-bullet-active {
  width: 26px;
  border-radius: 2px;
  background: var(--orange);
  opacity: 1;
}

/* ========== Footer ========== */
.site-footer {
  flex-shrink: 0;
  padding: 0.65rem clamp(0.75rem, 3vw, 1.5rem) calc(0.85rem + var(--safe-bottom));
  text-align: center;
  border-top: 3px solid var(--orange);
  color: var(--muted);
  font-size: clamp(0.68rem, 1.6vw, 0.8rem);
}

body.is-totem .site-footer {
  font-size: 0.75rem;
  padding-top: 0.55rem;
  padding-bottom: calc(0.75rem + var(--safe-bottom));
}

/* ========== Intro / attract ========== */
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--mint);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
  transition: opacity 0.65s var(--ease), visibility 0.65s;
}

.intro-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-bloom {
  position: absolute;
  right: max(2%, calc(var(--stripe-w) - 8px));
  top: 2%;
  width: min(62vw, 520px);
  height: min(92vh, 1100px);
  pointer-events: none;
  z-index: 1;
}

.intro-bottle {
  display: none;
}

.intro-flower {
  position: absolute;
  right: 0;
  top: 4%;
  width: 108%;
  max-height: 96%;
  object-fit: contain;
  object-position: top right;
  filter: drop-shadow(0 14px 22px rgba(20, 40, 38, 0.18));
}

.intro-inner {
  position: relative;
  z-index: 2;
  width: min(520px, 78%);
  min-height: calc(var(--vh, 1vh) * 100);
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  padding: calc(8vh + var(--safe-top)) calc(var(--stripe-w) + 1.25rem) calc(4vh + var(--safe-bottom)) 8%;
}

.intro-kicker {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust);
}

.intro-screen h2 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 9vw, 4.4rem);
  letter-spacing: -0.025em;
  font-weight: 500;
  font-stretch: condensed;
  line-height: 0.88;
  max-width: 9.4ch;
  color: var(--ink);
  position: relative;
  z-index: 3;
  text-shadow: 0 0 18px var(--mint), 0 0 28px var(--mint);
}

.intro-screen h2::after {
  content: ".";
  color: var(--orange);
}

.intro-rule {
  margin: 0.15rem 0 0.2rem;
  width: min(240px, 70%);
}

.intro-quote {
  font-family: var(--font-geo);
  font-style: italic;
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  line-height: 1.35;
  max-width: 22rem;
}

.intro-quote::before,
.intro-quote::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.95em;
  background: var(--ink);
  margin: 0 0.5em;
  vertical-align: -0.08em;
}

.intro-sub {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.intro-lang-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--rust);
  margin-top: auto;
  padding-top: 1.5rem;
}

.intro-lang .lang-switch {
  margin-top: 0.05rem;
  transform: scale(1.08);
  transform-origin: left center;
}

.intro-screen .enter-btn {
  margin-top: 0.5rem;
  min-height: 60px;
  min-width: 200px;
  padding: 0.95rem 2.25rem;
  border-radius: 2px;
  background: var(--orange);
  color: var(--ink);
  font-family: var(--font-geo);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.92rem;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.2s, box-shadow 0.2s;
}

.intro-screen .enter-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

body.is-totem .intro-screen .enter-btn {
  min-height: 72px;
  min-width: 240px;
  font-size: 1.05rem;
}

.intro-touch {
  font-family: var(--font-geo);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: pulse-hint 2.2s ease-in-out infinite;
}

@media (max-width: 720px) {
  .intro-inner {
    width: 100%;
    padding-left: 1.25rem;
    padding-right: calc(var(--stripe-w) + 1rem);
  }
  .intro-screen h2 {
    max-width: 10ch;
  }
  .intro-quote,
  .intro-sub {
    max-width: 18rem;
    position: relative;
    z-index: 3;
  }
  .intro-bloom {
    top: auto;
    bottom: 26%;
    width: min(56vw, 230px);
    height: 38%;
    right: 0;
    opacity: 1;
  }
  .brand-text small {
    display: none;
  }
}

@media (max-width: 480px) {
  body.is-totem .filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
  }
}

/* ========== Detail ========== */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(47, 94, 88, 0.55);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}

.detail-overlay.open {
  opacity: 1;
  visibility: visible;
}

.detail-panel {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}

.detail-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.detail-card {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  height: 100%;
  max-height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--mint);
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  transform: translateY(24px);
  transition: transform 0.4s var(--ease);
  position: relative;
  color: var(--ink);
}

.detail-panel.open .detail-card {
  transform: translateY(0);
}

@media (min-width: 800px) and (orientation: landscape) {
  .detail-panel {
    padding: clamp(0.5rem, 2vw, 1.25rem);
  }
  .detail-card {
    border-radius: 0;
    border: 3px solid var(--frame);
    box-shadow:
      0 0 0 5px var(--orange),
      var(--shadow);
    grid-template-columns: minmax(240px, 38%) 1fr;
    grid-template-rows: 1fr;
    max-height: min(920px, 100%);
    height: auto;
    align-self: center;
    background: var(--cream);
  }
}

body.is-totem .detail-card {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(28vh, 38vh) 1fr;
  border-radius: 0;
}

.detail-close {
  position: absolute;
  top: calc(0.65rem + var(--safe-top));
  right: calc(0.85rem + var(--stripe-w));
  z-index: 5;
  width: var(--touch);
  height: var(--touch);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--glass-border);
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: background 0.2s, transform 0.2s;
}

.detail-close:active {
  background: var(--orange);
  transform: scale(0.94);
}

.detail-media {
  position: relative;
  background: var(--frame);
  min-height: 220px;
  max-height: 42vh;
  overflow: hidden;
  margin: 0.85rem 0.85rem 0;
  border: 3px solid var(--frame);
  box-shadow: 0 0 0 4px var(--orange);
}

body.is-totem .detail-media {
  max-height: none;
  min-height: 0;
  margin: 0.75rem 0.75rem 0;
}

@media (min-width: 800px) and (orientation: landscape) {
  .detail-media {
    max-height: none;
    min-height: 100%;
    margin: 0;
    border: none;
    box-shadow: none;
  }
}

.detail-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 240px;
  pointer-events: none;
}

body.is-totem .detail-poster {
  object-fit: contain;
  background: var(--frame);
  min-height: 0;
}

@media (min-width: 800px) and (orientation: landscape) {
  .detail-poster {
    object-fit: cover;
    min-height: 100%;
  }
}

.detail-poster-fallback {
  min-height: 240px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background: linear-gradient(160deg, var(--accent, var(--orange)), var(--ral-6033));
  color: #fff;
}

.detail-poster-fallback .year-big {
  font-family: var(--font-display);
  font-size: 3.5rem;
}

.detail-poster-fallback .title-fallback {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-top: 0.4rem;
}

.detail-body {
  padding: clamp(1rem, 3vw, 1.75rem);
  padding-bottom: calc(1.25rem + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.detail-year {
  font-family: var(--font-geo);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust);
  font-weight: 500;
}

.detail-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  font-weight: 500;
  font-stretch: condensed;
  letter-spacing: -0.02em;
  line-height: 0.95;
  margin-top: 0.15rem;
  color: var(--ink);
}

.detail-en {
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
  margin-top: 0.25rem;
  font-family: var(--font-geo);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.meta-pill {
  padding: 0.35rem 0.75rem;
  border-radius: 2px;
  font-size: 0.78rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--glass-border);
}

.meta-pill.rating {
  background: rgba(250, 152, 53, 0.22);
  border-color: var(--orange);
  color: var(--rust);
}

.detail-cast {
  font-size: 0.92rem;
  color: var(--muted);
}

.detail-cast strong {
  color: var(--ink);
  font-weight: 600;
}

.detail-summary h3,
.detail-gallery h3 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 0.45rem;
  padding-bottom: 0.28rem;
  border-bottom: 3px solid var(--orange);
  display: inline-block;
}

.detail-summary p {
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
  line-height: 1.65;
}

body.is-totem .detail-summary p {
  font-size: 1.05rem;
  line-height: 1.7;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.55rem;
}

body.is-totem .gallery-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

@media (min-width: 520px) {
  body.is-totem .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery-item {
  display: block;
  width: 100%;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
  border: 2px solid var(--frame);
  box-shadow: 0 0 0 2px var(--orange);
  background: #000;
  min-height: 72px;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  pointer-events: none;
}

.gallery-item:active {
  opacity: 0.85;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: auto;
  padding-top: 0.35rem;
  position: sticky;
  bottom: 0;
  background: linear-gradient(transparent, var(--mint) 30%);
  padding-bottom: 0.25rem;
}

@media (min-width: 800px) and (orientation: landscape) {
  .detail-actions {
    background: linear-gradient(transparent, var(--cream) 30%);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.35rem;
  border-radius: 2px;
  font-family: var(--font-geo);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  flex: 1 1 auto;
  text-align: center;
}

body.is-totem .btn {
  min-height: 60px;
  font-size: 1rem;
  padding: 1rem 1.5rem;
}

.btn:active {
  transform: translate(1px, 1px);
}

.btn-primary {
  background: var(--orange);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--glass-border);
  color: var(--ink);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ========== Trailer modal ========== */
.trailer-modal {
  position: fixed;
  inset: 0;
  z-index: 460;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 2vw, 1.25rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  pointer-events: none;
}

.trailer-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.trailer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.82);
  backdrop-filter: blur(8px);
}

.trailer-shell {
  position: relative;
  z-index: 2;
  width: min(960px, 100%);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
}

.trailer-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: min(90vh, 900px);
  background: var(--ink);
  border: 3px solid var(--frame);
  box-shadow: 0 0 0 5px var(--orange);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
}

body.is-totem .trailer-modal {
  padding: 0;
}

body.is-totem .trailer-shell,
body.is-totem .trailer-dialog {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
}

body.is-totem .trailer-dialog {
  border: none;
  box-shadow: none;
}

.trailer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  padding-right: calc(0.85rem + var(--touch) + 0.4rem);
  border-bottom: 3px solid var(--orange);
  flex-shrink: 0;
  background: var(--ral-6033);
  position: relative;
  z-index: 2;
}

.trailer-header h3 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  font-weight: 500;
  font-stretch: condensed;
  letter-spacing: 0.02em;
  line-height: 1.15;
  padding-right: 0.5rem;
}

.trailer-close {
  position: absolute;
  z-index: 5;
  top: calc(0.55rem + var(--safe-top));
  right: 0.7rem;
  width: var(--touch);
  height: var(--touch);
  border-radius: 2px;
  background: rgba(17, 17, 17, 0.78);
  border: 2px solid #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  pointer-events: auto;
  touch-action: manipulation;
}

.trailer-close:active {
  background: var(--orange);
  color: var(--ink);
}

.trailer-stage {
  position: relative;
  z-index: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  flex: 1;
  min-height: 200px;
  overflow: hidden;
  isolation: isolate;
}

body.is-totem .trailer-stage {
  aspect-ratio: auto;
  flex: 1;
}

.trailer-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.trailer-video {
  object-fit: contain;
  background: #000;
}

.trailer-frame.hidden,
.trailer-empty.hidden,
.hidden {
  display: none !important;
}

.trailer-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05rem;
  line-height: 1.5;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(17, 17, 17, 0.94);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: min(960px, 100%);
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0;
  border: 3px solid var(--frame);
  box-shadow: 0 0 0 5px var(--orange);
  pointer-events: none;
}

.lightbox-close {
  position: absolute;
  top: calc(0.75rem + var(--safe-top));
  right: calc(0.75rem + var(--stripe-w));
  width: var(--touch);
  height: var(--touch);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.detail-card::-webkit-scrollbar,
.detail-body::-webkit-scrollbar {
  width: 6px;
}
.detail-card::-webkit-scrollbar-thumb,
.detail-body::-webkit-scrollbar-thumb {
  background: rgba(17, 17, 17, 0.25);
  border-radius: 4px;
}

@media (min-width: 1200px) {
  body:not(.is-totem) .app-shell {
    max-width: 1200px;
  }
}

@media (orientation: landscape) and (min-width: 900px) {
  body.is-totem {
    display: flex;
    justify-content: center;
    background: #2a4a46;
  }
  body.is-totem .app-shell {
    width: min(100%, 540px);
    max-width: 540px;
    background: var(--mint);
  }
}

@media (orientation: portrait) {
  body.is-totem .app-shell {
    width: 100%;
    max-width: 100%;
  }
}

@media (min-height: 1600px) and (max-width: 1200px) {
  body.is-totem .films-swiper .swiper-slide {
    width: min(62vw, 360px);
  }
  body.is-totem .hero h1 {
    font-size: 3.8rem;
  }
  body.is-totem .chip {
    min-height: 60px;
    font-size: 1.05rem;
  }
}
