/* ==========================================================
   Página de caso de estudio
   --brand (en <body>) es el color de la marca del cliente.
   ========================================================== */

/* Portada */
.case-hero__title { font-size: clamp(3.2rem, 13vw, 12rem); }
.back { transition: color .3s; }
.back:hover { color: var(--accent); }
.reel__frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel__frame video + .corner ~ .reel__hud { text-shadow: 0 1px 12px rgba(0, 0, 0, .6); }

/* Ficha */
.sheet { border-block: 1px solid var(--line); }
.sheet__grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-block: 0; }
.sheet__grid > div { display: grid; gap: 8px; padding: 30px 24px 30px 0; }
.sheet__grid > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.sheet dt, .credits dt { font: 400 .68rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sheet dd, .credits dd { font: 400 1.5rem/1.05 var(--display); letter-spacing: .04em; text-transform: uppercase; }

/* Capítulos: título fijo a la izquierda, relato a la derecha */
.chapter { padding: clamp(80px, 11vw, 160px) 0; }
.chapter--alt { background: var(--bg-2); border-block: 1px solid var(--line-soft); }
.chapter__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 7vw, 120px); align-items: start; }
.chapter__head { position: sticky; top: 110px; display: grid; gap: 24px; }
.chapter__head h2 { font-size: clamp(2.8rem, 6vw, 5.6rem); }
.chapter__head--center { position: static; margin-bottom: clamp(36px, 5vw, 64px); }
.chapter__body { display: grid; gap: 24px; justify-items: start; }
.chapter__body p { color: var(--muted); max-width: 560px; }
.chapter__body .lede { color: var(--text); font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.4; font-weight: 300; }

.bullets { width: 100%; border-top: 1px solid var(--line); margin-top: 12px; }
.bullets li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.bullets b { font: 400 .68rem/2.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--pill); font: 400 .66rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* Lema */
.motto { margin: clamp(56px, 8vw, 120px) 0; text-align: center; }
.motto p { font: 400 clamp(4rem, 17vw, 16rem)/.84 var(--display); text-transform: uppercase; }
.motto p span { color: var(--brand); }
.motto cite { display: block; margin-top: 22px; font: 400 .68rem var(--mono); font-style: normal; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.trio, .phases { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.trio article, .phases li { display: grid; gap: 14px; align-content: start; padding: 30px 28px 0 0; }
.trio article + article, .phases li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.trio p, .phases p { color: var(--muted); }
.trio h3, .phases h3 { font-size: clamp(1.8rem, 2.8vw, 2.6rem); }

/* Identidad */
.identity { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; margin-top: clamp(48px, 6vw, 90px); }
.identity__crest {
  position: relative; display: grid; place-items: center; min-height: 460px; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(60% 60% at 50% 45%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%), #000;
}
.identity__crest img { width: min(52%, 280px); height: auto; }
.identity__crest figcaption, .shot figcaption { position: absolute; left: 24px; bottom: 20px; color: rgba(255, 255, 255, .78); text-shadow: 0 1px 10px rgba(0, 0, 0, .7); }
.identity__side { display: grid; gap: 24px; align-content: start; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.swatches li { display: grid; align-content: end; gap: 4px; min-height: 150px; padding: 14px; background: var(--c); color: var(--t); transition: flex .5s var(--ease-out); }
.swatches b { font: 400 1.15rem/1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.swatches span { font: 400 .62rem var(--mono); letter-spacing: .1em; opacity: .75; }

/* Fotogramas */
.shot { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--bg-3); }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease-out); }
.shot:hover img { transform: scale(1.04); }
.js .shot.reveal, .js .identity__crest.reveal { opacity: 1; transform: none; filter: none; clip-path: inset(12% 6% 12% 6% round 44px); transition: clip-path 1.5s var(--ease-out); transition-delay: inherit; }
.js .shot.reveal img { transform: scale(1.14); }
.js .shot.reveal.is-in, .js .identity__crest.reveal.is-in { clip-path: inset(0 round var(--radius)); }
.js .shot.reveal.is-in img { transform: none; }
.js .shot.reveal.is-in:hover img { transform: scale(1.04); }

.phases { margin-top: clamp(40px, 5vw, 72px); }
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; margin-top: clamp(48px, 6vw, 90px); }
.gallery .shot { grid-column: span 4; aspect-ratio: 4 / 3; }
.gallery .shot--wide { grid-column: span 8; aspect-ratio: auto; min-height: 100%; }
.gallery .shot--tall { grid-row: span 2; aspect-ratio: auto; }

