/* cpil.info – one stylesheet for the whole site */
:root {
  --bg: #0E0E0D;
  --fg: #EDEAE4;
  --soft: #C9C5BE;
  --mute: #8E8A83;
  --line: #2A2927;
  --heading: Signika, sans-serif;
  --heading-weight: 300;
  --body: brix-slab, Georgia, serif;
  --pad: 4vw;
  --max: 1360px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: .75; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.label { margin: 0; font-family: var(--heading); font-weight: var(--heading-weight); font-size: 14px; letter-spacing: .5em; text-transform: uppercase; color: var(--mute); }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; }
.h1 { margin: 0; font-family: var(--heading); font-weight: var(--heading-weight); font-size: clamp(48px, 7vw, 88px); line-height: 1; }
.h2 { margin: 0; font-family: var(--heading); font-weight: var(--heading-weight); font-size: clamp(32px, 4vw, 44px); line-height: 1.1; }
.muted { color: var(--mute); }
.soft { color: var(--soft); }
.small { font-size: 13px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 16px 24px; margin-bottom: 40px; }

/* Header */
.site-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px; padding: 28px var(--pad); }
.site-header.overlay { position: absolute; top: 0; left: 0; right: 0; z-index: 5; color: #F2EFEA; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.site-header.overlay .logo { filter: drop-shadow(0 1px 8px rgba(0,0,0,.35)); }
.logo { height: 48px; width: auto; display: block; overflow: visible; }
.main-nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-family: var(--heading); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; }

