/* ---------- Theme ---------- */
:root {
  /* Cozy palette: deep brown background, cream text, warm accents */
  --bg: #1f1712;
  --fg: #fbf3e8;
  --text: #e9dccb;                    /* body copy, slightly softer than headings */
  --muted: #b5a290;
  --accent: #ff9f5a;
  --panel: #2a2019;                   /* form fields */
  --line: #3d2f25;                    /* dividers and borders */
  --menu-bg: rgba(52, 37, 28, .97);   /* dropdown / mobile menu, a step lighter than the page */
  --radius: 10px;                     /* rounded corners on artwork */
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ---------- Header / hero ---------- */
.hero {
  position: relative;
  min-height: 170px;
  overflow-x: clip;          /* the curved edge below is wider than the page; dropdown can still hang below */
  background: center / cover no-repeat;
  padding: 24px var(--gutter) 60px;
}
.hero::before {               /* darken image so text stays readable */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.45), rgba(0,0,0,.1) 60%);
}
.hero::after {                /* curved edge in the page colour, like a rising horizon */
  content: "";
  position: absolute; left: -10%; right: -10%; bottom: -1px;
  height: 40px;
  background: var(--bg);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { text-decoration: none; line-height: 1; }
.brand-name {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
  text-transform: none;
}
.brand-tag {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text);
}

.nav { display: flex; align-items: center; gap: 28px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; }
.nav li { position: relative; }
.nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-color: var(--accent); }
.has-sub > a::after { content: " \25BE"; font-size: 11px; }
.submenu {
  position: absolute; top: 100%; left: -16px; z-index: 30;
  border-top: 12px solid transparent;   /* drops the box below the underline but stays hoverable */
  display: none !important;
  flex-direction: column; gap: 0 !important;
  white-space: nowrap;
  padding: 8px 0 !important;
}
.submenu::before {            /* the brown box, drawn below the hover gap so all four corners are rounded */
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: var(--menu-bg);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}
.submenu a { display: block; padding: 8px 16px; border: 0; }
.submenu a:hover { color: var(--accent); }
.has-sub:hover .submenu, .has-sub:focus-within .submenu { display: flex !important; }

.socials { display: flex; gap: 14px; }
.socials a,
.nav .socials a { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; text-decoration: none; }
.socials svg { width: 20px; height: 20px; fill: currentColor; }
.socials a:hover { color: var(--accent); }

.menu-toggle {
  display: none;
  background: none; border: 0; color: var(--fg);
  font-size: 28px; cursor: pointer;
}

/* Page title, sits just under the banner */
.page-intro {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px var(--gutter) 0;
}
.page-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 44px);
  text-transform: none;
  line-height: 1.1;
}
/* Fredoka is loaded at 500/600; keep every display heading at 600 */
.page-title, .section h2, .tile span, .poster-title, .project h3 { font-weight: 600; }
.page-sub { margin: 6px 0 0; max-width: 640px; color: var(--muted); }

/* ---------- Sections ---------- */
main { padding: 0 var(--gutter) 80px; }
.section { max-width: 1400px; margin: 0 auto; padding-top: 28px; }
.section h2 {
  font-family: var(--display);
  text-transform: none;
  font-size: clamp(24px, 3vw, 36px);
  margin: 0 0 20px;
}
.lead { max-width: 720px; color: var(--text); font-size: 18px; }

/* Category tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}
.tile {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
  display: grid; place-items: center;
  text-decoration: none;
}
.tile img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease, filter .5s ease;
}
.tile span {
  position: relative;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(32px, 4vw, 56px);
  text-transform: none;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.tile:hover img { transform: scale(1.06); filter: brightness(.7); }

/* Masonry gallery */
.gallery { columns: 3 280px; column-gap: 8px; }
.gallery figure {
  margin: 0 0 8px;
  break-inside: avoid;
  position: relative;
  cursor: zoom-in;
  border-radius: var(--radius);
  overflow: hidden;
}
.gallery img { width: 100%; transition: transform .4s ease; }
.gallery figure:hover img { transform: scale(1.03); }
.gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 24px 12px 10px;
  font-size: 14px;
  background: linear-gradient(transparent, rgba(20, 14, 10, .85));
  opacity: 0; transition: opacity .3s;
}
.gallery figure:hover figcaption { opacity: 1; }

