/* ==========================================================================
   Margarette Contreras — Analog Film Photography
   Bodoni Moda (display / text, optical sizes) + Geist Mono (captions)
   ========================================================================== */

@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-latin-opsz-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-latin-opsz-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0f0e0c;          /* sumi */
  --ink-2: #1a1815;
  --bone: #ece7de;
  --paper: #e7e1d5;        /* washi */
  --shu: #c4452b;          /* vermilion seal */

  --fg: var(--bone);
  --muted: rgba(236, 231, 222, 0.56);
  --line: rgba(236, 231, 222, 0.14);

  --serif: "Bodoni Moda", "Bodoni 72", Didot, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* side padding never smaller than a notch / rounded-corner safe area */
  --pad: max(clamp(18px, 3.6vw, 60px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gap: clamp(12px, 1.6vw, 24px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; color-scheme: dark; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html.lb-open, html.menu-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(16px, 0.35vw + 14.5px, 19px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  overflow-x: clip;
}
img, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
p, h1, h2, h3, dl, dd, ol, figure { margin: 0; }
em { font-style: italic; }
::selection { background: var(--shu); color: var(--bone); }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

/* Display type */
.hero__title, .statement__text, .chapter__title, .chapter__num, .frame__note,
.index__heading, .index__title, .about__lead, .pub__title, .pubs__heading,
.contact__kicker, .contact__mail, .site-footer__mark, .lb__title, .loader__count,
.menu nav a, .legal h1, .interlude__title, .seal {
  font-family: var(--serif);
  font-weight: 400;
}

/* Caption — like the edge print on a film strip */
.mono {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.09em;
  line-height: 1.5;
  text-transform: uppercase;
}
.label { color: var(--muted); }
.vlabel { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; color: var(--muted); }
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}
.theme-bone {
  --fg: #1a1712;
  --muted: rgba(26, 23, 18, 0.56);
  --line: rgba(26, 23, 18, 0.16);
  background: var(--paper);
  color: var(--fg);
}

.skip {
  position: fixed; left: var(--pad); top: 12px; z-index: 300;
  padding: 8px 12px; background: var(--bone); color: var(--ink);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* Seal (hanko) */
.seal {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; flex: none;
  background: var(--shu); color: #f4efe6;
  font-style: italic; font-size: 12px; letter-spacing: -0.04em; line-height: 1;
  border-radius: 2px;
}

/* ---------- Film grain ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 190;
  pointer-events: none; opacity: 0.1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
  animation: grain 0.9s steps(5) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-4%, 3%); }
  40%  { transform: translate(3%, -5%); }
  60%  { transform: translate(-6%, -2%); }
  80%  { transform: translate(5%, 4%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Loader ---------- */
.loader { display: none; }
.js:not(.seen) .loader {
  position: fixed; inset: 0; z-index: 250;
  display: grid; place-items: center; align-content: center; gap: 28px;
  background: var(--ink); color: var(--bone);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.15s var(--ease-io);
  animation: loader-failsafe 0s 6s forwards;
}
.loader.is-done { clip-path: inset(0 0 100% 0); }
.loader[hidden] { display: none !important; }
.loader__count {
  font-size: clamp(4.2rem, 15.4vw, 14rem);
  line-height: 1; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums lining-nums;
}
.loader__meta {
  position: absolute; left: var(--pad); right: var(--pad); bottom: var(--pad);
  display: flex; justify-content: space-between; gap: 16px; color: var(--muted);
}
@keyframes loader-failsafe { to { visibility: hidden; } }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 120;
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  padding: 20px var(--pad);
  color: var(--bone);
  transition: transform 0.7s var(--ease), color 0.5s var(--ease);
}
.site-header.is-hidden { transform: translateY(-120%); }
/* soft backdrop once the header floats over content */
.site-header::before {
  content: ""; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(15, 14, 12, 0.92), rgba(15, 14, 12, 0.6) 55%, rgba(15, 14, 12, 0));
  opacity: 0; transition: opacity 0.5s var(--ease);
}
.site-header.is-scrolled::before, .page-legal .site-header::before { opacity: 1; }
.site-header.is-light::before { background: linear-gradient(to bottom, rgba(231, 225, 213, 0.94), rgba(231, 225, 213, 0.6) 55%, rgba(231, 225, 213, 0)); }
.menu-open .site-header::before { opacity: 0; }
.site-header.is-light { color: #1a1712; }
.menu-open .site-header { color: var(--bone); }
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 14px; }
.site-nav { justify-self: end; }
.site-nav ul { display: flex; gap: clamp(18px, 2.6vw, 40px); list-style: none; margin: 0; padding: 0; }
.site-nav a { position: relative; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0.2em; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); transform-origin: left; }
.menu-btn { display: none; justify-self: end; min-height: 44px; min-width: 44px; background: none; border: 0; padding: 0; text-align: right; cursor: pointer; }

