/*
  Template de seção com camadas: múltiplas imagens (fundo transparente),
  uma imagem de máscara com "buraco" transparente por cima e texto no topo.
*/

/* GloboTIPO font family */
@font-face {
font-family: 'Globotipo';
font-style: normal;
font-weight: 100;
src: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/fonts/globo-th-lt.woff2') format('woff2');
}
@font-face {
font-family: 'Globotipo';
font-style: normal;
font-weight: 200;
src: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/fonts/globo-th.woff2') format('woff2');
}
@font-face {
font-family: 'Globotipo';
font-style: normal;
font-weight: 300;
src: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/fonts/globo-lt-lt.woff2') format('woff2');
}
@font-face {
font-family: 'Globotipo';
font-style: normal;
font-weight: 400;
src: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/fonts/globo-lt.woff2') format('woff2');
}
@font-face {
font-family: 'Globotipo';
font-style: normal;
font-weight: 500;
src: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/fonts/globo-rg-lt.woff2') format('woff2');
}
@font-face {
font-family: 'Globotipo';
font-style: normal;
font-weight: 600;
src: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/fonts/globo-rg.woff2') format('woff2');
}
@font-face {
font-family: 'Globotipo';
font-style: normal;
font-weight: 700;
src: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/fonts/globo-bd-lt.woff2') format('woff2');
}
@font-face {
font-family: 'Globotipo';
font-style: normal;
font-weight: 800;
src: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/fonts/globo-bd.woff2') format('woff2');
}
@font-face {
font-family: 'Globotipo';
font-style: normal;
font-weight: 900;
src: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/fonts/globo-bk-lt.woff2') format('woff2');
}
@font-face {
font-family: 'Globotipo';
font-style: normal;
font-weight: 950;
src: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/fonts/globo-bk.woff2') format('woff2');
}

