/* =========================================================
   Isak Persson — Portfolio
   ========================================================= */

:root {
  --bg: #f6f4ef;
  --ink: #0e0e10;
  --ink-2: #1b1b1f;
  --muted: #6b6b6b;
  --line: rgba(14, 14, 16, 0.12);
  --accent: #2742f5;
  --motion: 1; /* multiplier 0..1.5 */
  --grid-cols: 12;
  --pad-x: clamp(20px, 4vw, 64px);

  --f-display: 'Antonio', 'Big Shoulders Display', 'Archivo Black', system-ui, sans-serif;
  --f-hero: 'Antonio', 'Big Shoulders Display', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

[data-tone="cream"] { --bg: #f1ece1; --ink: #1a1612; --line: rgba(26,22,18,0.14); }
[data-tone="white"] { --bg: #fbfaf7; --ink: #0e0e10; --line: rgba(14,14,16,0.10); }
[data-tone="dark"]  { --bg: #0e0e10; --ink: #f5f3ee; --ink-2: #dad8d2; --muted: #8a8a8a; --line: rgba(245,243,238,0.16); }

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  overflow-x: hidden;
  cursor: none;
}
@media (pointer: coarse), (hover: none) {
  body { cursor: auto; }
  .cursor { display: none !important; }
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::selection { background: var(--ink); color: var(--bg); }

/* ---------- Cursor ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 18px; height: 18px;
  border-radius: 999px;
  border: 1.5px solid #fff;
  background: transparent;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  color: #fff;
  transition: width .35s cubic-bezier(.2,.8,.2,1), height .35s cubic-bezier(.2,.8,.2,1), border-color .2s, background .2s;
}
.cursor[data-mode="image"] {
  width: 88px; height: 88px;
  background: rgba(255,255,255,0.10);
  border-color: #fff;
  backdrop-filter: none;
}
.cursor .cursor-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #fff;
  opacity: 0;
  transition: opacity .25s;
}
.cursor[data-mode="image"] .cursor-label { opacity: 1; }
.cursor[data-mode="link"] {
  width: 38px; height: 38px;
  background: #fff;
  border-color: #fff;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--pad-x);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  mix-blend-mode: difference;
  color: #f5f3ee;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav .brand {
  display: flex; gap: 10px; align-items: center;
}
.nav .brand .dot {
  width: 8px; height: 8px; border-radius: 999px; background: currentColor;
}
.nav .links {
  display: flex; gap: 28px;
}
.nav .links a {
  position: relative;
  opacity: .85;
  transition: opacity .25s;
}
.nav .links a:hover { opacity: 1; }
.nav .links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px; background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
/* Hide category links once scrolled */
.nav .nav-cat {
  transition: opacity .35s cubic-bezier(.2,.8,.2,1), transform .35s cubic-bezier(.2,.8,.2,1);
}
.nav.is-compact .nav-cat {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  width: 0;
  margin-right: -28px; /* collapse the gap */
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- Buttons (glass / white-outline) ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px 14px 24px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  overflow: hidden;
  cursor: none;
  transition: background .3s, border-color .3s, color .3s, transform .3s cubic-bezier(.2,.8,.2,1);
}
.btn::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0));
  pointer-events: none;
}
.btn .arrow {
  width: 14px; height: 14px;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.btn:hover { background: rgba(255,255,255,0.18); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--dark {
  color: var(--ink);
  border-color: rgba(14,14,16,0.7);
  background: rgba(255,255,255,0.4);
}
.btn--dark:hover { background: rgba(255,255,255,0.7); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 640px;
  width: 100%;
  overflow: hidden;
  color: #f6f4ef;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  clip-path: inset(0 0 100% 0);
  animation: heroMediaIn 1.3s .3s cubic-bezier(.2,.85,.2,1) forwards;
}
@keyframes heroMediaIn {
  to { clip-path: inset(0 0 0 0); }
}
.hero__bg img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.1);
  animation: heroMediaScale 22s 1.4s ease-out infinite alternate;
}
@keyframes heroMediaScale {
  to { transform: scale(1.0); }
}
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.1) 22%, rgba(0,0,0,0.0) 45%, rgba(0,0,0,0.0) 60%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

