/* ═══════════════════════════════════════════════════════════════
   LONGHAND — One wedding, told in paper
   Berry & Sage system · Prata / Newsreader / Archivo
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* palette — Berry & Sage */
  --berry: #8C1F3B;
  --sage:  #A3AD8C;
  --cream: #F7F1E6;
  --blush: #E8C4C9;
  --plum:  #5A2A45;

  /* derived act backgrounds (graded, not raw) */
  --bg-cream: #F7F1E6;
  --bg-blush: #F1DDDB;
  --bg-sage:  #D9DDC6;
  --bg-plum:  #5A2A45;
  --bg-plum-deep: #3A1B2C;

  /* text */
  --ink:      #35232E;   /* plum-black for light acts */
  --ink-soft: #6B5560;
  --paper:    #F7F1E6;   /* text on dark acts */
  --paper-soft: #D9C6CE;

  /* live act variables — tweened by GSAP */
  --bg: var(--bg-cream);
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);

  /* type */
  --f-display: "Prata", serif;
  --f-body: "Newsreader", serif;
  --f-label: "Archivo", sans-serif;

  --fs-display: clamp(2.875rem, 6.5vw, 6.75rem);
  --fs-display2: clamp(2.125rem, 4.8vw, 4.5rem);
  --fs-voice: clamp(1.625rem, 3.2vw, 2.625rem);
  --fs-lede: clamp(1.125rem, 1.55vw, 1.375rem);
  --fs-copy: clamp(1.0625rem, 1.3vw, 1.1875rem);
  --fs-label: 0.6875rem;

  --track: 0.22em;
  --gutter: clamp(1.25rem, 6vw, 5.5rem);
  --hairline: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}

/* ── base ─────────────────────────────────────────────────────── */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: var(--fs-copy);
  line-height: 1.75;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }

:focus-visible {
  outline: 2px solid var(--berry);
  outline-offset: 4px;
  border-radius: 1px;
}
[data-act="plum"] :focus-visible,
[data-act="plum-deep"] :focus-visible { outline-color: var(--blush); }

::selection { background: var(--berry); color: var(--cream); }

/* ── the ink thread ───────────────────────────────────────────── */

.thread {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}
.thread-path {
  stroke: var(--berry);
  stroke-width: 1.25;
  stroke-linecap: round;
  opacity: 0.85;
}

/* content that the thread should pass behind */
.frame, .ch-figure, .overture-figure, .enquire-figure,
.band-frame, .display, .display-2, .ch-voice, .band-line { position: relative; z-index: 4; }
.site-head { z-index: 10; }

/* ── header ───────────────────────────────────────────────────── */

.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: clamp(1.1rem, 2.5vh, 1.75rem) var(--gutter);
  color: var(--fg);
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}
.site-head.is-hidden {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}
.wordmark {
  font-family: var(--f-display);
  font-size: 1.1875rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.head-right { display: flex; align-items: baseline; gap: 2.25rem; }
.head-label {
  font-family: var(--f-label);
  font-size: var(--fs-label);
  letter-spacing: var(--track);
  text-transform: uppercase;
  opacity: 0.72;
}
.head-enquire {
  font-family: var(--f-label);
  font-size: var(--fs-label);
  letter-spacing: var(--track);
  text-transform: uppercase;
  padding-bottom: 0.35em;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  transition: background-size 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.head-enquire:hover { background-size: 32% 1px; }

/* ── shared type roles ────────────────────────────────────────── */

.eyebrow, .ch-time, .plate-note, .ch-spec, .enquire-meta, .colophon-note, .colophon-fine {
  font-family: var(--f-label);
  font-size: var(--fs-label);
  letter-spacing: var(--track);
  text-transform: uppercase;
}

.display {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: 1.04;
  letter-spacing: -0.01em;
}
.display-2 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--fs-display2);
  line-height: 1.08;
  letter-spacing: -0.005em;
}
.display em, .display-2 em { font-family: var(--f-body); font-weight: 400; }

.mask { display: block; overflow: hidden; }
.mask-inner { display: block; }

.lede {
  font-size: var(--fs-lede);
  line-height: 1.65;
  max-width: 34em;
  color: var(--fg);
}
.lede em, .ch-copy em { color: color-mix(in srgb, var(--fg) 88%, var(--berry)); }

.ch-copy { max-width: 33em; }
.ch-copy + .ch-copy { margin-top: 1.4em; }

.ch-spec {
  margin-top: 2.75rem;
  padding-top: 1.1rem;
  border-top: var(--hairline);
  opacity: 0.78;
  letter-spacing: 0.18em;
}

/* museum caption under every plate */
.plate-note {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: var(--hairline);
  opacity: 0.78;
  letter-spacing: 0.18em;
}

