/**
 * DLP Core Styles v3.0
 * High-contrast, learning-focused design system
 * Copyright © 2025-2026 Holistic Quality LLC
 */

/* =============================================
   CSS CUSTOM PROPERTIES - DESIGN TOKENS
   ============================================= */
:root {
  /* Background hierarchy - darker = more important container */
  --bg-deepest: #050505;
  --bg-deep: #09090b;
  --bg-base: #0f0f11;
  --bg-elevated: #151517;
  --bg-surface: #1a1a1d;
  --bg-overlay: rgba(5, 5, 5, 0.95);

  /* Text hierarchy - brighter = more important */
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Accent colors - pillar palette (vibrant for dark bg) */
  --p1-scale: #60a5fa;       /* Blue - brighter */
  --p2-emergence: #4ade80;   /* Green - brighter */
  --p3-systems: #f87171;     /* Red - brighter */
  --p4-energy: #fbbf24;      /* Yellow/Orange */
  --p5-uncertainty: #c084fc; /* Purple - brighter */
  --p6-information: #2dd4bf; /* Teal - brighter */
  --p7-time: #fb923c;        /* Orange */
  --p8-consciousness: #a78bfa; /* Violet */

  /* Semantic colors */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Interactive states */
  --focus-ring: rgba(96, 165, 250, 0.5);
  --hover-overlay: rgba(255, 255, 255, 0.05);
  --active-overlay: rgba(255, 255, 255, 0.1);

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

  /* 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: 2rem;
  --text-4xl: 2.5rem;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows - subtle glows for dark theme */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* =============================================
   BASE RESET & DEFAULTS
   ============================================= */
*, *::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;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 0 0 8px 8px;
  z-index: 10000;
  text-decoration: none;
  font-size: 0.9rem;
}
.skip-link:focus {
  top: 0;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text-secondary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle background texture */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(16, 185, 129, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: -1;
}

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

h1 { font-size: var(--text-4xl); margin-bottom: var(--space-lg); }
h2 { font-size: var(--text-3xl); margin-bottom: var(--space-md); }
h3 { font-size: var(--text-2xl); margin-bottom: var(--space-md); }
h4 { font-size: var(--text-xl); margin-bottom: var(--space-sm); }

p {
  margin-bottom: var(--space-md);
  max-width: 65ch; /* Optimal reading width */
}

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

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

a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* =============================================
   UNIFIED NAVIGATION (used across all pages)
   ============================================= */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.nav .logo {
    font-weight: 800;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #10b981, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav .nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav .nav-links > a, .nav-dropdown > a {
    color: #94a3b8;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav .nav-links > a:hover, .nav-dropdown > a:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.05);
}

.nav-dropdown { position: relative; }

.nav-dropdown-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #111113;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.nav-dropdown:hover .nav-dropdown-content {
    opacity: 1;
    visibility: visible;
}

.nav-dropdown-content a {
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
}

.nav-dropdown-content a:hover {
    background: rgba(255,255,255,0.05);
    color: #ffffff;
}

.nav-cta {
    background: linear-gradient(135deg, #10b981, #3498db) !important;
    color: white !important;
}

.nav-cta:hover {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
    transform: scale(1.02);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(9, 9, 11, 0.98);
        backdrop-filter: blur(20px);
        padding: 0.5rem 1rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        gap: 0;
    }
    .nav .nav-links.open { display: flex; }
    .nav .nav-links > a, .nav-dropdown > a {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    .nav-dropdown-content {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none;
        box-shadow: none;
        background: rgba(255,255,255,0.03);
        border: none;
        padding: 0 0 0 1rem;
        min-width: 0;
    }
    .nav-dropdown.open > .nav-dropdown-content { display: block; }
    .nav-dropdown:hover .nav-dropdown-content { display: none; }
    .nav-dropdown.open:hover .nav-dropdown-content { display: block; }
    .mobile-menu-btn { display: block; }
    .nav-inner { padding: 0.75rem 1rem; }
}

/* =============================================
   UNIFIED FOOTER (used across all pages)
   ============================================= */
.unified-footer {
    background: #050505;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}
.unified-footer .footer-inner { max-width: 1200px; margin: 0 auto; }
.unified-footer .footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; margin-bottom: 3rem; }
.unified-footer .footer-col h4 { color: #fff; font-size: 0.9rem; margin-bottom: 1rem; }
.unified-footer .footer-col a { display: block; color: #94a3b8; text-decoration: none; font-size: 0.85rem; padding: 0.3rem 0; }
.unified-footer .footer-col a:hover { color: #10b981; }
.unified-footer .footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.05); font-size: 0.8rem; color: #64748b; flex-wrap: wrap; gap: 1rem; }
.unified-footer .footer-bottom a { color: #94a3b8; text-decoration: none; }
.unified-footer .footer-bottom a:hover { color: #10b981; }

/* =============================================
   HQ ECOSYSTEM WIDGET
   ============================================= */
.hq-widget{position:fixed;bottom:20px;right:20px;z-index:9999;font-family:'Inter','Segoe UI',system-ui,-apple-system,sans-serif}
.hq-widget-btn{width:50px;height:50px;border-radius:50%;background:#12121a;border:1px solid rgba(255,255,255,0.1);cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 20px rgba(0,0,0,0.4);transition:all 0.3s}
.hq-widget-btn:hover{transform:scale(1.05);border-color:rgba(16,185,129,0.5)}
.hq-widget-btn svg{width:28px;height:28px}
.hq-dropdown{position:absolute;bottom:60px;right:0;width:280px;background:#12121a;border:1px solid rgba(255,255,255,0.1);border-radius:12px;opacity:0;visibility:hidden;transform:translateY(10px);transition:all 0.2s;box-shadow:0 8px 30px rgba(0,0,0,0.5)}
.hq-widget.active .hq-dropdown{opacity:1;visibility:visible;transform:translateY(0)}
.hq-dropdown-header{padding:1rem;border-bottom:1px solid rgba(255,255,255,0.1);display:flex;align-items:center;gap:0.5rem}
.hq-dropdown-header svg{width:20px;height:20px}
.hq-dropdown-header span{font-weight:600;font-size:0.9rem;color:#e8e8f0}
.hq-dropdown-links{padding:0.5rem}
.hq-dropdown a{display:flex;align-items:center;gap:0.75rem;padding:0.65rem 0.75rem;border-radius:8px;color:#9ca3b8;text-decoration:none;font-size:0.85rem;transition:all 0.15s}
.hq-dropdown a:hover{background:rgba(255,255,255,0.05);color:#e8e8f0}
.hq-dropdown a.current{background:rgba(16,185,129,0.1);color:#10b981}
.hq-dropdown .icon{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:1rem}
.hq-dropdown .icon.cgs{background:rgba(59,130,246,0.15)}
.hq-dropdown .icon.dlp{background:rgba(139,92,246,0.15)}
.hq-dropdown .icon.gdn{background:rgba(16,185,129,0.15)}
.hq-dropdown .icon.research{background:rgba(239,68,68,0.15)}
.hq-dropdown .icon.hq{background:rgba(251,191,36,0.15)}
.hq-dropdown .info{display:flex;flex-direction:column}
.hq-dropdown .name{color:#e8e8f0;font-weight:500}
.hq-dropdown .desc{font-size:0.75rem;color:#6b7280}
.hq-dropdown-footer{padding:0.75rem 1rem;border-top:1px solid rgba(255,255,255,0.1);text-align:center;font-size:0.75rem;color:#fbbf24}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
  body {
    background: white;
    color: black;
  }

  .nav,
  .hq-widget,
  .unified-footer {
    display: none;
  }
}