.hero__title {
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  font-family: var(--f-hero);
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  color: #f6f4ef;
  -webkit-text-stroke: 0.6px currentColor;
}
.hero__line {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  /* Same large size for both lines, natural width */
  font-size: clamp(140px, 26vw, 460px);
  letter-spacing: -0.05em;
  padding: 0.04em 0;
}
.hero__line--top { /* Isak */ }
.hero__line--bottom { /* Persson */ }
.hero__rule {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--f-mono);
  font-weight: 500;
  font-stretch: 100%;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #f6f4ef;
  -webkit-text-stroke: 0;
  padding: clamp(8px, 1.4vw, 18px) 0;
  opacity: 0;
  animation: fadeUp 1s 1.2s forwards;
}
.hero__rule-line {
  flex: 1;
  height: 1px;
  background: rgba(246, 244, 239, 0.55);
  position: relative;
  overflow: hidden;
}
.hero__rule-line::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(246, 244, 239, 0.95);
  transform: scaleX(0);
  transform-origin: left;
  animation: ruleSweep 1.6s 1.1s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes ruleSweep { to { transform: scaleX(1); } }
.hero__line--bottom {
  margin-top: 0;
}
.hero__line .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  animation: heroIn 1.1s cubic-bezier(.2,.85,.2,1) forwards;
}
.hero__line--top .ch:nth-child(1){ animation-delay: .35s; }
.hero__line--top .ch:nth-child(2){ animation-delay: .42s; }
.hero__line--top .ch:nth-child(3){ animation-delay: .49s; }
.hero__line--top .ch:nth-child(4){ animation-delay: .56s; }
.hero__line--bottom .ch:nth-child(1){ animation-delay: .50s; }
.hero__line--bottom .ch:nth-child(2){ animation-delay: .56s; }
.hero__line--bottom .ch:nth-child(3){ animation-delay: .62s; }
.hero__line--bottom .ch:nth-child(4){ animation-delay: .68s; }
.hero__line--bottom .ch:nth-child(5){ animation-delay: .74s; }
.hero__line--bottom .ch:nth-child(6){ animation-delay: .80s; }
.hero__line--bottom .ch:nth-child(7){ animation-delay: .86s; }
@keyframes heroIn { to { opacity: 1; transform: translateY(0); } }

.hero__meta {
  position: absolute;
  left: var(--pad-x);
  bottom: 28px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 1s 1.2s forwards;
}
.hero__meta .label { color: rgba(246,244,239,0.65); }
.hero__meta .role { font-size: 13px; }

.hero__scroll {
  position: absolute;
  right: var(--pad-x);
  bottom: 28px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 1s 1.4s forwards;
}
.hero__scroll .line {
  display: inline-block;
  width: 48px; height: 1px; background: currentColor;
  position: relative; overflow: hidden;
}
.hero__scroll .line::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(246,244,239,0.4);
  animation: scrollLine 2.2s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { transform: translateX(-100%); }
  60%,100% { transform: translateX(100%); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Section header (category) ---------- */
.cat {
  position: relative;
  padding: 0 var(--pad-x);
  margin-top: clamp(80px, 14vw, 220px);
}
.cat__head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 0;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(40px, 6vw, 96px);
}
.cat__index {
  grid-column: 1 / 3;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.cat__title {
  grid-column: 1 / 11;
  font-family: 'Big Shoulders Display', 'Archivo Black', system-ui, sans-serif;
  font-weight: 700;
  font-stretch: 100%;
  font-size: clamp(80px, 17vw, 280px);
  line-height: 0.85;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 16px 0 0;
  color: var(--ink);
  overflow: hidden;
}
.cat__title span {
  display: inline-block;
}
.cat__count {
  grid-column: 11 / 13;
  text-align: right;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: end;
  padding-bottom: 18px;
}

/* ---------- Editorial grid ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(8px, 1vw, 16px);
  row-gap: clamp(16px, 2.4vw, 44px);
  align-items: start;  /* don't stretch tiles to row height */
}
[data-density="dense"] .gallery { row-gap: clamp(8px, 1.4vw, 24px); column-gap: clamp(6px, 0.8vw, 14px); }
[data-density="airy"] .gallery { row-gap: clamp(60px, 9vw, 140px); }

.tile {
  position: relative;
  overflow: visible;
}
.tile .frame {
  position: relative;
  overflow: hidden;
}
.tile .frame img {
  display: block;
  width: 100%;
  height: auto;
  transition: filter .6s;
  will-change: transform;
}
.tile .frame::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.35));
  opacity: 0;
  transition: opacity .4s;
}
.tile:hover .frame::after { opacity: 1; }

