/* historia — "A borboleta não nasce pronta." */
@property --hi-r { syntax: '<percentage>'; inherits: false; initial-value: 0%; }

.hi { background: var(--papel); color: var(--ameixa); }

/* abertura: título + retrato */
.hi-abre { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 80px); align-items: end; }
.hi-abre-texto { padding-bottom: clamp(0px, 5vh, 64px); }
.hi-h2 { font-size: clamp(2.6rem, 1.1rem + 4.7vw, 5.7rem); }
.hi-h2 .wf-tom { padding-bottom: .1em; }
.hi-abre .wf-lead { margin: 28px 0 0; }
.hi-frase { margin: 44px 0 0; padding: 0 0 0 22px; border-left: 2px solid var(--rose); }
.hi-frase blockquote { margin: 0; font-family: var(--f-titulo); font-weight: 500; font-size: var(--t-h3); line-height: 1.15; color: var(--malva); }
.hi-frase figcaption { margin-top: 10px; font-size: var(--t-mini); color: var(--texto-2); }

.hi-retrato { position: relative; margin: 0 calc(-1 * var(--margem) * .5) 0 0; justify-self: end; width: min(100%, 600px); }
.hi-mancha { position: absolute; inset: -10% -12% -6% -18%; width: 130%; height: 116%; z-index: -1; }
.hi-retrato img { display: block; width: 100%; height: auto;
  -webkit-mask: url(../img/hi-mascara.svg) center / 100% 100% no-repeat;
          mask: url(../img/hi-mascara.svg) center / 100% 100% no-repeat; }

