/* Layout: página única, faixas alternadas; título em itálico Exo 2 ecoando o logo, emblema grande em círculo no topo; atendimento como sequência em coluna vertebral */
:root {
  /* Versão leve: fundo branco, títulos em azul, texto em cinza-azulado */
  --bg: #ffffff;
  --surface: #f1f6fa;
  --ink: #34495a;
  --heading: #3d77a0;
  --muted: #627888;
  --brand: #7cadce;
  --deep: #3d77a0;
  --link: #3d77a0;
  --line: #dce8f0;
  --rule: #a9c9df;
  --btn-bg: #3d77a0;
  --btn-fg: #ffffff;
  --btn-hover: #30658a;
  --band-bg: #e6f0f7;
  --band-fg: #2c5f84;
  --alert-bg: #fdeeea;
  --alert-fg: #8a2f1c;
  --alert-line: #e8b4a6;
  --header-bg: rgba(255, 255, 255, 0.95);
  --ring: rgba(61, 119, 160, 0.4);
  --gal-bg: #e6f0f7;
  --gal-fg: #2c5f84;
  --gal-muted: #4d6577;
  --gal-card: #dbe8f1;
  --star: #c98a04;
  --max: 1120px;
  --gutter: clamp(16px, 5vw, 56px);
  --display: "Exo 2", "Trebuchet MS", system-ui, sans-serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1822;
    --surface: #13222e;
    --ink: #e7eff5;
    --muted: #9db2c2;
    --deep: #8fbbdb;
    --link: #9cc4e0;
    --line: #243949;
    --btn-bg: #7cadce;
    --btn-fg: #0d1822;
    --btn-hover: #a3c8e2;
    --band-bg: #173246;
    --band-fg: #ffffff;
    --alert-bg: #2b1a16;
    --alert-fg: #f4b9aa;
    --alert-line: #5a3028;
    --header-bg: rgba(13, 24, 34, 0.95);
    --ring: rgba(124, 173, 206, 0.5);
    --heading: #e7eff5;
    --rule: #7cadce;
    --star: #f2b84b;
    --gal-bg: #10273a;
    --gal-fg: #eef4f9;
    --gal-muted: #a9bfd0;
    --gal-card: #163449;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1822;
  --surface: #13222e;
  --ink: #e7eff5;
  --muted: #9db2c2;
  --deep: #8fbbdb;
  --link: #9cc4e0;
  --line: #243949;
  --btn-bg: #7cadce;
  --btn-fg: #0d1822;
  --btn-hover: #a3c8e2;
  --band-bg: #173246;
  --band-fg: #ffffff;
  --alert-bg: #2b1a16;
  --alert-fg: #f4b9aa;
  --alert-line: #5a3028;
  --header-bg: rgba(13, 24, 34, 0.95);
    --ring: rgba(124, 173, 206, 0.5);
    --heading: #e7eff5;
    --rule: #7cadce;
    --star: #f2b84b;
    --gal-bg: #10273a;
    --gal-fg: #eef4f9;
    --gal-muted: #a9bfd0;
    --gal-card: #163449;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 30; background: var(--header-bg);
}

h1, h2, h3 { font-family: var(--display); color: var(--heading); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 600; line-height: 1.15; max-width: 24ch; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.25; }
p { margin: 0; }
a { color: var(--link); }
img { max-width: 100%; height: auto; }

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

.skip { position: absolute; left: -999px; top: 8px; background: var(--btn-bg); color: var(--btn-fg); padding: 8px 14px; z-index: 40; }
.skip:focus { left: 8px; }

.wrap {
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* Cabeçalho */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--header-bg); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-style: italic; font-size: 1.1rem; }
.brand img { height: 40px; width: auto; }
.top nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 20px; }
.top nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; padding: 6px 0; }
.top nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.top nav .nav-cta { background: var(--btn-bg); color: var(--btn-fg); padding: 8px 16px; border-radius: 6px; font-weight: 600; }
.top nav .nav-cta:hover { background: var(--btn-hover); color: var(--btn-fg); text-decoration: none; }

/* Botões */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn, .btn-ghost {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 1rem;
  padding: 14px 24px; border-radius: 6px; border: 2px solid var(--btn-bg);
}
.btn { background: var(--btn-bg); color: var(--btn-fg); }
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn-ghost { background: transparent; color: var(--link); }
.btn-ghost:hover { background: var(--surface); }

