/* ========================================
   TRAJECTA — DESIGN SYSTEM
   Modern SaaS styling for trajecta.app
   ======================================== */

/* ========================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ======================================== */
:root {
    /* Brand Colors */
    --trajecta-blue: #34b1eb;
    --trajecta-blue-dark: #2a8ec0;
    --trajecta-blue-light: rgba(52, 177, 235, 0.15);
    --trajecta-blue-glow: rgba(52, 177, 235, 0.4);

    /* Dark Backgrounds */
    --dark-bg: #0f1419;
    --dark-bg-lighter: #1a1f2e;
    --dark-bg-card: rgba(26, 31, 46, 0.6);

    /* Glass / Frosted */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Text on Dark */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.6);

    /* Section Backgrounds */
    --section-light: #f8fafc;
    --section-white: #ffffff;

    /* Semantic Colors */
    --color-danger: #dc2626;
    --color-danger-light: rgba(220, 38, 38, 0.1);
    --color-success: #16a34a;
    --color-success-light: rgba(22, 163, 74, 0.1);

    /* Accent */
    --color-indigo: #6366f1;

    /* Gradient Meshes */
    --gradient-mesh-1: radial-gradient(at 20% 30%, rgba(52, 177, 235, 0.15) 0%, transparent 50%);
    --gradient-mesh-2: radial-gradient(at 80% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    --gradient-mesh-3: radial-gradient(at 50% 80%, rgba(52, 177, 235, 0.08) 0%, transparent 50%);

    /* Typography Scale */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    --font-size-6xl: 3.75rem;

    /* Line Heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.7;

    /* Font Weights */
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-2xl: 0 40px 80px rgba(0, 0, 0, 0.25);
    --shadow-glow-sm: 0 4px 15px var(--trajecta-blue-glow);
    --shadow-glow-md: 0 8px 25px var(--trajecta-blue-glow);
}

/* ========================================
   2. BASE STYLES
   ======================================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Jost', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    color: #1f2937;
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
}

section {
    scroll-margin-top: 80px;
}

section + section {
    margin-top: 0;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   3. TYPOGRAPHY
   ======================================== */
.hero-headline {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: var(--fw-bold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-6);
}

.section-heading {
    font-size: clamp(1.875rem, 4vw, 2.25rem);
    font-weight: var(--fw-bold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-4);
}

.section-intro {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    color: #6b7280;
    margin-bottom: var(--space-6);
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-xs);
    font-weight: var(--fw-semibold);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    margin-bottom: var(--space-6);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--trajecta-blue);
    background: var(--trajecta-blue-light);
    border: 1px solid rgba(52, 177, 235, 0.2);
}

