/* ══════════════════════════════════════════════════════════
   Dr. Lucas Andrade · Harmonização Facial
   Tokens do projeto + Navegação flutuante (Liquid Glass)
   + HERO editorial (Seção 1)
   ══════════════════════════════════════════════════════════ */

:root {
  /* Tipografia */
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Jost", system-ui, -apple-system, sans-serif;

  /* Paleta */
  --creme-a: #F8F5EF;
  --creme-b: #F4EEE4;
  --ink: #232323;        /* títulos */
  --body: #5F5B55;       /* corpo */
  --gold: #A78D67;       /* acento decorativo (não para texto) */
  --gold-text: #7E6440;  /* texto em fundo creme: 5.10:1 AA */
  --gold-text-dark: #C2A87A; /* texto em painel escuro: 6.18:1 AAA */
  --muted: #6D685E;      /* texto secundário: 4.96:1 AA */
  --green: #1F3A2B;      /* painel de segurança das páginas de protocolo (.p-green) */
  --white: #FFFFFF;      /* Seção 4 */
  --btn-dark: #2C2B29;

  /* Geometria global de imagens: curvas generosas e consistentes
     (aproximação da "Golden Radius / Euler curve" — nunca cantos duros) */
  --radius-img: clamp(22px, 2.6vw, 40px);
  --radius-frame: clamp(30px, 3.6vw, 54px);

  /* Progresso do scroll da hero (0 → 1) atualizado via JS */
  --hero-progress: 0;
}

/* ─────────── reset enxuto ─────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--creme-b); /* rede de segurança contra overscroll/paint */
}

body {
  font-family: var(--font-body);
  color: var(--body);
  background: linear-gradient(180deg, var(--creme-a) 0%, var(--creme-b) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* âncoras respiram ao receber o scroll suave */
#inicio, #sobre, #procedimentos, #resultados, #contato { scroll-margin-top: 24px; }

/* ══════════════════════ SKIP-LINK · ACESSIBILIDADE ══════════════════════ */
.skip-link {
  position: fixed;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 12px 24px;
  background: var(--gold-text);
  color: var(--creme-a);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.3s ease;
}
.skip-link:focus {
  top: 18px;
}

/* ══════════════════════ NAVEGAÇÃO FLUTUANTE · LIQUID GLASS ══════════════════════ */
.glass-nav {
  position: fixed;
  top: clamp(18px, 3vh, 34px);
  left: 50%;
  transform: translate(-50%, 0) scale(1);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 1.4vw, 14px);
  height: 60px;
  padding: 0 9px 0 clamp(18px, 2.2vw, 28px);
  border-radius: 999px;

  /* vidro líquido: translucidez + blur forte + brilhos internos suaves */
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 14px 44px -20px rgba(35, 30, 24, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);

  transition:
    opacity 0.45s ease-out,
    transform 0.45s ease-out,
    filter 0.45s ease-out;
  will-change: opacity, transform, filter;
}

.glass-nav__link {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--btn-dark);
  opacity: 0.82;
  padding: 8px 8px;
  border-radius: 999px;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}
.glass-nav__link:hover { opacity: 1; }
.glass-nav__link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* botão circular de telefone (sem texto) */
.glass-nav__phone {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--btn-dark);
  display: grid;
  place-items: center;
  flex: none;
  transition: transform 0.35s cubic-bezier(0.22, 0.7, 0.2, 1),
              background 0.35s ease, box-shadow 0.35s ease;
}
.glass-nav__phone svg { width: 17px; height: 17px; fill: #F8F5EF; }
.glass-nav__phone:hover {
  background: #3a3835;
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.45);
}
.glass-nav__phone:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* entrada suave (fade + leve movimento ascendente) */
.js .glass-nav {
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.99);
  filter: blur(6px);
}
.glass-nav.is-in {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  filter: blur(0);
}
/* retração premium ao alcançar a Seção 2 (por último: vence o .is-in) */
.glass-nav.glass-nav--hidden {
  opacity: 0;
  transform: translate(-50%, -14px) scale(0.98);
  filter: blur(6px);
  pointer-events: none;
}