/* Topo */
.hero-in {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(24px, 5vw, 72px); align-items: center;
  padding-block: clamp(40px, 7vw, 96px);
}
.hero h1 {
  font-style: italic; font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.02; letter-spacing: -0.02em;
  color: var(--heading);
}
.lead { font-size: clamp(1.1rem, 1.9vw, 1.3rem); line-height: 1.5; max-width: 38ch; margin-top: 24px; }
.reg { margin-top: 18px; color: var(--muted); font-weight: 500; }
.hero-art { position: relative; margin: 0; max-width: 100%; }
.hero-art::before {
  content: ""; position: absolute; inset: 20px -20px -20px 20px; z-index: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.hero-art img {
  position: relative; z-index: 1; display: block; width: 100%; height: auto;
  aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; border-radius: 10px;
}

/* Fotos */
.foto-sobre, .foto-local, .band-foto { margin: 0; }
.foto-sobre { margin-bottom: 28px; }
.foto-local { margin-bottom: 24px; }
.foto-sobre img, .foto-local img, .band-foto img { display: block; width: 100%; height: auto; border-radius: 10px; }
.foto-sobre img { aspect-ratio: 4 / 3; object-fit: cover; }
.foto-local img { aspect-ratio: 3 / 2; object-fit: cover; }
.band-in { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.band-in > * { min-width: 0; }

/* Seções */
.block { padding-block: clamp(52px, 8vw, 96px); }
.block h2 { margin-bottom: 28px; }
.tint { background: var(--surface); }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.cols > * { min-width: 0; }
.block .cols h2 { max-width: none; }

.prose p + p { margin-top: 1.1em; }
.prose { max-width: 60ch; }

.formacao, .info { margin: 0; border-top: 2px solid var(--rule); }
.formacao > div, .info > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.formacao dt, .info dt { font-weight: 600; color: var(--deep); }
.formacao dd, .info dd { margin: 0; }
.hosp { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

/* Atendimento como coluna vertebral */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: etapa; display: grid; gap: 0; max-width: 60ch; }
.steps li { position: relative; counter-increment: etapa; padding: 0 0 36px 68px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(etapa); position: absolute; left: 0; top: 0; width: 46px; height: 32px; border-radius: 16px;
  display: grid; place-items: center; background: var(--bg); border: 2px solid var(--brand);
  font-family: var(--display); font-weight: 700; color: var(--deep);
}
.steps li::after { content: ""; position: absolute; left: 22px; top: 36px; bottom: 4px; width: 2px; background: var(--brand); }
.steps li:last-child::after { display: none; }
.steps p { margin-top: 6px; }

/* Atendimento com a foto do centro cirúrgico ao lado */
.atend-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.atend-grid > * { min-width: 0; }
.foto-cirurgia { margin: 0; overflow: hidden; border-radius: 10px; }
.foto-cirurgia img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; transition: transform 1s cubic-bezier(0.2, 0.7, 0.2, 1); }
.foto-cirurgia:hover img { transform: scale(1.04); }

/* Áreas */
.areas { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); }
.areas li { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); gap: 12px clamp(24px, 5vw, 64px); padding: 28px 0; border-bottom: 1px solid var(--line); }
.areas p { max-width: 58ch; }

/* Mapa */
.mapa { margin-top: clamp(36px, 5vw, 60px); }
.mapa h3 { margin-bottom: 16px; }
.mapa iframe {
  display: block; width: 100%; height: clamp(300px, 42vw, 420px); border: 0; border-radius: 10px;
  background: var(--surface);
}

