/* =============================================
   OWL Technology - Design System
   Inspirado em: Linear, Vercel, Stripe
   Direção: Boldness & Clarity
   ============================================= */

/* =============================================
   DESIGN TOKENS - 4px Grid System
   ============================================= */
:root {
    /* Spacing Scale (4px base) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Color Foundation - Cool Tinted Dark */
    --bg-base: #0a0a0f;
    --bg-elevated: #0f0f18;
    --bg-surface: #141420;
    --bg-subtle: #1a1a28;
    --bg-muted: #22222e;

    /* Border Colors */
    --border-default: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-accent: rgba(103, 61, 230, 0.4);

    /* Text Hierarchy (4 levels) */
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.72);
    --text-muted: rgba(255, 255, 255, 0.48);
    --text-faint: rgba(255, 255, 255, 0.28);

    /* Brand Colors */
    --primary: #673DE6;
    --primary-light: #7c52f0;
    --primary-dark: #5230b8;
    --accent: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.15);

    /* Semantic Colors */
    --success: #10b981;
    --success-subtle: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --error: #ef4444;

    /* Shadows - Layered Approach */
    --shadow-sm:
        0 0 0 0.5px var(--border-subtle),
        0 1px 2px rgba(0, 0, 0, 0.12);
    --shadow-md:
        0 0 0 0.5px var(--border-subtle),
        0 1px 2px rgba(0, 0, 0, 0.08),
        0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg:
        0 0 0 0.5px var(--border-subtle),
        0 2px 4px rgba(0, 0, 0, 0.06),
        0 8px 16px rgba(0, 0, 0, 0.12),
        0 16px 32px rgba(0, 0, 0, 0.08);
    --shadow-glow:
        0 0 0 0.5px var(--border-accent),
        0 4px 16px rgba(103, 61, 230, 0.15),
        0 8px 32px rgba(103, 61, 230, 0.08);

    /* Border Radius - Sharp System */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

    /* Font Sizes */
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 24px;
    --text-2xl: 32px;
    --text-3xl: 40px;
    --text-4xl: 48px;

    /* Letter Spacing */
    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.02em;

    /* Transitions */
    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
    --duration-fast: 150ms;
    --duration-normal: 200ms;
    --duration-slow: 300ms;
}

/* =============================================
   GLOBAL RESET & BASE
   ============================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    font-size: 16px;
    background: var(--bg-base);
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-base);
    overflow-x: hidden;
    max-width: 100vw;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent any element from exceeding viewport */
img,
video,
canvas,
iframe {
    max-width: 100%;
    height: auto;
}

/* Container safety */
.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* =============================================
   HEADER - Fixed, Precision Styling
   ============================================= */
#main-header {
    z-index: 9999 !important;
    position: fixed !important;
    width: 100%;
    max-width: 100vw;
    background: transparent;
    transition: background var(--duration-normal) var(--ease-out),
        box-shadow var(--duration-normal) var(--ease-out);
}

.header-scrolled {
    background: rgba(10, 10, 15, 0.92) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow:
        0 0 0 0.5px var(--border-subtle),
        0 1px 3px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.1);
}

.menu-active {
    background: rgba(10, 10, 15, 0.98) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* =============================================
   PARTICLES CANVAS
   ============================================= */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.6;
}

/* =============================================
   GLASSMORPHISM CARDS - Refined
   ============================================= */
.glass-card {
    background: var(--bg-surface);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition:
        transform var(--duration-normal) var(--ease-out),
        box-shadow var(--duration-normal) var(--ease-out),
        border-color var(--duration-normal) var(--ease-out);
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
}

/* =============================================
   TYPOGRAPHY UTILITIES
   ============================================= */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    line-height: 1.2;
}

/* =============================================
   ANIMATED BACKGROUND
   ============================================= */
.animated-gradient {
    background: linear-gradient(-45deg,
            var(--bg-base),
            var(--bg-elevated),
            #1a1535,
            var(--bg-elevated));
    background-size: 400% 400%;
    animation: gradient-shift 20s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Hero Background */
.hero-bg {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(103, 61, 230, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0, 212, 255, 0.06) 0%, transparent 40%);
}

