/* Case study template — shared by every inner project page.
   xygarathma.com's type, tidy image rows that keep each image's original ratio
   (only the top fold is cropped), off-white / off-black backgrounds, and five
   project accent colours (--a1…--a5) that each page sets in its own :root. */
:root {
  --paper: #f7f2ec; --night: #100202; --ink: #100202; --grey: #3a3030; --mute: #7a706b; --line: rgba(16,2,2,.16);
  --blue: #053eff; --orange: #ff6300;
  --display: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "Azeret Mono", ui-monospace, monospace;
  --pad: clamp(16px, 2.4vw, 34px);
  --gap: 8px;
  /* per-project: --a1…--a5 (accent colours), optional --tag-on-dark, --video-bg, --zoom (hover cursor) */
  --zoom: zoom-in;
}
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; }
.label { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.tags { font-weight: 600; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--blue); }

/* ── nav (as on xygarathma.com) ── */
.nav { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; background: rgba(247,242,236,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav img { width: 30px; display: block; }
.nav nav { display: flex; gap: 28px; font-size: 14px; }
.nav nav a { position: relative; }
.nav nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.nav nav a:hover::after, .nav nav a.is-active::after { transform: scaleX(1); transform-origin: left; }

/* ── top fold (the only cropped image) ── */
.fold { position: relative; height: min(76svh, 720px); min-height: 420px; overflow: hidden; background: #3d63d8; }
.fold::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(16,2,2,.88) 0%, rgba(16,2,2,.55) 26%, rgba(16,2,2,.12) 52%, rgba(16,2,2,0) 70%); }
.fold .title { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; color: #f7f2ec; border: 0; padding: 0 var(--pad) clamp(26px, 3vw, 44px); cursor: default; }
.fold .title .tags { color: var(--tag-on-dark, var(--a3)); }
.fold .title__side p { color: #f7f2ec; }
.fold img { position: absolute; left: 0; top: -12%; width: 100%; height: 124%; object-fit: cover; transform: scale(1.05); transition: transform 2.2s var(--ease); translate: 0 var(--par, 0px); will-change: translate; }
.is-loaded .fold img { transform: none; }

/* ── title band ── */
.title { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 30px; padding: clamp(40px, 5vw, 70px) var(--pad) clamp(30px, 3.5vw, 50px); border-bottom: 1px solid var(--ink); }
.title h1 { font-family: var(--display); font-weight: 500; font-size: var(--h1-size, clamp(68px, 11.5vw, 190px)); line-height: .8; letter-spacing: -.055em; margin-left: -.04em; }
.title h1 span { display: inline-block; transform: translateY(30px); opacity: 0; transition: transform 1.1s var(--ease), opacity 1.1s var(--ease); transition-delay: .2s; }
.is-loaded .title h1 span { transform: none; opacity: 1; }
.title__side { display: grid; justify-items: end; gap: 14px; text-align: right; padding-bottom: 6px; }
.title__side p { font-family: var(--display); font-size: clamp(18px, 1.7vw, 26px); letter-spacing: -.02em; line-height: 1.1; }
.chips { display: flex; gap: 6px; }
.chips i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); }

/* ── story: sticky facts + narrative ── */
.story { display: grid; grid-template-columns: minmax(240px, 1fr) 2.4fr; gap: clamp(30px, 5vw, 90px); padding: clamp(50px, 6vw, 90px) var(--pad); }
.facts { position: sticky; top: 90px; align-self: start; display: grid; gap: 30px; }
.facts ul { list-style: none; margin: 10px 0 0; padding: 0; }
.facts li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.facts .award { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; font-size: 15px; line-height: 1.4; }
.facts .award svg { flex: none; width: 20px; height: 20px; color: var(--orange); margin-top: 1px; }
.lede { font-family: var(--display); font-weight: 400; font-size: clamp(19px, 1.75vw, 27px); line-height: 1.32; letter-spacing: -.015em; }
.lede b { font-weight: 500; color: var(--blue); }
.lede p + p { margin-top: .8em; }

/* impact: one tile per state colour */
.impact { margin-top: clamp(40px, 5vw, 70px); }
.impact__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-top: 14px; }
.impact__grid.three { grid-template-columns: repeat(3, 1fr); }
.tile { background: var(--c); color: #fff; padding: 22px 20px 24px; display: flex; flex-direction: column; }
.tile.dark-text { color: var(--ink); }
.tile b { display: flex; align-items: flex-start; height: clamp(92px, 7.6vw, 124px); font-family: var(--display); font-weight: 500; font-size: clamp(44px, 4.4vw, 74px); line-height: .9; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.tile b.small { font-size: clamp(22px, 1.9vw, 30px); line-height: 1.05; letter-spacing: -.02em; }
.tile p { font-size: 14px; line-height: 1.4; margin-top: 18px; }
/* ── image rows: each image keeps its own ratio; widths are set so a row shares one height ── */
.gallery { display: grid; gap: var(--gap); padding: 0 var(--gap); }
.row { display: flex; gap: var(--gap); }
.row figure { flex: var(--ar) 1 0; min-width: 0; background: #e3d9ce; overflow: hidden; cursor: var(--zoom); }
.row img { display: block; width: 100%; height: auto; transition: transform 1.2s var(--ease), opacity .3s; }
.row figure:hover img { transform: scale(1.02); }
.row figure.on-paper { background: #fbf7f2; display: grid; place-items: center; aspect-ratio: 1.779; }
.row figure.on-paper img { width: 84%; }
.g3 { gap: 4px; }
.g3 .row { gap: 4px; }

/* ── text sections ── */
.section { display: grid; grid-template-columns: minmax(240px, 1fr) 2.4fr; gap: clamp(30px, 5vw, 90px); padding: clamp(70px, 9vw, 130px) var(--pad); }
.section h2 { font-family: var(--display); font-weight: 500; font-size: clamp(40px, 4.6vw, 76px); line-height: .92; letter-spacing: -.04em; }
.section .label { display: block; margin-bottom: 14px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 48px); color: var(--grey); line-height: 1.65; }
.cols--one { grid-template-columns: 1fr; max-width: 64ch; }
.cols h3 { font-family: var(--display); font-weight: 500; font-size: clamp(20px, 1.7vw, 26px); line-height: 1.1; letter-spacing: -.02em; color: var(--ink); margin-bottom: 12px; }
.band .cols h3 { color: #f3eee8; }
.gallery.spaced { margin-top: clamp(70px, 8vw, 120px); }
.hexes { display: flex; gap: 10px; margin-top: 28px; }
.hexes span { display: grid; place-items: center; width: 58px; height: 66px; background: var(--c); color: #fff; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); font-family: var(--mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.hexes span.dark-text { color: var(--ink); }

/* ── video section ── */
.video { background: var(--video-bg, var(--a4)); color: #f3eee8; margin: clamp(56px, 7vw, 104px) 0; padding: clamp(36px, 4vw, 60px) var(--pad) clamp(56px, 6vw, 88px); }
.video__head { display: grid; grid-template-columns: minmax(240px, 1fr) 2.4fr; gap: clamp(30px, 5vw, 90px); margin-bottom: clamp(32px, 3.6vw, 52px); }
.video .label { color: rgba(243,238,232,.7); display: block; margin-bottom: 14px; }
.video h2 { font-family: var(--display); font-weight: 500; font-size: clamp(40px, 4.6vw, 76px); line-height: .92; letter-spacing: -.04em; }
.video .cols { color: rgba(243,238,232,.85); }
.player { position: relative; display: block; width: 88%; margin: 0 auto; aspect-ratio: 16 / 9; background: #000 center / cover no-repeat; border: 0; padding: 0; cursor: pointer; overflow: hidden; }
.player::after { content: ""; position: absolute; inset: 0; background: rgba(16,2,2,.25); transition: background .4s; }
.player:hover::after { background: rgba(16,2,2,.05); }
.player .play { position: absolute; left: 50%; top: 50%; z-index: 1; translate: -50% -50%; width: clamp(64px, 7vw, 96px); aspect-ratio: 1; border-radius: 50%; background: var(--paper); display: grid; place-items: center; transition: scale .4s var(--ease); }
.player:hover .play { scale: 1.08; }
.player .play svg { width: 34%; margin-left: 8%; fill: var(--ink); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2; }

/* band for the experiential launch */
.band { background: var(--night); color: #f3eee8; padding-bottom: clamp(70px, 8vw, 120px); margin-top: clamp(70px, 8vw, 120px); }
.band .section .label { color: #a3948d; }
.band .cols { color: #d4c9c1; }
.band .row figure { background: #2a1c1c; }

/* ── prev / all / next ── */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); margin-top: clamp(56px, 6vw, 90px); }
.pager a { display: flex; align-items: center; gap: 18px; padding: 26px var(--pad); transition: background .3s, color .3s; }
.pager a:hover { background: var(--blue); color: #fff; }
.pager a:hover .label { color: rgba(255,255,255,.75); }
.pager .next { justify-content: flex-end; text-align: right; }
.pager .all { border-inline: 1px solid var(--ink); font-family: var(--display); font-weight: 500; font-size: 18px; }
.pager strong { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(22px, 2.2vw, 34px); letter-spacing: -.02em; line-height: 1; margin-top: 6px; }
.pager img { width: 96px; height: auto; }

/* ── footer ── */
.footer { background: var(--night); color: #f3eee8; padding: 60px 45px 50px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.footer strong { display: block; font-family: var(--display); font-weight: 400; font-size: 28px; margin-bottom: 18px; }
.footer nav { display: grid; justify-items: end; gap: 4px; }
.footer a:hover { color: var(--a3); }

/* ── lightbox ── */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(16,2,2,.94); opacity: 0; pointer-events: none; transition: opacity .35s; }
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 92vw; max-height: 86vh; width: auto; height: auto; object-fit: contain; transform: scale(.97); transition: transform .45s var(--ease); background: #fbf7f2; }
.lightbox.is-open img { transform: none; }
.lightbox img.is-photo { background: none; }
.lightbox button { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(243,238,232,.4); background: rgba(16,2,2,.5); color: #f3eee8; font: 500 20px var(--display); cursor: pointer; transition: background .3s, color .3s; }
.lightbox button:hover { background: var(--paper); color: var(--ink); }
.lightbox button svg { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-prev { left: 18px; top: 50%; translate: 0 -50%; }
.lightbox .lb-next { right: 18px; top: 50%; translate: 0 -50%; }
.lightbox .lb-count { position: absolute; bottom: 18px; left: 50%; translate: -50% 0; color: rgba(243,238,232,.7); }

/* ── mosaic: one big image beside four small ones (all 16:9) ── */
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 var(--gap); }
.mosaic + .mosaic { margin-top: 4px; }
.mosaic figure { aspect-ratio: var(--mr, 1.779); overflow: hidden; background: #e3d9ce; cursor: var(--zoom); }
.mosaic figure.big { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.mosaic.flip figure.big { grid-column: 3 / 5; grid-row: 1 / 3; }
.mosaic figure.half { grid-column: span 2; }
.mosaic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.mosaic figure:hover img { transform: scale(1.02); }

/* ── standalone media: a centred image or video between sections ── */
.solo { width: min(72%, 1040px); margin: clamp(56px, 7vw, 104px) auto; }
.solo .row figure { background: none; }
.player--file { width: 100%; }
.player--empty { display: grid; place-items: center; cursor: default; background: rgba(16,2,2,.28); border: 1px dashed rgba(247,242,236,.4); }
.player--empty::after { display: none; }
.player--empty span.label { position: relative; z-index: 1; color: rgba(247,242,236,.9); }

.video + .pager { margin-top: 0; }
.marquee-row { padding: clamp(40px, 5vw, 70px) 0 0; }
.marquee-row .label { display: block; padding: 0 var(--pad) 14px; }
.marquee-row .marquee__track { gap: 28px; font-family: var(--display); font-weight: 500; font-size: clamp(30px, 3.6vw, 56px); letter-spacing: -.03em; animation-duration: 40s; }
.marquee-row .marquee__track i { width: 12px; height: 12px; border-radius: 50%; background: var(--a1); flex: none; }

@media (max-width: 900px) {
  .nav nav { gap: 16px; font-size: 13px; }
  .fold { height: 118vw; max-height: 620px; min-height: 0; }
  .fold img { object-position: 30% 50%; }
  .title { grid-template-columns: 1fr; }
  .title__side { justify-items: start; text-align: left; }
  .story, .section, .video__head { grid-template-columns: 1fr; }
  .facts { position: static; grid-template-columns: 1fr 1fr; }
  .impact__grid { grid-template-columns: 1fr 1fr; }
  .tile b { height: 84px; }
  .cols { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
  .row figure { flex-basis: 100%; }
  .g3 .row figure { flex: 1 1 calc(50% - 2px); }
  .mosaic { grid-template-columns: 1fr 1fr; }
  .mosaic figure.big, .mosaic.flip figure.big { grid-column: 1 / -1; grid-row: auto; aspect-ratio: var(--mr, 1.779); }
  .impact__grid.three { grid-template-columns: 1fr 1fr; }
  .solo { width: auto; margin-inline: var(--gap); }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager .all { grid-column: 1 / -1; grid-row: 2; border-inline: 0; border-top: 1px solid var(--ink); justify-content: center; }
  .pager img { display: none; }
  .footer { flex-direction: column; align-items: flex-start; padding: 50px 20px; }
  .footer nav { justify-items: start; }
}
