:root {
  --navy: #15233f;
  --navy-deep: #0d1729;
  --blue-medium: #2a3f5f;
  --silver: #c8ccd3;
  --silver-light: #e8eaed;
  --cream: #f8f6f1;
  --white: #ffffff;
  --text-dark: #1a1a1a;
  --text-muted: #6b7280;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(21, 35, 63, 0.15);
}

/* Suporta safe-area (iPhone com notch / Dynamic Island) */
@supports (padding: env(safe-area-inset-bottom)) {
  .floating-wa {
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    right: calc(1.25rem + env(safe-area-inset-right));
  }
}

.font-display {
  font-family: 'DM Sans', system-ui, sans-serif;
  letter-spacing: -0.015em;
}

h1.font-display, h2.font-display {
  letter-spacing: -0.025em;
}

/* Reveal-on-scroll animation */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
}

/* Header scroll behavior */
#site-header.scrolled {
  background-color: rgba(13, 23, 41, 0.98);
  box-shadow: 0 1px 0 rgba(200, 204, 211, 0.1);
}

/* Slow bounce for hero scroll cue */
@keyframes bounceSlow {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(6px); opacity: 1; }
}
.animate-bounce-slow {
  animation: bounceSlow 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

/* CTA primary subtle elevation on hover */
.cta-primary {
  position: relative;
}
.cta-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid currentColor;
  opacity: 0;
  transform: translate(6px, 6px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.cta-primary:hover::after {
  opacity: 0.3;
  transform: translate(8px, 8px);
}

/* Container override for editorial breathing room */
.container {
  max-width: 1280px;
}

/* Selection */
::selection {
  background: var(--navy);
  color: var(--silver);
}

/* Scrollbar (desktop) */
@media (min-width: 1024px) {
  ::-webkit-scrollbar {
    width: 10px;
  }
  ::-webkit-scrollbar-track {
    background: var(--cream);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--silver);
    border: 2px solid var(--cream);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--blue-medium);
  }
}

/* Map iframe loading state — keep dark background until map loads */
iframe {
  background: var(--navy-deep);
}

/* Improve type rendering */
h1, h2, h3 {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Focus visible (accessibility) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--silver);
  outline-offset: 4px;
}

/* Video autoplay polish — hide any browser overlay/play button */
video::-webkit-media-controls {
  display: none !important;
  -webkit-appearance: none;
}
video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none;
}
video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}
video::-webkit-media-controls-panel {
  display: none !important;
}
video::-webkit-media-controls-overlay-enclosure {
  display: none !important;
}

/* Mobile WhatsApp floating spacing — avoid covering CTAs */
@media (max-width: 1023px) {
  section:last-of-type {
    padding-bottom: 5rem;
  }
}

/* Especialidades carousel */
.carousel-track {
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* Only handle horizontal pan inside the carousel — vertical swipes pass through to page scroll */
  touch-action: pan-x pan-y pinch-zoom;
}
.carousel-track::-webkit-scrollbar {
  display: none;
}

/* On mobile use snap-proximity instead of mandatory to avoid scroll lock during vertical swipes */
@media (max-width: 767px) {
  .carousel-track {
    --tw-scroll-snap-strictness: proximity;
    scroll-snap-type: x proximity;
  }
}

/* Card hover shadow elevation (desktop only) */
@media (min-width: 768px) {
  .card-spec {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .card-spec:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 60px -20px rgba(13, 23, 41, 0.35);
  }
}
