/*
  HARA ODONTOLOGIA — sistema de design
  Tese: "Luz natural de consultório, sem frieza." Editorial-cinematográfico:
  fotografia real, serifa de display, muito ar, hairlines. Evitados de propósito:
  azul-bebê, dente vetorizado, degradê de "sorriso perfeito", cards idênticos.

  PALETA (OKLCH aproximado em hex; razões de contraste sobre --paper)
  --paper  #F4EEE4  fundo linho quente (nunca #fff)
  --paper2 #EBE3D5  faixas alternadas
  --ink    #221D18  texto (≈15:1)
  --muted  #5C5348  texto secundário (≈6.6:1)
  --accent #1E4639  verde-esmeralda profundo, único accent (≈9.3:1)
  --dark   #17140F  footer / sobreposição da hero
  --edge   rgba(34,29,24,.16)  hairlines

  TIPOGRAFIA
  Display: Instrument Serif 400 (com UMA palavra em itálico por título)
  Body: Inter · Mono: Geist Mono caixa alta +0.14em para labels.
  Escala fluida com clamp().

  GRID / ESPAÇO
  Container 1240px, gutter fluido; seções clamp(64px, 9vw, 120px); gap em tudo.
  Escala 8/12/16/24/32/48. Raios: pill 999, mídia 16px (acolhedor),
  nada de raios variados.

  MOTION
  Reveal de 0.7s com cubic-bezier(.16,1,.3,1), só translateY curto + opacity.
  Nav ganha blur ao rolar. prefers-reduced-motion desliga tudo.
*/

:root {
  --paper: #F4EEE4;
  --paper2: #EBE3D5;
  --ink: #221D18;
  --muted: #5C5348;
  --accent: #1E4639;
  --dark: #17140F;
  --on-dark: #F4EEE4;
  --on-dark-muted: #BFB6A8;
  --edge: rgba(34, 29, 24, .16);
  --edge-dark: rgba(244, 238, 228, .16);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-display: clamp(2.75rem, 1.6rem + 5.2vw, 5.75rem);
  --fs-h2: clamp(2rem, 1.3rem + 3vw, 3.75rem);
  --fs-h3: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --fs-lede: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  --fs-mono: .75rem;

  --pad: clamp(64px, 9vw, 120px);
  --gutter: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --r: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.5 var(--sans); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure, address { margin: 0; padding: 0; }
ul, ol { list-style: none; }
address { font-style: normal; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.foot :focus-visible { outline-color: var(--on-dark); }

.skip { position: absolute; left: 16px; top: -64px; z-index: 100; background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 999px; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- tipografia ---------- */
.display { font-family: var(--serif); font-weight: 400; line-height: 1.06; letter-spacing: -.01em; }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); line-height: 1.1; }
.display em { color: var(--accent); }
.mono, .eyebrow, .doc__meta {
  font: 600 var(--fs-mono)/1.4 var(--mono); text-transform: uppercase; letter-spacing: .14em;
}
.eyebrow { display: flex; align-items: center; gap: 12px; color: var(--accent); margin-bottom: 24px; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; opacity: .7; }
.lede { font-size: var(--fs-lede); line-height: 1.6; color: var(--muted); max-width: 580px; margin-top: 24px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 28px;
  font: 500 1rem/1 var(--sans); border: 1.5px solid transparent; border-radius: 999px;
  transition: transform .2s var(--ease), background-color .2s, color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn--pill { background: var(--accent); color: var(--paper); box-shadow: 0 8px 24px -8px rgba(30, 70, 57, .45); }
.btn--pill:hover { background: var(--ink); }
.btn--sm { min-height: 44px; padding: 0 20px; font-size: .9375rem; }
.btn--lg { min-height: 56px; padding: 0 32px; text-align: center; line-height: 1.3; }
.btn--ghost { border-color: currentColor; background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.cta-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 40px; }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; transition: background-color .3s, border-color .3s, color .3s; color: var(--ink); border-bottom: 1px solid transparent; }
.nav.is-scrolled, .nav.is-open { background: rgba(244, 238, 228, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--ink); border-bottom-color: var(--edge); }
.nav__in { max-width: 1240px; margin-inline: auto; padding: 12px var(--gutter); display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; font: 400 1.75rem/1 var(--serif); letter-spacing: -.01em; }
.wordmark__logo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--paper2); }
.wordmark__logo.is-missing { display: none; }
.nav__links { display: flex; align-items: center; gap: 32px; font-size: .9375rem; }
.nav__links a:not(.btn) { opacity: .88; padding: 8px 0; }
.nav__links a:not(.btn):hover { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }
.nav__toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; background: none; border: 0; color: inherit; cursor: pointer; border-radius: 50%; }
.nav__toggle .i-close { display: none; }
.nav.is-open .i-close { display: block; }
.nav.is-open .i-open { display: none; }

