/* Materia Theme - Material Design 3 Core Styles */

/* ========================================
   MD3 COLOR TOKENS & SYSTEM VARIABLES
======================================== */

:root {
    /* MATERIA DARK Color System - Material Design 3 Dark Theme */
    /* NOTE: Colors are defined below in the harmonious section */
    
    /* MATERIA Brand Colors - Purple Variations */
    --materia-purple-dark: #4F378B;
    --materia-purple-light: #D0BCFF;
    --materia-rose: #E8B7CC;
    --materia-lavender: #CCC2DC;
    --materia-mauve: #625B71;
    --materia-slate: #49454F;
    
    /* MD3 Elevation System */
    --md-elevation-1: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
    --md-elevation-2: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
    --md-elevation-3: 0px 1px 3px 0px rgba(0, 0, 0, 0.3), 0px 4px 8px 3px rgba(0, 0, 0, 0.15);
    --md-elevation-4: 0px 2px 3px 0px rgba(0, 0, 0, 0.3), 0px 6px 10px 4px rgba(0, 0, 0, 0.15);
    --md-elevation-5: 0px 4px 4px 0px rgba(0, 0, 0, 0.3), 0px 8px 12px 6px rgba(0, 0, 0, 0.15);
    
    /* MATERIA Sharp Geometric System - Bold & Angular */
    --md-shape-corner-none: 0px;
    --md-shape-corner-extra-small: 0px;     /* Sharp edges everywhere */
    --md-shape-corner-small: 2px;           /* Minimal rounding */
    --md-shape-corner-medium: 4px;          /* Very subtle */
    --md-shape-corner-large: 6px;           /* Still quite sharp */
    --md-shape-corner-extra-large: 8px;     /* Maximum geometric */
    --md-shape-corner-full: 0px;            /* No pills - all rectangular */
    
    /* MATERIA Geometric Cuts */
    /* MATERIA Geometric Cuts - REMOVED for cleaner design */
    /* Clip-path variables removed to eliminate angular cuts and geometric shapes */
    
    /* MD3 Motion System */
    --md-motion-duration-short1: 50ms;
    --md-motion-duration-short2: 100ms;
    --md-motion-duration-short3: 150ms;
    --md-motion-duration-short4: 200ms;
    --md-motion-duration-medium1: 250ms;
    --md-motion-duration-medium2: 300ms;
    --md-motion-duration-medium3: 350ms;
    --md-motion-duration-medium4: 400ms;
    --md-motion-duration-long1: 450ms;
    --md-motion-duration-long2: 500ms;
    --md-motion-duration-long3: 550ms;
    --md-motion-duration-long4: 600ms;
    
    --md-motion-easing-linear: cubic-bezier(0, 0, 1, 1);
    --md-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
    --md-motion-easing-standard-accelerate: cubic-bezier(0.3, 0, 1, 1);
    --md-motion-easing-standard-decelerate: cubic-bezier(0, 0, 0, 1);
    --md-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
    --md-motion-easing-emphasized-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);
    --md-motion-easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
    
    /* MD3 Typography Scale */
    --md-typescale-display-large-font-size: 57px;
    --md-typescale-display-large-line-height: 64px;
    --md-typescale-display-large-font-weight: 400;
    --md-typescale-display-large-letter-spacing: -0.25px;
    
    --md-typescale-display-medium-font-size: 45px;
    --md-typescale-display-medium-line-height: 52px;
    --md-typescale-display-medium-font-weight: 400;
    --md-typescale-display-medium-letter-spacing: 0px;
    
    --md-typescale-display-small-font-size: 36px;
    --md-typescale-display-small-line-height: 44px;
    --md-typescale-display-small-font-weight: 400;
    --md-typescale-display-small-letter-spacing: 0px;
    
    --md-typescale-headline-large-font-size: 32px;
    --md-typescale-headline-large-line-height: 40px;
    --md-typescale-headline-large-font-weight: 400;
    --md-typescale-headline-large-letter-spacing: 0px;
    
    --md-typescale-headline-medium-font-size: 28px;
    --md-typescale-headline-medium-line-height: 36px;
    --md-typescale-headline-medium-font-weight: 400;
    --md-typescale-headline-medium-letter-spacing: 0px;
    
    --md-typescale-headline-small-font-size: 24px;
    --md-typescale-headline-small-line-height: 32px;
    --md-typescale-headline-small-font-weight: 400;
    --md-typescale-headline-small-letter-spacing: 0px;
    
    --md-typescale-title-large-font-size: 22px;
    --md-typescale-title-large-line-height: 28px;
    --md-typescale-title-large-font-weight: 400;
    --md-typescale-title-large-letter-spacing: 0px;
    
    --md-typescale-title-medium-font-size: 16px;
    --md-typescale-title-medium-line-height: 24px;
    --md-typescale-title-medium-font-weight: 500;
    --md-typescale-title-medium-letter-spacing: 0.15px;
    
    --md-typescale-title-small-font-size: 14px;
    --md-typescale-title-small-line-height: 20px;
    --md-typescale-title-small-font-weight: 500;
    --md-typescale-title-small-letter-spacing: 0.1px;
    
    --md-typescale-body-large-font-size: 16px;
    --md-typescale-body-large-line-height: 24px;
    --md-typescale-body-large-font-weight: 400;
    --md-typescale-body-large-letter-spacing: 0.5px;
    
    --md-typescale-body-medium-font-size: 14px;
    --md-typescale-body-medium-line-height: 20px;
    --md-typescale-body-medium-font-weight: 400;
    --md-typescale-body-medium-letter-spacing: 0.25px;
    
    --md-typescale-body-small-font-size: 12px;
    --md-typescale-body-small-line-height: 16px;
    --md-typescale-body-small-font-weight: 400;
    --md-typescale-body-small-letter-spacing: 0.4px;
    
    --md-typescale-label-large-font-size: 14px;
    --md-typescale-label-large-line-height: 20px;
    --md-typescale-label-large-font-weight: 500;
    --md-typescale-label-large-letter-spacing: 0.1px;
    
    --md-typescale-label-medium-font-size: 12px;
    --md-typescale-label-medium-line-height: 16px;
    --md-typescale-label-medium-font-weight: 500;
    --md-typescale-label-medium-letter-spacing: 0.5px;
    
    --md-typescale-label-small-font-size: 11px;
    --md-typescale-label-small-line-height: 16px;
    --md-typescale-label-small-font-weight: 500;
    --md-typescale-label-small-letter-spacing: 0.5px;
    
    /* MD3 State Layer Opacity */
    --md-state-hover-opacity: 0.08;
    --md-state-focus-opacity: 0.12;
    --md-state-pressed-opacity: 0.12;
    --md-state-dragged-opacity: 0.16;
    --md-state-disabled-opacity: 0.38;
    --md-state-disabled-container-opacity: 0.12;
    
    /* MATERIA Header Heights - Taller for Bold Design */
    --header-height-mobile: 5rem;
    --header-height-desktop: 6rem;
}

