/* Hollow Pine: topo da home, "os pontos sob a pele". A foto, a gravura de anatomia (canvas), as linhas de chamada
   e os rótulos formam o palco; a lente que revela a gravura é desenhada por js/lente/. Tokens em css/tokens.css. */

.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  /* Altura da cena e escala da foto de 1920 x 1081 que a cobre (cover); o título se mede por elas */
  --hh: max(40rem, 100svh);
  --sc: max(100vw / 1920, var(--hh) / 1081);
}

/* ---------- Palco: foto, gravura, linhas de chamada e rótulos. Em pilha ocupa só a metade de cima ---------- */

.hero__stage-wrap {
  position: relative;
  height: clamp(17rem, 50svh, 40rem);
  touch-action: pan-y;
  will-change: transform;
}

.hero__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  --dissolve: linear-gradient(to bottom, #000 74%, rgb(0 0 0 / 0.55) 87%, rgb(0 0 0 / 0.15) 95%, transparent);
  -webkit-mask-image: var(--dissolve);
  mask-image: var(--dissolve);
}

/* Sem JS a foto cobre o quadro; com JS o tamanho e a posição vêm da medida (cover + câmera) */
.hero__img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 62% 30%;
  transform-origin: 0 0;
  will-change: transform;
}

.hero__lens {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.hero__callouts {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.hero__leader {
  fill: none;
  stroke: var(--butter-deep);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

/* Rótulo do ponto: papel opaco, nunca translúcido sobre a foto */
.hero__pill {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.1rem 0.5rem 0.5rem;
  background: var(--paper-label);
  border: 1.5px solid var(--butter);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-glass);
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.hero__pill-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--butter);
  color: var(--on-butter);
  font-weight: 700;
  font-size: var(--text-sm);
  font-variant-numeric: lining-nums;
}

.hero__pill-t {
  display: grid;
  gap: 0.1rem;
}

.hero__pill-t strong {
  font-size: var(--text-sm);
  font-weight: 600;
}

.hero__pill-t span {
  font-size: var(--text-xs);
  color: var(--ink-soft);
}

/* ---------- Texto do topo ---------- */

.hero__copy {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: start;
  gap: var(--space-sm);
  padding: var(--space-md) var(--gutter) var(--space-xl);
}

.hero h1 {
  width: max-content;
  max-width: 100%;
  font-size: clamp(2.6rem, 11.5vw, 4.75rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-wrap: nowrap;
}

.hero h1 em {
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--butter-deep);
}

/* Começa 0,24 em abaixo, já visível: o quadro 0 está completo e as palavras assentam uma a uma.
   Os seletores mais específicos vencem a entrada com opacidade de css/motion.css, que não vale para o topo */
.hero h1 .w,
.has-motion .hero h1 .w {
  display: inline-block;
  animation: hero-rise 0.95s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes hero-rise {
  from { transform: translateY(0.24em); }
  to { transform: none; }
}

/* A foto e os blocos do topo nascem prontos: a lente precisa da foto parada para alinhar a gravura */
.has-motion .hero .hero__img,
.has-motion .hero .hero__lede,
.has-motion .hero .hero__actions,
.has-motion .hero .hero__where,
.has-motion .hero .xray-toggle {
  animation: none;
}

[data-capture] .hero h1 .w {
  animation: none;
}

.hero__lede {
  max-width: 44ch;
  font-size: clamp(1.0625rem, 0.75rem + 0.55vw, 1.3rem);
  line-height: 1.45;
  color: var(--ink);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-lg);
}

.hero__actions .btn {
  min-height: 3.5rem;
  padding-inline: var(--space-lg);
  font-size: var(--text-base);
}

.hero__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: 2.75rem;
  border-bottom: 1.5px solid var(--butter);
  font-size: var(--text-base);
  text-decoration: none;
  transition: color var(--dur-state) var(--ease-out), border-color var(--dur-state) var(--ease-out), gap var(--dur-state) var(--ease-out);
}

.hero__link span {
  transition: transform var(--dur-state) var(--ease-out);
}

.hero__link:hover {
  color: var(--butter-deep);
  border-bottom-color: var(--butter-deep);
  border-bottom-width: 3px;
}

.hero__link:hover span {
  transform: translateX(5px);
}

/* Botão que fixa os 3 pontos (teclado, toque e quem não usa cursor) */
.xray-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  justify-self: start;
  min-height: 2.75rem;
  padding: var(--space-2xs) var(--space-md) var(--space-2xs) var(--space-xs);
  background: var(--paper-label);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font: 500 var(--text-sm) / 1.2 var(--font-text);
  transition: border-color var(--dur-state) var(--ease-out), background-color var(--dur-state) var(--ease-out), transform var(--dur-tap) var(--ease-out), box-shadow var(--dur-state) var(--ease-out);
}

.xray-toggle:hover {
  border-color: var(--butter);
  background: var(--butter-wash);
  box-shadow: 0 0.5rem 1rem -0.6rem oklch(0.49 0.12 40 / 0.5);
}

