/* Peônia Decor: estilos de todas as páginas (tokens, topo, rodapé, botões e componentes). Regras em design/DESIGN.md.
   Os arquivos em /assets ficam uma semana em cache: ao mudar este arquivo, suba o ?v= nos <link> de todas as páginas. */

/* Self-hosted (SIL OFL, licences in assets/fonts): no request to Google, so no visitor IP shared before consent (LGPD).
   Latin subset covers Portuguese; Jost is variable, one file serves 400 and 500. */
@font-face { font-family: "Marcellus"; font-weight: 400; font-display: swap; src: url(fonts/marcellus-latin.woff2) format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 400 500; font-display: swap; src: url(fonts/jost-latin.woff2) format("woff2"); }
:root {
  --salvia: #E8EADF; --salvia-funda: #CDD1BB; --oliva: #9A9970; --ouro: #D4AF5B; --ouro-escuro: #7A5E1C;
  --tinta: #2B2C20; --muted: #43452F;
  --linha: rgb(43 44 32 / 0.2); --linha-clara: rgb(232 234 223 / 0.2);
  --fio: rgb(212 175 91 / 0.35); --ouro-suave: rgb(122 94 28 / 0.6);
  --serif: "Marcellus", Georgia, "Times New Roman", serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
/* Column layout so the footer sits at the bottom of short pages (Contato). */
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  background: var(--salvia); color: var(--tinta); overflow-x: clip; /* full-bleed garland uses 100vw, which includes classic scrollbars */
  font: 400 1.0625rem/1.6 var(--sans); -webkit-font-smoothing: antialiased;
  caret-color: var(--ouro-escuro);
}
main { flex: 1; }
::selection { background: var(--ouro); color: var(--tinta); }
/* Page scrollbar: thin, dark-gold thumb on the sage ground. The root element owns the viewport scrollbar. */
html { scrollbar-width: thin; scrollbar-color: var(--ouro-suave) var(--salvia); }
/* Older WebKit/Blink (ignored where scrollbar-color is supported). */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--salvia); }
::-webkit-scrollbar-thumb { background: var(--ouro-suave); border-radius: 999px; border: 2px solid var(--salvia); }
::-webkit-scrollbar-thumb:hover { background: var(--ouro-escuro); }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--tinta); outline-offset: 4px; }
.top :focus-visible, footer :focus-visible { outline-color: var(--salvia); }

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: max(24px, env(safe-area-inset-left)); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; }
/* The one oversized line on each page: everything below it is a step down. */
h1 { font-size: clamp(2.5rem, 1.4rem + 4.6vw, 5.5rem); line-height: 1.06; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem); line-height: 1.18; }
h3 { font-size: 1.5rem; line-height: 1.2; }
p { margin: 0; text-wrap: pretty; }
.lead { font-size: clamp(1.125rem, 1rem + 0.4vw, 1.25rem); line-height: 1.5; max-width: 44ch; }
.muted { color: var(--muted); }
.small { font-size: 1rem; line-height: 1.5; }
.tel { font-variant-numeric: tabular-nums lining-nums; }
.ico { width: 20px; height: 20px; flex: none; }
/* Optical offset: Jost caps (ratio ~0.70) sit above the line-box centre; measured ~1.5px at 16px. See DESIGN.md Layout. */
.btn .ico, .link .ico, footer .col .ico { transform: translateY(-1.5px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border-radius: 2px;
  background: var(--ouro); color: var(--tinta); text-decoration: none;
  font: 500 1rem/1.25 var(--sans); letter-spacing: 0.01em;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.btn:hover { background: var(--tinta); color: var(--salvia); }
.btn:active { transform: translateY(1px); }
.link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font: 500 1rem/1.25 var(--sans); letter-spacing: 0.01em;
  text-decoration: underline 1px; text-underline-offset: 4px;
}
.link:hover { color: var(--ouro-escuro); }

/* Mobile is the base layout; desktop is layered on in the min-width queries at the end. */

/* Header */
/* Gold hairline along the bottom edge: the hero garland hangs just below it. */
.top { position: sticky; top: 0; z-index: 20; background: var(--tinta); color: var(--salvia); padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid var(--fio); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 64px; }
.top img { display: block; height: 40px; width: auto; }
/* Logo link meets the 44px touch floor around the 40px mark. */
.top .wrap > a:first-child { display: grid; place-items: center; min-width: 48px; min-height: 48px; }
.top .nav, .top .btn { display: none; }
.top .nav a { position: relative; font: 500 1rem/1.25 var(--sans); text-decoration: none; padding-block: 12px; }
/* Gold rule grows from the left on hover and stays under the page that is open (aria-current). */
.top .nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 1px; background: var(--ouro);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform 200ms ease-out;
}
.top .nav a:hover::after, .top .nav a[aria-current]::after { transform: scaleX(1); }
.top .nav a[aria-current] { color: var(--ouro); }
.menu summary { list-style: none; display: grid; place-items: center; width: 48px; height: 48px; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu .ico { width: 28px; height: 28px; }
.menu[open] .i-open, .menu:not([open]) .i-close { display: none; }
.menu nav { position: absolute; inset: calc(100% + 1px) 0 auto 0; z-index: 5; background: var(--tinta); padding: 8px 24px 24px; display: grid; border-bottom: 1px solid var(--fio); }
.menu nav a { min-height: 48px; display: flex; align-items: center; font: 500 1rem/1.25 var(--sans); text-decoration: none; border-top: 1px solid var(--linha-clara); }
.menu nav a[aria-current] { color: var(--ouro); }

/* Sections */
section { padding-block: 56px; scroll-margin-top: 64px; }
.oliva { background: var(--oliva); color: var(--tinta); }
.funda { background: var(--salvia-funda); }
/* Interior pages open on a title and a short intro. */
.page-head .lead { margin-top: 16px; }
.actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 32px; }
.actions .btn { width: 100%; }