/* MATERIA Dark Mode - Harmonious & Readable Color System - UPDATED FOR WHITE TEXT */
:root {
    /* ==========================================
       CORE DARK THEME COLORS - WELL BALANCED
    ========================================== */
    
    /* Primary Color Family - Warm Blue (Professional & Readable) */
    --md-sys-color-primary: #4285f4;              /* Google Blue - Professional */
    --md-sys-color-on-primary: #ffffff;           /* Pure white for contrast */
    --md-sys-color-primary-container: #1a73e8;    /* Darker blue container */
    --md-sys-color-on-primary-container: #ffffff;  /* White text on dark blue */
    
    /* Secondary Color Family - Complementary Teal (Harmonious) */
    --md-sys-color-secondary: #00bcd4;            /* Cyan - Complements blue */
    --md-sys-color-on-secondary: #ffffff;         /* White for readability */
    --md-sys-color-secondary-container: #0097a7;  /* Darker teal container */
    --md-sys-color-on-secondary-container: #ffffff; /* White text */
    
    /* Tertiary Color Family - Subtle Purple (Accent) */
    --md-sys-color-tertiary: #9c27b0;             /* Material Purple */
    --md-sys-color-on-tertiary: #ffffff;          /* White for readability */
    --md-sys-color-tertiary-container: #7b1fa2;   /* Darker purple container */
    --md-sys-color-on-tertiary-container: #ffffff; /* White text */
    
    /* Error Color Family - Clear Red (Accessible) */
    --md-sys-color-error: #f44336;                /* Material Red */
    --md-sys-color-on-error: #ffffff;             /* White for readability */
    --md-sys-color-error-container: #d32f2f;      /* Darker red container */
    --md-sys-color-on-error-container: #ffffff;   /* White text */
    
    /* Success Color Family - Clear Green */
    --md-sys-color-success: #4caf50;              /* Material Green */
    --md-sys-color-on-success: #ffffff;           /* White for readability */
    --md-sys-color-success-container: #388e3c;    /* Darker green container */
    --md-sys-color-on-success-container: #ffffff; /* White text */
    
    /* Warning Color Family - Clear Orange */
    --md-sys-color-warning: #ff9800;              /* Material Orange */
    --md-sys-color-on-warning: #ffffff;           /* White for readability */
    --md-sys-color-warning-container: #f57c00;    /* Darker orange container */
    --md-sys-color-on-warning-container: #ffffff; /* White text */
    
    /* ==========================================
       BACKGROUND & SURFACE COLORS - CONSISTENT
    ========================================== */
    
    /* Main Background - Deep but not pure black */
    --md-sys-color-background: #121212;           /* Material Dark Background */
    --md-sys-color-on-background: #ffffff;        /* Pure white text */
    
    /* Surface Colors - Proper hierarchy */
    --md-sys-color-surface: #1e1e1e;              /* Main surface */
    --md-sys-color-on-surface: #ffffff;           /* White text on surfaces */
    --md-sys-color-surface-variant: #2d2d2d;      /* Variant surface */
    --md-sys-color-on-surface-variant: #e0e0e0;   /* Light gray text */
    
    /* Surface Container Hierarchy - Clear elevation */
    --md-sys-color-surface-container-lowest: #0d0d0d;  /* Lowest elevation */
    --md-sys-color-surface-container-low: #1e1e1e;     /* Low elevation */
    --md-sys-color-surface-container: #2d2d2d;         /* Medium elevation */
    --md-sys-color-surface-container-high: #3d3d3d;    /* High elevation */
    --md-sys-color-surface-container-highest: #4d4d4d; /* Highest elevation */
    
    /* ==========================================
       OUTLINE & BORDER COLORS - SUBTLE
    ========================================== */
    
    --md-sys-color-outline: #616161;              /* Medium gray outline */
    --md-sys-color-outline-variant: #424242;      /* Darker gray outline */
    
    /* ==========================================
       INVERSE COLORS - FOR LIGHT CONTENT
    ========================================== */
    
    --md-sys-color-inverse-surface: #ffffff;      /* White inverse surface */
    --md-sys-color-inverse-on-surface: #121212;   /* Dark text on light */
    --md-sys-color-inverse-primary: #1a73e8;      /* Primary color for light surfaces */
    
    /* ==========================================
       MATERIA BRAND COLORS - CONSISTENT
    ========================================== */
    
    --materia-dark-accent: #4285f4;               /* Primary accent */
    --materia-dark-glow: rgba(66, 133, 244, 0.3); /* Blue glow */
    --materia-dark-highlight: rgba(0, 188, 212, 0.2); /* Teal highlight */
    --materia-dark-shadow: rgba(0, 0, 0, 0.8);    /* Deep shadow */
    
    /* ==========================================
       GLASS MORPHISM VARIABLES - SUBTLE
    ========================================== */
    
    --glass-bg: rgba(30, 30, 30, 0.8);           /* Dark glass background */
    --glass-border: rgba(255, 255, 255, 0.1);    /* Light border */
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6); /* Glass shadow */
    
    /* ==========================================
       ENHANCED EFFECTS - HARMONIOUS
    ========================================== */
    
    --materia-dark-cut-glow: drop-shadow(0 0 8px var(--materia-dark-glow));
    --materia-text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* Subtle text shadow */
    --materia-hover-overlay: rgba(255, 255, 255, 0.08);  /* Hover overlay */
    --materia-focus-ring: 0 0 0 3px rgba(66, 133, 244, 0.3); /* Focus ring */
}

/* Dark mode media query fallback for systems that don't force dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --md-sys-color-primary: #4285f4;
        --md-sys-color-on-primary: #ffffff;
        --md-sys-color-primary-container: #1a73e8;
        --md-sys-color-on-primary-container: #ffffff;
        
        --md-sys-color-secondary: #00bcd4;
        --md-sys-color-on-secondary: #ffffff;
        --md-sys-color-secondary-container: #0097a7;
        --md-sys-color-on-secondary-container: #ffffff;
        
        --md-sys-color-tertiary: #9c27b0;
        --md-sys-color-on-tertiary: #ffffff;
        --md-sys-color-tertiary-container: #7b1fa2;
        --md-sys-color-on-tertiary-container: #ffffff;
        
        --md-sys-color-error: #f44336;
        --md-sys-color-on-error: #ffffff;
        --md-sys-color-error-container: #d32f2f;
        --md-sys-color-on-error-container: #ffffff;
        
        --md-sys-color-background: #121212;
        --md-sys-color-on-background: #ffffff;
        
        --md-sys-color-surface: #1e1e1e;
        --md-sys-color-on-surface: #ffffff;
        --md-sys-color-surface-variant: #2d2d2d;
        --md-sys-color-on-surface-variant: #e0e0e0;
        
        --md-sys-color-outline: #616161;
        --md-sys-color-outline-variant: #424242;
        
        --md-sys-color-surface-container-lowest: #0d0d0d;
        --md-sys-color-surface-container-low: #1e1e1e;
        --md-sys-color-surface-container: #2d2d2d;
        --md-sys-color-surface-container-high: #3d3d3d;
        --md-sys-color-surface-container-highest: #4d4d4d;
        
        --md-sys-color-inverse-surface: #ffffff;
        --md-sys-color-inverse-on-surface: #121212;
        --md-sys-color-inverse-primary: #1a73e8;
    }
}

/* ========================================
   GLOBAL BASE STYLES
======================================== */
* {
    box-sizing: border-box;
}

/* Only remove transforms from Alpine.js elements */
[x-transition] {
    transform: none !important;
}

html {
    scroll-behavior: auto !important;
    font-feature-settings: 'kern' 1;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', 'Roboto', 'Source Sans Pro', system-ui, sans-serif;
    font-feature-settings: 'kern' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* MATERIA Dark Background - Clean & Harmonious */
    background: 
        /* Clean dark gradient base */
        linear-gradient(135deg, var(--md-sys-color-background) 0%, var(--md-sys-color-surface-container-low) 100%),
        /* Subtle geometric accents with harmonious colors */
        conic-gradient(from 45deg at 25% 25%, 
            transparent 0deg, 
            color-mix(in srgb, var(--md-sys-color-primary) 0.03, transparent) 90deg, 
            transparent 90deg),
        conic-gradient(from 225deg at 75% 75%, 
            transparent 0deg, 
            color-mix(in srgb, var(--md-sys-color-secondary) 0.02, transparent) 90deg, 
            transparent 90deg);
    background-attachment: fixed;
    color: var(--md-sys-color-on-background);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: var(--md-typescale-body-large-font-size);
    line-height: var(--md-typescale-body-large-line-height);
    font-weight: var(--md-typescale-body-large-font-weight);
    letter-spacing: var(--md-typescale-body-large-letter-spacing);
    transition: background var(--md-motion-duration-medium2) var(--md-motion-easing-standard),
                color var(--md-motion-duration-medium2) var(--md-motion-easing-standard);
}

button {
    border: none;
    background: none;
    cursor: pointer;
}

img {
    max-width: 100%;
    height: auto;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -o-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* ========================================
   SCROLL BEHAVIOR & ANCHOR NAVIGATION
======================================== */
section[id], 
.anchor-section,
[id] {
    scroll-margin-top: calc(var(--header-height-mobile) + 20px);
}

@media (min-width: 1024px) {
    section[id], 
    .anchor-section,
    [id] {
        scroll-margin-top: calc(var(--header-height-desktop) + 20px);
    }
}

/* ========================================
   MD3 SURFACE SYSTEM & STATE LAYERS
======================================== */

/* MATERIA Geometric Surface System - Bold & Angular */
.md-surface {
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-shape-corner-none);
    border-left: 6px solid var(--md-sys-color-primary);
    border-bottom: 2px solid var(--md-sys-color-outline-variant);
    position: relative;
    border-radius: 12px 0px 0px 12px; /* Simplified from clip-path cut-corner */
    transition: all var(--md-motion-duration-short4) var(--md-motion-easing-emphasized);
}

.md-surface:hover {
    border-left-width: 8px;
    transform: translateY(-2px);
    box-shadow: 
        8px 8px 0 var(--md-sys-color-primary-container),
        var(--md-elevation-3);
}

.md-surface-container-lowest {
    background: var(--md-sys-color-surface-container-lowest);
    color: var(--md-sys-color-on-surface);
    border: 3px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-corner-none);
    position: relative;
}

.md-surface-container-lowest::before {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 24px;
    height: 24px;
    background: var(--md-sys-color-tertiary);
    /* Removed unnecessary clip-path for cleaner design */
}

.md-surface-container-low {
    background: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-shape-corner-none);
    position: relative;
    border-top: 4px solid var(--md-sys-color-primary);
    border-right: 4px solid var(--md-sys-color-tertiary);
}

.md-surface-container-low::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(45deg, 
        var(--md-sys-color-primary) 0%, 
        transparent 25%, 
        var(--md-sys-color-primary) 50%, 
        transparent 75%);
    opacity: 0.1;
}

.md-surface-container {
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-shape-corner-none);
    border-radius: 8px; /* Simplified from clip-path diagonal-cut */
    border-bottom: 3px solid var(--md-sys-color-primary);
    position: relative;
}

