/* ============================================
   TANGARÁ — Design System
   ============================================ */

:root {
  /* Brand colors — Tangará IDV oficial */
  --brand-navy: #162163;        /* azul Tangará — primário (deep) */
  --brand-navy-deep: #0f1646;   /* ainda mais escuro */
  --brand-navy-soft: #1e2d7d;   /* variação mais clara */
  --brand-red: #d81921;         /* vermelho Tangará */
  --brand-red-deep: #b01019;
  --brand-green: #00a859;       /* sucesso / disponibilidade */
  --brand-green-deep: #007d42;

  /* Neutrals — subtly warm */
  --ink: #0b1220;
  --ink-2: #2a3344;
  --ink-3: #5a6478;
  --ink-4: #8b93a7;
  --line: #e4e7ee;
  --line-2: #eef1f6;
  --bg: #ffffff;
  --bg-2: #f7f8fb;
  --bg-3: #eff1f6;

  /* Density (tweakable) */
  --density: 1;
  --space-xs: calc(4px * var(--density));
  --space-sm: calc(8px * var(--density));
  --space-md: calc(16px * var(--density));
  --space-lg: calc(24px * var(--density));
  --space-xl: calc(40px * var(--density));
  --space-2xl: calc(64px * var(--density));
  --space-3xl: calc(96px * var(--density));
  --space-4xl: calc(128px * var(--density));

  /* Type (tweakable) */
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Animation speed */
  --anim-speed: 1;
}

/* Tipografia alternativa (tweakable) */
body[data-font="classic"] {
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
}
body[data-font="industrial"] {
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'Archivo', system-ui, sans-serif;
}
body[data-font="geometric"] {
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

body[data-density="compact"] { --density: 0.75; }
body[data-density="comfortable"] { --density: 1; }
body[data-density="spacious"] { --density: 1.25; }

body[data-anim="off"] * {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-red);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--brand-red);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  border-radius: 50px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .3s cubic-bezier(.2,.7,.2,1);
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--brand-red);
  color: white;
  box-shadow: 0 4px 16px rgba(216, 25, 33, 0.25);
}
.btn-primary:hover {
  background: var(--brand-red-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(216, 25, 33, 0.35);
}
.btn-secondary {
  background: var(--brand-navy);
  color: white;
  box-shadow: 0 4px 16px rgba(22, 33, 99, 0.2);
}
.btn-secondary:hover {
  background: var(--brand-navy-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(22, 33, 99, 0.3);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--brand-navy);
  color: var(--brand-navy);
  background: rgba(22, 33, 99, 0.04);
}
.btn-whatsapp {
  background: var(--brand-green);
  color: white;
  box-shadow: 0 4px 16px rgba(0, 168, 89, 0.25);
}
.btn-whatsapp:hover {
  background: var(--brand-green-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 168, 89, 0.35);
}

.btn svg { width: 18px; height: 18px; }

/* Cards */
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all .3s cubic-bezier(.2,.7,.2,1);
}
.card:hover {
  border-color: var(--ink-3);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -20px rgba(10, 37, 64, 0.15);
}

/* Placeholders listrados para fotos */
.photo-placeholder {
  background:
    repeating-linear-gradient(
      135deg,
      #e4e7ee 0px, #e4e7ee 1px,
      #f7f8fb 1px, #f7f8fb 10px
    );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.photo-placeholder::after {
  content: '';
  position: absolute; inset: 12px;
  border: 1px dashed #b4bbc9;
  pointer-events: none;
}
.photo-placeholder span {
  background: white;
  padding: 6px 10px;
  border: 1px solid #b4bbc9;
  position: relative;
  z-index: 1;
  max-width: 70%;
}
.photo-placeholder.dark {
  background:
    repeating-linear-gradient(
      135deg,
      #1e2d7d 0px, #1e2d7d 1px,
      #162163 1px, #162163 10px
    );
  color: rgba(255,255,255,0.6);
}
.photo-placeholder.dark::after { border-color: rgba(255,255,255,0.25); }
.photo-placeholder.dark span { background: #162163; border-color: rgba(255,255,255,0.25); }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.2s cubic-bezier(.16,1,.3,1), transform 1.2s cubic-bezier(.16,1,.3,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: .15s; }
.reveal-delay-2 { transition-delay: .3s; }
.reveal-delay-3 { transition-delay: .45s; }
.reveal-delay-4 { transition-delay: .6s; }

/* Navbar */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: all .3s ease;
}
.nav.scrolled {
  border-bottom-color: var(--line);
  background: rgba(255,255,255,0.98);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--space-md);
  max-width: 1540px;
  margin: 0 auto;
}
.logo-img {
  height: 56px;
  width: auto;
  display: block;
  max-width: 220px;
}
body[data-screen-label="Home"] .nav:not(.scrolled) .logo-img {
  filter: brightness(0) invert(1);
  opacity: 1;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--brand-navy);
}
.logo-mark {
  width: 36px; height: 36px;
  background: url('bird.webp') center/contain no-repeat;
  flex-shrink: 0;
}
.logo span:last-child { color: var(--brand-red); }
.footer .logo-mark { filter: brightness(0) invert(1); opacity: 0.9; }
.footer .logo { color: white; }
.footer .logo span:last-child { color: white; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-links a {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color .2s;
  position: relative;
}
.nav-links a:hover,
.nav-links a.active { color: var(--brand-navy); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--brand-red);
}

