/* ==========================================================================
   Journeyman — design proposal
   1. Tokens   2. Base   3. Type   4. Header   5. Sections   6. Gallery
   7. Lightbox   8. Motion
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */

@font-face {
  font-family: "Noe Display";
  src: url("../fonts/NoeDisplay-Black.woff2") format("woff2"),
       url("../fonts/NoeDisplay-Black.woff") format("woff");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #11110d;
  --bg-raised: #1b1b15;
  --paper: #f3efe6;
  --muted: #a6a294;
  --peach: #df7266;
  --peach-light: #ec8f84;
  --rule: rgb(243 239 230 / 0.14);

  --font-display: "Noe Display", Georgia, serif;
  --font-italic: "Cardo", Garamond, Baskerville, Georgia, serif;
  --font-text: "baskerville-urw", Baskerville, "Libre Baskerville", Georgia, serif;
  --font-ui: "proxima-nova", "Proxima Nova", "Avenir Next", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --section: clamp(96px, 16vw, 220px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* 2. Base ------------------------------------------------------------------ */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: clamp(17px, 1.15vw, 19px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; height: auto; }

[hidden] { display: none !important; }

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

:focus-visible { outline: 1px solid var(--peach); outline-offset: 4px; }

.wrap { padding-inline: var(--gutter); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* 3. Type ------------------------------------------------------------------ */

.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.86;
  letter-spacing: -0.005em;
}

.display em {
  font-family: var(--font-italic);
  font-weight: 400;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
}

.label {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  margin: 0;
  font-family: var(--font-italic);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(26px, 2.8vw, 44px);
  line-height: 1.14;
}

.prose p { max-width: 34em; margin: 1.2em 0 0; color: rgb(243 239 230 / 0.82); }

.link-arrow {
  display: inline-flex; gap: 0.75em; align-items: center;
  font-family: var(--font-ui); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
  border-bottom: 1px solid var(--rule); padding-bottom: 6px;
  transition: border-color 0.4s var(--ease), gap 0.4s var(--ease), color 0.4s var(--ease);
}
.link-arrow > span { color: var(--peach); }
.link-arrow:hover { border-color: var(--peach); color: var(--peach); gap: 1.25em; }

/* Call to action: solid peach */
.cta {
  display: inline-flex; gap: 0.9em; align-items: center;
  padding: 16px 26px; border-radius: 999px;
  background: var(--peach); color: var(--bg);
  font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  transition: background-color 0.4s var(--ease), gap 0.4s var(--ease), transform 0.4s var(--ease);
}
.cta:hover { background: var(--peach-light); gap: 1.4em; }
.cta:active { transform: scale(0.98); }

/* 4. Header ---------------------------------------------------------------- */

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  transition: background-color 0.5s var(--ease), padding 0.5s var(--ease);
}
.site-header.is-scrolled {
  background: rgb(17 17 13 / 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding-block: 14px;
}

.logo { display: block; width: clamp(104px, 9vw, 132px); color: var(--paper); transition: color 0.4s var(--ease); }
.logo:hover { color: var(--peach); }
.logo svg { display: block; width: 100%; height: auto; }

.nav { display: flex; gap: clamp(20px, 3vw, 44px); }
.nav a {
  font-family: var(--font-ui); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  position: relative; padding-block: 4px;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--peach); transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

.menu-toggle {
  display: none; background: none; border: 0; color: var(--paper); cursor: pointer;
  font-family: var(--font-ui); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
}

/* 5. Sections -------------------------------------------------------------- */

/* Hero: portrait on stage, words around it */
.hero { position: relative; overflow: hidden; padding-top: clamp(64px, 8svh, 96px); }
.hero__stage { position: relative; width: min(50vw, 62svh, 900px); margin-inline: auto; }
.hero__portrait { position: relative; z-index: 1; aspect-ratio: 1200 / 1593; overflow: hidden; }
.hero__photo { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__particles {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  width: 100%; height: 100%; /* a canvas keeps its pixel size unless told otherwise */
  -webkit-mask-image: linear-gradient(#000 78%, transparent);
  mask-image: linear-gradient(#000 78%, transparent);
}
.hero__portrait img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.1); }

.hero__title { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
/* overflow hides the words before they slide up; the padding leaves room for descenders (g, y) */
.hero__word { position: absolute; overflow: hidden; white-space: nowrap; padding-bottom: 0.35em; margin-bottom: -0.3em; }
.hero__word > span { display: block; transform: translateY(105%); }
.hero__word--1 { top: 12%; right: 70%; font-size: min(6.5vw, 10svh, 116px); }
.hero__word--2 { top: 56%; left: 86%; font-size: min(5vw, 7.5svh, 88px); line-height: 0.9; }
.hero__word--2 em { color: var(--peach); }
.hero__word--3 { bottom: 5%; left: 64%; font-size: min(6.5vw, 10svh, 116px); }

.hero__meta {
  display: flex; justify-content: space-between; align-items: end; gap: 24px;
  margin-top: 16px; padding-block: 18px; border-top: 1px solid var(--rule);
}
.scroll-cue { display: inline-flex; align-items: center; gap: 12px; }
.scroll-cue::after { content: ""; width: 1px; height: 36px; background: var(--paper); transform-origin: top; animation: cue 2.4s var(--ease) infinite; }

/* Intro */
.intro {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 var(--gutter);
  padding-block: var(--section);
}
.intro__mark { grid-column: 1 / span 4; align-self: start; }
.intro__text { grid-column: 6 / span 7; }
.intro__text .lede { margin-block: 28px 12px; }

.mark {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 1; background: var(--peach); color: var(--paper);
  display: grid; place-content: center; text-align: center;
  font-size: clamp(48px, 6.6vw, 104px);
}
/* the photograph becomes a peach duotone: greyscale, multiplied onto the peach */
.mark__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1;
  filter: grayscale(1) brightness(1.5) contrast(1.35); mix-blend-mode: multiply;
  transform: scale(1.06); transition: transform 2.4s var(--ease);
}
.mark:hover .mark__img { transform: scale(1); }
.mark__text { margin: 0; }
.mark em { display: block; font-size: 0.62em; line-height: 0.9; margin: 0.06em 0; }

/* Contents */
.contents { padding-bottom: var(--section); }
.contents__head { display: flex; justify-content: space-between; align-items: end; padding-bottom: 20px; }
.contents__head--aside { margin-top: clamp(72px, 10vw, 140px); }
.toc { list-style: none; margin: 0; padding: 0; counter-reset: chapter; }
.toc a {
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 24px;
  padding-block: clamp(18px, 2.4vw, 32px); border-top: 1px solid var(--rule);
}
.toc li:last-child a { border-bottom: 1px solid var(--rule); }
.toc__num { font-family: var(--font-ui); font-size: 13px; letter-spacing: 0.16em; color: var(--muted); transition: color 0.4s var(--ease); }
.toc__title { font-size: clamp(34px, 5.6vw, 88px); transition: transform 0.6s var(--ease), color 0.4s var(--ease); }
.toc__count { font-family: var(--font-ui); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.toc__thumb { display: none; }
.toc a:hover .toc__title { transform: translateX(14px); }
.toc a:hover .toc__num { color: var(--peach); }

.toc-preview {
  position: fixed; left: 0; top: 0; z-index: 40; width: clamp(220px, 20vw, 320px); aspect-ratio: 4 / 5;
  pointer-events: none; opacity: 0; overflow: hidden;
  transition: opacity 0.35s var(--ease);
}
.toc-preview.is-visible { opacity: 1; }
.toc-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Feature */
.feature {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 var(--gutter); align-items: center;
  padding-bottom: var(--section);
}
.feature__text { grid-column: 1 / span 6; position: relative; z-index: 2; }
.feature__title { font-size: clamp(44px, 5.8vw, 96px); margin-block: 22px 32px; }
.feature__text .lede { font-size: clamp(22px, 2vw, 30px); max-width: 18em; margin-bottom: 36px; }
.feature__media { grid-column: 7 / span 5; overflow: hidden; }
.feature__media img { width: 100%; transform: scale(1.12); }

/* Showcase: one photograph at a time, full width, cross-fading */
.showcase { padding-bottom: var(--section); }
.showcase__head, .showcase__controls { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.showcase__head { padding-bottom: 20px; }
.showcase__head h2 { margin: 0; }
.showcase__stage { position: relative; aspect-ratio: 3 / 2; max-height: 86svh; width: 100%; overflow: hidden; background: #000; }
.showcase__slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.4s var(--ease); }
.showcase__slide.is-active { opacity: 1; }
.showcase__slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 7s linear; }
.showcase__slide.is-active img { transform: scale(1); }
.showcase__slide figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding-block: 80px 28px;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.55));
}
.showcase__slide figcaption a { display: inline-flex; flex-direction: column; gap: 8px; }
.showcase__slide figcaption .label { color: rgb(243 239 230 / 0.75); }
.showcase__slide figcaption .title { font-family: var(--font-italic); font-style: italic; font-size: clamp(26px, 2.6vw, 40px); line-height: 1.1; }
.showcase__slide figcaption a:hover .title { color: var(--peach); }
.showcase__controls { padding-top: 18px; }
.showcase__controls button, .latest__nav button {
  background: none; border: 0; padding: 8px 0; cursor: pointer; color: inherit;
  font-family: var(--font-ui); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  transition: color 0.3s var(--ease);
}
.showcase__controls button:hover { color: var(--peach); }
.showcase__progress { flex: 1; height: 1px; background: var(--rule); position: relative; overflow: hidden; }
.showcase__progress span { position: absolute; inset: 0; background: var(--peach); transform-origin: left; transform: scaleX(0); }
.showcase.is-playing .showcase__progress span { animation: progress var(--slide-time, 6s) linear forwards; }
@keyframes progress { to { transform: scaleX(1); } }

/* Statement: words over a full-bleed photograph */
.statement {
  position: relative; overflow: hidden; display: grid; place-content: center;
  min-height: 75svh; text-align: center;
}
/* show more sky than foreground, and let the dark shore melt into the page */
.statement__media { position: absolute; inset: -12% 0; width: 100%; height: 124%; object-fit: cover; object-position: center 25%; }
.statement::after { content: ""; position: absolute; inset: auto 0 0; height: 22%; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.statement .display { position: relative; z-index: 1; font-size: clamp(52px, 9vw, 150px); }
.statement em { color: var(--peach); }

/* About */
.about {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 var(--gutter); align-items: end;
  padding-block: clamp(56px, 7vw, 110px) var(--section);
}
.about__media { grid-column: 1 / span 5; }
.about__text { grid-column: 7 / span 6; }
.about__title { font-size: clamp(38px, 4.6vw, 76px); margin-block: 20px 8px; }
.about__facts {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px var(--gutter);
  margin: 36px 0 0; padding-top: 24px; border-top: 1px solid var(--rule);
}
.about__facts dd { margin: 4px 0 0; font-family: var(--font-italic); font-style: italic; font-size: 20px; }
.about__cta { margin: 40px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 36px; }

/* Latest: a light section near the end, like the back pages of a magazine */
.latest {
  --rule: rgb(17 17 13 / 0.14);
  background: var(--paper); color: var(--bg);
  padding-block: var(--section);
}
.latest .label { color: #6f6b60; }
.latest__head { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-bottom: clamp(32px, 4vw, 56px); }
.latest__title { font-size: clamp(40px, 5.4vw, 92px); margin-top: 16px; }
.latest__title em { color: var(--peach); }
.latest__nav { display: flex; gap: 8px; }
.latest__nav button {
  width: 52px; height: 52px; padding: 0; border: 1px solid var(--rule); border-radius: 50%;
  font-size: 18px; letter-spacing: 0;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.latest__nav button:hover { background: var(--peach); border-color: var(--peach); color: var(--paper); }
.latest__nav button:disabled { opacity: 0.3; pointer-events: none; }
.latest__track {
  list-style: none; margin: 0; padding: 0 var(--gutter);
  display: flex; gap: clamp(16px, 2vw, 28px);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  scrollbar-width: none; cursor: grab;
}
.latest__track::-webkit-scrollbar { display: none; }
.latest__track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.latest__track.is-dragging a { pointer-events: none; }
.latest__card { flex: 0 0 clamp(240px, 24vw, 360px); scroll-snap-align: start; }
.latest__frame { aspect-ratio: 4 / 5; overflow: hidden; background: #e4dfd3; }
.latest__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); -webkit-user-drag: none; user-select: none; }
.latest__card a:hover img { transform: scale(1.04); }
.latest__card .label { margin-top: 14px; }
.latest__card .title { margin: 4px 0 0; font-family: var(--font-italic); font-style: italic; font-size: 22px; }

/* Contact: part of the light back pages */
.contact {
  --rule: rgb(17 17 13 / 0.14);
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 48px var(--gutter);
  background: var(--paper); color: var(--bg);
  padding: clamp(64px, 8vw, 120px) var(--gutter) var(--section);
  border-top: 1px solid var(--rule);
}
.contact .label { color: #6f6b60; }
.contact__intro { grid-column: 1 / span 5; }
.contact__title { font-size: clamp(44px, 6vw, 100px); margin-block: 16px 24px; }
.contact__title em { color: var(--peach); }
.contact .lede { font-size: clamp(22px, 2vw, 30px); color: rgb(17 17 13 / 0.82); }
.contact__offers { margin: 36px 0 0; display: grid; gap: 18px; padding-top: 24px; border-top: 1px solid var(--rule); }
.contact__offers dd { margin: 4px 0 0; font-family: var(--font-italic); font-style: italic; font-size: 20px; }
.contact__mail { margin: 32px 0 0; font-family: var(--font-ui); font-size: 14px; letter-spacing: 0.08em; }
.contact__mail a { border-bottom: 1px solid var(--rule); padding-bottom: 4px; transition: border-color 0.3s var(--ease), color 0.3s var(--ease); }
.contact__mail a:hover { color: var(--peach); border-color: var(--peach); }

.contact__form { grid-column: 7 / span 6; display: grid; gap: 26px; align-content: start; }
.contact__topics { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.contact__topics legend { margin-bottom: 14px; padding: 0; }
.contact__topics label { cursor: pointer; }
.contact__topics input { position: absolute; opacity: 0; pointer-events: none; }
.contact__topics span {
  display: inline-block; padding: 10px 18px; border: 1px solid var(--rule); border-radius: 999px;
  font-family: var(--font-ui); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.contact__topics label:hover span { border-color: var(--bg); }
.contact__topics input:checked + span { background: var(--bg); border-color: var(--bg); color: var(--paper); }
.contact__topics input:focus-visible + span { outline: 1px solid var(--peach); outline-offset: 3px; }
.field { display: grid; gap: 8px; }
.field input, .field textarea {
  width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0;
  background: transparent; color: var(--bg); font-family: var(--font-text); font-size: 18px;
  transition: border-color 0.3s var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--peach); }
.field.is-invalid input, .field.is-invalid textarea { border-color: #b3261e; }
.contact__send { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.contact .cta { border: 0; cursor: pointer; }
.contact__status { margin: 0; font-family: var(--font-italic); font-style: italic; font-size: 18px; }

.chapter-hero__cta { margin: clamp(32px, 4vw, 48px) 0 0; }
.lightbox__ask { color: var(--peach) !important; transition: opacity 0.3s var(--ease); }
.lightbox__ask:hover { opacity: 0.75; }
.lightbox__meta { display: flex; gap: 28px; align-items: baseline; }

/* Footer */
.site-footer__social { display: flex; gap: 28px; margin: 0; }
.site-footer__social a { transition: color 0.3s var(--ease); }
.site-footer__social a:hover { color: var(--peach); }
.site-footer { padding: var(--section) var(--gutter) 40px; text-align: center; border-top: 1px solid var(--rule); }
.site-footer__logo { width: min(560px, 72vw); margin-inline: auto; color: var(--peach); }
.site-footer__logo svg { width: 100%; height: auto; display: block; }
.site-footer__tagline { margin-top: 26px; font-size: clamp(20px, 2vw, 30px); }
.site-footer__row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  margin-top: clamp(64px, 10vw, 140px); padding-top: 20px; border-top: 1px solid var(--rule);
}

/* 6. Gallery page ---------------------------------------------------------- */

.chapter-hero { padding: clamp(140px, 24vh, 260px) var(--gutter) clamp(64px, 10vw, 140px); }
.chapter-hero__title { font-size: clamp(56px, 11vw, 190px); margin-block: 24px clamp(32px, 5vw, 64px); }
.chapter-hero__deck { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 var(--gutter); align-items: end; }
.chapter-hero__deck .lede { grid-column: 6 / span 7; font-size: clamp(22px, 2.2vw, 34px); }
.chapter-hero__deck .label { grid-column: 1 / span 4; }

.gallery {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: clamp(56px, 9vw, 140px) var(--gutter);
  padding: 0 var(--gutter) var(--section);
}
.photo { margin: 0; cursor: zoom-in; }
.photo__frame { overflow: hidden; }
.photo img, .photo video { width: 100%; transition: transform 1.4s var(--ease); }
.photo:hover img, .photo:hover video { transform: scale(1.03); }
.photo figcaption { display: flex; gap: 14px; margin-top: 14px; }
.photo figcaption .title { font-family: var(--font-italic); font-style: italic; font-size: 20px; color: var(--paper); letter-spacing: 0; text-transform: none; }

/* Layout recipes: column placement for a magazine rhythm */
.c-1-5   { grid-column: 1 / span 5; }
.c-2-5   { grid-column: 2 / span 5; }
.c-3-8   { grid-column: 3 / span 8; }
.c-1-4   { grid-column: 1 / span 4; }
.c-5-4   { grid-column: 5 / span 4; }
.c-6-4   { grid-column: 6 / span 4; }
.c-7-5   { grid-column: 7 / span 5; }
.c-8-5   { grid-column: 8 / span 5; }
.c-9-4   { grid-column: 9 / span 4; }
.c-1-6   { grid-column: 1 / span 6; }
.c-2-4   { grid-column: 2 / span 4; }
.c-1-8   { grid-column: 1 / span 8; }
.c-2-10  { grid-column: 2 / span 10; }
.c-3-10  { grid-column: 3 / span 10; }
.c-4-6   { grid-column: 4 / span 6; }
.c-7-6   { grid-column: 7 / span 6; }
.c-full  { grid-column: 1 / -1; }
.push    { margin-top: clamp(80px, 14vw, 240px); }

/* AI Experiments: chapter index and chapter heads */
.chapter-index { margin-top: clamp(56px, 8vw, 110px); border-top: 1px solid var(--rule); }
.chapter-index ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 var(--gutter);
}
.chapter-index a {
  display: flex; align-items: baseline; gap: 16px; padding-block: 18px;
  border-bottom: 1px solid var(--rule); transition: color 0.4s var(--ease);
}
.chapter-index a:hover { color: var(--peach); }
.chapter-index .label { width: 2.5em; }
.chapter-index__title { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: clamp(20px, 1.8vw, 28px); line-height: 1; }
.chapter-index__title em { font-family: var(--font-italic); font-weight: 400; text-transform: none; }

.ai-chapter { scroll-margin-top: 80px; }
.ai-chapter__head {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 var(--gutter); align-items: end;
  padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(56px, 8vw, 120px);
  border-top: 1px solid var(--rule);
}
.ai-chapter__head .label { grid-column: 1 / -1; color: var(--peach); }
.ai-chapter__title { grid-column: 1 / span 7; font-size: clamp(44px, 7vw, 120px); margin-top: 16px; }
.ai-chapter__head .lede { grid-column: 8 / span 5; font-size: clamp(20px, 1.8vw, 28px); color: rgb(243 239 230 / 0.82); }

.next-chapter { position: relative; display: block; overflow: hidden; min-height: 80svh; display: grid; place-content: center; text-align: center; }
.next-chapter img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); opacity: 0.45; transition: transform 1.6s var(--ease), opacity 0.8s var(--ease); }
.next-chapter:hover img { transform: scale(1.04); opacity: 0.6; }
.next-chapter > * { position: relative; }
.next-chapter .display { font-size: clamp(46px, 8vw, 130px); margin-top: 20px; }

/* 7. Lightbox -------------------------------------------------------------- */

.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgb(10 10 8 / 0.96); opacity: 0; visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img, .lightbox video { max-width: 92vw; max-height: 84vh; width: auto; transform: scale(0.97); transition: transform 0.7s var(--ease); }
.lightbox.is-open img, .lightbox.is-open video { transform: none; }
.lightbox__caption { position: absolute; bottom: 24px; left: var(--gutter); right: var(--gutter); display: flex; justify-content: space-between; align-items: baseline; }
.lightbox__title { font-family: var(--font-italic); font-style: italic; font-size: 22px; }
.lightbox button {
  position: absolute; background: none; border: 0; color: var(--paper); cursor: pointer;
  font-family: var(--font-ui); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; padding: 16px;
}
.lightbox__close { top: 12px; right: calc(var(--gutter) - 16px); }
.lightbox__prev { left: calc(var(--gutter) - 16px); top: 50%; transform: translateY(-50%); }
.lightbox__next { right: calc(var(--gutter) - 16px); top: 50%; transform: translateY(-50%); }

/* 8. Motion ---------------------------------------------------------------- */

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

.unveil { clip-path: inset(12% 0 12% 0); transition: clip-path 1.6s var(--ease); }
.unveil.is-in { clip-path: inset(0 0 0 0); }

.is-loaded .hero__portrait img { transform: scale(1); transition: transform 3.2s var(--ease); }
.is-loaded .hero__word > span { transform: none; transition: transform 1.3s var(--ease) 0.3s; }
.is-loaded .hero__word--2 > span { transition-delay: 0.45s; }
.is-loaded .hero__word--3 > span { transition-delay: 0.6s; }

/* Particle portrait: the photograph is built grain by grain on a canvas (see particles.js),
   so the <img> stays hidden; without particles the <img> simply fades in */
.js .hero__portrait { transition: opacity 2s var(--ease), filter 2s var(--ease); }
.js .hero:not(.is-formed):not(.has-particles) .hero__portrait { opacity: 0; filter: blur(14px); }
.has-particles .hero__portrait img { visibility: hidden; }

@keyframes cue {
  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; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .unveil, .hero__word > span, .hero__portrait img { opacity: 1; transform: none; clip-path: none; }
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 820px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
  .site-header.menu-open { -webkit-backdrop-filter: none; backdrop-filter: none; background: transparent; }
  .site-header.menu-open .nav {
    display: flex; flex-direction: column; justify-content: center; gap: 28px;
    position: fixed; inset: 0; z-index: -1; padding: var(--gutter); background: var(--bg);
  }
  .site-header.menu-open .nav a { font-family: var(--font-display); font-weight: 900; font-size: clamp(28px, 9vw, 44px); letter-spacing: 0; white-space: nowrap; }

  .hero { padding-top: 84px; }
  .hero__stage { width: 88vw; }
  .hero__word--1 { top: -2%; right: auto; left: 0; font-size: 11vw; }
  .hero__word--2 { top: 62%; left: 70%; font-size: 8vw; }
  .hero__word--3 { bottom: 0; left: 50%; translate: -50% 0; font-size: 11vw; }

  .intro, .feature, .about, .chapter-hero__deck, .gallery { grid-template-columns: 1fr; }
  .intro__mark, .intro__text, .feature__text, .feature__media, .about__media, .about__text,
  .chapter-hero__deck .lede, .chapter-hero__deck .label { grid-column: 1 / -1; }
  .intro__mark { width: 62%; margin-bottom: 56px; }
  .feature__media { margin-top: 48px; }
  .about__text { margin-top: 40px; }
  .chapter-hero__deck .label { margin-top: 28px; order: 2; }

  .toc a { grid-template-columns: 72px 1fr; gap: 16px; }
  .toc__num, .toc__count { display: none; }
  .toc__thumb { display: block; width: 72px; aspect-ratio: 4 / 5; object-fit: cover; }
  .toc-preview { display: none; }

  .gallery > * { grid-column: 1 / -1; margin-top: 0; }
  .contact { grid-template-columns: 1fr; }
  .contact__intro, .contact__form { grid-column: 1 / -1; }
  .lightbox__meta { flex-direction: column; gap: 6px; align-items: flex-end; }
  .showcase__stage { aspect-ratio: 4 / 5; }
  .latest__card { flex-basis: 72vw; }
  .latest__nav { display: none; }
  .chapter-index ol { grid-template-columns: 1fr; }
  .ai-chapter__head { grid-template-columns: 1fr; }
  .ai-chapter__title, .ai-chapter__head .lede { grid-column: 1 / -1; }
  .ai-chapter__head .lede { margin-top: 20px; }
  .gallery > :nth-child(3n + 2) { width: 82%; margin-left: auto; }
  .gallery > :nth-child(3n) { width: 82%; }
  .hero__meta .label:last-child { display: none; }
}
