/* Ivan — public site
   Layout: a thin instrument-panel nav (bordered cells, mono labels) over a
   stack of full-screen illustration panels; the shop, about and footer sit
   on a quiet night/day ground beneath them. */

:root {
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --bar-h: 48px;
  --eyebrow-h: 40px;
  --gutter: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* night (default) */
  --bg: #121211;
  --surface: #1C1B19;
  --line: #34312C;
  --line-strong: #4A463F;
  --text: #EDE6DA;
  --muted: #A39E93;
  --faint: #6F6A61;
  --accent: #C9A35B;
  --on-accent: #121211;
  --glass: rgba(18, 18, 17, .88);
  --invert-bg: #EDE6DA;
  --invert-fg: #121211;
  --shadow: 0 30px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

:root[data-mode="day"] {
  --bg: #F5F4F1;
  --surface: #FFFFFF;
  --line: #D9D5CD;
  --line-strong: #B9B3A8;
  --text: #141414;
  --muted: #5C5952;
  --faint: #8E8980;
  --accent: #8A6526;
  --on-accent: #FFFFFF;
  --glass: rgba(245, 244, 241, .9);
  --invert-bg: #141414;
  --invert-fg: #F5F4F1;
  --shadow: 0 30px 60px rgba(20, 20, 20, .18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  transition: background-color .5s ease, color .5s ease;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------- type roles -- */
.hud {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.display { font-family: var(--font-display); letter-spacing: -.03em; line-height: .9; }

/* --------------------------------------------------------------- nav bar -- */
.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  min-height: var(--bar-h);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background-color .5s ease, border-color .5s ease;
}
.bar__left, .bar__right { display: flex; align-items: stretch; min-width: 0; }
.bar__logo {
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-right: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
}
.bar__logo em { font-style: italic; color: var(--accent); }
.bar__nav { display: none; align-items: stretch; }
.bar__nav > li { display: flex; align-items: stretch; position: relative; }
.bar__nav ul, .menu ul { list-style: none; margin: 0; padding: 0; }
.bar__item {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: color .15s;
}
.bar__item:hover, .bar__item[aria-expanded="true"] { color: var(--text); }
.bar__item span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  transition: background-color .12s linear, color .12s linear;
}
.bar__item:hover span, .bar__item[aria-expanded="true"] span { background: var(--invert-bg); color: var(--invert-fg); }
.bar__item svg { width: 12px; height: 12px; transition: transform .25s var(--ease); }
.bar__item[aria-expanded="true"] svg { transform: rotate(180deg); }

.bar__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--bar-h);
  border-left: 1px solid var(--line);
  background: none;
  border-top: 0; border-bottom: 0; border-right: 0;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .12s linear, color .12s linear;
}
.bar__cell:hover { background: var(--invert-bg); color: var(--invert-fg); }
.bar__cell svg { width: 18px; height: 18px; }
.bar__cta {
  display: none;
  align-items: center;
  padding: 0 18px;
  border-left: 1px solid var(--line);
  background: var(--invert-bg);
  color: var(--invert-fg);
  text-decoration: none;
  transition: opacity .15s;
}
.bar__cta:hover { opacity: .8; }
#menuBtn { display: flex; }

