/* =====================================================
   OPANKA — Premium Landing Page
   Custom Styles (extends Tailwind via CDN)
   ===================================================== */

/* ----- Design System Tokens ----- */
:root {
    --color-primary: #02b8c3;
    --color-primary-rgb: 2, 184, 195;
    --color-secondary: #00B8D9;
    --color-bg-page: #FFFFFF;
    --color-bg-section: #F8F9FA;
    --color-bg-card: #FFFFFF;
    --color-text-primary: #0A0A0A;
    --color-text-secondary: #4B4B4B;
    --color-text-muted: #6B7280;
    --border-default: #E5E7EB;
    --border-divider: #F1F3F5;
    --font-stack: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ----- Reset & Base ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    /* Scroll suave nativo — desabilitamos em mobile pois conflita com Lerp */
    scroll-behavior: auto;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-stack);
    background-color: var(--color-bg-page);
    color: var(--color-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ----- Typography (Design System) ----- */
.text-display-xl { font-size: 56px; line-height: 64px; }
.text-display-lg { font-size: 40px; line-height: 48px; }
.text-display-md { font-size: 32px; line-height: 40px; }
.text-display-sm { font-size: 24px; line-height: 32px; }

@media (max-width: 768px) {
    .text-display-xl { font-size: 36px; line-height: 42px; }
    .text-display-lg { font-size: 28px; line-height: 36px; }
    .text-display-md { font-size: 24px; line-height: 32px; }
    .text-display-sm { font-size: 20px; line-height: 28px; }
}

.tracking-neg { letter-spacing: -0.02em; }

/* ----- Loader Screen ----- */
#loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0A0A0A;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#loader .loader-logo {
    font-size: 28px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.02em;
}

#loader .loader-logo span {
    color: var(--color-primary);
}

#loader .loader-bar-track {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

#loader .loader-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 999px;
    transition: width 0.15s linear;
}

#loader .loader-percent {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    font-variant-numeric: tabular-nums;
}

/* ----- Navbar ----- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
    background: transparent;
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    background: rgba(5, 5, 5, 0.75);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.navbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-logo {
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
    text-decoration: none;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.navbar-logo span {
    color: var(--color-primary);
}

.navbar-links {
    display: flex;
    gap: 32px;
    align-items: center;
    list-style: none;
}

.navbar-links a {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

.navbar-links a:hover {
    color: #FFFFFF;
}

.navbar-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.navbar-links a:hover::after {
    width: 100%;
}

.navbar-cta {
    position: relative;
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 999px;
    background: transparent;
    border: 1.5px solid transparent;
    background-image: linear-gradient(rgba(5, 5, 5, 0.75), rgba(5, 5, 5, 0.75)), linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.navbar-cta:hover {
    transform: scale(1.04);
    box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.3);
}

/* ----- Mobile Nav Toggle ----- */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.navbar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #FFFFFF;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

@media (max-width: 768px) {
    .navbar-links { display: none; }
    .navbar-toggle { display: flex; }

    .navbar-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(5, 5, 5, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 24px;
        gap: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .navbar-links.open a {
        font-size: 16px;
        color: rgba(255, 255, 255, 0.8);
    }
}

/* ----- Hero / Canvas Section -----
   O container externo define a "trilha de scroll" (500dvh).
   Dentro dele, o canvas fica sticky, ocupando 100dvh da tela.
   100dvh evita jumps no iOS Safari quando a address bar colapsa.
*/
.hero-scroll-container {
    position: relative;
    /* 500dvh = a distância de scroll total que controla a animação.
       Quanto maior, mais lento o playback da sequência. */
    height: 500dvh;
    /* Fallback para browsers que não suportam dvh */
    height: 500vh;
}

@supports (height: 100dvh) {
    .hero-scroll-container { height: 500dvh; }
}

.hero-sticky {
    position: sticky;
    top: 0;
    width: 100%;
    /* 100dvh = ocupa toda a viewport dinâmica (fix iOS Safari) */
    height: 100dvh;
    height: 100vh; /* Fallback */
    overflow: hidden;
}

@supports (height: 100dvh) {
    .hero-sticky { height: 100dvh; }
}

#hero-canvas {
    display: block;
    width: 100%;
    height: 100%;
    /* object-fit é tratado via JS para canvas,
       mas se fosse <img>, usaríamos object-fit: cover */
}

