/* CHANGELOG (anim brief — 2026-05-27):
   - Inline SVG .brand-mark with first-visit draw animation (Task 1)
   - .topnav.scrolled morph state on desktop (Task 4)
   - .reveal-child base + .reveal-stagger orchestration hooks (Task 2)
   - prefers-reduced-motion guards on all new motion
*/
/* ============================================================
   Dra. Karla Côgo — Landing Page
   Design tokens + base layout
   ============================================================ */

:root {
  /* Palette — cream-base default */
  --cream: #f4ede0;
  --cream-warm: #ede4d2;
  --cream-deep: #e3d8bf;
  --ink: #15211d;
  --ink-soft: #2a3733;
  --ink-mute: #5d6661;
  --ink-faint: #8a8e87;

  /* Brand: marrom warm escuro (Karla Côgo brand kit) */
  --deep: #3a2a1d;
  --deep-2: #4a3727;
  --deep-3: #5a4533;
  --on-deep: #ebe2cc;
  --on-deep-mute: #c4b6a0;

  /* Brand: terracota principal */
  --clay: #c97a3f;
  --clay-hover: #b56a32;
  --clay-soft: #e8c8a5;

  /* Brand: caramelo (tom intermediário) */
  --caramel: #a07a5c;

  /* Brand: sage verde */
  --sage: #7fab85;
  --sage-soft: #c5d8c8;
  --sage-deep: #4a7050;

  /* Brand: coral (accent emocional / danger) */
  --danger: #c76b5f;
  --danger-soft: #ecc4be;
  --whatsapp: #25D366;
  --whatsapp-hover: #1fb858;
  --whatsapp: #25D366;
  --whatsapp-hover: #1fb858;

  /* Stable token names (Tweaks remaps these) */
  --bg: var(--cream);
  --bg-2: var(--cream-warm);
  --bg-3: var(--cream-deep);
  --fg: var(--ink);
  --fg-2: var(--ink-soft);
  --fg-3: var(--ink-mute);
  --fg-4: var(--ink-faint);
  --accent: var(--clay);
  --accent-hover: var(--clay-hover);
  --accent-soft: var(--clay-soft);
  --line: rgba(21, 33, 29, 0.12);
  --line-strong: rgba(21, 33, 29, 0.22);

  /* Type */
  --font-display: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --font-body: "Geist", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  /* Spacing scale */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --s9: 96px; --s10: 128px; --s11: 160px;

  /* Layout */
  --max-w: 1240px;
  --max-w-narrow: 920px;
  --max-w-prose: 680px;
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 14px;
  --radius-xl: 22px;

  /* Density (Tweakable) */
  --section-y: clamp(48px, 5vw, 80px);
}