.section-label-danger {
    color: var(--color-danger);
    background: var(--color-danger-light);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.section-label-success {
    color: var(--color-success);
    background: var(--color-success-light);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.section-label-sm {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #6b7280;
    font-weight: var(--fw-medium);
}

.gradient-text {
    background: linear-gradient(135deg, var(--trajecta-blue) 0%, var(--color-indigo) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.p-trajecta-font {
    font-family: 'Cal Sans', sans-serif;
}

/* ========================================
   4. LAYOUT UTILITIES
   ======================================== */
.section-spacing {
    padding: var(--space-24) 0;
}

.max-w-3xl {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.max-w-4xl {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   5. NAVIGATION
   ======================================== */
.navbar {
    background: var(--dark-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(15, 20, 25, 0.95) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    text-shadow: 0px 0px 2px rgba(238, 238, 238, 0.2);
}

.btn-early-access {
    padding: 10px 20px;
    border: 1px solid var(--trajecta-blue);
    border-radius: var(--radius-sm);
    color: var(--trajecta-blue) !important;
    transition: all 0.3s ease;
    background: transparent;
    font-weight: var(--fw-medium);
}

.btn-early-access:hover {
    background: var(--trajecta-blue);
    color: white !important;
    text-decoration: none;
    box-shadow: var(--shadow-glow-sm);
}

/* ========================================
   6. BUTTONS
   ======================================== */
.btn-primary-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--trajecta-blue) 0%, var(--trajecta-blue-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: var(--fw-semibold);
    font-size: var(--font-size-base);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-glow-sm), 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-md), 0 4px 8px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.btn-primary-modern:active {
    transform: translateY(0);
}

.btn-primary-modern:focus-visible {
    outline: 2px solid var(--trajecta-blue);
    outline-offset: 2px;
}

.btn-secondary-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: var(--fw-medium);
    font-size: var(--font-size-base);
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.btn-secondary-modern:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-secondary-modern:focus-visible {
    outline: 2px solid var(--trajecta-blue);
    outline-offset: 2px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: var(--font-size-lg);
}

.btn-xl {
    padding: 18px 40px;
    font-size: var(--font-size-xl);
}

/* ========================================
   7. HERO SECTION
   ======================================== */
.hero-modern {
    background: var(--dark-bg);
    position: relative;
    overflow: hidden;
    min-height: 90vh;
    display: flex;
    align-items: center;
    text-align: center;
    padding: var(--space-24) 0 var(--space-12);
}

.hero-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        var(--gradient-mesh-1),
        var(--gradient-mesh-2),
        var(--gradient-mesh-3);
    pointer-events: none;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.hero-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--trajecta-blue);
    top: 10%;
    right: 5%;
    opacity: 0.15;
}

.hero-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--color-indigo);
    bottom: 10%;
    left: 5%;
    opacity: 0.1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto var(--space-12);
}

.hero-subtext {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto var(--space-8);
}

.hero-cta-group {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
}

.hero-mockup {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-mockup::before {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 80%;
    background: radial-gradient(ellipse at center, var(--trajecta-blue-glow) 0%, transparent 70%);
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
}

.hero-mockup img {
    position: relative;
    z-index: 1;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl), 0 0 80px -20px var(--trajecta-blue-glow);
    border: 1px solid var(--glass-border);
}

/* Typing animation */
.typed-text {
    display: inline-block;
    min-width: 120px;
    color: var(--trajecta-blue);
    text-shadow: 0 0 20px var(--trajecta-blue-glow);
}

.cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background-color: var(--trajecta-blue);
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: bottom;
    border-radius: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

#typed-container {
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

/* ========================================
   8. PROBLEM SECTION
   ======================================== */
.section-problem {
    background: var(--section-white);
}

.problem-text {
    color: var(--color-danger);
    font-style: italic;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.bento-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--trajecta-blue), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(52, 177, 235, 0.2);
}

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

.bento-card-problem {
    border-top: 3px solid rgba(220, 38, 38, 0.3);
}

.bento-card-problem:hover {
    border-color: rgba(220, 38, 38, 0.3);
}

.bento-card-problem::before {
    background: linear-gradient(90deg, transparent, var(--color-danger), transparent);
}

/* ========================================
   9. SOLUTION SECTION
   ======================================== */
.section-solution {
    background: var(--section-light);
}

.solution-text {
    color: var(--color-success);
    font-style: italic;
}

/* Feature Cards */
.feature-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(52, 177, 235, 0.2);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-6);
    background: linear-gradient(135deg, var(--trajecta-blue-light) 0%, rgba(99, 102, 241, 0.1) 100%);
    color: var(--trajecta-blue);
    border-radius: var(--radius-lg);
    font-size: 28px;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 20px var(--trajecta-blue-glow);
}

/* ========================================
   10. PRODUCT DEMO SECTION
   ======================================== */
.section-product-demo {
    background: var(--dark-bg);
    position: relative;
    overflow: hidden;
}

.section-product-demo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(at 30% 30%, rgba(52, 177, 235, 0.1) 0%, transparent 50%),
        radial-gradient(at 70% 70%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.demo-primary {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.demo-primary img {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--glass-border);
    width: 100%;
    height: auto;
    display: block;
}

.feature-highlight {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-highlight:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.feature-highlight img {
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    width: 100%;
    height: auto;
}

.feature-highlight h4 {
    font-size: var(--font-size-xl);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.feature-highlight p {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin: 0;
    line-height: var(--line-height-relaxed);
}

/* ========================================
   11. WHO IT'S FOR SECTION
   ======================================== */
.section-audience {
    background: var(--section-white);
}

.persona-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.persona-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(52, 177, 235, 0.2);
}

.persona-icon {
    font-size: 48px;
    color: var(--trajecta-blue);
    margin-bottom: var(--space-4);
    display: block;
}

.platform-badges {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--section-light);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--fw-medium);
    color: #6b7280;
}