/* dropdown (Work) */
.dd {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 320px;
  max-width: calc(100vw - 32px);
  margin-top: -1px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-top-color: transparent;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .25s var(--ease);
}
.bar__nav > li[data-open="true"] .dd { opacity: 1; transform: none; pointer-events: auto; }
.dd a {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background-color .12s linear, color .12s linear;
}
.dd a:last-child { border-bottom: 0; }
.dd a:hover { background: var(--invert-bg); color: var(--invert-fg); }
.dd__thumb { display: block; width: 56px; height: 42px; object-fit: cover; background: var(--surface); }
.lb__stage video { background: #000; }
.dd__name { font-family: var(--font-display); font-size: 22px; line-height: 1; }
.dd__count { color: var(--muted); }
.dd a:hover .dd__count { color: inherit; opacity: .7; }

/* mobile menu */
.menu {
  position: fixed;
  inset: var(--bar-h) 0 0 0;
  z-index: 45;
  background: var(--bg);
  overflow: auto;
  padding: 8px var(--gutter) 40px;
  display: none;
}
.menu[data-open="true"] { display: block; }
.menu a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: clamp(32px, 9vw, 44px);
  line-height: 1;
}
.menu a small { font-family: var(--font-mono); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.menu__group { margin-top: 32px; }
.menu__group .hud { display: block; color: var(--faint); margin-bottom: 4px; }
.menu__group a { font-size: 26px; padding: 14px 0; }

@media (min-width: 900px) {
  .bar__nav { display: flex; }
  .bar__cta { display: flex; }
  #menuBtn { display: none; }
}

/* ------------------------------------------------------- eyebrow sub-bar -- */
.eyebrow {
  position: sticky;
  top: var(--bar-h);
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  height: var(--eyebrow-h);
  padding: 0 var(--gutter);
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  transition: background-color .5s ease;
}
.eyebrow .num { color: var(--faint); }
.eyebrow .sep { margin: 0 8px; color: var(--faint); }
.eyebrow__right { display: none; }
@media (min-width: 640px) { .eyebrow__right { display: block; } }

/* ----------------------------------------------------------------- panels -- */
.panel {
  position: relative;
  display: grid;
  min-height: calc(100svh - var(--bar-h));
  overflow: hidden;
  isolation: isolate;
  color: var(--panel-ink, #EDE6DA);
  background: var(--panel-bg, #0F2230);
}
/* Panel image. Framing (--tx/--ty in % of the panel, --z zoom, --r image
   ratio) is set per collection in the Studio; the same rules are mirrored in
   studio.css so the editor preview is exact. The slow breathe + cursor
   parallax live on the wrapper so they never fight the framing. */
.panel__art {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  container-type: size;
}
.panel__frame {
  position: absolute;
  inset: 0;
  translate: var(--px, 0px) var(--py, 0px);
  transition: translate .9s var(--ease);
  animation: panel-breathe 22s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes panel-breathe { from { scale: 1.03; } to { scale: 1.1; } }
.panel__frame > img, .panel__frame > video {
  position: absolute;
  left: 50%; top: 50%;
  width: max(100cqw, calc(100cqh * var(--r, 1.5)));
  height: auto;
  max-width: none;
  aspect-ratio: var(--r, 1.5);
  object-fit: cover;
  transform: translate(calc(-50% + var(--tx, 0) * 1cqw), calc(-50% + var(--ty, 0) * 1cqh)) scale(var(--z, 1));
}
@supports not (width: 1cqw) {
  .panel__frame > img, .panel__frame > video { left: 0; top: 0; width: 100%; height: 100%; aspect-ratio: auto; transform: translate(calc(var(--tx, 0) * 1%), calc(var(--ty, 0) * 1%)) scale(var(--z, 1)); }
}
.panel__frame > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.panel__scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--panel-bg) 55%, transparent), transparent 45%);
  opacity: .7;
  pointer-events: none;
}
.panel__text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: min(100%, 700px);
  padding: calc(var(--eyebrow-h) + 32px) var(--gutter) clamp(40px, 8vh, 96px);
  align-self: end;
  justify-self: start;
}
.panel__text .hud { opacity: .85; }
.panel__title {
  font-size: clamp(56px, 13vw, 176px);
}
.panel__title.is-long { font-size: clamp(44px, 9vw, 128px); }
@media (min-width: 900px) {
  .panel[data-corner="tr"] .panel__text { align-self: start; justify-self: end; text-align: right; align-items: flex-end; }
  .panel[data-corner="cl"] .panel__text { align-self: center; }
  .panel[data-corner="br"] .panel__text { justify-self: end; text-align: right; align-items: flex-end; }
  .panel[data-corner="tl"] .panel__text { align-self: start; }
  .panel[data-corner="cr"] .panel__text { align-self: center; justify-self: end; text-align: right; align-items: flex-end; }
}

/* Explore link: underline draws, arrow pushes forward */
.explore {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding-bottom: 2px;
  text-decoration: none;
  width: max-content;
}
.explore svg { width: 22px; height: 22px; transition: transform .5s var(--ease); }
.explore::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 8px;
  height: 1px;
  width: 100%;
  background: currentColor;
  transform: scaleX(.25);
  transform-origin: left;
  transition: transform .5s var(--ease);
}
.explore:hover svg, .explore:focus-visible svg { transform: translateX(12px); }
.explore:hover::after, .explore:focus-visible::after { transform: scaleX(1); }

/* reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(36px); transition: opacity .9s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal:nth-child(2) { transition-delay: .08s; }
.js .reveal:nth-child(3) { transition-delay: .16s; }

/* ----------------------------------------------------------------- sections -- */
.section {
  padding-block: clamp(64px, 9vw, 128px);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--line);
}
.section__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px 40px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section__head .hud { color: var(--accent); display: block; margin-bottom: 14px; }
.section__title { font-size: clamp(44px, 7vw, 104px); }

/* prints */
.prints {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 40px 28px;
}
.print {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}
.print__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ratio, 4 / 5);
  max-width: 100%;
  background: var(--surface);
}
.print__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.print:hover .print__media img { transform: scale(1.06); }
.print__row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.print__row + .print__row { margin-top: -8px; font-size: 13px; color: var(--muted); }
.print__price { font-variant-numeric: tabular-nums; }
.print__sold { position: absolute; top: 12px; left: 12px; padding: 5px 9px; background: var(--invert-bg); color: var(--invert-fg); }
.print__action { display: flex; margin-top: 4px; }
.print__action .btn { height: 46px; padding: 0 18px; }
.print__buy:disabled { opacity: .6; cursor: progress; }

/* about + newsletter */
.about { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 48px; }
.about__bio { font-family: var(--font-display); font-size: clamp(26px, 3vw, 40px); line-height: 1.2; max-width: 22ch; }
.about__col { display: flex; flex-direction: column; gap: 16px; }
.about__col .hud { color: var(--accent); }
.about__col p.muted { color: var(--muted); max-width: 48ch; }
.nl { display: flex; flex-wrap: wrap; gap: 8px; }
.nl input {
  flex: 1 1 200px;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  border-radius: 0;
  min-width: 0;
}
.nl input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 22px;
  border: 0;
  background: var(--invert-bg);
  color: var(--invert-fg);
  cursor: pointer;
  text-decoration: none;
  transition: opacity .2s, transform .15s;
}
.btn:hover { opacity: .85; }
.btn:active { transform: scale(.98); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn--ghost:hover { opacity: 1; background: var(--invert-bg); color: var(--invert-fg); border-color: transparent; }
.nl__ok { color: var(--accent); }

/* footer */
.footer {
  padding-block: clamp(64px, 9vw, 112px) 40px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.footer .hud { color: var(--accent); display: block; margin-bottom: 14px; }
.footer__mail {
  font-size: clamp(30px, 7vw, 112px);
  text-decoration: none;
  overflow-wrap: anywhere;
  display: inline-block;
}
.footer__mail:hover { color: var(--accent); }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; color: var(--muted); font-size: 13px; }
.footer__row nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.footer__row a { padding: 12px 0; text-decoration: none; display: inline-block; }
.footer__row a:hover { color: var(--text); }

/* -------------------------------------------------------- collection page -- */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding-block: clamp(48px, 8vw, 112px) 48px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--line);
}
.hero__main { flex: 1 1 520px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hero__main .hud { color: var(--accent); }
.hero__title { font-size: clamp(60px, 12vw, 168px); overflow-wrap: anywhere; }
.hero__aside { flex: 0 1 420px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hero__aside p { font-size: 18px; line-height: 1.6; color: var(--muted); }
.hero__aside dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; font-size: 13px; }
.hero__aside dt { color: var(--muted); margin-bottom: 4px; }
.hero__aside dd { margin: 0; }

.wall {
  padding-block: 48px 96px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  columns: 3 280px;
  column-gap: 28px;
}
.work {
  break-inside: avoid;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: zoom-in;
  transition: transform .6s var(--ease);
}
.work:hover { transform: translateY(-6px); }
.work__media { overflow: hidden; aspect-ratio: var(--ratio, 4 / 5); background: var(--surface); box-shadow: 0 12px 28px rgba(0,0,0,.25); max-width: 100%; }
.work__media img, .work__media video { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.work:hover .work__media img { transform: scale(1.05); }
.work__cap { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.work__cap span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- collection layouts (templates). Each collection picks one. ---- */
.js-open { cursor: zoom-in; }

/* grid: uniform tiles edge to edge, title on hover */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; padding: 2px 0 96px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.grid__item { position: relative; aspect-ratio: 4 / 5; overflow: hidden; margin: 0; padding: 0; border: 0; background: var(--surface); color: #fff; text-align: left; }
.grid__item img, .grid__item video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ease); }
.grid__item:hover img, .grid__item:focus-visible img { transform: scale(1.05); }
.grid__cap { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; gap: 12px; padding: 40px 16px 14px; font-size: 13px; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); opacity: 0; transition: opacity .3s; }
.grid__item:hover .grid__cap, .grid__item:focus-visible .grid__cap { opacity: 1; }
@media (hover: none) { .grid__cap { opacity: 1; padding-top: 28px; } }

/* magazine: image beside text, alternating sides */
.mag {
  display: flex; flex-direction: column; gap: clamp(72px, 9vw, 144px);
  padding-block: clamp(48px, 6vw, 96px) clamp(80px, 10vw, 144px);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.mag__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px 64px; align-items: center; }
.mag__media {
  display: block; margin: 0; padding: 0; border: 0; background: var(--surface);
  width: min(100%, calc(min(86svh, 920px) * var(--ratio, .8)));
  aspect-ratio: var(--ratio, .8); max-width: 100%;
  justify-self: center; overflow: hidden; box-shadow: var(--shadow);
}
.mag__media img, .mag__media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mag__cap { display: flex; flex-direction: column; gap: 14px; max-width: 44ch; }
.mag__cap h2 { font-size: clamp(34px, 4.5vw, 64px); }
.mag__num { color: var(--faint); }
.mag__meta { color: var(--accent); }
.mag__text { color: var(--muted); font-size: clamp(16px, 1.25vw, 18px); line-height: 1.6; }
.mag__text p { margin: 0 0 1em; } .mag__text p:last-child { margin: 0; }
@media (min-width: 860px) {
  .mag__row { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .mag__row:nth-child(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .mag__row:nth-child(even) .mag__media { order: 2; }
  .mag__row:nth-child(even) .mag__cap { justify-self: end; text-align: right; align-items: flex-end; }
}

/* reel: one work at a time, horizontal snap */
.reel__wrap { position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.reel__wrap:focus-visible { outline-offset: -3px; }
.reel { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; height: calc(100svh - var(--bar-h) - var(--eyebrow-h)); }
.reel::-webkit-scrollbar { display: none; }
.reel__item { flex: 0 0 100%; scroll-snap-align: start; position: relative; margin: 0; display: grid; background: var(--box, var(--bg)); padding: 24px var(--gutter) 112px; }
.reel__media { display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; background: none; }
.reel__media img, .reel__media video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: var(--shadow); }
.reel__cap { position: absolute; left: max(var(--gutter), env(safe-area-inset-left, 0px)); right: 180px; bottom: 32px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; color: var(--panel-ink, var(--text)); }
.reel__cap .display { font-size: clamp(28px, 3.5vw, 48px); }
.reel__cap .hud { opacity: .75; }
.reel__bar { position: absolute; right: max(var(--gutter), env(safe-area-inset-right, 0px)); bottom: 28px; display: flex; align-items: center; gap: 14px; }
.reel__count { color: var(--muted); font-variant-numeric: tabular-nums; }
.reel__nav { display: flex; gap: 6px; }
.reel__hint { padding: 12px var(--gutter); color: var(--faint); }

/* focal point: cropped renderings keep the chosen spot in view */
img, video { object-position: var(--fx, 50%) var(--fy, 50%); }

/* frame sequences (canvas player) take the space of an image wherever they appear */
canvas.seq { display: block; width: 100%; height: 100%; background: transparent; }
.panel__frame > canvas.seq { position: absolute; left: 50%; top: 50%; width: max(100cqw, calc(100cqh * var(--r, 1.5))); height: auto; aspect-ratio: var(--r, 1.5); max-width: none; transform: translate(calc(-50% + var(--tx, 0) * 1cqw), calc(-50% + var(--ty, 0) * 1cqh)) scale(var(--z, 1)); }
.reel__media canvas.seq, .lb__stage canvas.seq { width: min(92vw, 1200px); height: min(72vh, calc(92vw / var(--ratio, 1.25))); max-width: 100%; max-height: 100%; }
.lb__stage canvas.seq { box-shadow: var(--shadow); }

/* frames template: a pinned stage per sequence, scrubbed by scroll */
.scrub__section .scrolly__stage { background: var(--box, var(--bg)); }
.scrub__media { display: block; width: 100%; height: 100%; margin: 0; padding: 32px var(--gutter) 110px; border: 0; background: none; box-sizing: border-box; }
.scrub__media canvas.seq { width: 100%; height: 100%; }

/* ---- scroll-driven templates: the scrollbar is the timeline ---- */
.scrolly { position: relative; }
.scrolly__stage { position: sticky; top: var(--bar-h); height: calc(100svh - var(--bar-h)); overflow: hidden; }
.scrolly__hint { position: absolute; top: calc(var(--eyebrow-h) + 16px); right: max(var(--gutter), env(safe-area-inset-right, 0px)); margin: 0; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; transition: opacity .4s; }
.scrolly__hint svg { width: 14px; height: 14px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { translate: 0 0; } 50% { translate: 0 5px; } }
.scrolly__cap { position: absolute; left: max(var(--gutter), env(safe-area-inset-left, 0px)); right: calc(var(--gutter) + 88px); bottom: 28px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; pointer-events: none; }
.scrolly__cap .display { font-size: clamp(28px, 3.5vw, 48px); }
.scrolly__cap .hud { color: var(--muted); }
.scrolly__count { position: absolute; right: max(var(--gutter), env(safe-area-inset-right, 0px)); bottom: 34px; margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }

/* stack: works fly in and settle into a fanned pile */
.stack__item { position: absolute; left: 50%; top: 50%; width: min(72vw, calc(min(56svh, 620px) * var(--ratio, .8))); aspect-ratio: var(--ratio, .8); margin: 0; padding: 0; border: 0; background: var(--surface); box-shadow: 0 30px 60px rgba(0, 0, 0, .45); transform: translate(-50%, -50%); will-change: transform; opacity: 0; }
.stack__item img, .stack__item video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* drive: vertical scroll moves a horizontal row */
.drive__track { position: absolute; top: 0; bottom: 0; left: 0; display: flex; align-items: center; gap: 6vw; padding: 0 max(var(--gutter), env(safe-area-inset-left, 0px)); will-change: transform; }
.drive__item { flex: none; display: flex; flex-direction: column; gap: 14px; width: min(74vw, calc(min(60svh, 700px) * var(--ratio, .8))); }
.drive__media { display: block; width: 100%; aspect-ratio: var(--ratio, .8); margin: 0; padding: 0; border: 0; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.drive__media img, .drive__media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.drive__cap { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.drive__cap .display { font-size: clamp(22px, 2.4vw, 34px); }
.drive__cap .hud { color: var(--muted); }
.drive.is-static .scrolly__stage { position: static; height: auto; }
.drive.is-static .drive__track { position: static; overflow-x: auto; padding-block: 24px; }

/* zoom: fly through a cloud of works */
.zoom__item { position: absolute; left: 50%; top: 50%; width: min(44vw, calc(min(38svh, 440px) * var(--ratio, .8))); aspect-ratio: var(--ratio, .8); margin: 0; padding: 0; border: 0; background: var(--surface); box-shadow: 0 30px 60px rgba(0, 0, 0, .45); transform: translate(-50%, -50%); will-change: transform, opacity; opacity: 0; }
.zoom__item img, .zoom__item video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* parallax: works move at different speeds while the page scrolls */
.plx { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); row-gap: clamp(32px, 6vw, 96px); padding-block: clamp(48px, 6vw, 96px) clamp(96px, 12vw, 180px); padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.plx__item { grid-column: var(--col) / span var(--span); margin-top: var(--mt, 0); display: flex; flex-direction: column; gap: 12px; will-change: transform; min-width: 0; }
.plx__media { display: block; width: 100%; aspect-ratio: var(--ratio, .8); margin: 0; padding: 0; border: 0; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.plx__media img, .plx__media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.plx__cap { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.plx__cap span:last-child { color: var(--muted); }
@media (max-width: 700px) { .plx__item { grid-column: 1 / -1 !important; margin-top: 0 !important; } .plx__item:nth-child(even) { grid-column: 3 / -1 !important; } .plx__item:nth-child(odd) { grid-column: 1 / 11 !important; } }

/* showcase layout: one full-width box per work, loops autoplay, caption below */
.show { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.show__item { display: flex; flex-direction: column; }
.show__media {
  display: block; position: relative; overflow: hidden;
  width: 100%; margin: 0; padding: 0; border: 0;
  height: min(92svh, calc(100vw / var(--ratio, 1.25)));
  background: var(--box, var(--surface));
  cursor: zoom-in;
}
.show__media img, .show__media video { width: 100%; height: 100%; object-fit: contain; display: block; }
.show__media.is-cover { height: calc(100svh - var(--bar-h)); }
.show__media.is-cover img, .show__media.is-cover video { object-fit: cover; }
.show__cap {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
  padding-block: clamp(40px, 6vw, 80px) clamp(56px, 8vw, 112px);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.show__cap h2 { font-size: clamp(36px, 5vw, 72px); }
.show__meta { color: var(--accent); }
.show__text { max-width: 58ch; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.6; color: var(--muted); }
.show__text p { margin: 0 0 1em; }
.show__text p:last-child { margin: 0; }
.show__cap .explore { margin-top: 8px; }

/* about this project */
.story {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 64px;
  padding-block: clamp(56px, 8vw, 112px);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--line);
}
@media (min-width: 860px) { .story { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.story__side { display: flex; flex-direction: column; gap: 28px; }
.story__side .hud { color: var(--accent); }
.story__side dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 18px; font-size: 14px; }
.story__side dt { color: var(--muted); margin-bottom: 4px; font-size: 13px; }
.story__side dd { margin: 0; }
.story__text { min-width: 0; max-width: 64ch; }
.story__text p { margin: 0 0 1.1em; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.6; }
.story__text p:first-child { font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px); line-height: 1.2; letter-spacing: -.01em; margin-bottom: .8em; }
.story__text p:last-child { margin-bottom: 0; }

.next {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 48px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.next .hud { color: var(--muted); }
.next__name { display: inline-flex; align-items: center; gap: 20px; font-size: clamp(36px, 6vw, 88px); }
.next__name svg { width: 44px; height: 44px; transition: transform .5s var(--ease); flex: none; }
.next:hover .next__name svg { transform: translateX(14px); }

/* lightbox */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  touch-action: pan-y;
}
.lb[data-open="true"] { display: flex; }
.lb__close { position: absolute; top: 16px; right: 16px; }
.lb__stage {
  display: grid;
  place-items: center;
  width: 100%;
  max-height: 72vh;
  flex: 1 1 auto;
  min-height: 0;
}
.lb__stage img, .lb__stage video { max-width: min(92vw, 1200px); max-height: 72vh; width: auto; height: auto; box-shadow: var(--shadow); animation: lb-in .5s var(--ease); }
@keyframes lb-in { from { opacity: 0; transform: scale(.94) translateY(12px); } to { opacity: 1; transform: none; } }
.lb__bar { display: flex; align-items: center; gap: 16px; }
.lb__bar p { min-width: 200px; text-align: center; font-size: 14px; line-height: 1.6; }
.lb__bar p span { color: var(--muted); }
.sq {
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color .12s linear, color .12s linear;
}
.sq:hover { background: var(--invert-bg); color: var(--invert-fg); }
.sq svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- sections -- */
/* Pages are lists of sections (renderSections in site.js). Content sections
   take an optional background / text colour of their own. */
.sec { position: relative; background: var(--sec-bg, transparent); color: var(--sec-ink, inherit); }
.sec--text, .sec--quote, .sec--cta {
  padding-block: clamp(56px, 8vw, 112px);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.sec--text .sec__inner { max-width: 68ch; display: grid; gap: 20px; }
.sec--text .sec__inner[data-align="center"] { margin-inline: auto; text-align: center; }
.sec--text .hud { color: var(--accent); }
.sec--text h2 { margin: 0; font-size: clamp(36px, 5vw, 72px); }
.sec__text p { margin: 0 0 1.1em; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.6; }
.sec__text p:last-child { margin-bottom: 0; }
.sec--quote blockquote { margin: 0 auto; max-width: 28ch; text-align: center; display: grid; gap: 22px; }
.sec--quote p { margin: 0; font-size: clamp(30px, 5vw, 72px); line-height: 1.12; letter-spacing: -.01em; }
.sec--quote footer { color: var(--muted); }
.feature__media { display: block; width: 100%; border: 0; padding: 0; margin: 0; position: relative; overflow: hidden; background: var(--box, #141414); cursor: zoom-in; }
.sec--feature[data-height="screen"] .feature__media { height: calc(100svh - var(--bar-h)); }
.feature__media img, .feature__media video, .feature__media canvas.seq { display: block; width: 100%; height: 100%; object-fit: cover; }
.sec--feature[data-height="auto"] .feature__media img, .sec--feature[data-height="auto"] .feature__media video { height: auto; }
.sec--feature[data-height="auto"] .feature__media canvas.seq { height: auto; aspect-ratio: var(--ratio, 16 / 9); }
.feature__media.is-contain img, .feature__media.is-contain video, .feature__media.is-contain canvas.seq { object-fit: contain; }
.sec--feature[data-height="auto"] .feature__media.is-contain img { height: auto; max-height: calc(100svh - var(--bar-h)); }
.feature__cap { margin: 0; padding: 14px max(var(--gutter), env(safe-area-inset-left, 0px)); color: var(--muted); }
.sec--twoup {
  padding-block: clamp(32px, 5vw, 72px);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.twoup { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(16px, 3vw, 40px); align-items: start; }
.twoup__item { margin: 0; display: grid; gap: 10px; }
.twoup__media { display: block; width: 100%; border: 0; padding: 0; background: var(--surface); cursor: zoom-in; aspect-ratio: var(--ratio, 4 / 5); overflow: hidden; }
.twoup__media img, .twoup__media video, .twoup__media canvas.seq { display: block; width: 100%; height: 100%; object-fit: cover; }
.twoup figcaption { color: var(--muted); }
.cta { display: grid; justify-items: center; text-align: center; gap: 22px; }
.cta .hud { color: var(--accent); }
.cta h2 { margin: 0; font-size: clamp(36px, 6vw, 88px); max-width: 18ch; }

/* design preview inside the Studio (html.editing) */
.editing { scroll-behavior: auto; }
/* section handles, empty notes and the drop zones between sections */
.sec__handle, .sec__empty, .sec-drop { display: none; }
.editing .sec__handle { display: inline-flex; align-items: center; gap: 8px; position: absolute; left: 12px; top: 10px; z-index: 6; padding: 5px 9px; background: rgba(0, 0, 0, .72); color: #fff; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; cursor: grab; opacity: .55; transition: opacity .15s; user-select: none; }
.editing .sec:hover > .sec__handle, .editing .sec.is-selected > .sec__handle { opacity: 1; }
.editing .sec__handle b { font-weight: 400; opacity: .7; letter-spacing: 0; }
.editing .sec__handle:active { cursor: grabbing; }
.editing .sec.is-selected { outline: 3px solid var(--accent) !important; outline-offset: -3px; }
.editing .sec__empty { display: block; margin: 0; padding: 48px max(var(--gutter), env(safe-area-inset-left, 0px)); text-align: center; color: var(--muted); border: 1px dashed var(--line); }
.editing .sec-drop { display: flex; justify-content: center; align-items: center; position: relative; z-index: 7; height: 0; padding-block: 10px; margin-block: -10px; transition: height .15s, background-color .15s; }
.editing .sec-drop::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid var(--accent); opacity: 0; transition: opacity .15s; }
.editing .sec-drop__add { position: absolute; top: 50%; translate: 0 -50%; padding: 6px 12px; border: 1px solid var(--accent); background: var(--bg); color: var(--accent); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; cursor: pointer; opacity: 0; transition: opacity .15s; }
.editing .sec-drop:hover::before, .editing .sec-drop:hover .sec-drop__add { opacity: 1; }
.arranging .sec-drop { height: 64px; padding: 0; margin-block: 0; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.arranging .sec-drop::before { display: none; }
.arranging .sec-drop .sec-drop__add { opacity: 1; pointer-events: none; }
.arranging .sec-drop.is-over { height: 96px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.arranging .sec-drop.is-over .sec-drop__add::after { content: " · drop"; }
.editing .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
.editing [data-sel] { outline: 2px dashed transparent; outline-offset: -3px; transition: outline-color .15s; cursor: pointer; }
.editing [data-sel]:hover { outline-color: color-mix(in srgb, var(--accent) 75%, transparent); }
.editing [data-sel].is-selected { outline: 3px solid var(--accent); outline-offset: -3px; }
.editing .panel::after { content: "Click to edit this panel"; position: absolute; top: calc(var(--eyebrow-h) + 12px); left: 50%; translate: -50% 0; z-index: 3; padding: 6px 10px; background: rgba(0,0,0,.55); color: #fff; font-family: var(--font-mono); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; opacity: 0; transition: opacity .2s; pointer-events: none; }
.editing .panel:hover::after { opacity: 1; }
.editing .bar__cta, .editing .menu, .editing .lb { display: none !important; }
.editing .zoom__item, .editing .stack__item { cursor: grab; touch-action: none; }
.editing .zoom__item:active, .editing .stack__item:active { cursor: grabbing; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