.md-surface-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 24px 24px;
    border-color: transparent transparent var(--md-sys-color-tertiary) transparent;
}

.md-surface-container-high {
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-shape-corner-none);
    border: 2px solid var(--md-sys-color-outline);
    position: relative;
    border-radius: 16px; /* Simplified from clip-path notch-cut */
}

.md-surface-container-high::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -2px;
    width: 12px;
    height: 40%;
    background: var(--md-sys-color-secondary);
    transform: translateY(-50%) skewY(-15deg);
}

.md-surface-container-highest {
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-shape-corner-none);
    border: 4px solid var(--md-sys-color-primary);
    position: relative;
    /* Removed excessive 3D perspective for cleaner look */
    box-shadow: 
        0 8px 0 var(--md-sys-color-primary-container),
        0 16px 0 var(--md-sys-color-tertiary-container),
        var(--md-elevation-4);
}

.md-surface-container-highest::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, 
        var(--md-sys-color-primary) 0%, 
        var(--md-sys-color-tertiary) 25%, 
        var(--md-sys-color-secondary) 50%, 
        var(--md-sys-color-primary) 75%, 
        var(--md-sys-color-tertiary) 100%);
    z-index: -1;
    /* Removed rotating border animation for cleaner appearance */
}

/* Removed rotating border animation keyframes for cleaner appearance */

.md-surface-variant {
    background: 
        repeating-conic-gradient(
            from 0deg at 50% 50%,
            var(--md-sys-color-surface-variant) 0deg,
            var(--md-sys-color-surface-variant) 45deg,
            color-mix(in srgb, var(--md-sys-color-surface-variant) 95%, var(--md-sys-color-primary) 5%) 45deg,
            color-mix(in srgb, var(--md-sys-color-surface-variant) 95%, var(--md-sys-color-primary) 5%) 90deg
        );
    color: var(--md-sys-color-on-surface-variant);
    border-radius: var(--md-shape-corner-none);
    border: 1px solid var(--md-sys-color-outline);
}

/* MD3 State Layer System */
.md-state-layer {
    position: relative;
    overflow: hidden;
}

.md-state-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    transition: background-color var(--md-motion-duration-short4) var(--md-motion-easing-standard);
    pointer-events: none;
}

/* Hover State */
.md-state-layer:hover::before {
    background-color: color-mix(in srgb, var(--md-sys-color-on-surface) var(--md-state-hover-opacity), transparent);
}

/* Focus State */
.md-state-layer:focus::before,
.md-state-layer:focus-visible::before {
    background-color: color-mix(in srgb, var(--md-sys-color-on-surface) var(--md-state-focus-opacity), transparent);
}

/* Pressed State */
.md-state-layer:active::before {
    background-color: color-mix(in srgb, var(--md-sys-color-on-surface) var(--md-state-pressed-opacity), transparent);
}

/* Disabled State */
.md-state-layer:disabled,
.md-state-layer[disabled] {
    opacity: var(--md-state-disabled-opacity);
    pointer-events: none;
}

.md-state-layer:disabled::before,
.md-state-layer[disabled]::before {
    background-color: transparent;
}

/* Primary State Layers */
.md-state-layer-primary:hover::before {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) var(--md-state-hover-opacity), transparent);
}

.md-state-layer-primary:focus::before,
.md-state-layer-primary:focus-visible::before {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) var(--md-state-focus-opacity), transparent);
}

.md-state-layer-primary:active::before {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) var(--md-state-pressed-opacity), transparent);
}

/* Secondary State Layers */
.md-state-layer-secondary:hover::before {
    background-color: color-mix(in srgb, var(--md-sys-color-secondary) var(--md-state-hover-opacity), transparent);
}

.md-state-layer-secondary:focus::before,
.md-state-layer-secondary:focus-visible::before {
    background-color: color-mix(in srgb, var(--md-sys-color-secondary) var(--md-state-focus-opacity), transparent);
}

.md-state-layer-secondary:active::before {
    background-color: color-mix(in srgb, var(--md-sys-color-secondary) var(--md-state-pressed-opacity), transparent);
}

/* Elevation System */
.md-elevation-1 {
    box-shadow: var(--md-elevation-1);
}

.md-elevation-2 {
    box-shadow: var(--md-elevation-2);
}

.md-elevation-3 {
    box-shadow: var(--md-elevation-3);
}

.md-elevation-4 {
    box-shadow: var(--md-elevation-4);
}

.md-elevation-5 {
    box-shadow: var(--md-elevation-5);
}

/* Legacy Glass Support (converted to MD3 surfaces) */
.aeris-glass {
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-shape-corner-medium);
    box-shadow: var(--md-elevation-2);
}

.aeris-glass-dark {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-shape-corner-medium);
    box-shadow: var(--md-elevation-3);
}

.aeris-glass-strong {
    background-color: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-shape-corner-medium);
    box-shadow: var(--md-elevation-4);
}

/* ========================================
   GRADIENT UTILITIES
======================================== */
.aeris-gradient-primary {
    background: linear-gradient(135deg, var(--aeris-primary) 0%, var(--aeris-secondary) 100%);
}

.aeris-gradient-warm {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

.aeris-gradient-cool {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
}

.aeris-gradient-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
}

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

/* ========================================
   SHADOW UTILITIES
======================================== */
.aeris-shadow-soft {
    box-shadow: var(--md-elevation-2);
}

.aeris-shadow-medium {
    box-shadow: var(--md-elevation-2);
}

.aeris-shadow-large {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.aeris-shadow-glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.aeris-shadow-glow-purple {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

/* ========================================
   MD3 BUTTON SYSTEM
======================================== */

/* MATERIA Geometric Button System - Bold & Angular */
.md-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    min-height: 48px;
    padding: 12px 32px;
    border: none;
    text-decoration: none;
    font-family: inherit;
    font-size: var(--md-typescale-label-large-font-size);
    line-height: var(--md-typescale-label-large-line-height);
    font-weight: 600;  /* Bold text */
    letter-spacing: 0.5px;  /* More spacing */
    text-transform: uppercase;  /* All caps */
    border-radius: var(--md-shape-corner-none);  /* Sharp edges */
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--md-motion-duration-short2) var(--md-motion-easing-emphasized);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: 8px 0px 0px 8px; /* Simplified from clip-path polygon */
}

.md-btn:disabled,
.md-btn[disabled] {
    pointer-events: none;
    opacity: var(--md-state-disabled-opacity);
}

.md-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--md-motion-duration-medium2) var(--md-motion-easing-emphasized);
}

.md-btn:hover::before {
    left: 100%;
}

/* Filled Button - Aggressive Styling */
.md-btn-filled {
    background: linear-gradient(135deg, 
        var(--md-sys-color-primary) 0%, 
        color-mix(in srgb, var(--md-sys-color-primary) 80%, black 20%) 100%);
    color: var(--md-sys-color-on-primary);
    box-shadow: 
        4px 4px 0 var(--md-sys-color-primary-container),
        var(--md-elevation-2);
    border-bottom: 3px solid color-mix(in srgb, var(--md-sys-color-primary) 60%, black 40%);
}

.md-btn-filled:hover {
    transform: translateY(-2px) translateX(-2px);
    box-shadow: 
        6px 6px 0 var(--md-sys-color-primary-container),
        var(--md-elevation-4);
}

.md-btn-filled:active {
    transform: translateY(1px) translateX(1px);
    box-shadow: 
        2px 2px 0 var(--md-sys-color-primary-container),
        var(--md-elevation-1);
}

/* Outlined Button - Sharp & Bold */
.md-btn-outlined {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    border: 3px solid var(--md-sys-color-primary);
    position: relative;
}

.md-btn-outlined::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    bottom: -3px;
    left: -3px;
    border: 2px solid var(--md-sys-color-tertiary);
    opacity: 0;
    transition: opacity var(--md-motion-duration-short4) var(--md-motion-easing-emphasized);
}

.md-btn-outlined:hover {
    background: var(--md-sys-color-primary-container);
    transform: scale(1.05);
}

.md-btn-outlined:hover::after {
    opacity: 1;
}

/* Text Button - Geometric Underline */
.md-btn-text {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    padding: 12px 16px;
    position: relative;
}

.md-btn-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--md-sys-color-primary) 0%, 
        var(--md-sys-color-tertiary) 100%);
    transition: width var(--md-motion-duration-medium1) var(--md-motion-easing-emphasized-decelerate);
}

.md-btn-text:hover::after {
    width: 100%;
}

/* Tonal Button - Layered Effect */
.md-btn-tonal {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    position: relative;
    border-right: 4px solid var(--md-sys-color-secondary);
    border-bottom: 4px solid var(--md-sys-color-secondary);
}

.md-btn-tonal::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 0;
    bottom: 0;
    background: color-mix(in srgb, var(--md-sys-color-secondary-container) 90%, var(--md-sys-color-secondary) 10%);
    z-index: -1;
    transition: all var(--md-motion-duration-short4) var(--md-motion-easing-emphasized);
}