.tile__meta {
  position: absolute;
  inset: auto 14px 14px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .45s cubic-bezier(.2,.8,.2,1), transform .45s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
  z-index: 3;
}
.tile:hover .tile__meta { opacity: 1; transform: translateY(0); }
.tile__meta .ttl {
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: 100%;
  font-size: 26px;
  line-height: .95;
  letter-spacing: 0;
  text-transform: uppercase;
}
.tile__meta .sub {
  text-align: right;
}

/* Layout variants — 12-col grid placements */
.tile.v-wideL   { grid-column: 1 / 9;  }
.tile.v-tallR   { grid-column: 9 / 13; }
.tile.v-smallL  { grid-column: 2 / 6;  }
.tile.v-smallR  { grid-column: 8 / 12; }
.tile.v-centerL { grid-column: 3 / 11; }
.tile.v-edgeL   { grid-column: 1 / 6;  }
.tile.v-edgeR   { grid-column: 7 / 13; }
.tile.v-full    { grid-column: 1 / 13; }
.tile.v-medC    { grid-column: 4 / 10; }
.tile.v-thinL   { grid-column: 1 / 4;  }
.tile.v-thinR   { grid-column: 10 / 13;}

[data-density="dense"] .tile.v-wideL,
[data-density="dense"] .tile.v-tallR,
[data-density="dense"] .tile.v-smallL,
[data-density="dense"] .tile.v-smallR,
[data-density="dense"] .tile.v-centerL,
[data-density="dense"] .tile.v-edgeL,
[data-density="dense"] .tile.v-edgeR,
[data-density="dense"] .tile.v-full,
[data-density="dense"] .tile.v-medC,
[data-density="dense"] .tile.v-thinL,
[data-density="dense"] .tile.v-thinR {}

/* Editorial stagger — only applied when the photo is actually tall.
   For wide photos in these slots the offset would add dead space, so
   they sit flush with the top of the row instead. */
.tile.v-tallR.is-tall .frame   { margin-top: 22%; }
.tile.v-edgeR.is-tall .frame   { margin-top: 12%; }
.tile.v-thinR.is-tall .frame   { margin-top: 30%; }

/* Tall photos (natural ratio taller than 3:4) should never run full-width —
   they'd dominate the grid. Drop them into a centered medium slot instead. */
.tile.is-tall.v-full   { grid-column: 4 / 10; }
.tile.is-tall.v-wideL  { grid-column: 1 / 7; }
.tile.is-tall.v-centerL{ grid-column: 4 / 9; }
.tile.is-tall.v-edgeL  { grid-column: 1 / 6; }
.tile.is-tall.v-edgeR  { grid-column: 8 / 13; }