@media (max-width: 800px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute; inset: 100% 0 auto; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 24px; background: var(--paper); color: var(--ink);
    border-bottom: 1px solid var(--edge); display: none;
  }
  .nav.is-open .nav__links { display: flex; }
  .nav__links a:not(.btn) { padding: 16px 0; border-bottom: 1px solid var(--edge); font-size: 1.0625rem; }
  .nav__links .btn { margin-top: 16px; }
}

/* ---------- mídia com fallback quente ---------- */
.media { position: relative; overflow: hidden; background-color: var(--paper2); border-radius: var(--r); isolation: isolate; }
.media::before { /* hairlines visíveis só quando a foto falta */
  content: ""; position: absolute; inset: 12px; border: 1px solid var(--edge); border-radius: 2px; z-index: -1;
  background: linear-gradient(to top right, transparent calc(50% - .5px), var(--edge) 50%, transparent calc(50% + .5px));
}
.media__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media__img.is-missing { display: none; }

/* ---------- hero ---------- */
/* duas colunas: texto e foto em retrato (512x640) com moldura; sem foto ampliada */
.hero { position: relative; isolation: isolate; padding-top: 64px; overflow: hidden;
  background: radial-gradient(60% 50% at 78% 38%, rgba(235, 227, 213, .95), transparent 70%), var(--paper); }
.hero__in { display: grid; gap: 48px; align-items: center; padding-block: clamp(40px, 6vw, 72px) var(--pad); }
.hero__title { font-size: var(--fs-display); max-width: 14ch; }
.hero .lede { max-width: 52ch; }
.hero__fig { position: relative; margin: 0; width: min(100%, 512px); justify-self: center; }
.hero__frame { aspect-ratio: 4 / 5; border: 1px solid var(--edge); box-shadow: 0 30px 60px -30px rgba(34, 29, 24, .45); }
.hero__card {
  position: absolute; left: -16px; bottom: 24px; max-width: calc(100% - 16px); display: grid; gap: 4px; padding: 12px 16px;
  background: rgba(244, 238, 228, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--edge); border-radius: var(--r); box-shadow: 0 20px 40px -24px rgba(34, 29, 24, .45);
  font: 600 .6875rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: .14em;
}
.hero__card span:first-child { color: var(--accent); }
.hero__card span:last-child { color: var(--muted); font-weight: 500; }
@media (min-width: 900px) {
  .hero__in { grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 6vw, 96px); }
  .hero__fig { justify-self: end; }
  .hero__card { left: -40px; }
}
.hero::after { /* grão de filme, discreto */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- seções ---------- */
.section { padding-block: var(--pad); }
.section--tint { background: var(--paper2); }
.head { margin-bottom: clamp(40px, 6vw, 72px); max-width: 820px; }

.spec { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--edge); }
.spec__item { padding: 32px 0; border-bottom: 1px solid var(--edge); display: grid; gap: 12px; }
.spec__item p:not(.mono) , .spec__item > p { color: var(--muted); max-width: 46ch; }
.spec__item .mono { color: var(--accent); }
@media (min-width: 800px) {
  .spec { grid-template-columns: repeat(2, 1fr); column-gap: 0; }
  .spec__item { padding: 40px 48px 48px 0; }
  .spec__item:nth-child(even) { padding-left: 48px; padding-right: 0; border-left: 1px solid var(--edge); }
  .spec__item:nth-child(2) { margin-top: 0; }
}