@media (max-width: 920px) {
  :root {
    --section-y: 48px;
  }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv01", "cv02";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
hr { border: 0; height: 1px; background: var(--line); margin: 0; }

/* ============================================================
   Type system
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
.h-display {
  font-family: var(--font-display);
  font-size: clamp(40px, 6.4vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.h-1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.018em;
}
.h-2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.014em;
}
.h-3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.italic { font-style: italic; }
.serif { font-family: var(--font-display); font-weight: 400; }
em { font-style: italic; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 14px; height: 1px;
  background: currentColor;
  opacity: 0.5;
}
.eyebrow.no-line::before { display: none; }

.lede {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--fg-2);
  text-wrap: pretty;
  max-width: 60ch;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-3);
}
.numeric {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Layout primitives
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}
.wrap-narrow { max-width: var(--max-w-narrow); margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }
.wrap-prose { max-width: var(--max-w-prose); margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }

section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}
.section-tight { padding-top: calc(var(--section-y) * 0.6); padding-bottom: calc(var(--section-y) * 0.6); }

.section-head {
  display: grid;
  gap: var(--s5);
  margin-bottom: var(--s8);
  max-width: var(--max-w-narrow);
}
.section-head .eyebrow { margin-bottom: var(--s2); }

.divider {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* Tone wrappers */
.tone-deep {
  background: var(--deep);
  color: var(--on-deep);
  --bg: var(--deep);
  --bg-2: var(--deep-2);
  --bg-3: var(--deep-3);
  --fg: var(--on-deep);
  --fg-2: var(--on-deep);
  --fg-3: var(--on-deep-mute);
  --fg-4: rgba(235, 226, 204, 0.5);
  --line: rgba(235, 226, 204, 0.14);
  --line-strong: rgba(235, 226, 204, 0.28);
}
.tone-sage {
  background: var(--sage-deep);
  color: #eaf0ec;
  --bg: var(--sage-deep);
  --fg: #eaf0ec;
  --fg-2: #d9e2dc;
  --fg-3: rgba(234, 240, 236, 0.65);
  --line: rgba(234, 240, 236, 0.18);
}
.tone-cream-deep {
  background: var(--cream-deep);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.005em;
  line-height: 1;
  padding: 18px 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent);
  color: #fff8ef;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary .arrow { transition: transform 0.2s; }
.btn-primary:hover .arrow { transform: translateX(3px); }

.btn-outline {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn-outline:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.btn-ghost {
  background: transparent;
  color: var(--fg-2);
  border: 1px solid transparent;
  padding-left: 16px;
  padding-right: 16px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  transition: color 0.18s, text-decoration-color 0.18s;
}
.btn-ghost:hover { color: var(--clay); text-decoration-color: var(--clay); transform: none; }
.btn-ghost .ic { width: 14px; height: 14px; opacity: 0.7; }

.btn-wa {
  background: var(--whatsapp);
  color: #052b13;
  border-color: var(--whatsapp);
}
.btn-wa:hover { background: var(--whatsapp-hover); border-color: var(--whatsapp-hover); }

.btn-large {
  font-size: 17px;
  padding: 22px 34px;
  font-weight: 500;
}
.btn-xl {
  font-size: 19px;
  padding: 26px 40px;
}

.btn-block { width: 100%; max-width: 480px; }

.btn .dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: currentColor;
  opacity: 0.7;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ============================================================
   Trust strip
   ============================================================ */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5);
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
}
.trust-strip > span { display: inline-flex; align-items: center; gap: 8px; }
.trust-strip svg { color: var(--accent); }

/* ============================================================
   Top nav (minimal)
   ============================================================ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}
@media (max-width: 920px) {
  .brand-mark { width: 38px; height: 38px; }
}
.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-top: 3px;
  display: block;
}
.nav-links {
  display: flex;
  gap: var(--s6);
  align-items: center;
}
.nav-links a {
  font-size: 14px;
  text-decoration: none;
  color: var(--fg-2);
  transition: color 0.18s;
}
.nav-links a:hover { color: var(--accent); }
@media (max-width: 820px) {
  .nav-links a:not(.nav-cta) { display: none; }
}
.nav-cta {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream) !important;
  font-size: 13px !important;
  font-weight: 500;
}

/* ============================================================
   Sticky CTA (bottom-right, mobile + desktop)
   ============================================================ */
.float-cta {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--whatsapp);
  color: #052b13;
  font-weight: 500;
  font-size: 15px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.18s, box-shadow 0.18s;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
.float-cta.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.float-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0,0,0,0.24), 0 2px 8px rgba(0,0,0,0.1);
}
.float-cta svg { color: #fff; }   /* logo branco = visual clássico do WhatsApp */
.float-cta .label-full { display: inline; }
@media (max-width: 540px) {
  .float-cta { bottom: 16px; right: 16px; padding: 15px; font-size: 14px; }
  .float-cta .label-full { display: none; }
  .float-cta svg { width: 26px; height: 26px; }
}

/* ============================================================
   Icons
   ============================================================ */
.ic { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.6; }
.ic-lg { width: 28px; height: 28px; stroke-width: 1.4; }
.ic-xl { width: 40px; height: 40px; stroke-width: 1.2; }

/* ============================================================
   Image / Placeholder slots
   ============================================================ */
.ph {
  background: repeating-linear-gradient(
    135deg,
    var(--bg-2) 0 16px,
    var(--bg-3) 16px 32px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-3);
  border-radius: var(--radius-m);
  text-align: center;
  padding: 24px;
  position: relative;
}
.tone-deep .ph {
  background: repeating-linear-gradient(135deg, var(--deep-2) 0 16px, var(--deep-3) 16px 32px);
}
.ph::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-s);
  pointer-events: none;
}
.ph-label {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding: 6px 12px;
  border-radius: 999px;
  max-width: 80%;
}