.platform-badge i {
    font-size: 18px;
}

/* ========================================
   12. SOCIAL PROOF / TESTIMONIALS
   ======================================== */
.section-social-proof {
    background: var(--section-light);
}

.testimonial-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: 20px;
    left: 24px;
    font-size: 60px;
    font-family: Georgia, serif;
    color: var(--trajecta-blue);
    opacity: 0.15;
    line-height: 1;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(52, 177, 235, 0.2);
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    background: var(--trajecta-blue-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.testimonial-avatar i {
    color: var(--trajecta-blue);
    font-size: 20px;
}

/* ========================================
   13. FINAL CTA SECTION
   ======================================== */
.section-cta {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-bg-lighter) 100%);
    position: relative;
    overflow: hidden;
}

.section-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(at 30% 50%, rgba(52, 177, 235, 0.15) 0%, transparent 50%),
        radial-gradient(at 70% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* ========================================
   14. FAQ SECTION
   ======================================== */
.section-faq {
    background: var(--section-white);
}

.faq-item {
    background: var(--section-light);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(52, 177, 235, 0.2);
}

.faq-question {
    width: 100%;
    padding: 20px 24px;
    background: none;
    border: none;
    text-align: left;
    font-size: var(--font-size-base);
    font-weight: var(--fw-semibold);
    color: #1f2937;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    color: var(--trajecta-blue);
}

.faq-question:focus-visible {
    outline: 2px solid var(--trajecta-blue);
    outline-offset: -2px;
}

.faq-icon {
    font-size: 20px;
    color: var(--trajecta-blue);
    transition: transform 0.3s ease;
}

.faq-item input[type="checkbox"] {
    display: none;
}

.faq-item input[type="checkbox"]:checked + .faq-question .faq-icon {
    transform: rotate(45deg);
}

.faq-item input[type="checkbox"]:checked ~ .faq-answer {
    max-height: 300px;
    padding: 0 24px 20px 24px;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: #6b7280;
    line-height: var(--line-height-relaxed);
}

/* ========================================
   15. COOKIE BANNER
   ======================================== */
#cookie-banner {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: rgba(15, 20, 25, 0.35);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: var(--font-size-sm);
    text-align: center;
    padding: 16px;
    z-index: 9999;
    border-top: 1px solid var(--glass-border);
}

#cookie-banner p {
    margin: 0;
}

#accept-cookies {
    margin-left: 12px;
    background: var(--trajecta-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: var(--fw-medium);
    transition: all 0.3s ease;
}

#accept-cookies:hover {
    background: var(--trajecta-blue-dark);
}

/* ========================================
   16. LEGACY (kept for compatibility)
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 150px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 10px;
    border: 1px solid #888;
    width: 40%;
}

.close {
    color: #aaaaaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

code {
    background-color: lightgray;
    padding: 0.5rem;
}

footer a {
    text-decoration: none;
}

/* ========================================
   17. RESPONSIVE
   ======================================== */
@media (max-width: 991.98px) {
    .hero-modern {
        min-height: auto;
        padding: var(--space-20) 0 var(--space-12);
    }

    .section-spacing {
        padding: var(--space-16) 0;
    }

    .btn-early-access {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
        text-align: center;
    }

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar-collapse {
        margin-top: var(--space-4);
        padding: var(--space-4);
    }
}

@media (max-width: 767.98px) {
    .hero-headline {
        font-size: clamp(2rem, 6vw, 2.5rem);
    }

    .hero-cta-group {
        flex-direction: column;
        gap: var(--space-3);
        align-items: stretch;
    }

    .hero-cta-group a {
        justify-content: center;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .bento-card {
        padding: 20px;
    }

    .cursor {
        width: 2px;
    }
}