:root {
  --page-bg: #e1e6ff;
  --text-color: #ffffff;
  --content-max-width: 1200px;
  --hero-height: 100vh;
  --credits-text: #231f20;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background-color: var(--page-bg);
  background-image: url('img/bg.jpg');
  background-repeat: repeat-y;      /* repete verticalmente */
  background-position: top center;  /* centraliza no eixo X */
  color: var(--text-color);
  font-family: 'Globotipo', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Animação de entrada para os textos */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Rolagem suave para âncoras */
html {
  scroll-behavior: smooth;
}

/* Hero/Header no topo */
.hero {
  position: relative;
  width: 100%;
  height: var(--hero-height);
  min-height: 320px;
  /* Permite deslocar o conteúdo para baixo quando embedado sob um header externo */
  margin-top: var(--host-header-offset, 0px);
  background-image: var(--hero-image, url('img/bg.jpg'));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0; /* cria contexto e garante ficar abaixo de headers externos com z-index alto */
}
.hero-content {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center; /* centraliza verticalmente */
  justify-items: start;  /* alinhado à esquerda */
  padding: 24px 16px;
  z-index: 1; /* acima das camadas animadas */
  /* Sobe levemente o bloco de conteúdo do hero */
  transform: translateY(var(--hero-shift, -48px));
}
.hero-inner {
  width: min(100%, 700px);
  margin: 0 auto;
}
.hero-title {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 3vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  color: #3951ff;
  /* Animação de entrada */
  animation: fadeInUp 800ms 300ms both cubic-bezier(.22,.61,.36,1);
}
.hero-subtitle {
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  line-height: 1.5;
  color: #3951ff;
  /* Animação de entrada com atraso */
  animation: fadeInUp 800ms 500ms both cubic-bezier(.22,.61,.36,1);
}
.hero-publish-date {
  margin: 16px 0 0;
  font-size: clamp(0.8125rem, 1.5vw, 0.9375rem);
  font-weight: 400;
  line-height: 1.5;
  color: #3951ff;
  /* Animação de entrada com mais atraso */
  animation: fadeInUp 800ms 700ms both cubic-bezier(.22,.61,.36,1);
}

@media (prefers-reduced-motion: reduce) {
  .hero-title, .hero-subtitle, .hero-publish-date { animation: none; }
}

/* Em telas menores, ajuste leve para cima */
@media (max-width: 768px) {
  .hero-content { transform: translateY(var(--hero-shift-mobile, -48px)); }
}

/* Larguras de conteúdo no header */
.hero-inner .hero-title,
.hero-inner .hero-subtitle,
.hero-inner .hero-publish-date {
  width: 100%;
  max-width: 500px;
}

/* Camadas animadas do header */
.hero-layers {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: paint;
  transform: translateZ(0);
  /* Aplica a imagem como máscara (mostra apenas onde a máscara é opaca) */
  mask-image: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/2025/html/memoria-globo/criesp/img/header/HEADER_mask.png');
  -webkit-mask-image: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/2025/html/memoria-globo/criesp/img/header/HEADER_mask.png');
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-size: cover;
  -webkit-mask-size: cover;
  /* Move a máscara verticalmente com parallax (mais rápida) */
  mask-position: center calc(50% + var(--mask-py, 0px));
  -webkit-mask-position: center calc(50% + var(--mask-py, 0px));
  mask-mode: alpha;
}
.hero-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  /* Inclui offset de paralaxe através da var --py */
  transform: translateY(8px) scale(1.02) translateY(var(--py, 0px));
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  z-index: 1;
}
.hero-layer.base {
  /* Base visível imediatamente, sem animação de entrada */
  opacity: 1;
  transform: translateY(var(--py, 0px));
}
.hero-layer.is-ready {
  animation: heroLayerIn 480ms cubic-bezier(.22,.61,.36,1) forwards;
  animation-delay: calc(var(--i) * 90ms);
}
@keyframes heroLayerIn {
  to {
    opacity: 1;
    transform: translateY(var(--py, 0px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-layer { animation: none; opacity: 1; transform: none; }
}

/* Footer / Créditos */
.site-footer {
  padding: 140px 16px 88px;
  color: #ffffff;                          /* textos brancos */
  background-image: url('img/bg-creditos.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: top center;         /* começa no topo da seção */
}
.footer-wrap {
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
}
.credits-title {
  margin: 0 0 16px;
  font-weight: 800;
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  line-height: 1.2;
}
.credits-list {
  display: grid;
  gap: 12px;
}
.credit { display: inline-flex; align-items: baseline; gap: 8px; }
.credit dt::after { content: ":"; margin: 0 6px 0 2px; }
.credit dt {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.credit dd {
  margin: 0;
  font-weight: 500;
}

@media (max-width: 768px) {
  .credit { flex-wrap: wrap; }
}

.page-wrap {
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 80px;
  display: grid;
  gap: 40px;
}

/* Seção base */
.stack-section {
  --section-ratio: 16/9;          /* Ajuste por seção, se quiser */
  --section-radius: 16px;         /* Raio do canto da seção */
  --section-shadow: none;         /* sem sombra nas seções */
  --content-padding: 24px;         /* Respiro interno da área de texto */
  --content-color: #ffffff;        /* Cor do texto da seção */
  --content-bg: transparent;       /* Fundo opcional do texto */
  --content-width: 400px;          /* Largura alvo do bloco de texto */
  --slide-offset: 56px;            /* Distância inicial das imagens para animação */
  --layers-bg: #ff7200;            /* Cor de fundo dentro da máscara das imagens */
  --title-bg: #ff7200;             /* Cor chapada do box do título (ano) */
  --mask-image: url('img/teste/mascara.png'); /* Máscara padrão aplicada às imagens */
  --mask-size: cover;
  --mask-position: center;
  --mask-repeat: no-repeat;

  position: relative;
  width: 100%; /* ocupa todo o container, até 1200px */
  aspect-ratio: var(--section-ratio);
  border-radius: var(--section-radius);
  overflow: hidden;
  box-shadow: var(--section-shadow);
  opacity: 0;                      /* seção invisível até entrar em viewport */
  transition: opacity 400ms cubic-bezier(.22,.61,.36,1);
}

.stack {
  position: absolute;
  inset: 0;
}

/* Camadas de imagens de fundo */
.layers,
.layers img {
  position: absolute;
  inset: 0;
}

.layers { z-index: 1; }
.layers {
  /* Aplica a máscara somente nas imagens (texto não é mascarado) */
  -webkit-mask-image: var(--mask-image);
  mask-image: var(--mask-image);
  -webkit-mask-repeat: var(--mask-repeat);
  mask-repeat: var(--mask-repeat);
  -webkit-mask-position: var(--mask-position);
  mask-position: var(--mask-position);
  -webkit-mask-size: var(--mask-size);
  mask-size: var(--mask-size);
  /* Usa alpha por padrão; se sua máscara for baseada em luminância, podemos ajustar via classe */
}
/* Variação automática da imagem de fundo das camadas por seção */
.page-wrap > .stack-section:nth-child(5n + 1) .layers::before { background-image: url('img/bg/bg01.png'); }
.page-wrap > .stack-section:nth-child(5n + 2) .layers::before { background-image: url('img/bg/bg02.png'); }
.page-wrap > .stack-section:nth-child(5n + 3) .layers::before { background-image: url('img/bg/bg03.png'); }
.page-wrap > .stack-section:nth-child(5n + 4) .layers::before { background-image: url('img/bg/bg04.png'); }
.page-wrap > .stack-section:nth-child(5n + 0) .layers::before { background-image: url('img/bg/bg05.png'); }

/* Variação automática da cor do título por seção */
.page-wrap > .stack-section:nth-child(3n + 1) { --title-bg: #ff7200; } /* Laranja */
.page-wrap > .stack-section:nth-child(3n + 2) { --title-bg: #ff0044; } /* Rosa */
.page-wrap > .stack-section:nth-child(3n)     { --title-bg: #1fcf30; } /* Verde */

/* Fundo colorido sob as imagens, também mascarado */
.layers::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--layers-bg);
  background-size: cover;
  background-position: center;
}

/* Desktop: limita área das imagens+máscara a 830px, alinhada à esquerda */
@media (min-width: 769px) {
  /* Fade-in da seção mais suave e perceptível no desktop */
  .stack-section { transition: opacity 800ms cubic-bezier(.16,1,.3,1); }

  /* Animação: começar totalmente fora da máscara (mais abaixo) */
  .stack-section { --slide-offset: 120%; }

  .stack-section .layers {
    left: 0;
    right: auto;        /* desfaz o inset right */
    top: 0;
    bottom: 0;          /* mantém altura total da seção */
    width: min(830px, 100%);
    height: 100%;
  }

  /* Ímpares: imagem à esquerda (default) e texto encostado na direita do container (1200px) */
  .page-wrap > .stack-section:nth-child(odd) .content {
    align-items: center;
    justify-items: end;   /* posiciona conteúdo no canto direito */
    align-content: center;
  }
  .page-wrap > .stack-section:nth-child(odd) .content-inner {
    margin-left: auto;     /* encosta o box na direita */
    margin-right: 0;
    text-align: right;     /* texto à direita dentro do box */
  }
  /* Mas a descrição nas seções ímpares deve ficar alinhada à esquerda */
  .page-wrap > .stack-section:nth-child(odd) .content-inner .description {
    text-align: left;
  }

  /* Variação automática no desktop: seções pares com imagem à direita e texto à esquerda */
  .page-wrap > .stack-section:nth-child(even) .layers {
    left: auto;
    right: 0;
    width: min(830px, 100%);
    height: 100%;
  }
  .page-wrap > .stack-section:nth-child(even) .content {
    align-items: center;
    justify-items: start; /* texto à esquerda */
    align-content: center; /* mantém título e descrição próximos */
  }
  .page-wrap > .stack-section:nth-child(even) .content-inner {
    margin-left: 0;
    margin-right: auto;    /* bloco encostado à esquerda do container */
    text-align: left;      /* texto alinhado à esquerda dentro do box */
  }

  /* remover controle específico da última linha para manter o alinhamento original */

  /* Imagens sobem com curva e duração mais suaves no desktop */
  .stack-section.is-visible .layers img {
    animation-duration: 900ms;
    animation-timing-function: cubic-bezier(.16,1,.3,1);
    animation-delay: calc(var(--i, 0) * 140ms);
  }
}
.layers img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1; /* acima do fundo colorido */
  /* Estado inicial parado, um pouco abaixo */
  transform: translateY(var(--slide-offset, 56px));
  opacity: 0;
  /* Transição suave para a volta */
  transition: transform 700ms cubic-bezier(.22,.61,.36,1), opacity 500ms ease;
  transition-delay: calc(var(--i, 0) * 120ms);
  will-change: transform, opacity;
}

/* Quando a seção entra em view, dispara a animação */
.stack-section.is-visible .layers img {
  transform: translateY(0);
  opacity: 1;
}

.stack-section.is-visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .layers img {
    animation: none !important;
    transform: none;
  }
  .stack-section { opacity: 1 !important; transition: none !important; }
}

/* Sem máscara: apenas camadas e texto */

/* Texto no topo */
.content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;              /* permite centralização simples */
  gap: 20px;                  /* distância entre título e descrição */
  padding: var(--content-padding);
  color: var(--content-color);
}

/* Alinhamentos úteis (aplique na .content) */
.align-center        { place-items: center; align-content: center; }
.align-top-left      { align-items: start;  justify-items: start; }
.align-top-right     { align-items: start;  justify-items: end; }
.align-bottom-left   { align-items: end;    justify-items: start; }
.align-bottom-right  { align-items: end;    justify-items: end; }

.content-inner {
  width: min(100%, var(--content-width));
  background: transparent;      /* plano branco vira ::after */
  padding: calc(var(--content-padding) * 0.75);
  border-radius: 0;             /* cantos retos, sem arredondar */
  backdrop-filter: none;        /* sem efeito para fundo sólido */
  position: relative;           /* necessário para o pseudo bg */
  z-index: 0;                   /* cria contexto para o ::before ficar atrás */
  padding: 3%;
}

/* Plano branco do box de descrição (sobre a sombra) */
.content-inner::after {
  content: "";
  position: absolute;
  inset: 0;                    /* exatamente o tamanho do box */
  background: #f1f2f2;         /* branco opaco */
  z-index: 0;                  /* acima da sombra, abaixo do conteúdo */
  clip-path: polygon(0% 0%, 100% 4%, 100% 96%, 0% 100%);
}

/* Sombra chapada azul atrás do box de descrição (igual ao título) */
.content-inner::before {
  content: "";
  position: absolute;
  inset: 0px;    /* ligeiramente maior e mais baixo à direita */
  scale: 110%;
  background: #3951ff;          /* azul sólido, sem blur */
  z-index: -1;                  /* atrás do plano branco (::after) */
  pointer-events: none;
  clip-path: polygon(10% 10%, 100% 14%, 100% 98%, 10% 100%);

}

/* Garante que o texto fique acima dos pseudos */
.content-inner > * { position: relative; z-index: 1; }

.title {
  margin: 0;
  font-size: 40pt;            /* Título com 40pt */
  line-height: 1.1;
  background: transparent;    /* fundo vem do pseudo-elemento pontudo */
  color: #fff;
  display: inline-block;       /* Box do título separado do descritivo */
  padding: 8px 12px;
  border-radius: 0;            /* sem borda arredondada */
  position: relative;
  z-index: 0;
}
.title::before {
  content: "";
  margin-right: -4%;
  position: absolute;
  inset: 0;                    /* cobre todo o box do título */
  background: var(--title-bg);
  z-index: -1;                 /* atrás do texto, à frente da sombra azul */
  /* Forma pontuda (trapezoide) */
  clip-path: polygon(0% 0%, 100% 10%, 100% 96%, 0% 100%);
}
.title-box {
  position: relative;
  display: inline-block;
  transform: rotate(var(--title-tilt, -3deg));

  /* ANIMAÇÃO: Estado inicial (invisível e deslocado) */
  opacity: 0;
  transform: translateY(30px) rotate(var(--title-tilt, -3deg));
  transition: opacity 600ms cubic-bezier(.22,.61,.36,1), transform 600ms cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
  /* Fim da animação */

  transform-origin: left center;
}
.title-box::before {
  content: "";
  position: absolute;
  inset: 0px 0px -6px -18px; /* ligeiramente maior que o título */
  clip-path: polygon(0% 0%, 100% 20%, 100% 96%, 0% 100%);
  background: #3951ff;          /* sombra chapada, sem blur */
  transform: translate(11px, 6px);
  z-index: -2;                  /* fica atrás do título e do seu fundo pontudo */
}

/* ANIMAÇÃO: Estado inicial do box de descrição */
.content-inner {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 600ms cubic-bezier(.22,.61,.36,1), transform 600ms cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}

/* ANIMAÇÃO: Ativa a transição quando a seção fica visível */
.stack-section.is-visible .title-box,
.stack-section.is-visible .content-inner {
  opacity: 1;
  /* Remove a rotação e o deslocamento vertical no estado final */
  transform: translateY(0) rotate(0);
  transition-delay: 400ms; /* Atraso para o texto aparecer depois das imagens */
}

.description {
  margin: 0;
  opacity: 0.95;
  line-height: 1.5;
  color: #000000;
  /* Manter alinhamento normal (herdado do container) */
  text-align: inherit;
  /* Não hifenizar nem quebrar palavras automaticamente */
  hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
}

/* Responsivo */
@media (max-width: 768px) {
  /* Header no mobile usa as camadas animadas; sem imagem de fundo fixa */
  .hero {
    background-image: var(--hero-image, none);
    /* Inverte cores no mobile: fundo azul */
  }
  /* Máscara específica do header no mobile (assets mobile) */
  .hero-layers {
    -webkit-mask-image: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/2025/html/memoria-globo/criesp/header-mobi/HEADER_mask.png');
    mask-image: url('https://s3.glbimg.com/v1/AUTH_8b29beb0cbe247a296f902be2fe084b6/2025/html/memoria-globo/criesp/header-mobi/HEADER_mask.png');
  }
  /* Textos do header em branco no mobile */
  .hero-title,
  .hero-subtitle,
  .hero-publish-date { color: #ffffff; }
  /* Fundo do texto (linha fina) no mobile, no estilo das sections */
  .hero-textbox {
    position: relative;
    z-index: 2;
    padding: 3%;
    width: min(100%, 500px);
  }
  .hero-textbox::after {
    content: "";
    position: absolute;
    inset: 0;
    /* Remove o fundo branco para manter o fundo azul visível */
    background: #3951ff; /* mesmo plano branco das sections */
    z-index: 0;
    clip-path: polygon(0% 0%, 100% 4%, 100% 96%, 0% 100%);
  }
  .hero-textbox > * { position: relative; z-index: 1; }
  /* Maior distância entre seções no mobile */
  .page-wrap { gap: 128px; }
  /* Card mais compacto no mobile */
  .stack-section {
    --section-radius: 12px;
    /* Igual ao desktop: imagens começam totalmente fora da máscara */
    --slide-offset: 120%;
    /* Permite que o texto fique abaixo da imagem */
    aspect-ratio: auto;
    overflow: visible;
  }

  /* O wrapper deixa de ser absoluto para empilhar os blocos */
  .stack { position: static; inset: auto; }

  /* A área de imagem passa a controlar o aspecto */
  .layers {
    position: relative;
    inset: auto;
    width: 100%;
    /* Mantém proporção 830x720, ocupando 100% da largura da tela */
    height: auto;
    aspect-ratio: 830 / 720;
    border-radius: var(--section-radius);
    overflow: hidden; /* arredonda somente a imagem no mobile */
  }
  .layers img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  /* Igual ao desktop: curva, duração e delay da animação das imagens */
  .stack-section.is-visible .layers img {
    animation-duration: 900ms;
    animation-timing-function: cubic-bezier(.16,1,.3,1);
    animation-delay: calc(var(--i, 0) * 140ms);
  }

  /* Conteúdo abaixo da imagem, sem sobreposição */
  .content {
    position: static;
    position: relative; /* Necessário para o z-index funcionar */
    z-index: 2; /* Garante que o conteúdo fique sobre a imagem */
    display: block;
    margin-top: -80px; /* Puxa o bloco de conteúdo mais para cima */
  }

  /* Espaço consistente entre título e descrição no mobile */
  .title-box { margin-bottom: 20px; }

  .content-inner {
    width: 100%;
    padding: 3%;
  }

  /* Evita alinhamentos para a direita no mobile */
  .align-top-right .content-inner,
  .align-bottom-right .content-inner,
  .align-center-right .content-inner {
    text-align: left;
    margin-left: 0;
  }

  .title {
    font-size: 3rem;
    text-align: left;
    display: inline-block;
    white-space: nowrap; /* Impede que o título quebre em duas linhas */
    padding-left: 3%;
    padding-right: 3%;
  }
  .title-box {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    display: inline-block; /* encolhe ao tamanho do título */
  }
  /* Garante alinhamento à esquerda independentemente da variação de alinhamento */
  .align-top-right .title-box,
  .align-bottom-right .title-box,
  .align-center-right .title-box {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Alinhamento do conteúdo para direita + texto à direita */
.align-top-right .content-inner,
.align-bottom-right .content-inner,
.align-center-right .content-inner {
  text-align: right;   /* conteúdo alinhado à direita */
  margin-left: auto;   /* bloco encostado à direita do container */
}

.align-center-right { align-items: center; justify-items: end; align-content: center; }

/* Botão Voltar ao Topo */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  width: 50px;
  height: 50px;
  background-color: #3951ff; /* Azul da sombra chapada */
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  text-decoration: none;
  /* Inicialmente invisível e desabilitado */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 300ms ease, visibility 300ms ease, transform 300ms ease;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top svg {
  width: 28px;
  height: 28px;
}

/* --- Barra de Progresso de Rolagem --- */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 8px;
  background-color: #3951ff; /* Azul da sombra chapada */
  width: 0%; /* Começa com 0 e é atualizada via JS */
  z-index: 998; /* abaixo de headers externos com z-index 999 */
  transition: width 50ms ease-out; /* Suaviza a atualização da barra */
}

/* --- Efeito de Círculo que Segue o Mouse (Apenas Desktop) --- */

.mouse-follower {
  /* Escondido por padrão e em dispositivos touch */
  display: none;
}

/* Ativa o efeito apenas em dispositivos com ponteiro fino (mouse) */
@media (pointer: fine) {
  html, body, * {
  cursor: none !important;
  }
  
  .mouse-follower {
    display: block;
    position: fixed;
    z-index: 997; /* Abaixo do header externo e da barra de progresso */
    top: 0;
    left: 0;
    /* Centraliza o elemento exatamente no ponto (left/top) */
    transform: translate(-50%, -50%);
    width: 24px;   /* menor */
    height: 24px;  /* menor */
    opacity: 0.6;  /* opacidade de ~60% */

    /* Novo estilo: um anel em vez de um círculo sólido */
    background-color: transparent;
    border: 6px solid #3951ff; /* cor e espessura atualizadas */

    border-radius: 50%;

    /* Removemos o mix-blend-mode */

    /* Impede que o círculo intercepte cliques e outros eventos do mouse */
    pointer-events: none;

    /* Transição suave apenas para o tamanho (efeito de pulsar) */
    transition: width 300ms ease-out, height 300ms ease-out;
    will-change: width, height;

  }

  /* Estado quando o mouse está se movendo (CSS puro) */
  .mouse-follower.is-moving {
    width: 30px;   /* aumento mais sutil ao mover */
    height: 30px;
  }
}

/* --- Estilo para texto destacado (<b>) na descrição --- */
.description b {
  font-weight: 700;
  color: #3951ff; /* Cor inicial do texto (azul) */
  text-decoration: none; /* Remove qualquer sublinhado padrão */

  /* Cria o sublinhado usando um gradiente como imagem de fundo */
  background-image: linear-gradient(#3951ff, #3951ff);
  background-repeat: no-repeat;
  background-position: 0% 100%; /* Posição: esquerda, embaixo (para o sublinhado inicial) */
  background-size: 0% 100%; /* Largura 0%, altura 100% (começa invisível) */

  /* Transição suave para o tamanho do fundo e a cor do texto */
  transition: background-size 400ms ease, color 400ms ease;
}

/* Efeito ao passar o mouse */
.description b:hover {
  color: #ffffff; /* Muda a cor do texto para branco */
  background-size: 100% 100%; /* Expande a altura do fundo para 100% */
}

/* --- Efeito "Barrel Roll" para o texto do título (ano) --- */
.digit-roll {
  display: inline-block;
  /* Corta o texto que sai da área do dígito */
  overflow-y: clip;
  /* Garante que a altura seja de uma linha para o 'lh' funcionar */
  line-height: 1;
}

.digit-roll > span {
  display: block;
  /* Estado inicial: dígito transladado para cima, fora da vista */
  color: transparent; /* O texto começa transparente */
  transform: translateY(-100%);
  /* Sombra que simula o dígito "atrás", na posição final */
  text-shadow: 0 1.1em var(--title-bg); /* Usa a cor do título da seção */
  /* Transição suave para a posição final */
  transition: transform 800ms cubic-bezier(.22,.61,.36,1),
              color 1ms 800ms; /* Muda a cor para branco no final da animação */
  transition-delay: calc(var(--i, 0) * 100ms + 500ms); /* Atraso escalonado */
}

/* Quando a seção fica visível, os dígitos "rolam" para a posição final */
.stack-section.is-visible .digit-roll > span {
  transform: translateY(0);
  color: #ffffff; /* O texto se torna branco ao chegar na posição final */
}

/* --- Animação "engraçadinha" para o título ao clicar --- */

/* Define os passos da animação de "chacoalhar" */
@keyframes title-wobble {
  0% { transform: rotate(0deg); }
  15% { transform: rotate(-5deg); }
  30% { transform: rotate(5deg); }
  45% { transform: rotate(-3deg); }
  60% { transform: rotate(3deg); }
  75% { transform: rotate(-1deg); }
  100% { transform: rotate(0deg); }
}

/* Aplica a animação quando a classe .is-animating está presente */
.title-box.is-animating {
  /* Garante que a origem da transformação seja o centro para um "chacoalhar" mais natural */
  transform-origin: center;
  animation: title-wobble 0.8s ease-in-out;
}