.md-btn-tonal:hover::before {
    top: 0;
    left: 0;
    background: var(--md-sys-color-secondary-container);
}

/* FAB (Floating Action Button) */
.md-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: var(--md-shape-corner-large);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    box-shadow: var(--md-elevation-3);
    cursor: pointer;
    transition: box-shadow var(--md-motion-duration-short2) var(--md-motion-easing-standard);
}

.md-fab:hover {
    box-shadow: var(--md-elevation-4);
}

.md-fab-large {
    width: 96px;
    height: 96px;
    border-radius: var(--md-shape-corner-extra-large);
}

.md-fab-small {
    width: 40px;
    height: 40px;
    border-radius: var(--md-shape-corner-medium);
}

/* Legacy Button Support - MATERIA Geometric Style */
.aeris-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    min-height: 48px;
    padding: 12px 32px;
    border: none;
    text-decoration: none;
    font-family: inherit;
    font-size: var(--md-typescale-label-large-font-size);
    line-height: var(--md-typescale-label-large-line-height);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: var(--md-shape-corner-none);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 8px 0px 0px 8px; /* Simplified from clip-path polygon */
    transition: all var(--md-motion-duration-short2) var(--md-motion-easing-emphasized);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background: linear-gradient(135deg, 
        var(--md-sys-color-primary) 0%, 
        color-mix(in srgb, var(--md-sys-color-primary) 80%, black 20%) 100%);
    color: var(--md-sys-color-on-primary);
    box-shadow: 
        4px 4px 0 var(--md-sys-color-primary-container),
        var(--md-elevation-2);
    border-bottom: 3px solid color-mix(in srgb, var(--md-sys-color-primary) 60%, black 40%);
}

.aeris-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--md-motion-duration-medium2) var(--md-motion-easing-emphasized);
}

.aeris-btn:hover {
    transform: translateY(-2px) translateX(-2px);
    box-shadow: 
        6px 6px 0 var(--md-sys-color-primary-container),
        var(--md-elevation-4);
}

.aeris-btn:hover::before {
    left: 100%;
}

.aeris-btn-primary {
    background: linear-gradient(135deg, 
        var(--md-sys-color-primary) 0%, 
        color-mix(in srgb, var(--md-sys-color-primary) 80%, black 20%) 100%);
    color: var(--md-sys-color-on-primary);
}

.aeris-btn-secondary {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border-right: 4px solid var(--md-sys-color-secondary);
    border-bottom: 4px solid var(--md-sys-color-secondary);
    box-shadow: 4px 4px 0 var(--md-sys-color-secondary-container);
}

.aeris-btn-ghost {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    border: 3px solid var(--md-sys-color-primary);
    box-shadow: none;
}

.aeris-btn-ghost:hover {
    background: var(--md-sys-color-primary-container);
    transform: scale(1.05) translateY(-1px);
}

/* ========================================
   MD3 FORM ELEMENTS
======================================== */

/* Outlined Text Field */
.md-text-field {
    position: relative;
    width: 100%;
}

.md-text-field-input {
    width: 100%;
    height: 56px;
    padding: 16px;
    background-color: transparent;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-corner-extra-small);
    font-family: inherit;
    font-size: var(--md-typescale-body-large-font-size);
    line-height: var(--md-typescale-body-large-line-height);
    color: var(--md-sys-color-on-surface);
    transition: border-color var(--md-motion-duration-short4) var(--md-motion-easing-standard),
                outline var(--md-motion-duration-short4) var(--md-motion-easing-standard);
    outline: none;
}

.md-text-field-input:focus {
    border-color: var(--md-sys-color-primary);
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: -1px;
}

.md-text-field-input:disabled {
    border-color: color-mix(in srgb, var(--md-sys-color-on-surface) var(--md-state-disabled-container-opacity), transparent);
    color: color-mix(in srgb, var(--md-sys-color-on-surface) var(--md-state-disabled-opacity), transparent);
    background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 0.04, transparent);
}

.md-text-field-input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
    opacity: 1;
}

/* Filled Text Field */
.md-text-field-filled .md-text-field-input {
    background-color: var(--md-sys-color-surface-container-highest);
    border: none;
    border-bottom: 1px solid var(--md-sys-color-on-surface-variant);
    border-radius: var(--md-shape-corner-extra-small) var(--md-shape-corner-extra-small) 0 0;
}

.md-text-field-filled .md-text-field-input:focus {
    border-bottom: 2px solid var(--md-sys-color-primary);
    outline: none;
}

/* Textarea */
.md-textarea {
    min-height: 120px;
    resize: vertical;
    padding-top: 16px;
    padding-bottom: 16px;
}

/* Select Field */
.md-select {
    position: relative;
}

.md-select-input {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 48px;
}

/* Checkbox */
.md-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.md-checkbox-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.md-checkbox-box {
    width: 18px;
    height: 18px;
    border: 2px solid var(--md-sys-color-on-surface-variant);
    border-radius: 2px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--md-motion-duration-short2) var(--md-motion-easing-standard);
}

.md-checkbox-input:checked + .md-checkbox-box {
    background-color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}

.md-checkbox-input:checked + .md-checkbox-box::after {
    content: '✓';
    color: var(--md-sys-color-on-primary);
    font-size: 12px;
    font-weight: bold;
}

.md-checkbox-input:disabled + .md-checkbox-box {
    border-color: color-mix(in srgb, var(--md-sys-color-on-surface) var(--md-state-disabled-opacity), transparent);
    background-color: transparent;
}

/* Radio Button */
.md-radio {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.md-radio-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.md-radio-circle {
    width: 20px;
    height: 20px;
    border: 2px solid var(--md-sys-color-on-surface-variant);
    border-radius: 50%;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--md-motion-duration-short2) var(--md-motion-easing-standard);
}

.md-radio-input:checked + .md-radio-circle {
    border-color: var(--md-sys-color-primary);
}

.md-radio-input:checked + .md-radio-circle::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--md-sys-color-primary);
}

.md-radio-input:disabled + .md-radio-circle {
    border-color: color-mix(in srgb, var(--md-sys-color-on-surface) var(--md-state-disabled-opacity), transparent);
}

/* Legacy Form Support (converted to MD3) */
.aeris-input {
    width: 100%;
    height: 56px;
    padding: 16px;
    background-color: transparent;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-corner-extra-small);
    font-family: inherit;
    font-size: var(--md-typescale-body-large-font-size);
    line-height: var(--md-typescale-body-large-line-height);
    color: var(--md-sys-color-on-surface);
    transition: border-color var(--md-motion-duration-short4) var(--md-motion-easing-standard),
                outline var(--md-motion-duration-short4) var(--md-motion-easing-standard);
    outline: none;
}

.aeris-input:focus {
    border-color: var(--md-sys-color-primary);
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: -1px;
}

.aeris-textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    padding: 16px;
    background-color: transparent;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-corner-extra-small);
    font-family: inherit;
    font-size: var(--md-typescale-body-large-font-size);
    line-height: var(--md-typescale-body-large-line-height);
    color: var(--md-sys-color-on-surface);
    transition: border-color var(--md-motion-duration-short4) var(--md-motion-easing-standard),
                outline var(--md-motion-duration-short4) var(--md-motion-easing-standard);
    outline: none;
}

.aeris-textarea:focus {
    border-color: var(--md-sys-color-primary);
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: -1px;
}

.aeris-select {
    width: 100%;
    height: 56px;
    padding: 16px;
    padding-right: 48px;
    background-color: transparent;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-corner-extra-small);
    font-family: inherit;
    font-size: var(--md-typescale-body-large-font-size);
    line-height: var(--md-typescale-body-large-line-height);
    color: var(--md-sys-color-on-surface);
    transition: border-color var(--md-motion-duration-short4) var(--md-motion-easing-standard),
                outline var(--md-motion-duration-short4) var(--md-motion-easing-standard);
    outline: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 20px;
}

.aeris-select:focus {
    border-color: var(--md-sys-color-primary);
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: -1px;
}

/* ========================================
   MD3 CARD SYSTEM
======================================== */

/* MATERIA Geometric Card System - Bold & Dramatic */
.md-card {
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-shape-corner-none);
    padding: 24px;
    position: relative;
    overflow: visible;
    border-left: 8px solid var(--md-sys-color-primary);
    border-bottom: 4px solid var(--md-sys-color-outline);
    border-radius: 16px 0px 0px 16px; /* Simplified from clip-path polygon */
    transition: all var(--md-motion-duration-medium2) var(--md-motion-easing-emphasized);
}

.md-card::before {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--md-sys-color-tertiary);
    /* Removed unnecessary clip-path for cleaner design */
    z-index: 1;
}

.md-card::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 0 12px;
    border-color: transparent transparent transparent var(--md-sys-color-secondary);
}

/* Elevated Card - Stacked Effect */
.md-card-elevated {
    background: var(--md-sys-color-surface-container-low);
    box-shadow: 
        8px 8px 0 var(--md-sys-color-primary-container),
        16px 16px 0 var(--md-sys-color-tertiary-container),
        var(--md-elevation-3);
    transform: translateZ(0);
}

