/**
 * NEWT LANDING PAGE - STYLESHEET & ANIMATIONS
 * Reference: https://mkt.kamino.com.br/software7
 * Design tokens and specifications defined in DESIGN.md
 */

/* ==========================================================================
   1. Google Fonts Import
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Lexend:wght@300;400;500;600;700;800;900&family=Red+Hat+Display:ital,wght@0,300..900;1,300..900&display=swap');

/* ==========================================================================
   2. Design Tokens & CSS Variables
   ========================================================================== */
:root {
  /* Brand Navy & Dark Palette */
  --color-navy-hero: #001e35;
  --color-navy-primary: #00264a;
  --color-navy-dark: hsl(203, 60%, 8%); /* #001322 */
  
  /* Brand Accent & Highlight Colors */
  --color-neon-lime: #e6fd8c;
  --color-brand-cyan: #90edfd;
  --color-brand-sky: #7dd3fc;
  --color-brand-ice: #ebf5fb;

  /* Surface & Background Colors */
  --bg-background: #ffffff;
  --bg-muted-20: rgba(241, 245, 249, 0.5);
  --bg-muted-30: rgba(241, 245, 249, 0.8);
  --card-background: #ffffff;

  /* Border Tokens */
  --border-light: rgba(226, 232, 240, 0.8);
  --border-dark: rgba(255, 255, 255, 0.1);

  /* Typography Colors */
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-white: #ffffff;
  --text-white-70: rgba(255, 255, 255, 0.7);
  --text-white-50: rgba(255, 255, 255, 0.5);
  --text-white-20: rgba(255, 255, 255, 0.2);

  /* Radius Tokens */
  --radius: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Font Families */
  --font-display: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Red Hat Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   3. Base & Typography Utilities
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--color-neon-lime);
  color: var(--color-navy-hero);
}

.font-lexend {
  font-family: var(--font-display);
}

.font-redhat {
  font-family: var(--font-body);
}

.font-inter {
  font-family: var(--font-sans);
}

/* ==========================================================================
   4. Keyframe Animations
   ========================================================================== */

/* Shimmer beam sliding across button */
@keyframes button-shimmer {
  0% {
    left: -3rem;
  }
  100% {
    left: 110%;
  }
}

/* Continuous infinite marquee */
@keyframes marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Reverse marquee scroll */
@keyframes marquee-scroll-reverse {
  0% {
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0);
  }
}

/* Pulse glow for halos and indicators */
@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.6;
    box-shadow: 0 0 20px rgba(230, 253, 140, 0.15);
    transform: scale(1);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 35px rgba(230, 253, 140, 0.35);
    transform: scale(1.02);
  }
}

/* Subtle float effect for visual accents */
@keyframes float-slow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Floating 3D Badge / Illustration Accent */
@keyframes float-badge-3d {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(-1.5deg);
  }
}

.animate-float-badge {
  animation: float-badge-3d 4s ease-in-out infinite;
  will-change: transform;
}

/* Modal Fade-in */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Slide-up */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Tab Panel Fade-in and Slide */
@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98) translateX(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
}

/* ==========================================================================
   5. Button & Badge Styles
   ========================================================================== */

/* Hero Glow Button */
.btn-hero-glow {
  position: relative;
  overflow: hidden;
  background-color: rgba(230, 253, 140, 0.08);
  border: 1px solid rgba(230, 253, 140, 0.3);
  box-shadow: 0 0 30px rgba(230, 253, 140, 0.15), inset 0 0 30px rgba(230, 253, 140, 0.05);
  color: var(--color-neon-lime);
  transition: all 0.3s ease;
}

.btn-hero-glow:hover {
  background-color: rgba(230, 253, 140, 0.15);
  border-color: rgba(230, 253, 140, 0.6);
  box-shadow: 0 0 40px rgba(230, 253, 140, 0.3), inset 0 0 30px rgba(230, 253, 140, 0.1);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Shimmer Light Reflection on Buttons */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}

.btn-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  bottom: -50%;
  width: 48px;
  background: linear-gradient(90deg, transparent, rgba(230, 253, 140, 0.6), transparent);
  transform: skewX(-20deg);
  animation: button-shimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}

/* Dedicated shimmer beam element if used as a child */
.shimmer-beam {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  background: linear-gradient(90deg, transparent, rgba(230, 253, 140, 0.6), transparent);
  transform: skewX(-20deg);
  animation: button-shimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}

/* Floating Bottom-Right CTA Button */
.floating-cta {
  background-color: var(--color-navy-hero);
  border: 1px solid rgba(230, 253, 140, 0.4);
  box-shadow: 0 4px 24px rgba(0, 30, 53, 0.4), 0 0 20px rgba(230, 253, 140, 0.1);
  color: var(--color-neon-lime);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-cta:hover {
  border-color: var(--color-neon-lime);
  box-shadow: 0 6px 28px rgba(0, 30, 53, 0.5), 0 0 30px rgba(230, 253, 140, 0.3);
  transform: translateY(-2px);
}

/* Back to Top Floating Button */
.btn-back-to-top {
  background-color: var(--color-navy-hero);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 30, 53, 0.35);
  transition: all 0.3s ease;
}

