/* ==========================================================
   Elevated Studio — black & white frame, colour photographs.
   ========================================================== */

:root {
  --bg: #0a0a0a;
  --fg: #f3f3f1;
  --muted: #8b8b88;
  --line: rgba(255, 255, 255, 0.14);
  --card: #151515;
  --invert-logo: 0;

  --display: "Inter Tight", "Inter", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --sans: "Inter Tight", "Inter", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: var(--sans); /* small labels: same family, spaced capitals */

  --gutter: clamp(22px, 5.5vw, 104px);
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* The favourite-shots page flips to a light gallery wall. */
body[data-page="shots"] {
  --bg: #ececea;
  --fg: #0d0d0d;
  --muted: #6d6d6a;
  --line: rgba(0, 0, 0, 0.12);
  --card: #dcdcda;
  --invert-logo: 1;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.7s var(--ease), color 0.7s var(--ease);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
::selection { background: var(--fg); color: var(--bg); }

.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; }
.muted { color: var(--muted); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  transition: background-color 0.4s, backdrop-filter 0.4s, color 0.7s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; filter: invert(var(--invert-logo)); transition: filter 0.7s; }
.brand-name { font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; font-size: 17px; }
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  position: relative; padding: 6px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-links .nav-cta { border: 1px solid var(--fg); padding: 8px 16px; border-radius: 999px; transition: background 0.3s, color 0.3s; }
.nav-links .nav-cta::after { display: none; }
.nav-links .nav-cta:hover { background: var(--fg); color: var(--bg); }
.nav-toggle { display: none; width: 40px; height: 40px; position: relative; }
.nav-toggle span { position: absolute; left: 8px; right: 8px; height: 1.5px; background: currentColor; transition: transform 0.4s var(--ease), top 0.4s var(--ease); }
.nav-toggle span:first-child { top: 15px; }
.nav-toggle span:last-child { top: 24px; }
.nav.open .nav-toggle span:first-child { top: 19px; transform: rotate(45deg); }
.nav.open .nav-toggle span:last-child { top: 19px; transform: rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; z-index: 2; }
  .nav-links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 28px;
    background: var(--bg); opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease);
  }
  .nav-links a { font-family: var(--display); font-weight: 400; letter-spacing: -0.03em; font-size: 38px; text-transform: none; }
  .nav.open .nav-links { opacity: 1; pointer-events: auto; }
  .nav-links .nav-cta { border: 0; padding: 6px 0; }
}