.menu {
  position: fixed; inset: 0; z-index: 110;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 40px;
  padding: 96px var(--pad) calc(var(--pad) + var(--safe-b));
  overscroll-behavior: contain;
  background: var(--ink);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.9s var(--ease-io), visibility 0s 0.9s;
}
.menu.is-open { clip-path: inset(0); visibility: visible; transition: clip-path 0.9s var(--ease-io); }
.menu nav { display: flex; flex-direction: column; gap: 4px; }
.menu nav a { font-size: clamp(2.6rem, 11vw, 4.5rem); line-height: 1; letter-spacing: -0.045em; }
.menu__foot { display: flex; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- Split text ---------- */
.js [data-split] .w {
  display: inline-block; overflow: hidden; vertical-align: top; text-indent: 0;
  padding: 0.04em 0.07em 0.24em; margin: -0.04em -0.07em -0.24em;
}
.js [data-split] .i {
  display: inline-block;
  transform: translate3d(0, 112%, 0);
  transition: transform 1.4s var(--ease);
  transition-delay: calc(var(--i, 0) * 26ms);
}
.js [data-split="chars"] .i { transition-delay: calc(var(--i, 0) * 30ms); }
.js [data-split].is-in .i { transform: none; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translate3d(0, 24px, 0); transition: opacity 1.4s var(--ease), transform 1.4s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Depth: pinned scenes and sliding sheets ---------- */
.stack { position: relative; }
.pin {
  position: sticky; top: 0; z-index: 0;
  height: 100vh; height: 100svh; min-height: 520px;
  overflow: hidden; isolation: isolate;
  --p: 0;
}
.pin__inner {
  position: absolute; inset: 0; z-index: -2;
  transform: scale(calc(1 - var(--p) * 0.08)) translate3d(0, calc(var(--p) * -3vh), 0);
  transform-origin: 50% 35%;
  will-change: transform;
}
.pin__inner img, .pin__inner video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.pin__dim {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: #050504; opacity: calc(var(--p) * 0.7);
}
.pin__content {
  opacity: calc(1 - var(--p) * 1.6);
  transform: translate3d(0, calc(var(--p) * -8vh), 0);
}
.sheet {
  position: relative; z-index: 1;
  background: var(--ink);
  box-shadow: 0 -30px 90px rgba(0, 0, 0, 0.45);
}

/* Living stills: video fades in over the photograph once it plays */
.living { opacity: 0; transition: opacity 1.6s var(--ease); }
.living.is-playing { opacity: 1; }

/* ---------- Hero ---------- */
.hero { color: #f3eee6; }
.hero .pin__inner img, .hero .pin__inner video { filter: saturate(0.92) brightness(0.88); }
.js .hero .pin__inner { scale: 1.12; transition: scale 2.8s var(--ease); }
.is-ready .hero .pin__inner { scale: 1; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, rgba(15, 14, 12, 0.6), rgba(15, 14, 12, 0.16) 16%, rgba(15, 14, 12, 0) 30%),
    linear-gradient(to top, rgba(15, 14, 12, 0.8), rgba(15, 14, 12, 0.32) 34%, rgba(15, 14, 12, 0) 58%);
}
.hero__content {
  position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(64px, 9vh, 104px); z-index: 3;
}
.hero__title {
  font-size: clamp(2.2rem, 6.1vw, 7.4rem);
  line-height: 0.8;
  letter-spacing: -0.05em;
}
.hero__title .line { display: block; }
/* "Contreras" is anchored so its C cuts through the descender of the g */
.hero__title .line + .line { padding-left: 1.62em; }
.hero__sub { margin-top: clamp(18px, 2.4vw, 32px); color: rgba(243, 238, 230, 0.8); }
.hero__foot {
  position: absolute; left: var(--pad); right: var(--pad); bottom: calc(24px + var(--safe-b)); z-index: 3;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end;
  color: rgba(243, 238, 230, 0.72);
}
.hero__foot > :last-child { justify-self: end; }
.hero__scroll { display: inline-flex; align-items: center; gap: 12px; }
.hero__scroll::before {
  content: ""; width: 1px; height: 28px; background: currentColor;
  transform-origin: top; animation: scrollcue 2.4s var(--ease-io) infinite;
}
@keyframes scrollcue {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
.js .hero__sub, .js .hero__foot { opacity: 0; transition: opacity 1.6s var(--ease) 0.9s; }
.is-ready .hero__sub { opacity: 1; }
.is-ready .hero__foot { opacity: 1; }

/* ---------- Statement ---------- */
.statement {
  padding: clamp(120px, 18vw, 300px) var(--pad) clamp(110px, 16vw, 260px);
  row-gap: 64px;
  align-items: start;
}
.statement .vlabel { grid-column: 1 / 2; grid-row: 1 / 3; justify-self: start; }
.statement__text {
  grid-column: 3 / 12;
  font-size: clamp(1.5rem, 3.45vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-indent: 18%;
  text-wrap: pretty;
}
.statement__aside {
  grid-column: 3 / 12;
  display: flex; gap: clamp(32px, 8vw, 140px);
  color: var(--muted);
}

/* ---------- Chapters ---------- */
.chapter { padding-bottom: clamp(96px, 14vw, 220px); }
.chapter__head {
  padding: clamp(120px, 14vw, 220px) var(--pad) 0;
  margin-bottom: clamp(64px, 9vw, 140px);
  row-gap: 32px;
  align-items: end;
}
.chapter__kicker { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 16px; color: var(--muted); }
.chapter__num { font-style: italic; text-transform: none; letter-spacing: -0.02em; font-size: 1.6rem; line-height: 1; color: var(--fg); }
.chapter__title {
  grid-column: 1 / 9;
  font-size: clamp(3.1rem, 10.5vw, 11.9rem);
  line-height: 0.82;
  letter-spacing: -0.055em;
}
.chapter__dek { grid-column: 10 / 13; max-width: 34ch; font-size: 0.95rem; line-height: 1.5; color: var(--muted); padding-bottom: 0.5em; }

/* ---------- Spreads / frames ---------- */
.spread {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: clamp(72px, 10vw, 180px);
  padding: 0 var(--pad);
  align-items: start;
}
.frame { grid-column: var(--c, 1 / -1); margin-top: var(--y, 0); }
.frame[data-speed] { will-change: transform; }
.frame__btn {
  display: block; width: 100%;
  padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
}
.frame__img {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: var(--ar, 3 / 2);
  background: var(--ink-2);
}
.frame__img img, .frame__img video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 2s var(--ease), filter 0.8s var(--ease), opacity 1.6s var(--ease);
}
.js .frame__img { clip-path: inset(100% 0 0 0); transition: clip-path 1.6s var(--ease); }
.js .frame__img img, .js .frame__img video { transform: scale(1.2); }
.js .frame.is-in .frame__img { clip-path: inset(0 0 0 0); }
.js .frame.is-in .frame__img img, .js .frame.is-in .frame__img video { transform: scale(1); }
@media (hover: hover) {
  .js .frame.is-in .frame__btn:hover img, .js .frame.is-in .frame__btn:hover video { transform: scale(1.03); }
}
.frame figcaption {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 14px; color: var(--muted);
}
.frame figcaption > :first-child { color: var(--fg); }
.frame__note {
  margin-top: clamp(28px, 4vw, 56px);
  font-style: italic;
  font-size: clamp(1.1rem, 1.45vw, 1.45rem);
  line-height: 1.35;
  max-width: 24ch;
}

/* ---------- Full-bleed scenes ---------- */
.bleed, .interlude { color: #f3eee6; --muted: rgba(243, 238, 230, 0.74); --fg: #f3eee6; }
.bleed::after, .interlude::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(15, 14, 12, 0.82), rgba(15, 14, 12, 0.28) 42%, rgba(15, 14, 12, 0) 64%),
              linear-gradient(to bottom, rgba(15, 14, 12, 0.5), rgba(15, 14, 12, 0) 18%);
}
.bleed .pin__inner img, .bleed .pin__inner video { object-position: 18% 50%; }
.bleed__head {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 0 var(--pad) clamp(28px, 4vw, 56px);
  row-gap: 28px; align-items: end;
}
.bleed__head .chapter__title { grid-column: 1 / 10; }
.bleed__head .chapter__dek { grid-column: 10 / 13; color: var(--fg); }
.bleed + .spread { margin-top: 30vh; padding-top: clamp(96px, 12vw, 180px); padding-bottom: clamp(96px, 14vw, 220px); }

.interlude__content {
  position: absolute; inset: auto var(--pad) clamp(28px, 4vw, 56px); z-index: 3;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 28px;
  align-items: end;
}
.interlude__content .label { grid-column: 1 / -1; color: var(--muted); }
.interlude__title {
  grid-column: 1 / 8;
  font-size: clamp(2.8rem, 8.4vw, 9.5rem); line-height: 0.84; letter-spacing: -0.055em;
}
.interlude__stocks { grid-column: 9 / 13; display: grid; gap: 22px; }
.interlude__stocks ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(243, 238, 230, 0.28); }
.interlude__stocks li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(243, 238, 230, 0.18); }
.interlude__stocks li span:last-child { color: var(--muted); }
.interlude__stocks p { font-size: 0.95rem; line-height: 1.5; color: var(--fg); max-width: 40ch; }
.interlude + .sheet { margin-top: 30vh; }

