/* ==========================================================================
   Madison Ross Media Group — Design System (2026)
   Theme: "Executive Portfolio" — Clean, premium, corporate digital presence
   ========================================================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ========================================================================
   1. DESIGN TOKENS (CSS Custom Properties)
   ======================================================================== */

:root {
    /* -- Typography -- */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* -- Spacing Scale -- */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;

    /* -- Border Radius -- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 50px;

    /* -- Transitions -- */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* -- Light Theme (Default) -- */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: rgba(79, 70, 229, 0.08);
    --primary-glow: rgba(79, 70, 229, 0.15);

    --accent: #EC4899;
    --accent-light: rgba(236, 72, 153, 0.08);

    --background: #F8FAFC;
    --background-alt: #F1F5F9;
    --surface: #FFFFFF;
    --surface-hover: #F8FAFC;
    --surface-elevated: #FFFFFF;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;
    --text-inverse: #FFFFFF;

    --border: #E2E8F0;
    --border-hover: #CBD5E1;
    --divider: #F1F5F9;

    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(226, 232, 240, 0.6);
    --glass-blur: 20px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.04), 0 10px 15px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.06), 0 20px 48px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.08), 0 30px 60px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(79, 70, 229, 0.12);

    /* -- Category Colors -- */
    --category-na: #3B82F6;
    --category-na-bg: rgba(59, 130, 246, 0.08);
    --category-na-border: rgba(59, 130, 246, 0.2);

    --category-asia: #10B981;
    --category-asia-bg: rgba(16, 185, 129, 0.08);
    --category-asia-border: rgba(16, 185, 129, 0.2);

    --category-other: #F59E0B;
    --category-other-bg: rgba(245, 158, 11, 0.08);
    --category-other-border: rgba(245, 158, 11, 0.2);

    /* -- Toggle -- */
    --toggle-bg: #E2E8F0;
    --toggle-knob: #FFFFFF;
    --toggle-icon: #94A3B8;
}

/* ========================================================================
   2. DARK THEME
   ======================================================================== */

[data-theme="dark"] {
    --primary: #818CF8;
    --primary-hover: #6366F1;
    --primary-light: rgba(129, 140, 248, 0.1);
    --primary-glow: rgba(129, 140, 248, 0.2);

    --accent: #F472B6;
    --accent-light: rgba(244, 114, 182, 0.1);

    --background: #0B0F19;
    --background-alt: #111827;
    --surface: #151B2B;
    --surface-hover: #1C2438;
    --surface-elevated: #1E2640;

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    --text-inverse: #0F172A;

    --border: #1E293B;
    --border-hover: #334155;
    --divider: #1E293B;

    --glass-bg: rgba(11, 15, 25, 0.78);
    --glass-border: rgba(30, 41, 59, 0.5);
    --glass-blur: 20px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.2), 0 10px 15px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.25), 0 20px 48px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.3), 0 30px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(129, 140, 248, 0.15);

    --category-na: #60A5FA;
    --category-na-bg: rgba(96, 165, 250, 0.1);
    --category-na-border: rgba(96, 165, 250, 0.2);

    --category-asia: #34D399;
    --category-asia-bg: rgba(52, 211, 153, 0.1);
    --category-asia-border: rgba(52, 211, 153, 0.2);

    --category-other: #FBBF24;
    --category-other-bg: rgba(251, 191, 36, 0.1);
    --category-other-border: rgba(251, 191, 36, 0.2);

    --toggle-bg: #1E293B;
    --toggle-knob: #334155;
    --toggle-icon: #94A3B8;
}

/* ========================================================================
   3. GLOBAL RESET & BASE
   ======================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    transition: background-color var(--transition-slow), color var(--transition-slow);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

ul, ol {
    list-style: none;
}

/* ========================================================================
   4. BACKGROUND MESH GRADIENT
   ======================================================================== */

.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-mesh::before,
.bg-mesh::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: meshFloat 20s ease-in-out infinite;
}

.bg-mesh::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.bg-mesh::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
    bottom: -50px;
    left: -100px;
    animation-delay: -10s;
}

[data-theme="dark"] .bg-mesh::before,
[data-theme="dark"] .bg-mesh::after {
    opacity: 0.25;
}

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

/* ========================================================================
   5. LAYOUT CONTAINER
   ======================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ========================================================================
   6. HEADER / NAVIGATION
   ======================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    transition: background var(--transition-base), border-color var(--transition-base);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    max-width: 1200px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 18px;
    font-family: var(--font-heading);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
    transition: transform var(--transition-fast);
}

.brand:hover .brand-icon {
    transform: scale(1.05);
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.brand-name span {
    color: var(--text-tertiary);
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* ========================================================================
   7. THEME TOGGLE
   ======================================================================== */

.theme-toggle {
    position: relative;
    width: 56px;
    height: 30px;
    background: var(--toggle-bg);
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    transition: background var(--transition-base);
    outline: none;
    padding: 3px;
}