/* ----- Story Beat Overlays -----
   Textos que aparecem/desaparecem sobre o canvas
   sincronizados com posições do scroll.
*/
.story-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.story-beat {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.story-beat.visible {
    opacity: 1;
    transform: translateY(0);
}

.story-beat-inner {
    max-width: 500px;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .story-beat-inner {
        max-width: 100%;
        padding: 0 24px;
    }
}

.story-beat h2 {
    font-size: 48px;
    line-height: 54px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #FFFFFF;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5),
                 0 0 80px rgba(0, 0, 0, 0.3);
    margin-bottom: 16px;
}

.story-beat p {
    font-size: 18px;
    line-height: 28px;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 20px rgba(0, 0, 0, 0.5);
    font-weight: 400;
}

.story-beat .story-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    background: rgba(2, 184, 195, 0.15);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
    border: 1px solid rgba(2, 184, 195, 0.2);
}

@media (max-width: 768px) {
    .story-beat h2 { font-size: 32px; line-height: 38px; }
    .story-beat p { font-size: 15px; line-height: 24px; }
}

/* Posicionamento dos beats */
.story-beat.beat-left .story-beat-inner {
    margin-left: 5%;
}

.story-beat.beat-right {
    justify-content: flex-end;
}

.story-beat.beat-right .story-beat-inner {
    margin-right: 5%;
    text-align: right;
}

.story-beat.beat-center {
    justify-content: center;
    text-align: center;
}

.story-beat.beat-center .story-beat-inner {
    max-width: 600px;
    margin: 0 auto;
}

/* ----- Scroll Down Indicator ----- */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-indicator span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.5);
}

.scroll-indicator .scroll-arrow {
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    position: relative;
}

.scroll-indicator .scroll-arrow::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    animation: scrollBounce 1.8s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(12px); opacity: 0.3; }
}

/* ----- Container ----- */
.container-custom {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
}

/* ----- Section Padding ----- */
.section-padding {
    padding-top: 100px;
    padding-bottom: 100px;
}

@media (min-width: 1024px) {
    .section-padding {
        padding-top: 140px;
        padding-bottom: 140px;
    }
}

/* ----- Section Title Badge ----- */
.section-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

/* ----- Buttons (Design System) ----- */
.btn-primary {
    background: var(--color-primary);
    color: #FFFFFF;
    border-radius: 9999px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 16px;
    font-family: var(--font-stack);
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    text-decoration: none;
    gap: 8px;
}

.btn-primary:hover {
    background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-primary) 100%);
    transform: scale(1.03);
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.3);
}

.btn-secondary {
    border: 1px solid var(--color-text-primary);
    background: transparent;
    color: var(--color-text-primary);
    border-radius: 9999px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 16px;
    font-family: var(--font-stack);
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--color-bg-section);
    transform: scale(1.03);
}

/* ----- Cards (Design System) ----- */
.card {
    background-color: var(--color-bg-card);
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px -10px rgba(var(--color-primary-rgb), 0.15);
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-default);
    position: relative;
    z-index: 1;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8F9FA 100%);
    opacity: 0;
    z-index: -1;
    transition: opacity 200ms ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 40px -10px rgba(var(--color-primary-rgb), 0.3);
    border-color: var(--color-primary);
}

.card:hover::before { opacity: 1; }

/* ----- Feature Icon Container ----- */
.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(var(--color-primary-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--color-primary);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ----- Split Section (Image + Content) ----- */
.split-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: center;
}

@media (min-width: 1024px) {
    .split-section { grid-template-columns: 1fr 1fr; gap: 80px; }
}

.split-image-wrapper {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.05), rgba(var(--color-primary-rgb), 0.15));
}

.split-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ----- Checkmark List ----- */
.check-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.check-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.check-list li svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-primary);
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* ----- CTA Banner ----- */
.cta-banner {
    background: linear-gradient(135deg, #0A0A0A 0%, #1a1a2e 100%);
    border-radius: 32px;
    padding: 80px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(var(--color-primary-rgb), 0.12) 0%, transparent 60%);
    pointer-events: none;
}

@media (max-width: 768px) {
    .cta-banner { padding: 48px 24px; border-radius: 24px; }
}

/* ----- Footer ----- */
.footer {
    background: #0A0A0A;
    padding: 64px 0 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 48px;
}

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer a:hover { color: #FFFFFF; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* ----- Reveal on Scroll Animations ----- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }

/* ----- Marquee / Infinite Scroll Text ----- */
.marquee-section {
    overflow: hidden;
    padding: 32px 0;
    border-top: 1px solid var(--border-divider);
    border-bottom: 1px solid var(--border-divider);
}

.marquee-track {
    display: flex;
    gap: 48px;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
}

.marquee-track span {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.marquee-track .dot {
    color: var(--color-primary);
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ----- Stats Counter Section ----- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-item {
    text-align: center;
    padding: 24px;
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .stat-number { font-size: 36px; }
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* ----- Utility: smooth text appear ----- */
.text-gradient {
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