.nav-cta {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Footer */
.footer {
  background: var(--brand-navy-deep);
  color: white;
  padding: var(--space-3xl) 0 var(--space-lg);
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}
.footer h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.5);
  margin-bottom: var(--space-md);
  font-weight: 600;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul a {
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  transition: color .2s;
}
.footer ul a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
}

/* Section building blocks */
.section {
  padding: var(--space-3xl) 0;
  position: relative;
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-2xl);
  align-items: end;
  margin-bottom: var(--space-2xl);
}
.section-head h2 {
  font-size: clamp(36px, 4.5vw, 64px);
  color: var(--brand-navy);
}
.section-head p {
  color: var(--ink-3);
  font-size: 17px;
  max-width: 520px;
  line-height: 1.6;
}

/* WhatsApp floating */
.whatsapp-float {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 50;
  background: var(--brand-green);
  color: white;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 168, 89, 0.35);
  cursor: pointer;
  transition: transform .2s;
  animation: wa-pulse 2.4s infinite;
}
.whatsapp-float:hover { transform: scale(1.08); }
.whatsapp-float svg { width: 28px; height: 28px; fill: white; }

@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 168, 89, 0.35), 0 0 0 0 rgba(0, 168, 89, 0.5); }
  50% { box-shadow: 0 8px 24px rgba(0, 168, 89, 0.35), 0 0 0 20px rgba(0, 168, 89, 0); }
}

/* Focus states — Acessibilidade WCAG 2.1 AA */
:focus-visible {
  outline: 2px solid var(--brand-navy);
  outline-offset: 2px;
}
.btn:focus-visible {
  outline: 2px solid var(--brand-navy);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(22, 33, 99, 0.15);
}
.btn-primary:focus-visible,
.btn-whatsapp:focus-visible {
  outline-color: white;
  box-shadow: 0 0 0 4px rgba(22, 33, 99, 0.3);
}
.nav-links a:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 4px;
  border-radius: 8px;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}
.product-card:focus-visible {
  outline: 2px solid var(--brand-navy);
  outline-offset: 2px;
}
.whatsapp-float:focus-visible {
  outline: 2px solid white;
  outline-offset: 4px;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
  .type-reveal {
    visibility: visible !important;
  }
  .type-cursor {
    display: none !important;
  }
  .ken-burns img, .ken-burns .photo-placeholder {
    transform: none !important;
  }
  .tilt-card {
    transform: none !important;
  }
}

/* ============================================
   ANIMATIONS — Enhanced
   ============================================ */

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Page transition */
.page-enter {
  animation: pageEnter .6s cubic-bezier(.2,.7,.2,1);
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* #4 — Type reveal for headings (character by character) */
.type-reveal .type-cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: var(--brand-red);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: caretBlink .5s step-end infinite;
}
.type-reveal .type-cursor.done {
  animation: caretFade .3s ease forwards;
}
@keyframes caretBlink {
  50% { opacity: 0; }
}
@keyframes caretFade {
  to { opacity: 0; }
}

/* #3 — 3D Tilt on cards */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 800px;
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.tilt-card:hover {
  box-shadow: 0 30px 60px -20px rgba(10, 37, 64, 0.25);
}

/* #7 — Ken Burns zoom on gallery images */
.ken-burns {
  overflow: hidden;
}
.ken-burns img,
.ken-burns .photo-placeholder {
  transition: transform 12s cubic-bezier(.16,1,.3,1);
  transform: scale(1.1);
}
.ken-burns.is-visible img,
.ken-burns.is-visible .photo-placeholder {
  transform: scale(1);
}

/* #10 — Ripple effect on buttons */
.btn {
  position: relative;
  overflow: hidden;
}
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleAnim .8s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* #9 — Enhanced stagger reveals */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s cubic-bezier(.16,1,.3,1), transform 1s cubic-bezier(.16,1,.3,1);
}
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: .15s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: .3s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: .45s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: .6s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: .75s; }
.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* #1 — Counter glow pulse when animated */
.stat-count.counted {
  animation: countPulse .6s ease-out;
}
@keyframes countPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); color: var(--brand-red); }
  100% { transform: scale(1); }
}
.stat-count {
  display: inline-block;
}

