/* =========================================================
   7.5 CASE STUDY — plum intro panel (Brief / Scope / Solution),
   joined media mosaic, challenge + facts, three insight tiles,
   chapters with figures, all-work / next-project nav.
   Also: the Photography page rooms and the painting lens.
   ========================================================= */

.case { padding-top: var(--s-6); }
.case__back { display: inline-flex; align-items: center; gap: var(--s-2); font-size: 15px; font-weight: 600; margin-bottom: var(--s-5); }
.case__back .icon { width: 16px; height: 16px; }

/* plum panel */
.case-panel { background: var(--ink); color: var(--paper); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 48px); }
.case-panel .tags { margin-bottom: 20px; }
.case-panel__sub { font-size: 15px; opacity: .8; }
.case-panel__name { font-size: var(--fs-display); line-height: .92; letter-spacing: -0.05em; text-transform: uppercase; margin-top: 6px; }
.bss { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--s-6); margin-top: var(--s-7); }
.bss h2 { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .04em; margin-bottom: var(--s-2); }
.bss p, .bss ul { font-size: 15px; line-height: 1.6; opacity: .85; }
.bss ul { list-style: none; margin: 0; padding: 0; line-height: 1.8; }

/* joined mosaic: 7 | 5 (two rows), then 4 | 8 */
.case-mosaic { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); border-radius: var(--r-lg); overflow: hidden; margin-top: var(--s-4); }
.case-mosaic > * { min-height: 260px; }
.case-mosaic .m-7 { grid-column: span 7; min-height: 340px; }
.case-mosaic .m-5 { grid-column: span 5; display: grid; grid-template-rows: 1fr 1fr; }
.case-mosaic .m-4 { grid-column: span 4; }
.case-mosaic .m-8 { grid-column: span 8; }
.case-mosaic img { width: 100%; height: 100%; object-fit: cover; }
/* number tiles take the place of the kit's colour swatches */
.num-tile { padding: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-4); }
.num-tile--ink { background: var(--ink); color: var(--paper); }
.num-tile--linen { background: var(--linen); }
.num-tile strong { font-size: clamp(32px, 4vw, 56px); font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
.num-tile > span { font-size: 15px; font-weight: 600; text-transform: uppercase; }

/* challenge + facts */
.chapter { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--s-5) var(--s-7); padding: var(--s-8) 0 var(--s-5); }
.chapter__title { font-size: clamp(32px, 4vw, 48px); line-height: 1; letter-spacing: -0.04em; text-transform: uppercase; margin-top: var(--s-3); }
.chapter__body { display: flex; flex-direction: column; gap: 20px; }
.chapter__body > p { font-size: 17px; line-height: 1.6; }
.chapter__body ul { margin: 0; padding-left: 1.1em; font-size: 17px; line-height: 1.6; }
.chapter__body li + li { margin-top: var(--s-2); }

/* three insight tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--s-3); }
.tiles .tile { border-radius: var(--r-md); padding: var(--s-5); min-height: 220px; display: flex; flex-direction: column; gap: var(--s-3); border: 1px solid var(--ink); }
.tiles .tile--ink { background: var(--ink); color: var(--paper); }
.tiles .tile--clay { background: var(--clay); color: var(--paper); border-color: var(--clay); }
.tile__num { font-family: var(--font-mono); font-size: var(--fs-mono); }
.tile__name { font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: -0.02em; }
.tiles .tile p { font-size: var(--fs-small); margin-top: auto; }

/* figures */
.figs { display: grid; gap: var(--s-4); padding-top: var(--s-5); }
.figs--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figs--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.figs--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.figs .wide { grid-column: span 2; }
.figs .media { aspect-ratio: var(--ar, 4/5); }

/* pull line */
.pull { font-size: clamp(32px, 4.5vw, 64px); font-weight: 700; letter-spacing: -0.045em; line-height: 1; max-width: 20ch; padding-block: var(--s-9) var(--s-5); }
.pull span { color: var(--clay); }

/* all work / next project */
.case-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 20px; margin-block: var(--s-9) var(--s-8); }
.case-nav__all { display: inline-flex; align-items: center; gap: var(--s-2); font-size: 15px; font-weight: 600; }
.case-nav__next { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.case-nav__next span:first-child { font-size: var(--fs-label); color: var(--ink-2); }
.case-nav__next span:last-child { font-size: clamp(24px, 3vw, 36px); font-weight: 700; letter-spacing: -0.04em; }

/* ---------- PHOTOGRAPHY page rooms ---------- */
.room { padding-block: var(--s-9) 0; }
.room__head { margin-bottom: var(--s-7); }
.room__title { font-size: var(--fs-display); line-height: .92; letter-spacing: -0.055em; margin-top: var(--s-4); }
.wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.wall .media { aspect-ratio: 3/4; }
.wall .media:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); max-width: 920px; margin-inline: auto; }
.pairs .media { aspect-ratio: 4/5; }
.ngrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.ngrid .media { aspect-ratio: 4/5; }
.ngrid img { opacity: .5; transition: opacity var(--t-slow) var(--ease); }
.ngrid .is-lit img { opacity: 1; }

