/* ============================================================
   Portrait — the profile piece.
   Mia tells her story in chapters, Violet in save files.
   Angela's reads as a magazine feature: a standfirst, three
   numbered movements, a record of accolades, and a direct line.
   ============================================================ */

/* ============================================================
   SECTIONS 1–5: STRICT EQUAL FULLPAGE DIMENSIONS
   ============================================================ */

.pt-band.pt-fullpage-fixed {
  height: 100vh;
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 var(--gutter);
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.pt-hero-band {
  padding-top: var(--nav-height, 4.5rem);
}

.pt-section-inner {
  width: 100%;
  max-width: 90rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  box-sizing: border-box;
}

.pt-section-inner.pt-reverse {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

/* Card sizing for all fixed sections 1 to 5 */
.pt-fullpage-fixed .ph-slides {
  aspect-ratio: 3 / 4;
  height: min(58vh, 26rem);
  width: auto;
  max-width: 100%;
  justify-self: end;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 25px 60px -25px rgba(23, 17, 15, 0.45);
}

.pt-fullpage-fixed .pt-reverse .ph-slides {
  justify-self: start;
}

.pt-section-inner .movement-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1;
  color: rgba(110, 18, 37, 0.22);
  margin-bottom: 0.3rem;
}

.pt-section-inner h1.display {
  font-size: clamp(2.6rem, 1.9rem + 5vw, 6.4rem);
  margin-top: 0.8rem;
  line-height: 1.08;
}

.pt-section-inner h2.display {
  font-size: clamp(2.2rem, 1.8rem + 2.5vw, 4.2rem);
  margin-top: 0.5rem;
  line-height: 1.15;
}

.pt-section-inner h1.display em,
.pt-section-inner h2.display em {
  font-style: italic;
  color: var(--bordeaux);
}

.pt-section-inner .lede {
  margin-top: 1.2rem;
  max-width: 34rem;
}

/* ---------- record / accolades ---------- */

.pt-record-inner .section-head {
  margin-bottom: clamp(1rem, 2.5vh, 2rem);
}

.pt-record-inner .record-list {
  display: flex;
  flex-direction: column;
}

.pt-record-inner .record-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(166, 124, 78, 0.35);
}

.pt-record-inner .record-row:first-child {
  border-top: 1px solid rgba(166, 124, 78, 0.35);
}

.pt-record-inner .record-row dt {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
}

.pt-record-inner .record-row dd {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bordeaux);
  white-space: nowrap;
}

/* ---------- correspondence ---------- */

.correspondence {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.letter-card {
  padding: clamp(2rem, 4vw, 2.8rem);
  background: var(--paper);
  box-shadow: 0 30px 70px -34px rgba(23, 17, 15, 0.35);
  position: relative;
}

.letter-card::after {
  content: "";
  position: absolute;
  inset: 0.7rem;
  border: 1px solid rgba(166, 124, 78, 0.35);
  pointer-events: none;
}

.letter-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--ink);
}

.letter-card p {
  margin-top: 0.9rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.letter-rows { margin-top: 1.6rem; display: flex; flex-direction: column; }

.letter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0.2rem;
  border-top: 1px solid rgba(166, 124, 78, 0.3);
  transition: padding-left var(--dur-mid) var(--ease-silk),
              background-color var(--dur-mid) var(--ease-silk);
}

.letter-row:last-child { border-bottom: 1px solid rgba(166, 124, 78, 0.3); }

.letter-row:hover { background: rgba(110, 18, 37, 0.05); padding-left: 0.7rem; }

.letter-row span:first-child {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}

.letter-row span:last-child {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bordeaux);
  white-space: nowrap;
}

.letter-note {
  margin-top: 1.4rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

/* ============================================================
   THE PORTRAIT — stills, slideshows and motion.
   ============================================================ */

main { overflow-x: clip; }

.pt-band {
  position: relative;
  isolation: isolate;
}

.pt-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.pt-bg-inner {
  position: absolute;
  inset: -8% 0;
  transform: translate3d(0, calc(var(--p, 0) * 3.5%), 0);
}

.pt-bg-inner picture,
.pt-bg-inner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 26%;
}