/* ══════════════════════ CTA FLUTUANTE · ESFERA CRISTAL LÍQUIDO ══════════════════════ */
.fab {
  position: fixed;
  right: clamp(20px, 3vw, 40px);
  bottom: clamp(20px, 3vw, 40px);
  z-index: 95;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;

  /* alto contraste (igual ao CTA da navbar) + leve toque de vidro/cristal */
  background: rgba(38, 37, 33, 0.94);
  -webkit-backdrop-filter: blur(6px) saturate(1.5) brightness(1.05);
  backdrop-filter: blur(6px) saturate(1.5) brightness(1.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 14px 26px -14px rgba(20, 16, 12, 0.4),    /* sombra bem leve — sensação de suspensão */
    inset 0 2px 5px rgba(255, 255, 255, 0.28),   /* luz superior (topo da esfera) */
    inset 0 -8px 14px rgba(0, 0, 0, 0.32),       /* profundidade inferior */
    inset 0 0 0 1px rgba(255, 255, 255, 0.10);   /* aro */

  /* entrada só por opacity (transform quebraria a refração) */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease-out, visibility 0.55s, background 0.35s ease, box-shadow 0.35s ease;
  /* flutuação contínua (+20% de amplitude): will-change avisa o compositor
     de antemão, já que este transform roda para sempre enquanto o FAB
     está em cena (mesmo raciocínio já aplicado a .hero__frame e .glass-nav) */
  will-change: transform;
  animation: fabFloat 5.5s ease-in-out infinite;
}
.fab--in { opacity: 1; visibility: visible; }

/* glint especular (reflexo de luz no alto-esquerda) */
.fab::before {
  content: "";
  position: absolute; inset: 0; border-radius: 50%;
  z-index: 1; pointer-events: none;
  background: radial-gradient(44% 44% at 33% 26%,
    rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.10) 52%, transparent 72%);
  animation: fabGlint 7s ease-in-out infinite;
}
/* brilho líquido girando (sensação de cristal líquido, sutil sobre o fundo escuro) */
.fab::after {
  content: "";
  position: absolute; inset: 0; border-radius: 50%;
  z-index: 1; pointer-events: none; mix-blend-mode: screen;
  background:
    radial-gradient(58% 40% at 62% 82%, rgba(255, 255, 255, 0.14) 0%, transparent 62%),
    conic-gradient(from 210deg, transparent 0deg, rgba(255, 255, 255, 0.14) 42deg,
      transparent 96deg, transparent 250deg, rgba(255, 255, 255, 0.10) 300deg, transparent 344deg);
  animation: fabSheen 9s linear infinite;
}

.fab__icon {
  position: relative;
  z-index: 3;
  width: 18px; height: 18px;
  fill: #F8F5EF; /* branco, alto contraste sobre o fundo escuro — igual ao CTA da navbar */
}

.fab:hover {
  background: rgba(52, 50, 46, 0.97);
  box-shadow:
    0 16px 30px -14px rgba(20, 16, 12, 0.46),
    inset 0 2px 6px rgba(255, 255, 255, 0.32),
    inset 0 -8px 14px rgba(0, 0, 0, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.fab:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

@keyframes fabFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7.2px); } }
@keyframes fabGlint {
  0%, 100% { transform: translate(0, 0); opacity: 0.9; }
  50% { transform: translate(2px, 3px); opacity: 1; }
}
@keyframes fabSheen { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .fab { width: 40px; height: 40px; }
  .fab__icon { width: 16px; height: 16px; }
}

/* ══════════════════════ BOTÕES ══════════════════════ */
.btn {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.01em;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 0.4s cubic-bezier(0.22, 0.7, 0.2, 1),
              background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  will-change: transform;
}
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.btn--primary {
  background: var(--btn-dark);
  color: var(--white);
  padding: 18px 36px;
}
.btn--primary:hover {
  background: #3a3835;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -14px rgba(35, 35, 35, 0.5);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(44, 43, 41, 0.18);
  padding: 18px 34px;
}
.btn--ghost:hover { background: rgba(44, 43, 41, 0.04); transform: translateY(-2px); }