/* Home hero: photos hang as baubles from a draped garland */
.garland { position: relative; height: 184px; margin-inline: -24px; }
.garland svg { position: absolute; inset: 0 0 auto 0; width: 100%; height: 40px; overflow: visible; }
.garland path { fill: none; stroke: var(--ouro-escuro); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bauble {
  --size: min(21vw, 88px);
  position: absolute; top: calc(var(--y-m) - 4px); left: calc(var(--x-m) - var(--size) / 2); width: var(--size); margin: 0;
  display: flex; flex-direction: column; align-items: center;
  transform-origin: 50% 0;
}
.bauble::before { content: ""; width: 1px; height: var(--len-m); background: var(--ouro-escuro); }
/* Hook dot overlaps the thread by 1px (optical join, no hairline gap between dot and thread). */
.bauble::after { content: ""; order: -1; width: 8px; height: 8px; margin-bottom: -1px; border-radius: 50%; background: var(--ouro-escuro); }
.bauble span { width: 16px; height: 8px; border-radius: 2px 2px 0 0; background: var(--ouro); }
.bauble img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; outline: 1px solid rgb(122 94 28 / 0.45); outline-offset: 4px; }
/* Desktop-only extras: display:none plus loading="lazy" means phones never download them. */
.bauble.extra { display: none; }

.hero .wrap { padding-block: 0 48px; }
.hero-text { padding-top: 16px; text-align: center; }
.hero-text .lead { margin: 16px auto 0; }
.hero .actions { align-items: stretch; }

/* Arched photo with its caption always visible: home highlights, Trabalhos grid. */
.obra { margin: 0; }
.obra .ph { aspect-ratio: 4 / 5; overflow: hidden; border-radius: 999px 999px 2px 2px; }
.obra img { width: 100%; height: 100%; object-fit: cover; }
.obra figcaption { padding-top: 16px; }
.obra h3 { font-size: 1.25rem; line-height: 1.25; }
.obra figcaption p { margin-top: 4px; font-size: 1rem; line-height: 1.5; max-width: 32ch; }

/* Home highlights: a swipeable row on phones (the next card peeks in), four columns on wider screens.
   The section is named by a quiet line instead of a big heading, so the photos lead. */
.kicker { display: flex; align-items: center; gap: 16px; font: 400 1.125rem/1.4 var(--sans); color: var(--muted); }
/* The trailing rule only on desktop: on phones the line wraps and the rule would float off at the edge. */
.kicker::after { content: ""; flex: none; width: 48px; height: 1px; background: var(--ouro-escuro); display: none; }
.destaques {
  list-style: none; margin: 0 auto; max-width: 1240px;
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 24px 24px 8px; scroll-padding-inline: 24px; outline-offset: -4px;
}
.destaques::-webkit-scrollbar { display: none; }
.destaques li { flex: none; width: min(72vw, 288px); scroll-snap-align: start; }
.spot-actions { display: flex; flex-wrap: wrap; gap: 0 32px; margin-top: 16px; }