/* corpo: borboleta presa + capítulos */
.hi-corpo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); margin-top: clamp(24px, 4vh, 56px); }
.hi-caps { list-style: none; margin: 0; padding: 0; grid-column: 1; grid-row: 1; }
.hi-palco { grid-column: 2; grid-row: 1; }
.hi-cap { padding: clamp(56px, 10vh, 110px) 0; min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.hi-cap + .hi-cap { border-top: 1px solid rgb(61 34 56 / .1); }
.hi-estado { margin: 0 0 8px; font-size: var(--t-mini); letter-spacing: .12em; text-transform: uppercase; font-stretch: 110%; color: var(--texto-2); }
.hi-estado span { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 8px; border-radius: 50%; border: 1px solid rgb(61 34 56 / .2); letter-spacing: 0; font-size: .85rem; transition: background-color .6s, color .6s, border-color .6s; }
.hi-cap.hi-agora .hi-estado span { background: var(--coral); border-color: var(--coral); color: #2b1426; }
.hi-num { margin: 0; font-family: var(--f-titulo); font-weight: 700; font-size: clamp(4.4rem, 2rem + 7.4vw, 9.4rem); line-height: .9; letter-spacing: -.04em;
  background: linear-gradient(100deg in oklch, var(--ameixa) 0%, var(--malva) 70%, #a2557a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.hi-num small { font-size: .3em; font-weight: 500; letter-spacing: -.01em; }
.hi-h3 { margin: 18px 0 14px; font-family: var(--f-titulo); font-weight: 600; font-size: var(--t-h3); line-height: 1.12; color: var(--ameixa); text-wrap: balance; }
.hi-txt { margin: 0 0 14px; max-width: 32em; color: var(--texto-2); }
.hi-cit { margin: 12px 0 18px; max-width: 30em; font-family: var(--f-titulo); font-weight: 500; font-size: 1.3rem; line-height: 1.4; color: var(--ameixa); }
.hi-cit-grande { margin: 26px 0 26px; font-size: clamp(1.6rem, 1.15rem + 1.3vw, 2.35rem); line-height: 1.2; letter-spacing: -.01em; color: var(--malva); text-wrap: pretty; }

.hi-numeros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin: 10px 0 22px; max-width: 34em; }
.hi-numeros div { padding-top: 14px; border-top: 2px solid var(--rose); }
.hi-numeros dt { white-space: nowrap; font-family: var(--f-titulo); font-weight: 700; font-size: clamp(1.8rem, .9rem + 1.6vw, 2.9rem); line-height: 1; letter-spacing: -.02em; color: var(--ameixa); }
.hi-numeros dd { margin: 8px 0 0; font-size: 1.02rem; line-height: 1.4; color: var(--texto-2); }

/* recorte de jornal (fonte da história de 2014) */
.hi-jornal { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; max-width: 30em; margin: 22px 0 0; padding: 10px 0 9px; border-top: 3px double rgb(61 34 56 / .45); border-bottom: 1px solid rgb(61 34 56 / .3); }
.hi-jornal span:first-child { font-family: var(--f-titulo); font-weight: 700; font-size: 1.5rem; line-height: 1; letter-spacing: -.01em; color: var(--ameixa); }
.hi-jornal span:last-child { font-size: var(--t-mini); letter-spacing: .12em; text-transform: uppercase; font-stretch: 110%; color: var(--texto-2); }

.hi-segue { align-self: flex-start; margin-top: 18px; display: inline-flex; gap: 10px; align-items: center; padding: 14px 24px 13px; border-radius: 999px; border: 1px solid rgb(61 34 56 / .22); font-weight: 600; font-size: 1.04rem; text-decoration: none; color: var(--ameixa); transition: background-color .35s var(--ease), border-color .35s, transform .35s var(--ease); }
.hi-segue span { transition: transform .35s var(--ease); }
.hi-segue:hover, .hi-segue:focus-visible { background: var(--pessego); border-color: var(--malva); }
.hi-segue:hover span { transform: translateX(4px); }

/* o quadro da borboleta */
.hi-palco { position: sticky; top: 4vh; height: 92vh; align-self: start; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hi-pouso { position: relative; width: min(100%, 600px, 74vh); aspect-ratio: 1; }
.hi-mancha-palco { position: absolute; inset: -8%; width: 116%; height: 116%; }
.hi-tinta { opacity: 0; transition: opacity 1.6s var(--ease); }
.hi-tinta:first-child { opacity: 1; }
.hi-palco[data-etapa="1"] .hi-tinta:nth-child(2),
.hi-palco[data-etapa="2"] .hi-tinta:nth-child(3),
.hi-palco[data-etapa="3"] .hi-tinta:nth-child(4),
.hi-palco[data-etapa="4"] .hi-tinta:nth-child(5) { opacity: 1; }
.hi-camada { position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask-image: radial-gradient(circle at 50% 52%, #000 var(--hi-r), transparent calc(var(--hi-r) + 16%));
          mask-image: radial-gradient(circle at 50% 52%, #000 var(--hi-r), transparent calc(var(--hi-r) + 16%));
  --hi-r: -16%; transition: --hi-r 1.8s var(--ease); }
.hi-camada.hi-aceso { --hi-r: 80%; }
.hi-palco[data-etapa="4"] .hi-voa { animation: hi-respira 5.2s ease-in-out 1.6s infinite; }
@keyframes hi-respira { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.86); } }
.hi-voa { position: absolute; inset: 0; transform-origin: 50% 50%; }
.hi-camada:last-of-type { filter: drop-shadow(0 18px 18px rgb(142 68 104 / .18)); }
.hi-legenda { margin: 6px 0 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.hi-legenda-n { font-size: var(--t-mini); letter-spacing: .14em; text-transform: uppercase; font-stretch: 110%; color: var(--texto-2); }
.hi-legenda-t { font-family: var(--f-titulo); font-weight: 500; font-size: var(--t-h3); line-height: 1.1; color: var(--malva); }

@media (max-width: 900px) {
  .hi-abre { grid-template-columns: 1fr; }
  .hi-retrato { justify-self: center; width: min(92%, 460px); margin: 0 0 8px; order: -1; }
  .hi-corpo { grid-template-columns: 1fr; margin-top: 64px; gap: 0; }
  .hi-caps, .hi-palco { grid-column: 1; }
  .hi-caps { grid-row: 2; }
  .hi-palco { grid-row: 1; z-index: 3; top: 0; height: auto; flex-direction: row; justify-content: flex-start; gap: 14px;
    margin: 0 calc(-1 * var(--margem)); padding: 8px var(--margem); background: rgb(253 241 234 / .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgb(61 34 56 / .08); }
  .hi-pouso { width: 78px; flex: none; }
  .hi-mancha-palco { display: none; }
  .hi-palco[data-etapa="4"] .hi-voa { animation: hi-respira 5.2s ease-in-out 1.6s infinite; }
@keyframes hi-respira { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.86); } }
.hi-voa { position: absolute; inset: 0; transform-origin: 50% 50%; }
.hi-camada:last-of-type { filter: none; }
  .hi-legenda { align-items: flex-start; text-align: left; margin: 0; gap: 0; }
  .hi-legenda-t { font-size: 1.35rem; }
  .hi-cap { min-height: 0; padding: 52px 0; }
  .hi-numeros { grid-template-columns: 1fr; gap: 14px; }
  .hi-numeros div { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: baseline; }
  .hi-numeros dt { font-size: 1.75rem; }
  .hi-numeros dd { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hi-camada, .hi-tinta { transition: none; }
  .hi-palco[data-etapa="4"] .hi-voa { animation: none; }
}