/* Tweaks panel */
.tweaks-panel {
  position: fixed;
  bottom: 24px; left: 24px;
  z-index: 200;
  background: white;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  font-family: var(--font-display);
  width: 280px;
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-3);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tweaks-panel h4 button {
  background: none; border: none; cursor: pointer; color: var(--ink-3);
  font-size: 18px; line-height: 1;
}
.tweak-row {
  margin-bottom: 14px;
}
.tweak-row label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  display: block;
  margin-bottom: 6px;
}
.tweak-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
}
.tweak-options button {
  padding: 8px 6px;
  font-size: 11px;
  font-family: var(--font-display);
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
  border-radius: 8px;
  transition: all .15s;
}
.tweak-options button.active {
  background: var(--brand-navy);
  color: white;
  border-color: var(--brand-navy);
}

/* ============================================
   MOBILE MENU — Hamburger
   ============================================ */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  padding: 0;
  border-radius: 8px;
  flex-shrink: 0;
}
.nav-toggle span {
  position: absolute;
  left: 50%;
  width: 20px;
  height: 2px;
  background: var(--brand-navy);
  transform: translateX(-50%);
  transition: all .3s cubic-bezier(.2,.7,.2,1);
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 28px; }
body[data-screen-label="Home"] .nav:not(.scrolled) .nav-toggle { border-color: rgba(255,255,255,0.35); }
body[data-screen-label="Home"] .nav:not(.scrolled) .nav-toggle span { background: white; }

body.nav-open .nav-toggle span:nth-child(1) { top: 21px; transform: translateX(-50%) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { top: 21px; transform: translateX(-50%) rotate(-45deg); }

/* ============================================
   RESPONSIVE — Tablet (max-width: 900px)
   ============================================ */
@media (max-width: 900px) {
  :root {
    --space-3xl: calc(64px * var(--density));
    --space-4xl: calc(80px * var(--density));
  }

  .container { padding: 0 16px; }

  /* Nav — hamburger */
  .nav-inner { padding: 14px 16px; }
  .logo-img { height: 40px; }
  .nav-toggle { display: block; }
  .nav-cta .btn:not(.btn-whatsapp) { display: none; }
  .nav-cta .btn-whatsapp {
    padding: 10px 14px !important;
    font-size: 12px !important;
  }
  .nav-cta .btn-whatsapp svg { width: 14px; height: 14px; }

  /* Mobile nav drawer — slide from right */
  .nav-links {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 280px !important;
    height: 100vh !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    background: #ffffff !important;
    padding: 80px 24px 40px !important;
    box-shadow: -10px 0 40px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.2,.7,.2,1);
    overflow-y: auto !important;
    z-index: 99999 !important;
  }
  body.nav-open .nav-links {
    transform: translateX(0);
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-toggle {
    z-index: 999999;
    position: relative;
  }
  body.nav-open .nav-toggle span { background: var(--brand-navy) !important; }
  .nav-links a {
    padding: 16px 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--brand-navy) !important;
    border-bottom: 1px solid var(--line);
    text-align: left;
    width: 100%;
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a:hover { color: var(--brand-red) !important; }
  .nav-links a.active::after { display: none; }
  .nav-links a.active { color: var(--brand-red) !important; }

  /* Section head */
  .section-head {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
  }
  .section-head h2 { font-size: clamp(28px, 8vw, 44px); }
  .section-head p { font-size: 15px; }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl) var(--space-lg);
  }
  .footer { padding: var(--space-2xl) 0 var(--space-lg); margin-top: var(--space-2xl); }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    font-size: 12px;
  }

  /* WhatsApp float */
  .whatsapp-float {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }
  .whatsapp-float svg { width: 26px; height: 26px; }

  /* Tweaks panel */
  .tweaks-panel {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    max-width: 320px;
  }

  /* Buttons — easier to tap */
  .btn {
    padding: 14px 20px;
    font-size: 14px;
    min-height: 48px;
  }

  .section { padding: var(--space-2xl) 0; }
}

/* ============================================
   RESPONSIVE — Phone (max-width: 640px)
   ============================================ */
@media (max-width: 640px) {
  :root {
    --space-2xl: calc(40px * var(--density));
    --space-3xl: calc(48px * var(--density));
  }

  .container { padding: 0 16px; }
  .nav-inner { padding: 10px 16px; }

  /* Footer — single column on phone */
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-lg); }
  .footer-grid > div:first-child { text-align: left; }

  .section-head h2 { font-size: clamp(26px, 9vw, 38px); }
}

/* ============================================
   RESPONSIVE — Small phone (max-width: 380px)
   ============================================ */
@media (max-width: 380px) {
  .nav-cta .btn-whatsapp {
    padding: 8px 10px !important;
    font-size: 11px !important;
  }
  .logo-img { height: 32px; }
}

/* ============================================
   Logo overrides (all pages)
   ============================================ */
.footer .logo-img { height: 56px; filter: brightness(0) invert(1); opacity: 0.95; }