/* Hero */
.hero { position: relative; height: clamp(240px, 34vh, 400px); overflow: hidden; background: #0B0B0A; }
/* On a computer, hovering the banner smoothly opens it downwards to show more of the still */
/* The chevron (or tapping it on a phone) does the same */
.hero { transition: height .9s cubic-bezier(.2,.7,.2,1); }
.hero.open { height: clamp(420px, 72vh, 780px); }
@media (hover: hover) and (pointer: fine) {
  .hero { transition-delay: .15s; }
  .hero:hover { height: clamp(420px, 72vh, 780px); }
}
@media (prefers-reduced-motion: reduce) { .hero:hover { height: clamp(240px, 34vh, 400px); } }
.banner-toggle { position: absolute; left: 50%; bottom: 6px; z-index: 4; width: 64px; height: 44px; margin-left: -32px; padding: 0; border: 0; background: none; color: #F2EFEA; opacity: .75; display: flex; align-items: center; justify-content: center; }
.banner-toggle:hover { opacity: 1; }
.banner-toggle svg { animation: nudge 2.6s ease-in-out infinite; transition: transform .6s cubic-bezier(.2,.7,.2,1); filter: drop-shadow(0 1px 6px rgba(0,0,0,.45)); }
@keyframes nudge { 0%, 60%, 100% { translate: 0 0; } 30% { translate: 0 4px; } }
.hero.open .banner-toggle svg { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .hero:hover .banner-toggle svg { transform: rotate(180deg); } }
.slide { margin: 0; }
.slide { position: absolute; inset: 0; opacity: 0; z-index: 0; transition: opacity 1.4s ease; }
.slide.active { opacity: 1; z-index: 2; }
.slide.prev { opacity: 1; z-index: 1; transition: none; }
.slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); }
.slide.active img, .slide.prev img { animation: drift 9s ease-out forwards; }
@keyframes drift { to { transform: scale(1.12); } }
.hero-shade { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,.25) 16%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 55%, rgba(0,0,0,.65) 100%); }
.hero-caption { z-index: 4; position: absolute; left: var(--pad); right: var(--pad); bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; color: #F2EFEA; }
.hero-title-link { display: flex; flex-direction: column; gap: 6px; }
.hero-title { font-family: var(--heading); font-weight: var(--heading-weight); font-size: clamp(36px, 5vw, 56px); line-height: 1.05; }
.dots { display: flex; gap: 10px; }
.dots button { width: 44px; height: 44px; padding: 0; border: 0; background: none; display: flex; align-items: center; }
.dots span { display: block; width: 100%; height: 2px; background: #F2EFEA; opacity: .35; transition: opacity .4s; }
.dots .on span { opacity: 1; }

.banner-caption { position: absolute; right: var(--pad); bottom: 18px; z-index: 4; margin: 0; font-size: 12px; letter-spacing: .08em; color: rgba(242,239,234,.8); }

/* Work list */
.work { padding-top: 64px; padding-bottom: 100px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid #3A3936; background: transparent; font-size: 13px; letter-spacing: .04em; }
.filters button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.work-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 56px; align-items: stretch; }
.work-list { list-style: none; margin: 0; padding: 0; min-width: 0; border-top: 1px solid var(--line); }
.work-list li { border-bottom: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: baseline; gap: 20px; padding: 26px 0; transition: opacity .4s; }
.row:hover { opacity: 1; }
.row.dim { opacity: .45; }
.row-thumb { display: none; }
.row-num { font-size: 12px; letter-spacing: .1em; color: var(--mute); }
.row-title { font-family: var(--heading); font-weight: var(--heading-weight); font-size: clamp(26px, 3vw, 38px); line-height: 1.1; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.row:hover .row-title { transform: translateX(14px); }
.row-meta { font-size: 13px; color: var(--mute); text-align: right; white-space: nowrap; }
/* The preview is exactly as tall as the list next to it; the still fills it */
.work-preview { position: relative; min-height: 320px; overflow: hidden; background: #1A1A18; }
.work-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity .6s ease, transform 1.2s cubic-bezier(.2,.7,.2,1); }
.work-preview img.on { opacity: 1; transform: scale(1); }
@media (max-width: 960px) {
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .work-preview { display: none; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 20px 0 24px; }
  .row-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 10px; }
  .row-num { display: none; }
  .row-meta { text-align: left; }
  .row:hover .row-title { transform: none; }
}

/* Players */
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-poster { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; }
.player-poster img { width: 100%; height: 100%; object-fit: cover; }
.play-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: #F2EFEA; }
.play-ring { width: 92px; height: 92px; border-radius: 50%; border: 1px solid rgba(242,239,234,.8); display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.25); transition: transform .4s ease; }
.player-poster:hover .play-ring { transform: scale(1.08); }
.play-label { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; }
.reel { padding-bottom: 120px; }

/* About */
.about { padding-top: 40px; padding-bottom: 80px; display: flex; flex-wrap: wrap; gap: 64px; align-items: center; }
.about > img { flex: 1 1 320px; width: 100%; min-width: 0; max-width: 460px; aspect-ratio: 1 / 1; object-fit: cover; filter: grayscale(1); }
.about-text { flex: 999 1 420px; min-width: 0; max-width: 640px; display: flex; flex-direction: column; gap: 20px; }
.about-text p { margin: 0; color: var(--soft); }

/* Contact */
.contact { border-top: 1px solid var(--line); }
.contact-inner { padding-top: 72px; padding-bottom: 72px; display: flex; flex-wrap: wrap; gap: 48px 80px; }
.contact-intro { flex: 1 1 300px; display: flex; flex-direction: column; gap: 12px; }
.contact-intro p { margin: 0; }
.contact-form { flex: 999 1 480px; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.contact-form input, .contact-form textarea { min-height: 44px; padding: 8px 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--fg); font: inherit; font-size: 16px; letter-spacing: 0; text-transform: none; }
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-bottom-color: var(--fg); }
.contact-form .full { grid-column: 1 / -1; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 16px; }
.form-status { margin: 0; margin-right: auto; font-size: 14px; color: var(--soft); }
.btn { min-height: 48px; padding: 0 28px; border-radius: 24px; border: 1px solid var(--fg); background: var(--fg); color: var(--bg); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.btn:disabled { opacity: .5; cursor: default; }
.thanks { grid-column: 1 / -1; margin: 0; font-size: 20px; color: var(--soft); }
@media (max-width: 560px) { .contact-form { grid-template-columns: minmax(0, 1fr); } }

/* Project page */
.project-player { padding-top: 8px; }
.project-intro { padding-top: 72px; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 48px 80px; }
.project-text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.project-text p { margin: 0; }
.logline { max-width: 640px; font-size: 21px; line-height: 1.5; color: var(--soft); }
.tags { display: flex; flex-wrap: wrap; gap: 12px; }
.tags span { padding: 8px 14px; border: 1px solid #3A3936; border-radius: 20px; font-size: 13px; }
.credits { flex: 1 1 340px; margin: 0; columns: 2; column-gap: 24px; font-size: 14px; }
.credits div { break-inside: avoid; margin-bottom: 18px; }
.credits dt { color: var(--mute); font-size: 12px; letter-spacing: .08em; }
.credits dd { margin: 2px 0 0; }
.extra-video { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 24px 64px; align-items: center; }
.extra-video > div:first-child { flex: 1 1 260px; display: flex; flex-direction: column; gap: 12px; }
.extra-video > div:first-child p { margin: 0; }
.extra-video .player { flex: 999 1 600px; width: auto; }
.stills { padding-top: 40px; padding-bottom: 80px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.still { grid-column: span var(--span); overflow: hidden; }
.still img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.still:hover img { transform: scale(1.03); }
@media (max-width: 760px) { .still { grid-column: 1 / -1; aspect-ratio: 16 / 9 !important; } .credits { columns: 1; } }
.next { position: relative; display: block; height: 440px; overflow: hidden; color: #F2EFEA; }
.next:hover { opacity: 1; }
.next img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.next:hover img { transform: scale(1.03); }
.next-shade { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.next-text { position: absolute; left: var(--pad); bottom: 56px; display: flex; flex-direction: column; gap: 8px; }
.next-title { font-family: var(--heading); font-weight: var(--heading-weight); font-size: clamp(40px, 5vw, 64px); line-height: 1.05; }

/* Next project whose only image is a title card: card on the right, text on the left */
.next.card { background: #151514; }
.next.card img { position: absolute; top: 0; right: 0; width: 58%; height: 100%; }
.next.card .next-shade { background: linear-gradient(90deg, #151514 38%, rgba(21,21,20,0) 70%); }
.next.card .next-text { max-width: 40%; }
@media (max-width: 760px) { .next.card img { width: 100%; opacity: .35; } .next.card .next-text { max-width: none; right: var(--pad); } }

/* Phones: logo centred on its own at the top, menu under the banner / player, filters on one line */
.mobile-nav { display: none; }
@media (max-width: 760px) {
  .site-header, .site-header.overlay { position: static; justify-content: center; padding: 22px var(--pad) 18px; background: var(--bg); color: var(--fg); text-shadow: none; }
  .site-header.overlay .logo { filter: none; }
  .site-header .main-nav { display: none; }
  .logo { height: 44px; }
  .mobile-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; padding: 16px var(--pad); border-bottom: 1px solid var(--line); font-family: var(--heading); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
  .mobile-nav a { padding: 8px 0; }
  .project-player + .mobile-nav { margin-top: 16px; border-top: 1px solid var(--line); }
  .project-player { padding-top: 0; }
  .project-intro { padding-top: 40px; }
  .work { padding-top: 40px; }
  .work .section-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .filters { flex-wrap: nowrap; gap: 6px; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; min-height: 40px; padding: 0 13px; font-size: 12.5px; letter-spacing: 0; white-space: nowrap; }
}

/* Footer */
.site-footer { max-width: var(--max); margin: 0 auto; padding: 32px var(--pad) 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; font-size: 12px; color: var(--mute); }
.site-footer nav { display: flex; gap: 28px; letter-spacing: .14em; text-transform: uppercase; }

/* /work grid */
.wgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--bg); }
.wtile { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #1A1A18; color: #F2EFEA; transition: opacity .5s ease, filter .5s ease; }
.wtile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.wtile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.7) 100%); opacity: 0; transition: opacity .4s ease; }
.wtile-text { position: absolute; left: 22px; right: 22px; bottom: 18px; z-index: 1; display: flex; flex-direction: column; gap: 4px; opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease; }
.wtile-title { font-family: var(--heading); font-weight: var(--heading-weight); font-size: 24px; line-height: 1.1; }
.wtile-meta { font-size: 12px; letter-spacing: .08em; color: rgba(242,239,234,.75); }
.wtile:hover img, .wtile.active img { transform: scale(1.04); }
.wtile:hover::after, .wtile:focus-visible::after, .wtile.active::after { opacity: 1; }
.wtile:hover .wtile-text, .wtile:focus-visible .wtile-text, .wtile.active .wtile-text { opacity: 1; transform: none; }
.wbar { padding-top: 8px; margin-bottom: 28px; }
.wtile[hidden] { display: none; }
.wtile.dim { opacity: .3; filter: grayscale(.6); }
.wtile.dim:hover { opacity: .7; }
.wpanel { grid-column: 1 / -1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .7s cubic-bezier(.2,.7,.2,1); }
.wpanel.show { grid-template-rows: 1fr; }
.wpanel > .wpanel-inner { overflow: hidden; min-height: 0; }
.wpanel-inner { position: relative; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 0 var(--pad); }
.wpanel.show .wpanel-inner { padding-top: 48px; padding-bottom: 56px; }
.wpanel-meta { font-size: 12px; letter-spacing: .08em; color: var(--mute); margin: 0 0 10px; }
.wpanel-title { font-family: var(--heading); font-weight: var(--heading-weight); font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05; margin: 0 0 18px; }
.wpanel-log { color: var(--soft); line-height: 1.6; margin: 0 0 24px; }
.wpanel-more { font-size: 13px; letter-spacing: .08em; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.wpanel-more:hover { border-color: currentColor; }
.wpanel-close { position: absolute; top: 12px; right: var(--pad); background: none; border: 0; color: var(--mute); font-size: 28px; line-height: 1; cursor: pointer; }
.wpanel-close:hover { color: var(--fg); }
@media (hover: none) { .wtile::after, .wtile-text { opacity: 1; transform: none; } }
@media (max-width: 1000px) { .wgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .wgrid { grid-template-columns: 1fr; }
  .wpanel-inner { grid-template-columns: 1fr; gap: 24px; }
  .wpanel.show .wpanel-inner { padding-top: 40px; padding-bottom: 40px; }
  .wtile-title { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .wpanel, .wtile, .wtile img { transition: none; } }