/* =============================================
   BUTTON STYLES - Refined
   ============================================= */
.btn-primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
    font-weight: 600;
    transition:
        transform var(--duration-fast) var(--ease-out),
        box-shadow var(--duration-normal) var(--ease-out);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s var(--ease-out);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 12px rgba(103, 61, 230, 0.25),
        0 8px 24px rgba(103, 61, 230, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

/* =============================================
   ANIMATIONS - Subtle & Refined
   ============================================= */

/* =============================================
   ANIMATIONS - Subtle & Refined
   ============================================= */

@keyframes shine-loop {
    0% {
        left: -100%;
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    40% {
        left: 200%;
        opacity: 0;
    }

    100% {
        left: 200%;
        opacity: 0;
    }
}

.btn-shine-loop {
    position: relative;
    overflow: hidden;
}

.btn-shine-loop::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    animation: shine-loop 8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
    z-index: 2;
}

/* Fade In */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.6s var(--ease-out),
        transform 0.6s var(--ease-out);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide Animations */
.slide-in-left {
    opacity: 0;
    transform: translateX(-40px);
    transition:
        opacity 0.6s var(--ease-out),
        transform 0.6s var(--ease-out);
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition:
        opacity 0.6s var(--ease-out),
        transform 0.6s var(--ease-out);
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale Animation */
.scale-in {
    opacity: 0;
    transform: scale(0.92);
    transition:
        opacity 0.5s var(--ease-out),
        transform 0.5s var(--ease-out);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Float Animation - More subtle */
.float-animation {
    animation: float 8s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-12px);
    }
}

/* Pulse - Subtle glow */
.pulse {
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 16px rgba(103, 61, 230, 0.2);
    }

    50% {
        box-shadow: 0 0 28px rgba(103, 61, 230, 0.35);
    }
}

/* =============================================
   HERO ANIMATIONS - CSS Only (No JS dependence)
   ============================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate-1 {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) both;
    animation-delay: 0.1s;
}

.hero-animate-2 {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) both;
    animation-delay: 0.2s;
}

.hero-animate-3 {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) both;
    animation-delay: 0.3s;
}

.hero-animate-4 {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) both;
    animation-delay: 0.4s;
}

/* Ensure visibility if reduced motion is preferred */
@media (prefers-reduced-motion: reduce) {

    .hero-animate-1,
    .hero-animate-2,
    .hero-animate-3,
    .hero-animate-4 {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* =============================================
   MOBILE MENU - Sidebar da Direita
   ============================================= */
.menu-open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

#mobile-menu-btn {
    position: relative;
    z-index: 100;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    min-width: 44px;
    min-height: 44px;
    overflow: visible;
}

#mobile-menu-btn>div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 24px;
}

#mobile-menu-btn .hamburger-line {
    height: 2px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all var(--duration-normal) var(--ease-out);
}

/* Mobile Menu Overlay */
#mobile-menu-overlay {
    transition: opacity 300ms var(--ease-out);
    z-index: 9998;
}

#mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile Menu Sidebar */
#mobile-menu {
    /* Fallback sólido primeiro */
    background-color: #0a0a0f;
    /* Camada semi-transparente por cima */
    background: linear-gradient(to bottom, rgba(10, 10, 15, 0.98), rgba(10, 10, 15, 1)) !important;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    /* Transform inicial - menu escondido à direita */
    transform: translateX(100%);
    transition: transform 300ms var(--ease-out);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

#mobile-menu.active {
    /* Menu visível */
    transform: translateX(0);
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* =============================================
   SERVICE CARDS
   ============================================= */
.service-icon {
    transition:
        transform var(--duration-normal) var(--ease-out),
        filter var(--duration-normal) var(--ease-out);
}

.glass-card:hover .service-icon {
    transform: scale(1.08);
    filter: drop-shadow(0 0 12px rgba(103, 61, 230, 0.4));
}

/* Stats Counter */
.stat-number {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' on;
}

/* =============================================
   FORM STYLES
   ============================================= */
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow:
        0 0 0 3px rgba(103, 61, 230, 0.15),
        var(--shadow-sm);
}

