/* Layout de leitura, áreas seguras e navegação por toque. */
:root{
  --safe-top:env(safe-area-inset-top,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --safe-left:env(safe-area-inset-left,0px);
  --safe-right:env(safe-area-inset-right,0px);
  --viewport-height:100vh;
  --gutter:clamp(16px,5vw,90px);
  --content-top:calc(112px + var(--safe-top));
  --content-bottom:calc(153px + var(--safe-bottom));
}
@supports(height:100svh){:root{--viewport-height:100svh}}
html{scrollbar-gutter:stable;scroll-behavior:auto;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{min-width:0}
button{min-height:44px;touch-action:manipulation}
.header{height:var(--content-top);padding-left:max(var(--gutter),var(--safe-left));padding-right:max(var(--gutter),var(--safe-right));pointer-events:none}
.brand{pointer-events:auto;top:calc(26px + var(--safe-top));min-height:44px;display:flex;align-items:center;justify-content:center;max-width:calc(100% - 64px)}
.brand svg{display:block}
.journey{height:calc(var(--scroll-distance,10000px) + var(--viewport-height))}
.stage{height:var(--viewport-height);min-height:0}
.background img,.foreground{will-change:auto}
.background,.foreground{backface-visibility:hidden}
.foreground::after{height:calc(var(--viewport-height)*1.5)}
.chapter,.opening{
  top:var(--content-top);bottom:var(--content-bottom);transform:none;
  display:flex;flex-direction:column;justify-content:center;
  overflow-y:auto;overflow-x:clip;overscroll-behavior-y:auto;
  scrollbar-width:none;-webkit-overflow-scrolling:touch;
  touch-action:pan-y pinch-zoom;
}
.chapter::-webkit-scrollbar,.opening::-webkit-scrollbar{display:none}
.chapter{left:max(var(--gutter),var(--safe-left));width:min(49vw,680px);max-width:calc(100% - max(var(--gutter),var(--safe-left)) - max(var(--gutter),var(--safe-right)))}
.chapter>*{flex-shrink:0}
.chapter:not(.active) .character{will-change:auto}
.title{max-width:100%;min-width:0;flex-shrink:0}
.title .initial{flex-shrink:0;max-width:none}
.title .word-rest{flex-shrink:0}
.detail-button{min-height:44px;min-width:110px;padding:10px 0;font-size:12px;justify-content:space-between;max-width:100%}
.tags{line-height:1.55}
.opening{left:max(var(--gutter),var(--safe-left));right:max(var(--gutter),var(--safe-right));align-items:center}
.opening>*{flex-shrink:0}
.opening-line{overflow:visible}
.opening-title{font-size:clamp(38px,5.6vw,95px)}
.opening-cta{min-height:48px;max-width:100%;flex-shrink:0}
.chapter-rail{left:max(var(--gutter),var(--safe-left));right:max(var(--gutter),var(--safe-right));bottom:calc(20px + var(--safe-bottom));gap:clamp(8px,1.3vw,20px)}
.rail-button{min-height:44px;padding:13px 0 5px;min-width:0}
.bottom-caption{left:max(var(--gutter),var(--safe-left));right:max(var(--gutter),var(--safe-right));bottom:calc(91px + var(--safe-bottom))}
.scroll-hint{min-height:44px;padding:8px 0}
.footer-scrim{height:calc(160px + var(--safe-bottom))}
.bridge{padding:calc(16px + var(--safe-top)) max(22px,var(--safe-right)) calc(95px + var(--safe-bottom)) max(22px,var(--safe-left))}
.bridge p{max-width:min(700px,100%);font-size:clamp(25px,3.2vw,46px)}
dialog{
  width:min(750px,calc(100% - 32px - var(--safe-left) - var(--safe-right)));
  max-height:calc(var(--viewport-height) - 24px - var(--safe-top) - var(--safe-bottom));
  padding:clamp(24px,4vw,60px);overscroll-behavior:contain;touch-action:pan-y pinch-zoom;
  -webkit-overflow-scrolling:touch;scrollbar-gutter:stable;
}
.close-dialog{position:sticky;top:0;z-index:2;display:block;margin:-12px -12px -32px auto;min-width:44px;min-height:44px;right:auto;background:#071d21;line-height:1}
.modal-next{min-height:48px;gap:18px;text-align:left}
.modal-next span{line-height:1.5}
.modal-title{padding-right:20px;overflow-wrap:anywhere}
.modal-copy{overflow-wrap:break-word}
.chapter.is-compact .eyebrow{margin-bottom:12px}
.chapter.is-compact .title{margin-bottom:16px}
.chapter.is-compact .tagline{margin-bottom:12px;font-size:clamp(18px,2vw,26px)}
.chapter.is-compact .description{margin-bottom:12px;line-height:1.5}
.chapter.is-compact .tags{margin-bottom:10px}
.opening.is-compact .opening-eyebrow{margin-bottom:14px}
.opening.is-compact .opening-title{margin-bottom:16px}
.opening.is-compact .opening-description{margin-bottom:18px}
/* align-items:center + overflow exige início seguro quando o texto não cabe. */
.chapter.is-overflowing,.opening.is-overflowing{justify-content:flex-start;padding-top:6px;padding-bottom:12px}
@media(max-width:1024px){
  :root{--content-top:calc(96px + var(--safe-top));--content-bottom:calc(135px + var(--safe-bottom))}
  .brand{top:calc(23px + var(--safe-top));width:200px}
  .chapter{width:min(60vw,660px)}
  .title{font-size:clamp(50px,8.2vw,86px)}
  .tagline{font-size:clamp(21px,2.6vw,29px)}
  .description{font-size:15px;max-width:470px}
  .opening-title{font-size:clamp(38px,6.6vw,72px)}
  .bottom-caption{bottom:calc(77px + var(--safe-bottom))}
}
@media(max-width:600px){
  :root{--gutter:clamp(16px,5vw,26px);--content-top:calc(86px + var(--safe-top));--content-bottom:calc(124px + var(--safe-bottom))}
  html{scrollbar-gutter:auto}
  .brand{top:calc(18px + var(--safe-top));width:180px}
  .chapter{width:auto;right:max(var(--gutter),var(--safe-right));max-width:none;z-index:30}
  .eyebrow{font-size:9px;line-height:1.5;margin-bottom:20px;letter-spacing:.13em}
  .title{font-size:clamp(40px,12.5vw,72px);margin-bottom:20px}
  .tagline{font-size:clamp(20px,5.5vw,28px);line-height:1.25;max-width:100%;margin-bottom:17px}
  .description{font-size:14px;line-height:1.6;max-width:100%;margin-bottom:18px}
  .tags{font-size:10px;gap:6px 12px;max-width:100%;margin-bottom:15px}
  .detail-button{font-size:12px;gap:22px}
  .background img,.foreground img{object-position:69% center}
  .chapter-rail{bottom:calc(12px + var(--safe-bottom));gap:8px}
  .rail-button{justify-content:space-between;gap:4px;padding:9px 2px 3px;min-height:44px}
  .rail-name{display:none}.rail-letter{display:block;font-size:19px}.rail-index{font-size:8px}.rail-dot{display:none!important}
  .bottom-caption{bottom:calc(64px + var(--safe-bottom))}
  .scroll-hint{font-size:9px;letter-spacing:.08em}
  .opening{left:max(var(--gutter),var(--safe-left));right:max(var(--gutter),var(--safe-right))}
  .opening-eyebrow{font-size:8px;line-height:1.6;max-width:290px;margin-bottom:21px}
  .opening-title{font-size:clamp(32px,8.9vw,50px);line-height:1.08;margin-bottom:20px}
  .opening-line:last-child{max-width:360px}
  .opening-description{font-size:14px;line-height:1.55;max-width:365px;margin-bottom:23px}
  .opening-cta{font-size:12px;gap:24px;min-height:48px;padding:13px 18px}
  .bridge p{font-size:clamp(25px,7vw,34px);max-width:100%}
  .bridge small{font-size:8px;line-height:1.6}
  dialog{width:calc(100% - 24px - var(--safe-left) - var(--safe-right));padding:26px 22px;scrollbar-gutter:auto}
  .modal-copy{font-size:15px;line-height:1.6}.modal-actions{font-size:14px;line-height:1.55}
}
@media(max-width:380px){
  :root{--content-top:calc(76px + var(--safe-top));--content-bottom:calc(114px + var(--safe-bottom))}
  .brand{top:calc(13px + var(--safe-top));width:166px}
  .eyebrow{margin-bottom:14px;font-size:8px}
  .title{font-size:clamp(36px,11.8vw,45px);margin-bottom:16px}
  .tagline{font-size:20px;margin-bottom:13px}
  .description{line-height:1.5;margin-bottom:13px}
  .tags{font-size:9px;gap:5px 10px;margin-bottom:10px}
  .opening-eyebrow{font-size:7px;margin-bottom:16px}
  .opening-title{font-size:clamp(29px,8.7vw,34px);margin-bottom:18px}
  .opening-description{font-size:13px;line-height:1.5;margin-bottom:19px}
  .opening-cta{font-size:11px}
}
/* Telefone deitado e janelas baixas: conteúdo em duas colunas. */
@media(max-height:540px) and (min-width:481px){
  :root{--content-top:calc(66px + var(--safe-top));--content-bottom:calc(103px + var(--safe-bottom));--gutter:clamp(22px,4vw,60px)}
  .brand{top:calc(8px + var(--safe-top));width:160px}
  .chapter{left:max(var(--gutter),var(--safe-left));right:max(var(--gutter),var(--safe-right));width:auto;max-width:none;display:grid;grid-template-columns:1fr 1.1fr;gap:8px clamp(20px,4vw,55px);align-content:center;justify-content:initial;z-index:30}
  .chapter .eyebrow{grid-column:1;grid-row:1;font-size:8px;margin:0}
  .chapter .title{grid-column:1;grid-row:2;font-size:clamp(36px,6vw,62px);margin:0}
  .chapter .tagline{grid-column:1;grid-row:3 / span 2;font-size:clamp(17px,2.5vw,23px);margin:0;max-width:100%}
  .chapter .description{grid-column:2;grid-row:1 / span 2;font-size:13px;line-height:1.45;margin:0;max-width:100%}
  .chapter .tags{grid-column:2;grid-row:3;font-size:9px;margin:0;gap:5px 10px;max-width:100%}
  .chapter .detail-button{grid-column:2;grid-row:4;min-height:44px;margin:0;padding:8px 0}
  .chapter.is-overflowing{align-content:start;justify-content:initial}
  .opening{display:grid;grid-template-columns:1.1fr 1fr;gap:10px 30px;align-content:center;justify-content:initial;text-align:left}
  .opening-title{grid-column:1;grid-row:1 / span 3;font-size:clamp(27px,4vw,43px);line-height:1.04;margin:0!important}
  .opening-line{padding-left:0}.opening-line:last-child{max-width:none}
  .opening-eyebrow{grid-column:2;grid-row:1;font-size:7px;line-height:1.4;margin:0!important}
  .opening-description{grid-column:2;grid-row:2;font-size:12px;line-height:1.45;margin:0!important}
  .opening-cta{grid-column:2;grid-row:3;min-height:44px;font-size:11px;padding:10px 14px;justify-self:start;gap:18px}
  .opening.is-overflowing{align-content:start;justify-content:initial}
  .chapter-rail{bottom:calc(8px + var(--safe-bottom))}
  .rail-button{padding:8px 0 2px}.rail-name{font-size:12px}
  .bottom-caption{bottom:calc(55px + var(--safe-bottom))}.scroll-hint{font-size:8px}
  .bridge{padding-bottom:calc(90px + var(--safe-bottom))}.bridge p{font-size:29px}
}
@media(pointer:coarse){
  .rail-button,.detail-button,.scroll-hint,.brand,.modal-next,.close-dialog{min-height:48px}
  .detail-button{min-width:120px}
  .brand [data-brand-letter]{transition:opacity .35s;filter:none!important}
  .opening-cta:hover{background:#062b2c80;border-color:#53d8c470}.opening-cta:hover span{transform:none}
  dialog::backdrop{backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
}
@media(prefers-reduced-motion:reduce){
  .opening-line-inner,.opening-item,.bridge p,.character,.background img,.foreground{will-change:auto!important}
  .opening-line-inner,.opening-item,.bridge p{filter:none!important}
}

@media(max-height:360px) and (min-width:481px){
  :root{--content-top:calc(60px + var(--safe-top));--content-bottom:calc(72px + var(--safe-bottom))}
  .brand{top:calc(4px + var(--safe-top));width:148px}
  .bottom-caption{display:none}
  .chapter{column-gap:20px;row-gap:6px}
  .chapter .description{font-size:12px;line-height:1.4}
  .chapter .tagline{font-size:17px}
  .chapter .title{font-size:clamp(30px,5.5vw,45px)}
  .chapter .tags{font-size:8px}
  .opening{column-gap:20px;row-gap:8px}
  .opening-title{font-size:clamp(25px,4.5vw,32px)}
  .opening-description{font-size:12px;line-height:1.4}
}
@media(max-width:380px){
  .chapter.is-compact .eyebrow{margin-bottom:8px}
  .chapter.is-compact .title{margin-bottom:10px}
  .chapter.is-compact .tagline{margin-bottom:8px}
  .chapter.is-compact .description{margin-bottom:8px}
  .chapter.is-compact .tags{margin-bottom:6px}
}
/* Impede que o foco em um botão desloque internamente o palco sticky. */
@supports(overflow:clip){.stage{overflow:clip}}
@media(max-width:340px){.chapter-rail{gap:6px}}
/* Só há rolagem interna quando o conteúdo realmente exige mais espaço. */
.chapter:not(.is-overflowing),.opening:not(.is-overflowing){overflow-y:visible;overflow-x:clip}
.chapter.is-overflowing,.opening.is-overflowing{overflow-y:auto;overflow-x:hidden}