/* Process steps (home, Oliva band) */
.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 24px; }
.steps li { position: relative; border-top: 1px solid var(--linha); padding-top: 24px; display: grid; grid-template-columns: 40px 1fr; column-gap: 16px; align-items: baseline; }
.num { font: 400 2rem/1.1 var(--serif); grid-row: 1 / 3; }
/* "Árvore acesa": when the section scrolls in, a gold thread lights each step's rule in order, once. */
.steps li::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--ouro-escuro);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform 300ms ease-out;
}
.steps li:nth-child(2)::before { transition-delay: 200ms; }
.steps li:nth-child(3)::before { transition-delay: 400ms; }
.steps.lit li::before { transform: scaleX(1); }
.steps p { margin-top: 12px; max-width: 34ch; }

/* Title, the two partners under one arch, then text: Sobre nós (story) and the home closing section. */
.dupla .wrap { display: grid; grid-template-areas: "intro" "foto" "texto"; gap: 32px; }
.dupla-intro { grid-area: intro; }
.dupla-intro .lead, .dupla-intro > p { margin-top: 16px; }
.retrato { margin: 0; }
.dupla .retrato { grid-area: foto; }
.retrato img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 999px 999px 2px 2px; outline: 1px solid var(--ouro-escuro); outline-offset: 4px; }
.retrato figcaption { margin-top: 16px; font-size: 1rem; line-height: 1.5; }
.dupla-texto { grid-area: texto; max-width: 65ch; }
.dupla-texto p + p { margin-top: 16px; }
.dupla-texto .actions { margin-top: 0; }

/* Home closing: who does the work, then the partners' photo; photo left, text right on desktop. */
.fecho .wrap { display: grid; gap: 40px; }
.fecho-texto p { margin-top: 16px; max-width: 52ch; }

/* Closing invite: the page ends on the next step. */
.convite p { margin-top: 16px; max-width: 44ch; }

/* Trabalhos: every photo, one column on phones, then two and three. */
.grade { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 48px; }
.serie { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 48px; }
.serie-intro p { margin-top: 16px; max-width: 52ch; }

/* Contato */
.team .wrap { display: grid; gap: 8px; align-items: center; }
/* Shares the row with the portraits from 1024px, so the display size stops short of the home hero's. */
.team h1 { font-size: clamp(2.5rem, 1.6rem + 2.4vw, 4rem); }
.team-intro p { margin-top: 16px; max-width: 52ch; }
.team-intro .link { margin-top: 16px; }
.contacts { display: grid; margin-top: 24px; }
/* Mobile: arched portrait beside the name; the button runs full width underneath. */
.contact { padding: 24px 0; display: grid; grid-template-columns: 96px 1fr; column-gap: 24px; align-items: center; }
.contact img { grid-row: 1 / 3; width: 96px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 999px 999px 2px 2px; outline: 1px solid var(--ouro-escuro); outline-offset: 4px; }
.contact h2 { font-size: 1.5rem; line-height: 1.2; align-self: end; }
.contact .tel { align-self: start; margin-top: 8px; }
.contact .btn { grid-column: 1 / -1; margin-top: 24px; width: 100%; }
.contact + .contact { border-top: 1px solid var(--linha); }