/* ---------- Index ---------- */
.index { padding: clamp(110px, 12vw, 180px) var(--pad) clamp(110px, 13vw, 200px); }
.index__head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  align-items: end; padding-bottom: clamp(28px, 3.4vw, 48px);
}
.index__head .vlabel { grid-column: 1 / 2; grid-row: 1; justify-self: start; }
.index__heading {
  grid-column: 3 / 10;
  font-size: clamp(2.5rem, 7vw, 7.7rem); line-height: 0.82; letter-spacing: -0.055em;
}
.index__meta { grid-column: 10 / 13; text-align: right; }
.index__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.index__row {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  align-items: baseline;
  width: 100%; padding: clamp(16px, 1.7vw, 26px) 0;
  border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; cursor: pointer;
  transition: opacity 0.5s var(--ease);
}
.index__row > .mono:first-child { grid-column: 1 / 2; color: var(--muted); }
.index__title {
  grid-column: 2 / 8;
  font-size: clamp(1.75rem, 4.9vw, 5.3rem);
  line-height: 0.95; letter-spacing: -0.045em;
  transition: transform 0.9s var(--ease);
}
.index__dek { grid-column: 8 / 11; font-size: 0.92rem; line-height: 1.45; color: var(--muted); max-width: 32ch; }
.index__series { grid-column: 11 / 12; color: var(--muted); }
.index__count { grid-column: 12 / 13; text-align: right; }
/* Touch screens have no hover preview: show the cover inside each row instead */
.index__thumb { display: none; }
@media (hover: none) {
  .index__thumb {
    display: block; grid-column: 12 / 13; justify-self: end; align-self: center;
    width: clamp(56px, 8vw, 96px); aspect-ratio: 4 / 5; object-fit: cover;
  }
  .index__count { display: none; }
  .index__row { align-items: center; }
}
@media (hover: hover) {
  .index__list:hover .index__row:not(:hover) { opacity: 0.28; }
  .index__row:hover .index__title { transform: translate3d(clamp(10px, 1.8vw, 32px), 0, 0); font-style: italic; }
}
.index__preview {
  position: fixed; top: 0; left: 0; z-index: 90;
  width: clamp(200px, 19vw, 340px); aspect-ratio: 4 / 5;
  pointer-events: none; overflow: hidden;
  opacity: 0; scale: 0.88;
  transition: opacity 0.45s var(--ease), scale 0.6s var(--ease);
}
.index__preview.is-on { opacity: 1; scale: 1; }
.index__preview img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  clip-path: inset(0 0 100% 0); transition: clip-path 0.7s var(--ease);
}
.index__preview img.is-active { clip-path: inset(0); z-index: 1; }
@media (hover: none), (pointer: coarse) { .index__preview { display: none; } }

