/* Dhaher Labs — Unified Design System v3.0 */
:root {
  --bg: #141517;
  --bg-surface: #1c1d20;
  --bg-elevated: #24262b;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-hover: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 40px;
  --accent: #60a5fa;
  --accent-dim: #3b82f6;
  --accent-muted: rgba(96, 165, 250, 0.15);
  --accent-light: rgba(96, 165, 250, 0.25);
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;
  --purple: #a78bfa;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --focus-ring: 0 0 0 3px rgba(96, 165, 250, 0.35);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --bg-surface: #f1f5f9;
    --bg-elevated: #e2e8f0;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-hover: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);
    --accent: #2563eb;
    --accent-dim: #1d4ed8;
    --accent-muted: rgba(37, 99, 235, 0.1);
    --accent-light: rgba(37, 99, 235, 0.2);
    --text: #0f172a;
    --text-dim: #475569;
    --text-muted: #94a3b8;
    --success: #16a34a;
    --warning: #d97706;
    --error: #dc2626;
    --purple: #7c3aed;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle at 20% 30%, rgba(96, 165, 250, 0.03) 0%, transparent 40%),
              radial-gradient(circle at 80% 70%, rgba(167, 139, 250, 0.03) 0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

.glass {
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 2rem;
  transition: background 0.3s var(--ease-out), transform 0.2s var(--ease-out);
}

.glass:hover { background: var(--glass-hover); }

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

/* SKIP TO CONTENT */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border-radius: 0 0 8px 8px;
  font-size: 0.85rem;
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* HEADER / NAV */
header {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand { font-size: 1.05rem; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { color: var(--accent); }

.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-decoration: none;
  position: relative;
  padding: 0.25rem 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s var(--ease-out);
}
.nav-links a:hover::after, .nav-links a:focus-visible::after { width: 100%; }
.nav-links a:hover { color: var(--accent); }

/* BREADCRUMBS */
.breadcrumbs {
  padding: 0.75rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { color: var(--text-dim); }

/* FOOTER */
footer {
  border-top: 1px solid var(--glass-border);
  padding: 2rem 0;
  margin-top: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* TYPOGRAPHY */
h1 { font-size: 2rem; font-weight: 600; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.75rem; color: var(--text); }
.subtitle { color: var(--text-dim); margin-bottom: 2rem; }

/* STATUS BADGES */
.system-status {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

.status-active {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.status-production {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.status-research {
  background: rgba(167, 139, 250, 0.12);
  color: var(--purple);
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.status-planning {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.status-dual {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(167, 139, 250, 0.12));
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
}
.btn-primary:hover {
  background: var(--accent-dim);
  color: white;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--glass);
  color: var(--text-dim);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  color: var(--accent);
  background: var(--accent-muted);
}

/* PROJECT / SYSTEM CARDS */
.card {
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.25s var(--ease-out);
}
.card:hover {
  background: var(--glass-hover);
  transform: translateY(-2px);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); }

.card-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.card-tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* SECTION LAYOUTS */
.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.section-desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.section { padding: 3rem 0; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* SCORE BADGE */
.score {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.score.perfect { background: rgba(52, 211, 153, 0.15); color: var(--success); border: 1px solid rgba(52, 211, 153, 0.25); }
.score.good { background: rgba(251, 191, 36, 0.15); color: var(--warning); border: 1px solid rgba(251, 191, 36, 0.25); }
.score.low { background: rgba(248, 113, 113, 0.15); color: var(--error); border: 1px solid rgba(248, 113, 113, 0.25); }

/* FILTER BAR */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  font-family: var(--font-sans);
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* SEARCH */
.search-box { max-width: 400px; margin: 0 auto 1.5rem; }
.search-box input {
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  outline: none;
}
.search-box input:focus { border-color: var(--accent); }
.search-box input::placeholder { color: var(--text-muted); }

/* CHIPS */
.chip-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.chip { font-size: 0.75rem; padding: 0.25rem 0.65rem; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 6px; color: var(--text-dim); }

/* LINK BAR */
.link-bar { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* METRIC ROW */
.metric-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.metric { text-align: center; }
.metric .val { font-size: 1.3rem; font-weight: 600; color: var(--accent); font-family: var(--font-mono); }
.metric .lbl { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

/* STATUS DOT */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.3rem; }
.status-dot.green { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.purple { background: var(--purple); }

/* ANIMATIONS */
.fade-in { animation: fadeIn 0.5s var(--ease-out) both; }
.fade-in-up { animation: fadeInUp 0.5s var(--ease-out) both; }
.slide-in { animation: slideIn 0.4s var(--ease-out) both; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }

/* SKELETON LOADING */
.skeleton {
  background: linear-gradient(90deg, var(--glass) 25%, var(--glass-hover) 50%, var(--glass) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
.skeleton-text { height: 1rem; margin-bottom: 0.5rem; width: 80%; }
.skeleton-block { height: 120px; width: 100%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* PERFORMANCE */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  .container { padding: 0 1.25rem; }
  nav { flex-direction: column; gap: 0.5rem; }
  .nav-links { gap: 1rem; font-size: 0.82rem; flex-wrap: wrap; justify-content: center; }
  .project-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