.pt-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      var(--ivory) 0%,
      rgba(246, 242, 236, var(--veil, 0.46)) 14%,
      rgba(246, 242, 236, var(--veil, 0.46)) 86%,
      var(--ivory) 100%),
    linear-gradient(105deg,
      rgba(246, 242, 236, 0.26) 0%,
      rgba(246, 242, 236, 0.06) 58%,
      rgba(110, 18, 37, 0.12) 100%);
}

.pt-scrim {
  position: relative;
  z-index: 1;
}

.pt-scrim::before {
  content: "";
  position: absolute;
  inset: -1.6rem -2.2rem;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 78% 74% at 50% 50%,
              rgba(246, 242, 236, 0.96) 0%,
              rgba(246, 242, 236, 0.93) 62%,
              rgba(246, 242, 236, 0.52) 84%,
              rgba(246, 242, 236, 0) 100%);
}

.pt-band .section-head {
  width: fit-content;
  max-width: 100%;
}

/* ------------------------------------------------------------
   THE CARDS
   ------------------------------------------------------------ */

.ph-slides .ph-media {
  opacity: 0;
  transition: opacity 1.1s var(--ease-silk, ease);
}

.ph-slides .ph-media.is-on { opacity: 1; }

/* ------------------------------------------------------------
   PARALLAX TARGETS
   ------------------------------------------------------------ */

.reveal[data-par="num"] {
  transform: translate3d(0, calc(var(--p, 0) * 30px), 0);
}

.reveal[data-par="card"] {
  transform: translate3d(0, calc(var(--p, 0) * 16px), 0);
}

[data-par] { will-change: transform; }

/* ------------------------------------------------------------
   SECTION 6: CLOSING BAND & TRANSPARENT FOOTER
   ------------------------------------------------------------ */

