/* ==========================================================================
   Chapter pages: shared long-form layout, plus one signature moment each.
   Building From Scratch - photos develop from negative to positive.
   The CineLove Chapter  - the planning process as numbered steps to flip through.
   Beyond the Wedding    - a trail of frames follows the cursor per project.
   ========================================================================== */

/* --- Hero -------------------------------------------------------------- */

.ch-hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
}

.ch-hero-media {
  position: absolute;
  inset: 0;
  margin: 0;
}

.ch-hero-media img,
.ch-hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ch-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(11, 11, 10, 0.94) 6%, rgba(11, 11, 10, 0.2) 55%, rgba(11, 11, 10, 0.5)),
    linear-gradient(to right, rgba(11, 11, 10, 0.5), transparent 60%);
}

.ch-numeral {
  position: absolute;
  right: var(--gutter);
  top: clamp(5rem, 12vh, 7rem);
  font-family: var(--display-em);
  font-style: italic;
  font-size: clamp(8rem, 24vw, 24rem);
  line-height: 0.8;
  color: rgba(236, 232, 223, 0.16);
  pointer-events: none;
}

.ch-hero-copy {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(2.5rem, 8vh, 5rem);
  max-width: 62rem;
}

.ch-hero-copy .dc-h1 {
  font-size: clamp(3rem, 8vw, 8rem);
}

.ch-hero-intro {
  max-width: 34rem;
  margin: 1.5rem 0 0;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--paper-soft);
}

.ch-hero-intro em {
  color: var(--paper);
}

/* --- Text blocks -------------------------------------------------------- */

.ch-statement {
  max-width: 1300px;
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: clamp(2rem, 5vw, 5rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.ch-statement em {
  color: var(--accent);
  font-size: 1.08em;
}

.ch-lead {
  max-width: 44rem;
  margin: 0 0 1.4rem;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.55;
  color: var(--paper);
}

.ch-narrow {
  max-width: 44rem;
}

.ch-narrow p {
  color: var(--paper-soft);
}

.ch-head {
  max-width: 60rem;
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}

.ch-head .dc-h2 {
  font-size: clamp(2.2rem, 5vw, 5rem);
}

.ch-head > p:last-child:not(.dc-label) {
  max-width: 36rem;
  margin: 1.2rem 0 0;
  color: var(--paper-soft);
}

.ch-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 4rem);
  max-width: 1100px;
}

.ch-cols p {
  margin: 0 0 1.2em;
  color: var(--paper-soft);
}

.ch-cols em {
  color: var(--paper);
  font-size: 1.08em;
}

.ch-kicker {
  margin: 1.6rem 0 0.5rem !important;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent) !important;
}

.ch-kicker:first-child {
  margin-top: 0 !important;
}

@media (max-width: 760px) {
  .ch-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Feature split: image and copy side by side ----------------------- */

.ch-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
}

.ch-split.is-reverse .ch-split-media {
  order: 2;
}

.ch-split-media {
  margin: 0;
  overflow: hidden;
}

.ch-split-media img {
  width: 100%;
  height: auto;
  max-height: 82vh;
  object-fit: cover;
}

.ch-split-copy .dc-h2 {
  font-size: clamp(2rem, 3.8vw, 3.6rem);
}

.ch-split-copy p {
  color: var(--paper-soft);
}

@media (max-width: 860px) {
  .ch-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .ch-split.is-reverse .ch-split-media {
    order: 0;
  }
}

/* --- Grids -------------------------------------------------------------- */

.ch-trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ch-trio figure {
  margin: 0;
  overflow: hidden;
}

.ch-trio img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.ch-ig {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ch-ig img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

@media (max-width: 600px) {
  .ch-trio {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ch-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ch-tags li {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--paper-faint);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-soft);
}

.ch-note {
  max-width: 1100px;
  margin: 0;
  font-family: var(--display-em);
  font-style: italic;
  font-size: clamp(1.6rem, 3.4vw, 3rem);
  line-height: 1.2;
  color: var(--paper);
}

.ch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

/* Role list (CineLove) */
.ch-roles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--paper-faint);
}

.ch-role {
  padding: 1.8rem 1.6rem 2rem 0;
  border-bottom: 1px solid var(--paper-faint);
}

.ch-role .ch-kicker {
  margin: 0 0 0.8rem !important;
}

.ch-role h3 {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  letter-spacing: -0.015em;
}

.ch-role p {
  margin: 0;
  color: var(--paper-soft);
}