.xray-toggle:active {
  transform: scale(0.97);
}

.xray-toggle:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.xray-toggle[aria-pressed="true"] {
  border-color: var(--butter);
  background: var(--butter-wash);
}

.xray-toggle__dot {
  position: relative;
  width: 1.5rem;
  height: 1.5rem;
  border: 1.5px solid var(--butter);
  border-radius: 50%;
  transition: transform var(--dur-state) var(--ease-out);
}

.xray-toggle__dot::after {
  content: "";
  position: absolute;
  inset: 0.4rem;
  background: var(--butter);
  border-radius: 50%;
}

.xray-toggle:hover .xray-toggle__dot {
  transform: scale(1.18);
}

/* Endereço e, embaixo, a prova social */
.hero__where {
  display: grid;
  gap: var(--space-3xs);
  color: var(--ink);
  font-size: var(--text-sm);
}

.hero__proof {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}

.hero__proof svg {
  display: block;
  width: 1.1em;
  height: 1.1em;
  flex: none;
  fill: var(--butter);
}

.hero__proof strong {
  font-weight: 700;
}

/* Em pilha (celular, tablet e telas quase quadradas) o botão de agendar sobe para logo depois do título */
.hero__copy .hero__actions { order: 1; }
.hero__copy .xray-toggle { order: 2; }
.hero__copy .hero__lede { order: 3; }
.hero__copy .hero__where { order: 4; }

/* Desktop: a cena começa atrás do cabeçalho, a foto ocupa a tela e o texto fica ancorado embaixo à esquerda */
@media (min-width: 72rem) and (min-aspect-ratio: 3/2) {
  .hero {
    height: var(--hh);
    margin-top: -4.25rem;
  }

  .hero__stage-wrap {
    position: absolute;
    inset: 0;
    height: auto;
  }

  .hero__stage {
    --dissolve: linear-gradient(to bottom, #000 0, #000 86%, rgb(0 0 0 / 0.6) 92%, rgb(0 0 0 / 0.18) 97%, transparent);
  }

  .hero__img {
    object-position: right 15%;
  }

  .hero__copy {
    position: absolute;
    left: var(--edge);
    bottom: clamp(1.5rem, 5svh, 3.5rem);
    padding: 0;
    gap: clamp(0.85rem, 2svh, 1.4rem);
    grid-template-areas: "h" "l" "a" "t" "w";
  }

  .hero__copy .hero__actions,
  .hero__copy .xray-toggle,
  .hero__copy .hero__lede,
  .hero__copy .hero__where {
    order: 0;
  }

  .hero__copy h1 { grid-area: h; }
  .hero__copy .hero__lede { grid-area: l; font-size: clamp(1.0625rem, 0.5rem + 0.6vw, 1.3rem); }
  .hero__copy .hero__actions { grid-area: a; }
  .hero__copy .xray-toggle { grid-area: t; }
  .hero__copy .hero__where { grid-area: w; font-size: clamp(0.9375rem, 0.6rem + 0.35vw, 1.0625rem); }

  /* Tamanho do título pela medida: o texto termina antes do ponto 3 (o mais à esquerda) e da folga da lente.
     A foto cobre a cena (escala --sc) e fica à direita; a linha mais larga mede 6,41 em */
  .hero h1 {
    font-size: clamp(3.25rem, calc((100vw - var(--edge) - 1127 * var(--sc)) / 6.45), 10rem);
  }
}

/* ---------- Cabeçalho transparente sobre a cena no topo (desktop a partir de 1152 px) ----------
   Halo de papel atrás das letras e fundo de papel no botão: o menu não some sobre o cabelo da modelo,
   sem tarja por cima da foto. A estrutura do cabeçalho mora em css/layout.css e o estado vem de js/hero.js */
@media (min-width: 72rem) {
  .is-home .site-header:not([data-scrolled="true"]) :is(.nav a, .brand__name) {
    text-shadow: 0 0 0.4em var(--paper), 0 0 0.4em var(--paper), 0 0 0.9em var(--paper);
  }

  /* :not(:hover): no hover vale a regra do botão (fundo terracota com texto claro) */
  .is-home .site-header:not([data-scrolled="true"]) .site-header__bar > .btn:not(:hover) {
    background: var(--paper);
  }

  .is-home .site-header {
    background: transparent;
    border-bottom-color: transparent;
    transition: background-color var(--dur-state) var(--ease-out), border-color var(--dur-state) var(--ease-out);
  }

  .is-home .site-header[data-scrolled="true"] {
    background: var(--paper);
    border-bottom-color: var(--line);
  }
}

/* Entre 1152 e 1280 px os links caem sobre o cabelo escuro: ganham uma pílula de papel */
@media (min-width: 72rem) and (max-width: 80rem) {
  .is-home .site-header:not([data-scrolled="true"]) .nav ul {
    padding-inline: var(--space-md);
    background: var(--paper);
    border-radius: var(--radius-pill);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__link span,
  .hero__link:hover span {
    transform: none;
  }
}
