/* =========================================================
   Maschio & Pionório — base.css
   Tokens, reset, tipografia, header, loader, hero, botões.
   ========================================================= */

:root {
  --bg: #0B0C0E;
  --bg-2: #111215;
  --ink: #F3F1EC;
  --ink-dim: #B4B2AC;      /* contraste AA sobre --bg */
  --ink-mute: #8C8A85;
  --line: rgba(243, 241, 236, .12);
  --line-strong: rgba(243, 241, 236, .26);
  --accent: #C2A46B;       /* latão */
  --accent-soft: rgba(194, 164, 107, .14);

  --paper: #F2EEE6;        /* seções claras */
  --paper-2: #E9E3D7;
  --paper-ink: #16171A;
  --paper-dim: #55534E;
  --paper-line: rgba(22, 23, 26, .12);
  --accent-dark: #8A6F3C;  /* latão sobre fundo claro (AA) */

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --pad: clamp(20px, 5vw, 72px);
  --header-h: 76px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: #0B0C0E; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* grão de papel sobre tudo (bem sutil, tira o "liso digital") */
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- tipografia ---------- */
.mono { font-family: var(--mono); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.headline, h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(46px, 7vw, 104px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 4.8vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.6; color: var(--ink-dim); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- fundo ambiente (hero + timeline) ---------- */
#lattice, #gl {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}
#lattice { z-index: 0; opacity: 0; }
#gl { z-index: 1; }
main, footer { position: relative; z-index: 2; }
/* vinheta quente fixa por trás de tudo */
html { background: var(--bg); }
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 78% 18%, rgba(194, 164, 107, .09), transparent 60%),
    radial-gradient(900px 600px at 8% 92%, rgba(80, 90, 110, .10), transparent 60%);
}

/* ---------- botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 0 26px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.btn--primary { background: var(--accent); color: #14120E; border-color: var(--accent); }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn__arrow { transition: transform .35s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--pad);
  transition: background .4s var(--ease), border-color .4s var(--ease), color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(11, 12, 14, .82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.site-header__logo { display: inline-flex; align-items: center; min-height: 48px; }
.site-header__logo img { height: 38px; width: auto; }
.site-nav { display: flex; gap: clamp(16px, 2.2vw, 36px); }
.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-dim);
  transition: color .25s;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); }

/* ---------- loader ---------- */
#veil {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
  clip-path: inset(0 0 0 0);
}
.veil__inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.veil__word { font-family: var(--serif); font-size: clamp(18px, 2vw, 26px); color: var(--ink-dim); }
.veil__count {
  font-family: var(--serif);
  font-size: clamp(64px, 12vw, 168px);
  font-weight: 400;
  line-height: .85;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.veil__bar { margin-top: 20px; height: 1px; background: var(--line); }
.veil__bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.is-ready #veil { display: none; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr) minmax(0, 2fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "meta  meta  meta"
    "copy  stage rail"
    "foot  foot  foot";
  column-gap: 24px;
  padding: calc(var(--header-h) + 40px) var(--pad) 32px;
}
.hero__meta { grid-area: meta; }
.hero__copy { grid-area: copy; align-self: center; max-width: 900px; padding: 5vh 0; }
.hero__title { max-width: 11ch; }
.hero__sub {
  margin-top: clamp(22px, 3vh, 34px);
  max-width: 30em;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.55;
  color: var(--ink-dim);
}
.hero__sub strong { color: var(--ink); font-weight: 600; }
.hero__ctas { margin-top: clamp(30px, 4.5vh, 48px); display: flex; flex-wrap: wrap; gap: 12px; }
.hero__stage { grid-area: stage; min-height: 300px; }
.hero__rail {
  grid-area: rail;
  align-self: center;
  justify-self: end;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: right;
  padding: 4px 18px 4px 0;
  border-right: 1px solid var(--line-strong);
}
.hero__rail li { font-size: 14px; color: var(--ink-dim); white-space: nowrap; }
.hero__rail li:last-child { color: var(--accent); font-weight: 600; }
.hero__foot { grid-area: foot; display: flex; justify-content: center; padding-top: 16px; }
.hero__foot a { font-size: 14px; color: var(--ink-mute); transition: color .25s; }
.hero__foot a:hover { color: var(--accent); }

/* estado inicial para coreografia (só com JS) */
.js .hero-spec { opacity: 0; }
.js .hero__title, .js .hero__sub, .js .hero__ctas { opacity: 0; }
.js [data-decode] { opacity: 0; }

/* ---------- WhatsApp flutuante ---------- */
.wa-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px 0 16px;
  border-radius: 999px;
  background: rgba(11, 12, 14, .82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: border-color .3s, color .3s;
}
.wa-float svg { color: var(--accent); }
.wa-float:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- menu mobile ---------- */
.menu-toggle { display: none; }
.mobile-menu {
  position: fixed; inset: 0; z-index: 45;
  display: flex; flex-direction: column; justify-content: center; gap: 28px;
  padding: calc(var(--header-h) + 24px) var(--pad) 40px;
  background: rgba(11, 12, 14, .97);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: flex; flex-direction: column; }
.mobile-menu nav a {
  display: flex; align-items: center; min-height: 56px;
  font-family: var(--serif); font-size: 30px; line-height: 1.1;
  border-bottom: 1px solid var(--line);
}
.mobile-menu .btn { justify-content: center; }
.mobile-menu__tel { display: flex; align-items: center; justify-content: center; min-height: 48px; color: var(--ink-dim); font-size: 17px; }
body.menu-open { overflow: hidden; }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 13px; }
}
@media (max-width: 960px) {
  :root { --header-h: 64px; }
  .site-nav { display: none; }
  .site-header__logo img { height: 32px; }
  .site-header { z-index: 55; }
  .menu-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px;
    width: 48px; height: 48px; margin-right: -10px;
  }
  .menu-toggle span { display: block; width: 24px; height: 1.5px; background: var(--ink); transition: transform .35s var(--ease); }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }
  .hero__foot a { display: inline-flex; align-items: center; min-height: 44px; }
  .hero__ctas .btn { flex: 1 1 100%; justify-content: center; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto auto;
    grid-template-areas: "meta" "copy" "stage" "rail" "foot";
  }
  .hero__copy { padding: 4vh 0 2vh; }
  .hero__stage { min-height: 160px; }
  .hero__rail {
    justify-self: start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 20px;
    text-align: left;
    border-right: 0;
    border-left: 1px solid var(--line-strong);
    padding: 4px 0 4px 14px;
  }
  .wa-float span { display: none; }
  .wa-float { width: 52px; height: 52px; padding: 0; justify-content: center; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
