/**
 * KLARIQO V2 DESIGN SYSTEM
 * Single Source of Truth for Typography, Colors, Spacing, and Components
 *
 * Usage: Include this file in all v2 pages AFTER Tailwind CDN
 * <link rel="stylesheet" href="/assets/css/design-system.css">
 */

/* ==========================================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================================================== */

:root {
    /* Colors - Primary */
    --color-brand: #FF3B30;
    --color-brand-dark: #D63027;
    --color-brand-light: #FF6B5B;

    /* Colors - Backgrounds */
    --color-bg: #050505;
    --color-bg-card: #141414;
    --color-bg-elevated: #1C1C1C;
    --color-bg-input: #0A0A0A;

    /* Colors - Borders */
    --color-border: #2A2A2A;
    --color-border-hover: rgba(255, 59, 48, 0.3);

    /* Colors - Text */
    --color-text-primary: #FAFAFA;
    --color-text-secondary: #888888;
    --color-text-muted: #666666;
    --color-text-accent: #FF3B30;

    /* Typography - Font Families */
    --font-display: 'Zalando Sans Expanded', sans-serif;
    --font-body: 'Manrope', system-ui, sans-serif;
    --font-serif: ui-serif, Georgia, serif;

    /* Typography - Font Sizes (Mobile First) */
    --text-xs: 0.75rem;      /* 12px - Captions, labels */
    --text-sm: 0.875rem;     /* 14px - Small body, descriptions */
    --text-base: 1rem;       /* 16px - Body text */
    --text-lg: 1.125rem;     /* 18px - Large body, hero subtitle */
    --text-xl: 1.25rem;      /* 20px - H4, card titles */
    --text-2xl: 1.5rem;      /* 24px - H3 */
    --text-3xl: 1.875rem;    /* 30px - Large stats */
    --text-4xl: 2.25rem;     /* 36px - H2 mobile */
    --text-5xl: 3rem;        /* 48px - H1 mobile, H2 desktop */

    /* Typography - Line Heights */
    --leading-none: 1;
    --leading-tight: 1.1;
    --leading-snug: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    /* Typography - Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

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

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-glow: 0 0 80px rgba(255, 59, 48, 0.3), 0 0 160px rgba(255, 59, 48, 0.1);
    --shadow-button: 0 8px 40px rgba(255, 59, 48, 0.4);
}


/* ==========================================================================
   2. BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    background: var(--color-bg);
    color: var(--color-text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(255, 59, 48, 0.3);
}


/* ==========================================================================
   3. TYPOGRAPHY - Headings
   ========================================================================== */

/* H1 - Massive (Hero Headlines Only) */
.text-massive,
.h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: var(--font-extrabold);
    line-height: var(--leading-none);
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
}

/* H2 - Huge (Section Headlines) */
.text-huge,
.h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: var(--font-extrabold);
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
}

/* H3 - Large (Card Titles, Feature Headlines) */
.h3 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-snug);
    color: var(--color-text-primary);
}

/* H4 - Medium (Sub-section Titles) */
.h4 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-snug);
    color: var(--color-text-primary);
}


/* ==========================================================================
   4. TYPOGRAPHY - Body Text
   ========================================================================== */

/* Hero Subtitle - Large intro text below H1 */
.subtitle-hero {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
}

@media (min-width: 768px) {
    .subtitle-hero {
        font-size: var(--text-xl);
    }
}

/* Section Subtitle - Text below H2 */
.subtitle-section {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
}

@media (min-width: 768px) {
    .subtitle-section {
        font-size: var(--text-lg);
    }
}

/* Body Large - Important paragraphs */
.body-lg {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
}

/* Body - Regular paragraphs */
.body,
p {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
}

/* Body Small - Descriptions, card content */
.body-sm {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
}

/* Caption - Labels, timestamps, small text */
.caption {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--color-text-muted);
}


/* ==========================================================================
   5. TYPOGRAPHY - Special Styles
   ========================================================================== */

/* Display Font Helper */
.font-display {
    font-family: var(--font-display);
}