/* Animation project posters */
.posters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 32px 20px;
}
.poster { text-decoration: none; display: block; }
.poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform .35s ease, box-shadow .35s ease;
}
.poster:hover img { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(255,159,90,.25); }
.poster-title {
  display: block;
  margin-top: 12px;
  font-family: var(--display);
  font-size: 22px;
  text-transform: none;
}
.poster-meta { display: block; color: var(--muted); font-size: 14px; }

/* Covers made from artwork: title set over the bottom of the image */
.poster-art { position: relative; display: block; }
.poster-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 60px 16px 16px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: linear-gradient(transparent, rgba(20, 14, 10, .85));
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0,0,0,.5);
  transition: transform .35s ease;
}
.poster:hover .poster-name { transform: translateY(-6px); }
.poster-meta .ext { color: var(--accent); }

/* Game assets: transparent pieces on soft cards, label always visible */
.gallery.assets {
  columns: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cell, 200px), 1fr));
  gap: 12px;
}
.gallery.assets figure {
  margin: 0;
  padding: 14px 14px 10px;
  background: var(--panel);
  border-radius: calc(var(--radius) + 4px);
  display: flex; flex-direction: column;
}
.gallery.assets img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  transition: transform .3s ease;
}
.gallery.assets figure:hover img { transform: scale(1.05); }
.gallery.assets figcaption {
  position: static;
  opacity: 1;
  background: none;
  padding: 8px 0 0;
  text-align: center;
  color: var(--text);
  font-weight: 600;
}

/* Area restoration viewer: one card per area, buttons cross-fade between its states */
.areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr));
  gap: 20px;
}
.area {
  margin: 0;
  padding: 12px;
  background: var(--panel);
  border-radius: calc(var(--radius) + 6px);
}
.area h3 { margin: 4px 6px 12px; font-family: var(--display); font-weight: 600; font-size: 22px; }
.states {
  position: relative;
  aspect-ratio: var(--r);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  cursor: zoom-in;
}
.states img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}
.states img.on { opacity: 1; pointer-events: auto; }
.state-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.state-tabs button {
  flex: 1 1 auto;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--text);
  font: 600 14px var(--body);
  cursor: pointer;
}
.state-tabs button:hover { border-color: var(--accent); color: var(--fg); }
.state-tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* Single animation project page */
.back { color: var(--muted); text-decoration: none; }
.back:hover { color: var(--accent); }
.project-intro {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  margin-bottom: 48px;
}
.project-poster { width: 100%; border-radius: var(--radius); }

/* Project intro with a trailer preview card on the right */
.project-intro:has(.trailer-card) { grid-template-columns: minmax(0, 240px) minmax(0, 1fr) minmax(0, 320px); }
.trailer-card {
  display: block;
  text-decoration: none;
  padding: 10px 10px 14px;
  background: var(--panel);
  border-radius: calc(var(--radius) + 4px);
  transition: transform .25s, box-shadow .25s;
}
.trailer-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.trailer-thumb { position: relative; display: block; }
.trailer-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;              /* trims the black bars YouTube adds to thumbnails */
  border-radius: var(--radius);
}
.trailer-thumb .play {
  position: absolute; left: 50%; top: 50%;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  transform: translate(-50%, -50%);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
  transition: transform .25s;
}
.trailer-card:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.play svg { width: 26px; height: 26px; fill: currentColor; margin-left: 3px; }
.trailer-label { display: block; margin: 12px 4px 0; font-family: var(--display); font-weight: 600; font-size: 18px; }
.trailer-sub { display: block; margin: 2px 4px 0; color: var(--muted); font-size: 14px; }
@media (max-width: 1100px) {
  .project-intro:has(.trailer-card) { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); }
  .trailer-card { grid-column: 2; max-width: 380px; }
}

/* Justified rows: each figure's --r is its width/height ratio, so every row
   fills the full width and all images in a row share one height */
.gallery.rows { columns: auto; display: grid; gap: 8px; }
.gallery.rows .row { display: flex; gap: 8px; }
.gallery.rows figure { flex: var(--r) 1 0; min-width: 0; margin: 0; }
.gallery.rows img { width: 100%; aspect-ratio: var(--r); object-fit: cover; }

/* Feature blocks: a tall piece spans two rows beside stacked wide pieces,
   so vertical work gets as much presence as the landscapes */
