/* ==========================================================================
   CT Pilates Estúdios: base do site.
   Conceito "Controle": tipografia grande, respiro, composição assimétrica.
   Cor: só navy, coral, grafite, branco e derivados. Texto sobre coral é navy.
   Todo estado escondido depende de html.js: sem JS, nada fica invisível.
   ========================================================================== */

/* Fontes auto-hospedadas (variáveis, subconjunto latino) */
@font-face {
  font-family: "Playfair Display";
  src: url("/assets/fonts/playfair.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("/assets/fonts/playfair-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

/* Fallbacks com métrica próxima, para o texto não pular quando a fonte chega */
@font-face {
  font-family: "Playfair Fallback";
  src: local("Georgia");
  size-adjust: 105%;
  ascent-override: 103%;
  descent-override: 24%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Nunito Fallback";
  src: local("Arial");
  size-adjust: 101%;
  ascent-override: 100%;
  descent-override: 35%;
  line-gap-override: 0%;
}

:root {
  /* Marcas de fundo. Com JS, só valem perto da seção (.marca-perto, em main.js) */
  --marca-nitida: url("/assets/img/logo/monograma-coral-2000.webp");
  --marca-borrada: url("/assets/img/logo/monograma-coral-borrado.webp");

  /* Paleta do cliente */
  --navy: #252F55;
  --coral: #F09171;
  --grafite: #333333;
  --branco: #FFFFFF;

  /* Derivados: o hex é o fallback do color-mix logo abaixo */
  --navy-profundo: #1A213C;
  --off-white: #FEFAF8;
  --areia: #FDF2EE;
  --coral-claro: #F3A78D;

  --texto: var(--grafite);
  --texto-suave: var(--grafite);
  --titulo: var(--navy);
  --enfase: var(--navy);
  --fio: rgb(37 47 85 / .16);
  --foco: var(--navy);

  --serif: "Playfair Display", "Playfair Fallback", Georgia, "Times New Roman", serif;
  --sans: "Nunito", "Nunito Fallback", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  --margem-tela: clamp(1.25rem, 5.5vw, 5.5rem);
  /* Acima de 2200 px de largura útil, o conteúdo para de crescer */
  --margem: max(var(--margem-tela), calc((100vw - 2200px) / 2));
  --gutter: clamp(1rem, 1.7vw, 2rem);
  --respiro: clamp(5rem, 8.5vw, 8.5rem);
  /* Quanto a tela passa de 1700 px: é o que faz a tipografia subir em tela grande */
  --folga: max(0px, min(100vw, 2560px) - 1700px);

  --header-altura: 64px;
  --barra-altura: 80px;

  --ease-controle: cubic-bezier(.33, 0, .2, 1);
}

html[class*="modo-"] :is(#para-voce, #tour, #depoimentos):not(.marca-perto) {
  --marca-nitida: none;
  --marca-borrada: none;
}

@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --navy-profundo: color-mix(in srgb, #252F55 70%, black);
    --off-white: color-mix(in srgb, #F09171 5%, white);
    --areia: color-mix(in srgb, #F09171 12%, white);
    --coral-claro: color-mix(in srgb, #F09171 78%, white);
  }
}

/* O hero aprovado não se move, e o header acompanha */
.hero, .site-header {
  --margem: var(--margem-tela);
  --gutter: clamp(1rem, 1.7vw, 1.5rem);
  --folga: 0px;
}

/* Reset enxuto */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-variant-numeric: lining-nums; /* Playfair usa algarismos antigos por padrão */
  scroll-padding-top: var(--header-altura);
}

body {
  margin: 0;
  background: var(--off-white);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 450;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
/* O reset acima venceria o atributo hidden: esta regra garante o oculto */
[hidden] { display: none !important; }

h1, h2, h3, p, ul, ol, figure, blockquote, address, dl { margin: 0; padding: 0; }
ul, ol { list-style: none; }
address { font-style: normal; }
em { font-style: italic; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

main:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--foco);
  outline-offset: 3px;
}

/* Superfícies: cada uma define as próprias cores de texto */
.fundo-claro { background: var(--off-white); }
.fundo-areia { background: var(--areia); }
.fundo-navy,
.fundo-profundo,
.fundo-grafite {
  --texto: var(--branco);
  --texto-suave: rgb(255 255 255 / .86);
  --titulo: var(--branco);
  --enfase: var(--coral);
  --fio: rgb(255 255 255 / .22);
  --foco: var(--coral);
  color: var(--texto);
}
.fundo-navy { background: var(--navy); }
.fundo-profundo { background: var(--navy-profundo); }
.fundo-grafite { background: var(--grafite); }
.fundo-coral {
  --texto: var(--navy);
  --texto-suave: var(--navy);
  --titulo: var(--navy);
  --enfase: var(--navy);
  --fio: var(--navy);
  --foco: var(--navy);
  background: var(--coral);
  color: var(--navy);
}

/* Tipografia */
.titulo {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--titulo);
  line-height: 1.08;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.titulo em { color: var(--enfase); }
.titulo--xl { font-size: clamp(2.5rem, 5.6vw, calc(5.5rem + var(--folga) * .037)); }
.titulo--l { font-size: clamp(2.25rem, 4.2vw, calc(4.125rem + var(--folga) * .03)); }

.apoio {
  color: var(--texto-suave);
  font-size: 1.0625rem;
  max-width: min(32em, 100%);
  text-wrap: pretty;
}
.apoio--grande { font-size: clamp(1.1875rem, 1.5vw, calc(1.375rem + var(--folga) * .0047)); line-height: 1.5; }

/* Botões em pílula. Alvo de toque nunca abaixo de 48px */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: calc(52px + var(--folga) * .014);
  padding: .75rem 1.75rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: calc(1.0625rem + var(--folga) * .0035);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color .5s var(--ease-controle), color .5s var(--ease-controle), border-color .5s var(--ease-controle);
}
.btn--primario { background: var(--coral); color: var(--navy); }
.btn--primario:hover { background: var(--coral-claro); }
.btn--contorno { border-color: currentColor; color: var(--texto); background: transparent; }
.btn--contorno:hover { background: var(--branco); border-color: var(--branco); color: var(--navy); }
.btn--bloco { width: 100%; }
.btn--grande { min-height: calc(60px + var(--folga) * .014); padding: 1rem 2.25rem; font-size: calc(1.125rem + var(--folga) * .0035); }

/* Link de texto com seta. Em fundo claro é navy: coral nunca é texto no claro */
.link-seta {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  min-height: 48px;
  color: var(--titulo);
  font-weight: 800;
  text-decoration: none;
}
.link-seta .icone-seta { flex: none; transition: transform .5s var(--ease-controle); }
.link-seta:hover .icone-seta { transform: translateX(6px); }
.fundo-navy .link-seta, .fundo-grafite .link-seta { color: var(--coral); }

/* Marca de play dos vídeos */
.play {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--navy);
  transition: background-color .5s var(--ease-controle);
}
.play svg { margin-left: 3px; }
a:hover .play { background: var(--coral-claro); }

/* Pular para o conteúdo */
.pular-conteudo {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 200;
  padding: .75rem 1.25rem;
  background: var(--branco);
  color: var(--navy);
  font-weight: 800;
  transform: translateY(-200%);
}
.pular-conteudo:focus { transform: none; }

/* Texto só para leitor de tela */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  --foco: var(--coral);
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: var(--header-altura);
  padding-inline: var(--margem);
  background: var(--navy);
  color: var(--branco);
  transition: background-color .25s var(--ease-controle);
}
/* Véu de leitura: garante contraste do menu sobre foto e vídeo */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -32px;
  z-index: -1;
  background: linear-gradient(to bottom, rgb(26 33 60 / .62), rgb(26 33 60 / 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease-controle);
}
html.js .site-header--transparente { background: transparent; }
html.js .site-header--transparente::before { opacity: var(--veu-header, 1); }

