@import "./tokens.css";

@tailwind base;
@tailwind components;
@tailwind utilities;

/* ==========================================================================
   1. RESET BASE & ACESSIBILIDADE
   ========================================================================== */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

body {
  background-color: var(--hg-canvas);
  color: var(--hg-ink-primary);
  font-family: var(--hg-font-sans);
  overflow-x: hidden;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Skip link de acessibilidade */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background-color: var(--hg-brand-primary);
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: top 180ms ease-out;
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--hg-accent-luminous);
  outline-offset: 2px;
}

/* Foco acessível global com contraste */
:focus-visible {
  outline: 2px solid var(--hg-accent-luminous);
  outline-offset: 2px;
}

/* Suporte tabular para números de ROI e métricas */
.font-tabular {
  font-family: var(--hg-font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   2. PADRÃO DOUBLE-BEZEL & SUPERFÍCIES TECNOLÓGICAS
   ========================================================================== */
.hg-bezel-outer {
  border-radius: var(--hg-radius-bezel-outer);
  padding: var(--hg-bezel-gap);
  background-color: var(--hg-bg-bezel-outer);
  border: 1px solid var(--hg-border-subtle);
  box-shadow: var(--hg-shadow-elevated);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.hg-bezel-inner {
  border-radius: var(--hg-radius-bezel-inner);
  background-color: var(--hg-surface-1);
  border: 1px solid var(--hg-border-subtle);
  overflow: hidden;
  position: relative;
}

.hg-bezel-inner-accent {
  border-radius: var(--hg-radius-bezel-inner);
  background: radial-gradient(120% 120% at 50% 0%, var(--hg-surface-2) 0%, var(--hg-surface-1) 100%);
  border: 1px solid var(--hg-border-accent);
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   3. FAIXA DINÂMICA DE CAPACIDADES (MARQUEE CSS COMPOSITOR)
   ========================================================================== */
@keyframes marquee-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

.hg-marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: marquee-scroll 32s linear infinite;
}

@media (hover: hover) and (pointer: fine) {
  .hg-marquee-wrapper:hover .hg-marquee-track {
    animation-play-state: paused;
  }
}

.hg-marquee-wrapper:focus-within .hg-marquee-track {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .hg-marquee-track {
    animation: none !important;
    transform: none !important;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
  }
  .hg-marquee-clone {
    display: none !important;
  }
}

/* ==========================================================================
   4. SIMULADOR DE ROI (SLIDERS 1:1 REATIVOS)
   ========================================================================== */
.roi-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: var(--hg-surface-3);
  outline: none;
  touch-action: pan-y;
  cursor: pointer;
  transition: background 150ms ease;
}

.roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--hg-accent-luminous);
  border: 3px solid var(--hg-canvas);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: grab;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.roi-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--hg-accent-luminous);
  border: 3px solid var(--hg-canvas);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: grab;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.roi-slider:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.15);
  box-shadow: 0 0 12px var(--hg-accent-luminous);
}

.roi-slider:active::-moz-range-thumb {
  cursor: grabbing;
  transform: scale(1.15);
  box-shadow: 0 0 12px var(--hg-accent-luminous);
}

.roi-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--hg-canvas), 0 0 0 6px var(--hg-accent-luminous);
}

.roi-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--hg-canvas), 0 0 0 6px var(--hg-accent-luminous);
}

/* ==========================================================================
   5. ACORDEÕES DE FAQ (<details> / <summary>)
   ========================================================================== */
details.hg-faq-item > summary {
  list-style: none;
}

details.hg-faq-item > summary::-webkit-details-marker {
  display: none;
}

details.hg-faq-item[open] .hg-faq-chevron {
  transform: rotate(45deg);
  background-color: var(--hg-accent-luminous);
  color: var(--hg-canvas);
}

/* ==========================================================================
   6. HEADER & MOBILE DRAWER TRANSITIONS
   ========================================================================== */
#mobile-drawer {
  transition: opacity 280ms cubic-bezier(0.32, 0.72, 0, 1), visibility 280ms cubic-bezier(0.32, 0.72, 0, 1);
}

#mobile-drawer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#mobile-drawer:not(.is-open) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Suporte de safe area para iPhones e dispositivos com notch */
.safe-bottom {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}