.pt-closing-band {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* No horizontal padding here: the footer is a child of this band and
     has to reach both edges. The gutter moves onto the copy below.
     The gap is what keeps the closing off the footer. */
  padding: clamp(3rem, 6vh, 4.5rem) 0 0;
  gap: clamp(2.5rem, 6vh, 5rem);
  box-sizing: border-box;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.pt-closing-band .closing {
  width: 100%;
  max-width: 90rem;
  margin: auto auto 0 auto;
  padding: 0 var(--gutter);
  /* a flex child shrinks below its content by default, which is how the
     correspondence ended up running under the footer */
  flex-shrink: 0;
}

.pt-closing-band .footer,
.footer.footer-integrated {
  width: 100%;
  /* Frosted, not filled. At 0.96 the panel was a solid slab and the
     blur behind it did nothing; at 0.68 the closing still reads
     through and the blur is what the type actually sits on. */
  background: rgba(246, 242, 236, 0.68) !important;
  backdrop-filter: blur(26px) saturate(1.18);
  -webkit-backdrop-filter: blur(26px) saturate(1.18);
  border-top: 1px solid rgba(166, 124, 78, 0.42) !important;
  margin-top: auto !important;
  padding: clamp(2.4rem, 4vh, 3.2rem) var(--gutter) 2.2rem !important;
  position: relative;
  z-index: 5;
  box-shadow: 0 -10px 40px rgba(23, 17, 15, 0.10);
  color: var(--ink-soft) !important;
}

.pt-closing-band .footer-word,
.footer.footer-integrated .footer-word {
  color: var(--ink) !important;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.pt-closing-band .footer-note,
.footer.footer-integrated .footer-note {
  color: var(--ink-soft) !important;
  font-size: 0.88rem;
  line-height: 1.65;
  font-weight: 400;
}

.pt-closing-band .footer-links,
.footer.footer-integrated .footer-links {
  gap: 2rem;
}

.pt-closing-band .footer-links a,
.footer.footer-integrated .footer-links a {
  color: var(--ink) !important;
  font-weight: 600;
  letter-spacing: 0.22em;
  font-size: 0.76rem;
  transition: color var(--dur-fast) ease, text-shadow var(--dur-fast) ease;
}

.pt-closing-band .footer-links a[aria-current="page"],
.footer.footer-integrated .footer-links a[aria-current="page"] {
  color: var(--bordeaux) !important;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1.5px;
}

.pt-closing-band .footer-links a:hover,
.footer.footer-integrated .footer-links a:hover {
  color: var(--bordeaux) !important;
}

.pt-closing-band .footer-legal,
.footer.footer-integrated .footer-legal {
  border-top: 1px solid rgba(166, 124, 78, 0.30) !important;
  margin-top: 2.4rem !important;
  padding-top: 1.6rem !important;
  color: var(--ink-soft) !important;
}

.pt-closing-band .footer-legal-links a,
.footer.footer-integrated .footer-legal-links a {
  color: var(--ink-soft) !important;
  font-weight: 500;
  transition: color var(--dur-fast) ease;
}

.pt-closing-band .footer-legal-links a:hover,
.footer.footer-integrated .footer-legal-links a:hover {
  color: var(--bordeaux) !important;
}

.pt-closing-band .badge-18,
.footer.footer-integrated .badge-18 {
  border: 1.5px solid var(--bordeaux) !important;
  color: var(--bordeaux) !important;
  background: rgba(110, 18, 37, 0.07) !important;
  font-weight: 700;
}

.pt-closing-band .pt-bg::after {
  background:
    linear-gradient(180deg,
      var(--ivory) 0%,
      rgba(246, 242, 236, 0.38) 12%,
      rgba(246, 242, 236, 0.28) 75%,
      rgba(246, 242, 236, 0.45) 100%
    );
}

/* The closing figure is a direct child of this grid now: it had to leave
   .pt-scrim, because a backdrop nested inside the scrim paints above the
   scrim's own panel and no amount of z-index fixes an ancestry problem.
   The three children are placed explicitly so the desktop layout is
   exactly what it was. */
.correspondence > .pt-scrim { grid-column: 1; grid-row: 1; }
.correspondence > .corr-figure { grid-column: 1; grid-row: 2; }
.correspondence > .letter-card { grid-column: 2; grid-row: 1 / span 2; }

.correspondence .lede { margin-top: 1.4rem; }

.corr-figure {
  margin-top: clamp(2rem, 5vh, 3rem);
  width: min(100%, 20rem);
  aspect-ratio: 4 / 5;
}

/* ------------------------------------------------------------
   SNAP SCROLL & RESPONSIVENESS
   ------------------------------------------------------------ */

@media (min-width: 901px) {
  html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    height: 100%;
  }

  body {
    height: 100%;
  }
}

@media (max-width: 900px) {
  .pt-band.pt-fullpage-fixed {
    height: auto;
    min-height: auto;
    overflow: hidden;
    /* No padding at all: the backdrop is a descendant, and it can only
       cover the whole screen if its containing block does. All the
       padding moves onto the copy wrapper below. */
    padding: 0;
  }

  .pt-section-inner,
  .pt-section-inner.pt-reverse,
  .correspondence {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* The wrapper is the backdrop's containing block, so it has to fill
     the band -- a percentage height against a content-sized parent only
     covered the copy. Percentages on an abspos child resolve against the
     padding box, so the padding here is covered too. */
  .pt-section-inner {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    padding: 2.75rem var(--gutter) 2.25rem;
    align-content: center;
  }

  /* the first section still has to clear the fixed nav */
  .pt-hero-band .pt-section-inner { padding-top: 5rem; }

  /* Copy sits low so the top of each frame -- which is where the
     subject is -- stays in view instead of being covered by the panel. */
  .pt-section-inner { align-content: end; }

  /* At 375px the headline computed to 49px and the copy block filled the
     whole section, leaving the photograph with nowhere to show. This is
     also simply a better size to read at arm's length. */
  .pt-section-inner h1.display { font-size: 2.15rem; line-height: 1.12; }
  .pt-section-inner h2.display { font-size: 1.95rem; line-height: 1.15; }
  .pt-section-inner .lede { font-size: 0.95rem; margin-top: 0.85rem; }
  .pt-section-inner .movement-num { font-size: 2.4rem; margin-bottom: 0.1rem; }

  /* left unpositioned on purpose: the closing figure is nested deeper,
     and its backdrop should resolve against the whole band so it runs
     behind the footer too */
  .correspondence {
    width: 100%;
    padding: 3rem var(--gutter) 0;
  }

  /* The copy panel becomes a real background rather than a positioned
     pseudo-element. A positioned .pt-scrim would be the containing
     block for the figure nested inside it, which is exactly what
     pinned the closing backdrop to a 335x161 box. Padding plus a
     negative margin reproduces the pseudo's bleed. */
  .pt-scrim {
    position: static;
    padding: 1.1rem 1.3rem;
    margin: -1.1rem -1.3rem;
    /* Radii just under the box, so the plateau clears every edge of it
       and the fade falls outside. A tighter ellipse leaves the last
       lines of the lede sitting on bare photograph -- which is exactly
       what happened in the closing section. */
    background: radial-gradient(ellipse 96% 92% at 50% 50%,
                rgba(246, 242, 236, 0.95) 0%,
                rgba(246, 242, 236, 0.92) 58%,
                rgba(246, 242, 236, 0.62) 80%,
                rgba(246, 242, 236, 0) 100%);
  }

  .pt-scrim::before { display: none; }

  .pt-band .ph-slides .ph-media,
  .pt-band .corr-figure .ph-media { object-position: center 28%; }

  /* the closing band's gutter moves inward for the same reason */
  .pt-closing-band .closing { padding-inline: 0; }

  /* the integrated footer sets gap: 2rem at a higher specificity than
     the shared touch-target rule, which left a dead band between the
     two wrapped rows now that each link is 44px tall */
  .footer.footer-integrated .footer-links { gap: 0 1.6rem; }
  .footer.footer-integrated .footer-legal { margin-top: 1.6rem !important; }

  /* one column here, and the figure is out of flow as the backdrop */
  .correspondence > .pt-scrim,
  .correspondence > .corr-figure,
  .correspondence > .letter-card { grid-column: auto; grid-row: auto; }

  /* ----------------------------------------------------------
     On a phone the slideshow IS the section. The frames are already
     portrait, so they fill the screen properly instead of sitting in
     a small landscape-ish card, and the separate still behind them is
     redundant -- dropping it also stops it downloading, since a lazy
     image inside display:none is never fetched.
     ---------------------------------------------------------- */
  .pt-band .pt-bg { display: none; }

  .pt-band .ph-slides,
  .pt-band .corr-figure {
    position: absolute;
    top: 0;
    left: 0;
    /* an explicit size, not left/right stretching: as a grid item the
       figure resolved those against its grid area and computed to 0.
       The height is the frame's own 4:5 rather than the section's, so a
       tall section shows the image at its top and paper below instead
       of stretching one portrait over the whole band. */
    width: 100%;
    height: calc(100vw * 1.25);
    /* -1 keeps it behind the copy, which is static content in the same
       stacking context; the band's `isolation` stops it going further
       back than the section itself */
    z-index: -1;
    max-width: none;
    margin: 0;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
    background: none;
    /* a backdrop must never depend on a reveal firing */
    opacity: 1;
    transform: none;
  }

  /* .ph::after is the card's hairline; as a backdrop it becomes the
     veil that holds the copy legible */
  .pt-band .ph-slides::after,
  .pt-band .corr-figure::after {
    border: 0;
    z-index: 1;
    background: linear-gradient(180deg,
      rgba(246, 242, 236, 0.78) 0%,
      rgba(246, 242, 236, 0.30) 22%,
      rgba(246, 242, 236, 0.30) 62%,
      var(--ivory) 100%);
  }

  /* the copy is the only thing left in the flow, and each section now
     wants a screen of its own for the backdrop to read */
  /* The frames are 4:5. Forced to cover a full-height section they lost
     42% of their width to the crop, which is what read as "zoomed in",
     and left a screen of dead space besides. Sizing the section to the
     image's own aspect (100vw x 1.25 IS 4:5) means cover has almost
     nothing to take, and the section is only as tall as it needs to be. */
  .pt-band.pt-fullpage-fixed {
    min-height: calc(100vw * 1.25);
    justify-content: center;
  }


  .pt-closing-band {
    min-height: auto;
    padding-bottom: 0;
  }

  .pt-bg-inner { inset: -5% 0; }
  .pt-scrim::before { inset: -1rem -1.2rem; }
  .corr-figure { width: min(100%, 16rem); }
}

@media (prefers-reduced-motion: reduce) {
  .pt-bg-inner,
  .reveal[data-par="num"],
  .reveal[data-par="card"] { transform: none; }

  .ph-slides .ph-media { transition-duration: 0.4s; }
}