.md-card-elevated:hover {
    transform: translateY(-4px) translateX(-4px);
    box-shadow: 
        12px 12px 0 var(--md-sys-color-primary-container),
        20px 20px 0 var(--md-sys-color-tertiary-container),
        var(--md-elevation-5);
}

/* Filled Card - Bold Borders */
.md-card-filled {
    background: var(--md-sys-color-surface-container-highest);
    border: 4px solid var(--md-sys-color-primary);
    position: relative;
}

.md-card-filled::before {
    background: var(--md-sys-color-primary);
    width: 24px;
    height: 24px;
}

.md-card-filled::after {
    border-width: 16px 0 0 16px;
    border-color: transparent transparent transparent var(--md-sys-color-primary);
}

/* Outlined Card - Double Border */
.md-card-outlined {
    background: var(--md-sys-color-surface);
    border: 3px solid var(--md-sys-color-outline);
    position: relative;
}

.md-card-outlined::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 2px solid var(--md-sys-color-tertiary);
    pointer-events: none;
    border-radius: 12px 0px 0px 12px; /* Simplified from clip-path polygon */
}

/* Interactive Card States - Aggressive Animations */
.md-card-interactive {
    cursor: pointer;
    transition: all var(--md-motion-duration-short4) var(--md-motion-easing-emphasized);
}

.md-card-interactive:hover {
    transform: translateY(-3px);
    border-left-width: 12px;
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.15),
        var(--md-elevation-4);
}

.md-card-interactive:hover::before {
    width: 28px;
    height: 28px;
    background: var(--md-sys-color-secondary);
}

.md-card-interactive.md-card-elevated:hover {
    transform: translateY(-3px);
}

.md-card-interactive:focus {
    outline: none;
}

.md-card-interactive:focus-visible {
    outline: 4px solid var(--md-sys-color-primary);
    outline-offset: 4px;
}

.md-card-interactive:active {
    transform: translateY(-2px) scale(0.98);
    border-left-width: 6px;
}

/* Card Content Areas */
.md-card-header {
    margin-bottom: 16px;
}

.md-card-title {
    font-size: var(--md-typescale-headline-small-font-size);
    line-height: var(--md-typescale-headline-small-line-height);
    font-weight: var(--md-typescale-headline-small-font-weight);
    letter-spacing: var(--md-typescale-headline-small-letter-spacing);
    color: var(--md-sys-color-on-surface);
    margin: 0 0 8px 0;
}

.md-card-subtitle {
    font-size: var(--md-typescale-title-medium-font-size);
    line-height: var(--md-typescale-title-medium-line-height);
    font-weight: var(--md-typescale-title-medium-font-weight);
    letter-spacing: var(--md-typescale-title-medium-letter-spacing);
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
}

.md-card-content {
    font-size: var(--md-typescale-body-medium-font-size);
    line-height: var(--md-typescale-body-medium-line-height);
    font-weight: var(--md-typescale-body-medium-font-weight);
    letter-spacing: var(--md-typescale-body-medium-letter-spacing);
    color: var(--md-sys-color-on-surface-variant);
}

.md-card-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.md-card-media {
    margin: -16px -16px 16px -16px;
    border-radius: var(--md-shape-corner-medium) var(--md-shape-corner-medium) 0 0;
    overflow: hidden;
}

.md-card-media img {
    width: 100%;
    height: auto;
    display: block;
}

/* Legacy Card Support - MATERIA Geometric Style */
.aeris-card {
    background: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-shape-corner-none);
    padding: 24px;
    position: relative;
    overflow: visible;
    border-left: 8px solid var(--md-sys-color-primary);
    border-bottom: 4px solid var(--md-sys-color-outline);
    border-radius: 16px 0px 0px 16px; /* Simplified from clip-path polygon */
    transition: all var(--md-motion-duration-medium2) var(--md-motion-easing-emphasized);
    box-shadow: 
        8px 8px 0 var(--md-sys-color-primary-container),
        var(--md-elevation-2);
}

.aeris-card::before {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--md-sys-color-tertiary);
    /* Removed unnecessary clip-path for cleaner design */
    z-index: 1;
}

.aeris-card-hover {
    cursor: pointer;
    transition: all var(--md-motion-duration-short4) var(--md-motion-easing-emphasized);
}

.aeris-card-hover:hover {
    transform: translateY(-3px);
    border-left-width: 12px;
    box-shadow: 
        12px 12px 0 var(--md-sys-color-primary-container),
        0 12px 24px rgba(0, 0, 0, 0.15),
        var(--md-elevation-4);
}

.aeris-card-hover:hover::before {
    width: 28px;
    height: 28px;
    background: var(--md-sys-color-secondary);
}

.aeris-card-hover:focus {
    outline: none;
}

.aeris-card-hover:focus-visible {
    outline: 4px solid var(--md-sys-color-primary);
    outline-offset: 4px;
}

.aeris-card-hover:active {
    transform: translateY(-2px) scale(0.98);
    border-left-width: 6px;
    box-shadow: 
        6px 6px 0 var(--md-sys-color-primary-container),
        var(--md-elevation-1);
}

/* ========================================
   ANIMATIONS
======================================== */
/* MD3 Motion Keyframes */
@keyframes md-fade-in {
    0% { 
        opacity: 0; 
        transform: translateY(16px);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0);
    }
}

@keyframes md-fade-out {
    0% { 
        opacity: 1; 
        transform: translateY(0);
    }
    100% { 
        opacity: 0; 
        transform: translateY(-8px);
    }
}

@keyframes md-slide-in-right {
    0% { 
        opacity: 0; 
        transform: translateX(24px);
    }
    100% { 
        opacity: 1; 
        transform: translateX(0);
    }
}

@keyframes md-slide-in-left {
    0% { 
        opacity: 0; 
        transform: translateX(-24px);
    }
    100% { 
        opacity: 1; 
        transform: translateX(0);
    }
}

@keyframes md-scale-in {
    0% { 
        opacity: 0; 
        transform: scale(0.8);
    }
    100% { 
        opacity: 1; 
        transform: scale(1);
    }
}

@keyframes md-shimmer {
    0% { 
        transform: translateX(-100%);
    }
    100% { 
        transform: translateX(100%);
    }
}

@keyframes md-pulse {
    0%, 100% { 
        opacity: 1;
    }
    50% { 
        opacity: 0.6;
    }
}

@keyframes md-bounce {
    0%, 100% { 
        transform: translateY(0);
        animation-timing-function: var(--md-motion-easing-standard);
    }
    50% { 
        transform: translateY(-8px);
        animation-timing-function: var(--md-motion-easing-standard);
    }
}

/* MD3 Animation Classes */
.md-animate-fade-in {
    animation: md-fade-in var(--md-motion-duration-medium4) var(--md-motion-easing-emphasized-decelerate);
}

.md-animate-fade-out {
    animation: md-fade-out var(--md-motion-duration-short4) var(--md-motion-easing-emphasized-accelerate);
}

.md-animate-slide-in-right {
    animation: md-slide-in-right var(--md-motion-duration-medium2) var(--md-motion-easing-emphasized-decelerate);
}

.md-animate-slide-in-left {
    animation: md-slide-in-left var(--md-motion-duration-medium2) var(--md-motion-easing-emphasized-decelerate);
}

.md-animate-scale-in {
    animation: md-scale-in var(--md-motion-duration-medium1) var(--md-motion-easing-emphasized-decelerate);
}

.md-animate-pulse {
    animation: md-pulse var(--md-motion-duration-long4) var(--md-motion-easing-linear) infinite;
}

.md-animate-bounce {
    animation: md-bounce var(--md-motion-duration-long2) var(--md-motion-easing-emphasized) infinite;
}

/* Legacy Animation Support (converted to MD3) */
.aeris-float {
    animation: md-bounce var(--md-motion-duration-long2) var(--md-motion-easing-emphasized) infinite;
}

.aeris-float-delayed {
    animation: md-bounce var(--md-motion-duration-long2) var(--md-motion-easing-emphasized) infinite;
    animation-delay: var(--md-motion-duration-long2);
}

.aeris-animate-in {
    animation: md-fade-in var(--md-motion-duration-medium4) var(--md-motion-easing-emphasized-decelerate);
}

.aeris-animate-slide-in {
    animation: md-slide-in-right var(--md-motion-duration-medium2) var(--md-motion-easing-emphasized-decelerate);
}

.aeris-pulse-slow {
    animation: md-pulse var(--md-motion-duration-long4) var(--md-motion-easing-linear) infinite;
}

/* MD3 Loading States */
.md-loading {
    position: relative;
    overflow: hidden;
    pointer-events: none;
    opacity: var(--md-state-disabled-opacity);
}

.md-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        color-mix(in srgb, var(--md-sys-color-on-surface) 0.1, transparent),
        transparent
    );
    animation: md-shimmer var(--md-motion-duration-long3) var(--md-motion-easing-linear) infinite;
    z-index: 1;
    transform: translateX(-100%);
}

