/* Paul Böttcher — built from Figma "BOET-WEB" (frames at 1512×982).
   Bars sit 16px from the viewport edges; inside them, columns follow the
   Figma calc() offsets (6-col / 12-col grid of the 1480px bar). */

:root {
  --edge: 16px;
  --bar: 20px;
  --panel-open: 200px;
  --ink: #000;
  --ink-muted: rgba(0, 0, 0, 0.35);
  --paper: #fff;
  /* Figma Smart Animate: 300ms, Ease out */
  --ease: cubic-bezier(0, 0, 0.58, 1);
  --dur: 300ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  position: relative;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 10px;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Stage: hero + prev/next click zones ---------- */

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* Figma centres a 3:2 box (1512×1008) on the 1512×982 frame. Covering the viewport
   with object-fit gives the same crop, and also fits heroes exported at frame size. */
.hero {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
}

.hero > img,
.hero > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Portrait video (app.js tripleVideo): three copies side by side, edge to edge */
.hero > .hero__triple {
  position: absolute;
  inset: 0;
  display: flex;
}

.hero__triple > video {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Intro (app.js playIntro): same place as the hero, above it, white while loading */
.hero--intro {
  z-index: 1;
  background: var(--paper);
}

.zone {
  position: absolute;
  top: calc(var(--edge) + var(--bar));
  bottom: calc(var(--edge) + var(--bar));
  width: 50%;
  cursor: pointer;
}

.zone--prev { left: 0; }
.zone--next { right: 0; }

/* Zoom zone and arrows exist only in the mobile layout */
.zone--zoom,
.arrow {
  display: none;
}

.zone--zoom {
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
}

/* PREVIOUS / NEXT label that replaces the mouse cursor over the zones.
   Difference blending keeps it legible on both dark and light images. */
.cursor-label {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  color: #fff;
  mix-blend-mode: difference;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  opacity: 0;
}

.cursor-label.is-visible {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .zone { cursor: none; }
}

/* ---------- Expandable panel (shared by header and footer) ---------- */

.panel {
  position: fixed;
  left: var(--edge);
  right: var(--edge);
  height: var(--bar);
  background: var(--paper);
  overflow: hidden;
  z-index: 10;
  transition: height var(--dur) var(--ease);
}

.panel--top { top: var(--edge); }
.panel--bottom { bottom: var(--edge); }

/* Inner content keeps its final (expanded) layout; the panel clips it.
   Top panel grows down, bottom panel grows up. */
.panel__inner {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--panel-open);
}

.panel--top .panel__inner { top: 0; }
.panel--bottom .panel__inner { bottom: 0; }

.row {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--bar);
}

.panel--top .row { top: 0; }
.panel--bottom .row { bottom: 0; }

.row > span,
.row > a {
  position: absolute;
  top: 4px;
  white-space: nowrap;
}