footer { position: relative; overflow-x: clip; background: var(--tinta); color: var(--salvia); }
footer .drape { position: absolute; inset: 0 0 auto 0; width: 100%; height: 24px; overflow: visible; }
footer .drape path { fill: none; stroke: var(--ouro); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0.7; }
/* Bottom room so the floating WhatsApp button never covers the last line on phones. */
footer > .wrap { display: grid; justify-items: center; text-align: center; padding-block: 0 calc(80px + env(safe-area-inset-bottom, 0px)); }
/* Thread from the drape's lowest point (22/24 of 24px) down to the logo. */
footer .hang { display: flex; flex-direction: column; align-items: center; padding-top: 22px; }
footer .hang::before { content: ""; width: 1px; height: 24px; background: var(--ouro); opacity: 0.7; }
footer .hang img { height: 56px; width: auto; margin-top: 4px; }
footer .tagline { margin-top: 16px; font: 400 1.25rem/1.3 var(--serif); text-wrap: balance; }
footer .col { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 24px; margin-top: 16px; font-size: 1rem; color: rgb(232 234 223 / 0.8); }
footer .place { min-height: 44px; display: flex; align-items: center; }
footer .col a { color: var(--salvia); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
footer .col a:hover { text-decoration: underline 1px; text-underline-offset: 4px; }

/* Floating WhatsApp: shown only while no other WhatsApp button is on screen (assets/site.js) */
.wa-float {
  position: fixed; z-index: 10; min-height: 56px; padding: 16px 24px;
  right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
  border: 1px solid rgb(43 44 32 / 0.25);
  transition: opacity 200ms ease-out, transform 200ms ease-out, visibility 0s, background-color 150ms ease-out, color 150ms ease-out;
}
.wa-float.is-hidden {
  opacity: 0; transform: translateY(16px); visibility: hidden;
  transition: opacity 200ms ease-in, transform 200ms ease-in, visibility 0s linear 200ms;
}

@media (min-width: 600px) {
  .grade { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
}

@media (min-width: 768px) {
  section { padding-block: 80px; scroll-margin-top: 80px; }
  /* Three equal tracks keep the nav centred on the page whatever the logo and button widths. */
  .top .wrap { display: grid; grid-template-columns: 1fr auto 1fr; min-height: 80px; }
  .top img { height: 48px; }
  .top .nav { display: flex; gap: 40px; }
  .top .btn { display: inline-flex; justify-self: end; transition: opacity 200ms ease-out, visibility 0s, background-color 150ms ease-out, color 150ms ease-out; }
  /* One WhatsApp CTA on screen at a time: the header button waits while another WhatsApp button is on screen. */
  .top .btn.is-hidden { opacity: 0; visibility: hidden; transition: opacity 200ms ease-in, visibility 0s linear 200ms; }
  /* The sticky header button covers desktop, so the floating one is phone-only. */
  .wa-float { display: none; }
  .menu { display: none; }

  .actions { flex-direction: row; align-items: center; gap: 32px; margin-top: 40px; }
  .actions .btn { width: auto; }
  .page-head .lead { margin-top: 24px; }

  /* Full-bleed: the garland runs edge to edge under the header; the hero clips the 100vw scrollbar overhang. */
  .garland { height: 320px; margin-inline: calc(50% - 50vw); }
  .hero { overflow-x: clip; }
  .garland svg { height: 72px; }
  /* Scales with the viewport so six baubles never overlap between 768px and 1320px. */
  .bauble { --size: min(152px, 11.5vw); top: calc(var(--y-d) - 4px); left: calc(var(--x-d) - var(--size) / 2); }
  .bauble::before { height: var(--len-d); }
  .bauble.extra { display: flex; }
  /* Desktop: the hero fills the first screen under the sticky header; the headline sits in the space left below the garland. */
  .hero .wrap { padding-bottom: 64px; min-height: min(calc(100svh - 80px), 880px); display: flex; flex-direction: column; }
  .hero-text { margin-block: auto; padding-top: 24px; }
  .hero-text .lead { margin-top: 24px; max-width: 48ch; }
  .hero .actions { justify-content: center; margin-top: 40px; }

  .kicker::after { display: block; }
  /* Four highlights fill the page grid exactly, so nothing scrolls sideways on wider screens. */
  .destaques { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; overflow: visible; }
  .destaques li { width: auto; }

  .steps { grid-template-columns: repeat(3, 1fr); margin-top: 40px; gap: 40px; }
  .steps li { display: block; padding-top: 24px; }
  .num { display: block; font-size: 2.5rem; }
  .steps h3 { margin-top: 12px; }

  .dupla .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr; grid-template-areas: "foto intro" "foto texto"; column-gap: 64px; row-gap: 32px; }
  /* The photo stays in view while the text scrolls past (header 80px + 48px of air). */
  .dupla .retrato { position: sticky; top: 128px; align-self: start; }
  .dupla-intro .lead, .dupla-intro > p { margin-top: 24px; }
  .fecho .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 64px; align-items: center; }
  .fecho .retrato { order: -1; }
  .fecho-texto p { margin-top: 24px; }

  .grade { margin-top: 48px; row-gap: 64px; }
  .serie { margin-top: 48px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }

  /* 768–1023px: intro above, the two portraits centred below; side by side from 1024px. */
  .contacts { grid-template-columns: repeat(2, 224px); column-gap: 40px; justify-content: center; margin-top: 32px; }
  .contact { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 0; }
  /* Squarer arch keeps the portraits close to the height of the text beside them. */
  .contact img { grid-row: auto; width: 100%; aspect-ratio: 1; margin-bottom: 16px; }
  .contact h2, .contact .tel { align-self: auto; }
  .contact + .contact { border-top: 0; }
  .contact .btn { width: 100%; margin-top: 16px; padding-inline: 16px; }

  footer > .wrap { padding-bottom: 32px; }
  /* Deeper drape on wide screens so it still reads as a curve; the thread starts at its lowest point (22/24). */
  footer .drape { height: 40px; }
  footer .hang { padding-top: 37px; }
}
@media (min-width: 1024px) {
  .grade { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .team .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 64px; align-items: center; }
  .contacts { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .top .nav a::after { transition: none; }
  .steps li::before { transition: none; }
  .btn, .top .btn, .top .btn.is-hidden, .wa-float, .wa-float.is-hidden { transition: none; }
  .wa-float.is-hidden { transform: none; }
}