.btn-back-to-top:hover {
  background-color: var(--color-navy-primary);
  border-color: var(--color-neon-lime);
  color: var(--color-neon-lime);
  transform: translateY(-2px);
}

/* Tag Pills & Badges */
.tag-pill,
.badge-lime {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  background-color: rgba(230, 253, 140, 0.1);
  border: 1px solid rgba(230, 253, 140, 0.3);
  color: var(--color-neon-lime);
}

.tag-pill-navy {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  background-color: rgba(0, 38, 74, 0.08);
  border: 1px solid rgba(0, 38, 74, 0.15);
  color: var(--color-navy-primary);
}

/* Glow Helpers */
.glow-lime {
  box-shadow: 0 0 30px rgba(230, 253, 140, 0.2);
}

.pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

.animate-float,
.float-slow {
  animation: float-slow 4s ease-in-out infinite;
}

/* ==========================================================================
   6. Marquee / Partner Logos Carousel
   ========================================================================== */
.marquee-wrapper {
  overflow: hidden;
  position: relative;
  width: 100%;
}

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

.marquee-track.marquee-reverse {
  animation-name: marquee-scroll-reverse;
}

.marquee-track:hover,
.marquee-wrapper:hover .marquee-track,
.marquee-container:hover .marquee-track,
.marquee-paused,
.group-hover\:paused:hover,
.hover\:pause-animation:hover {
  animation-play-state: paused;
}

/* ==========================================================================
   7. Tab Transitions (Features Section)
   ========================================================================== */
.tab-pane {
  display: none;
  opacity: 0;
  transform: scale(0.98) translateX(20px);
  transition: all 0.35s ease;
}

