/* ==========================================================================
   Nossa história
   ========================================================================== */

/* Barra de leitura */
.read-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: 1px;
  z-index: 49;
  pointer-events: none;
}
.read-progress span {
  display: block;
  height: 100%;
  background: var(--ink);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}

/* ---------- Abertura ---------- */
.h-intro {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 40px) 0 120px;
}
.h-intro__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(50px, 13.5vw, 172px);
  line-height: .96;
  letter-spacing: -.015em;
  max-width: 13ch;
  margin: 26px 0 0;
}
.h-intro__title em { font-style: italic; }

.h-intro__scroll {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 1px;
  height: 64px;
  background: var(--line);
  overflow: hidden;
}
.h-intro__scroll span {
  position: absolute;
  inset: 0;
  background: var(--ink);
  animation: drip 2.4s var(--ease) infinite;
}
@keyframes drip { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* ---------- Capítulos ---------- */
.chapter { padding: 64px 0 96px; }
.chapter__inner { display: grid; gap: 56px; }
.chapter__num {
  font-family: var(--serif);
  font-size: clamp(110px, 34vw, 280px);
  line-height: .78;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  letter-spacing: -.02em;
  user-select: none;
}
.chapter__title {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(46px, 12.5vw, 100px);
  line-height: 1;
}
.chapter__title .eyebrow { font-family: var(--sans); font-style: normal; font-size: 11px; color: var(--muted); }
.chapter__body {
  margin-top: 28px;
  max-width: 40ch;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.chapter__photos {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: start;
}
.frame { position: relative; margin: 0; }
.frame img, .ph__inner {
  width: 100%;
  height: auto;
  object-fit: cover;
}
.frame--a { grid-column: 1 / 10; grid-row: 1; }
.frame--a img, .frame--a .ph__inner { aspect-ratio: 4 / 5; }
.frame--b {
  grid-column: 6 / 13;
  grid-row: 1;
  margin-top: 82%;
  z-index: 1;
}
.frame--b img, .frame--b .ph__inner { aspect-ratio: 3 / 4; }
/* Moldura de polaroid: borda fina nos lados e mais larga embaixo */
.frame:not(.ph) {
  padding: 7px 7px 30px;
  background: var(--cream);
}
.frame__photo { display: block; overflow: hidden; }
.frame:not(.ph):has(figcaption) { padding-bottom: 0; }
.frame figcaption {
  display: flex;
  align-items: center;
  height: 30px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
}

/* Fotos que dá para pegar e arrastar (polaroids.js) */
.frame:not(.ph) {
  translate: var(--dx, 0px) var(--dy, 0px);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.frame img { -webkit-user-drag: none; pointer-events: none; }
.js .frame.reveal-img {
  transition: clip-path 1.4s var(--ease-out) var(--d, 0s), scale .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.frame.is-dragging {
  cursor: grabbing;
  scale: 1.035;
  box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 30px 50px -16px rgba(40, 32, 22, .45);
}
.chapter--flip .frame--a { grid-column: 4 / 13; }
.chapter--flip .frame--b { grid-column: 1 / 8; }

/* Fotos levemente tortas, como na landing */
.frame:not(.ph) { box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 14px 30px -12px rgba(40, 32, 22, .35); overflow: hidden; }
/* a máscara da animação deixa sobrar espaço para a sombra aparecer */
.js .frame.reveal-img { clip-path: inset(100% -60px 0 -60px); }
.js .frame.reveal-img.is-in { clip-path: inset(-60px); }
.frame--a { rotate: -2.4deg; }
.frame--b { rotate: 3.6deg; }
.chapter--flip .frame--a { rotate: 2.2deg; }
.chapter--flip .frame--b { rotate: -4deg; }
#a-escolha .frame--a { rotate: -1.6deg; }
#a-escolha .frame--b { rotate: 4.4deg; }

/* Espaço reservado para foto */
.ph__inner {
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(255,255,255,.35), transparent 60%),
    linear-gradient(160deg, #ddd3c7, #bfb3a5);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), inset 0 0 0 12px rgba(241,235,227,.25);
}
.ph__label { font-size: 10px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; opacity: .7; }
.ph__desc { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.15; max-width: 12ch; margin-inline: auto; }

/* ---------- Fechamento ---------- */
.h-next {
  background: var(--hero-bg);
  color: var(--on-dark);
  text-align: center;
  padding: 96px 0 104px;
}
.h-next .title-italic { margin: 22px 0 22px; font-size: clamp(42px, 11vw, 104px); }
.h-next__text { font-size: 14px; letter-spacing: .04em; opacity: .75; }
.h-next__actions {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* ==========================================================================
   DESKTOP
   ========================================================================== */
@media (min-width: 900px) {
  .h-intro { padding-bottom: 140px; }
  .h-intro__title { margin-top: 34px; }

  .chapter { padding: 120px 0 160px; }
  .chapter__inner {
    grid-template-columns: 5fr 7fr;
    column-gap: clamp(56px, 8vw, 150px);
    align-items: start;
  }
  .chapter__text { position: sticky; top: calc(var(--header-h) + 10vh); }
  .chapter--flip .chapter__inner { grid-template-columns: 7fr 5fr; }
  .chapter--flip .chapter__text { order: 2; }
  .chapter--flip .chapter__photos { order: 1; }
  .chapter__body { font-size: 18px; }

  .frame--a { grid-column: 1 / 10; }
  .frame--b { grid-column: 7 / 13; margin-top: 70%; }
  .chapter--flip .frame--a { grid-column: 4 / 13; }
  .chapter--flip .frame--b { grid-column: 1 / 7; }
  .ph__desc { font-size: 26px; }
  .frame:not(.ph) { padding: 11px 11px 46px; }
  .frame:not(.ph):has(figcaption) { padding-bottom: 0; }
  .frame figcaption { height: 46px; font-size: 15px; }

  .h-next { padding: 160px 0; }
  .h-next__text { font-size: 16px; }
  .h-next__actions { flex-direction: row; justify-content: center; gap: 48px; }
}