.site-header__logo { display: block; flex: none; }
.site-header__logo img { width: auto; height: 50px; }

.site-header__menu-botao { display: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}
.site-nav__lista { display: flex; gap: clamp(1rem, 2.2vw, 2rem); }
.site-nav__lista a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-weight: 700;
  text-decoration: none;
}
.site-nav__lista a:hover { text-decoration: underline; }
.site-nav__cta { min-height: 44px; padding: .5rem 1.25rem; font-size: 1rem; white-space: nowrap; }

/* Celular e tablet: o header sai com a página e volta ao rolar para cima (main.js).
   Mesma altura nos dois estados: voltar ao topo não desloca o logo. Menu só com JS */
@media (max-width: 1023.98px) {
  html { scroll-padding-top: calc(60px + 1rem); }

  .site-header {
    position: absolute;
    background: transparent;
    height: 60px;
  }
  .site-header--fixo {
    position: fixed;
    transform: translateY(-100%);
  }
  html.js .site-header--fixo { background: var(--navy); }
  .site-header--armado {
    transition: transform .35s var(--ease-controle), background-color .35s var(--ease-controle);
  }
  .site-header--visivel,
  .site-header--fixo:focus-within { transform: none; }
  .site-header::before { display: none; }
  .site-header__logo img { height: 48px; }

  .site-nav { display: none; }

  html.js .site-header__menu-botao {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding-inline: .25rem;
    font-weight: 800;
  }

  html.js .site-nav.is-aberto {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2.5rem;
    padding: 6rem var(--margem) calc(2rem + env(safe-area-inset-bottom));
    background: var(--navy);
    overflow-y: auto;
  }
  .site-nav.is-aberto .site-nav__lista { flex-direction: column; gap: .25rem; }
  .site-nav.is-aberto .site-nav__lista a {
    font-family: var(--serif);
    font-size: clamp(2rem, 9vw, 2.75rem);
    font-weight: 400;
    line-height: 1.2;
    min-height: 56px;
  }
  .site-nav.is-aberto .site-nav__cta { min-height: 56px; width: 100%; max-width: 26rem; font-size: 1.125rem; }

  html.menu-aberto { overflow: hidden; }
  /* transform: none é obrigatório: com transform, o menu fixo ficaria preso ao header */
  html.menu-aberto .site-header { position: fixed; transform: none; }
}