/* ---------- Filmstrip ---------- */
.filmstrip {
  position: relative; z-index: 1;
  overflow: hidden;
  /* developed film base: brown-black, slightly denser at the edges */
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 78%, rgba(0, 0, 0, 0.35)),
    linear-gradient(90deg, #22170f, #2b1d13 35%, #251910 65%, #2c1e14);
  border-block: 1px solid rgba(120, 84, 52, 0.25);
}
.filmstrip__track {
  position: relative;
  display: flex; gap: 14px;
  width: max-content;
  padding: 44px 0;
  animation: strip 120s linear infinite;
}
.filmstrip__track::before, .filmstrip__track::after {
  content: ""; position: absolute; left: 0; right: 0; height: 10px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='10'><rect x='6' y='0' width='10' height='10' rx='2' fill='%23e9dcc6' fill-opacity='.82'/></svg>");
  background-repeat: repeat-x; background-size: 22px 10px;
}
.filmstrip__track::before { top: 12px; }
.filmstrip__track::after { bottom: 12px; }
.filmstrip:hover .filmstrip__track { animation-play-state: paused; }
@keyframes strip { to { transform: translate3d(-50%, 0, 0); } }
.filmstrip__frame { position: relative; flex: none; }
.filmstrip__frame img { height: clamp(96px, 10.5vw, 160px); width: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.filmstrip__code {
  position: absolute; left: 2px; right: 2px; top: calc(100% + 5px);
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 9px; line-height: 1; letter-spacing: 0.12em;
  color: #e09a4f;
}

/* ---------- About ---------- */
.about { position: relative; z-index: 1; padding: clamp(110px, 14vw, 230px) var(--pad) clamp(96px, 11vw, 170px); }
.about .grid { row-gap: 40px; align-items: start; }
.about__label { grid-column: 1 / -1; }
.about__portrait { grid-column: 1 / 6; }
.about__body { grid-column: 7 / 13; padding-top: clamp(0px, 4vw, 64px); }
.about__lead {
  font-size: clamp(1.45rem, 2.5vw, 2.8rem);
  line-height: 1.08; letter-spacing: -0.03em;
  text-wrap: pretty;
}
.about__cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--gap) * 1.5);
  margin-top: clamp(40px, 5vw, 72px);
  font-size: 1rem; line-height: 1.6;
}
.about__cols p:first-child::first-letter {
  float: left; font-size: 3.6em; line-height: 0.82; padding: 0.06em 0.08em 0 0; font-style: italic;
}
.facts {
  display: grid; grid-template-columns: max-content 1fr; gap: 10px 48px;
  margin-top: clamp(48px, 6vw, 88px); padding-top: 20px;
  border-top: 1px solid var(--line);
}
.facts dt { color: var(--muted); }
.facts dd { min-width: 0; }
.facts a { border-bottom: 1px solid var(--line); transition: border-color 0.4s; }
.facts a:hover { border-color: currentColor; }