/* Resultados y créditos */
.stats--4 { grid-template-columns: repeat(4, 1fr); }
.credits { padding: clamp(48px, 6vw, 84px) 0; border-bottom: 1px solid var(--line); }
.credits__grid { display: grid; grid-template-columns: 1fr 3fr; gap: 24px; }
.credits dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.credits dl > div { display: grid; gap: 8px; }
.case-cta .hero__actions { margin-top: 0; }

@media (max-width: 1000px) {
  .chapter__grid, .identity, .credits__grid { grid-template-columns: 1fr; }
  .chapter__head { position: static; }
  .sheet__grid, .stats--4 { grid-template-columns: repeat(2, 1fr); }
  .sheet__grid > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .sheet__grid > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stats--4 li:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats--4 li:nth-child(n+3) { margin-top: 24px; }
  .gallery .shot { grid-column: span 6; }
  .gallery .shot--wide { grid-column: span 12; aspect-ratio: 16 / 9; }
  .gallery .shot--tall { grid-row: auto; aspect-ratio: 4 / 3; }
}
@media (max-width: 640px) {
  .trio, .phases, .credits dl { grid-template-columns: 1fr; }
  .trio article, .phases li { padding: 26px 0; }
  .trio article + article, .phases li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .swatches { grid-template-columns: repeat(2, 1fr); }
  .swatches li { min-height: 110px; }
  .identity__crest { min-height: 320px; }
  .gallery { gap: 14px; }
  .gallery .shot, .gallery .shot--wide { grid-column: span 12; aspect-ratio: 4 / 3; }
  .bullets li { grid-template-columns: 1fr; gap: 2px; }
}

/* Película con sonido (formatos 4:3 y similares) */
.film .reel__frame { aspect-ratio: 4 / 3; max-width: 1120px; margin-inline: auto; background: #000; }
.film figcaption { display: flex; justify-content: space-between; gap: 16px; max-width: 1120px; margin: 18px auto 0; font: 400 .68rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* Piezas que viven en YouTube: portada y galería en 16:9, enlazadas al video */
.film--wide .reel__frame { display: block; aspect-ratio: 16 / 9; }
.film--wide .reel__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gallery--video .shot { aspect-ratio: 16 / 9; }
.shot a { display: block; height: 100%; }
@media (max-width: 640px) { .gallery .gallery--video .shot, .gallery--video .shot { aspect-ratio: 16 / 9; } }

/* Videos de YouTube dentro de la página */
.reel__frame > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.shot a[data-yt]::after { content: "▶"; position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 36px; height: 36px; padding-left: 2px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 50%; background: rgba(10, 10, 11, .45); color: #fff; font-size: .6rem; transition: background .3s, border-color .3s, color .3s; }
.shot a[data-yt]:hover::after { background: var(--brand); border-color: var(--brand); color: #0a0a0b; }
.lightbox { width: min(1100px, 92vw); margin: auto; padding: 0; border: 0; background: none; overflow: visible; }
.lightbox::backdrop { background: rgba(5, 5, 6, .9); }
.lightbox__frame { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: #000; }
.lightbox iframe { display: block; width: 100%; height: 100%; border: 0; }
.lightbox__close { position: absolute; top: -40px; right: 0; padding: 6px 0; border: 0; background: none; color: rgba(255, 255, 255, .75); font: 400 .68rem var(--mono); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.lightbox__close:hover { color: #fff; }
