:root {
    /* -------------------------------------------------------------------------- */
    /*                                 System Tokens                              */
    /* -------------------------------------------------------------------------- */

    /* Typography */
    --font-inter: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 8rem;

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

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Animation */
    --duration-short: 150ms;
    --duration-base: 250ms;
    --duration-long: 400ms;
    --easing-standard: cubic-bezier(0.4, 0, 0.2, 1);

    /* -------------------------------------------------------------------------- */
    /*                           Dark Theme (Default)                             */
    /* -------------------------------------------------------------------------- */

    /* Backgrounds */
    --bg-page: #09090b;
    --bg-surface: #121214;
    --bg-elevated: #1c1c1f;
    --bg-overlay: rgba(0, 0, 0, 0.6);

    /* Text */
    --text-primary: #ededef;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --text-on-accent: #ffffff;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.08);
    --border-prominent: rgba(255, 255, 255, 0.12);

    /* Accents */
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --accent-subtle: rgba(59, 130, 246, 0.1);
    --accent-glow: rgba(59, 130, 246, 0.25);
    --accent-focus-ring: rgba(59, 130, 246, 0.4);

    /* Status */
    --status-error: #f87171;
    --status-error-bg: rgba(127, 29, 29, 0.2);
    --status-success: #34d399;
    --status-success-bg: rgba(6, 78, 59, 0.2);

    /* Gradients */
    --gradient-page: radial-gradient(circle at 50% 0%, #17171a 0%, #09090b 80%);
    --gradient-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);

    /* Misc */
    --card-hover-bg: rgba(255, 255, 255, 0.05);
}

.light-theme {
    /* -------------------------------------------------------------------------- */
    /*                                Light Theme                                 */
    /* -------------------------------------------------------------------------- */

    /* Backgrounds */
    --bg-page: #fafafa;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.5);

    /* Text */
    --text-primary: #171717;
    --text-secondary: #525252;
    --text-muted: #a3a3a3;
    --text-on-accent: #ffffff;

    /* Borders */
    --border-subtle: rgba(0, 0, 0, 0.05);
    --border-default: rgba(0, 0, 0, 0.08);
    --border-prominent: rgba(0, 0, 0, 0.12);

    /* Accents */
    --accent-primary: #2563eb;
    --accent-secondary: #3b82f6;
    --accent-subtle: #eff6ff;
    --accent-glow: rgba(37, 99, 235, 0.15);
    --accent-focus-ring: rgba(37, 99, 235, 0.3);

    /* Status */
    --status-error: #dc2626;
    --status-error-bg: #fef2f2;
    --status-success: #059669;
    --status-success-bg: #ecfdf5;

    /* Gradients */
    --gradient-page: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
    --gradient-surface: linear-gradient(to bottom, #ffffff 0%, #f9fafb 100%);

    /* Misc */
    --card-hover-bg: rgba(0, 0, 0, 0.02);
}

/* -------------------------------------------------------------------------- */
/*                                Global Styles                               */
/* -------------------------------------------------------------------------- */

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

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-inter);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Glow */
.glow-bg {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100vh;
    background: var(--gradient-page);
    z-index: -1;
}

.glow-bg::after {
    content: '';
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 40%;
    background: var(--accent-glow);
    filter: blur(120px);
    border-radius: 50%;
    opacity: 0.4;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-default);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all var(--duration-base) var(--easing-standard);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

.light-theme .theme-toggle .icon-sun {
    display: block;
}

.light-theme .theme-toggle .icon-moon {
    display: none;
}

/* Header */
.header {
    padding: 4rem 2rem 2rem;
    text-align: center;
}

.title {
    font-size: 3rem;
    /* 4xl in json is 3rem, matches */
    font-weight: 800;
    /* extrabold in json */
    letter-spacing: -0.02em;
    /* tight */
    margin-bottom: 0.5rem;
    background: linear-gradient(to bottom, var(--text-primary), var(--text-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    /* lg */
    font-weight: 400;
}

.button-group {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    margin-top: 2.5rem;
}

/* Buttons */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 3rem;
    font-size: 1.125rem;
    /* lg */
    font-weight: 600;
    /* semibold */
    color: var(--text-on-accent);
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-base) var(--easing-standard);
    box-shadow: 0 10px 25px -5px var(--accent-glow);
    text-decoration: none;
    white-space: nowrap;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px var(--accent-glow);
    background: var(--accent-secondary);
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-base) var(--easing-standard);
    text-decoration: none;
    white-space: nowrap;
}

.secondary-button:hover {
    transform: translateY(-2px);
    background: var(--bg-surface);
    border-color: var(--text-primary);
}

.secondary-button .icon-download {
    font-size: 1.2em;
}

/* Dashboard Grid */
.dashboard-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
}

/* Component: Card */
.card {
    position: relative;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-decoration: none;
    color: inherit;
    transition: all var(--duration-base) var(--easing-standard);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-default);
    overflow: hidden;
    min-height: 240px;
    box-shadow: var(--shadow-sm);
    /* From components.card.shadow */
}

.card:hover {
    transform: translateY(-8px);
    background: var(--card-hover-bg);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
    /* Enhanced shadow on hover */
}

.card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1.25rem;
    /* xl */
    font-weight: 600;
    /* semibold */
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    /* sm */
    line-height: 1.5;
    flex-grow: 1;
}

/* Badge matches components.badge */
.status-badge {
    align-self: flex-start;
    margin-top: 1.5rem;
    padding: 0.125rem 0.5rem;
    /* badge.padding */
    background: var(--accent-subtle);
    /* badge.colorScheme.default.bg */
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    /* xs */
    font-weight: 500;
    color: var(--text-secondary);
    /* Default fallback */
    border: 1px solid var(--border-default);
}

/* Card accents specific overrides */
.primary-accent:hover .status-badge {
    background: var(--accent-glow);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.placeholder {
    opacity: 0.6;
    filter: saturate(0.5);
    cursor: default;
}

.placeholder:hover {
    transform: none;
    background: var(--bg-surface);
    border-color: var(--border-default);
}

/* Footer */
.footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .title {
        font-size: 2.25rem;
    }

    .header {
        padding-top: 2rem;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Carousel Styles */
.carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 2rem 0;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.carousel-track {
    display: flex;
    gap: 1.5rem;
    /* Matches grid gap */
    width: max-content;
    animation: scroll 60s linear infinite;
    padding-left: 1.5rem;
    /* Initial offset so it doesn't look cut off */
}

/* Halt animation on hover for better UX */
.carousel-track:hover {
    animation-play-state: paused;
}

.carousel-track .card {
    flex: 0 0 350px;
    /* Fixed width for carousel items */
    margin: 0;
    /* Override any potential margins */
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Card Action Buttons */
.card-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.card .secondary-button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: 100%;
    justify-content: center;
}

@media (max-width: 768px) {
    .card-actions {
        flex-direction: column;
    }
}