/* ---------- Publications ---------- */
.pubs { position: relative; z-index: 1; padding: clamp(40px, 5vw, 80px) var(--pad) clamp(110px, 13vw, 220px); }
.pubs__head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  align-items: end; padding-bottom: clamp(28px, 4vw, 56px);
}
.pubs__head .label { grid-column: 1 / 5; align-self: start; }
.pubs__heading {
  grid-column: 5 / 13; justify-self: end;
  font-size: clamp(2.5rem, 7vw, 7.7rem); line-height: 0.82; letter-spacing: -0.055em; font-style: italic;
}
.pubs__list { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  align-items: start;
  padding: clamp(22px, 2.6vw, 36px) 0;
  border-top: 1px solid var(--line);
}
.pub:last-child { border-bottom: 1px solid var(--line); }
.pub__num { grid-column: 1 / 2; padding-top: 0.5em; color: var(--muted); }
.pub__title { grid-column: 2 / 7; font-size: clamp(1.3rem, 2.35vw, 2.5rem); line-height: 1.02; letter-spacing: -0.035em; }
.pub__type { grid-column: 7 / 9; padding-top: 0.5em; color: var(--muted); }
.pub__text { grid-column: 9 / 12; font-size: 0.95rem; line-height: 1.55; }
.pub__link { display: inline-block; margin-top: 14px; border-bottom: 1px solid var(--line); transition: border-color 0.4s; }
.pub__link:hover { border-color: currentColor; }
.pub__thumb {
  grid-column: 12 / 13; justify-self: end; width: 100%; max-width: 112px;
  padding: 0; border: 0; background: none; cursor: pointer; overflow: hidden;
}
.pub__thumb img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform 1.2s var(--ease); }
@media (hover: hover) { .pub__thumb:hover img { transform: scale(1.06); } }