/* ══════════════════════ HERO · EDITORIAL ══════════════════════ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 720px;
  padding: clamp(14px, 2.2vw, 36px);
  display: flex;
}

/* o retrato como objeto: card de curvas generosas */
.hero__frame {
  position: relative;
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius-frame);
  display: flex;
  align-items: center;
  background: #E8DFD0;
  box-shadow: 0 34px 90px -48px rgba(50, 40, 28, 0.4);
  transform: scale(calc(1 - var(--hero-progress) * 0.028));
  will-change: transform;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* enquadra rosto e tronco; evita cortes estranhos */
  object-position: 50% 16%;
}

/* vinheta MUITO sutil, apenas para legibilidade da tipografia */
.hero__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(92deg, rgba(30, 26, 21, 0.55) 0%, rgba(30, 26, 21, 0.26) 36%, rgba(30, 26, 21, 0) 64%),
    linear-gradient(180deg, rgba(30, 26, 21, 0.14) 0%, rgba(30, 26, 21, 0) 24%, rgba(30, 26, 21, 0) 72%, rgba(30, 26, 21, 0.2) 100%);
}

/* texto sobre a fotografia — hierarquia editorial, branco */
.hero__text {
  position: relative;
  z-index: 2;
  max-width: 620px;
  padding: 0 24px 0 clamp(40px, 6.5vw, 104px);
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #C9B08B; /* dourado clareado p/ contraste sobre a foto */
  margin-bottom: 24px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 5.6vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: #F8F5EF;
  text-shadow: 0 2px 28px rgba(20, 16, 12, 0.22);
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: block; }
.hero__title em { font-style: italic; font-weight: 500; }

.hero__lead {
  max-width: 480px;
  font-size: 18px;
  line-height: 1.75;
  color: rgba(248, 245, 239, 0.88);
  margin-top: 30px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 38px;
}