image-slot {
  --slot-bg: var(--bg-2);
  --slot-border: var(--line-strong);
  --slot-color: var(--fg-3);
  --slot-radius: var(--radius-m);
  border-radius: var(--radius-m);
}

/* ============================================================
   Reveal animation
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   Stagger children (Task 2)
   .reveal-stagger container orchestrates children via JS;
   each .reveal-child fades + lifts in with a transition-delay
   stamped by wireReveal().
   ============================================================ */
.reveal-child {
  opacity: 0;
  transform: translateY(35px);
  transition:
    opacity 0.75s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.reveal-child.in { opacity: 1; transform: translateY(0); }
@media (max-width: 920px) {
  /* Subtler lift on mobile */
  .reveal-child { transform: translateY(22px); transition-duration: 0.6s; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-child {
    opacity: 1;
    transform: none;
    transition: none;
    transition-delay: 0s !important;
  }
}

/* ============================================================
   Brand-mark SVG draw (Task 1)
   Default state = fully drawn (also state for repeat visits).
   .is-drawing class (added by wireBrandMarkDraw on first visit)
   triggers the keyframes.
   ============================================================ */
.brand-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: block;
  overflow: visible;
}
.brand-mark .bm-circle { transform-origin: 50% 50%; }
.brand-mark .bm-arc {
  /* pathLength=1 on the SVG normalizes the dash length */
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.brand-mark.is-drawing .bm-circle {
  opacity: 0;
  animation: bm-circle-in 400ms cubic-bezier(0.2, 0.7, 0.2, 1) 200ms forwards;
}
.brand-mark.is-drawing .bm-arc {
  stroke-dashoffset: 1;
  animation: bm-arc-draw 1200ms cubic-bezier(0.2, 0.7, 0.2, 1) 0ms forwards;
}
.brand-mark.is-drawing .bm-arc-2 { animation-delay: 200ms; }
@keyframes bm-circle-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes bm-arc-draw {
  to { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-mark.is-drawing .bm-circle,
  .brand-mark.is-drawing .bm-arc {
    animation: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
  }
}

/* ============================================================
   Topnav scroll morph (Task 4) — desktop only
   ============================================================ */
.topnav,
.topnav .topnav-inner,
.topnav .brand-text,
.topnav .brand-mark {
  transition:
    background 320ms cubic-bezier(0.2, 0.7, 0.2, 1),
    backdrop-filter 320ms cubic-bezier(0.2, 0.7, 0.2, 1),
    -webkit-backdrop-filter 320ms cubic-bezier(0.2, 0.7, 0.2, 1),
    height 320ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 300ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.topnav .brand-text {
  display: inline-flex;
  flex-direction: column;
  transform-origin: left center;
}
@media (min-width: 921px) {
  .topnav.scrolled {
    background: rgba(244, 237, 224, 0.85);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
  }
  .topnav.scrolled .topnav-inner { height: 52px; }
  .topnav.scrolled .brand-text {
    opacity: 0;
    transform: translateX(-8px);
    pointer-events: none;
  }
  .topnav.scrolled .brand-mark {
    transform: scale(0.92);
  }
}
@media (prefers-reduced-motion: reduce) {
  .topnav,
  .topnav .topnav-inner,
  .topnav .brand-text,
  .topnav .brand-mark {
    transition: none !important;
  }
}
