/* ============================================
   DESIGN SYSTEM INDEX
   ============================================

   Main entry point for the design system.
   Import this file to get all design tokens and base styles.

   ============================================ */

/* CSS Custom Properties (Variables) — unlayered for :root specificity */
@import '_variables.css?v=20260217e';
@import '_provider-palette.css';

/* Animations and Keyframes — self-layered via @layer design-system inside */
@import '_animations.css';

@layer design-system {

/* ============================================
   BASE STYLES
   ============================================ */

/* Box sizing reset */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Base body styles */
body {
    background: var(--ds-color-bg-primary);
    color: var(--ds-color-text-primary);
    font-family: var(--ds-font-family);
    font-size: var(--ds-font-size-base);
    line-height: var(--ds-line-height);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle grain texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.02;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    z-index: -1;
}

/* Links */
a {
    color: var(--ds-color-accent);
    text-decoration: none;
    transition: color var(--ds-transition-fast);
}

a:hover {
    color: var(--ds-color-accent-hover);
}

/* Selection */
::selection {
    background: var(--ds-color-accent);
    color: var(--ds-color-text-inverse);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--ds-font-family-heading);
    font-weight: var(--ds-font-weight-semibold);
    color: var(--ds-color-text-primary);
    line-height: var(--ds-line-height-tight);
    margin-bottom: var(--ds-space-4);
}

h1 { font-size: clamp(var(--ds-font-size-2xl), 5vw, var(--ds-font-size-4xl)); font-weight: var(--ds-font-weight-bold); letter-spacing: -0.5px; }
h2 { font-size: clamp(var(--ds-font-size-xl), 4vw, var(--ds-font-size-3xl)); letter-spacing: -0.25px; }
h3 { font-size: var(--ds-font-size-xl); }
h4 { font-size: var(--ds-font-size-lg); }
h5 { font-size: var(--ds-font-size-md); }
h6 { font-size: var(--ds-font-size-base); }

p {
    margin-bottom: var(--ds-space-4);
    color: var(--ds-color-text-secondary);
}

/* Monospace elements */
code, pre, kbd, samp, .monospace {
    font-family: var(--ds-font-family-mono);
}

/* ============================================
   TEXT UTILITIES
   ============================================ */

.text-muted { color: var(--ds-color-text-tertiary); }
.text-accent { color: var(--ds-color-accent); }
.text-success { color: var(--ds-color-success); }
.text-warning { color: var(--ds-color-warning); }
.text-danger, .text-error { color: var(--ds-color-error); }
.text-info { color: var(--ds-color-info); }

.text-xs { font-size: var(--ds-font-size-xs); }
.text-sm { font-size: var(--ds-font-size-sm); }
.text-base { font-size: var(--ds-font-size-base); }
.text-md { font-size: var(--ds-font-size-md); }
.text-lg { font-size: var(--ds-font-size-lg); }
.text-xl { font-size: var(--ds-font-size-xl); }
.text-2xl { font-size: var(--ds-font-size-2xl); }

.font-normal { font-weight: var(--ds-font-weight-normal); }
.font-medium { font-weight: var(--ds-font-weight-medium); }
.font-semibold { font-weight: var(--ds-font-weight-semibold); }
.font-bold { font-weight: var(--ds-font-weight-bold); }

/* Gradient text */
.gradient-text,
.text-gradient {
    background: var(--ds-gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   BACKGROUND UTILITIES
   ============================================ */

.bg-theme, .bg-primary { background: var(--ds-color-bg-primary); }
.bg-theme-alt, .bg-secondary { background: var(--ds-color-bg-secondary); }
.bg-surface { background: var(--ds-color-surface); }
.bg-accent { background: var(--ds-color-accent); }
.bg-gradient-accent { background: var(--ds-gradient-accent); }
.bg-gradient-subtle { background: var(--ds-gradient-subtle); }

/* Glass effect */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ============================================
   SPACING UTILITIES
   ============================================ */

.gap-1 { gap: var(--ds-space-1); }
.gap-2 { gap: var(--ds-space-2); }
.gap-3 { gap: var(--ds-space-3); }
.gap-4 { gap: var(--ds-space-4); }
.gap-5 { gap: var(--ds-space-5); }
.gap-6 { gap: var(--ds-space-6); }
.gap-8 { gap: var(--ds-space-8); }

/* ============================================
   SHADOW UTILITIES
   ============================================ */

.shadow-sm { box-shadow: var(--ds-shadow-sm); }
.shadow-md { box-shadow: var(--ds-shadow-md); }
.shadow-lg { box-shadow: var(--ds-shadow-lg); }
.shadow-xl { box-shadow: var(--ds-shadow-xl); }
.shadow-none { box-shadow: none; }

/* ============================================
   BORDER RADIUS UTILITIES
   ============================================ */

.rounded-sm { border-radius: var(--ds-radius-sm); }
.rounded-md { border-radius: var(--ds-radius-md); }
.rounded-lg { border-radius: var(--ds-radius-lg); }
.rounded-xl { border-radius: var(--ds-radius-xl); }
.rounded-2xl { border-radius: var(--ds-radius-2xl); }
.rounded-full { border-radius: var(--ds-radius-full); }

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--ds-color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--ds-border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ds-color-text-tertiary);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
    background: rgba(232, 228, 223, 0.9);
}

.spinner-border {
    color: var(--ds-color-accent);
}

.loading-spinner {
    border-color: var(--ds-color-accent);
    border-top-color: transparent;
}

} /* end @layer design-system */