/* ---------- painting lens: a light tours the painting ---------- */
.lensdrift { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #160b10; border-radius: var(--r-lg); }
.lensdrift__stage { position: absolute; inset: 0; margin: auto; height: 88%; aspect-ratio: 1100 / 849; }
.lensdrift__pan {
  position: absolute; inset: 0;
  -webkit-mask-image: radial-gradient(circle, #000 42%, rgba(0,0,0,.25) 60%, transparent 72%);
          mask-image: radial-gradient(circle, #000 42%, rgba(0,0,0,.25) 60%, transparent 72%);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: 300px 300px; mask-size: 300px 300px;
  -webkit-mask-position: 30% 40%; mask-position: 30% 40%;
}
.lensdrift__img { position: absolute; inset: 0; background: url("../images/painting/whole-1600.jpg") center / cover; transform-origin: 60% 40%; animation: pdrift 24s ease-in-out infinite alternate; }
@keyframes pdrift { from { transform: scale(1.02); } to { transform: scale(1.11) translate(-2%, -2%); } }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1023px) {
  .case-mosaic .m-7, .case-mosaic .m-5, .case-mosaic .m-4, .case-mosaic .m-8 { grid-column: 1 / -1; }
  .case-mosaic .m-5 { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .figs--3, .figs--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .figs--2, .figs--3 { grid-template-columns: 1fr; }
  .figs .wide { grid-column: auto; }
  .wall { grid-template-columns: 1fr 1fr; }
  .wall .media:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 4/5; }
  .pairs, .ngrid { grid-template-columns: 1fr 1fr; }
  .lensdrift { aspect-ratio: 4 / 5; }
}
@media (prefers-reduced-motion: reduce) {
  .lensdrift__img { animation: none; }
  .lensdrift__pan { -webkit-mask: none; mask: none; }
  .ngrid img { opacity: 1; }
}
@media (max-width: 639px) { .case-panel__name, .modal .case-panel__name { font-size: clamp(30px, 10.5vw, 48px); overflow-wrap: anywhere; } }

/* full-width cover cell (e.g. a video) inside the case mosaic */
.case-mosaic .m-12 { grid-column: 1 / -1; min-height: 0; }
.case-mosaic .m-12 .video-block { border-radius: 0; }

/* real photos fill their mosaic cells instead of stretching the rows */
.case-mosaic > div:not(.m-12), .case-mosaic .m-5 > div { position: relative; overflow: hidden; min-height: 0; }
.case-mosaic .m-7 { min-height: clamp(300px, 36vw, 520px); }
.case-mosaic > div:not(.m-12) > img, .case-mosaic .m-5 > div > img { position: absolute; inset: 0; }
@media (max-width: 1023px) { .case-mosaic .m-5 > div { aspect-ratio: 4 / 5; } }
.case-mosaic > div.m-7 { min-height: clamp(300px, 36vw, 520px); }
.case-mosaic > div.m-5 { min-height: clamp(300px, 36vw, 520px); }
.case-mosaic > div.m-4, .case-mosaic > div.m-8 { min-height: clamp(220px, 24vw, 360px); }
@media (max-width: 1023px) { .case-mosaic > div.m-5 { min-height: 0; } .case-mosaic > div.m-7 { min-height: 70vw; } }

/* a wide video between chapters (sewing video after "Cut by hand", Paula 2026-10-14) */
.case-video { padding-top: var(--s-6); }
.case-video .video-block { border-radius: var(--r-lg); }
.figs .media > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.figs--1 { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin-inline: auto; }
/* bundle video: cropped to the flowers and the fold, no floor (Paula, 2026-10-14) */
.figs--1 .video-block { aspect-ratio: auto !important; height: 100%; }
.figs--1 .video-block video { object-position: 50% 0%; }

/* Worn row (Paula's board, 2026-10-14): text | photo, then the yoga video below on the left */
.worn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); padding-top: var(--s-8); align-items: center; }
.worn-row__text { display: flex; flex-direction: column; gap: var(--s-4); padding-right: var(--s-6); }
.worn-row__text p { font-size: 17px; line-height: 1.6; max-width: 36ch; }
.worn-row .media { aspect-ratio: var(--ar, 1/1); }
@media (max-width: 639px) { .worn-row { grid-template-columns: 1fr; } .worn-row__text { padding-right: 0; } }

/* analog look for the yoga video (Paula, 2026-10-14): darker, warmer, film grain, soft vignette */
.case-video--analog .video-block { position: relative; }
.case-video--analog video { filter: brightness(.78) contrast(1.18) sepia(.22) saturate(.85); }
.case-video--analog .video-block::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; border-radius: inherit;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(20, 10, 6, .45) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .4 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay; opacity: .9;
}
.case-video--analog .video-block__caption, .case-video--analog .video-block__toggle { z-index: 2; }
