/* ═══════════════════════════════════════════════════════════════════════════
   ETHRAEON UNIVERSAL DESIGN SYSTEM (EUDS) v3.2 — PREMIUM FOUNDATION
   ═══════════════════════════════════════════════════════════════════════════
   
   Constitutional AI Orchestration Platform
   © 2025 S. Jason Prohaska (ingombrante©) — All Rights Reserved
   Schedule A+ Enhanced IP Firewall Protected
   
   HUMANITAS ANTE MACHINAM — Humanity Before the Machine
   
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   1. CSS RESET & FOUNDATION
   ───────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--euds-midnight);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────────
   2. CSS CUSTOM PROPERTIES — CONSTITUTIONAL DESIGN TOKENS
   ───────────────────────────────────────────────────────────────────────────── */
:root {
    /* ═══ PRIMARY PALETTE — Constitutional Depth ═══ */
    --euds-midnight: #0a0a0f;
    --euds-obsidian: #1a1a2e;
    --euds-slate: #2d2d44;
    --euds-storm: #4a4a6a;
    --euds-mist: #6a6a8a;
    
    /* ═══ ACCENT PALETTE — Constitutional Action ═══ */
    --euds-electric: #00d4ff;
    --euds-cyan: #00ffff;
    --euds-gold: #ffd700;
    --euds-warm-gold: #f4a460;
    --euds-violet: #8b5cf6;
    --euds-rose: #ff007f;
    --euds-teal: #008080;
    --euds-emerald: #50c878;
    --euds-crimson: #dc143c;
    
    /* ═══ SEMANTIC PALETTE — Status & Feedback ═══ */
    --euds-success: #00ff88;
    --euds-warning: #ffaa00;
    --euds-error: #ff4466;
    --euds-info: #4488ff;
    
    /* ═══ TEXT HIERARCHY ═══ */
    --text-primary: #f5f5f7;
    --text-secondary: rgba(245, 245, 247, 0.7);
    --text-tertiary: rgba(245, 245, 247, 0.5);
    --text-muted: rgba(245, 245, 247, 0.35);
    --text-disabled: rgba(245, 245, 247, 0.2);
    
    /* ═══ GLASS MORPHISM ═══ */
    --glass-bg: rgba(26, 26, 46, 0.7);
    --glass-bg-light: rgba(26, 26, 46, 0.5);
    --glass-bg-strong: rgba(26, 26, 46, 0.9);
    --glass-bg-hover: rgba(26, 26, 46, 0.85);
    --glass-border: rgba(0, 212, 255, 0.12);
    --glass-border-hover: rgba(0, 212, 255, 0.25);
    --glass-border-gold: rgba(255, 215, 0, 0.15);
    --glass-blur: blur(20px);
    --glass-blur-strong: blur(30px);
    
    /* ═══ SHADOWS ═══ */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(0, 212, 255, 0.15);
    --shadow-glow-strong: 0 0 60px rgba(0, 212, 255, 0.25);
    --shadow-gold-glow: 0 0 30px rgba(255, 215, 0, 0.1);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    
    /* ═══ SPACING SCALE (4px base) ═══ */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    
    /* ═══ TYPOGRAPHY SCALE ═══ */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    
    /* ═══ BORDER RADIUS ═══ */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* ═══ TRANSITIONS ═══ */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* ═══ Z-INDEX SCALE ═══ */
    --z-base: 0;
    --z-dropdown: 1000;
    --z-sticky: 1100;
    --z-fixed: 1200;
    --z-modal: 1400;
    --z-tooltip: 1600;
    --z-notification: 1700;
}

/* ─────────────────────────────────────────────────────────────────────────────
   3. ANIMATED BACKGROUND
   ───────────────────────────────────────────────────────────────────────────── */
.euds-bg-animated {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 100% 100% at 50% 100%, rgba(255, 215, 0, 0.03) 0%, transparent 50%),
        var(--euds-midnight);
    animation: bgPulse 20s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   4. TYPOGRAPHY
   ───────────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

.euds-display {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.euds-subtitle {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    font-weight: 400;
}

.euds-mono {
    font-family: 'JetBrains Mono', monospace;
}

.euds-serif {
    font-family: 'Crimson Text', Georgia, serif;
}

/* ─────────────────────────────────────────────────────────────────────────────
   5. GLASS MORPHISM COMPONENTS
   ───────────────────────────────────────────────────────────────────────────── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), var(--shadow-inset);
    transition: all var(--transition-base);
}

.glass-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    transform: translateY(-2px);
}

.glass-card-gold {
    border-color: var(--glass-border-gold);
}

.glass-card-gold:hover {
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: var(--shadow-xl), var(--shadow-gold-glow);
}

/* ─────────────────────────────────────────────────────────────────────────────
   6. NAVIGATION
   ───────────────────────────────────────────────────────────────────────────── */
.euds-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    padding: var(--space-4) var(--space-8);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
}

.euds-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.euds-nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: var(--text-lg);
}

.euds-nav-logo svg {
    width: 40px;
    height: 40px;
}

.euds-nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    list-style: none;
}

.euds-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.euds-nav-link:hover {
    color: var(--text-primary);
    background: rgba(0, 212, 255, 0.1);
}

.euds-nav-link.active {
    color: var(--euds-electric);
    background: rgba(0, 212, 255, 0.15);
}

/* ─────────────────────────────────────────────────────────────────────────────
   7. HERO SECTION
   ───────────────────────────────────────────────────────────────────────────── */
.euds-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-24) var(--space-8);
    position: relative;
}

.euds-hero-content {
    max-width: 900px;
}

.euds-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--euds-electric);
    margin-bottom: var(--space-6);
}