/* ---------- Contact ---------- */
.contact { position: relative; z-index: 1; background: var(--ink); padding: clamp(130px, 17vw, 280px) var(--pad) clamp(80px, 10vw, 160px); }
.contact__grid { align-items: start; }
.contact .vlabel { grid-column: 1 / 2; grid-row: 1 / 4; justify-self: start; }
.contact__kicker {
  grid-column: 3 / 11;
  font-size: clamp(1.45rem, 3.1vw, 3.5rem); line-height: 1.04; letter-spacing: -0.03em;
  text-wrap: balance;
}
.contact__mail {
  grid-column: 3 / -1; justify-self: start;
  position: relative;
  margin-top: clamp(40px, 6vw, 96px);
  font-style: italic;
  font-size: clamp(1.15rem, 4.15vw, 5rem);
  line-height: 1.04; letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}
.contact__mail::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.02em; height: 1px;
  background: currentColor; transform: scaleX(0.1); transform-origin: left;
  transition: transform 1s var(--ease);
}
.contact__mail:hover::after, .contact__mail:focus-visible::after { transform: scaleX(1); }
.contact__links { grid-column: 3 / -1; display: flex; gap: 36px; margin-top: 40px; color: var(--muted); }
.contact__links a:hover { color: var(--fg); }

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 1; background: var(--ink); padding: 0 var(--pad) var(--safe-b); overflow: hidden; }
.site-footer__row a { padding: 4px 0; margin: -4px 0; }
.site-footer__row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap);
  padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted);
}
.site-footer__row a:hover { color: var(--fg); }
.site-footer__row > :last-child { justify-self: end; }
.site-footer__mark {
  font-size: 16.8vw; line-height: 0.74; letter-spacing: -0.06em;
  white-space: nowrap; text-align: center;
  height: 0.6em; margin-top: 3vw;
  color: var(--fg);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 160;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: #0b0a09;
  color: var(--bone);
  opacity: 0; visibility: hidden;
  transition: opacity 0.6s var(--ease), visibility 0s 0.6s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity 0.6s var(--ease); }
.lb__top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 16px;
  padding: 20px var(--pad);
}
.lb__title { font-style: italic; font-size: clamp(1.4rem, 2vw, 2.1rem); line-height: 1; margin-right: 12px; }
.lb__series { color: var(--muted); }
.lb__count { font-variant-numeric: tabular-nums; }
.lb__close { justify-self: end; min-height: 44px; background: none; border: 0; cursor: pointer; padding: 0; }
.lightbox { overscroll-behavior: contain; touch-action: none; }
.lb__arrows { display: none; }
.lb__stage { position: relative; min-height: 0; }
.lb__img {
  position: absolute; top: 0; bottom: 0; left: var(--pad); right: var(--pad);
  width: calc(100% - 2 * var(--pad)); height: 100%; object-fit: contain;
  opacity: 0; transform: scale(0.985);
  transition: opacity 0.6s var(--ease), transform 0.9s var(--ease);
}
.lb__img.is-loaded { opacity: 1; transform: none; }
.lb__nav { position: absolute; top: 0; bottom: 0; width: 50%; background: none; border: 0; padding: 0; cursor: pointer; }
.lb__nav--prev { left: 0; cursor: w-resize; }
.lb__nav--next { right: 0; cursor: e-resize; }
.lb__bottom {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  align-items: end; padding: 20px var(--pad) calc(24px + var(--safe-b));
}
.lb__text { grid-column: 1 / 6; font-size: 0.92rem; line-height: 1.5; color: var(--muted); max-width: 56ch; }
.lb__thumbs { grid-column: 7 / 13; display: flex; justify-content: flex-end; gap: 6px; }
.lb__thumbs button {
  width: 56px; aspect-ratio: 3 / 2; padding: 0; border: 0; background: none; cursor: pointer;
  opacity: 0.35; transition: opacity 0.4s;
}
.lb__thumbs button[aria-current="true"], .lb__thumbs button:hover { opacity: 1; }
.lb__thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Cursor ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 170;
  width: 84px; height: 84px; margin: -42px 0 0 -42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bone); color: var(--ink);
  pointer-events: none;
  opacity: 0; scale: 0.2;
  transition: opacity 0.35s var(--ease), scale 0.5s var(--ease);
}
.cursor span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.cursor.is-on { opacity: 1; scale: 1; }
.has-cursor [data-cursor] { cursor: none; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Legal pages (imprint, privacy) & 404 ---------- */
.legal { padding: clamp(130px, 15vw, 220px) var(--pad) clamp(96px, 12vw, 160px); }
.legal__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; margin-bottom: clamp(48px, 7vw, 104px); }
.legal__head .label { grid-column: 1 / -1; margin-bottom: 20px; }
.legal h1 { grid-column: 1 / 10; font-size: clamp(2.4rem, 6.4vw, 6.4rem); line-height: 0.9; letter-spacing: -0.05em; }
.legal__meta { grid-column: 10 / 13; justify-self: end; text-align: right; color: var(--muted); }
.legal__cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 56px; border-top: 1px solid var(--line); padding-top: 28px; }
.legal__col { grid-column: span 6; min-width: 0; }
.legal__col + .legal__col { padding-left: var(--gap); border-left: 1px solid var(--line); }
.legal__lang { color: var(--muted); margin-bottom: 8px; }
.legal h2 { margin: 40px 0 10px; color: var(--muted); }
.legal h2:first-of-type { margin-top: 12px; }
.legal p, .legal li { max-width: 60ch; font-size: 0.98rem; line-height: 1.6; }
.legal p + p { margin-top: 0.8em; }
.legal ul { margin: 0.6em 0 0; padding-left: 1.1em; }
.legal a { border-bottom: 1px solid var(--line); transition: border-color 0.4s; overflow-wrap: anywhere; }
.legal a:hover { border-color: currentColor; }
.todo { outline: 1px dashed var(--shu); outline-offset: 3px; color: var(--shu); }
.site-nav--legal { grid-column: -2; }
.site-nav--legal a[aria-current="page"]::after { transform: scaleX(1); }