/* ---------- Page transitions ---------- */
.app { min-height: 100vh; }
.page { animation: pageIn 0.8s var(--ease) both; }
.app.leaving .page { opacity: 0; transform: translateY(-8px); transition: opacity 0.25s, transform 0.25s; }
@keyframes pageIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Hero (home) ---------- */
.hero {
  position: relative; height: 100svh; min-height: 560px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--gutter) calc(var(--gutter) + 8px);
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0; overflow: hidden;
  opacity: 0; transform: scale(1.08); transition: opacity 1.6s ease, transform 7s linear;
}
.hero-slide.on { opacity: 1; transform: scale(1); }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.85) 100%);
}
.hero > :not(.hero-slides) { position: relative; z-index: 1; }
.hero-kicker { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; color: #f3f3f1; }
.hero-title {
  font-family: var(--display); font-weight: 400; letter-spacing: -0.035em;
  font-size: clamp(52px, 11vw, 200px); line-height: 0.84; letter-spacing: -0.01em;
  margin: 0; color: #f3f3f1;
}
.hero-title .outline { color: rgba(243, 243, 241, 0.5); }
.hero-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 22px; color: #f3f3f1; }
.hero-bottom p { margin: 0; max-width: 420px; font-size: 15px; color: rgba(243,243,241,0.78); }
@media (max-width: 600px) {
  .hero-kicker span:last-child { display: none; }
  .hero-bottom p { font-size: 14px; }
}
.hero-dots { display: flex; gap: 0; margin-right: -6px; }
.hero-dots button { padding: 14px 6px; background: none; border: 0; cursor: pointer; }
.hero-dots button:hover i { background: rgba(255,255,255,0.65); }
.hero-dots button:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }
.hero-dots i { width: 28px; height: 2px; background: rgba(255,255,255,0.3); display: block; overflow: hidden; position: relative; transition: background 0.2s; }
.hero-dots i.on::after { content: ""; position: absolute; inset: 0; background: #fff; animation: dot var(--dot, 5s) linear forwards; transform-origin: left; }
.hero-slide video, .hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
@keyframes dot { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Section heads ---------- */
.section { padding: clamp(72px, 10vw, 140px) var(--gutter); }
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 36px;
}
.section-title {
  font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; margin: 0;
  font-size: clamp(34px, 4.6vw, 72px); line-height: 0.9;
}
.section-title sup { font-family: var(--mono); font-size: 14px; vertical-align: top; margin-left: 8px; color: var(--muted); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.chip:hover { border-color: var(--fg); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip em { font-style: normal; opacity: 0.55; margin-left: 4px; }

/* ---------- Work grid ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 2.4vw, 36px) clamp(16px, 2vw, 28px); }
.work-card { display: block; transition: opacity 0.5s var(--ease); }
.work-card.hidden { display: none; }
.work-card .frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: var(--card); }
.work-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.work-card .meta { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; }
.work-card .meta b { font-weight: 500; font-size: 15px; }
.work-card .idx { color: var(--muted); margin-right: 10px; font-family: var(--mono); font-size: 12px; }
/* Hovering a project only zooms its picture in; colours never change. */
@media (hover: hover) {
  .work-grid .work-card:hover img { transform: scale(1.035); }
}
.work-card.wide { grid-column: 1 / -1; }
.work-card.wide .frame { aspect-ratio: 21 / 9; }
@media (max-width: 760px) {
  .work-grid { grid-template-columns: 1fr; }
  .work-card.wide .frame { aspect-ratio: 16 / 9; }
}

/* ---------- Marquee (shots teaser) ---------- */
.teaser { padding: 0 0 clamp(72px, 10vw, 140px); }
.teaser .section-head { margin: 0 var(--gutter) 36px; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 70s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee img { height: clamp(180px, 22vw, 300px); width: auto; transition: transform 0.6s var(--ease); }
.marquee a:hover img { transform: translateY(-6px); }
@keyframes marquee { to { transform: translateX(-50%); } }
.link-arrow { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; display: inline-flex; gap: 10px; align-items: center; }
.link-arrow span { transition: transform 0.4s var(--ease); }
.link-arrow:hover span { transform: translateX(6px); }

/* ---------- Contact CTA / footer ---------- */
.cta { padding: clamp(80px, 12vw, 180px) var(--gutter) 40px; border-top: 1px solid var(--line); }
.cta-title {
  font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; margin: 0 0 32px;
  font-size: clamp(48px, 9vw, 160px); line-height: 0.86;
}
.cta-title a { display: inline-block; transition: color 0.4s; }
.cta-title .outline { color: var(--muted); transition: color 0.4s; }
.cta-title a:hover .outline { color: var(--fg); }
.footer { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 48px; color: var(--muted); }
.footer a:hover { color: var(--fg); }
.footer .socials { display: flex; gap: 24px; }

/* ---------- Project page ---------- */
.p-hero { position: relative; height: min(92svh, 56.25vw + 80px); min-height: 420px; overflow: hidden; }
.p-hero img { width: 100%; height: 100%; object-fit: cover; animation: heroZoom 2.4s var(--ease) both; }
.p-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 75%, var(--bg) 100%); }
@keyframes heroZoom { from { transform: scale(1.12); } to { transform: scale(1); } }
.p-head { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(28px, 5vw, 80px); padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(40px, 6vw, 80px); }
.p-title { font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; margin: 0; font-size: clamp(38px, 5.4vw, 88px); line-height: 0.98; }
.p-info dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 28px; margin: 0 0 28px; border-top: 1px solid var(--line); padding-top: 16px; }
.p-info dt { font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.06em; padding-top: 2px; }
.p-info dd { margin: 0; }
.p-info p { margin: 0; font-size: 17px; max-width: 52ch; white-space: pre-line; }
@media (max-width: 860px) { .p-head { grid-template-columns: 1fr; } }

.p-gallery { padding: 0 var(--gutter); display: flex; flex-direction: column; gap: clamp(14px, 1.6vw, 24px); }
/* Every row is capped so a photo never gets taller than the screen. */
.p-row { display: grid; gap: clamp(14px, 1.6vw, 24px); width: min(100%, calc(88vh * var(--r, 1.5))); margin-inline: auto; }
.p-row.two { grid-template-columns: 1fr 1fr; width: min(100%, calc(80vh * var(--r, 1.5) + 24px)); }
.p-row.single-narrow { width: min(100%, calc(84vh * var(--r, 0.75)), 760px); }
.p-row.inset { width: min(100% - 2 * clamp(0px, 8vw, 140px), calc(88vh * var(--r, 1.5))); }
.p-img { overflow: hidden; background: var(--card); cursor: zoom-in; }
.p-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity 0.8s; opacity: 0; }
.p-img img.loaded { opacity: 1; }
.p-img:hover img { transform: scale(1.02); }
/* rows arranged by hand in admin mode */
.p-row.sp-large { margin-top: clamp(40px, 7vw, 120px); }
.p-row.sp-none { margin-top: calc(-1 * clamp(14px, 1.6vw, 24px)); }
.p-row.s-full { width: 100%; }
.p-row.s-medium { width: 80%; }
.p-row.s-small { width: 60%; }
.p-row.s-tiny { width: 40%; }
.p-row.s-bleed { width: auto; margin-inline: calc(-1 * var(--gutter)); }
.p-row.s-fit.with-text { width: 100%; }
.p-row.a-left:not(.s-bleed) { margin-left: 0; }
.p-row.a-right:not(.s-bleed) { margin-right: 0; }
.p-row.with-text { gap: clamp(24px, 4.5vw, 80px); align-items: center; justify-content: center; }
.p-row.s-bleed.with-text { padding-inline: var(--gutter); }
/* text between (or next to) the photos */
.p-row.text-only { padding-block: clamp(34px, 5.5vw, 88px); }
.p-row.text-only.s-fit { width: 60%; }
.p-text { min-width: 0; }
.p-text h2 { font-family: var(--display); font-weight: 400; letter-spacing: -0.03em; line-height: 1.04; font-size: clamp(28px, 3.4vw, 54px); margin: 0; text-wrap: balance; white-space: pre-line; }
.p-text p { margin: 0; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.6; color: color-mix(in srgb, var(--fg) 82%, transparent); max-width: 62ch; white-space: pre-line; text-wrap: pretty; }
.p-text h2 + p { margin-top: clamp(10px, 1.2vw, 18px); }
.p-text.t-small p { font-size: 15px; color: var(--muted); }
.p-text.t-small h2 { font-size: clamp(22px, 2.2vw, 34px); }
.p-text.t-large p { font-size: clamp(21px, 2.3vw, 36px); line-height: 1.32; letter-spacing: -0.015em; color: var(--fg); max-width: 40ch; }
.p-text.t-large h2 { font-size: clamp(38px, 5.4vw, 88px); line-height: 0.98; }
.text-only .p-text { text-align: center; }
.text-only .p-text p { margin-inline: auto; }
.p-text.ta-left, .text-only .p-text.ta-left { text-align: left; }
.p-text.ta-left p, .text-only .p-text.ta-left p { margin-inline: 0 auto; }
.p-text.ta-center { text-align: center; }
.p-text.ta-center p { margin-inline: auto; }
.p-text.ta-right, .text-only .p-text.ta-right { text-align: right; }
.p-text.ta-right p, .text-only .p-text.ta-right p { margin-inline: auto 0; }
.p-text.va-top { align-self: start; }
.p-text.va-bottom { align-self: end; }
@media (max-width: 600px) {
  .p-row.two, .p-row.set { grid-template-columns: minmax(0, 1fr) !important; }
  .p-row, .p-row.two, .p-row.single-narrow, .p-row.inset, .p-row.set:not(.s-bleed) { width: 100%; }
  .p-row.with-text { gap: 18px; padding-block: 10px; }
}