.euds-hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--euds-success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.euds-hero-title {
    margin-bottom: var(--space-6);
}

.euds-hero-title .gradient-text {
    background: linear-gradient(135deg, var(--euds-electric) 0%, var(--euds-cyan) 50%, var(--euds-violet) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.euds-hero-description {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto var(--space-8);
    line-height: 1.7;
}

/* ─────────────────────────────────────────────────────────────────────────────
   8. BUTTONS
   ───────────────────────────────────────────────────────────────────────────── */
.euds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
}

.euds-btn-primary {
    background: linear-gradient(135deg, var(--euds-electric) 0%, var(--euds-cyan) 100%);
    color: var(--euds-midnight);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.euds-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.4);
}

.euds-btn-secondary {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    color: var(--text-primary);
    backdrop-filter: var(--glass-blur);
}

.euds-btn-secondary:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.euds-btn-gold {
    background: linear-gradient(135deg, var(--euds-gold) 0%, var(--euds-warm-gold) 100%);
    color: var(--euds-midnight);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.euds-btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.4);
}

.euds-btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
}

/* ─────────────────────────────────────────────────────────────────────────────
   9. GRID & LAYOUT
   ───────────────────────────────────────────────────────────────────────────── */
.euds-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-8);
}

.euds-section {
    padding: var(--space-24) 0;
}

.euds-grid {
    display: grid;
    gap: var(--space-6);
}

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

@media (max-width: 1024px) {
    .euds-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .euds-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .euds-grid-4,
    .euds-grid-3,
    .euds-grid-2 { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   10. FEATURE CARDS
   ───────────────────────────────────────────────────────────────────────────── */
.euds-feature-card {
    padding: var(--space-8);
    position: relative;
    overflow: hidden;
}

.euds-feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
    font-size: var(--text-2xl);
}

.euds-feature-icon.gold {
    background: rgba(255, 215, 0, 0.1);
}

.euds-feature-icon.violet {
    background: rgba(139, 92, 246, 0.1);
}

.euds-feature-icon.emerald {
    background: rgba(80, 200, 120, 0.1);
}

.euds-feature-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.euds-feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ─────────────────────────────────────────────────────────────────────────────
   11. DASHBOARD TILES
   ───────────────────────────────────────────────────────────────────────────── */
.euds-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-6);
}

.euds-tile {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.euds-tile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.euds-tile-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: var(--text-xl);
}

.euds-tile-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--euds-success);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.euds-tile-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
}

.euds-tile-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.euds-tile-description {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    flex-grow: 1;
}

.euds-tile-footer {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.euds-tile-link {
    color: var(--euds-electric);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: all var(--transition-fast);
}

.euds-tile-link:hover {
    gap: var(--space-3);
}

/* ─────────────────────────────────────────────────────────────────────────────
   12. STATS & METRICS
   ───────────────────────────────────────────────────────────────────────────── */
.euds-stat {
    text-align: center;
    padding: var(--space-6);
}

.euds-stat-value {
    font-size: var(--text-4xl);
    font-weight: 700;
    background: linear-gradient(135deg, var(--euds-electric) 0%, var(--euds-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-2);
}

.euds-stat-label {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   13. BADGES & TAGS
   ───────────────────────────────────────────────────────────────────────────── */
.euds-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.euds-badge-electric {
    background: rgba(0, 212, 255, 0.15);
    color: var(--euds-electric);
}

.euds-badge-gold {
    background: rgba(255, 215, 0, 0.15);
    color: var(--euds-gold);
}

.euds-badge-success {
    background: rgba(0, 255, 136, 0.15);
    color: var(--euds-success);
}

.euds-badge-violet {
    background: rgba(139, 92, 246, 0.15);
    color: var(--euds-violet);
}

/* ─────────────────────────────────────────────────────────────────────────────
   14. FOOTER
   ───────────────────────────────────────────────────────────────────────────── */
.euds-footer {
    padding: var(--space-16) var(--space-8);
    background: rgba(10, 10, 15, 0.5);
    border-top: 1px solid var(--glass-border);
}

.euds-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-12);
}

@media (max-width: 768px) {
    .euds-footer-inner {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
}

.euds-footer-brand {
    max-width: 300px;
}

.euds-footer-tagline {
    margin-top: var(--space-4);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.euds-footer-tagline em {
    color: var(--euds-electric);
    font-style: normal;
}

.euds-footer-title {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.euds-footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.euds-footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.euds-footer-link:hover {
    color: var(--euds-electric);
}

.euds-footer-bottom {
    max-width: 1400px;
    margin: var(--space-12) auto 0;
    padding-top: var(--space-8);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.euds-footer-legal {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

/* ─────────────────────────────────────────────────────────────────────────────
   15. ANIMATIONS
   ───────────────────────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.2); }
    50% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.4); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* ─────────────────────────────────────────────────────────────────────────────
   16. UTILITIES
   ───────────────────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-electric { color: var(--euds-electric); }
.text-gold { color: var(--euds-gold); }
.text-violet { color: var(--euds-violet); }

.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-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

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

/* ─────────────────────────────────────────────────────────────────────────────
   17. CONSTITUTIONAL SIGILS
   ───────────────────────────────────────────────────────────────────────────── */
.sigil-trace::before { content: '⟁'; margin-right: var(--space-2); }
.sigil-consent::before { content: '🜄'; margin-right: var(--space-2); }
.sigil-governance::before { content: '▣'; margin-right: var(--space-2); }
.sigil-identity::before { content: 'Δ'; margin-right: var(--space-2); }

/* ─────────────────────────────────────────────────────────────────────────────
   END OF EUDS v3.2 PREMIUM
   ═══════════════════════════════════════════════════════════════════════════ */