/* MD3 Shape Utilities */
.md-shape-none {
    border-radius: var(--md-shape-corner-none);
}

.md-shape-extra-small {
    border-radius: var(--md-shape-corner-extra-small);
}

.md-shape-small {
    border-radius: var(--md-shape-corner-small);
}

.md-shape-medium {
    border-radius: var(--md-shape-corner-medium);
}

.md-shape-large {
    border-radius: var(--md-shape-corner-large);
}

.md-shape-extra-large {
    border-radius: var(--md-shape-corner-extra-large);
}

.md-shape-full {
    border-radius: var(--md-shape-corner-full);
}

/* Legacy Loading Support */
.aeris-loading {
    position: relative;
    overflow: hidden;
    pointer-events: none;
    opacity: var(--md-state-disabled-opacity);
}

.aeris-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        color-mix(in srgb, var(--md-sys-color-on-surface) 0.1, transparent),
        transparent
    );
    animation: md-shimmer var(--md-motion-duration-long3) var(--md-motion-easing-linear) infinite;
    z-index: 1;
    transform: translateX(-100%);
}

/* ========================================
   MD3 TYPOGRAPHY SYSTEM
======================================== */

/* Display Type Scale */
.md-typescale-display-large {
    font-size: var(--md-typescale-display-large-font-size);
    line-height: var(--md-typescale-display-large-line-height);
    font-weight: var(--md-typescale-display-large-font-weight);
    letter-spacing: var(--md-typescale-display-large-letter-spacing);
}

.md-typescale-display-medium {
    font-size: var(--md-typescale-display-medium-font-size);
    line-height: var(--md-typescale-display-medium-line-height);
    font-weight: var(--md-typescale-display-medium-font-weight);
    letter-spacing: var(--md-typescale-display-medium-letter-spacing);
}

.md-typescale-display-small {
    font-size: var(--md-typescale-display-small-font-size);
    line-height: var(--md-typescale-display-small-line-height);
    font-weight: var(--md-typescale-display-small-font-weight);
    letter-spacing: var(--md-typescale-display-small-letter-spacing);
}

/* Headline Type Scale */
.md-typescale-headline-large {
    font-size: var(--md-typescale-headline-large-font-size);
    line-height: var(--md-typescale-headline-large-line-height);
    font-weight: var(--md-typescale-headline-large-font-weight);
    letter-spacing: var(--md-typescale-headline-large-letter-spacing);
}

.md-typescale-headline-medium {
    font-size: var(--md-typescale-headline-medium-font-size);
    line-height: var(--md-typescale-headline-medium-line-height);
    font-weight: var(--md-typescale-headline-medium-font-weight);
    letter-spacing: var(--md-typescale-headline-medium-letter-spacing);
}

.md-typescale-headline-small {
    font-size: var(--md-typescale-headline-small-font-size);
    line-height: var(--md-typescale-headline-small-line-height);
    font-weight: var(--md-typescale-headline-small-font-weight);
    letter-spacing: var(--md-typescale-headline-small-letter-spacing);
}

/* Title Type Scale */
.md-typescale-title-large {
    font-size: var(--md-typescale-title-large-font-size);
    line-height: var(--md-typescale-title-large-line-height);
    font-weight: var(--md-typescale-title-large-font-weight);
    letter-spacing: var(--md-typescale-title-large-letter-spacing);
}

.md-typescale-title-medium {
    font-size: var(--md-typescale-title-medium-font-size);
    line-height: var(--md-typescale-title-medium-line-height);
    font-weight: var(--md-typescale-title-medium-font-weight);
    letter-spacing: var(--md-typescale-title-medium-letter-spacing);
}

.md-typescale-title-small {
    font-size: var(--md-typescale-title-small-font-size);
    line-height: var(--md-typescale-title-small-line-height);
    font-weight: var(--md-typescale-title-small-font-weight);
    letter-spacing: var(--md-typescale-title-small-letter-spacing);
}

/* Body Type Scale */
.md-typescale-body-large {
    font-size: var(--md-typescale-body-large-font-size);
    line-height: var(--md-typescale-body-large-line-height);
    font-weight: var(--md-typescale-body-large-font-weight);
    letter-spacing: var(--md-typescale-body-large-letter-spacing);
}

.md-typescale-body-medium {
    font-size: var(--md-typescale-body-medium-font-size);
    line-height: var(--md-typescale-body-medium-line-height);
    font-weight: var(--md-typescale-body-medium-font-weight);
    letter-spacing: var(--md-typescale-body-medium-letter-spacing);
}

.md-typescale-body-small {
    font-size: var(--md-typescale-body-small-font-size);
    line-height: var(--md-typescale-body-small-line-height);
    font-weight: var(--md-typescale-body-small-font-weight);
    letter-spacing: var(--md-typescale-body-small-letter-spacing);
}

/* Label Type Scale */
.md-typescale-label-large {
    font-size: var(--md-typescale-label-large-font-size);
    line-height: var(--md-typescale-label-large-line-height);
    font-weight: var(--md-typescale-label-large-font-weight);
    letter-spacing: var(--md-typescale-label-large-letter-spacing);
}

.md-typescale-label-medium {
    font-size: var(--md-typescale-label-medium-font-size);
    line-height: var(--md-typescale-label-medium-line-height);
    font-weight: var(--md-typescale-label-medium-font-weight);
    letter-spacing: var(--md-typescale-label-medium-letter-spacing);
}

.md-typescale-label-small {
    font-size: var(--md-typescale-label-small-font-size);
    line-height: var(--md-typescale-label-small-line-height);
    font-weight: var(--md-typescale-label-small-font-weight);
    letter-spacing: var(--md-typescale-label-small-letter-spacing);
}

/* Responsive Typography */
@media (max-width: 640px) {
    .md-typescale-display-large {
        font-size: clamp(36px, 8vw, var(--md-typescale-display-large-font-size));
        line-height: clamp(44px, 9vw, var(--md-typescale-display-large-line-height));
    }
    
    .md-typescale-display-medium {
        font-size: clamp(32px, 7vw, var(--md-typescale-display-medium-font-size));
        line-height: clamp(40px, 8vw, var(--md-typescale-display-medium-line-height));
    }
    
    .md-typescale-display-small {
        font-size: clamp(28px, 6vw, var(--md-typescale-display-small-font-size));
        line-height: clamp(36px, 7vw, var(--md-typescale-display-small-line-height));
    }
    
    .md-typescale-headline-large {
        font-size: clamp(24px, 5vw, var(--md-typescale-headline-large-font-size));
        line-height: clamp(32px, 6vw, var(--md-typescale-headline-large-line-height));
    }
}

/* Legacy Typography Support (converted to MD3) */
.aeris-heading {
    font-size: var(--md-typescale-headline-medium-font-size);
    line-height: var(--md-typescale-headline-medium-line-height);
    font-weight: var(--md-typescale-headline-medium-font-weight);
    letter-spacing: var(--md-typescale-headline-medium-letter-spacing);
}

.aeris-heading-lg {
    font-size: var(--md-typescale-display-medium-font-size);
    line-height: var(--md-typescale-display-medium-line-height);
    font-weight: var(--md-typescale-display-medium-font-weight);
    letter-spacing: var(--md-typescale-display-medium-letter-spacing);
}

.aeris-heading-md {
    font-size: var(--md-typescale-headline-large-font-size);
    line-height: var(--md-typescale-headline-large-line-height);
    font-weight: var(--md-typescale-headline-large-font-weight);
    letter-spacing: var(--md-typescale-headline-large-letter-spacing);
}

.aeris-heading-sm {
    font-size: var(--md-typescale-headline-medium-font-size);
    line-height: var(--md-typescale-headline-medium-line-height);
    font-weight: var(--md-typescale-headline-medium-font-weight);
    letter-spacing: var(--md-typescale-headline-medium-letter-spacing);
}

.aeris-body-lg {
    font-size: var(--md-typescale-body-large-font-size);
    line-height: var(--md-typescale-body-large-line-height);
    font-weight: var(--md-typescale-body-large-font-weight);
    letter-spacing: var(--md-typescale-body-large-letter-spacing);
}

.aeris-body {
    font-size: var(--md-typescale-body-medium-font-size);
    line-height: var(--md-typescale-body-medium-line-height);
    font-weight: var(--md-typescale-body-medium-font-weight);
    letter-spacing: var(--md-typescale-body-medium-letter-spacing);
}

.aeris-body-sm {
    font-size: var(--md-typescale-body-small-font-size);
    line-height: var(--md-typescale-body-small-line-height);
    font-weight: var(--md-typescale-body-small-font-weight);
    letter-spacing: var(--md-typescale-body-small-letter-spacing);
}

/* ========================================
   PROSE STYLING (CONSOLIDATED)
======================================== */
.prose {
    color: #374151;
    max-width: none;
}

.prose-lg {
    font-size: 1.125rem;
    line-height: 1.7;
}