.theme-toggle:focus-visible {
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.toggle-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.toggle-knob {
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    background: var(--surface);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .toggle-knob {
    transform: translateX(26px);
}

.toggle-icon {
    font-size: 13px;
    line-height: 1;
}

.icon-sun,
.icon-moon {
    transition: opacity var(--transition-fast);
}

[data-theme="dark"] .icon-sun {
    display: none;
}

[data-theme="light"] .icon-moon,
:root:not([data-theme="dark"]) .icon-moon {
    display: none;
}

/* ========================================================================
   8. HERO SECTION
   ======================================================================== */

.hero {
    text-align: center;
    padding: var(--space-4xl) var(--space-lg) var(--space-3xl);
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--primary-light);
    border: 1px solid var(--primary-glow);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-lg);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    animation: fadeUp 0.8s ease-out;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(36px, 6vw, 68px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    animation: fadeUp 0.8s ease-out 0.15s both;
}

.hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
    animation: fadeUp 0.8s ease-out 0.3s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-top: var(--space-2xl);
    animation: fadeUp 0.8s ease-out 0.45s both;
}

.stat {
    text-align: center;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    margin-top: var(--space-xs);
}

/* ========================================================================
   9. SECTION LAYOUT
   ======================================================================== */

.section {
    padding: var(--space-3xl) 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.section-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.section-icon.na {
    background: var(--category-na-bg);
    border: 1px solid var(--category-na-border);
    color: var(--category-na);
}

.section-icon.asia {
    background: var(--category-asia-bg);
    border: 1px solid var(--category-asia-border);
    color: var(--category-asia);
}

.section-icon.other {
    background: var(--category-other-bg);
    border: 1px solid var(--category-other-border);
    color: var(--category-other);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 400;
    margin-top: 2px;
}

/* ========================================================================
   10. CARD GRID
   ======================================================================== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

.card {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition:
        transform var(--transition-base),
        box-shadow var(--transition-base),
        border-color var(--transition-base),
        background var(--transition-base);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.card:hover .card-icon-wrapper {
    transform: scale(1.08);
}

.card-icon-wrapper.na {
    background: var(--category-na-bg);
    color: var(--category-na);
}

.card-icon-wrapper.asia {
    background: var(--category-asia-bg);
    color: var(--category-asia);
}

.card-icon-wrapper.other {
    background: var(--category-other-bg);
    color: var(--category-other);
}

.card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-description {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.card-arrow {
    font-size: 16px;
    color: var(--text-tertiary);
    transition: transform var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}

.card:hover .card-arrow {
    transform: translateX(3px);
    color: var(--primary);
}

/* Offline card modifier */
.card.offline {
    opacity: 0.5;
    pointer-events: none;
}

.card.offline::after {
    content: 'Offline';
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--background-alt);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ========================================================================
   11. DIVIDER
   ======================================================================== */

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: var(--space-xl) 0;
}

/* ========================================================================
   12. FOOTER
   ======================================================================== */

.site-footer {
    border-top: 1px solid var(--border);
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    background: var(--background-alt);
    transition: background var(--transition-slow);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.footer-legal {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.8;
}

.footer-legal a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-legal a:hover {
    color: var(--primary);
}

/* ========================================================================
   13. ANIMATIONS
   ======================================================================== */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scroll-triggered reveal */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger-children.visible > *:nth-child(1)  { transition-delay: 0.03s; }
.stagger-children.visible > *:nth-child(2)  { transition-delay: 0.06s; }
.stagger-children.visible > *:nth-child(3)  { transition-delay: 0.09s; }
.stagger-children.visible > *:nth-child(4)  { transition-delay: 0.12s; }
.stagger-children.visible > *:nth-child(5)  { transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(6)  { transition-delay: 0.18s; }
.stagger-children.visible > *:nth-child(7)  { transition-delay: 0.21s; }
.stagger-children.visible > *:nth-child(8)  { transition-delay: 0.24s; }
.stagger-children.visible > *:nth-child(9)  { transition-delay: 0.27s; }
.stagger-children.visible > *:nth-child(10) { transition-delay: 0.30s; }
.stagger-children.visible > *:nth-child(11) { transition-delay: 0.33s; }
.stagger-children.visible > *:nth-child(12) { transition-delay: 0.36s; }
.stagger-children.visible > *:nth-child(13) { transition-delay: 0.39s; }
.stagger-children.visible > *:nth-child(14) { transition-delay: 0.42s; }
.stagger-children.visible > *:nth-child(15) { transition-delay: 0.45s; }
.stagger-children.visible > *:nth-child(n+16) { transition-delay: 0.48s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================================================
   14. RESPONSIVE
   ======================================================================== */

@media (max-width: 768px) {
    .hero {
        padding: var(--space-3xl) var(--space-md) var(--space-2xl);
    }

    .hero-stats {
        gap: var(--space-lg);
    }

    .stat-number {
        font-size: 28px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        padding: var(--space-sm) var(--space-md);
    }

    .brand-name {
        font-size: 15px;
    }

    .brand-name span {
        display: none;
    }

    .section {
        padding: var(--space-2xl) 0;
    }

    .container {
        padding: 0 var(--space-md);
    }
}

@media (max-width: 480px) {
    .hero-stats {
        flex-direction: column;
        gap: var(--space-md);
    }

    .brand-icon {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}

/* ========================================================================
   15. ACCESSIBILITY
   ======================================================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .stagger-children > * {
        opacity: 1;
        transform: none;
    }
}

/* Focus visible ring */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