.gallery.rows .feature {
  display: grid;
  grid-template-columns: var(--cols);
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  aspect-ratio: var(--ar);
}
.feature figure { min-width: 0; min-height: 0; }
.feature img { height: 100%; aspect-ratio: auto; }
.feature .c1 { grid-column: 1; }
.feature .c2 { grid-column: 2; }
.feature .c3 { grid-column: 3; }
.feature .r1 { grid-row: 1; }
.feature .r2 { grid-row: 2; }
.feature .tall { grid-row: 1 / 3; }

/* Project page details */
.credits {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 20px;
  margin: 20px 0 24px;
}
.credits dt { color: var(--muted); }
.credits dd { margin: 0; }
.section-note { margin: -10px 0 18px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chips a {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600; font-size: 14px;
}
.chips a:hover { border-color: var(--accent); color: var(--accent); }
section[id] { scroll-margin-top: 16px; }

/* Home intro: one line about me and a row of credits */
.intro .lead { margin: 0; max-width: 760px; }
.credits-strip { align-items: center; margin-top: 18px; }
.credits-label {
  margin-right: 4px;
  color: var(--muted);
  font-size: 13px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
}
.credits-strip .see-all { border-color: var(--accent); color: var(--accent); }

/* Looping clips sit in the same rows as images */
.gallery.rows video {
  display: block;
  width: 100%;
  aspect-ratio: var(--r);
  object-fit: cover;
  background: var(--panel);
}
.gallery figure.clip { cursor: default; }

/* Line-to-colour comparison: the line art sits on top, clipped at --pos */
.gallery figure.compare { cursor: ew-resize; flex: var(--r) 1 0; }
.compare img { width: 100%; aspect-ratio: var(--r); object-fit: cover; }
.gallery figure.compare:hover img { transform: none; }
.compare .top {
  position: absolute; inset: 0;
  height: 100%;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.compare::after {             /* divider handle */
  content: "";
  position: absolute; top: 0; bottom: 0; left: var(--pos);
  width: 3px; margin-left: -1.5px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(0,0,0,.5);
  pointer-events: none;
}
.compare input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.compare .tag {
  position: absolute; top: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(20, 14, 10, .75);
  font-size: 13px; font-weight: 600;
  pointer-events: none;
}
.compare .left { left: 10px; }
.compare .right { right: 10px; }

/* Floating episode panel (right edge, desktop only) */
.ep-rail {
  position: fixed; right: 14px; top: 50%; z-index: 50;
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px;
  background: var(--menu-bg);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  transform: translate(20px, -50%);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.ep-rail.show { opacity: 1; pointer-events: auto; transform: translate(0, -50%); }
.ep-rail a {
  position: relative;
  padding: 5px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px; font-weight: 600;
  color: var(--text);
  text-align: center;
}
.ep-rail a:hover { color: var(--fg); background: rgba(255,255,255,.08); }
.ep-rail a.active { background: var(--accent); color: var(--bg); }
.ep-rail a::after {           /* full episode title slides out on hover */
  content: attr(data-title);
  position: absolute; right: calc(100% + 14px); top: 50%;
  transform: translate(6px, -50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--menu-bg);
  color: var(--fg);
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.ep-rail a:hover::after { opacity: 1; transform: translate(0, -50%); }

/* Back-to-top arrow */
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { filter: brightness(1.1); }
.to-top svg { width: 22px; height: 22px; fill: currentColor; }

/* Video reel */
.reel {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--panel);
  margin-bottom: 40px;
}
.reel iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Game project cards */
.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 32px;
  align-items: center;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.project h3 { font-family: var(--display); font-size: 30px; margin: 0; }
.project .meta { color: var(--accent); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
.project p { color: var(--text); }
.pill-links { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-links a {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px; font-size: 14px; text-decoration: none;
}
.pill-links a:hover { border-color: var(--accent); color: var(--accent); }
.pill-links a.cta-pill { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 700; }
.pill-links a.cta-pill:hover { filter: brightness(1.08); color: var(--bg); }
.cv-links { margin-top: 24px; }
.hello { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.hello h2 { margin: 0; }
.portrait {
  width: 120px; height: 120px;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  flex: none;
}
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { margin: 0; min-height: 1.6em; font-weight: 600; }
.form-status.ok { color: #9be38f; }
.form-status.error { color: #ff8a7a; }
button.cta:disabled { opacity: .6; cursor: wait; }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shots img { aspect-ratio: 9 / 16; object-fit: cover; cursor: zoom-in; border-radius: var(--radius); }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 48px;
}
.contact-grid .big-link {
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 34px);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  overflow-wrap: anywhere;
}
form { display: grid; gap: 14px; }
label { font-size: 14px; color: var(--muted); }
input, textarea {
  width: 100%;
  margin-top: 4px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  font: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
button.cta {
  justify-self: start;
  padding: 12px 28px;
  background: var(--accent);
  color: var(--bg);
  border: 0; border-radius: 4px;
  font-weight: 700; font-size: 15px;
  cursor: pointer;
}

/* ---------- Footer ---------- */
footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 40px var(--gutter);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 14px;
}
footer strong { display: block; }
footer .socials { justify-content: center; margin-top: 8px; }
footer a { color: var(--muted); }

/* Touch screens have no hover, so captions are always shown */
@media (hover: none) {
  .gallery figcaption { opacity: 1; }
}
@media (hover: none) and (max-width: 760px) {
  .gallery figure { overflow: visible; }
  .gallery figure img { border-radius: var(--radius); }
  .gallery figcaption {
    position: static;
    background: none;
    padding: 6px 2px 4px;
    color: var(--muted);
    font-size: 13px;
  }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  background: rgba(20, 14, 10, .95);
  padding: 24px 12px;
}
.lightbox.open { display: grid; }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.lb-figure img {
  max-width: 100%;
  max-height: calc(100vh - 110px);
  width: auto;
  border-radius: var(--radius);
}
.lb-figure figcaption {
  display: flex; gap: 14px; justify-content: center; align-items: baseline;
  margin-top: 12px;
  color: var(--text);
  text-align: center;
}
.lb-count { color: var(--muted); font-size: 14px; }
.lightbox button {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--fg);
  font-size: 30px; line-height: 1;
  cursor: pointer;
  transition: background .2s;
}
.lightbox button:hover { background: var(--accent); color: var(--bg); }
.lb-prev { grid-column: 1; justify-self: center; }
.lb-next { grid-column: 3; justify-self: center; }
.lb-figure { grid-column: 2; grid-row: 1; }
.lb-close { position: absolute; top: 14px; right: 14px; font-size: 20px !important; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { visibility: hidden; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  /* Phone menu: a full-width panel under the header */
  .menu-toggle { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -8px; line-height: 1; }
  .nav {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0; z-index: 60;
    display: none;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 6px 18px 16px;
    background: rgb(52, 37, 28);   /* solid, so the page doesn't show through */
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(0,0,0,.45);
  }
  .nav.open { display: flex; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav > ul > li { border-bottom: 1px solid var(--line); }
  .nav > ul > li > a { display: block; padding: 14px 2px; font-size: 18px; border: 0; }
  .nav a[aria-current] { color: var(--accent); }
  .has-sub > a::after { content: none; }
  .submenu { position: static; display: flex !important; padding: 0 0 10px 16px !important; border-top: 0; white-space: normal; }
  .submenu::before { content: none; }
  .submenu a { padding: 9px 2px; font-size: 16px; color: var(--text); }
  .nav .socials { justify-content: center; gap: 28px; padding-top: 16px; }
  .nav .socials a, .nav .socials svg { width: 24px; height: 24px; }
  .project, .project-intro, .project-intro:has(.trailer-card) { grid-template-columns: 1fr; }
  .trailer-card { grid-column: auto; }
  .gallery.rows .row { flex-direction: column; }
  .ep-rail { display: none; }   /* phones use the jump links at the top and the arrow */
  /* viewer on phones: image full width, arrows sit along the bottom (swipe also works) */
  .lightbox { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; padding: 60px 8px 20px; }
  .lb-figure { grid-column: 1 / 3; grid-row: 1; }
  .lb-figure img { max-height: calc(100vh - 200px); }
  .lb-prev { grid-column: 1; grid-row: 2; justify-self: end; margin-right: 12px; }
  .lb-next { grid-column: 2; grid-row: 2; justify-self: start; margin-left: 12px; }
  .gallery.assets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gallery.assets figure { padding: 10px 10px 8px; }
  .posters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .poster-title { font-size: 18px; }
  .poster-name { font-size: 20px; padding: 40px 10px 10px; }
  .gallery.rows figure { flex: none; }
  .gallery.rows .feature { display: flex; flex-direction: column; aspect-ratio: auto; }
  .feature img { height: auto; aspect-ratio: var(--r); }
  .project-poster { max-width: 220px; }
  footer { grid-template-columns: 1fr; }
}