.next-project { display: block; margin-top: clamp(80px, 10vw, 140px); position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.next-project .np-label { display: flex; justify-content: space-between; padding: 22px var(--gutter); }
.next-project .np-title { font-family: var(--display); font-weight: 400; letter-spacing: -0.03em; font-size: clamp(38px, 7vw, 120px); line-height: 0.98; padding: 0 var(--gutter) 28px; position: relative; z-index: 1; transition: transform 0.8s var(--ease); }
.next-project .np-img { height: clamp(220px, 34vw, 520px); overflow: hidden; }
.next-project .np-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.next-project:hover .np-img img { transform: scale(1.04); }
.next-project:hover .np-title { transform: translateX(16px); }

/* ---------- Favourite shots: 3D ring ---------- */
.shots { height: 100svh; min-height: 640px; display: flex; flex-direction: column; padding-top: var(--nav-h); overflow: hidden; position: relative; }
.shots-head { text-align: center; padding: 8px var(--gutter) 0; position: relative; z-index: 3; }
.shots-head h1 { font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; margin: 0; font-size: clamp(24px, 2.6vw, 38px); line-height: 1; }
.shots-head p { margin: 6px 0 0; }
.stage {
  position: relative; flex: 1; perspective: 2400px; perspective-origin: 50% 32%;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
}
.stage.dragging { cursor: grabbing; }
.ring { position: absolute; left: 50%; top: 66%; width: 0; height: 0; transform-style: preserve-3d; }
.card3d { position: absolute; transform-style: preserve-3d; cursor: pointer; }
.card3d .face {
  position: absolute; inset: 0; background-size: cover; background-position: center; background-color: var(--card);
  border-radius: 4px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.card3d .face.back { transform: rotateY(180deg); }
.featured {
  position: absolute; left: 50%; top: 0; z-index: 2; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; pointer-events: none;
}
.featured-img {
  position: relative; border-radius: 6px; overflow: hidden; pointer-events: auto; cursor: zoom-in;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.45), 0 8px 20px -8px rgba(0,0,0,0.3);
  background: var(--card);
}
.featured-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.5s ease; }
.shots-foot {
  position: relative; z-index: 3; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 var(--gutter) 24px;
}
.shot-caption b { display: block; font-weight: 500; font-size: 15px; }
.shot-caption a { border-bottom: 1px solid var(--line); }
.shot-caption a:hover { border-color: var(--fg); }
.ring-controls { display: flex; gap: 8px; align-items: center; }
.round-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center;
  font-size: 16px; transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.round-btn:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.view-toggle { justify-self: end; display: flex; gap: 6px; }