.form-success {
    background: var(--success-subtle);
    border: 0.5px solid rgba(16, 185, 129, 0.25);
    color: var(--success);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.form-error {
    background: rgba(239, 68, 68, 0.08);
    border: 0.5px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

/* =============================================
   PARTICLES DECORATION
   ============================================= */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(103, 61, 230, 0.4);
    border-radius: var(--radius-full);
    animation: particle-float 20s infinite;
}

@keyframes particle-float {

    0%,
    100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* =============================================
   SCROLLBAR - Minimal
   ============================================= */

/* Hide ALL scrollbars by default */
*::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

* {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* Prevent any element from creating scrollbars */
/* Prevent horizontal scroll on main containers only */
body,
section {
    overflow-x: clip;
}

.container {
    overflow-x: visible;
}

pre {
    overflow: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
}

section {
    overflow: visible;
}

/* ONLY allow main html scrollbar */
html {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -ms-overflow-style: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--primary) var(--bg-base) !important;
}

html::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
    display: block !important;
}

html::-webkit-scrollbar-track {
    background: var(--bg-base);
}

html::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

html::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

body {
    overflow-y: visible !important;
    overflow-x: hidden !important;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

body::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

/* =============================================
   SERVICES GRID - Refined Layout
   ============================================= */
.services-grid {
    max-width: 1200px;
    margin: 0 auto;
}

.services-grid>.glass-card {
    flex: 0 1 calc(25% - 18px);
    min-width: 200px;
    max-width: 280px;
}

/* Tablets - 3 cards */
@media (max-width: 1024px) {
    .services-grid>.glass-card {
        flex: 0 1 calc(33.333% - 16px);
        min-width: 180px;
        max-width: 260px;
    }
}

/* Mobile landscape - 2 cards */
@media (max-width: 768px) {
    .services-grid>.glass-card {
        flex: 0 1 calc(50% - 8px);
        min-width: 140px;
        max-width: 200px;
    }

    .glass-card:hover {
        transform: none;
    }
}

/* Mobile portrait - 2 cards compactos */
@media (max-width: 480px) {
    .services-grid>.glass-card {
        flex: 0 1 calc(50% - 6px);
        min-width: 120px;
        max-width: 180px;
    }

    .services-grid {
        gap: 8px !important;
    }
}

/* =============================================
   ADDITIONAL UI REFINEMENTS
   ============================================= */

/* Badge/Chip Component */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: rgba(103, 61, 230, 0.08);
    border: 0.5px solid rgba(103, 61, 230, 0.2);
    border-radius: 10px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--primary-light);
}

/* Status Indicator */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--success);
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

/* Trust Indicators */
.trust-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.trust-indicator svg {
    color: var(--success);
}

/* Code Block Styling */
.code-block {
    background: var(--bg-subtle);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

.code-block-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 0.5px solid var(--border-subtle);
}

.code-block-header .dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
}

.code-block-header .dot.red {
    background: #ff5f56;
}

.code-block-header .dot.yellow {
    background: #ffbd2e;
}

.code-block-header .dot.green {
    background: #27c93f;
}

/* Section Divider */
.section-divider {
    border: none;
    height: 0.5px;
    background: var(--border-subtle);
    margin: var(--space-16) 0;
}

/* Link Styles */
.link-primary {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

.link-primary:hover {
    color: var(--accent);
}

/* Focus States */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: rgba(103, 61, 230, 0.3);
    color: var(--text-primary);
}

/* =============================================
   CTA SECTION REFINEMENTS
   ============================================= */
.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 100% 80% at 50% 100%, rgba(103, 61, 230, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 0% 50%, rgba(0, 212, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* =============================================
   RESPONSIVE TYPOGRAPHY
   ============================================= */
@media (max-width: 768px) {
    :root {
        --text-4xl: 36px;
        --text-3xl: 28px;
        --text-2xl: 24px;
        --text-xl: 20px;
    }
}

@media (max-width: 480px) {
    :root {
        --text-4xl: 28px;
        --text-3xl: 24px;
        --text-2xl: 20px;
        --text-xl: 18px;
    }
}