.notfound { min-height: 100vh; min-height: 100svh; display: grid; align-content: end; gap: 28px; padding: 120px var(--pad) calc(48px + var(--safe-b)); position: relative; isolation: isolate; }
.notfound__media { position: absolute; inset: 0; z-index: -1; }
.notfound__media img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.55) saturate(0.9); }
.notfound h1 { font-size: clamp(5rem, 22vw, 18rem); line-height: 0.8; letter-spacing: -0.06em; padding-bottom: 0.08em; }
.notfound p:not(.mono) { font-size: clamp(1.2rem, 2.4vw, 2rem); line-height: 1.2; letter-spacing: -0.02em; max-width: 24ch; }
.notfound a.mono { border-bottom: 1px solid currentColor; justify-self: start; padding: 6px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .index__dek { display: none; }
  .index__title { grid-column: 2 / 10; }
  .index__series { grid-column: 10 / 12; }
  .pub__title { grid-column: 2 / 8; }
  .pub__type { grid-column: 8 / 12; }
  .pub__text { grid-column: 2 / 11; margin-top: 16px; }
  .pub__thumb { grid-column: 12 / 13; grid-row: 1; }
  .chapter__title { grid-column: 1 / -1; }
  .chapter__dek, .bleed__head .chapter__dek { grid-column: 1 / 8; }
  .bleed__head .chapter__title { grid-column: 1 / -1; }
  .interlude__title { grid-column: 1 / -1; }
  .interlude__stocks { grid-column: 1 / 8; }
  .about__cols { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .grid, .spread, .index__head, .index__row, .pubs__head, .pub, .lb__bottom, .interlude__content {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .vlabel { writing-mode: horizontal-tb; transform: none; }
  .brand__name { display: none; }
  .site-nav { display: none; }
  .site-nav.site-nav--legal { display: block; }
  .menu-btn { display: block; }

  .hero__title { font-size: 9vw; }
  .hero__content { bottom: 64px; }
  .hero__foot { grid-template-columns: 1fr auto; }
  .hero__foot .hero__scroll, .hero__foot > :last-child { display: none; }

  .statement .vlabel, .statement__text, .statement__aside { grid-column: 1 / -1; grid-row: auto; }
  .statement__text { text-indent: 0; }
  .statement__aside { gap: 32px; }

  .chapter__kicker, .chapter__title, .chapter__dek,
  .bleed__head .chapter__title, .bleed__head .chapter__dek { grid-column: 1 / -1; }
  .chapter__title { font-size: 14vw; }
  .bleed .pin__inner img, .bleed .pin__inner video { object-position: 58% 50%; }
  .bleed + .spread, .interlude + .sheet { margin-top: 18vh; }
  .interlude__title, .interlude__stocks { grid-column: 1 / -1; }
  .interlude__title { font-size: 12vw; }

  .frame { grid-column: var(--cm, 1 / -1); margin-top: 0; }
  .spread { row-gap: 64px; }
  .frame__note { max-width: none; }

  .index__head .vlabel { grid-column: 1 / -1; margin-bottom: 20px; }
  .index__heading { grid-column: 1 / -1; }
  .index__meta { grid-column: 1 / -1; text-align: left; margin-top: 20px; }
  .index__title { grid-column: 2 / 6; font-size: clamp(1.6rem, 8vw, 2.6rem); }
  .index__series { display: none; }
  .index__count { grid-column: 6 / 7; }
  .index__title { grid-column: 2 / 5; }
  .index__thumb { grid-column: 5 / 7; grid-row: 1; width: 60px; }

  .about__portrait { grid-column: 1 / 6; }
  .about__body { grid-column: 1 / -1; padding-top: 24px; }
  .about__cols { grid-template-columns: 1fr; }
  .facts { gap: 8px 24px; }

  .pubs__head .label, .pubs__heading { grid-column: 1 / -1; justify-self: start; }
  .pubs__heading { margin-top: 20px; }
  .pub__num { grid-column: 1 / 2; }
  .pub__title { grid-column: 2 / 6; }
  .pub__type { grid-column: 2 / 6; margin-top: 10px; padding-top: 0; }
  .pub__text { grid-column: 2 / -1; }
  .pub__thumb { grid-column: 6 / 7; max-width: 64px; }

  .contact .vlabel, .contact__kicker, .contact__mail, .contact__links { grid-column: 1 / -1; grid-row: auto; }
  .contact .vlabel { margin-bottom: 28px; }
  .contact__links { flex-wrap: wrap; gap: 20px 28px; }
  .site-footer__row { grid-template-columns: 1fr 1fr; row-gap: 10px; }
  .site-footer__row > :nth-child(2n) { justify-self: end; }

  .legal h1, .legal__meta { grid-column: 1 / -1; justify-self: start; text-align: left; }
  .legal__meta { margin-top: 20px; }
  .legal__col { grid-column: 1 / -1; }
  .legal__col + .legal__col { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 28px; }
  .lb__top { grid-template-columns: 1fr auto; }
  .lb__count { grid-column: 1 / 2; grid-row: 2; }
  .lb__close { grid-row: 1; grid-column: 2; }
  .lb__text { grid-column: 1 / -1; }
  .lb__thumbs { display: none; }
}

/* ---------- Touch devices ---------- */
@media (hover: none) {
  /* a static, non-blended grain keeps scrolling smooth on phones */
  .grain { animation: none; mix-blend-mode: normal; opacity: 0.045; inset: 0; }
  .lb__arrows {
    display: flex; justify-content: space-between; grid-column: 1 / -1; margin-top: 16px;
  }
  .lb__arrows button { min-height: 44px; min-width: 88px; padding: 0; background: none; border: 0; cursor: pointer; text-align: left; }
  .lb__arrows button:last-child { text-align: right; }
}

/* ---------- Short landscape screens (phones turned sideways) ---------- */
@media (max-height: 560px) and (orientation: landscape) {
  .pin { min-height: 0; }
  .site-header { padding-top: 12px; padding-bottom: 12px; }
  .hero__title { font-size: 5.2vw; }
  .hero__content { bottom: calc(52px + var(--safe-b)); }
  .hero__foot { bottom: calc(14px + var(--safe-b)); }
  .chapter__kicker { display: none; }
  .bleed__head { row-gap: 12px; padding-bottom: 16px; }
  .interlude__content { row-gap: 12px; bottom: 16px; }
  .menu { justify-content: flex-start; padding-top: 72px; overflow-y: auto; }
  .menu nav a { font-size: 2.1rem; }
  .lb__thumbs { display: none; }
  .bleed__head .chapter__title, .interlude__title { font-size: 6.4vw; }
  .bleed__head .chapter__dek, .interlude__stocks p { display: none; }
  .interlude__stocks li { padding: 4px 0; }
  .lb__top { padding-top: 8px; padding-bottom: 8px; }
  .lb__bottom { padding-top: 8px; }
  .lb__text { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
  .grain, .filmstrip__track { animation: none; }
  .living { display: none; }
}
