/* =========================================================
   Seções (na ordem da página)
   ========================================================= */
@layer sections {

  /* ================= HERO =================
     Camadas, de trás para a frente: céu -> coluna (eyebrow, logo, subtítulo) -> frente recortada
     (árvores, água, praia) -> botões. Céu e frente usam o mesmo palco (--sw, --sh, --sl, --st), que o
     assets/js/hero.js calcula para o horizonte ficar logo abaixo do subtítulo; os valores abaixo são
     o ponto de partida sem JS. --cta-top: onde os botões começam (também calculado no hero.js). */
  .hero {
    --sw: max(100vw, 130svh);
    --sh: var(--sw);
    --sl: calc(50vw - var(--sw) * 0.459);
    --st: calc(100svh * 0.66 - var(--sh) * 0.526);
    --cta-top: calc(100svh * 0.66 + 1.5rem);
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    overflow: hidden;
    background: #D9A07A; /* tom do céu enquanto as imagens carregam */
  }
  .hero__layer { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
  .hero__stage { position: absolute; left: var(--sl); top: var(--st); width: var(--sw); height: var(--sh); }
  .hero__stage picture { display: block; width: 100%; height: 100%; }
  .hero__stage img { width: 100%; height: 100%; max-width: none; user-select: none; -webkit-user-drag: none; }

  /* Coluna centralizada: eyebrow, logo e subtítulo no mesmo eixo */
  .hero__col {
    position: absolute; left: 0; right: 0;
    top: calc(var(--header-h) + clamp(0.75rem, 3vh, 2.25rem));
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding-inline: var(--gutter);
  }
  /* eyebrow numa etiqueta de vidro claro: texto escuro com contraste garantido sobre qualquer céu */
  .hero__eyebrow {
    margin-bottom: clamp(0.9rem, 2.2vh, 1.4rem);
    padding: 0.5rem 0.95rem 0.5rem 0.85rem;
    border-radius: var(--r-pill);
    background: rgb(255 252 246 / 0.62);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 0 0 1px rgb(255 252 246 / 0.5);
    color: var(--c-mata-900);
    text-wrap: balance;
  }
  .hero__eyebrow::before { background: var(--c-terracota-600); }
  /* Logo com as cores originais (as mesmas do preloader), só o sol mais claro: o amarelo do logo
     (sol-400) tem o mesmo valor do céu do pôr do sol e sumia. O preloader clareia o sol no voo. */
  .lockup--hero {
    --lk-size: clamp(17px, min(0.75rem + 1.45vw, 3.4svh), 34px);
    --lk-sun: var(--c-sol-200);
  }
  .js.is-loading .lockup--hero { visibility: hidden; }
  .hero__sub {
    margin-top: clamp(1.5rem, 3.6vh, 2.4rem);
    max-width: 23em;
    font-size: clamp(1rem, 0.9rem + 0.42vw, 1.3rem);
    line-height: 1.42;
    font-weight: 600;
    color: var(--c-mata-900);
    text-wrap: balance;
  }

  /* Botões: por cima de todas as camadas, centralizados no mesmo eixo */
  .hero__layer--cta { z-index: 1; }
  .hero__cta { position: absolute; left: 0; right: 0; top: var(--cta-top); padding-inline: var(--gutter); }
  .hero__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.75rem; pointer-events: auto; }
  .hero__actions .btn { box-shadow: 0 10px 30px rgb(10 22 15 / 0.22); }
  .hero__actions .btn-glass { min-height: 3.75rem; }

  @media (max-width: 639.98px) {
    .hero__actions { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    /* rótulo centralizado no botão inteiro (como o "Explorar o Recanto"), com o ícone à direita:
       a folga da esquerda é o espaço que o ícone ocupa (gap + círculo + respiro da direita) */
    .hero__actions .btn { padding-left: calc(0.9rem + 2.9rem + 0.45rem); }
    .hero__actions .btn__label { flex: 1; text-align: center; }
    .hero__actions .btn-glass { min-height: 3.1rem; font-size: var(--fs-sm); }
    .hero__sub { max-width: 19em; }
  }

  /* Celular e tablet: títulos de seção na largura toda da coluna, com o mínimo de linhas. No desktop
     as larguras em ch desenham a composição; na coluna única elas só criavam quebras a mais. As linhas
     continuam equilibradas (motion.js nos títulos com data-split; text-wrap: balance nos demais).
     O id do <main> garante a precedência sobre as larguras de cada seção. */
  @media (max-width: 1023.98px) {
    #conteudo .h2 { max-width: none; }
  }

  /* Tudo depois da hero passa por cima dela (a faixa ondulada sobe sobre a base da hero) */
  :where(main > section, main > div):not(.hero):not(.waterline) { position: relative; z-index: 1; }
  :where(.numbers, .spaces, .location, .process, .faq) { background-color: var(--bg); }
  .site-footer { z-index: 1; }

  /* Imagens que preenchem as molduras (arco, forma orgânica, cards sobrepostos...) */
  :is(.pause__media, .conditions__arch, .process__img, .why__photo, .sibling__img) picture { display: block; width: 100%; height: 100%; }
  :is(.pause__media, .conditions__arch, .process__img, .why__photo, .sibling__img) img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, center); }
  :is(.conditions__arch, .process__img, .why__photo, .sibling__img) { overflow: hidden; background: var(--c-areia-200); }

  /* ================= FAIXA ONDULADA =================
     A faixa sobe sobre a base da hero: acima da curva o SVG é transparente (a foto aparece),
     abaixo dela o .ribbon__ground (linho) encerra a imagem. A borda da hero vira a onda. */
  :root { --ribbon-h: calc(max(100vw, 1200px) * 0.15); --ribbon-overlap: 0.68; }
  .ribbon {
    position: relative;
    margin-top: calc(var(--ribbon-h) * var(--ribbon-overlap) * -1);
    background: transparent;
    overflow-x: clip;
    pointer-events: none;
  }
  .ribbon__svg { display: block; width: max(100%, 1200px); height: auto; position: relative; left: 50%; translate: -50% 0; overflow: visible; }
  .ribbon__guide { stroke: none; }
  .ribbon__ground { fill: var(--c-linho-50); }
  .ribbon__band { stroke: var(--c-mata-700); stroke-width: 68; stroke-linecap: round; }
  .ribbon__text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 34px;
    fill: var(--c-linho-50);
    font-variation-settings: "opsz" 48;
  }
  /* Centro do texto no meio da faixa: linha de base normal, sobre uma cópia da onda deslocada em
     meia altura das maiúsculas (#ribbon-text-path). O "dominant-baseline: central" e o dy num <tspan>
     não servem: no Safari, em texto sobre caminho, o primeiro deixava o texto ~0,3em acima do meio e
     o segundo quebrava a altura no meio das palavras. */
  /* Celular/tablet: o reset (svg { max-width: 100% }) espremia a faixa na largura da tela.
     Aqui ela ganha escala própria e mostra só o trecho em "S" da onda: o x = 650 do viewBox
     fica no centro da tela ((800 - 650) / 1600 = 0.09375 da largura). Com mais sobreposição,
     a faixa inteira cabe na primeira tela. */
  @media (max-width: 1023.98px) {
    :root { --ribbon-w: min(215vw, 1200px); --ribbon-h: calc(var(--ribbon-w) * 0.15); --ribbon-overlap: 1; }
    .ribbon__svg { width: var(--ribbon-w); max-width: none; translate: calc(-50% + var(--ribbon-w) * 0.09375) 0; }
  }

  /* ================= NÚMEROS =================
     Cabeçalho centralizado de uma linha e 4 números (2 × 2 no celular, 4 colunas no desktop) */
  .numbers .section-head .h2 { max-width: none; }
  /* eyebrow longo: quebra no ponto e, quando quebra, o marcador fica acima do texto */
  .numbers .eyebrow { text-wrap: balance; }
  @media (max-width: 1023.98px) {
    .numbers .eyebrow { flex-direction: column; gap: 0.55rem; }
  }
  .stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
  }
  /* Cada número se mede pela própria coluna (cqi). O mais largo, "314.600 m²" (≈ 3,9em), cabe com 25cqi.
     No celular ele ocupa a linha inteira e os outros dois, na metade da largura, cabem com 42cqi */
  .stat {
    container-type: inline-size;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 0.6rem;
    padding: 1.75rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--line);
  }
  .stat:first-child { grid-column: 1 / -1; }
  .stat:nth-child(3) { border-left: 1px solid var(--line); }
  .stat__value {
    font-family: var(--font-display);
    font-size: min(var(--fs-stat), 42cqi);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: -0.04em;
    color: var(--c-mata-700);
    font-variation-settings: "opsz" 144;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .stat:first-child .stat__value { font-size: min(var(--fs-stat), 25cqi); }
  .stat__value small { font-size: 0.32em; letter-spacing: -0.01em; color: var(--c-terracota-600); font-weight: 500; }
  .stat__label { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }
  @media (min-width: 1024px) {
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stat:first-child { grid-column: auto; }
    .stat__value { font-size: min(var(--fs-stat), 25cqi); }
    .stat { gap: 0.9rem; padding: clamp(2.25rem, 4.5vh, 3.25rem) 1rem 0.5rem; border-bottom: 0; }
    .stat + .stat { border-left: 1px solid var(--line); }
    .stat__label { font-size: var(--fs-base); }
  }

  /* ================= POR QUE O RECANTO (diferenciais) =================
     Os cinco diferenciais do cliente em lista com ícones de linha, ao lado da foto em forma orgânica */
  .why__intro { display: grid; gap: clamp(2.5rem, 5vw, 5rem); align-items: center; margin-bottom: clamp(3.5rem, 7vw, 7rem); }
  .why__text .h2 { max-width: 20ch; margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem); }
  .diffs { border-top: 1px solid var(--line); }
  .diff {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: clamp(0.9rem, 1.6vw, 1.35rem);
    align-items: center;
    padding-block: clamp(0.9rem, 1.6vw, 1.2rem);
    border-bottom: 1px solid var(--line);
  }
  .diff__icon {
    display: grid;
    place-items: center;
    width: clamp(3rem, 2.5rem + 1.3vw, 3.6rem);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--c-mata-700);
    color: var(--c-linho-50);
    transition: background-color var(--dur) var(--ease-out), rotate var(--dur) var(--ease-out);
  }
  .diff__icon .ico { width: 50%; }
  .diff:hover .diff__icon { background-color: var(--c-terracota-600); rotate: -8deg; }
  .diff__title { font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.6rem); line-height: 1.15; letter-spacing: -0.015em; text-wrap: pretty; }
  .diff__body p { margin-top: 0.3rem; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-muted); }
  .why__photo {
    aspect-ratio: 3 / 4;
    width: 100%;
    max-width: 440px;
    justify-self: center;
    /* retângulo de cantos arredondados, no formato da foto do N. Sra. Aparecida (.sibling__img) */
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
  }
  .perks { display: grid; gap: 1rem; }
  .perks__group { padding: clamp(1.5rem, 2.5vw, 2.25rem); border-radius: var(--r-xl); background: var(--c-linho-50); }
  .perks__title {
    display: flex; align-items: center; gap: 0.9rem;
    font-size: var(--fs-h3);
    margin-bottom: 1.25rem;
    --tile: 44px;
  }
  .perks__group li {
    display: flex; gap: 0.7rem; align-items: baseline;
    padding: 0.6rem 0;
    border-top: 1px solid var(--line);
    font-size: var(--fs-sm);
    font-weight: 600;
  }
  .perks__group li::before { content: ""; flex: none; width: 0.55rem; height: 0.55rem; border-radius: 50% 50% 0 0; background: var(--c-terracota-400); }
  @media (max-width: 1023.98px) {
    .why__text > .eyebrow { display: flex; justify-content: center; text-align: center; }
    .why__text > .h2 { margin-inline: auto; text-align: center; }
  }
  @media (min-width: 1024px) {
    /* eyebrow na 1ª linha; título e lista nas seguintes. A foto ocupa as linhas do título e da lista:
       começa na altura do título e termina junto com a lista. */
    .why__intro { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); row-gap: 0; align-items: start; }
    .why__text { display: contents; }
    .why__text > * { grid-column: 1; }
    .why__photo { grid-column: 2; grid-row: 2 / span 2; align-self: stretch; aspect-ratio: auto; max-width: 520px; }
    .perks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  /* ================= CONHEÇA CADA ESPAÇO ================= */
  .spaces { padding-bottom: calc(var(--section-y) * 0.6); overflow: hidden; }
  .spaces .section-head--center { gap: 0.9rem; }
  .spaces .section-head--center .eyebrow { margin-bottom: 0; }
  .spaces .section-head--center .h2 { max-width: none; }
  .spaces .section-head--center .section-head__aside { max-width: 48rem; }
  .spaces__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
  }
  .spaces__viewport::-webkit-scrollbar { display: none; }
  .spaces__track {
    display: flex;
    gap: clamp(1rem, 2vw, 2rem);
    width: max-content;
    padding-bottom: 0.5rem;
  }
  .space-card {
    position: relative;
    width: min(78vw, 360px);
    scroll-snap-align: start;
    flex: none;
  }
  .space-card__media {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--c-areia-200);
  }
  .space-card__media picture { display: block; width: 100%; height: 100%; transition: transform 1.2s var(--ease-out); }
  .space-card__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: var(--pos, center);
    transform: scale(1.12);
  }
  .space-card:hover .space-card__media picture { transform: scale(1.06); }
  .space-card__badge { --tile: 46px; position: absolute; top: 0.9rem; left: 0.9rem; z-index: 2; box-shadow: var(--shadow-sm); }
  .space-card__body { padding: 1.25rem 0.25rem 0; display: grid; gap: 0.7rem; }
  .space-card__title { font-size: var(--fs-h3); font-weight: 500; }
  .space-card__body p { color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.55; max-width: 32ch; }
  .space-card--cta { display: grid; }
  .space-card__cta {
    aspect-ratio: 4 / 5;
    border-radius: var(--r-lg);
    background: var(--c-mata-900);
    color: var(--c-linho-50);
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    gap: clamp(0.9rem, 2.2vh, 1.4rem);
    padding: clamp(1.25rem, 3vh, 2rem);
    --tile: clamp(40px, 5.5vh, 56px);
  }
  .space-card__cta-text {
    font-family: var(--font-display);
    font-size: min(clamp(1.75rem, 1.1rem + 1.6vw, 2.6rem), 5.6vh);
    line-height: 1.04;
    letter-spacing: -0.02em;
  }
  .space-card__cta .btn { max-width: 100%; }
  .spaces__progress-wrap { margin-top: 2rem; display: none; }
  .spaces__progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
  .spaces__progress span { display: block; height: 100%; width: 100%; background: var(--c-terracota-600); transform-origin: left; transform: scaleX(0); }

  @media (max-width: 1023.98px) {
    /* Card final do tamanho das fotos: esticado na altura da linha, o aspect-ratio
       o alargava além da tela. Conteúdo centralizado nos dois eixos. */
    .space-card--cta { grid-template-columns: minmax(0, 1fr); }
    .space-card__cta { align-self: start; align-items: center; text-align: center; padding-inline: clamp(1rem, 5vw, 1.5rem); }
    /* o respiro do fim fica no próprio trilho: alguns navegadores ignoram o
       padding final de um contêiner com rolagem */
    .spaces__viewport { padding-inline-end: 0; }
    .spaces__track { padding-inline-end: var(--gutter); }
  }
  @media (min-width: 1024px) {
    .spaces__viewport {
      padding-inline: max(var(--gutter), calc((100vw - var(--container)) / 2));
    }
    .space-card { width: clamp(300px, 25vw, 380px); }
    /* Fixada: ocupa exatamente uma tela; a imagem do card se ajusta ao espaço que sobra */
    .spaces.is-pinned .spaces__pin {
      height: 100svh;
      display: flex;
      flex-direction: column;
      padding-top: calc(var(--header-h) + clamp(1rem, 3vh, 2rem));
      padding-bottom: clamp(1rem, 3vh, 2rem);
    }
    .spaces.is-pinned .section-head { flex: none; margin-bottom: clamp(1.25rem, 3vh, 2.5rem); }
    .spaces.is-pinned .spaces__viewport { flex: 1 1 auto; min-height: 0; overflow: visible; scroll-snap-type: none; }
    .spaces.is-pinned .spaces__track { height: 100%; padding-bottom: 0; }
    .spaces.is-pinned .space-card { display: flex; flex-direction: column; height: 100%; }
    .spaces.is-pinned .space-card__media { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; }
    /* texto com altura fixa: todas as imagens ficam do mesmo tamanho e alinhadas */
    .spaces.is-pinned { --space-body-h: 13.5rem; }
    .spaces.is-pinned .space-card__body { flex: none; height: var(--space-body-h); align-content: start; }
    .spaces.is-pinned .space-card--cta .space-card__cta { flex: 1 1 auto; aspect-ratio: auto; min-height: 0; }
    .spaces.is-pinned .space-card--cta::after { content: ""; flex: none; height: var(--space-body-h); }
    .spaces.is-pinned .spaces__progress-wrap { display: block; flex: none; margin-top: clamp(1rem, 2.5vh, 1.75rem); }
  }
  @media (min-width: 1024px) and (max-height: 780px) {
    .spaces.is-pinned { --space-body-h: 8.5rem; }
    .spaces.is-pinned .section-head__aside { display: none; }
    .spaces.is-pinned .space-card__body p { display: none; }
  }

  /* ================= IMPLANTAÇÃO ================= */
  /* Fica acima da seção seguinte: o popover pode passar da borda do mapa sem ser cortado */
  .masterplan { z-index: 2; }
  .mp { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
  .mp__map { position: relative; }
  .mp__img {
    display: block;
    width: 100%; height: auto;
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
    background: var(--c-salvia-100);
  }

  /* Pontos: --x/--y em pixels da foto da implantação (2632 × 822) */
  .mp__spot {
    position: absolute;
    left: calc(var(--x) / 2632 * 100%);
    top: calc(var(--y) / 822 * 100%);
    translate: -50% -50%;
    --tile: 44px;
    border-radius: 9px;
    box-shadow: 0 0 0 4px rgb(247 242 233 / 0.85), var(--shadow-md);
    transition: scale 0.4s var(--ease-out);
  }
  .mp__spot::after {
    content: "";
    position: absolute; inset: -4px;
    border-radius: 12px;
    border: 2px solid var(--c-linho-50);
    animation: spot-pulse 2.4s var(--ease-out) infinite;
    pointer-events: none;
  }
  @keyframes spot-pulse { 0% { opacity: 0.9; scale: 1; } 100% { opacity: 0; scale: 1.6; } }
  .mp__spot:hover, .mp__spot[aria-expanded="true"] { scale: 1.12; }
  .mp__spot .tile { pointer-events: none; }

  /* Popover horizontal: a mídia segue o formato das fotos (≈ 800 × 485) */
  .mp__pop {
    position: absolute;
    z-index: 4;
    width: min(360px, calc(100vw - 2rem));
    border-radius: var(--r-lg);
    background: var(--c-papel);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
  }
  .mp__pop-img { width: 100%; height: auto; background: var(--c-areia-200); }
  .mp__pop-body { padding: 0.9rem 1.15rem 1.05rem; }
  .mp__pop-title { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.15; margin-bottom: 0.3rem; }
  .mp__pop-text { font-size: var(--fs-sm); line-height: 1.45; color: var(--text-muted); }
  .mp__pop-close {
    position: absolute; top: 0.6rem; right: 0.6rem;
    width: 2rem; height: 2rem; border-radius: 50%;
    background: rgb(247 242 233 / 0.92);
    font-size: 1.25rem; line-height: 1;
  }

  /* Dica de uso acima da foto; rodapé (nota + CTA) abaixo dela */
  .mp__hint {
    display: flex; align-items: center; gap: 0.65rem;
    width: fit-content;
    padding: 0.4rem 1rem 0.4rem 0.4rem;
    border-radius: var(--r-pill);
    background: var(--c-linho-50);
    font-size: var(--fs-sm); font-weight: 600;
    color: var(--c-mata-700);
  }
  .mp__hint-icon {
    position: relative;
    display: grid; place-items: center;
    width: 1.9rem; height: 1.9rem;
    flex: none;
    border-radius: 50%;
    background: var(--c-terracota-600);
    color: #fff;
  }
  .mp__hint-icon svg { width: 0.95rem; height: 0.95rem; fill: currentColor; translate: 1px 1px; }
  .mp__hint-icon::after {
    content: "";
    position: absolute; inset: -3px;
    border-radius: 50%;
    border: 2px solid var(--c-terracota-400);
    animation: spot-pulse 2.4s var(--ease-out) infinite;
  }
  .mp__hint-touch { display: none; }
  @media (hover: none), (pointer: coarse) {
    .mp__hint-mouse { display: none; }
    .mp__hint-touch { display: inline; }
  }
  .mp__foot { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .mp__foot .note { margin: 0; max-width: 34rem; }

  .mp__list { display: grid; gap: 0.75rem; --tile: 40px; }
  .mp__list li { display: flex; gap: 0.9rem; align-items: center; padding: 0.75rem; border-radius: var(--r-md); background: var(--c-linho-50); }
  .mp__list strong { display: block; font-size: 0.98rem; }
  .mp__list span { display: block; font-size: var(--fs-xs); color: var(--text-muted); }

  @media (min-width: 640px) {
    .mp__list { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 1023.98px) {
    /* Celular/tablet: a foto inteira na largura da tela, sem pontos (não cabe popover);
       a lista de espaços e o CTA vêm logo abaixo */
    .mp__hint, .mp__spot { display: none; }
    .mp__img { border-radius: var(--r-md); }
    .mp__foot { order: 1; align-items: center; text-align: center; }
  }
  @media (min-width: 1024px) {
    .mp__spot { --tile: clamp(44px, 3.7vw, 54px); }
    .mp__pop { width: clamp(330px, 29vw, 420px); }
    .mp__hint { margin-inline: auto; }
    .mp__foot { align-items: center; gap: 0.75rem; text-align: center; }
    .mp__foot .btn { order: -1; }
    .mp__list { display: none; }
  }

  /* ================= LOCALIZAÇÃO ================= */
  .location__grid { display: grid; gap: clamp(2.5rem, 5vw, 5rem); align-items: center; }
  .location__text .h2 { max-width: 14ch; margin-bottom: 1.5rem; }
  .location__address {
    display: flex; gap: 1rem; align-items: center;
    margin-block: 2rem 1.5rem;
    font-style: normal;
    --tile: 52px;
  }
  .location__address strong { display: block; font-weight: 700; }
  .location__address span { color: var(--text-muted); font-size: var(--fs-sm); }
  .distances { border-top: 1px solid var(--line); }
  .distances li {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    font-size: var(--fs-sm);
  }
  .distances b { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; white-space: nowrap; }
  .location__note { margin-top: 0.9rem; }
  .location__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

  .map-frame {
    position: relative;
    aspect-ratio: 6 / 5.2;
    border-radius: var(--r-xl);
    overflow: hidden;
    background: var(--c-salvia-100);
    box-shadow: var(--shadow-md);
  }
  .map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
  @media (max-width: 1023.98px) {
    .location__text > .eyebrow { display: flex; justify-content: center; text-align: center; }
    .location__text > .h2 { margin-inline: auto; text-align: center; }
    .location__text > .lead { margin-inline: auto; text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
    .location__note { text-align: center; }
    .location__actions { justify-content: center; }
  }
  @media (min-width: 1024px) {
    .location__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
    .location__actions { justify-content: flex-end; }
  }

  /* ================= PAUSA CINEMATOGRÁFICA ================= */
  .pause {
    position: relative;
    height: 100svh;
    min-height: 520px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--bg);
  }
  .pause__media { position: absolute; inset: 0; }
  .pause__media > .ph, .pause__media img { width: 100%; height: 100%; object-fit: cover; }
  .pause__media .ph__tile { opacity: 0.35; }
  .pause__shade { position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% 50%, rgb(21 41 29 / 0.25), rgb(21 41 29 / 0.6)); }
  /* Portinha (só com JS e movimento liberado; sem isso a seção aparece direto com a imagem) */
  .pause__door { position: absolute; inset: 0; z-index: 1; display: none; pointer-events: none; }
  .pause.has-door .pause__door { display: block; }
  .pause__door svg { width: 100%; height: 100%; overflow: visible; }
  .door-wall { fill: var(--bg); }
  .door-shadow { fill: rgb(21 41 29 / 0.1); }
  .door-sun { fill: var(--c-sol-400); }
  .door-frame { fill: var(--c-terracota-400); }
  .door-leaf__body { fill: var(--c-mata-700); }
  .door-leaf--r .door-leaf__body { fill: var(--c-mata-800); }
  .door-leaf__glass { fill: var(--c-pessego-300); }
  .door-leaf__panel { fill: rgb(21 41 29 / 0.45); }
  .door-leaf__knob { fill: var(--c-sol-400); }
  .door-step { fill: #DCCDB4; }
  .door-plant__leaf { fill: var(--c-mata-700); }
  .door-plant__leaf2 { fill: var(--c-musgo-400); }
  .door-plant__pot { fill: var(--c-terracota-600); }
  .pause__quote {
    position: relative;
    z-index: 2;
    max-width: 14ch;
    padding-inline: var(--gutter);
    text-align: center;
    font-family: var(--font-display);
    font-size: var(--fs-quote);
    font-weight: 300;
    line-height: 0.98;
    letter-spacing: -0.035em;
    color: var(--c-linho-50);
    font-variation-settings: "opsz" 144;
    text-shadow: 0 4px 60px rgb(10 22 15 / 0.45);
  }
  @media (max-width: 1023.98px) {
    /* única peça da seção: no celular a frase cresce além de um título comum */
    .pause__quote { font-size: max(var(--fs-quote), min(18vw, 5.5rem)); text-wrap: balance; }
  }

  /* ================= CONDIÇÕES ================= */
  .conditions__grid { display: grid; gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
  .conditions .h2 { max-width: 13ch; }
  /* Rótulo em cima do número. No celular a entrada ("8% ou 10%") ocupa a linha inteira;
     a partir de 640px as três colunas se medem pelo conteúdo (auto) e repartem a sobra */
  .cond-blocks {
    container-type: inline-size;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1rem;
    margin-block: clamp(2rem, 4vw, 3rem);
  }
  .cond-block--entrada { grid-column: 1 / -1; }
  .cond-block {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
  }
  .cond-block dd {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 1.6rem + 4vw, 5.5rem);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--c-pessego-300);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .cond-block dd small { font-size: 0.42em; color: var(--c-linho-50); letter-spacing: 0; }
  .cond-block dd .cond-block__or { color: var(--text-muted); }
  .cond-block dt { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
  @media (min-width: 640px) {
    .cond-blocks { grid-template-columns: repeat(3, auto); }
    .cond-block--entrada { grid-column: auto; }
  }
  .conditions .lead { margin-bottom: 2rem; }
  .conditions__arch {
    aspect-ratio: 3 / 4;
    max-width: 460px;
    width: 100%;
    justify-self: center;
    border-radius: 999px 999px var(--r-xl) var(--r-xl);
  }
  @media (max-width: 1023.98px) {
    /* tudo centralizado; só o subtítulo (texto maior) fica justificado */
    .conditions__content { text-align: center; }
    .conditions .h2 { margin-inline: auto; }
    .cond-block { align-items: center; }
    .conditions .lead { margin-inline: auto; text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
  }
  @media (min-width: 1024px) {
    .conditions__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
    /* a coluna de texto é estreita: os números encolhem com ela (≈ 8,6em no total, com os vãos) */
    .cond-block dd { font-size: min(clamp(2.6rem, 1.6rem + 4vw, 5.5rem), 10.5cqi); }
  }

  /* ================= COMO FUNCIONA ================= */
  .process .section-head .h2 { max-width: 18ch; }
  .process__grid { display: grid; gap: 3rem; }
  .process__visual { display: none; }
  .steps { position: relative; display: grid; gap: 2.5rem; padding-left: 0.25rem; }
  .steps__line {
    position: absolute;
    left: calc(var(--tile) / 2 - 20px + 0.25rem);
    top: 0; bottom: 0;
    width: 40px; height: 100%;
    overflow: visible;
  }
  .steps__line path { fill: none; stroke: var(--c-musgo-400); stroke-width: 1.5; }
  .step { position: relative; display: grid; grid-template-columns: var(--tile) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
  .step__tile { position: relative; z-index: 1; box-shadow: 0 0 0 6px var(--bg); }
  .step__num { display: block; font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.16em; color: var(--c-terracota-600); margin-bottom: 0.4rem; }
  .step__title { font-size: var(--fs-h3); margin-bottom: 0.6rem; }
  .step__body p { color: var(--text-muted); max-width: 32rem; }
  .process__close { margin-top: 3rem; font-family: var(--font-display); font-size: var(--fs-lead); color: var(--c-mata-700); }

  @media (min-width: 1024px) {
    .process__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(3rem, 7vw, 8rem); align-items: start; }
    /* A coluna acompanha a altura dos passos e a moldura trava centralizada na tela:
       altura = 4/5 da largura, limitada à tela com folga igual em cima e embaixo
       (folga >= header, que reaparece ao rolar para cima) */
    .process__visual { display: block; align-self: stretch; container-type: inline-size; }
    .process__frame {
      --frame-gap: calc(var(--header-h) + clamp(1rem, 3vh, 2rem));
      --frame-h: min(125cqi, 100svh - 2 * var(--frame-gap));
      position: sticky;
      top: calc((100svh - var(--frame-h)) / 2);
      height: var(--frame-h);
      border-radius: var(--r-xl);
      overflow: hidden;
    }
    .process__img { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s var(--ease-out), scale 1.2s var(--ease-out); scale: 1.06; }
    .process__img.is-active { opacity: 1; scale: 1; }
    .steps { gap: 0; }
    .step { min-height: 52vh; align-content: center; padding-block: 2rem; }
    .step .step__body { opacity: 0.35; transition: opacity 0.6s var(--ease-out); }
    .step.is-active .step__body { opacity: 1; }
    .no-motion .step .step__body, .is-reduced .step .step__body { opacity: 1; }
  }

  /* ================= FAQ ================= */
  .faq__grid { display: grid; gap: 2.5rem; }
  .faq__tile { --tile: 56px; margin-bottom: 1.5rem; }
  .faq__aside .h2 { max-width: 13ch; }
  .faq__help { margin-top: 1.5rem; color: var(--text-muted); }
  .faq__help a { color: var(--c-mata-700); font-weight: 700; text-underline-offset: 4px; }
  .faq__mosaic { margin-top: 1rem; }
  @media (max-width: 1023.98px) {
    .faq__tile { margin-inline: auto; }
    .faq__sticky > .eyebrow { display: flex; justify-content: center; text-align: center; }
    .faq__sticky > :is(.h2, .faq__help) { margin-inline: auto; text-align: center; }
  }
  @media (min-width: 1024px) {
    .faq__grid {
      grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
      grid-template-rows: auto 1fr;
      column-gap: clamp(3rem, 6vw, 7rem);
      row-gap: 3rem;
      align-items: start;
    }
    .faq__aside { grid-column: 1; grid-row: 1; }
    .faq__list { grid-column: 2; grid-row: 1 / span 2; }
    .faq__mosaic { grid-column: 1; grid-row: 2; align-self: end; margin-top: 0; }
  }

  /* ================= NOSSA SENHORA APARECIDA =================
     Cabeçalho centralizado (eyebrow, título e subtítulo) + duas colunas de mesma altura:
     fotos com o selo do logo | destaques com ícones e CTA */
  /* azul-marinho quase preto do logo do N. Sra. (texto do selo) */
  .sibling { --nsa-ink: #12113A; }
  .sibling__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: clamp(2rem, 5vh, 3.5rem);
  }
  .sibling__head .eyebrow { margin-bottom: 0.85rem; }
  .sibling__head .h2 { max-width: 34ch; }
  .sibling__head .lead { max-width: 46rem; margin-top: 1.1rem; }
  .sibling__grid { display: grid; gap: clamp(2.5rem, 5vw, 5rem); }
  /* Uma foto só, preenchendo a coluna */
  .sibling__media { position: relative; width: 100%; aspect-ratio: 4 / 3; }
  .sibling__frame { position: absolute; inset: 0; }
  .sibling__img { position: absolute; inset: 0; border-radius: var(--r-xl); box-shadow: var(--shadow-md); }

  /* Selo: disco claro com o emblema do logo no centro e o nome girando em volta.
     Preso ao canto superior esquerdo da foto, passando um pouco da borda; a largura é uma
     fração da largura da foto, então selo, texto e emblema encolhem junto com ela.
     O quanto ele passa para a esquerda cabe sempre na margem lateral da página. */
  .sibling__seal {
    position: absolute;
    left: 0; top: 0;
    z-index: 2;
    width: 26%;
    translate: -24% -24%;
    filter: drop-shadow(0 12px 24px rgb(21 41 29 / 0.3));
  }
  .sibling__seal svg { width: 100%; height: auto; overflow: visible; }
  .seal-bg { fill: var(--c-papel); }
  /* letter-spacing de partida; o ui.js recalcula para o nome fechar a volta com espaços iguais */
  .seal-text { font: 700 12.5px var(--font-body); letter-spacing: 2.55px; text-transform: uppercase; fill: var(--nsa-ink); }
  .sibling__logo { position: absolute; left: 50%; top: 50%; width: 47%; translate: -50% -50%; }
  .sibling__logo img { width: 100%; height: auto; }

  .sibling__content { display: flex; flex-direction: column; gap: clamp(1.25rem, 2.5vw, 1.75rem); }
  .nsa-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  /* ícone ao lado do texto; no celular (colunas estreitas) o ícone vai para cima */
  .nsa-feat {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: clamp(0.95rem, 1.6vw, 1.15rem);
    border-radius: var(--r-lg);
    background: var(--c-linho-50);
  }
  @media (max-width: 639.98px) {
    .nsa-feat { flex-direction: column; align-items: flex-start; justify-content: space-between; }
  }
  .nsa-feat__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.75rem; height: 2.75rem;
    border-radius: 50%;
    background: var(--c-mata-900);
    color: var(--c-sol-400);
    transition: rotate var(--dur) var(--ease-out);
  }
  .nsa-feat__icon .ico { width: 1.4rem; }
  .nsa-feat:hover .nsa-feat__icon { rotate: -8deg; }
  .nsa-feat__text {
    font-family: var(--font-display);
    font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.3rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
  }
  /* Metragem: mesmas cores dos outros cards, só a tipografia em destaque */
  .nsa-feat--main small {
    display: block;
    margin-bottom: 0.35rem;
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-wrap: balance;
    color: var(--text-muted);
  }
  .nsa-feat--main strong {
    display: block;
    font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.4rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.03em;
  }
  @media (max-width: 1023.98px) {
    .sibling__head .lead { text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
    .sibling__cta .btn { width: 100%; justify-content: space-between; }
    /* no celular a foto vai quase até a borda da tela: o selo passa menos para a esquerda */
    .sibling__seal { translate: -12% -28%; }
  }
  @media (min-width: 1024px) {
    /* a seção ocupa a tela: o respiro de cima nunca é menor que o menu fixo, que reaparece ao rolar para cima */
    .sibling {
      display: flex; align-items: center; min-height: 100svh;
      padding-block: max(calc(var(--header-h) + 1.25rem), clamp(3rem, 8vh, 5.5rem)) clamp(3rem, 8vh, 5.5rem);
    }
    .sibling > .container { width: 100%; }
    /* as fotos acompanham a altura da coluna de destaques (no mínimo --cols-h) */
    .sibling__grid {
      --cols-h: clamp(400px, 52vh, 540px);
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      align-items: stretch;
    }
    .sibling__media { aspect-ratio: auto; min-height: var(--cols-h); }
    /* o selo passa da borda direita da foto: não pode encostar nos cards */
    .sibling__grid { column-gap: clamp(3.5rem, 6vw, 6rem); }
    .sibling__content { min-height: var(--cols-h); }
    .nsa-feats { flex: 1 1 auto; grid-auto-rows: 1fr; }
  }

  /* ================= FORMULÁRIO ================= */
  /* Formulário: ocupa exatamente uma tela no desktop (sem scroll além da seção) */
  .contact { --contact-pad: clamp(1.5rem, 5vh, 3.5rem); display: flex; align-items: center; min-height: 100svh; padding-block: clamp(2rem, 6vh, 4.5rem); }
  .contact__grid { display: grid; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
  .contact .h2 { max-width: 18ch; margin-bottom: 1.5rem; }
  .contact .h2:focus { outline: none; }
  .seals { display: grid; gap: 0.75rem; margin-top: 2rem; --tile: 38px; }
  .seals li { display: flex; align-items: center; gap: 0.9rem; font-weight: 600; }
  .mosaic {
    --tile: clamp(52px, 6.4vw, 84px);
    display: grid;
    grid-template-columns: repeat(4, var(--tile));
    gap: 10px;
    perspective: 900px;
  }
  .mosaic .tile { cursor: pointer; }
  .mosaic .tile.is-swapped { --t-bg: var(--c-mata-900); }
  @media (max-width: 1023.98px) {
    .mosaic { grid-template-columns: repeat(4, var(--tile)); --tile: clamp(48px, 17vw, 72px); justify-content: start; }
    .mosaic .tile:nth-child(n + 9) { display: none; }
  }
  .contact__card {
    position: relative;
    padding: clamp(1.25rem, min(3vw, 3.6vh), 2.5rem);
    border-radius: var(--r-xl);
    background: var(--c-linho-50);
    color: var(--c-tinta);
    box-shadow: var(--shadow-lg);
    --text-muted: rgb(27 35 29 / 0.68);
    --line: rgb(27 35 29 / 0.14);
    --focus: var(--c-mata-700);
  }
  .contact__card .btn--accent { --btn-bg: var(--btn-green); --btn-fg: var(--c-linho-50); }
  .lead-form__title { font-family: var(--font-display); font-size: var(--fs-h3); margin-bottom: clamp(0.6rem, 1.6vh, 1.1rem); }
  .contact .field { margin-bottom: clamp(0.5rem, 1.2vh, 0.8rem); gap: 0.35rem; }
  .contact .field__input { min-height: clamp(2.8rem, 5.6vh, 3.2rem); padding-block: 0.6rem; }
  .lead-form .btn { margin-top: clamp(0.4rem, 1vh, 0.75rem); }
  .lead-form__legal { margin-top: clamp(0.6rem, 1.4vh, 1rem); font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.5; }
  .lead-form__legal a { color: var(--c-mata-700); font-weight: 600; }
  .lead-success { display: grid; gap: 1rem; justify-items: start; padding-block: 1rem; --tile: 64px; }
  .lead-success:focus { outline: none; }
  .lead-success__title { font-family: var(--font-display); font-size: var(--fs-h3); }
  .lead-success p { color: var(--text-muted); }
  .link-back { font-weight: 700; font-size: var(--fs-sm); color: var(--c-mata-700); text-decoration: underline; text-underline-offset: 4px; }
  @media (max-width: 1023.98px) {
    .contact__pitch > .eyebrow { display: flex; justify-content: center; text-align: center; }
    .contact__pitch > .h2 { margin-inline: auto; text-align: center; }
    .contact__pitch > .lead { margin-inline: auto; text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
  }
  @media (min-width: 1024px) {
    /* Espaçamento igual em cima e embaixo: o conteúdo fica centralizado na seção.
       Os CTAs rolam até o topo exato da seção (sem descontar o menu), então ela ocupa a tela inteira. */
    .contact { --contact-pad: max(var(--header-h), clamp(2rem, 7vh, 4.5rem)); min-height: 100svh; padding-block: var(--contact-pad); scroll-margin-top: calc(var(--header-h) * -1); }
    .contact__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  }

  /* ================= RODAPÉ ================= */
  .site-footer {
    position: relative;
    overflow: hidden;
    padding-block: clamp(4rem, 8vw, 7rem) 2rem;
    background: var(--c-mata-900);
    color: rgb(247 242 233 / 0.82);
    border-top: 1px solid rgb(247 242 233 / 0.08);
  }
  .site-footer__sun {
    position: absolute;
    right: -6vw; top: -4vw;
    width: clamp(320px, 46vw, 680px);
    opacity: 0.1;
    --mark-wave-1: var(--c-linho-50);
    --mark-wave-2: var(--c-linho-50);
    --mark-sun: var(--c-sol-400);
    pointer-events: none;
  }
  .site-footer__sun svg { width: 100%; height: auto; }
  .site-footer__tiles { position: absolute; left: var(--gutter); bottom: 5.5rem; display: flex; gap: var(--tile-gap); --tile: 36px; opacity: 0.9; }
  .site-footer__grid { position: relative; display: grid; gap: 2.5rem; padding-bottom: 5rem; }
  .site-footer__tagline { margin-top: 1rem; font-family: var(--font-display); font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.4rem); color: var(--c-linho-50); line-height: 1.1; }
  .site-footer__title { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-pessego-300); margin-bottom: 1rem; }
  .site-footer__col li { padding: 0.3rem 0; font-size: var(--fs-sm); }
  .site-footer__col a { text-decoration: none; }
  .site-footer__col a:hover { color: var(--c-linho-50); text-decoration: underline; text-underline-offset: 4px; }
  .to-top { display: inline-flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: var(--fs-sm); text-decoration: none; color: var(--c-linho-50); }
  .to-top svg { width: 48px; height: 48px; border-radius: 6px; transition: transform 0.8s var(--ease-out); }
  .to-top:hover svg { transform: rotate(-90deg); }
  .site-footer__legal {
    position: relative;
    display: grid; gap: 0.5rem;
    justify-items: center;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgb(247 242 233 / 0.12);
    font-size: var(--fs-xs);
    color: rgb(247 242 233 / 0.6);
  }
  .site-footer__legal a { color: inherit; }
  .site-footer__credit a { color: var(--c-linho-50); font-weight: 600; text-decoration: none; }
  .site-footer__credit a:hover { text-decoration: underline; text-underline-offset: 4px; }
  .site-footer__credit a span { white-space: nowrap; }
  .site-footer__credit sup { font-size: 0.6em; line-height: 0; }
  @media (min-width: 768px) {
    .site-footer__grid { grid-template-columns: 1.6fr 1fr 1fr auto; }
  }
  @media (max-width: 1023.98px) {
    .site-footer { padding-bottom: 6rem; }
    .site-footer__tiles { display: none; }
    .site-footer__grid { justify-items: center; text-align: center; }
  }
  @media (min-width: 1024px) {
    /* faixa de crédito: desenvolvedor à esquerda, dados do empreendimento à direita */
    .site-footer__legal { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem 2rem; text-align: left; }
    .site-footer__legal p:last-child { text-align: right; }
  }
}
