/**
 * Chorui LLC - Main Theme Stylesheet
 * Responsive, Accessible, Semantic Design System with Dual Light/Dark Modes
 */

/* ==========================================================================
   1. CSS Custom Properties / Design Tokens
   ========================================================================== */
:root, [data-theme="light"] {
  --color-scheme: light;
  
  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-muted: #f1f5f9;
  
  /* Borders */
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #0d9488;
  
  /* Typography Colors */
  --text-primary: #0f172a;        /* Deep Slate / Navy */
  --text-secondary: #334155;      /* Slate */
  --text-muted: #64748b;          /* Cool Gray */
  --text-inverse: #ffffff;
  
  /* Accent Colors (Navy & Teal) */
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --navy-700: #334155;
  
  --accent-teal: #0d9488;         /* Primary Action Teal */
  --accent-teal-hover: #0f766e;
  --accent-teal-light: #14b8a6;
  --accent-teal-subtle: #f0fdfa;  /* Pale Ice Teal */
  --accent-teal-glow: rgba(13, 148, 136, 0.15);
  
  /* UI Elements */
  --header-bg: rgba(255, 255, 255, 0.95);
  --header-border: #e2e8f0;
  --footer-bg: #0f172a;
  --footer-text: #f8fafc;
  --footer-muted: #94a3b8;
  --footer-border: #1e293b;
  
  /* Shadows & Elevation */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  
  /* Hero Gradients */
  --hero-gradient: linear-gradient(135deg, #f8fafc 0%, #f0fdfa 100%);
  --badge-bg: #e6fffa;
  --badge-text: #0d9488;
}

[data-theme="dark"] {
  --color-scheme: dark;
  
  /* Backgrounds */
  --bg-primary: #0b1120;          /* Deepest Midnight Navy */
  --bg-secondary: #0f172a;        /* Navy Slate */
  --bg-surface: #1e293b;          /* Elevated Navy Surface */
  --bg-surface-elevated: #334155;
  --bg-card: #151f32;
  --bg-muted: #1e293b;
  
  /* Borders */
  --border-color: #27354f;
  --border-subtle: #1e293b;
  --border-focus: #14b8a6;
  
  /* Typography Colors */
  --text-primary: #f8fafc;        /* Crisp Bright White */
  --text-secondary: #cbd5e1;      /* Silvery Slate */
  --text-muted: #94a3b8;          /* Medium Silver */
  --text-inverse: #0f172a;
  
  /* Accent Colors (Bright Electric Teal for Dark Mode) */
  --navy-900: #0b1120;
  --navy-800: #0f172a;
  --navy-700: #1e293b;
  
  --accent-teal: #14b8a6;         /* Electric Teal */
  --accent-teal-hover: #2dd4bf;
  --accent-teal-light: #5eead4;
  --accent-teal-subtle: rgba(20, 184, 166, 0.12);
  --accent-teal-glow: rgba(20, 184, 166, 0.25);
  
  /* UI Elements */
  --header-bg: rgba(11, 17, 32, 0.95);
  --header-border: #1e293b;
  --footer-bg: #070c18;
  --footer-text: #f8fafc;
  --footer-muted: #94a3b8;
  --footer-border: #1e293b;
  
  /* Shadows & Elevation */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  
  /* Hero Gradients */
  --hero-gradient: linear-gradient(135deg, #0b1120 0%, #0f1f33 100%);
  --badge-bg: rgba(20, 184, 166, 0.15);
  --badge-text: #2dd4bf;
}

/* ==========================================================================
   2. Reset & Base Typography
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text-primary);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

/* Skip link for Accessibility */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 1.5rem;
  background: var(--accent-teal);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.5rem 0.5rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s ease;
}
.skip-to-content:focus {
  top: 0;
}

/* Heading Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.65;
}

a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

img, svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style-position: inside;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   3. Layout & Container Utilities
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

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

.section {
  padding: 5rem 0;
}

.section-secondary {
  background-color: var(--bg-secondary);
}

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

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

/* ==========================================================================
   4. Site Header & Top Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-topbar {
  background-color: var(--navy-900);
  color: #f8fafc;
  font-size: 0.85rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topbar-contact a {
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 1.25rem;
}
.topbar-contact a:hover {
  color: var(--accent-teal-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.75rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo {
  height: 40px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
}

.brand-descriptor {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-teal);
}

/* Nav Menu */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
}

.nav-link {
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  padding: 0.4rem 0.2rem;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-teal);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-teal);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: 0.375rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* ==========================================================================
   5. Site Footer
   ========================================================================== */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  border-top: 1px solid var(--footer-border);
  margin-top: auto;
  padding: 4.5rem 0 2rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.footer-about p {
  color: var(--footer-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.footer-nav {
  list-style: none;
  margin: 0;
}

.footer-nav li {
  margin-bottom: 0.75rem;
}

.footer-nav a {
  color: var(--footer-muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--accent-teal-light);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  color: var(--footer-muted);
  font-size: 0.95rem;
}

.footer-contact-item a {
  color: #f8fafc;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--footer-muted);
}

.footer-legal-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
}

.footer-legal-links a {
  color: var(--footer-muted);
}
.footer-legal-links a:hover {
  color: var(--accent-teal-light);
}

/* ==========================================================================
   6. Responsive Breakpoints
   ========================================================================== */
@media (max-width: 991px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }
  
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    box-shadow: var(--shadow-lg);
  }
  
  .main-nav.is-open {
    display: flex;
  }
  
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .topbar-content {
    justify-content: center;
  }
}