/* na hero, o CTA principal é claro sobre a fotografia */
.hero .btn--primary { background: var(--creme-a); color: var(--ink); }
.hero .btn--primary:hover {
  background: #FFFFFF;
  box-shadow: 0 14px 30px -14px rgba(20, 16, 12, 0.4);
}
.hero .btn--ghost { border-color: rgba(248, 245, 239, 0.38); color: #F8F5EF; }
.hero .btn--ghost:hover { background: rgba(248, 245, 239, 0.09); }

.hero__trust {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: rgba(248, 245, 239, 0.75);
  margin-top: 30px;
}
.hero__trust-rule {
  flex: none;
  width: 26px;
  height: 1px;
  background: #C9B08B;
  opacity: 0.8;
}

/* ── Componente compartilhado: CTA discreto do Instagram ──
   Usado na Hero (sobre a fotografia) e no painel escuro da Seção 5.
   Vidro: refrata a superfície atrás, funcionando sobre qualquer tom.
   Em repouso é só o glifo; no hover expande revelando o @. */
.ig-pill {
  height: 40px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: rgba(248, 245, 239, 0.8);
  background: rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 12px 28px -16px rgba(20, 16, 12, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: color 0.4s ease, background 0.4s ease, border-color 0.4s ease,
              transform 0.4s cubic-bezier(0.22, 0.7, 0.2, 1);
}
.ig-pill__icon {
  width: 18px; height: 18px; flex: none;
  stroke: currentColor; fill: none;
  stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
}
.ig-pill__handle {
  font-family: var(--font-body);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: 0;
  margin-left: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.5s cubic-bezier(0.22, 0.7, 0.2, 1),
              margin-left 0.5s cubic-bezier(0.22, 0.7, 0.2, 1),
              opacity 0.35s ease;
}
.ig-pill:hover, .ig-pill:focus-visible {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.17);
  border-color: rgba(255, 255, 255, 0.27);
  transform: translateY(-2px);
}
.ig-pill:hover .ig-pill__handle,
.ig-pill:focus-visible .ig-pill__handle {
  max-width: 170px;
  margin-left: 9px;
  opacity: 1;
}
.ig-pill:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* posicionamento na Hero: contrapeso do monograma na diagonal */
.hero__ig {
  position: absolute;
  z-index: 3;
  right: clamp(20px, 3vw, 40px);
  bottom: clamp(20px, 3vw, 40px);
}

/* marca-d'água oficial entre a Seção 1 e a Seção 2 (canto inferior-esquerdo) */
.hero__watermark {
  position: absolute;
  z-index: 3;
  left: clamp(12px, 3vw, 52px);
  bottom: clamp(-120px, -8vw, -56px);
  width: clamp(240px, 26vw, 420px);
  height: auto;
  opacity: 0.15;
  pointer-events: none;
  user-select: none;
}

/* ══════════════════════ Reveal de entrada ══════════════════════ */
/* Estado inicial escondido só quando há JS (sem JS, conteúdo visível) */
.js .hero__frame { opacity: 0; }
.js .hero__title .line > span {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(8px);
}
.js .eyebrow, .js .hero__lead, .js .hero__actions, .js .hero__trust {
  opacity: 0;
  transform: translateY(16px);
}
.js .hero__watermark { opacity: 0; }
/* fade puro (sem transform) — deixa o transform livre para o hover */
.js .hero__ig { opacity: 0; }

.hero.is-ready .hero__frame {
  animation: frameIn 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) 0.05s forwards;
}
.hero.is-ready .hero__title .line > span {
  animation: revealLine 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hero.is-ready .eyebrow,
.hero.is-ready .hero__lead,
.hero.is-ready .hero__actions,
.hero.is-ready .hero__trust {
  animation: revealSoft 1s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hero.is-ready .eyebrow { animation-delay: 0.45s; }
.hero.is-ready .hero__title .line:nth-child(1) > span { animation-delay: 0.6s; }
.hero.is-ready .hero__title .line:nth-child(2) > span { animation-delay: 0.75s; }
.hero.is-ready .hero__lead   { animation-delay: 1.1s; }
.hero.is-ready .hero__actions{ animation-delay: 1.25s; }
.hero.is-ready .hero__trust  { animation-delay: 1.4s; }
.hero.is-ready .hero__watermark { animation: watermarkIn 1.6s ease 1.3s forwards; }
.hero.is-ready .hero__ig { animation: frameIn 0.9s ease 1.55s forwards; }

@keyframes frameIn { to { opacity: 1; } }
@keyframes revealLine {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes revealSoft {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes watermarkIn { to { opacity: 0.15; } }

/* ══════════════════════ Responsivo ══════════════════════ */
@media (max-width: 860px) {
  .hero__frame { align-items: flex-end; }
  .hero__text {
    max-width: 560px;
    /* respiro extra na base: reserva a faixa do CTA do Instagram (canto inferior-direito) */
    padding: 0 26px clamp(78px, 10vh, 104px);
  }
  .hero__title { font-size: clamp(40px, 9.4vw, 64px); }
  .hero__lead { font-size: 17px; margin-top: 24px; }
  .hero__vignette {
    background:
      linear-gradient(0deg, rgba(30, 26, 21, 0.58) 0%, rgba(30, 26, 21, 0.22) 42%, rgba(30, 26, 21, 0) 66%),
      linear-gradient(180deg, rgba(30, 26, 21, 0.16) 0%, rgba(30, 26, 21, 0) 26%);
  }
}

@media (max-width: 560px) {
  .hero { padding: 10px; min-height: 620px; }
  .hero__actions { gap: 12px; margin-top: 30px; }
  .hero__actions .btn { flex: 1 1 auto; text-align: center; padding: 16px 22px; }
  .hero__watermark { width: clamp(190px, 54vw, 300px); bottom: -58px; }
}

/* navegação flutuante em telas menores: mesma estética, mais compacta */
@media (max-width: 720px) {
  .glass-nav { height: 52px; gap: 4px; padding: 0 7px 0 14px; }
  .glass-nav__link { font-size: 12.5px; letter-spacing: 0.02em; padding: 6px 6px; }
  .glass-nav__phone { width: 36px; height: 36px; }
  .glass-nav__phone svg { width: 15px; height: 15px; }
}
@media (max-width: 430px) {
  /* colapso elegante: "Início" sai (voltar ao topo é gesto natural).
     $= e não =: nas páginas de protocolo o link é "../index.html#inicio",
     e a nav estourava a viewport porque o seletor exato não casava. */
  .glass-nav__link[href$="#inicio"] { display: none; }
}

/* ══════════════════════ Acessibilidade ══════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero__frame,
  .hero__title .line > span,
  .eyebrow, .hero__lead, .hero__actions, .hero__trust, .hero__ig {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .hero__watermark { opacity: 0.15 !important; }
}