@media (max-width: 860px) {
  .ch-roles {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Final outputs: a film and featured frames */
.ch-output {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.ch-output.is-wide {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.ch-output-stack {
  display: grid;
  gap: 16px;
}

.ch-media-box {
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.ch-media-box.is-16x9 {
  aspect-ratio: 16 / 9;
}

.ch-media-box.is-reel {
  aspect-ratio: 4 / 5;
}

.ch-media-meta {
  margin-top: 0.8rem;
}

.ch-media-meta .ch-kicker {
  margin: 0 0 0.3rem !important;
}

.ch-media-meta h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.25rem;
}

@media (max-width: 860px) {
  .ch-output,
  .ch-output.is-wide {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ch-figure {
  margin: 0;
}

.ch-figure img {
  width: 100%;
}

.ch-figure figcaption {
  margin-top: 0.8rem;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--paper-dim);
}

/* ===================================================================
   Building From Scratch: photos develop from negative to positive
   =================================================================== */

.dc-anim [data-develop] img {
  filter: invert(var(--neg, 1)) sepia(calc(var(--neg, 1) * 0.6)) contrast(calc(1 + var(--neg, 1) * 0.1));
}

/* ===================================================================
   The CineLove Chapter: the process as a production folder.
   Numbered steps run sideways; open any sheet to read it full size.
   =================================================================== */

.ch-steps {
  padding-top: clamp(2rem, 5vh, 3rem);
  overflow: hidden;
}

.ch-steps-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.6rem;
}

.ch-steps-head .dc-label {
  margin-bottom: 0.5rem;
}

.ch-steps-sub {
  max-width: 34rem;
  margin: 0;
  color: var(--paper-soft);
}

.ch-steps-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ch-steps-count {
  margin-right: 0.6rem;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.ch-steps-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--paper-faint);
  border-radius: 50%;
  background: none;
  font-size: 16px;
  color: var(--paper);
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s, opacity 0.3s;
}

.ch-steps-arrow:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.ch-steps-arrow:disabled {
  opacity: 0.3;
  cursor: default;
  background: none;
  color: var(--paper);
  border-color: var(--paper-faint);
}

.ch-steps-track {
  display: flex;
  gap: clamp(14px, 2vw, 24px);
  margin: 0 calc(-1 * var(--gutter));
  padding: 0.5rem var(--gutter) 1.5rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
  cursor: grab;
}

.ch-steps-track::-webkit-scrollbar {
  display: none;
}

.ch-steps-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.ch-step {
  flex: none;
  width: clamp(250px, 30vw, 400px);
  scroll-snap-align: start;
}

/* The sheet sits on a quiet board so every page reads at the same size */
.ch-step-sheet {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 16px;
  border: 1px solid var(--paper-faint);
  background: var(--ink-2);
  cursor: zoom-in;
  transition: border-color 0.4s, background 0.4s;
}

.ch-step-sheet img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8);
  transition: transform 0.8s var(--ease);
  pointer-events: none;
}

.ch-step-sheet:hover {
  border-color: rgba(214, 161, 92, 0.5);
  background: var(--ink-3);
}

.ch-step-sheet:hover img {
  transform: scale(1.03);
}

.ch-step-tag {
  margin: 1rem 0 0.4rem;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-soft);
}

.ch-step-tag span {
  color: var(--accent);
}

.ch-step-cap {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--paper-dim);
}

.ch-steps-progress {
  height: 1px;
  background: var(--paper-faint);
}

.ch-steps-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.2s linear;
}

@media (max-width: 600px) {
  .ch-step {
    width: 78vw;
  }

  .ch-steps-arrow {
    width: 40px;
    height: 40px;
  }
}

/* Full-size reading view for one sheet */
.ch-sheetbox-stage {
  flex: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 0;
  padding: 0 var(--gutter) var(--gutter);
}

.ch-sheetbox-stage figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-height: 0;
  margin: 0;
}

.ch-sheetbox-stage img {
  max-width: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
}

.ch-sheetbox-stage figcaption {
  max-width: 40rem;
  text-align: center;
  color: var(--paper-soft);
}

@media (max-width: 600px) {
  .ch-sheetbox-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .ch-sheetbox-stage .ch-steps-arrow {
    display: none;
  }
}

/* ===================================================================
   Beyond the Wedding: projects with a trail of frames
   =================================================================== */

.ch-project {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.ch-project.is-reverse .ch-project-frame {
  order: -1;
}

.ch-project-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: clamp(2.6rem, 5.4vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}

.ch-meta {
  margin: 1rem 0 2rem;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.ch-project-frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  cursor: pointer;
}

.ch-project-frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 1.4s var(--ease);
}

.ch-project-frame:hover img {
  transform: scale(1.04);
}

.ch-project-frame .dc-btn {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(11, 11, 10, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

@media (max-width: 860px) {
  .ch-project {
    grid-template-columns: minmax(0, 1fr);
  }

  .ch-project.is-reverse .ch-project-frame {
    order: 0;
  }
}

/* The frames that follow the cursor */
.ch-trail {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
}

.ch-trail img {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(140px, 13vw, 220px);
  height: auto;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
  will-change: transform, opacity;
}

/* Full-screen viewer for a project's photos */
.ch-viewer-track {
  flex: 1;
  display: flex;
  gap: 12px;
  align-items: center;
  overflow-x: auto;
  overscroll-behavior: contain;
  scroll-snap-type: x mandatory;
  padding: 0 var(--gutter) var(--gutter);
  cursor: grab;
}

.ch-viewer-track img {
  flex: none;
  height: min(78vh, 900px);
  width: auto;
  scroll-snap-align: center;
  background: var(--ink-2);
}

@media (max-width: 760px) {
  .ch-viewer-track img {
    height: auto;
    width: 86vw;
  }
}

.ch-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 900px;
}

@media (max-width: 600px) {
  .ch-feed {
    grid-template-columns: minmax(0, 1fr);
  }
}