/* --------------------------------------------------------------------------
   Barra de WhatsApp (abaixo de 1024px)
   -------------------------------------------------------------------------- */
.barra-wa {
  position: fixed;
  inset: auto 0 0;
  z-index: 40;
  display: none;
  padding: .625rem var(--margem) calc(.625rem + env(safe-area-inset-bottom));
  background: var(--navy);
  box-shadow: 0 -1px 0 rgb(255 255 255 / .14);
}
.barra-wa .btn { min-height: 56px; padding-inline: .75rem; font-size: 1rem; white-space: nowrap; }

@media (max-width: 1023.98px) {
  .barra-wa { display: block; }

  /* Com JS, a barra só aparece entre o CTA do hero e o CTA de contato */
  html.js .barra-wa {
    transform: translateY(105%);
    visibility: hidden;
    transition: transform .5s var(--ease-controle), visibility .5s;
  }
  html.js .barra-wa.is-visivel { transform: none; visibility: visible; }
  html.modo-estatico .barra-wa { transition: none; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  --foco: var(--coral);
  background: var(--navy-profundo);
  color: rgb(255 255 255 / .86);
  font-size: 1rem;
}
.site-footer__interno {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2.5rem var(--gutter);
  padding: clamp(3.5rem, 6vw, 5.5rem) var(--margem) 2.5rem;
}
.site-footer__marca { grid-column: 1 / span 3; }
.site-footer__marca img { width: 170px; height: auto; }
/* Mantida para leitores de tela e busca: o logo já mostra esta linha */
.site-footer__linha {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.site-footer__endereco { grid-column: 4 / span 3; }
.site-footer__contatos { grid-column: 7 / span 4; }
.site-footer__redes { grid-column: 11 / span 2; }
.site-footer__contatos a,
.site-footer__redes a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  overflow-wrap: anywhere;
}
.site-footer__copyright {
  grid-column: 1 / -1;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / .18);
  font-size: .9375rem;
}