/* Serif Italic (for accent words) */
.font-serif {
    font-family: var(--font-serif);
}

.accent-italic {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--color-text-accent);
}

/* Text Colors */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-text-accent); }

/* Gradient Text */
.text-gradient {
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Number Highlight (Stroke Only) */
.number-highlight {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: var(--font-extrabold);
    line-height: var(--leading-none);
    color: transparent;
    -webkit-text-stroke: 2px var(--color-brand);
}

/* Stat Numbers */
.stat-number {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-none);
    color: var(--color-text-primary);
}

@media (min-width: 768px) {
    .stat-number {
        font-size: var(--text-4xl);
    }
}

.stat-label {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-normal);
    color: var(--color-text-secondary);
}


/* ==========================================================================
   6. BUTTONS
   ========================================================================== */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    background: var(--color-brand);
    color: white;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    line-height: var(--leading-none);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--color-brand-dark);
    transform: scale(1.02);
    box-shadow: var(--shadow-button);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    background: transparent;
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    line-height: var(--leading-none);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    border-color: var(--color-brand);
    background: rgba(255, 59, 48, 0.1);
}


/* ==========================================================================
   7. CARDS
   ========================================================================== */

.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-2px);
}

.card-elevated {
    background: var(--color-bg-elevated);
}


/* ==========================================================================
   8. TAGS & BADGES
   ========================================================================== */

.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
}

.tag-accent {
    background: rgba(255, 59, 48, 0.1);
    border-color: rgba(255, 59, 48, 0.3);
    color: var(--color-brand);
}

.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-4);
    background: var(--color-brand);
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    border-radius: var(--radius-full);
    text-transform: uppercase;
}


/* ==========================================================================
   9. FORM ELEMENTS
   ========================================================================== */

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--color-border);
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-brand);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 59, 48, 0.5);
    transition: transform 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}


/* ==========================================================================
   10. ANIMATIONS
   ========================================================================== */

@keyframes blob {
    0%, 100% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.animate-blob {
    animation: blob 15s ease-in-out infinite;
}

.animation-delay-2000 { animation-delay: 2s; }
.animation-delay-4000 { animation-delay: 4s; }

@keyframes waveform {
    0%, 100% { height: 20%; }
    50% { height: 100%; }
}

.waveform-bar {
    width: 3px;
    background: var(--color-brand);
    border-radius: 2px;
    animation: waveform 1s ease-in-out infinite;
}


/* ==========================================================================
   11. FAQ ACCORDION
   ========================================================================== */

.faq-item {
    border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6) 0;
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    text-align: left;
    cursor: pointer;
    transition: color 0.3s ease;
}

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

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-icon {
    transition: transform 0.3s ease;
    color: var(--color-brand);
    font-size: var(--text-2xl);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}


/* ==========================================================================
   12. UTILITIES
   ========================================================================== */

/* Glow Effect */
.glow-red {
    box-shadow: var(--shadow-glow);
}

/* Max Widths */
.max-w-content { max-width: 65ch; }
.max-w-narrow { max-width: 480px; }
.max-w-medium { max-width: 640px; }
.max-w-wide { max-width: 1024px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-brand); }


/* ==========================================================================
   13. MOBILE MENU (Header Component)
   ========================================================================== */

.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
    transform: translateX(0);
}

.hamburger span {
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}


/* ==========================================================================
   14. DROPDOWN (Header Component)
   ========================================================================== */

.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* ==========================================================================
   15. STICKY CTA
   ========================================================================== */

.sticky-cta {
    position: fixed;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 100;
    transition: transform 0.3s ease;
}

.sticky-cta.visible {
    transform: translateX(-50%) translateY(0);
}


/* ==========================================================================
   16. TIMELINE
   ========================================================================== */

.timeline-item {
    position: relative;
    padding-left: var(--space-12);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-brand), transparent);
}

.timeline-dot {
    position: absolute;
    left: -7px;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-brand);
    border: 3px solid var(--color-bg);
}
