/**
 * OXORA Landing V3 — Design System & Polish Layer
 * Motion tokens, section rhythm, trust, nav, a11y, legacy section unification
 */

/* ── Shared motion keyframes (centralized) ── */
@keyframes ox-lv2-aurora-shift {
    0% { transform: translate(0, 0) scale(1); opacity: 0.9; }
    100% { transform: translate(2%, -1.5%) scale(1.03); opacity: 1; }
}

@keyframes ox-lv2-blob-drift-a {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(24px, -18px); }
}

@keyframes ox-lv2-blob-drift-b {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 22px); }
}

/* ── Scroll progress (film narrative) ── */
.ox-v3-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    z-index: 200;
    background: var(--ox-gradient);
    box-shadow: 0 0 12px rgba(155, 61, 255, 0.5);
    pointer-events: none;
    transition: width 80ms linear;
}

/* ── Skip link ── */
.ox-skip-link {
    position: absolute;
    top: -100%;
    left: var(--ox-space-4);
    z-index: 9999;
    padding: var(--ox-space-3) var(--ox-space-5);
    background: var(--ox-purple);
    color: #fff;
    font-weight: 600;
    font-size: var(--ox-text-sm);
    border-radius: var(--ox-radius-sm);
    text-decoration: none;
    transition: top var(--ox-motion-fast) var(--ox-motion-ease);
}

.ox-skip-link:focus {
    top: var(--ox-space-4);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ── Focus system ── */
.ox-landing :focus { outline: none; }

.ox-landing :focus-visible {
    outline: 2px solid var(--ox-purple);
    outline-offset: 3px;
}

.ox-btn:focus-visible,
.ox-lv2-ai-tab:focus-visible,
.ox-landing-nav a:focus-visible {
    outline: 2px solid var(--ox-blue);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(45, 140, 255, 0.2);
}

/* ── Section rhythm (unified product feel) ── */
.ox-landing .ox-section {
    padding: var(--ox-section-y) var(--ox-space-6);
}

.ox-lv2-live-ai,
.ox-lv2-segments-wrap,
.ox-lv2-dashboard-section,
.ox-lv2-pricing-wrap,
.ox-lv2-genai-wrap,
[class*="ox-lv2-eco"] {
    padding-block: var(--ox-section-y-lg) !important;
}

.ox-section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto var(--ox-space-10);
}

.ox-section-header .ox-lead {
    margin: var(--ox-space-4) auto 0;
    max-width: 560px;
}

.ox-section-divider {
    height: 1px;
    max-width: var(--ox-container-max);
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, var(--ox-border), transparent);
    border: none;
}

/* ── Typography V3 refinements ── */
.ox-h4 {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: var(--ox-lh-snug);
    letter-spacing: -0.01em;
    margin: 0;
}

.ox-caption {
    font-size: var(--ox-text-caption);
    font-weight: 500;
    letter-spacing: var(--ox-tracking-wide);
    text-transform: uppercase;
    color: var(--ox-text-tertiary);
    line-height: 1.4;
}

.ox-body {
    font-size: var(--ox-text-base);
    line-height: var(--ox-lh-body);
    color: var(--ox-text-secondary);
}

/* ── Nav V3 — cinematic ── */
.ox-landing-nav {
    transition: background var(--ox-motion-base) var(--ox-motion-ease),
                border-color var(--ox-motion-base) var(--ox-motion-ease),
                box-shadow var(--ox-motion-base) var(--ox-motion-ease);
}

.ox-landing-nav.is-scrolled {
    background: rgba(5, 8, 22, 0.92);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.ox-landing-nav-menu {
    display: none;
    align-items: center;
    gap: var(--ox-space-1);
}

@media (min-width: 900px) {
    .ox-landing-nav-menu { display: flex; }
}

.ox-landing-nav-link {
    padding: 0.5rem 0.85rem;
    font-size: var(--ox-text-sm);
    font-weight: 500;
    color: var(--ox-text-tertiary);
    text-decoration: none;
    border-radius: var(--ox-radius-sm);
    transition: color var(--ox-motion-fast) var(--ox-motion-ease),
                background var(--ox-motion-fast) var(--ox-motion-ease);
}

.ox-landing-nav-link:hover {
    color: var(--ox-text);
    background: rgba(255, 255, 255, 0.04);
}

.ox-landing-nav-link.is-active {
    color: var(--ox-purple);
    background: rgba(155, 61, 255, 0.1);
}

.ox-landing-nav-inner {
    max-width: var(--ox-container-wide);
}

/* ── Legacy sections polish ── */
.ox-landing .ox-card,
.ox-landing .ox-step {
    backdrop-filter: blur(var(--ox-blur-glass));
}

.ox-landing .ox-card-hover {
    transition: transform var(--ox-motion-base) var(--ox-motion-ease),
                box-shadow var(--ox-motion-base) var(--ox-motion-ease),
                border-color var(--ox-motion-base) var(--ox-motion-ease);
}

.ox-landing .ox-card-hover:hover,
.ox-landing .ox-step:hover {
    transform: translateY(var(--ox-motion-lift));
}

.ox-benefits-list {
    list-style: none;
    padding: 0;
    margin-top: var(--ox-space-8);
    display: flex;
    flex-direction: column;
    gap: var(--ox-space-5);
}

.ox-benefits-list li {
    display: flex;
    gap: var(--ox-space-3);
    align-items: flex-start;
}

.ox-benefits-list [data-lucide] {
    color: var(--ox-purple);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.ox-section-cta-card .ox-btn { margin-top: var(--ox-space-6); }

/* ── FAQ accordion V3 ── */
.ox-lv2-faq { margin-top: var(--ox-space-10); }

.ox-lv2-faq-item {
    border-bottom: 1px solid var(--ox-border);
}

.ox-lv2-faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ox-space-4);
    padding: var(--ox-space-5) 0;
    background: none;
    border: none;
    color: var(--ox-text);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: color var(--ox-motion-fast) var(--ox-motion-ease);
}