@media (max-width: 1023.98px) {
  .site-footer__interno { grid-template-columns: 1fr; gap: 1.5rem; }
  .site-footer__marca,
  .site-footer__endereco,
  .site-footer__contatos,
  .site-footer__redes,
  .site-footer__copyright { grid-column: 1; }
  .site-footer__redes { display: flex; gap: 1.5rem; }
  /* Reserva a altura da barra: ela nunca cobre o conteúdo do rodapé */
  .site-footer { padding-bottom: calc(var(--barra-altura) + env(safe-area-inset-bottom)); }
}

/* --------------------------------------------------------------------------
   Player único de vídeo
   -------------------------------------------------------------------------- */
.video-dialog {
  --foco: var(--coral);
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--branco);
}
.video-dialog::backdrop { background: rgb(26 33 60 / .94); }
.video-dialog__interno {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  height: 100%;
  padding: max(.75rem, env(safe-area-inset-top)) 1rem max(.75rem, env(safe-area-inset-bottom));
}
.video-dialog__fechar {
  align-self: center;
  min-height: 48px;
  padding: .5rem 1.5rem;
  border: 1.5px solid var(--branco);
  border-radius: 999px;
  font-weight: 800;
  transition: background-color .5s var(--ease-controle), color .5s var(--ease-controle);
}
.video-dialog__fechar:hover { background: var(--branco); color: var(--navy); }
.video-dialog__video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100% - 60px);
  aspect-ratio: 608 / 1080;
  background: #000;
}

/* --------------------------------------------------------------------------
   Linha do logo: base estática. A Fase 2 anima o traçado.
   -------------------------------------------------------------------------- */
.linha {
  position: absolute;
  z-index: 2;
  display: none;
  overflow: visible;
  height: auto;
  max-width: none;
  pointer-events: none;
}
.linha path { fill: none; stroke: var(--coral); stroke-width: 1.5; stroke-linecap: round; }

/* Na base, só no desktop. A versão do celular (L1, L2 e L5) entra na Fase 2 */
@media (min-width: 1024px) {
  .linha { display: block; }
  .linha--l1 { right: 0; top: calc(100% - 3.2vw); width: 34vw; }
  /* L2 só existe traçada por autoridade.js, no modo-cine */
  .linha--l2 { display: none; }
  /* Com teto: em tela muito larga a linha entraria na coluna do texto */
  .linha--l3 { right: 0; bottom: calc(min(15vw, 18rem) / -3); width: min(15vw, 18rem); }
  /* Com teto: mais larga, a linha fica alta demais e cruza o último depoimento */
  .linha--l4 { right: 6vw; bottom: -4px; width: min(30vw, 36rem); }
  /* Teto de largura: mais alta que isto, a linha entraria na lista do faq */
  .linha--l5 { right: calc(100% - 6px); bottom: calc(100% - 4px); width: min(36vw, 30rem); }
}

/* --------------------------------------------------------------------------
   Página 404
   -------------------------------------------------------------------------- */
.pagina-404 {
  --titulo: var(--branco);
  --texto-suave: rgb(255 255 255 / .86);
  --foco: var(--coral);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1.5rem;
  min-height: 100vh;
  min-height: 100svh;
  padding: 7rem var(--margem) 4rem;
  background: var(--navy);
  color: var(--branco);
}

@media (min-width: 1024px) {
  body { font-size: calc(1.125rem + var(--folga) * .0035); }
  .apoio { font-size: calc(1.125rem + var(--folga) * .0047); }
  .apoio--grande { font-size: calc(1.125rem + var(--folga) * .0094); }
  /* O corpo cresce em tela grande, o header do hero aprovado não */
  .site-header { font-size: 1.125rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  html { scroll-behavior: auto; }
}