.prose-xl {
    font-size: 1.25rem;
    line-height: 1.8;
}

.prose-gray {
    color: #374151;
}

.prose h1, 
.prose h2, 
.prose h3, 
.prose h4, 
.prose h5, 
.prose h6 {
    color: #1f2937;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.025em;
    margin-top: 0;
}

.prose h1 { 
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.prose h2 { 
    font-size: 1.875rem;
    margin-bottom: 1.25rem;
    font-weight: 400;
}

.prose h3 { 
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.prose h4 { 
    font-size: 1.25rem;
    margin-bottom: 0.875rem;
    font-weight: 500;
}

.prose h5 { 
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.prose h6 { 
    font-size: 1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prose p {
    color: #4b5563;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

.prose p:last-child {
    margin-bottom: 0;
}

.prose .lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 1.5rem;
}

.prose ul, 
.prose ol {
    color: #4b5563;
    margin-bottom: 1.25rem;
    padding-left: 1.625rem;
}

.prose ul {
    list-style-type: none;
    position: relative;
}

.prose ul > li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.5rem;
    line-height: 1.75;
}

.prose ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.8125rem;
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background-color: #3b82f6;
}

.prose ol {
    counter-reset: list-counter;
}

.prose ol > li {
    position: relative;
    counter-increment: list-counter;
    padding-left: 1.75rem;
    margin-bottom: 0.5rem;
    line-height: 1.75;
}

.prose ol > li::before {
    content: counter(list-counter);
    position: absolute;
    left: 0;
    top: 0;
    color: #3b82f6;
    font-weight: 600;
    font-size: 0.875rem;
}

.prose ul ul, 
.prose ul ol, 
.prose ol ul, 
.prose ol ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.prose ul ul > li::before {
    background-color: #6b7280;
    width: 0.25rem;
    height: 0.25rem;
}

.prose strong {
    color: #1f2937;
    font-weight: 600;
}

.prose em {
    color: #4b5563;
    font-style: italic;
}

.prose mark {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.prose small {
    font-size: 0.875rem;
    color: #6b7280;
}

.prose a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
    border-bottom: 1px solid transparent;
}

.prose a:hover {
    color: #1d4ed8;
    border-bottom-color: #3b82f6;
}

.prose a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 0.125rem;
}

.prose blockquote {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 0.75rem 0.75rem 0;
    font-style: italic;
    position: relative;
}

.prose blockquote::before {
    content: '"';
    position: absolute;
    top: 0.5rem;
    left: -0.5rem;
    font-size: 3rem;
    color: #3b82f6;
    font-family: Georgia, serif;
    opacity: 0.3;
}

.prose blockquote p {
    color: inherit;
    margin-bottom: 0;
}

.prose blockquote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
    font-style: normal;
}

.prose blockquote cite::before {
    content: '— ';
}

.prose code {
    background: #f3f4f6;
    color: #1f2937;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-weight: 500;
}

.prose pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.7;
}

.prose pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.prose hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d1d5db, transparent);
    margin: 2rem 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
}

.prose thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.prose th {
    border: 1px solid #e5e7eb;
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prose td {
    border: 1px solid #e5e7eb;
    padding: 0.875rem 1rem;
    color: #4b5563;
    line-height: 1.5;
}

.prose tbody tr:nth-child(even) {
    background: #f9fafb;
}

.prose tbody tr:hover {
    background: #f3f4f6;
}

.prose img {
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
}

.prose figure {
    margin: 1.5rem 0;
}

.prose figcaption {
    color: #6b7280;
    font-size: 0.875rem;
    text-align: center;
    margin-top: 0.75rem;
    font-style: italic;
}

.prose video {
    border-radius: 0.75rem;
    margin: 1.5rem 0;
}

.prose dl {
    margin: 1.5rem 0;
}

.prose dt {
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.prose dd {
    color: #4b5563;
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #e5e7eb;
}

.prose address {
    color: #4b5563;
    font-style: normal;
    line-height: 1.75;
    margin: 1.5rem 0;
}

.prose kbd {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    font-family: inherit;
    color: #374151;
    box-shadow: inset 0 -1px 0 #d1d5db;
}

.prose .callout {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

.prose .callout.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: #3b82f6;
}

.prose .callout.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left-color: #10b981;
}

.prose .callout.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left-color: #f59e0b;
}

.prose .callout.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left-color: #ef4444;
}

.prose .property-highlight {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.prose .property-feature {
    display: flex;
    align-items: flex-start;
    margin: 1rem 0;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
}

.prose .property-feature::before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
    margin-right: 0.75rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .prose {
        font-size: 1rem;
    }
    
    .prose h1 { font-size: 1.875rem; }
    .prose h2 { font-size: 1.5rem; }
    .prose h3 { font-size: 1.25rem; }
    .prose h4 { font-size: 1.125rem; }
    .prose h5 { font-size: 1rem; }
    .prose h6 { font-size: 0.875rem; }
    
    .prose blockquote {
        margin-left: 0;
        margin-right: 0;
        padding: 1rem;
    }
    
    .prose table {
        font-size: 0.875rem;
    }
    
    .prose th,
    .prose td {
        padding: 0.5rem 0.75rem;
    }
}

@media (prefers-color-scheme: dark) {
    .prose {
        color: #d1d5db;
    }
    
    .prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
        color: #f9fafb;
    }
    
    .prose p {
        color: #d1d5db;
    }
    
    .prose strong {
        color: #f9fafb;
    }
    
    .prose a {
        color: #60a5fa;
    }
    
    .prose a:hover {
        color: #93c5fd;
    }
    
    .prose code {
        background: #374151;
        color: #f9fafb;
    }
    
    .prose blockquote {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
        color: #dbeafe;
        border-left-color: #60a5fa;
    }
}

/* ========================================
   MD3 SCROLLBAR CUSTOMIZATION
======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background-color: var(--md-sys-color-surface-variant);
    border-radius: var(--md-shape-corner-extra-small);
}

::-webkit-scrollbar-thumb {
    background-color: var(--md-sys-color-outline);
    border-radius: var(--md-shape-corner-extra-small);
    transition: background-color var(--md-motion-duration-short2) var(--md-motion-easing-standard);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--md-sys-color-on-surface-variant);
}

::-webkit-scrollbar-thumb:active {
    background-color: var(--md-sys-color-primary);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--md-sys-color-outline) var(--md-sys-color-surface-variant);
}

/* ========================================
   MD3 TEXT SELECTION
======================================== */
::selection {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 0.24, transparent);
    color: inherit;
}

::-moz-selection {
    background-color: color-mix(in srgb, var(--md-sys-color-primary) 0.24, transparent);
    color: inherit;
}

/* ========================================
   MD3 FOCUS STYLES
======================================== */
:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
    border-radius: var(--md-shape-corner-extra-small);
}

.md-focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) var(--md-state-focus-opacity), transparent);
}

/* Legacy Focus Support */
.aeris-focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) var(--md-state-focus-opacity), transparent);
}

/* ========================================
   UTILITY CLASSES
======================================== */
.aeris-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;
}

.aeris-hover-lift {
    transition: all var(--transition-normal);
}

.aeris-hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.aeris-hover-scale {
    transition: all var(--transition-normal);
}

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

