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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    color: var(--on-background);
    background-color: var(--background);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

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

.container-narrow {
    max-width: 900px;
}

/* Section Styles */
section {
    padding: var(--space-5xl) 0;
    scroll-margin-top: 80px;
}

section:first-of-type {
    padding-top: var(--space-4xl);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: clamp(var(--fs-4xl), 6vw, var(--fs-6xl));
}

h2 {
    font-size: clamp(var(--fs-3xl), 4vw, var(--fs-4xl));
}

h3 {
    font-size: var(--fs-2xl);
}

h4 {
    font-size: var(--fs-xl);
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

/* Utility Classes */
.text-primary {
    color: var(--primary);
}

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

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--on-surface-variant);
}

.font-mono {
    font-family: var(--font-mono);
}

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

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

.gap-xl {
    gap: var(--space-xl);
}

/* Grid */
.grid {
    display: grid;
}

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

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: var(--fs-base);
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.button:hover::before {
    opacity: 1;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.button:active {
    transform: translateY(0);
}

.button-primary {
    background: var(--primary);
    color: var(--on-primary);
}

.button-primary:hover {
    background: var(--primary-light);
    box-shadow: var(--glow);
}

.button-secondary {
    background: var(--surface-variant);
    color: var(--on-surface);
}

.button-outline {
    background: transparent;
    border: 2px solid var(--outline);
    color: var(--on-surface);
}

.button-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all var(--transition-base);
}

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

.card-glass {
    background: rgba(26, 46, 68, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="light"] .card-glass {
    background: rgba(255, 255, 255, 0.7);
}

/* Badges & Pills */
.badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    font-weight: 500;
    background: var(--surface-variant);
    color: var(--on-surface-variant);
}

.badge-primary {
    background: rgba(79, 195, 247, 0.2);
    color: var(--primary);
}

/* Loading States */
.skeleton {
    background: linear-gradient(
            90deg,
            var(--surface-variant) 0%,
            var(--surface-hover) 50%,
            var(--surface-variant) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: var(--z-fixed);
    transition: width 0.1s ease;
}

/* Responsive */
@media (max-width: 768px) {
    section {
        padding: var(--space-4xl) 0;
    }

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

    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .button {
        padding: 0.75rem 1.5rem;
        font-size: var(--fs-sm);
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

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

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}