.shots-count { font-family: var(--display); font-weight: 400; letter-spacing: -0.03em; font-size: 22px; min-width: 76px; text-align: center; }
@media (max-width: 700px) {
  .shots-foot { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 12px; }
  .view-toggle { justify-self: center; }
}

.shots-grid { columns: 4 260px; column-gap: 14px; padding: calc(var(--nav-h) + 24px) var(--gutter) 80px; }
.shots-grid a { display: block; margin-bottom: 14px; break-inside: avoid; overflow: hidden; border-radius: 4px; cursor: zoom-in; }
.shots-grid img { width: 100%; height: auto; transition: transform 0.8s var(--ease); }
.shots-grid a:hover img { transform: scale(1.03); }
.grid-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; column-span: all; margin-bottom: 24px; flex-wrap: wrap; }

/* ---------- About ---------- */
.about-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 5vw, 80px); padding: calc(var(--nav-h) + clamp(40px, 6vw, 90px)) var(--gutter) clamp(60px, 8vw, 120px); align-items: end; }
.about-hero h1 { font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; margin: 0 0 32px; font-size: clamp(48px, 8vw, 136px); line-height: 0.98; }
.about-hero h1 .outline { color: var(--muted); }
.about-lead { font-size: clamp(19px, 1.7vw, 24px); line-height: 1.45; max-width: 34ch; margin: 0 0 20px; }
.about-body { color: var(--muted); max-width: 56ch; margin: 0; white-space: pre-line; }
.portrait { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--card); }
.portrait img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.portrait:hover img { transform: scale(1.03); }
.portrait figcaption { position: absolute; left: 14px; bottom: 12px; color: #fff; mix-blend-mode: difference; }
@media (max-width: 860px) { .about-hero { grid-template-columns: 1fr; } }


.services { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.services li {
  display: grid; grid-template-columns: 80px 1fr 1.2fr; gap: 24px; align-items: baseline;
  border-bottom: 1px solid var(--line); padding: 28px 0; transition: padding 0.5s var(--ease);
}
.services li:hover { padding-left: 14px; }
.services li::before { counter-increment: s; content: "0" counter(s); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.services h3 { margin: 0; font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; font-size: clamp(24px, 2.6vw, 38px); line-height: 1; }
.services p { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .services li { grid-template-columns: 40px 1fr; } .services p { grid-column: 2; } }

.about-strip { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 14px; padding: 0 var(--gutter); }
.about-strip figure { position: relative; margin: 0; overflow: hidden; background: var(--card); }
.about-strip img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; display: block; transition: transform 1.1s var(--ease); }
.about-strip img:hover { transform: scale(1.03); }
@media (max-width: 700px) { .about-strip { grid-template-columns: repeat(min(2, var(--n, 2)), 1fr); } }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(8, 8, 8, 0.97); color: #f3f3f1;
  display: grid; grid-template-columns: 80px 1fr 80px; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lb-figure { margin: 0; height: 100vh; display: grid; place-items: center; padding: 64px 0; }
.lb-img { max-width: 100%; max-height: calc(100vh - 128px); object-fit: contain; transition: opacity 0.25s; }
.lb-img.swap { opacity: 0; }
.lb-arrow { height: 100%; font-size: 26px; opacity: 0.6; transition: opacity 0.2s; }
.lb-arrow:hover { opacity: 1; }
.lb-close { position: absolute; top: 18px; right: var(--gutter); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; z-index: 2; }
.lb-meta { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 20px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #9a9a97; }
@media (max-width: 600px) { .lightbox { grid-template-columns: 44px 1fr 44px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Language switch ---------- */
.lang { display: flex; align-items: center; gap: 2px; margin-left: 28px; position: relative; z-index: 2; }
.lang button {
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.1em; padding: 6px 7px; border-radius: 999px;
  color: var(--muted); transition: color 0.3s, background 0.3s;
}
.lang button:hover { color: var(--fg); }
.lang button.on { color: var(--bg); background: var(--fg); }
@media (max-width: 760px) { .lang { margin-left: auto; margin-right: 8px; } }

/* ---------- Favourite shot window ---------- */
body.sv-lock { overflow: hidden; }
/* The page stays visible behind: dimmed and slightly blurred. */
.shot-view {
  position: fixed; inset: 0; z-index: 90;
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 96px; align-items: center;
  background: rgba(10, 10, 10, 0.38);
  backdrop-filter: blur(10px) saturate(0.9); -webkit-backdrop-filter: blur(10px) saturate(0.9);
  opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.shot-view.open { opacity: 1; visibility: visible; }
.sv-window {
  --win-h: calc(100svh - 56px);
  position: relative; height: var(--win-h); width: 100%; max-width: 1240px; justify-self: center;
  background: #f5f5f3; color: #0d0d0d; border-radius: 10px;
  overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.55);
  transform: translateY(18px) scale(0.985); transition: transform 0.55s var(--ease);
  --line: rgba(0, 0, 0, 0.1); --muted: #6d6d6a; --card: #e2e2e0; --fg: #0d0d0d; --bg: #f5f5f3;
}
.shot-view.open .sv-window { transform: none; }
.sv-bar {
  position: sticky; top: 0; z-index: 2; height: 52px; padding: 0 22px;
  display: flex; justify-content: space-between; align-items: center;
  background: color-mix(in srgb, #f5f5f3 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.sv-close { transition: opacity 0.3s; }
.sv-close:hover { opacity: 0.55; }
/* The photo takes the whole first view of the window. */
.sv-figure { margin: 0; height: calc(var(--win-h) - 52px - 60px); display: flex; align-items: center; justify-content: center; padding: 0 22px 14px; }
.sv-figure img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 4px; background: var(--card);
  transition: opacity 0.18s ease;
}
.sv-figure img.swap { opacity: 0; }
.sv-hint { height: 60px; margin: 0 22px; display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--line); }
.sv-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-title b { font-weight: 500; }
.sv-down { display: inline-flex; gap: 8px; align-items: center; }
.sv-down i { font-style: normal; display: inline-block; animation: bob 1.8s var(--ease) infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.sv-nav {
  justify-self: center; width: 56px; height: 56px; border-radius: 50%; font-size: 18px;
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(0, 0, 0, 0.18);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.sv-nav:hover { background: #fff; color: #0d0d0d; border-color: #fff; }
.sv-nav-in { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); flex: none; }
.sv-info { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(28px, 5vw, 80px); padding: clamp(40px, 5vw, 72px) clamp(22px, 4vw, 56px) clamp(56px, 6vw, 88px); }
#svInfo:empty { display: none; }
.sv-info.single { grid-template-columns: minmax(0, 720px); }
.sv-text h2 { font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; font-size: clamp(30px, 3.4vw, 52px); line-height: 1.02; margin: 14px 0 22px; }
.sv-story { font-size: clamp(16px, 1.25vw, 19px); line-height: 1.6; max-width: 56ch; margin: 0 0 30px; }
.sv-meta { margin: 0; }
.sv-meta > p { margin: 0 0 10px; }
.sv-field { display: grid; grid-template-columns: 112px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sv-field:first-of-type { border-top: 1px solid var(--line); }
.sv-field dt { font-size: 11.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.sv-field dd { margin: 0; }
.sv-field a { border-bottom: 1px solid var(--line); }
.sv-field a:hover { border-color: var(--fg); }
@media (max-width: 860px) { .sv-info { grid-template-columns: 1fr; } }
/* Phones: window almost full screen, arrows move inside next to the title. */
@media (max-width: 700px) {
  .shot-view { grid-template-columns: 1fr; padding: 0 8px; }
  .sv-window { --win-h: calc(100svh - 24px); }
  .sv-nav { display: none; }
  .sv-nav-in { display: grid; place-items: center; }
  .sv-hint { margin: 0 14px; gap: 10px; }
  .sv-down { display: none; }
  .sv-title { text-align: center; }
  .sv-figure { padding: 0 14px 12px; }
  .sv-field { grid-template-columns: 96px 1fr; }
}

/* Lightbox with a single photo: no arrows */
.lightbox.single .lb-arrow { visibility: hidden; }

/* ---------- Software ---------- */
.sw-intro { padding: calc(var(--nav-h) + clamp(40px, 6vw, 90px)) var(--gutter) clamp(40px, 5vw, 70px); max-width: 1200px; }
.sw-intro h1 { font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; font-size: clamp(48px, 8vw, 136px); line-height: 0.98; margin: 0 0 28px; }
.sw-intro h1 sup { font-size: 14px; vertical-align: top; margin-left: 8px; color: var(--muted); letter-spacing: 0; }
.sw-list { display: grid; gap: clamp(20px, 2.4vw, 36px); }

.sw-card { display: grid; grid-template-columns: 1.35fr 1fr; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--card); transition: border-color 0.4s var(--ease); }
.sw-card:hover { border-color: color-mix(in srgb, var(--fg) 35%, transparent); }
.sw-card-media { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #000; }
.sw-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.sw-card:hover .sw-card-media img { transform: scale(1.03); }
.sw-play { position: absolute; left: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.92); }
.sw-play::after { content: ""; position: absolute; left: 22px; top: 18px; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #0a0a0a; }
.sw-card-body { padding: clamp(24px, 3vw, 44px); display: flex; flex-direction: column; gap: 14px; }
.sw-card-body h3 { margin: 0; font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; font-size: clamp(32px, 3.4vw, 52px); line-height: 1; }
.sw-card-body > p { margin: 0; }
.sw-card-body > p:not(.mono) { color: color-mix(in srgb, var(--fg) 78%, transparent); max-width: 46ch; }
.sw-card-body .link-arrow { margin-top: auto; padding-top: 12px; }
.sw-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sw-tags span { font-size: 12px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.sw-more { border: 1px dashed var(--line); border-radius: 6px; padding: 34px clamp(24px, 3vw, 44px); display: flex; flex-direction: column; gap: 6px; }
.sw-more b { font-weight: 500; font-size: 18px; }
@media (max-width: 860px) { .sw-card { grid-template-columns: 1fr; } }

.sw-head { padding: calc(var(--nav-h) + clamp(32px, 5vw, 72px)) var(--gutter) clamp(36px, 4vw, 56px); }
.sw-back { display: inline-block; margin-bottom: clamp(28px, 4vw, 48px); transition: color 0.3s; }
.sw-back:hover { color: var(--fg); }
.sw-head .p-title { margin: 10px 0 22px; font-size: clamp(44px, 9vw, 150px); }
.sw-tagline { font-size: clamp(20px, 2vw, 28px); line-height: 1.35; max-width: 34ch; margin: 0 0 clamp(32px, 4vw, 56px); letter-spacing: -0.01em; }
.sw-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.sw-meta > div { padding: 16px 20px 16px 0; border-bottom: 1px solid var(--line); }
.sw-meta > div.wide { grid-column: 1 / -1; }
.sw-meta dt { font-size: 11.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.sw-meta dd { margin: 0; }
@media (max-width: 860px) { .sw-meta { grid-template-columns: 1fr 1fr; } }

.sw-video { padding: 0 var(--gutter); }
.sw-video video { width: 100%; height: auto; display: block; border-radius: 6px; background: #000; aspect-ratio: 1920 / 1248; }
.sw-cap { font-size: 14px; color: var(--muted); max-width: 80ch; margin: 14px 0 0; line-height: 1.5; }

.sw-block { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(24px, 5vw, 90px); padding: clamp(64px, 9vw, 130px) var(--gutter) 0; }
.sw-block-full { display: block; }
.sw-h { font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; font-size: clamp(32px, 4vw, 60px); line-height: 1; margin: 0 0 24px; }
.sw-lead { font-size: clamp(17px, 1.4vw, 21px); line-height: 1.55; margin: 0 0 22px; max-width: 60ch; }
.sw-label { margin: 26px 0 12px; }
.sw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-chips span { padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; }
@media (max-width: 860px) { .sw-block { grid-template-columns: 1fr; } }

.sw-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 0; counter-reset: st; border-top: 1px solid var(--line); }
.sw-steps li { padding: 26px 22px 0 0; position: relative; }
.sw-steps li + li { padding-left: 22px; border-left: 1px solid var(--line); }
.sw-steps li::before { counter-increment: st; content: "0" counter(st); display: block; font-size: 12px; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 18px; }
.sw-steps b { display: block; font-weight: 500; font-size: 19px; letter-spacing: -0.01em; margin-bottom: 10px; }
.sw-steps p { margin: 0; font-size: 15px; line-height: 1.55; color: color-mix(in srgb, var(--fg) 72%, transparent); }
@media (max-width: 1100px) { .sw-steps { grid-template-columns: 1fr 1fr; } .sw-steps li, .sw-steps li + li { padding: 24px 22px 24px 0; border-left: 0; border-bottom: 1px solid var(--line); } }
@media (max-width: 600px) { .sw-steps { grid-template-columns: 1fr; } }

.sw-split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; }
.sw-shot { margin: 0; cursor: zoom-in; overflow: hidden; border-radius: 6px; background: var(--card); }
.sw-shot img { width: 100%; transition: transform 1.1s var(--ease); }
.sw-shot:hover img { transform: scale(1.015); }
.sw-window { max-width: 500px; justify-self: center; width: 100%; box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.06); }
@media (max-width: 860px) { .sw-split { grid-template-columns: 1fr; } }

.sw-stats { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sw-stats > div { padding: 28px 24px 26px 0; }
.sw-stats > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.sw-stats b { display: block; font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; font-size: clamp(48px, 6vw, 96px); line-height: 1; margin-bottom: 12px; }
.sw-stats span { color: color-mix(in srgb, var(--fg) 72%, transparent); font-size: 15px; line-height: 1.45; display: block; max-width: 28ch; }
@media (max-width: 700px) { .sw-stats { grid-template-columns: 1fr; } .sw-stats > div, .sw-stats > div + div { padding: 24px 0 22px; border-left: 0; } .sw-stats > div + div { border-top: 1px solid var(--line); } }

.sw-wide-head { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(24px, 5vw, 90px); margin-bottom: 28px; align-items: start; }
@media (max-width: 860px) { .sw-wide-head { grid-template-columns: 1fr; gap: 0; } }

.sw-learned { list-style: none; margin: 0; padding: 0; counter-reset: ln; }
.sw-learned li { display: grid; grid-template-columns: 48px 1fr; padding: 20px 0; border-bottom: 1px solid var(--line); font-size: clamp(16px, 1.25vw, 19px); line-height: 1.55; }
.sw-learned li:first-child { border-top: 1px solid var(--line); }
.sw-learned li::before { counter-increment: ln; content: "0" counter(ln); font-size: 12px; color: var(--muted); letter-spacing: 0.1em; padding-top: 5px; }
.sw-page > .cta { margin-top: clamp(80px, 10vw, 150px); }
.sw-teaser .sw-card { margin-top: 4px; }
.sw-teaser .sw-card + .sw-card { margin-top: clamp(20px, 2.4vw, 36px); }
.about-dev { margin-top: 14px; }
.about-dev a { color: var(--fg); border-bottom: 1px solid var(--line); }
.about-dev a:hover { border-color: var(--fg); }

/* ---------- videos ---------- */
.p-video { position: relative; background: #000; cursor: default; }
.p-video video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.play-btn, .shots-grid a.is-video::after, .featured-img.is-video::after {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 74px; height: 74px; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: #0a0a0a; font-size: 24px; display: grid; place-items: center; padding-left: 5px;
  border: 0; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.35); transition: transform 0.4s var(--ease), opacity 0.3s;
}
.play-btn:hover { transform: translate(-50%, -50%) scale(1.06); }
.p-video.playing .play-btn { opacity: 0; pointer-events: none; }
.shots-grid a { position: relative; }
.shots-grid a.is-video::after, .featured-img.is-video::after { content: "▶"; width: 46px; height: 46px; font-size: 15px; padding-left: 3px; pointer-events: none; }
#svVid { display: none; max-width: 100%; max-height: calc(var(--win-h) - 52px - 60px - 14px); width: auto; height: auto; border-radius: 4px; background: #000; }


/* a video shot at the front of the ring plays muted in a loop */
.featured-img video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s ease; pointer-events: none; }
.featured-img.playing video { opacity: 1; }
.featured-img.is-video.playing::after { opacity: 0; }

/* ---------- AudioSync: the onset envelope ---------- */
.on-sec { --master: #7fb2e8; --clip: #e0aa45; }
.on-steps { list-style: none; margin: 0; padding: 0; counter-reset: on; }
.on-steps > li { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(24px, 5vw, 90px); padding: clamp(28px, 3.4vw, 52px) 0; border-top: 1px solid var(--line); align-items: start; }
.on-text::before { counter-increment: on; content: "0" counter(on); display: block; font-size: 12px; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 16px; }
.on-text b { display: block; font-weight: 500; font-size: 21px; letter-spacing: -0.015em; margin-bottom: 10px; }
.on-text p { margin: 0; line-height: 1.55; color: color-mix(in srgb, var(--fg) 74%, transparent); max-width: 44ch; text-wrap: pretty; }
.on-fig { margin: 0; min-width: 0; min-height: 190px; display: flex; flex-direction: column; gap: 10px; }
.of-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: center; }
.of-label { font-size: 13px; line-height: 1.25; color: var(--muted); }
.of-plot { position: relative; height: 84px; background: #121213; border-radius: 5px; overflow: hidden; }
.of-row.tall .of-plot { height: 112px; }
[data-fig="wave"] { min-height: 0; max-width: 480px; gap: 6px; }
[data-fig="wave"] .of-plot { height: 40px; }
.of-row.under { margin-top: -10px; }
.of-row.tall:not(.score) .of-plot { border-radius: 5px 5px 0 0; }
.of-row.under .of-plot, .of-row.tall.under .of-plot { border-radius: 0 0 5px 5px; border-top: 1px solid rgba(255,255,255,0.16); }
.of-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.of-plot .m { fill: var(--master); } .of-plot .c { fill: var(--clip); }
.of-plot .m.thin { stroke: var(--master); } .of-plot .c.thin { stroke: var(--clip); }
.of-plot .thin { stroke-width: 1; vector-effect: non-scaling-stroke; }
.of-plot .g { stroke: rgba(255,255,255,0.28); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4; }
.of-plot .s { fill: none; stroke: var(--fg); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.of-axis { display: flex; justify-content: space-between; margin-left: 128px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.of-badge { margin: 4px 0 0 128px; font-size: 14px; color: var(--muted); }
.of-badge b { font-weight: 500; font-size: 22px; letter-spacing: -0.02em; color: var(--fg); margin: 0 2px 0 4px; }
.of-piece { position: absolute; top: 0; bottom: 0; background: rgba(224,170,69,0.1); box-shadow: inset 1px 0 rgba(224,170,69,0.6), inset -1px 0 rgba(224,170,69,0.6); }
.hit .of-piece { background: rgba(90,209,123,0.12); box-shadow: inset 1px 0 #5ad17b, inset -1px 0 #5ad17b; }
.of-dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--clip); box-shadow: 0 0 0 4px rgba(224,170,69,0.22); }
.hit .of-dot { background: #5ad17b; box-shadow: 0 0 0 4px rgba(90,209,123,0.25); }
.of-row.score .of-plot { overflow: visible; }
.of-ctrl { margin-left: 128px; display: flex; flex-direction: column; gap: 10px; }
.of-ctrl input { width: 100%; height: 28px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: grab; }
.of-ctrl input:active { cursor: grabbing; }
.of-ctrl input::-webkit-slider-runnable-track { height: 2px; background: rgba(255,255,255,0.28); }
.of-ctrl input::-moz-range-track { height: 2px; background: rgba(255,255,255,0.28); }
.of-ctrl input::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -11px; border-radius: 50%; background: var(--fg); }
.of-ctrl input::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--fg); }
.of-ctrl output { display: flex; gap: 26px; align-items: baseline; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 34px; }
.of-ctrl output b { font-weight: 500; font-size: 22px; letter-spacing: -0.02em; color: var(--fg); margin-left: 6px; }
.of-ctrl output em { font-style: normal; font-weight: 500; color: #5ad17b; }
.of-hint { margin: 0 0 0 128px; font-size: 13px; color: var(--muted); }
.on-note { padding-top: 20px; border-top: 1px solid var(--line); margin: 0; max-width: none; }
@media (max-width: 860px) { .on-steps > li { grid-template-columns: 1fr; gap: 22px; } }
@media (max-width: 600px) {
  .of-row { grid-template-columns: 1fr; gap: 6px; }
  .of-row.under { margin-top: 0; }
  .of-row.tall .of-plot, .of-row.tall.under .of-plot { border-radius: 5px; border-top: 0; }
  .of-axis, .of-badge, .of-ctrl, .of-hint { margin-left: 0; }
  .of-plot, .of-row.tall .of-plot { height: 76px; }
  [data-fig="wave"] .of-plot { height: 38px; }
}

/* categories of the favourite shots */
.shots-grid a.hidden { display: none; }
.grid-head .filters { flex-basis: 100%; }