/* image frames */
.frame {
  overflow: hidden;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
}
.frame img { transform: scale(1.08); will-change: transform; }
.frame--round {
  border-radius: 50%;
  aspect-ratio: 1;
}
.frame--round img { transform: none; }

/* ── overture ─────────────────────────────────────────────────── */

.overture {
  min-height: 100svh;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 2rem;
  align-items: center;
  padding: clamp(7rem, 16vh, 10rem) var(--gutter) clamp(4rem, 9vh, 7rem);
}
.overture-text { grid-column: 1 / 7; }
.overture .eyebrow { margin-bottom: clamp(1.75rem, 4vh, 3rem); opacity: 0.6; }
.overture .display { margin-bottom: clamp(1.75rem, 4vh, 2.75rem); }
.overture .lede { margin-bottom: clamp(2.5rem, 7vh, 4.5rem); }

.thread-origin { color: var(--berry); }

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  font-family: var(--f-label);
  font-size: var(--fs-label);
  letter-spacing: var(--track);
  text-transform: uppercase;
}
.cue-rule {
  width: 4.5rem; height: 1px;
  background: currentColor;
  opacity: 0.4;
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.scroll-cue:hover .cue-rule { transform: scaleX(1.45); }
.cue-where { color: var(--berry); }

.overture-figure {
  grid-column: 8 / 13;
  align-self: end;
  margin-top: 8vh;
}
.overture-figure .frame { aspect-ratio: 4 / 5; }

/* ── the line band ────────────────────────────────────────────── */

.band { padding: clamp(5rem, 12vh, 9rem) 0 clamp(4rem, 10vh, 7rem); }
.band-frame {
  height: clamp(18rem, 52vh, 34rem);
  overflow: hidden;
}
.band-frame img { transform: scale(1.1); will-change: transform; }
.band-line {
  font-size: var(--fs-voice);
  font-family: var(--f-body);
  text-align: center;
  margin-top: clamp(2.5rem, 6vh, 4rem);
  padding: 0 var(--gutter);
}

/* ── chapters ─────────────────────────────────────────────────── */

.chapter { padding: clamp(6rem, 16vh, 11rem) var(--gutter); }

.ch-head { margin-bottom: clamp(3.5rem, 9vh, 6.5rem); max-width: 1600px; }
.ch-head--right { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }

.ch-time {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  color: var(--berry);
  margin-bottom: 1.5rem;
}
[data-act="plum"] .ch-time, [data-act="plum-deep"] .ch-time { color: var(--blush); }
.ch-rule { width: 3.25rem; height: 1px; background: currentColor; opacity: 0.55; }
.ch-time--center { justify-content: center; display: flex; }

.ch-body {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 2rem;
  align-items: start;
}

/* chapter I — overlap composition */
.ch-body--one .ch-figure--main { grid-column: 1 / 7; grid-row: 1; }
.ch-body--one .ch-figure--main .frame { aspect-ratio: 3 / 4; }
.ch-body--one .ch-text { grid-column: 8 / 13; grid-row: 1; padding-top: 6vh; }
.ch-body--one .ch-figure--detail {
  grid-column: 5 / 9;
  grid-row: 2;
  margin-top: clamp(-8rem, -12vh, -4rem);
  z-index: 5;
}
.ch-body--one .ch-figure--detail .frame { aspect-ratio: 1; box-shadow: 0 30px 80px -30px rgba(53, 35, 46, 0.35); }

/* chapter II — text left, image low right */
.ch-body--two .ch-text { grid-column: 2 / 6; padding-top: 4vh; }
.ch-body--two .ch-figure--main { grid-column: 7 / 13; margin-top: 10vh; }
.ch-body--two .ch-figure--main .frame { aspect-ratio: 4 / 5; }

.ch-voice {
  font-size: var(--fs-voice);
  text-align: center;
  margin-top: clamp(6rem, 14vh, 10rem);
}
.ch-voice em { color: color-mix(in srgb, var(--fg) 80%, var(--berry)); }

/* chapter III — pinned table */
.chapter--three { padding-left: 0; padding-right: 0; }
.chapter--three .ch-head, .ch-body--three { padding-left: var(--gutter); padding-right: var(--gutter); }
.table-pin { height: 100svh; position: relative; z-index: 5; }
.table-figure { height: 100%; position: relative; }
.frame--bleed { height: 100%; overflow: hidden; }
.frame--bleed img { transform: scale(1.18); will-change: transform; }
.plate-note--overlay {
  position: absolute;
  left: var(--gutter); right: var(--gutter); bottom: 1.25rem;
  color: var(--cream);
  border-top-color: color-mix(in srgb, var(--cream) 35%, transparent);
  opacity: 0.92;
  text-shadow: 0 1px 12px rgba(53, 35, 46, 0.45);
}
.ch-body--three { margin-top: clamp(5rem, 12vh, 8rem); }
.ch-body--three .ch-text { grid-column: 2 / 7; }
.ch-body--three .ch-figure--tall { grid-column: 8 / 12; margin-top: -4vh; }
.ch-body--three .ch-figure--tall .frame { aspect-ratio: 4 / 5; }

/* chapter IV — dark act */
.ch-body--four { align-items: center; }
.ch-body--four .ch-figure--main { grid-column: 1 / 7; }
.ch-body--four .ch-figure--main .frame { aspect-ratio: 4 / 5; }
.ch-body--four .ch-text { grid-column: 8 / 13; }
.ch-voice--dark em { color: var(--blush); }

/* ── coda ─────────────────────────────────────────────────────── */

.coda {
  padding: clamp(7rem, 18vh, 12rem) var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.coda .ch-time--center { margin-bottom: 2.5rem; }
.coda-line { margin-bottom: clamp(4rem, 10vh, 7rem); }
.coda-figure { width: min(46rem, 82vw); }
.coda-figure .frame { aspect-ratio: 3 / 2; }
.coda-text {
  margin-top: clamp(3.5rem, 8vh, 5.5rem);
  max-width: 38em;
  text-align: left;
}
.ch-copy--last { text-align: center; margin-top: 2.25em !important; }

/* ── enquire ──────────────────────────────────────────────────── */

.enquire { padding: clamp(7rem, 18vh, 12rem) var(--gutter) clamp(5rem, 12vh, 8rem); }
.enquire-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 2rem;
  align-items: center;
}
.enquire-text { grid-column: 1 / 8; }
.enquire-text .display-2 { margin: 0 0 2.25rem; }
.enquire-text .ch-copy + .ch-copy { margin-top: 1.2em; }

.enquire-mail {
  display: inline-block;
  margin-top: 3rem;
  font-family: var(--f-display);
  font-size: clamp(1.375rem, 2.6vw, 2.125rem);
  letter-spacing: 0.01em;
  padding-bottom: 0.3em;
  background: linear-gradient(var(--blush), var(--blush)) left bottom / 100% 1px no-repeat;
  transition: background-size 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s ease;
}
.enquire-mail:hover { background-size: 30% 1px; color: var(--blush); }

.enquire-meta { margin-top: 2.5rem; opacity: 0.72; letter-spacing: 0.18em; }

.enquire-figure { grid-column: 9 / 13; }
.enquire-figure .frame--round { width: min(20rem, 100%); margin: 0 auto; }
.plate-note--dark { justify-content: center; gap: 1.25rem; }

/* ── colophon ─────────────────────────────────────────────────── */

.colophon {
  padding: clamp(3rem, 8vh, 5rem) var(--gutter) 2.5rem;
  text-align: center;
  border-top: 1px solid color-mix(in srgb, var(--paper) 14%, transparent);
}
.colophon-mark {
  font-family: var(--f-display);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 1rem;
  margin-bottom: 1rem;
}
.colophon-note { opacity: 0.7; margin-bottom: 2.25rem; }
.colophon-fine { opacity: 0.5; letter-spacing: 0.16em; font-size: 0.625rem; }

/* ── responsive ───────────────────────────────────────────────── */

@media (max-width: 900px) {
  .thread { display: none; }

  .head-label { display: none; }

  .overture { grid-template-columns: 1fr; row-gap: 3.5rem; align-items: start; padding-top: 7.5rem; }
  .overture-text, .overture-figure { grid-column: 1; }
  .overture-figure { margin-top: 0; width: min(30rem, 100%); }

  .ch-head--right { align-items: flex-start; text-align: left; }

  .ch-body { grid-template-columns: 1fr; row-gap: 3rem; }
  .ch-body--one .ch-figure--main,
  .ch-body--one .ch-text,
  .ch-body--one .ch-figure--detail,
  .ch-body--two .ch-text,
  .ch-body--two .ch-figure--main,
  .ch-body--three .ch-text,
  .ch-body--three .ch-figure--tall,
  .ch-body--four .ch-figure--main,
  .ch-body--four .ch-text { grid-column: 1; grid-row: auto; }

  .ch-body--one .ch-text { padding-top: 0; order: 3; }
  .ch-body--one .ch-figure--main { order: 1; }
  .ch-body--one .ch-figure--detail {
    order: 2;
    margin-top: -30vw;
    width: 68%;
    justify-self: end;
  }
  .ch-body--two .ch-figure--main { margin-top: 0; }
  .ch-body--three .ch-figure--tall { margin-top: 0; width: min(26rem, 100%); }

  .enquire-grid { grid-template-columns: 1fr; row-gap: 4rem; }
  .enquire-text, .enquire-figure { grid-column: 1; }
  .enquire-figure .frame--round { width: min(14rem, 60vw); margin: 0; }
  .plate-note--dark { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .frame img, .band-frame img, .frame--bleed img { transform: none; }
  .cue-rule, .head-enquire, .enquire-mail { transition: none; }
}