.ox-lv2-faq-q:hover { color: var(--ox-purple); }

.ox-lv2-faq-q::after {
    content: '';
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--ox-text-tertiary);
    border-bottom: 2px solid var(--ox-text-tertiary);
    transform: rotate(45deg);
    transition: transform var(--ox-motion-base) var(--ox-motion-ease);
}

.ox-lv2-faq-item.open .ox-lv2-faq-q::after {
    transform: rotate(-135deg);
}

.ox-lv2-faq-a {
    margin: 0 0 var(--ox-space-5);
    padding-right: var(--ox-space-8);
    color: var(--ox-text-secondary);
    line-height: var(--ox-lh-relaxed);
    font-size: var(--ox-text-sm);
}

/* ── Trust strip ── */
.ox-trust-strip {
    padding: var(--ox-space-8) var(--ox-space-6);
    border-top: 1px solid var(--ox-border);
    border-bottom: 1px solid var(--ox-border);
    background: rgba(11, 16, 32, 0.6);
    backdrop-filter: blur(var(--ox-blur-glass));
}

.ox-trust-strip-inner {
    max-width: var(--ox-container-wide);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ox-space-4) var(--ox-space-8);
}

.ox-trust-item {
    display: flex;
    align-items: center;
    gap: var(--ox-space-3);
    font-size: var(--ox-text-sm);
    color: var(--ox-text-tertiary);
    transition: color var(--ox-motion-fast) var(--ox-motion-ease),
                transform var(--ox-motion-fast) var(--ox-motion-ease);
}

.ox-trust-item:hover {
    color: var(--ox-text-secondary);
    transform: translateY(-1px);
}

.ox-trust-item [data-lucide] {
    width: 18px;
    height: 18px;
    color: var(--ox-purple);
    opacity: 0.85;
}

/* ── Footer polish ── */
.ox-landing-footer {
    position: relative;
}

.ox-landing-footer::before {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 180px;
    background: radial-gradient(ellipse 60% 100% at 50% 100%, rgba(155, 61, 255, 0.06), transparent);
    pointer-events: none;
}

.ox-footer-link {
    color: var(--ox-text-tertiary);
    text-decoration: none;
    font-size: var(--ox-text-sm);
    transition: color var(--ox-motion-fast) var(--ox-motion-ease);
}

.ox-footer-link:hover { color: var(--ox-text); }

.ox-footer-heading {
    font-size: 0.9rem;
    margin-bottom: var(--ox-space-4);
}

.ox-footer-col-links {
    display: flex;
    flex-direction: column;
    gap: var(--ox-space-2);
}

.ox-footer-brand-desc {
    margin-top: var(--ox-space-4);
    line-height: var(--ox-lh-relaxed);
    max-width: 280px;
}

/* ── Reveal motion (token-aligned) ── */
.ox-lv2-reveal {
    transform: translateY(var(--ox-motion-reveal-y));
    transition: opacity var(--ox-motion-reveal) var(--ox-motion-ease),
                transform var(--ox-motion-reveal) var(--ox-motion-ease);
}

.ox-lv2-reveal-stagger > * {
    transition: opacity var(--ox-motion-slow) var(--ox-motion-ease),
                transform var(--ox-motion-slow) var(--ox-motion-ease);
}

.ox-lv2-reveal-stagger.revealed > *:nth-child(n) {
    transition-delay: calc(var(--ox-motion-stagger) * (var(--i, 1) - 1));
}

/* ── Glass token unification ── */
.ox-lv2-glass {
    backdrop-filter: blur(var(--ox-blur-glass));
    -webkit-backdrop-filter: blur(var(--ox-blur-glass));
}

.ox-lv2-glass-strong {
    backdrop-filter: blur(var(--ox-blur-strong));
    -webkit-backdrop-filter: blur(var(--ox-blur-strong));
}

/* ── Ultra-wide & landscape ── */
@media (min-width: 1600px) {
    .ox-container,
    .ox-landing-nav-inner,
    .ox-footer-grid,
    .ox-trust-strip-inner {
        max-width: 1360px;
    }
}

@media (max-width: 768px) {
    .ox-landing-nav-inner {
        padding: var(--ox-space-4) var(--ox-space-4);
    }

    .ox-trust-strip-inner {
        gap: var(--ox-space-4);
    }

    .ox-trust-item {
        flex: 1 1 calc(50% - var(--ox-space-4));
        justify-content: center;
        text-align: center;
        flex-direction: column;
        font-size: 0.78rem;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .ox-landing .ox-section {
        padding-block: var(--ox-space-12);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ox-v3-scroll-progress { display: none; }
}
