/* ============================================================
   MaisPorto Consórcios — Design tokens & base
   ============================================================ */

:root {
  /* Palette — Porto navy dominant */
  --ink-900: #050E26;        /* deep blue-black */
  --ink-800: #0A1738;
  --navy-900: #001233;       /* hero bg */
  --navy-800: #00194D;
  --navy-700: #002878;
  --navy-600: #0040A8;
  --porto: #0033A0;          /* Porto blue */
  --azure: #1FB6FF;          /* glow / accent */
  --azure-soft: #6BCBFF;
  --gold: #FCD34D;           /* highlight */
  --gold-warm: #F5A524;
  --cream: #F4EFE3;          /* warm paper */
  --cream-2: #EAE3D2;
  --paper: #FBF8F1;
  --line: rgba(255,255,255,0.08);
  --line-on-cream: rgba(10,18,38,0.08);

  /* Type families */
  --font-display-geometric: "Archivo Black", "Arial Black", sans-serif;
  --font-display-serif: "Instrument Serif", "Times New Roman", serif;
  --font-display-sans: "Space Grotesk", "Helvetica Neue", sans-serif;
  --font-display: var(--font-display-geometric);
  --font-body: "Manrope", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "Menlo", monospace;

  /* Density */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4.5rem;
  --space-12: 7rem;
  --space-16: 10rem;
  --section-py: clamp(5rem, 10vw, 9rem);
  --container: 1280px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  /* Type scale */
  --display-1: clamp(3.4rem, 8.6vw, 7.5rem);
  --display-2: clamp(2.6rem, 6vw, 5rem);
  --display-3: clamp(2rem, 4.5vw, 3.5rem);
  --eyebrow: 0.78rem;
  --body-lg: clamp(1.05rem, 1.4vw, 1.18rem);
  --body: 1rem;
}

[data-density="compact"] {
  --section-py: clamp(3.5rem, 7vw, 6rem);
  --space-8: 3rem;
  --space-12: 4.5rem;
  --space-16: 6.5rem;
}
[data-density="spacious"] {
  --section-py: clamp(6.5rem, 13vw, 12rem);
  --space-8: 6rem;
  --space-12: 9rem;
  --space-16: 13rem;
}

[data-display="serif"] { --font-display: var(--font-display-serif); }
[data-display="sans"]  { --font-display: var(--font-display-sans); }

/* ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--navy-900);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--azure); color: var(--navy-900); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
[data-display="serif"] .display { line-height: 0.96; letter-spacing: -0.015em; }
[data-display="sans"]  .display { font-weight: 600; line-height: 0.95; letter-spacing: -0.03em; }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--eyebrow);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--azure);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

.muted { color: rgba(244, 239, 227, 0.62); }
.muted-ink { color: rgba(5, 14, 38, 0.6); }

/* Sections */
section {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
  position: relative;
}
section.on-cream { background: var(--cream); color: var(--ink-900); }
section.on-paper { background: var(--paper); color: var(--ink-900); }
section.on-navy  { background: var(--navy-900); color: var(--cream); }
section.on-ink   { background: var(--ink-900); color: var(--cream); }

/* Grain noise overlay */
.grain::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.06;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}
.grain > * { position: relative; z-index: 2; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--azure);
  color: var(--navy-900);
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 12px 30px -10px rgba(31,182,255,0.6);
}
.btn-primary:hover { background: #8fdcff; transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  opacity: 0.9;
}
.btn-ghost:hover { background: currentColor; color: var(--navy-900); opacity:1; }
.btn-whats {
  background: #1FAE57;
  color: white;
  box-shadow: 0 12px 30px -10px rgba(31,174,87,0.7);
}
.btn-whats:hover { background: #189c4c; transform: translateY(-2px); }
.btn-dark {
  background: var(--navy-900);
  color: var(--cream);
}
.btn-dark:hover { background: var(--ink-900); }
.btn-arrow svg { transition: transform 0.25s ease; }
.btn-arrow:hover svg { transform: translateX(4px); }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--azure);
  box-shadow: 0 0 0 4px rgba(31,182,255,0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(31,182,255,0.18); }
  50% { box-shadow: 0 0 0 8px rgba(31,182,255,0.04); }
}

/* Scroll reveal — additive enhancement; default is visible so JS-disabled
   or animation-throttled environments never get a blank page. */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
[data-reveal].in-view {
  animation: revealUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
[data-reveal-delay="1"].in-view { animation-delay: 80ms; }
[data-reveal-delay="2"].in-view { animation-delay: 160ms; }
[data-reveal-delay="3"].in-view { animation-delay: 240ms; }
[data-reveal-delay="4"].in-view { animation-delay: 320ms; }
[data-reveal-delay="5"].in-view { animation-delay: 400ms; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal].in-view { animation: none; }
}

/* Utility */
.kbd-num {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
}

/* Number ticker */
.num-roll {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* Card baseline */
.card {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.75rem;
}
.card.on-cream-card {
  background: var(--paper);
  border: 1px solid var(--line-on-cream);
}

/* Form base */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.field label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}
.field input, .field select, .field textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  outline: none;
  transition: border 0.15s ease, background 0.15s ease;
  font-size: 1rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--azure);
  background: rgba(255,255,255,0.06);
}
.field.on-light input, .field.on-light select, .field.on-light textarea {
  background: white;
  border: 1px solid rgba(10,18,38,0.12);
  color: var(--ink-900);
}
.field.on-light input:focus, .field.on-light select:focus { border-color: var(--porto); }
.field.on-light label { color: var(--ink-800); opacity: 0.8; }

/* Tweaks panel positioning override */
.tweaks-trigger { z-index: 100; }

/* Print hide */
@media print {
  .nav, .tweaks-panel, .lead-modal { display: none !important; }
}

/* ============================================================
   Mobile polish
   ============================================================ */
@media (max-width: 720px) {
  :root {
    --section-py: clamp(3rem, 9vw, 5rem);
    --display-2: clamp(2.1rem, 8.5vw, 3rem);
    --display-3: clamp(1.7rem, 6vw, 2.4rem);
    --gutter: 1.25rem;
  }
  .btn {
    padding: 0.85rem 1.3rem;
    font-size: 0.9rem;
  }
  /* Avoid horizontal scroll from absolute decorations */
  body, html { overflow-x: hidden; }
}
@media (max-width: 480px) {
  :root {
    --display-1: clamp(2.4rem, 11vw, 4rem);
    --gutter: 1rem;
  }
  /* Make sure floating WhatsApp doesn't cover bottom CTAs */
  .btn { white-space: normal; }
}