/* Static caption beneath some tiles */
.tile__caption {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.tile__caption .ttl-static {
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: 100%;
  font-size: clamp(22px, 2.6vw, 40px);
  line-height: .95;
  color: var(--ink);
  letter-spacing: 0;
}

/* Reveal animation */
.tile, .pull-quote, .strip {
  opacity: 0;
  transform: translateY(calc(48px * var(--motion)));
  transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform 1.1s cubic-bezier(.2,.8,.2,1);
}
.tile.is-in, .pull-quote.is-in, .strip.is-in {
  opacity: 1;
  transform: translateY(0);
}

.tile .frame {
  --clip: calc(100% * var(--motion));
}

/* Parallax image */
.tile .frame img {
  transition: filter .6s;
}

/* ---------- Pull quote between tiles ---------- */
.pull-quote {
  grid-column: 2 / 12;
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: 100%;
  font-size: clamp(36px, 5.5vw, 96px);
  line-height: .95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
  padding: clamp(40px, 8vw, 120px) 0;
  text-wrap: balance;
}
.pull-quote .accent { color: var(--accent); }
.pull-quote .sm {
  display: block;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 28px;
  font-weight: 400;
}

/* ---------- Marquee strip between sections ---------- */
.strip {
  grid-column: 1 / 13;
  overflow: hidden;
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  margin: 0 calc(-1 * var(--pad-x));
}
.strip__track {
  display: flex;
  gap: 60px;
  white-space: nowrap;
  animation: marquee 32s linear infinite;
  animation-duration: calc(32s / max(var(--motion, 1), 0.1));
  will-change: transform;
}
.strip__track span {
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: 100%;
  font-size: clamp(36px, 6vw, 80px);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.strip__track .dot {
  width: 14px; height: 14px; border-radius: 999px; background: var(--accent);
  align-self: center;
  flex-shrink: 0;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Footer ---------- */
.foot {
  margin-top: clamp(120px, 18vw, 240px);
  padding: 80px var(--pad-x) 40px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  position: relative;
}
.foot__big {
  grid-column: 1 / 13;
  display: block;
  font-family: 'Big Shoulders Display', 'Archivo Black', system-ui, sans-serif;
  font-weight: 700;
  font-stretch: 100%;
  font-size: clamp(80px, 18vw, 320px);
  line-height: .82;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--ink);
  transition: opacity .3s, transform .6s cubic-bezier(.2,.8,.2,1), color .3s;
}
.foot__big:hover { color: var(--accent); }
.foot__row {
  grid-column: 1 / 13;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.foot__row a { color: var(--ink); }

/* ---------- Lightbox ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  background: #fff;
  transition: opacity .5s ease;
}
.lb.is-open { opacity: 1; pointer-events: auto; }
.lb__stage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr clamp(280px, 28vw, 420px);
  grid-template-rows: 1fr;
}
.lb__media {
  position: relative;
  overflow: hidden;
  background: #fff;
}
.lb__slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  will-change: transform;
}
.lb__slide img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}
.lb__slide.is-entering.dir-next  { animation: lb-enter-next .9s cubic-bezier(0.22, 1, 0.36, 1) both; }
.lb__slide.is-entering.dir-prev  { animation: lb-enter-prev .9s cubic-bezier(0.22, 1, 0.36, 1) both; }
.lb__slide.is-leaving.dir-next   { animation: lb-leave-next .9s cubic-bezier(0.22, 1, 0.36, 1) both; }
.lb__slide.is-leaving.dir-prev   { animation: lb-leave-prev .9s cubic-bezier(0.22, 1, 0.36, 1) both; }

@keyframes lb-enter-next {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes lb-enter-prev {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
@keyframes lb-leave-next {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}
@keyframes lb-leave-prev {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}
.lb.is-open .lb__media .lb__slide img { opacity: 1; transform: none; }

.lb__side {
  position: relative;
  padding: 28px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 28px;
  border-left: 1px solid var(--line);
  min-width: 0;
  overflow: hidden;
}
.lb__head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  font-family: var(--f-mono);
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted);
  min-width: 0;
}
.lb__head > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.lb__close { flex: 0 0 auto; }
.lb__close {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  cursor: none;
  color: var(--ink);
}
.lb__title {
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: 100%;
  font-size: clamp(40px, 4.4vw, 72px);
  line-height: .9;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  max-width: 100%;
}
.lb__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  row-gap: 10px;
  column-gap: 24px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.lb__meta dt { color: var(--muted); }
.lb__meta dd { margin: 0; color: var(--ink); }
.lb__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
}
.lb__nav button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: none;
  display: flex; align-items: center; gap: 10px;
  transition: background .25s, border-color .25s;
}
.lb__nav button:hover { background: var(--ink); color: var(--bg); }

/* Slide in side panel */
.lb__side {
  transform: translateX(20px);
  opacity: 0;
  transition: transform .6s .15s cubic-bezier(.2,.8,.2,1), opacity .5s .15s;
}
.lb.is-open .lb__side { transform: translateX(0); opacity: 1; }

@media (max-width: 800px) {
  /* Full-screen image — no split layout */
  .lb__stage { display: block; width: 100%; height: 100svh; }
  .lb__media { position: absolute; inset: 0; background: #fff; }
  /* Hide the desktop side panel entirely on mobile */
  .lb__side { display: none !important; }
  .lb__title { font-size: 36px; }

  /* Close X: top-right */
  .lb__close-floating { top: 16px; right: 16px; width: 38px; height: 38px; }

  /* Nav pill: full width, bottom of screen */
  .lb__nav-floating {
    bottom: 16px;
    left: 16px;
    right: 16px;
    width: auto;
    transform: none;
    justify-content: space-between;
    border-radius: 999px;
    box-shadow: none;
    padding: 8px 14px;
    display: flex !important; /* always visible on mobile */
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  /* Info toggle button: only visible on mobile */
  .lb__info-toggle { display: flex; }

  /* Mobile info bottom-sheet */
  .lb__mobile-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px 24px 40px;
    transform: translateY(100%);
    transition: transform .4s cubic-bezier(.2,.8,.2,1);
    z-index: 10;
    box-shadow: 0 -4px 40px rgba(0,0,0,0.12);
  }
  .lb__mobile-info.is-open { transform: translateY(0); }
  .lb__mobile-info__handle {
    width: 36px; height: 4px;
    background: rgba(14,14,16,0.15);
    border-radius: 999px;
    margin: 0 auto 20px;
    cursor: pointer;
  }
  .lb__mobile-info__title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(28px, 7vw, 48px);
    line-height: .9;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
  }
}

/* ---------- Ambient sound toggle ---------- */
.audio {
  position: fixed;
  bottom: 24px; left: 24px;
  z-index: 70;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--f-mono);
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 10px 16px 10px 12px;
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 -1px 0 rgba(255, 255, 255, 0.08) inset,
    0 10px 30px rgba(14, 14, 16, 0.12);
  cursor: none;
}
[data-tone="dark"] .audio {
  background: rgba(20, 20, 22, 0.18);
  border-color: rgba(245, 243, 238, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.10) inset,
    0 -1px 0 rgba(0, 0, 0, 0.20) inset,
    0 10px 30px rgba(0, 0, 0, 0.35);
}
.audio__bars {
  display: flex; gap: 3px; align-items: end;
  height: 14px;
}
.audio__bars span {
  display: block;
  width: 2px; height: 4px;
  background: var(--ink);
  border-radius: 1px;
}
.audio.is-on .audio__bars span {
  animation: bars 1.2s ease-in-out infinite;
}
.audio.is-on .audio__bars span:nth-child(2) { animation-delay: .15s; }
.audio.is-on .audio__bars span:nth-child(3) { animation-delay: .3s; }
.audio.is-on .audio__bars span:nth-child(4) { animation-delay: .1s; }
@keyframes bars {
  0%,100% { height: 4px; }
  50%     { height: 14px; }
}

/* ---------- Section index (right rail) ---------- */
.section-index {
  position: fixed;
  top: 50%;
  right: 22px;
  transform: translateY(-50%) translateX(20px);
  z-index: 60;
  display: flex; flex-direction: column; gap: 14px;
  font-family: var(--f-mono);
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  mix-blend-mode: difference;
  color: #f5f3ee;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s cubic-bezier(.2,.8,.2,1), transform .6s cubic-bezier(.2,.8,.2,1);
}
.section-index.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}
.section-index a {
  display: flex; align-items: center; gap: 10px;
  opacity: .5;
  transition: opacity .3s;
}
.section-index a.is-active { opacity: 1; }
.section-index .bar {
  width: 18px; height: 1px; background: currentColor;
  transition: width .3s;
}
.section-index a.is-active .bar { width: 36px; }

@media (max-width: 800px) {
  .section-index { display: none; }
}

/* ---------- Condensed view ---------- */
[data-view="condensed"] .gallery {
  grid-template-columns: repeat(3, 1fr);
  column-gap: clamp(10px, 1vw, 18px);
  row-gap: clamp(10px, 1vw, 18px);
}
[data-view="condensed"] .tile {
  grid-column: auto !important;
}
[data-view="condensed"] .tile .frame {
  /* Let each photo keep its natural aspect ratio so a row of wide photos
     collapses to their actual height instead of being forced to 4:5. */
  aspect-ratio: auto !important;
  margin-top: 0 !important;
}
[data-view="condensed"] .pull-quote,
[data-view="condensed"] .strip,
[data-view="condensed"] .tile__caption {
  display: none;
}
[data-view="condensed"] .cat__head { margin-bottom: clamp(20px, 3vw, 48px); }
[data-view="condensed"] .cat { margin-top: clamp(40px, 7vw, 120px); }

@media (max-width: 720px) {
  [data-view="condensed"] .gallery { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Hide info / captions globally ---------- */
[data-info="off"] .tile__meta,
[data-info="off"] .tile__caption,
[data-info="off"] .lb__side {
  display: none !important;
}
[data-info="off"] .lb__stage {
  grid-template-columns: 1fr;
}
[data-info="off"] .lb__close-floating {
  display: grid;
}

/* Info toggle button — only shown on mobile inside nav-floating */
.lb__info-toggle { display: none; }

/* Mobile info bottom-sheet — hidden on desktop */
.lb__mobile-info { display: none; }
@media (max-width: 800px) {
  .lb__mobile-info { display: block; }
  .lb__info-toggle { display: flex; align-items: center; justify-content: center; }
}

/* Floating close — solid black pill, top right. Always visible. */
.lb__close-floating {
  display: none;
  position: absolute;
  top: 20px; right: 20px;
  appearance: none;
  background: #0e0e10;
  border: 0;
  border-radius: 999px;
  width: 38px; height: 38px;
  place-items: center;
  cursor: none;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  transition: background .25s;
}
.lb__close-floating:hover { background: #2a2a2e; }
/* Solid black control bar at the bottom of full-view mode.
   Auto-hides after 5s of cursor inactivity (.is-idle). */
.lb__nav-floating {
  display: none;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  gap: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #0e0e10;
  color: #fff;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  transition: opacity .4s ease, transform .4s ease;
}
.lb__nav-floating.is-idle {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
}
[data-info="off"] .lb__nav-floating { display: flex; }
.lb__nav-floating button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 8px;
  color: #fff;
  font: inherit;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: none;
  display: flex; align-items: center; gap: 8px;
  border-radius: 999px;
  transition: background .2s;
}
.lb__nav-floating button:hover { background: rgba(255,255,255,0.10); }

/* ---------- View toggle (public) ---------- */
.view-disclaimer {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  background: #0e0e10;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  transition: opacity .4s cubic-bezier(.2,.8,.2,1), transform .5s cubic-bezier(.2,.8,.2,1);
}
[data-footvisible="on"] .view-disclaimer {
  opacity: 0;
  transform: translate(-50%, 20px);
}
@media (max-width: 720px) {
  .view-disclaimer { bottom: 26px; }
}

/* Disclaimer in the corner of full-view */
.lb__disclaimer {
  position: absolute;
  bottom: 26px;
  left: 24px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  background: #0e0e10;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.view-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 70;
  display: inline-flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 3px;
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 -1px 0 rgba(255, 255, 255, 0.08) inset,
    0 10px 30px rgba(14, 14, 16, 0.12);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  gap: 0;
}
[data-tone="dark"] .view-toggle {
  background: rgba(20, 20, 22, 0.18);
  border-color: rgba(245, 243, 238, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.10) inset,
    0 -1px 0 rgba(0, 0, 0, 0.20) inset,
    0 10px 30px rgba(0, 0, 0, 0.35);
}
.view-toggle button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: none;
  transition: background .3s, color .3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: .55;
}
.view-toggle button:hover { opacity: .9; }
.view-toggle button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  opacity: 1;
}
.view-toggle svg { display: block; }

/* audio + view-toggle positions on mobile handled in the main mobile block below */

/* Hide floating chrome when footer is visible */
.audio,
.view-toggle {
  transition: opacity .4s cubic-bezier(.2,.8,.2,1), transform .5s cubic-bezier(.2,.8,.2,1);
}
[data-footvisible="on"] .audio,
[data-footvisible="on"] .view-toggle {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

/* ---------- Tweaks overrides ---------- */
[data-tone="dark"] ::selection { background: var(--bg); color: var(--ink); }
[data-tone="dark"] .btn--dark { color: var(--bg); border-color: rgba(245,243,238,0.7); background: rgba(245,243,238,0.08); }
[data-tone="dark"] .btn--dark:hover { background: rgba(245,243,238,0.18); }
[data-tone="dark"] .nav { color: #0e0e10; }
[data-tone="dark"] .section-index { color: #0e0e10; }

/* =============================================================
   MOBILE — phone-first adjustments (≤ 720px)
   Desktop layout is untouched; these rules layer on top.
   ============================================================= */
@media (max-width: 720px) {

  /* --- Nav: keep brand + Contact, hide category links --- */
  .nav { padding: 16px var(--pad-x); }
  .nav .nav-cat { display: none; }
  .nav .nav-contact { display: block; white-space: nowrap; }

  /* --- Hero --- */
  .hero__line { font-size: clamp(52px, 17vw, 130px); }
  .hero__meta { font-size: 10px; bottom: 20px; }
  .hero__scroll { display: none; }

  /* --- Category sections --- */
  .cat { margin-top: clamp(60px, 12vw, 120px); }
  .cat__head { row-gap: 10px; }
  .cat__index { grid-column: 1 / 7; }
  .cat__count { grid-column: 7 / 13; text-align: right; }
  .cat__title { grid-column: 1 / 13; font-size: clamp(44px, 14vw, 110px); }
  .cat__blurb { grid-column: 1 / 13; }

  /* --- Editorial gallery: 6-col grid with scattered variant layout --- */
  [data-view="editorial"] .gallery {
    grid-template-columns: repeat(6, 1fr);
    row-gap: clamp(10px, 3vw, 24px);
    column-gap: clamp(6px, 2vw, 10px);
  }
  /* Remove blanket full-width override for editorial */
  [data-view="editorial"] .tile { grid-column: auto; }
  /* Map each variant to a 6-col mobile position for visual scatter */
  [data-view="editorial"] .tile.v-full    { grid-column: 1 / 7; }
  [data-view="editorial"] .tile.v-wideL   { grid-column: 1 / 5; }
  [data-view="editorial"] .tile.v-tallR   { grid-column: 5 / 7; }
  [data-view="editorial"] .tile.v-smallL  { grid-column: 1 / 4; }
  [data-view="editorial"] .tile.v-smallR  { grid-column: 4 / 7; }
  [data-view="editorial"] .tile.v-edgeL   { grid-column: 1 / 5; }
  [data-view="editorial"] .tile.v-edgeR   { grid-column: 3 / 7; }
  [data-view="editorial"] .tile.v-medC    { grid-column: 2 / 6; }
  [data-view="editorial"] .tile.v-centerL { grid-column: 1 / 7; }
  [data-view="editorial"] .tile.v-thinL   { grid-column: 1 / 3; }
  [data-view="editorial"] .tile.v-thinR   { grid-column: 5 / 7; }
  /* Remove stagger margins on mobile — they don't translate to 6-col */
  [data-view="editorial"] .tile .frame { margin-top: 0 !important; }

  /* Pull quote in editorial */
  .pull-quote {
    grid-column: 1 / 13;
    font-size: clamp(20px, 5.5vw, 36px);
    padding: clamp(24px, 6vw, 48px) 0;
  }

  /* --- Condensed / grid view: full-width single col override --- */
  [data-view="condensed"] .gallery { grid-template-columns: repeat(2, 1fr); }
  [data-view="condensed"] .tile { grid-column: auto !important; }

  /* --- Lightbox --- */
  .lb__title { font-size: clamp(26px, 7vw, 44px); }
  .lb__side { max-height: 45vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .lb__disclaimer { left: 50%; transform: translateX(-50%); bottom: 70px; white-space: nowrap; }
  .lb__close-floating { top: 14px; right: 14px; width: 36px; height: 36px; }
  /* Center the nav pill at the bottom */
  .lb__nav-floating {
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    font-size: 9px;
  }

  /* --- Footer --- */
  .foot { padding: 60px var(--pad-x) 32px; }
  .foot__big { font-size: clamp(36px, 13vw, 72px); }
  .foot__row { flex-direction: column; align-items: flex-start; gap: 10px; font-size: 10px; }

  /* --- Bottom chrome: audio (left) + view-toggle (right), pill shape, full width --- */
  .audio {
    bottom: 16px;
    left: 16px;
    right: calc(50% + 5px);
    transform: none;
    justify-content: center;
    font-size: 9px;
    padding: 10px 12px;
    border-radius: 999px;
    box-sizing: border-box;
    width: auto;
    border: 1px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    box-shadow: none;
  }
  .audio > span:last-child { display: inline; }

  .view-toggle {
    bottom: 16px;
    left: calc(50% + 5px);
    right: 16px;
    transform: none;
    font-size: 9px;
    width: auto;
    display: flex;
    box-sizing: border-box;
    border-radius: 999px;
    box-shadow: none;
  }
  .view-toggle button {
    flex: 1;
    justify-content: center;
    padding: 10px 6px;
    border-radius: 999px;
  }

  /* --- Disclaimer: centered just above the button row --- */
  .view-disclaimer {
    display: inline-flex;
    bottom: 62px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  /* Very small phones: hide audio text, keep icon */
  @media (max-width: 360px) {
    .audio > span:last-child { display: none; }
  }
}