/* Layers that only exist in the expanded variant fade in (Smart Animate) */
.details {
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.panel.is-open .details {
  opacity: 1;
}

/* ---------- Header ---------- */

.swap--p { left: 6px; }
.swap--b { left: 39px; }

.swap__short,
.swap__long {
  transition: opacity var(--dur) var(--ease);
}

.swap__long {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
}

.panel.is-open .swap__short { opacity: 0; }
.panel.is-open .swap__long { opacity: 1; }

.nav-info { left: calc(50% + 3px); }
/* SPACE / IMAGE sit on the last column; in narrow desktop windows they slide left
   so IMAGE keeps a 16px gap to the overview icon */
.panel--top .row { --nav-x: min(calc(83.333% + 0.67px), calc(100% - 126px)); }
.nav-space { left: var(--nav-x); }
.nav-slash { left: calc(var(--nav-x) + 41px); }
.nav-image { left: calc(var(--nav-x) + 53px); }

/* Inactive category is a grey link, active category is plain black text */
a[data-section-link][href] {
  color: var(--ink-muted);
  cursor: pointer;
}

@media (hover: hover) {
  a[data-section-link][href]:hover {
    color: var(--ink);
  }
}

/* Overview toggle: grey on project pages, black while the overview is open */
.row > .nav-overview {
  top: 0;
  right: 0;
  width: 31px;
  height: var(--bar);
  color: var(--ink-muted);
  cursor: pointer;
}

.nav-overview.is-active {
  color: var(--ink);
}

@media (hover: hover) {
  .nav-overview:hover {
    color: var(--ink);
  }
}

.grid-icon {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 19px;
  height: 8px;
  /* 4 × 3 blocks of 4×2px, 1px apart */
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 4px 2px,
    linear-gradient(currentColor, currentColor) 5px 0 / 4px 2px,
    linear-gradient(currentColor, currentColor) 10px 0 / 4px 2px,
    linear-gradient(currentColor, currentColor) 15px 0 / 4px 2px,
    linear-gradient(currentColor, currentColor) 0 3px / 4px 2px,
    linear-gradient(currentColor, currentColor) 5px 3px / 4px 2px,
    linear-gradient(currentColor, currentColor) 10px 3px / 4px 2px,
    linear-gradient(currentColor, currentColor) 15px 3px / 4px 2px,
    linear-gradient(currentColor, currentColor) 0 6px / 4px 2px,
    linear-gradient(currentColor, currentColor) 5px 6px / 4px 2px,
    linear-gradient(currentColor, currentColor) 10px 6px / 4px 2px,
    linear-gradient(currentColor, currentColor) 15px 6px / 4px 2px;
  background-repeat: no-repeat;
}

.header-hit {
  left: 0 !important;
  top: 0 !important;
  width: calc(83.333% - 6.33px);
  height: var(--bar);
}

/* Bio, contact and references share one top line (y 134 in the 200px panel, as in
   Figma). When one of them no longer fits beside the others, app.js adds
   .is-stacked and they sit underneath each other instead. */
.info > * {
  position: absolute;
  top: var(--info-top, 134px);
}

.info__bio {
  left: 6px;
  width: min(485px, calc(50% - 9px));
}

.info__contact {
  left: calc(50% + 3px);
  width: min(240px, calc(16.667% - 6px));
}

.info__refs {
  left: calc(66.667% + 2.33px);
  width: min(485px, calc(33.333% - 8.33px));
}

.info > .info__rights {
  top: 71px;
  left: calc(50% + 3px);
}

/* ---------- Legal: imprint + privacy policy ----------
   "Legal. All rights reserved, 2026." opens it: the header grows only as far as the
   text needs (app.js sets --legal-h), at most down to the bottom bar. The INFO
   blocks give way to three text blocks of four grid columns each, on their top
   line. Like the footer text, each runs 3.5 columns wide (to the middle of its
   last column): imprint in 1–4, the privacy policy flowing evenly through 5–8 and
   9–12, so both of its columns end on the same bottom line. */

.info__rights {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

@media (hover: hover) {
  .info__rights:hover {
    color: var(--ink-muted);
  }
}

.info > * {
  transition: opacity var(--dur) var(--ease), visibility var(--dur);
}

.panel--top.is-legal {
  z-index: 11;
}

.panel--top.is-legal .panel__inner {
  height: min(var(--legal-h, 100vh), calc(100vh - 2 * var(--edge)));
  height: min(var(--legal-h, 100dvh), calc(100dvh - 2 * var(--edge)));
}

.panel--top.is-legal .info > :not(.info__rights) {
  opacity: 0;
  visibility: hidden;
}

.legal {
  position: absolute;
  top: var(--info-top, 134px);
  left: 0;
  right: 0;
  bottom: 0;
  /* One grid column: (bar − 2 × 6px margins − 11 × 6px gutters) / 12 */
  --u: ((100% - 66px) / 12);
  display: grid;
  /* 3.5 columns of text | the rest of column 4 | 2 × 3.5 columns of text */
  grid-template-columns: calc(3.5 * var(--u) + 18px) calc(0.5 * var(--u) + 6px) calc(7.5 * var(--u) + 42px);
  align-items: start;
  padding: 0 6px 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur);
}

.legal::-webkit-scrollbar { display: none; }

.panel--top.is-legal .legal {
  opacity: 1;
  visibility: visible;
}

.legal__imprint {
  grid-column: 1;
}

/* Privacy policy: two columns (5–8, 9–12) of equal height. Paragraphs may run on
   into the next column, so both fill down to the same line. The empty line between
   paragraphs is a margin, which the browser drops at the top of a column. */
.legal__privacy {
  grid-column: 3;
  column-count: 2;
  column-gap: calc(0.5 * var(--u) + 6px);
}

.legal__block > * + * {
  margin-top: 1lh;
}

/* Narrower windows: imprint in columns 1–6, privacy policy in 7–12 (5.5 wide) */
@media (max-width: 1099px) {
  .legal {
    grid-template-columns: calc(5.5 * var(--u) + 30px) calc(0.5 * var(--u) + 6px) calc(5.5 * var(--u) + 30px);
  }

  .legal__privacy {
    column-count: 1;
  }
}

@media (hover: hover) {
  .legal a:hover {
    color: var(--ink-muted);
  }
}

/* Narrow desktop windows (INFO stacked): one column under the legal line */
.panel--top.is-stacked.is-legal .panel__inner {
  height: auto;
  max-height: calc(100dvh - 2 * var(--edge));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.panel--top.is-stacked.is-legal .info > :not(.info__rights) {
  display: none;
}

.panel--top.is-stacked .legal {
  position: static;
  display: none;
  grid-template-columns: 1fr;
  row-gap: 2lh;
  padding-top: 1lh;
  overflow: visible;
}

.panel--top.is-stacked .legal__block {
  grid-column: auto;
}

.panel--top.is-stacked .legal__privacy {
  column-count: 1;
}

.panel--top.is-stacked.is-legal .legal {
  display: grid;
}

.panel--top.is-stacked .panel__inner {
  height: auto;
  display: flex;
  flex-direction: column;
}

.panel--top.is-stacked .row {
  position: relative;
  flex: none;
}

.panel--top.is-stacked .info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 6px 8px;
}

.panel--top.is-stacked .info > * {
  position: static;
  width: auto;
  max-width: 485px;
}

@media (hover: hover) {
  .info__contact a:hover {
    color: var(--ink-muted);
  }
}

/* ---------- Footer ---------- */

.meta-1 { left: 6px; }
.meta-2 { left: calc(33.333% + 3.67px); }
.meta-3 { left: calc(66.667% + 2.33px); }
.meta-4 { left: calc(83.333% + 0.67px); }

/* Text column: as tall as the thumbnails (6–145px), so the tags line sits on
   their bottom edge (Figma frame "Video, Photographer, Tags") */
.project__info {
  position: absolute;
  top: 6px;
  left: 6px;
  /* three and a half of the 12 grid columns (ends mid column 4): 424px at design size */
  width: calc(3.5 * (100% - 78px) / 12 + 18px);
  min-height: var(--thumb-h, 139px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* One empty line between the text and the links; the links stack directly */
.project__link {
  margin-top: 1lh;
}

.project__link + .project__link {
  margin-top: 0;
}

@media (hover: hover) {
  .project__link:hover {
    color: var(--ink-muted);
  }
}

.project__tags {
  margin-top: auto;
  padding-top: 1lh;
}

.project__credit {
  position: absolute;
  top: calc(6px + var(--thumb-h, 139px) + 6px);
  white-space: nowrap;
  text-align: right;
}

.project__text a {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-position: from-font;
  text-decoration-skip-ink: none;
}

@media (hover: hover) {
  .project__text a:hover {
    color: var(--ink-muted);
  }
}

.project__thumbs {
  list-style: none;
}

.project__thumbs li {
  position: absolute;
  top: 6px;
  height: var(--thumb-h, 139px);
  overflow: hidden;
}

.project__thumbs img,
.project__thumbs video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Overview (frames "MacBook Pro 14 - 29 / 30") ----------
   White page; thumbnails sit on the 6-column grid, 22px from the frame edges,
   139px tall with 6px gaps; images fill each row from the left.
   --overview-top (y 241 in Figma) is a hard limit: nothing is ever shown above it.
   With enough height the block is bottom-aligned and grows upwards, showing at most
   --overview-rows rows; further rows scroll inside that window. When the visible
   rows no longer fit between the limit and the bottom margin, app.js adds .is-top:
   the grid then starts at the limit, runs down to the window edge and scrolls. */

.overview {
  --overview-top: 241px;
  --overview-rows: 5;
  --overview-cols: 6;
  /* Narrower windows drop columns instead of squeezing the tiles: every tile stays
     at least this wide, so it is always landscape (139px tall) */
  --overview-min: 200px;
  /* Wide screens: rows grow with the columns, so tiles keep the Figma proportion
     (240 × 139) instead of stretching into thin strips */
  --overview-row: max(139px, (100cqw - 5 * 6px) / 6 * 139 / 240);
  container-type: inline-size;
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: var(--overview-top) 22px 22px;
  background: var(--paper);
}

.overview.is-top {
  padding-bottom: 0;
}

.overview.is-top .overview__grid {
  flex: 1 1 auto;
  max-height: none;
  margin-top: 0;
  align-content: start;
  padding-bottom: 22px;
}

.overview[hidden],
.overview__grid[hidden] {
  display: none;
}

.overview__grid {
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(var(--overview-rows) * var(--overview-row) + (var(--overview-rows) - 1) * 6px);
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(var(--overview-min), (100% - (var(--overview-cols) - 1) * 6px) / var(--overview-cols)), 1fr));
  grid-auto-rows: var(--overview-row);
  justify-content: start;
  gap: 6px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.overview__grid::-webkit-scrollbar { display: none; }

.overview__grid a {
  display: block;
  height: 100%;
  cursor: pointer;
}

.overview__grid img,
.overview__grid video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.is-overview .stage,
body.is-overview .panel--bottom,
body.is-overview .cursor-label {
  visibility: hidden;
}

/* ---------- Mobile (frames "iPhone 17 - 1…4", 402×874) ----------
   Bars 14px from the sides and 16px from top and bottom, 22px tall, 13px text
   3px below the bar edge. Inside the bars a 6-column grid with 6px margins and
   gutters; one column is (100% - 42px) / 6 of the bar, (100vw - 70px) / 6 of the
   screen. app.js (layoutMobile) sets --x on labels that cannot follow the grid and
   the image geometry (--img-*, --box-* for the arrows, --footer-closed/-open). */

@media (max-width: 899px) and (hover: none) and (pointer: coarse) {
  :root {
    --bar: 22px;
    --side: 14px;
    --mcol: calc((100vw - 70px) / 6);
  }

  body {
    background: var(--paper);
    font-size: 13px;
  }

  .panel {
    left: var(--side);
    right: var(--side);
  }

  .row > span,
  .row > a {
    top: 3px;
  }

  /* Capital letters optically centred in the 22px bar, whatever line metrics the
     browser uses for Helvetica Neue: each label is trimmed to cap height and
     baseline, then placed half the remaining space from the top. */
  @supports (text-box: trim-both cap alphabetic) {
    .row > span,
    .row > a,
    .swap__long {
      line-height: 16px;
      text-box: trim-both cap alphabetic;
    }

    .row > span,
    .row > a:not(.nav-overview) {
      top: calc((var(--bar) - 1cap) / 2);
    }

    /* Second line ("with …") one 16px line below the first */
    .panel--bottom .row > .meta-2 {
      padding: calc((var(--bar) - 1cap) / 2 + 16px) 6px calc((var(--bar) - 1cap) / 2);
    }
  }

  .header-hit {
    display: none;
  }

  /* Header: P / B (PAUL / BÖTTCHER), INFO, SPACE / IMAGE, overview icon */
  .swap--b,
  .nav-info,
  .nav-space,
  .nav-slash,
  .nav-image {
    left: var(--x, 0);
    right: auto;
  }

  .row > .nav-overview {
    width: 32px;
  }

  /* 4 × 3 blocks of 4×2.5px, 6px from the top and right edge of the bar */
  .grid-icon {
    left: auto;
    right: 6px;
    height: 10px;
    background-size: 4px 2.5px;
    background-position:
      0 0, 5px 0, 10px 0, 15px 0,
      0 3.75px, 5px 3.75px, 10px 3.75px, 15px 3.75px,
      0 7.5px, 5px 7.5px, 10px 7.5px, 15px 7.5px;
  }

  /* Expanded header (variant HEADER2): one text column 76px below the bar top,
     one empty line between the blocks, 6px bottom margin */
  .panel--top .panel__inner {
    height: auto;
    max-height: calc(100dvh - 2 * var(--edge));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .panel--top .row {
    position: relative;
  }

  .panel--top .info {
    padding: calc(76px - var(--bar)) 6px 6px;
  }

  .panel--top .info > * {
    position: static;
    width: auto;
  }

  .panel--top .info > * + * {
    margin-top: 1lh;
  }

  .info__contact > p:nth-child(2),
  .info__refs > p:nth-child(2) {
    display: none;
  }

  /* The line break before "So basically …" is for desktop only */
  .bio-break {
    display: none;
  }

  /* Legal: the header fills the screen; imprint and privacy policy follow the
     legal line in one column */
  .panel--top.is-legal .panel__inner {
    height: auto;
  }

  .legal__block {
    grid-column: auto;
  }

  .legal__privacy {
    column-count: 1;
  }

  .panel--top.is-legal .info > :not(.info__rights) {
    display: none;
  }

  .panel--top.is-legal .info > .info__rights {
    margin-top: 0;
  }

  .legal {
    position: static;
    display: none;
    grid-template-columns: 1fr;
    row-gap: 2lh;
    padding: 1lh 6px 6px;
    overflow: visible;
  }

  .panel--top.is-legal .legal {
    display: grid;
  }

  /* Footer bar: title, city, year on line one, "with …" on line two */
  .panel--bottom {
    height: var(--footer-closed, var(--bar));
  }

  .panel--bottom .panel__inner {
    height: var(--footer-open, 50vh);
    display: flex;
    flex-direction: column;
  }

  .panel--bottom .row {
    position: relative;
    flex: none;
    height: auto;
    min-height: var(--bar);
  }

  .row > .meta-2 {
    position: static;
    display: block;
    padding: 19px 6px 3px;
    white-space: normal;
  }

  .row > .meta-2:empty {
    display: none;
  }

  .meta-3 {
    left: var(--x, 0);
  }

  .meta-4 {
    left: calc(6px + 5 * ((100% - 42px) / 6 + 6px));
  }

  /* Expanded project info (frame "iPhone 17 - 3"): text from the top edge,
     credit 6px above the thumbnails, thumbnails 6px above the title line */
  .project {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 6px 0 3px;
  }

  .project__info {
    position: static;
    flex: 1 1 auto;
    min-height: 0;
    width: auto;
    padding: 0 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .project__credit {
    position: static;
    flex: none;
    margin-top: 6px;
    padding: 0 6px;
    white-space: normal;
  }

  .project__thumbs {
    flex: none;
    display: flex;
    gap: 6px;
    margin-top: 6px;
    padding: 0 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .project__thumbs::-webkit-scrollbar { display: none; }

  .project__thumbs li {
    position: relative;
    top: auto;
    left: auto !important;
    flex: none;
    width: auto !important;
    height: 139px;
    aspect-ratio: var(--ratio, 240 / 139);
  }

  /* Image inside the margins; zoomed it covers the screen */
  .hero {
    inset: auto;
    left: var(--img-x, 20px);
    top: var(--img-y, 50%);
    width: var(--img-w, calc(100vw - 40px));
    height: var(--img-h, 0px);
    overflow: hidden;
    transition:
      left var(--dur) var(--ease),
      top var(--dur) var(--ease),
      width var(--dur) var(--ease),
      height var(--dur) var(--ease);
  }

  /* Click zones: columns 1–2 previous, 3–4 zoom, 5–6 next (split in the gutters) */
  .zone {
    top: calc(var(--edge) + var(--bar));
    bottom: calc(var(--edge) + var(--footer-closed, var(--bar)));
  }

  .zone--prev {
    width: calc(29px + 2 * var(--mcol));
  }

  .zone--zoom {
    display: block;
    left: calc(29px + 2 * var(--mcol));
    width: calc(12px + 2 * var(--mcol));
    cursor: zoom-in;
  }

  body.is-zoomed .zone--zoom {
    cursor: zoom-out;
  }

  .zone--next {
    left: calc(41px + 4 * var(--mcol));
    width: auto;
  }

  /* Arrows: 26 × 7.5px triangles at 35% black, 6px from the image edges. The
     middle pair points outwards and turns 180° when zoomed, so they face each other. */
  .arrow {
    display: block;
    position: absolute;
    width: 26px;
    height: 7.5px;
    background: var(--ink-muted);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    transform: translate(-50%, -50%) rotate(var(--turn));
    pointer-events: none;
    transition:
      left var(--dur) var(--ease),
      top var(--dur) var(--ease),
      transform var(--dur) var(--ease),
      opacity var(--dur) var(--ease);
  }

  .arrow--up,
  .arrow--down {
    left: calc(var(--box-x) + var(--box-w) / 2);
  }

  .arrow--up {
    --turn: 0deg;
    top: calc(var(--box-y) - 9.75px);
  }

  .arrow--down {
    --turn: 180deg;
    top: calc(var(--box-y) + var(--box-h) + 9.75px);
  }

  body.is-zoomed .arrow--up { --turn: 180deg; }
  body.is-zoomed .arrow--down { --turn: 360deg; }

  .arrow--prev,
  .arrow--next {
    top: calc(var(--box-y) + var(--box-h) / 2);
  }

  .arrow--prev {
    --turn: -90deg;
    left: calc(var(--box-x) - 9.75px);
  }

  .arrow--next {
    --turn: 90deg;
    left: calc(var(--box-x) + var(--box-w) + 9.75px);
  }

  body.is-info-open .arrow--prev,
  body.is-info-open .arrow--next,
  body.is-header-open .arrow {
    opacity: 0;
  }

  body.is-instant .hero,
  body.is-instant .arrow,
  body.is-instant .panel {
    transition: none;
  }

  /* Overview: three images per row, each two columns of the 6-column grid,
     20px from the screen edges (bar margin + 6px). As on desktop the block is
     bottom-aligned while it fits; with more rows than fit (no row limit here) app.js
     adds .is-top and the grid starts 100px under the header, where images also
     disappear when scrolling. */
  .overview {
    --overview-top: calc(var(--edge) + var(--bar) + 100px);
    --overview-cols: 3;
    --overview-min: 0px;
    --overview-row: calc((2 * var(--mcol) + 6px) * 139 / 240);
    padding-left: calc(var(--side) + 6px);
    padding-right: calc(var(--side) + 6px);
  }

  .overview__grid {
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
}

/* ---------- Smart Animate project ⇄ overview (app.js morphIn / morphOut) ----------
   A stand-in image moves between the main image and its overview tile, above the
   overview (z 5) and below the bars (z 10). */

.morph {
  position: fixed;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
}

.morph > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.overview.is-leaving {
  pointer-events: none;
}

/* Footer thumbnails swap places with the main image when clicked */
.project__thumb {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.project__thumb:disabled {
  cursor: default;
}

/* ---------- Overview sort menu (Figma component "Frame 12") ----------
   Directly above the overview's top limit, 16px from the left, 20px tall. app.js
   (layoutSort) sets --sx / --sy on the options and --sort-w / --sort-h on the menu.
   "type" opens its kinds upwards; the row of options never moves. */

.sort {
  position: absolute;
  left: 16px;
  /* Text 22px from the edge where the tiles disappear, as it is 22px from the left
     edge (the text sits 4–16px inside the 20px box, as in Figma) */
  top: calc(var(--overview-top) - 22px - 16px);
  z-index: 1;
  width: var(--sort-w, 83px);
  height: 20px;
  background: var(--paper);
  color: var(--ink);
  line-height: 20px;
  white-space: nowrap;
  transition:
    width var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
}

/* Dissolves while the expanded header covers the overview */
body.is-header-open .sort {
  opacity: 0;
  pointer-events: none;
}

.sort__label {
  position: absolute;
  left: 6px;
  top: 0;
  cursor: default;
}

.sort__item {
  position: absolute;
  left: var(--sx, 0);
  top: var(--sy, 0);
  height: 20px;
  opacity: 0;
  pointer-events: none;
  transition:
    left var(--dur) var(--ease),
    top var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
}

.sort__item[hidden] {
  display: none;
}

.sort.is-open .sort__item,
.sort__item.is-current {
  opacity: 1;
  pointer-events: auto;
}

.sort__opt {
  display: block;
  height: 20px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--ink-muted);
  font: inherit;
  line-height: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.sort__item.is-current > .sort__opt,
.sort__opt.is-picked {
  color: var(--ink);
}

/* "type (stage design)": the picked kinds follow the word while the menu is closed */
.sort__picked {
  position: absolute;
  left: calc(100% - 3px);
  top: 0;
  transition: opacity var(--dur) var(--ease);
}

.sort.is-open .sort__picked {
  opacity: 0;
  pointer-events: none;
}

/* Spreads upwards from the row, the lowest kind first */
.sort__kinds {
  position: absolute;
  left: 0;
  bottom: calc(100% - 3px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 0;
  overflow: hidden;
  background: var(--paper);
  opacity: 0;
  pointer-events: none;
  transition:
    height var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
}

.sort.is-kinds .sort__kinds {
  height: 126px;
  opacity: 1;
  pointer-events: auto;
}

.sort__kinds .sort__opt {
  flex: none;
  height: 18px;
  line-height: 18px;
  text-align: left;
}

.sort.is-instant,
.sort.is-instant * {
  transition: none;
}

/* Mobile: a white dropdown across the bar width, one option per line */
@media (max-width: 899px) and (hover: none) and (pointer: coarse) {
  .sort {
    left: var(--side);
    right: var(--side);
    /* Text 20px above the tiles' edge, as it is 20px from the side (13px text sits
       3–19px inside the 22px box) */
    top: calc(var(--overview-top) - 20px - 19px);
    width: auto;
    height: var(--sort-h, 22px);
    overflow: hidden;
    line-height: 22px;
    transition:
      height var(--dur) var(--ease),
      opacity var(--dur) var(--ease);
  }

  .sort__item,
  .sort__opt {
    height: 22px;
  }

  .sort__picked {
    left: calc(100% - 3px);
  }

  .sort__kinds {
    left: 12px;
    top: 22px;
    bottom: auto;
    justify-content: flex-start;
  }

  .sort.is-kinds .sort__kinds {
    height: 140px;
  }

  .sort__kinds .sort__opt {
    height: 20px;
    line-height: 20px;
  }
}
