/* Pedro Verri portfolio: graphic-novel style */
/* self-hosted fonts (latin subset) */
@font-face { font-family: "Anton"; font-weight: 400; font-display: swap; src: url(../fonts/anton.woff2) format("woff2"); }
@font-face { font-family: "Courier Prime"; font-weight: 400; font-display: swap; src: url(../fonts/courier-prime.woff2) format("woff2"); }
@font-face { font-family: "Courier Prime"; font-weight: 700; font-display: swap; src: url(../fonts/courier-prime-bold.woff2) format("woff2"); }
:root {
  --paper: #EDEAE3;
  --ink: #111;
  --white: #fff;
  --gap: 14px;
  --display: "Anton", Impact, sans-serif;
  --mono: "Courier Prime", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 16px; line-height: 1.5; }
img, video { display: block; max-width: 100%; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 760px) { .wrap { padding: 0 16px; } }

/* Halftone + inked borders */
.ht { background-color: #D3CFC6; background-image: radial-gradient(var(--ink) 1.1px, transparent 1.6px); background-size: 7px 7px; }
.ink-frame { position: absolute; inset: 0; border: 4.5px solid var(--ink); filter: url(#rough); pointer-events: none; z-index: 3; transition: border-width var(--tr), inset var(--tr); }
/* "line boil" on hover: the inked frame jitters between three hand-drawn variations */
@keyframes boil { 0% { filter: url(#rough); } 33% { filter: url(#rough2); } 66% { filter: url(#rough3); } }
.panel:hover .ink-frame, .panel:focus-visible .ink-frame, .about .photo:hover .ink-frame, .about .bio:hover .ink-frame, .shot:hover .ink-frame, .shot:focus-visible .ink-frame, .panel.lit .ink-frame { border-width: 8px; inset: -3.5px; animation: boil .3s steps(1) infinite; }

/* Buttons / tags */
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 2.5px solid var(--ink); background: var(--white); color: var(--ink);
  font: 700 15px/1 var(--mono); text-decoration: none; letter-spacing: .5px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translate(-3px, -3px); box-shadow: 4px 4px 0 var(--ink); }
/* selected filter / current section: black (not clickable), held in the lifted "hover" pose */
.btn[aria-pressed="true"], .btn[aria-current] { background: var(--ink); color: var(--paper); cursor: default;
  transform: translate(-3px, -3px); box-shadow: 4px 4px 0 #8A877F; }

/* Masthead */
.masthead { position: relative; margin-top: 28px; padding: 0; display: flex; flex-wrap: wrap; gap: 20px;
  align-items: flex-end; justify-content: space-between; overflow: hidden; }
.masthead .logo { width: min(340px, 70vw); height: auto; }
.caption { display: inline-block; background: var(--white); border: 2.5px solid var(--ink); padding: 6px 12px; font-weight: 700; font-size: 15px; }
.masthead .caption { margin-top: 10px; padding: 0; border: 0; background: none; font-size: 16px; letter-spacing: .5px; }
.masthead .brand { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 14px; }

/* Gallery */
.grid { display: flex; flex-direction: column; gap: var(--gap); }
.tier { display: flex; gap: var(--gap); height: var(--h, 360px); }
.tier[hidden] { display: none; }
/* when a filter is active, drop the comic tiers for a uniform grid of squares */
.grid.filtered { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.filtered .tier { display: contents; }
.grid.filtered .panel { height: auto; aspect-ratio: 1 / 1; }
.panel { position: relative; display: block; flex: 1 1 0; min-width: 0; text-decoration: none; color: var(--ink); background: #D3CFC6; }
.panel:hover, .panel:focus-visible, .panel.lit { z-index: 5; }
.panel.ht { background-color: #D3CFC6; background-image: radial-gradient(var(--ink) 1.1px, transparent 1.6px); background-size: 7px 7px; }
.clip { position: absolute; inset: 0; overflow: hidden; }
.clip img, .clip video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip video { opacity: 0; transition: opacity .2s; }
.clip img, .clip video { transition: opacity .2s, transform 1.6s cubic-bezier(.2, .7, .2, 1); }
.panel:hover .clip img, .panel:hover .clip video, .panel:focus-visible .clip img, .panel.lit .clip img, .panel.lit .clip video { transform: scale(1.07); }
.panel.playing video { opacity: 1; }
/* halftone screen over the art, lifted on hover */
.clip::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: radial-gradient(rgba(17,17,17,.32) 1.1px, transparent 1.6px); background-size: 8px 8px;
  mix-blend-mode: multiply; transition: opacity var(--tr); }
.panel:hover .clip::after, .panel:focus-visible .clip::after, .panel.lit .clip::after { opacity: 0; }
.panel .tag { position: absolute; left: 16px; bottom: 16px; z-index: 6; background: var(--white); border: 2.5px solid var(--ink); padding: 6px 10px; transition: transform var(--tr), box-shadow var(--tr); }
.panel:hover .tag, .panel:focus-visible .tag, .panel.lit .tag { transform: translate(6px, -8px); box-shadow: -5px 5px 0 var(--ink); }
.tag b { display: block; font: 400 30px/1 var(--display); letter-spacing: .5px; text-transform: uppercase; }
.tag span { display: block; margin-top: 3px; font-size: 12px; font-weight: 700; }
.panel .soon { position: absolute; right: 10px; top: 10px; z-index: 6; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 700; padding: 3px 8px; }
.panel[hidden] { display: none; }
@media (max-width: 760px) {
  /* phone: each tier = one wide panel, then two side by side */
  .tier { flex-wrap: wrap; height: auto; gap: 10px; }
  .tier .panel { flex: 1 1 calc(50% - 5px) !important; height: 170px; }
  .tier .panel:first-child { flex-basis: 100% !important; height: 220px; }
  .grid { gap: 10px; }
  .grid.filtered { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.filtered .panel { height: auto; }
  .panel .tag { left: 10px; bottom: 10px; padding: 4px 7px; }
  .tag b { font-size: 19px; }
  .tag span { font-size: 9.5px; }
  .panel .soon { font-size: 10px; }
  /* phones: the panels crossing the middle of the screen lose their halftone */
  .panel.in-focus .clip::after { opacity: 0; }
  /* phones: a tile in focus gets the full hover treatment */
  .panel.in-focus .ink-frame { border-width: 8px; inset: -3.5px; animation: boil .3s steps(1) infinite; }
  .panel.in-focus .tag { transform: translate(6px, -8px); box-shadow: -5px 5px 0 var(--ink); }
  .panel.in-focus .clip img { transform: scale(1.07); }
  /* Everseed: keep the character's head in frame on the wide phone panel */
  .panel[href*="everseed"] .clip img { object-position: 45% 22% !important; }
  /* small (half-width) panels: shorter one-line titles */
  .tier .panel:not(:first-child) .tag b { font-size: 15px; white-space: nowrap; }
  .tier .panel .tag { max-width: calc(100% - 20px); }
}

/* About */
.about { display: flex; flex-wrap: wrap; gap: var(--gap); margin-top: var(--gap); }
.about .photo { position: relative; flex: 0 1 240px; min-height: 0; }
.about .photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15); }
.about .bio { position: relative; flex: 999 1 520px; padding: 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.about-title { margin: 0 0 14px; font: 400 clamp(34px, 4vw, 48px)/1 var(--display); }
.about .bio p { margin: 0; font-size: clamp(16px, 1.25vw, 18px); line-height: 1.55; }
/* career timeline: one inked line, an ink dot per stop (left to right; vertical on phones) */
.timeline { list-style: none; margin: 26px 0 4px; padding: 0; position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 4px; background: var(--ink); filter: url(#rough); }
.timeline li { position: relative; padding-top: 34px; font-size: 14px; line-height: 1.35; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--paper); filter: url(#rough); }
.timeline li.now::before { width: 32px; height: 32px; top: -4px; background: var(--paper); border: 9px solid var(--ink); box-sizing: border-box; }
.timeline .yr { display: block; font: 400 30px/1 var(--display); }
.timeline b { display: inline-block; margin-top: 6px; background: var(--ink); color: var(--paper); padding: 3px 8px; font: 400 17px/1.1 var(--display); letter-spacing: .5px; }
.timeline span:last-child { display: block; margin-top: 6px; }
@media (max-width: 760px) {
  .timeline { grid-template-columns: 1fr; gap: 20px; padding-left: 40px; }
  .timeline::before { left: 10px; right: auto; top: 0; bottom: 0; width: 4px; height: auto; }
  .timeline li { padding-top: 0; }
  .timeline li::before { left: -40px; }
  .timeline li.now::before { left: -44px; top: -4px; }
}
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 22px 0 36px; font-size: 13px; }

/* Homepage tiles use the same outward-growing .ink-frame as case-study shots (see top). */

/* Phone header + filters */
@media (max-width: 760px) {
  .masthead { margin-top: 18px; gap: 14px; align-items: center; justify-content: center; }
  .masthead .brand { width: 100%; }
  .masthead h1 { display: flex; justify-content: center; }
  .about .photo { display: none; }
  .masthead .logo { width: 220px; }
  .masthead .caption { font-size: 13px; }
  .cs-nav .btn { min-height: 40px; padding: 6px 10px; font-size: 13px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 14px -16px 12px; padding: 4px 16px 8px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters .btn { flex: 0 0 auto; min-height: 40px; padding: 6px 12px; font-size: 13px; }
  .home-rule { margin-top: 16px; }
}

/* Case study */
.cs-nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 24px; }
.cs-nav .logo { width: 150px; height: auto; }
.cs { display: flex; flex-direction: column; gap: var(--gap); padding-top: 18px; }
.cs-head h1 { margin: 10px 0 0; font: 400 clamp(56px, 8vw, 110px)/.92 var(--display); }
/* information (not clickable) = black */
.cells { display: flex; flex-wrap: wrap; gap: var(--gap); }
.cell { position: relative; flex: 1 1 200px; padding: 16px 18px; background: var(--ink); color: var(--paper); }
.cell small { display: block; font-weight: 700; font-size: 12px; opacity: .75; }
.cell div { font-size: 17px; margin-top: 4px; }
.box { position: relative; flex: 1 1 300px; padding: 26px 24px; background: var(--ink); color: var(--paper); }
.box h2 { margin: 0; font: 400 30px/1.1 var(--display); }
.box p { margin: 10px 0 0; font-size: 17px; }
/* clickable = white with a black inked stroke, lifts on hover */
.box.try { background: var(--white); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; justify-content: center;
  transition: transform .15s, box-shadow .15s; }
.box.try { border: 2.5px solid var(--ink); }
.box.try:hover, .box.try:focus-visible { transform: translate(-3px, -3px); box-shadow: 4px 4px 0 var(--ink); }
/* inked separator between a page's header and its content */
.ink-rule { border: 0; height: 4.5px; margin: 6px 0 10px; background: var(--ink); filter: url(#rough); }
.home-rule { margin: 22px 0 0; }
.end-rule { margin: 18px 0 4px; }
.cs .next { margin-top: 0; }
.section-title { margin: 22px 0 0; font: 400 40px/1 var(--display); }
.flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
@media (max-width: 760px) { .flow { grid-template-columns: 1fr; } }
.shot { position: relative; display: block; margin: 0; overflow: hidden; color: var(--ink); cursor: zoom-in; }
.shot img { display: block; width: 100%; height: auto; transition: transform 1.6s cubic-bezier(.2, .7, .2, 1); }
.shot:hover img, .shot:focus-visible img { transform: scale(1.04); }
.shot .tag { position: absolute; left: 16px; bottom: 16px; z-index: 6; background: var(--white); border: 2.5px solid var(--ink); padding: 6px 10px; transition: transform .15s, box-shadow .15s; }
.shot:hover .tag, .shot:focus-visible .tag { transform: translate(6px, -8px); box-shadow: -5px 5px 0 var(--ink); }
.shot .expand { position: absolute; right: 14px; top: 14px; z-index: 6; width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--white); border: 2.5px solid var(--ink); opacity: 0; transform: scale(.8); transition: opacity .15s, transform .15s; }
.shot:hover .expand, .shot:focus-visible .expand { opacity: 1; transform: none; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(17, 17, 17, .88); }
.lightbox img, .lightbox video { display: block; max-width: 94vw; max-height: 84vh; width: auto; height: auto; border: 4px solid var(--paper); background: #000; }
.shot.vid { aspect-ratio: 16 / 9; }
.shot.vid img, .shot.vid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot.vid video { opacity: 0; transition: opacity .2s; }
.shot.vid.playing video { opacity: 1; }
.lightbox img.upscale { width: min(70vmin, 560px); height: auto; background: var(--white); }
.lightbox .btn { margin-top: 10px; }
.next { position: relative; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding: 16px 16px 16px 32px; margin-top: 10px;
  background: var(--white); color: var(--ink); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.next b { display: block; font: 400 clamp(40px, 6vw, 72px)/1 var(--display); margin-top: 6px; }
.next { border: 2.5px solid var(--ink); }
.next-thumb { position: relative; display: block; width: min(260px, 100%); aspect-ratio: 16 / 9; overflow: hidden; }
.next-thumb::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: radial-gradient(rgba(17,17,17,.32) 1.1px, transparent 1.6px); background-size: 8px 8px; mix-blend-mode: multiply; transition: opacity var(--tr); }
.next:hover .next-thumb::after, .next:focus-visible .next-thumb::after { opacity: 0; }
.next-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.next:hover, .next:focus-visible { transform: translate(-3px, -3px); box-shadow: 4px 4px 0 var(--ink); }

/* Ink page transition: a liquid ink swoosh (16 frames of 960x540 in ONE row, 15360px wide,
   kept under the 16384px GPU texture limit) floods the screen black, then a second swoosh
   reveals the new page. Chrome, Edge, Safari 18.2+; other browsers just switch pages. */
@view-transition { navigation: auto; }
::view-transition { background: #111; }
::view-transition-group(root) { animation-duration: .82s; }
::view-transition-old(root), ::view-transition-new(root) {
  -webkit-mask-size: 1600% 100%; mask-size: 1600% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  animation: ink-frames .38s steps(16, jump-none) both; mix-blend-mode: normal;
}
::view-transition-old(root) { -webkit-mask-image: url("../ink16-out.webp"); mask-image: url("../ink16-out.webp"); }
::view-transition-new(root) { -webkit-mask-image: url("../ink16-in.webp"); mask-image: url("../ink16-in.webp"); animation-delay: .42s; }
:root.ink-h::view-transition-old(root) { -webkit-mask-image: url("../ink16-out-h.webp"); mask-image: url("../ink16-out-h.webp"); }
:root.ink-h::view-transition-new(root) { -webkit-mask-image: url("../ink16-in-h.webp"); mask-image: url("../ink16-in-h.webp"); }
:root.ink-v::view-transition-old(root) { -webkit-mask-image: url("../ink16-out-v.webp"); mask-image: url("../ink16-out-v.webp"); }
:root.ink-v::view-transition-new(root) { -webkit-mask-image: url("../ink16-in-v.webp"); mask-image: url("../ink16-in-v.webp"); }
:root.ink-hv::view-transition-old(root) { -webkit-mask-image: url("../ink16-out-hv.webp"); mask-image: url("../ink16-out-hv.webp"); }
:root.ink-hv::view-transition-new(root) { -webkit-mask-image: url("../ink16-in-hv.webp"); mask-image: url("../ink16-in-hv.webp"); }
@keyframes ink-frames {
  from { -webkit-mask-position: 0% 0; mask-position: 0% 0; }
  to   { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; -webkit-mask: none; mask: none; }
  ::view-transition { background: none; }
  .btn, .panel .tag, .panel video, .clip::after, .ink-frame, .next-thumb::after { transition: none; }
  .ink-frame { animation: none !important; }
  .clip img, .clip video, .shot img { transition: none; transform: none !important; }
}

/* Phone: case studies */
@media (max-width: 760px) {
  .cs-nav .logo { width: 110px; }
  .cs-head h1 { font-size: 52px; }
  .cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cell { padding: 12px; }
  .cell div { font-size: 14px; }
  .cells .box, .cells .shot { grid-column: 1 / -1; }
  .box { padding: 20px 18px; }
  .box h2 { font-size: 26px; }
  .box p { font-size: 15px; }
  .flow { grid-template-columns: 1fr; gap: 10px; }
  .shot .tag { left: 8px; bottom: 8px; padding: 3px 6px; }
  .shot .tag b { font-size: 15px; }
  .flow .shot .tag b { font-size: 19px; }
  .shot .expand { opacity: 1; transform: none; width: 30px; height: 30px; right: 8px; top: 8px; }
  .shot .expand svg { width: 14px; height: 14px; }
  .section-title { font-size: 32px; }
  .next { padding: 16px; }
  .next-thumb { width: 100%; }
}

/* tiny build label so updates are easy to spot (update it on every push) */
.build { position: absolute; top: 3px; right: 6px; font-size: 9px; line-height: 1; color: #8A877F; letter-spacing: .3px; pointer-events: none; z-index: 50; }

/* hover timing: snappier on desktop, softer stepped focus on touch */
:root { --tr: .28s steps(6, end); }
@media (hover: hover) and (pointer: fine) { :root { --tr: .13s steps(3, end); } }

/* case-study shots: media clipped in .sclip (added by case.js) so the stroke can grow outward */
.shot.wrapped { overflow: visible; }
.sclip { display: block; overflow: hidden; }
.shot.vid .sclip { position: absolute; inset: 0; }

/* info lists: each item wraps whole; bullets at a line end are hidden by case.js */
.cell .it { display: inline-block; }

/* caption locks up with the logo: spans the same width as "VERRi" */
.masthead .caption { letter-spacing: .108em; margin-right: -.108em; }
@media (max-width: 760px) { .masthead .caption { font-size: 10.35px; } }

/* caption: optical nudge so it reads centred under the logo */
.masthead .caption { position: relative; left: 2.35%; }

/* static tiles: faint paper wash on top, cleared on hover / focus / lit */
.clip::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: var(--paper); opacity: .13; transition: opacity var(--tr); }
.panel:hover .clip::before, .panel:focus-visible .clip::before, .panel.lit .clip::before, .panel.in-focus .clip::before { opacity: 0; }

/* Top 25 Insiders: square trophy + vertical AR clip at the same height, caption box fills the rest */
/* widths come from the columns and heights from each tile's own shape (16u square, 9u x 16u clip),
   so both tiles always end up the same height; only the box stretches to match them */
.ar-row { display: grid; grid-template-columns: 16fr 9fr 12fr; gap: var(--gap); align-items: start; margin-bottom: var(--gap); }
.ar-row > .shot { width: 100%; height: auto; }
.ar-row .box { margin: 0; align-self: stretch; }
.ar-row .box p { font-size: clamp(13px, 1.25vw, 17px); }
@media (max-width: 760px) {
  .ar-row { grid-template-columns: 16fr 9fr; gap: 8px; }
  .ar-row .box { grid-column: 1 / -1; padding: 16px; }
  .ar-row .box h2 { font-size: 20px; } .ar-row .box p { font-size: 13px; }
}

/* masonry gallery (personal projects): natural aspect ratios in columns */
.masonry { columns: 3; column-gap: var(--gap); }
.masonry .shot { display: block; break-inside: avoid; margin: 0 0 var(--gap); }
.masonry .shot.vid { aspect-ratio: auto; }
@media (max-width: 760px) { .masonry { columns: 2; column-gap: 8px; } .masonry .shot { margin-bottom: 8px; } .masonry .shot .expand { width: 24px; height: 24px; right: 6px; top: 6px; } }

.masonry.js-cols { columns: auto; display: flex; gap: var(--gap); align-items: flex-start; }
.masonry.js-cols .mcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.masonry.js-cols .shot { margin: 0; }
@media (max-width: 760px) { .masonry.js-cols, .masonry.js-cols .mcol { gap: 8px; } }

/* before / after comparison: drag anywhere on the frame */
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.ba { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink); touch-action: pan-y; user-select: none; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 4px; margin-left: -2px; background: var(--ink); z-index: 2; pointer-events: none; }
.ba-line::after { content: "◀ ▶"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--paper); color: var(--ink); border: 3px solid var(--ink); padding: 6px 8px; font: 700 13px/1 var(--mono, monospace); white-space: nowrap; letter-spacing: 2px; }
.ba-name, .ba-side { position: absolute; z-index: 3; background: var(--ink); color: var(--paper); pointer-events: none; }
.ba-name { left: 50%; top: 12px; transform: translateX(-50%); padding: 5px 10px; font: 400 22px/1 var(--display); letter-spacing: .5px; }
.ba-side { bottom: 12px; padding: 4px 8px; font: 700 11px/1 var(--mono, monospace); letter-spacing: 1px; }
.ba-side.l { left: 12px; } .ba-side.r { right: 12px; }
.ba { cursor: ew-resize; }
.ba input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; z-index: 4; pointer-events: none; }
.ba .ink-frame { z-index: 5; }
.ba:focus-within .ink-frame, .ba:hover .ink-frame { border-width: 8px; inset: -3.5px; }
@media (max-width: 760px) { .ba-grid { grid-template-columns: 1fr; gap: 12px; } .ba-name { font-size: 17px; } }

/* before/after: enlarge button + big copy in the lightbox */
.ba .expand { position: absolute; right: 12px; top: 12px; z-index: 6; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; cursor: pointer;
  color: var(--ink); background: var(--white); border: 2.5px solid var(--ink); opacity: 0; transform: scale(.8); transition: opacity .15s, transform .15s; }
.ba:hover .expand, .ba:focus-within .expand { opacity: 1; transform: none; }
.ba .expand:hover { transform: translateY(-2px); box-shadow: 0 3px 0 var(--ink); }
.lightbox .ba-big { width: min(94vw, calc(84vh * 16 / 9)); border: 4px solid var(--paper); }
.lightbox .ba-big .ink-frame { display: none; }
.lightbox .ba-big img { max-width: none; max-height: none; border: 0; }
.lightbox .ba-big .ba-name { font-size: 30px; top: 16px; }
@media (max-width: 760px) { .ba .expand { opacity: 1; transform: none; width: 30px; height: 30px; right: 8px; top: 8px; } .ba .expand svg { width: 14px; height: 14px; } }

/* big hero clips (trailers / walkthrough): same behaviour as the smaller clips, full width */
.shot.vid.hero { display: block; margin-bottom: var(--gap); }
.shot.vid.hero.portrait { background: #000; }
.shot.vid.hero.portrait img, .shot.vid.hero.portrait video { object-fit: contain; }
@media (max-width: 760px) { .shot.vid.hero.portrait { aspect-ratio: 9 / 16; } .shot.vid.hero.portrait img, .shot.vid.hero.portrait video { object-fit: cover; } }
.foot-sig { display: inline-flex; align-items: center; gap: 10px; }
.sig-s { width: 30px; height: auto; color: var(--ink); overflow: visible; }

.ba-grid > .shot { aspect-ratio: 16 / 9; }
.ba-grid > .shot img { width: 100%; height: 100%; object-fit: cover; }
.shot.icons { display: block; margin-bottom: var(--gap); }

/* play button on the big clips, so they read as videos (especially on phones) */
.shot.vid.hero .play { position: absolute; left: 50%; top: 50%; z-index: 4; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%;
  display: grid; place-items: center; padding-left: 6px; color: var(--ink); background: var(--white); border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
  filter: url(#rough); transition: opacity var(--tr), transform var(--tr); pointer-events: none; }
.shot.vid.hero .play svg { width: 40px; height: 40px; }
.shot.vid.hero:hover .play { transform: translateY(-3px) scale(1.05); }
.shot.vid.hero.playing .play { opacity: 0; transform: scale(.85); }
@media (max-width: 760px) { .shot.vid.hero .play { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-width: 3px; box-shadow: 0 4px 0 var(--ink); } .shot.vid.hero .play svg { width: 28px; height: 28px; } }
.timeline[hidden] { display: none; }

/* ===== generated layouts (cms/build.py): every option comes from the content sheet ===== */
.flow.g { grid-template-columns: repeat(var(--c), minmax(0, 1fr)); }
.flow.g.c6 { gap: 12px; }
.flow.g > * { grid-column: span var(--s, 1); }
.flow.g.fixed > .shot, .flow.g.fixed > .stack > .shot { aspect-ratio: var(--ar); background: var(--bg, transparent); }
.flow.g.fixed .shot .sclip { position: absolute; inset: 0; }
.flow.g.fixed .shot img, .flow.g.fixed .shot video, .flow.g.fixed .shot picture { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: var(--fit, cover); }
.flow.g .shot[style*="--fit"] img, .flow.g .shot[style*="--fit"] video { object-fit: var(--fit); }
.flow.g .shot[style*="--bg"] { background: var(--bg); }
.flow.g .shot:not(.vid)[style*="aspect-ratio:auto"] .sclip { position: static; }
.flow.g .shot:not(.vid)[style*="aspect-ratio:auto"] img { position: static; height: auto; }
.flow.g .shot picture img { width: 100%; height: 100%; }
.stack { display: grid; grid-template-rows: repeat(var(--n), 1fr); gap: var(--gap); }
.stack > .shot { aspect-ratio: auto !important; }
.ba-grid[style*="--c"] { grid-template-columns: repeat(var(--c), minmax(0, 1fr)); }
.rowg { grid-template-columns: var(--w); }
.rowg > .shot.vid img, .rowg > .shot.vid video { object-fit: cover; }
@media (max-width: 760px) {
  .flow.g { grid-template-columns: repeat(var(--cm), minmax(0, 1fr)); }
  .flow.g > * { grid-column: span var(--sm, 1); }
  .flow.g.m3 { gap: 8px; } .flow.g.m4 { gap: 6px; }
  .flow.g.m2 .shot .tag span, .flow.g.m3 .shot .tag span, .flow.g.m4 .shot .tag span { display: none; }
  .flow.g.m2 .shot .tag b { font-size: 15px; }
  .flow.g.sm .shot .tag b { font-size: 13px; }
  .flow.g.lg .shot .tag b { font-size: 19px; }
  .flow.g.m3 .shot .tag b, .flow.g.m4 .shot .tag b { font-size: 13px; }
  .flow.g.m3 .shot .expand, .flow.g.m4 .shot .expand { width: 24px; height: 24px; right: 6px; top: 6px; }
  .flow.g.m4 .shot .expand { display: none; }
  .stack { grid-column: 1 / -1 !important; grid-template-rows: none; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; }
  .stack > .shot { aspect-ratio: 16 / 9 !important; }
  .ba-grid[style*="--cm"] { grid-template-columns: repeat(var(--cm), minmax(0, 1fr)); }
  .rowg { grid-template-columns: var(--wm); }
}
.flow.g + .flow.g { margin-top: var(--gap); }