/* ========================================
   RESPONSIVE UTILITIES
======================================== */
@media (max-width: 640px) {
    .aeris-mobile-full {
        width: 100%;
        border-radius: 0;
    }
    
    .aeris-mobile-padding {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .aeris-no-print {
        display: none !important;
    }
    
    .aeris-print-only {
        display: block !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* ========================================
   MD3 HIGH CONTRAST MODE SUPPORT
======================================== */
@media (prefers-contrast: high) {
    :root {
        --md-sys-color-outline: #000000;
        --md-sys-color-outline-variant: #000000;
    }
    
    .md-surface,
    .md-card,
    .aeris-glass,
    .aeris-glass-dark,
    .aeris-glass-strong,
    .aeris-card {
        background-color: var(--md-sys-color-surface) !important;
        border: 2px solid var(--md-sys-color-outline) !important;
        box-shadow: none !important;
    }
    
    .md-btn,
    .aeris-btn {
        border: 2px solid var(--md-sys-color-outline) !important;
    }
}

/* ========================================
   REDUCED MOTION SUPPORT
======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto !important;
    }
    
    a[href^="#"] {
        scroll-behavior: smooth !important;
    }
}

/* ========================================
   ASPECT RATIOS (for older browser support)
======================================== */
.aeris-aspect-video {
    position: relative;
    padding-bottom: 56.25%;
}

.aeris-aspect-square {
    position: relative;
    padding-bottom: 100%;
}

.aeris-aspect-photo {
    position: relative;
    padding-bottom: 75%;
}

.aeris-aspect-video > *,
.aeris-aspect-square > *,
.aeris-aspect-photo > * {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    object-fit: cover;
}

/* ========================================
   MATERIA SLIDESHOW COMPONENT - Refined Design
======================================== */

/* Base slideshow container */
.materia-slideshow {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: var(--md-sys-color-surface-container);
}

/* Header protection zone */
.materia-slideshow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    pointer-events: none;
    z-index: 99;
    background: transparent;
}

/* Individual slides */
.materia-slide {
    position: absolute;
    inset: 0;
    transition: all var(--md-motion-duration-long2, 500ms) var(--md-motion-easing-emphasized, ease-out);
    pointer-events: none;
}

/* Content area */
.materia-slide-content {
    position: relative;
    z-index: 20;
    min-height: 100vh;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.materia-slide-content * {
    pointer-events: auto;
}

/* Clean slideshow styles - no extra styling needed for new refined design */

/* Interactive elements should capture clicks */
.materia-slide a,
.materia-slide button,
.materia-slide-btn,
.materia-slide-nav {
    pointer-events: auto;
}

/* Responsive design */
@media (max-width: 640px) {
    .materia-slideshow::before {
        height: 64px;
    }
    
    .materia-slide-nav {
        padding: 0.75rem;
    }
    
    .materia-slide-nav.prev {
        left: 0.5rem;
    }
    
    .materia-slide-nav.next {
        right: 0.5rem;
    }
    
    .materia-slide-counter {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem 0.75rem;
    }
    
    .materia-slide-geometric {
        display: none;
    }
}

/* ========================================
   MATERIA DARK MODE ENHANCEMENTS
======================================== */

/* Enhanced glow effects for dark mode */
.md-surface:hover {
    filter: var(--materia-dark-cut-glow);
}

/* Dark mode specific button enhancements */
.md-button:hover {
    box-shadow: 
        0 0 20px var(--materia-dark-glow),
        var(--md-elevation-3);
}

/* Enhanced geometric elements with glow */
.materia-geometric-accent {
    filter: var(--materia-dark-cut-glow);
    transition: filter var(--md-motion-duration-medium2) var(--md-motion-easing-standard);
}

/* Dark mode text enhancement */
h1, h2, h3, h4, h5, h6 {
    text-shadow: 0 2px 4px var(--materia-dark-shadow);
}

/* Enhanced focus states for dark mode */
*:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--materia-dark-glow);
}

/* Dark mode card enhancements */
.card, .md-card {
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    box-shadow: 
        0 8px 32px var(--materia-dark-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card:hover, .md-card:hover {
    border-color: var(--md-sys-color-primary);
    box-shadow: 
        0 12px 40px var(--materia-dark-shadow),
        0 0 20px var(--materia-dark-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Enhanced dropdown menus for dark mode */
.dropdown-menu, [role="menu"] {
    background: var(--md-sys-color-surface-container-highest);
    border: 2px solid var(--md-sys-color-outline);
    box-shadow: 
        0 16px 48px var(--materia-dark-shadow),
        0 0 16px var(--materia-dark-glow);
}

/* Dark mode form field enhancements */
.md-textfield:focus-within {
    box-shadow: 
        0 0 0 2px var(--md-sys-color-primary),
        0 0 16px var(--materia-dark-glow);
}

/* Enhanced mobile menu for dark mode */
#mobile-menu {
    backdrop-filter: blur(20px);
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid var(--md-sys-color-outline-variant);
}

/* Dark mode image overlays */
img {
    filter: brightness(0.9) contrast(1.1);
}

/* Enhanced scrollbar for dark mode */
::-webkit-scrollbar {
    width: 12px;
    background: var(--md-sys-color-surface-container-low);
}

::-webkit-scrollbar-thumb {
    background: var(--md-sys-color-primary);
    border-radius: 6px;
    border: 2px solid var(--md-sys-color-surface-container-low);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--md-sys-color-primary-container);
    box-shadow: 0 0 8px var(--materia-dark-glow);
}

/* Dark mode selection colors */
::selection {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

::-moz-selection {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

/* Enhanced loading states for dark mode */
.loading, .skeleton {
    background: linear-gradient(
        90deg,
        var(--md-sys-color-surface-container) 0%,
        var(--md-sys-color-surface-container-high) 50%,
        var(--md-sys-color-surface-container) 100%
    );
    background-size: 200% 100%;
    animation: dark-shimmer 2s infinite ease-in-out;
}

@keyframes dark-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Enhanced tooltips for dark mode */
.tooltip, [data-tooltip] {
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline);
    box-shadow: 
        0 8px 24px var(--materia-dark-shadow),
        0 0 12px var(--materia-dark-glow);
}

/* ========================================
   AERIS-STYLE GLASS MORPHISM
======================================== */

/* Glass morphism utilities */
.materia-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.materia-glass-dark {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.7);
}

.materia-glass-strong {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Enhanced surface with glass effect */
.md-surface-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 12px 0px 0px 12px; /* Simplified from clip-path cut-corner */
    border-left: 4px solid var(--md-sys-color-primary);
}

.md-surface-glass:hover {
    border-left-width: 6px;
    transform: translateY(-2px);
    box-shadow: 
        6px 6px 0 var(--md-sys-color-primary-container),
        var(--glass-shadow),
        0 0 20px var(--materia-dark-glow);
}

/* Aeris-style gradient utilities */
.materia-gradient-primary {
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, var(--md-sys-color-secondary) 100%);
}

.materia-gradient-warm {
    background: linear-gradient(135deg, #fbbf24 0%, #f87171 100%);
}

.materia-gradient-cool {
    background: linear-gradient(135deg, #22d3ee 0%, #60a5fa 100%);
}

.materia-gradient-purple {
    background: linear-gradient(135deg, #a855f7 0%, #c084fc 100%);
}

.materia-text-gradient {
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, var(--md-sys-color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   CRITICAL TEXT READABILITY FIXES
   Force white text on dark theme
========================================== */

/* Ensure all body text is white */
body {
    color: var(--md-sys-color-on-surface) !important;
    background-color: var(--md-sys-color-background) !important;
}

/* Force white text for all common text elements */
h1, h2, h3, h4, h5, h6 {
    color: var(--md-sys-color-on-surface) !important;
    text-shadow: var(--materia-text-shadow);
}

p, span, div, li, td, th {
    color: var(--md-sys-color-on-surface) !important;
}

/* Fix prose elements specifically */
.prose {
    color: var(--md-sys-color-on-surface) !important;
}

.prose h1, 
.prose h2, 
.prose h3, 
.prose h4, 
.prose h5, 
.prose h6 {
    color: var(--md-sys-color-on-surface) !important;
    text-shadow: var(--materia-text-shadow);
}

.prose p {
    color: var(--md-sys-color-on-surface) !important;
    text-shadow: var(--materia-text-shadow);
}

.prose strong {
    color: var(--md-sys-color-primary) !important;
    font-weight: 600;
}

.prose a {
    color: var(--md-sys-color-secondary) !important;
    text-decoration: none;
}

.prose a:hover {
    color: var(--md-sys-color-tertiary) !important;
    text-decoration: underline;
}

.prose li {
    color: var(--md-sys-color-on-surface) !important;
    text-shadow: var(--materia-text-shadow);
}

.prose ul > li::before {
    background-color: var(--md-sys-color-primary) !important;
}

.prose ol > li::before {
    color: var(--md-sys-color-primary) !important;
}

.prose blockquote {
    color: var(--md-sys-color-on-surface-variant) !important;
    border-left-color: var(--md-sys-color-secondary) !important;
}

.prose code {
    color: var(--md-sys-color-on-surface) !important;
    background-color: var(--md-sys-color-surface-container-high) !important;
}

.prose pre {
    background-color: var(--md-sys-color-surface-container-highest) !important;
    color: var(--md-sys-color-on-surface) !important;
}

.prose table th {
    color: var(--md-sys-color-on-surface) !important;
    background-color: var(--md-sys-color-surface-container-high) !important;
}

.prose table td {
    color: var(--md-sys-color-on-surface) !important;
    background-color: var(--md-sys-color-surface-container) !important;
}

/* Fix any remaining dark text */
.text-gray-900,
.text-gray-800,
.text-gray-700,
.text-gray-600,
.text-slate-900,
.text-slate-800,
.text-slate-700,
.text-zinc-900,
.text-zinc-800,
.text-zinc-700 {
    color: var(--md-sys-color-on-surface) !important;
}

/* Ensure secondary text is light gray, not dark */
.text-gray-500,
.text-gray-400,
.text-slate-500,
.text-slate-400,
.text-zinc-500,
.text-zinc-400 {
    color: var(--md-sys-color-on-surface-variant) !important;
}

/* Fix any hardcoded dark colors */
* {
    color: inherit;
}

/* Specific fixes for components that might have dark text */
.page-block,
.content-area,
.article-content,
.blog-content,
.post-content,
.body-content {
    color: var(--md-sys-color-on-surface) !important;
}

/* Fix any Alpine.js or dynamic content */
[x-data] {
    color: var(--md-sys-color-on-surface);
}

/* Ensure readability in all states */
.opacity-75 {
    color: var(--md-sys-color-on-surface-variant) !important;
}

.opacity-50 {
    color: var(--md-sys-color-on-surface-variant) !important;
    opacity: 0.7 !important;
}