/* Quando procurar */
.checks, .plain { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 28px; }
.checks li::before { content: ""; position: absolute; left: 4px; top: 0.6em; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.plain li { padding-left: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.alert { margin-top: 24px; padding: 16px 18px; border-radius: 6px; background: var(--alert-bg); color: var(--alert-fg); border: 1px solid var(--alert-line); }
.mini { margin: 24px 0 12px; font-size: 1.05rem; }
#consulta h2 { margin-bottom: 20px; }
.checks + .alert { max-width: 52ch; }
.cols > div > h2 { margin-bottom: 24px; }

/* Perguntas frequentes */
.faq { max-width: 780px; border-top: 2px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative;
  font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 1.6rem; font-weight: 400; color: var(--deep); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 40px 22px 0; max-width: 62ch; }

/* Chamada final */
.band { background: var(--band-bg); color: var(--band-fg); padding-block: clamp(52px, 8vw, 88px); }
.band h2 { max-width: 20ch; }
.band-lead { margin-top: 14px; font-size: 1.2rem; max-width: 42ch; }
.band .btn { background: var(--band-fg); color: var(--band-bg); border-color: var(--band-fg); }
.band .btn:hover { background: var(--surface); border-color: var(--surface); color: var(--deep); }
.band .btn-ghost { color: var(--band-fg); border-color: var(--band-fg); }
.band .btn-ghost:hover { background: rgba(44, 95, 132, 0.08); }
.band :focus-visible { outline-color: var(--band-fg); }

/* Rodapé */
footer { padding-block: 40px 96px; }
.foot { display: grid; gap: 14px; }
.small { font-size: 0.88rem; color: var(--muted); max-width: 70ch; }

/* Botão flutuante */
.float-cta {
  position: fixed; z-index: 25;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--btn-bg); color: var(--btn-fg); text-decoration: none; font-weight: 600;
  padding: 12px 18px; border-radius: 999px; box-shadow: 0 4px 16px rgba(18, 33, 46, 0.28);
}
.float-cta:hover { background: var(--btn-hover); }

/* Galeria: do consultório ao centro cirúrgico */
.galeria { background: var(--gal-bg); color: var(--gal-fg); }
.galeria h2 { color: var(--gal-fg); }
.galeria-lead { max-width: 56ch; margin-bottom: 32px; color: var(--gal-muted); font-size: 1.1rem; }
.galeria-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 18px); align-items: start; padding-bottom: 40px; }
.galeria-grid figure { margin: 0; overflow: hidden; border-radius: 10px; background: var(--gal-card); }
.galeria-grid figure:nth-child(3n+2) { margin-top: 40px; margin-bottom: -40px; }
.galeria-grid img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; transition: transform 1s cubic-bezier(0.2, 0.7, 0.2, 1); }
.galeria-grid figure:hover img { transform: scale(1.04); }
@media (max-width: 820px) {
  .galeria-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 0; }
  .galeria-grid figure:nth-child(3n+2) { margin-top: 0; margin-bottom: 0; }
}

/* Avaliações do Google em carrossel (prints) */
.av-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: 28px; }
.av-head h2 { margin-bottom: 20px; }
.av-lead { color: var(--muted); max-width: 56ch; }
.av-setas { display: flex; gap: 10px; }
.av-seta {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  background: var(--bg); color: var(--heading); border: 1.5px solid var(--rule);
  transition: background-color 0.2s, transform 0.2s, border-color 0.2s;
}
.av-seta:hover { background: var(--surface); border-color: var(--heading); transform: translateY(-2px); }
.av-carrossel { position: relative; }
.av-track {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 6px 2px 16px; scrollbar-width: none; align-items: center;
}
.av-track::-webkit-scrollbar { display: none; }
.av-card { flex: 0 0 calc((100% - 20px) / 2); min-width: 0; margin: 0; scroll-snap-align: start; }
/* O fundo branco é do próprio print do Google, por isso fica igual nos dois temas */
.av-print {
  display: block; width: 100%; padding: 12px; cursor: zoom-in; font: inherit;
  background: #ffffff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 6px 18px rgba(18, 41, 59, 0.08); transition: transform 0.25s, box-shadow 0.25s;
}
.av-print:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(18, 41, 59, 0.14); }
.av-print img { display: block; width: 100%; height: auto; }
.av-nota { margin-top: 18px; }
@media (max-width: 1000px) { .av-card { flex-basis: min(100%, 680px); } }
@media (max-width: 640px) { .av-card { flex-basis: 92%; } }

/* Avaliação ampliada */
.av-zoom { width: min(92vw, 720px); max-height: 90vh; padding: 0; border: 0; border-radius: 14px; background: var(--bg); color: var(--ink); }
.av-zoom::backdrop { background: rgba(10, 22, 33, 0.72); }
.av-zoom-in { display: grid; gap: 14px; padding: 18px 20px 24px; }
.av-zoom-img { width: 100%; height: auto; background: #ffffff; border: 1px solid var(--line); border-radius: 10px; }
.av-zoom-quem { font-weight: 600; color: var(--heading); }
.av-zoom-texto { font-size: 1.02rem; }
.av-fechar {
  justify-self: end; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); color: var(--heading); border: 1px solid var(--line); cursor: pointer;
}

/* Movimento: o conteúdo já nasce visível; só o movimento é acrescentado */
:root { interpolate-size: allow-keywords; }