/* doutores: recortes estreitos no tamanho nativo; o segundo desce */
.docs { display: grid; gap: 48px; }
.doc { display: grid; gap: 20px; grid-template-columns: minmax(0, 286px) 1fr; align-items: start; }
.doc__photo--a { aspect-ratio: 286 / 576; }
.doc__photo--b { aspect-ratio: 297 / 640; }
.doc__body { padding-top: 20px; display: grid; gap: 8px; border-top: 1px solid var(--edge); }
.doc__body .mono { color: var(--accent); }
.doc__meta { color: var(--muted); font-weight: 500; margin-top: 8px; }
@media (max-width: 640px) { .doc { grid-template-columns: 1fr; } .doc__photo { max-width: 286px; width: 100%; } }
@media (min-width: 900px) {
  .docs { grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 5vw, 80px); }
  .doc--b { margin-top: clamp(48px, 8vw, 120px); }
}

/* galeria da clínica: três quadrados, com deslocamento vertical escalonado */
.gallery { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.g { aspect-ratio: 1 / 1; }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 20px; } .g2 { margin-top: 56px; } }
@media (min-width: 900px) { .gallery { gap: 24px; } .g2 { margin-top: 72px; } .g4 { margin-top: 24px; } }

/* placas: duas colunas no celular, quatro no desktop */
.plates { margin-top: 0; }
.plate { display: grid; gap: 12px; width: 100%; }
.plate .media { aspect-ratio: 3 / 4; border: 1px solid var(--edge); }
.plate figcaption { color: var(--muted); font-weight: 500; }
.plates-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; overflow: visible; padding-bottom: 0; }
@media (min-width: 700px) { .plates-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
@media (min-width: 900px) {
  .plates-grid { gap: 24px; }
  .plate:nth-child(even) { margin-top: 32px; }
}

/* passos */
.steps { display: grid; gap: 0; border-top: 1px solid var(--edge); }
.steps li { padding: 32px 0; border-bottom: 1px solid var(--edge); display: grid; gap: 8px; }
.steps p { color: var(--muted); max-width: 40ch; }
.steps__n { font-size: 3.5rem; line-height: 1; color: var(--accent); }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, 1fr); border-bottom: 0; }
  .steps li { padding: 32px 24px 0; border-bottom: 0; border-left: 1px solid var(--edge); }
  .steps li:first-child { border-left: 0; padding-left: 0; }
}

/* contato */
.contact { display: grid; gap: 48px; align-items: center; }
.contact__txt { display: grid; gap: 24px; justify-items: start; }
.contact__txt .eyebrow { margin-bottom: 0; }
.addr { font-size: var(--fs-lede); line-height: 1.6; }
.contact .mono { color: var(--muted); font-weight: 500; }
.map { aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; border: 1px solid var(--edge); background: var(--paper2); box-shadow: 0 30px 60px -30px rgba(34, 29, 24, .35); }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1.2fr; gap: 80px; } .map { aspect-ratio: 5 / 4; } }

/* footer */
.foot { background: var(--dark); color: var(--on-dark); padding-top: clamp(56px, 7vw, 96px); }
.foot__in { display: grid; gap: 40px; padding-bottom: 56px; }
.wordmark--foot { font-size: clamp(3rem, 8vw, 5rem); }
.foot__tag { color: var(--on-dark-muted); margin-top: 8px; }
.foot__col { display: grid; gap: 12px; align-content: start; color: var(--on-dark-muted); font-size: .9375rem; }
.foot__col a { display: inline-flex; align-items: center; gap: 8px; color: var(--on-dark); min-height: 24px; }
.foot__col a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-block: 24px; border-top: 1px solid var(--edge-dark); color: var(--on-dark-muted); font-size: .875rem; }
@media (min-width: 800px) { .foot__in { grid-template-columns: 1.5fr 1fr 1fr; } }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

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