/* =========================================================
   Cortège — site styles
   ========================================================= */

@font-face { font-family: 'Newsreader'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/newsreader-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Newsreader'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/newsreader-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  --ink: #141312;
  --grey: #75706a;
  --grey-dark: #4a4640;
  --line: #e6e3de;
  --tone: #eeece8;
  --bg: #ffffff;
  --pad-x: 40px;
  --pad-top: 32px;
  --row-vh: 62;
  --row: clamp(320px, calc(var(--row-vh) * 1vh), 800px);
  --gap: 28px;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: #000; }
img, video { display: block; max-width: 100%; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.upper { text-transform: uppercase; }
.muted { color: var(--grey); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* ---------- Header ---------- */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--pad-top) var(--pad-x) 0;
  position: relative; z-index: 5;
}
.site-header .logo { display: flex; padding: 10px 0; }
.site-header .logo img { height: 22px; width: auto; }
.site-nav { display: flex; gap: 40px; text-transform: uppercase; }
.site-nav a { color: var(--grey); padding: 10px 0; }
.site-nav a[aria-current] { color: var(--ink); }
.site-nav a[aria-current] span { border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

/* ---------- Page transition ---------- */
.page-content { flex-grow: 1; display: flex; flex-direction: column; animation: page-in 2.2s ease both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Footer ---------- */
.site-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 var(--pad-x) 20px; min-height: 44px;
  text-transform: uppercase; font-size: 11px; color: var(--grey);
}
.site-footer a { color: var(--grey); padding: 8px 0; }
.site-footer .links { display: flex; gap: 24px; }

/* ---------- Intro ---------- */
.intro { display: none; }
html.play-intro .intro {
  display: flex; position: fixed; inset: 0; z-index: 50; background: #fff;
  align-items: center; justify-content: center; transition: opacity 1s ease;
}
html.play-intro .intro img { height: 34px; width: auto; transition: opacity 1s ease; }
.intro.logo-out img { opacity: 0; }
.intro.site-in { opacity: 0; pointer-events: none; }

/* =========================================================
   HOME — Work
   ========================================================= */
/* Controls keep the same position in Images and Index views; the image block sits centred on screen. */
.work { flex-grow: 1; display: flex; flex-direction: column; justify-content: flex-start; gap: 14px; padding: max(16px, calc((100vh - 190px - var(--row)) / 2)) 0 16px; min-height: 0; }
.controls {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 var(--pad-x); text-transform: uppercase; font-size: 11px;
}
.controls .group { display: flex; gap: 20px; }
.controls button { color: var(--grey); padding: 8px 0; text-transform: uppercase; border-bottom: 1px solid transparent; }
.controls button[aria-pressed="true"] { color: var(--ink); }
.controls .views button[aria-pressed="true"] { border-bottom-color: var(--ink); }
.controls .views { gap: 16px; }

.strip-wrap { position: relative; }
.strip {
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scrollbar-width: none; -ms-overflow-style: none;
  padding: 0 var(--pad-x);
}
.strip::-webkit-scrollbar { display: none; }
.track { display: flex; gap: var(--gap); align-items: flex-end; width: max-content; }
.fade-edge {
  position: absolute; top: 0; right: 0; bottom: 0; width: 220px; pointer-events: none; z-index: 2;
  background: linear-gradient(to right, rgba(255,255,255,0), #fff 90%); opacity: .49; transition: opacity .5s ease;
}
.fade-edge.is-end { opacity: 0; }

.card { display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }
.card[hidden] { display: none; }
.card .media {
  position: relative; height: var(--row); aspect-ratio: var(--ratio, 1.5);
  background: var(--tone); overflow: hidden;
}
.card .media img, .card .media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.card .media video { opacity: 0; transition: opacity .8s ease; }
.card .media video.ready { opacity: 1; }
.card .media img { transition: transform 1.2s var(--ease); }
.card:hover .media img { transform: scale(1.015); }
.card .play {
  position: absolute; right: 16px; bottom: 14px; z-index: 1;
  display: flex; gap: 6px; align-items: center; color: #fff; text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0,0,0,.35);
}
.card .caption { display: flex; justify-content: space-between; gap: 16px; }
.card .caption .muted { white-space: nowrap; }

.scrollbar { display: flex; justify-content: center; align-items: center; height: 24px; }
.scrollbar .rail { width: 180px; height: 1px; background: var(--line); }
.scrollbar .thumb { width: 40px; height: 1px; background: var(--ink); transition: transform .5s var(--ease); }
body[data-view="index"] .scrollbar { visibility: hidden; }

/* Index view */
.index { display: none; padding: 0 var(--pad-x); gap: 80px; align-items: flex-start; }
body[data-view="index"] .index { display: flex; }
body[data-view="index"] .strip-wrap { display: none; }
.index-list { flex-grow: 1; min-width: 0; }
.index-row {
  display: grid; grid-template-columns: 48px minmax(0,1.3fr) minmax(0,1.1fr) 80px 110px 180px 60px;
  gap: 16px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); color: var(--grey);
}
.index-row.head { border-top: 0; padding-top: 0; text-transform: uppercase; }
a.index-row:hover, a.index-row.is-active { color: var(--ink); }
.index-row .client { font-family: var(--serif); font-size: 22px; letter-spacing: -0.01em; line-height: 1.1; }
.index-row .year { text-align: right; }
.index-row[hidden] { display: none; }
.index-preview { width: 400px; flex-shrink: 0; position: sticky; top: 24px; }
.index-preview .frame { width: 400px; aspect-ratio: var(--ratio, 1.5); max-height: 60vh; background: var(--tone); position: relative; overflow: hidden; }
.index-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.index-preview .label { margin-top: 12px; color: var(--grey); }

/* =========================================================
   PROJECT
   ========================================================= */
.project { padding: 24px var(--pad-x) 40px; display: flex; flex-direction: column; gap: 40px; }
.project-head {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 40px;
  padding: 24px 0 32px; border-bottom: 1px solid var(--line);
}
.project-head .kicker { color: var(--grey); text-transform: uppercase; }
.project-head h1 { margin: 16px 0 0; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4.2vw, 60px); line-height: 1.05; letter-spacing: -0.02em; }
.project-head h1 .muted { display: block; }
.credits { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px 40px; align-content: end; text-transform: uppercase; }
.credits div { display: flex; flex-direction: column; gap: 6px; }
.credits dt { color: var(--grey); }
.credits dd { margin: 0; }
.jump { display: flex; gap: 28px; text-transform: uppercase; margin-top: -16px; }
.jump a { padding: 6px 0; color: var(--grey); }
.jump a:first-child { color: var(--ink); border-bottom: 1px solid var(--ink); }

.volet { --col: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; scroll-margin-top: 24px; }
.volet > * { width: var(--col); max-width: 100%; }
/* Film: as large as the screen height allows, at its own ratio. */
.volet-film { --col: min(100%, calc(88vh * var(--ratio, 1.7778))); }
/* Photo: calmer column — a row never taller than ~72% of the screen, and never wider than the film above. */
.volet-photo { --col: min(100%, calc(72vh * 1.4), calc(88vh * var(--film-ratio, 3))); }
.volet-head { display: flex; justify-content: space-between; text-transform: uppercase; }
/* Several films (series): one after the other, each at its own format. */
.volet-film { gap: 16px; }
.film-item { --col: min(100%, calc(88vh * var(--ratio, 1.7778))); display: flex; flex-direction: column; gap: 12px; }
.film-item + .film-item { margin-top: 40px; }
.film-caption { display: flex; gap: 16px; text-transform: uppercase; }

/* Player */
.player { position: relative; width: var(--col, 100%); aspect-ratio: var(--ratio, 16/9); background: var(--tone); overflow: hidden; cursor: pointer; margin: 0 auto; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s ease; }
.player.started .poster { opacity: 0; pointer-events: none; }
.player .big-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%; border: 1px solid var(--ink); background: rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center; transition: opacity .4s ease; z-index: 2;
}
.player .big-play svg { width: 16px; height: 16px; margin-left: 3px; }
.player.playing .big-play { opacity: 0; pointer-events: none; }
.player .loader { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); opacity: 0; transition: opacity .3s; text-transform: uppercase; pointer-events: none; }
.player.waiting .loader { opacity: .7; }
.player .bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 28px 20px 14px;
  background: linear-gradient(to top, rgba(255,255,255,.75), rgba(255,255,255,0));
  display: flex; flex-direction: column; gap: 10px; opacity: 0; transition: opacity .5s ease;
}
.player.started:not(.playing) .bar, .player.active .bar { opacity: 1; }
.player .progress { position: relative; height: 13px; display: flex; align-items: center; cursor: pointer; }
.player .progress i { position: absolute; left: 0; height: 1px; }
.player .progress .track-bg { right: 0; background: rgba(20,19,18,.18); }
.player .progress .buffer { background: rgba(20,19,18,.35); width: 0; }
.player .progress .fill { background: var(--ink); width: 0; }
.player .ctrls { display: flex; justify-content: space-between; align-items: center; text-transform: uppercase; }
.player .ctrls .group { display: flex; gap: 20px; align-items: center; }
.player .ctrls button { padding: 6px 0; text-transform: uppercase; }
.player .time { font-variant-numeric: tabular-nums; }
.player:fullscreen { max-height: none; aspect-ratio: auto; background: #000; }
.player:fullscreen video { object-fit: contain; }

/* Photo grid: native ratios, landscapes span two columns */
.gallery { display: flex; flex-direction: column; gap: 16px; }
.gallery-row { display: flex; gap: 16px; }
.gallery figure { margin: 0; min-width: 0; background: var(--tone); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }

.deliverables { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 40px; padding: 32px 0 8px; border-top: 1px solid var(--line); }
.deliverables .total { display: flex; gap: 16px; align-items: baseline; margin: 12px 0; }
.deliverables .total b { font-family: var(--serif); font-weight: 400; font-size: 64px; line-height: 1; letter-spacing: -0.02em; }
.deliverables .list { text-transform: uppercase; }
.deliverables .group-label { color: var(--grey); padding: 20px 0 8px; display: block; }
.deliverables .group-label:first-child { padding-top: 0; }
.deliverables .row { display: grid; grid-template-columns: 64px minmax(0,1fr) 120px; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.deliverables .row:last-child { border-bottom: 1px solid var(--line); }
.deliverables .row span:last-child { color: var(--grey); text-align: right; }

.project-nav { display: flex; justify-content: space-between; text-transform: uppercase; font-size: 11px; }
.project-nav a { padding: 8px 0; }
.project-nav a:first-child { color: var(--grey); }

/* =========================================================
   ABOUT
   ========================================================= */
.about { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; padding: 28px var(--pad-x); }
.about .lines {
  margin: 0; padding-bottom: 28px; border-bottom: 1px solid var(--line);
  font-family: var(--serif); font-size: clamp(24px, 2.4vw, 34px); line-height: 1.3; letter-spacing: -0.015em;
}
.about .lines span { display: block; text-wrap: balance; }
.about .services { margin: 0; padding: 28px 0 0; list-style: none; display: flex; flex-wrap: wrap; gap: 16px 72px; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }

/* =========================================================
   Mobile
   ========================================================= */
@media (max-width: 820px) {
  :root { --pad-x: 16px; --pad-top: 16px; }
  .site-nav { gap: 20px; }
  .site-header .logo img { height: 16px; }
  .work { justify-content: flex-start; padding-top: 24px; }
  .strip { overflow: visible; padding: 0 var(--pad-x); }
  .track { flex-direction: column; width: auto; gap: 32px; align-items: stretch; }
  .card .media { height: auto; width: 100%; }
  .fade-edge, .scrollbar { display: none; }
  .index { gap: 0; }
  .index-preview { display: none; }
  .index-row { grid-template-columns: 28px minmax(0,1fr) 64px; }
  .index-row .talent, .index-row .type, .index-row .role, .index-row .year { display: none; }
  .index-row .client { font-size: 18px; }
  .project-head, .deliverables { grid-template-columns: 1fr; }
  .credits { gap: 20px 24px; }
  .work { padding-top: 24px; }
  .gallery-row { flex-direction: column; }
  .gallery figure { flex: none !important; width: 100%; }
  .gallery-spacer { display: none; }
  .player .big-play { width: 64px; height: 64px; }
  .about .lines span { display: inline; }
  .about .services { gap: 12px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .page-content { animation: none; }
  html.play-intro .intro { display: none; }
  .track, .card .media img { transition: none; }
}