.tab-pane.active,
.tab-pane.tab-content-active,
.tab-content-active,
[data-tab-content].active:not(.hidden) {
  display: block;
  opacity: 1;
  transform: scale(1) translateX(0);
  animation: tabFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-btn {
  cursor: pointer;
  background-color: #ffffff;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn:hover:not(.active) {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.tab-btn .tab-icon-box {
  background-color: #ebf5fb;
  color: #475569;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn .tab-title {
  color: #334155;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn .tab-dot {
  opacity: 0;
  transform: scale(0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn.active {
  background-color: var(--color-navy-hero) !important;
  border-color: transparent !important;
  box-shadow: 0 12px 28px -6px rgba(0, 30, 53, 0.38), 0 8px 12px -6px rgba(0, 30, 53, 0.25) !important;
}

.tab-btn.active .tab-icon-box {
  background-color: #1a3835 !important;
  color: var(--color-neon-lime) !important;
}

.tab-btn.active .tab-title {
  color: #ffffff !important;
  font-weight: 600 !important;
}

.tab-btn.active .tab-dot {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* ==========================================================================
   7.1 Implantação Step Sequential Fade-In Animation
   ========================================================================== */
.step-fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.step-fade-in:nth-child(1) {
  transition-delay: 0.1s;
}

.step-fade-in:nth-child(2) {
  transition-delay: 0.25s;
}

.step-fade-in:nth-child(3) {
  transition-delay: 0.4s;
}

.step-fade-in:nth-child(4) {
  transition-delay: 0.55s;
}

.step-fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   8. FAQ Accordion
   ========================================================================== */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease-out, opacity 0.3s ease-out;
}

.accordion-item.active .accordion-content,
.accordion-item[data-state="open"] .accordion-content {
  max-height: 500px;
  opacity: 1;
}

.accordion-chevron {
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-chevron,
.accordion-item[data-state="open"] .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-item.active,
.accordion-item[data-state="open"] {
  background-color: rgba(241, 245, 249, 0.6);
}

/* ==========================================================================
   9. Modal Animations & Backdrops
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}

.modal-content {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(0.95) translateY(10px);
}

.modal-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.modal-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.modal-visible .modal-content {
  transform: scale(1) translateY(0);
}

.animate-fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.animate-slide-up {
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   10. Decorative Patterns & Masks
   ========================================================================== */

/* Grid background pattern for Navy sections */
.grid-pattern {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

/* Subtle grid for light sections */
.grid-pattern-dark {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(0, 30, 53, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 30, 53, 0.04) 1px, transparent 1px);
}

/* Radial fade mask for glow orbs */
.mask-radial-fade {
  -webkit-mask-image: radial-gradient(circle at center, black 60%, transparent 100%);
  mask-image: radial-gradient(circle at center, black 60%, transparent 100%);
}

/* Horizontal linear fade mask for marquee container edges */
.mask-marquee-fade {
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 10%, black 90%, transparent 100%);
}

/* Card Glow Effect */
.card-glow-navy {
  box-shadow: 0 10px 30px -10px rgba(0, 38, 74, 0.08);
}

/* ==========================================================================
   11. Hero 3D Perspective Windows & Dynamic Animations
   ========================================================================== */

/* 3D Scene Perspective */
.hero-3d-scene {
  perspective: 1400px;
  perspective-origin: 50% 50%;
}

/* 3D Stage with Preserved 3D & Responsive Tilting */
.hero-3d-stage {
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 0.5s ease;
}

@media (max-width: 639px) {
  .hero-3d-scene {
    perspective: 900px;
  }
  .hero-3d-stage {
    left: -25px;
    top: 40px;
    transform: scale(0.85) rotateY(-22deg) rotateX(10deg) rotateZ(2deg);
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .hero-3d-scene {
    perspective: 1100px;
  }
  .hero-3d-stage {
    left: -67px;
    top: 0px;
    transform: scale(0.92) rotateY(-25deg) rotateX(11deg) rotateZ(2deg);
  }
}

@media (min-width: 1024px) {
  .hero-3d-scene {
    perspective: 1400px;
  }
  .hero-3d-stage {
    left: 0;
    top: 0;
    transform: rotateY(-27deg) rotateX(12deg) rotateZ(2deg);
  }
}

/* Base Window Card */
.hero-win {
  position: absolute;
  width: 78%;
  border-radius: 0.875rem;
  overflow: hidden;
  box-shadow: -22px 28px 50px -10px rgba(0, 10, 25, 0.85), 0 12px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background-color: #0b1a2d;
  will-change: transform, opacity;
  opacity: 0;
}

.hero-win-header {
  height: 1.75rem;
  background-color: #3f444f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  user-select: none;
}

.hero-win-title {
  font-size: 0.68rem;
  color: #f1f5f9;
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-win-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: rgba(255, 255, 255, 0.65);
  margin-left: auto;
}

.hero-win-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.hero-win-body {
  width: 100%;
  aspect-ratio: 1.8 / 1;
  overflow: hidden;
  background-color: #001322;
}

.hero-win-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
}

/* Window specific initial / rest positions in the staircase */
.hero-win-1 {
  top: 0%;
  left: 0%;
  z-index: 10;
}

.hero-win-2 {
  top: 15%;
  left: 15%;
  z-index: 20;
}

.hero-win-3 {
  top: 30%;
  left: 30%;
  z-index: 30;
}

/* 
  ENTRANCE ANIMATIONS:
  High velocity entry with hard braking inertia (overshoot & recoil)
  - Window 1: Enters from TOP moving downwards
  - Window 2: Enters from BOTTOM moving upwards
  - Window 3: Enters from TOP moving downwards
*/
@keyframes heroEnterFromTopBrake {
  0% {
    transform: translateY(-550px) scale(0.95);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  68% {
    transform: translateY(26px) scale(1.015); /* braking overshoot down */
  }
  84% {
    transform: translateY(-8px) scale(0.996); /* recoil up */
  }
  94% {
    transform: translateY(2px) scale(1.001); /* settling micro-bounce */
  }
  100% {
    transform: translateY(0px) scale(1); /* perfectly settled */
    opacity: 1;
  }
}

@keyframes heroEnterFromBottomBrake {
  0% {
    transform: translateY(550px) scale(0.95);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  68% {
    transform: translateY(-26px) scale(1.015); /* braking overshoot up */
  }
  84% {
    transform: translateY(8px) scale(0.996); /* recoil down */
  }
  94% {
    transform: translateY(-2px) scale(1.001); /* settling micro-bounce */
  }
  100% {
    transform: translateY(0px) scale(1); /* perfectly settled */
    opacity: 1;
  }
}

/* Triggering Entrance Animation */
.is-entering .hero-win-1 {
  animation: heroEnterFromTopBrake 1.1s cubic-bezier(0.18, 0.9, 0.32, 1) 0.1s forwards;
}

.is-entering .hero-win-2 {
  animation: heroEnterFromBottomBrake 1.1s cubic-bezier(0.18, 0.9, 0.32, 1) 0.28s forwards;
}

.is-entering .hero-win-3 {
  animation: heroEnterFromTopBrake 1.1s cubic-bezier(0.18, 0.9, 0.32, 1) 0.46s forwards;
}

/* 
  PHASE 2: GENTLE FLOATING LOOP (INFINITE)
  Preserves the staircase while giving an organic floating feel.
*/
@keyframes heroFloatGentle1 {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes heroFloatGentle2 {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-13px);
  }
}

@keyframes heroFloatGentle3 {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-9px);
  }
}

.is-floating .hero-win-1 {
  opacity: 1;
  animation: heroFloatGentle1 5.4s ease-in-out infinite;
}

.is-floating .hero-win-2 {
  opacity: 1;
  animation: heroFloatGentle2 6.2s ease-in-out 0.8s infinite;
}

.is-floating .hero-win-3 {
  opacity: 1;
  animation: heroFloatGentle3 5.8s ease-in-out 1.6s infinite;
}

/* Accessibility / Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .hero-win {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    animation: none !important;
  }
}