/* Topo: uma entrada coreografada */
.hero { position: relative; overflow: hidden; }
.hero-in { position: relative; z-index: 1; }
.hero h1 .ln { display: block; overflow: hidden; padding: 0.04em 0.08em 0.14em; margin: -0.04em -0.08em -0.14em; }
.hero h1 .ln > span { display: block; animation: ln-up 0.95s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(0.1s + var(--i, 0) * 0.14s); }
.lead { animation: fade-up 0.8s ease-out 0.55s both; }
.reg { animation: fade-up 0.8s ease-out 0.68s both; }
.hero .actions { animation: fade-up 0.8s ease-out 0.8s both; }
.hero-art img { animation: photo-in 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s both; }
.hero-art::before { animation: frame-in 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.6s both; }
/* Com o topo fora da tela, as animações pausam em estado final; ao voltar, recomeçam */
.hero.rest *, .hero.rest *::before { animation: none !important; }
@keyframes ln-up { from { transform: translateY(108%); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } }
@keyframes photo-in {
  from { clip-path: inset(100% 0 0 0 round 10px); transform: scale(1.06); }
  to { clip-path: inset(0 0 0 0 round 10px); transform: scale(1); }
}
@keyframes frame-in { from { opacity: 0; transform: translate(-22px, -22px); } }

/* Linha neural no pé do topo, como os circuitos do cérebro do logo */
.neuro { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(64px, 9vw, 112px); pointer-events: none; opacity: 0.55; }
.neuro path {
  fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; animation: draw 2.6s cubic-bezier(0.4, 0, 0.2, 1) both; animation-delay: calc(0.9s + var(--i, 0) * 0.25s);
}
.neuro circle {
  fill: var(--brand); transform-box: fill-box; transform-origin: center;
  animation: pop 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.5) both; animation-delay: calc(1.6s + var(--i, 0) * 0.3s);
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(0); } }

/* Ao rolar: blocos sobem e aparecem; só entra em ação se o navegador permitir */
html.anim .reveal {
  opacity: 0.45; transform: translateY(22px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--d, 0) * 70ms);
}
html.anim .reveal.in { opacity: 1; transform: none; }

/* Traço sob cada título */
.block h2::after { content: ""; display: block; width: 56px; height: 3px; margin-top: 16px; border-radius: 2px; background: var(--brand); transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s; }
html.anim .block h2.reveal:not(.in)::after { width: 0; }

/* Atendimento: a coluna desce e cada etapa se acende */
html.anim .steps li::after { transform: scaleY(0); transform-origin: top; transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.3s; }
html.anim .steps li.in::after { transform: scaleY(1); }
html.anim .steps li::before { transform: scale(0.6); transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) 0.1s; }
html.anim .steps li.in::before { transform: scale(1); }

/* Microinterações */
.btn, .btn-ghost { transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s; }
.btn:hover, .btn-ghost:hover { transform: translateY(-2px); }
.areas li h3 { transition: color 0.25s, transform 0.25s; }
.areas li:hover h3 { color: var(--deep); transform: translateX(6px); }
.foto-sobre, .foto-local { overflow: hidden; border-radius: 10px; }
.foto-sobre img, .foto-local img { transition: transform 1s cubic-bezier(0.2, 0.7, 0.2, 1); }
.foto-sobre:hover img, .foto-local:hover img { transform: scale(1.04); }
.top { transition: box-shadow 0.3s; }
.top.scrolled { box-shadow: 0 8px 24px rgba(18, 33, 46, 0.1); }
.faq details::details-content { block-size: 0; overflow: clip; transition: block-size 0.35s ease, content-visibility 0.35s allow-discrete; }
.faq details[open]::details-content { block-size: auto; }
.float-cta { animation: ring 1.8s ease-out 5s 3; }
@keyframes ring {
  from { box-shadow: 0 4px 16px rgba(18, 33, 46, 0.28), 0 0 0 0 var(--ring); }
  to { box-shadow: 0 4px 16px rgba(18, 33, 46, 0.28), 0 0 0 18px rgba(0, 0, 0, 0); }
}

/* Celular */
@media (max-width: 820px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); }
  .hero-art { max-width: 340px; margin-right: 20px; }
  .cols, .areas li, .band-in, .atend-grid { grid-template-columns: minmax(0, 1fr); }
  .formacao > div, .info > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .top nav { gap: 2px 14px; }
  .top nav a { font-size: 0.9rem; }
}
@media (max-width: 480px) {
  .float-cta span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .float-cta { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
