/* LIBRARY Design System — library.gagegreengroup.com
 * Single source of truth for all pages.
 * DM Sans + JetBrains Mono | Light theme | Fortune 100 grade
 */

/* ─── Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800;9..40,900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── Custom Properties — Crystalline Light ─── */
:root {
  --bg: #fff;
  --bg-subtle: #fafbfc;
  --bg-skeleton: #f3f4f6;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-hover: rgba(255, 255, 255, 0.88);
  --text: #1a1a2e;
  --text-muted: #64748b;
  --text-lighter: #64748b;
  --text-faint: #94a3b8;
  --text-ghost: #cbd5e1;
  --accent: #1a1a2e;
  --accent-soft: rgba(26, 26, 46, 0.06);
  --border: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.04);
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
  --shadow-hover: 0 2px 8px rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.04);
  --shadow-glass: 0 1px 2px rgba(0,0,0,0.03), 0 8px 24px rgba(0,0,0,0.02), inset 0 1px 0 rgba(255,255,255,0.6);
  --header-h: 52px;
  --blur: 20px;
}

/* ─── Reset ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html { font-family: 'DM Sans', -apple-system, sans-serif; }
body { background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; font-weight: 300; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ─── Typography ─── */
.mono { font-family: 'JetBrains Mono', monospace; }

.h1 { font-size: 72px; font-weight: 900; letter-spacing: -0.04em; text-transform: uppercase; line-height: 1; }
.h2 { font-size: 32px; font-weight: 900; letter-spacing: -0.02em; text-transform: uppercase; }
.h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.h4 { font-size: 14px; font-weight: 700; }

.label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-lighter);
}
.data-num {
  font-size: 32px; font-weight: 900;
  letter-spacing: -0.02em; color: var(--text);
}

/* ─── Header ─── */
.lib-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg-glass); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--border);
  padding: 0 24px; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
}
.lib-header .logo {
  font-size: 11px; font-weight: 900;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.lib-header nav { display: flex; gap: 16px; }
.lib-header nav a {
  font-size: 11px; color: var(--text-lighter);
  padding: 14px 8px; min-height: 44px;
  display: inline-flex; align-items: center;
  transition: color 0.15s;
}
.lib-header nav a:hover { color: var(--text); }
.lib-header nav a.active { color: var(--text); font-weight: 600; }

.mobile-menu {
  display: none; cursor: pointer;
  padding: 8px 12px; border: 1px solid #1a1a2e;
  border-radius: var(--radius-sm); background: var(--bg);
  font-size: 18px; line-height: 1; color: #1a1a2e;
  min-height: 44px; min-width: 44px;
  align-items: center; justify-content: center;
}
.mobile-nav {
  display: none; position: fixed; top: var(--header-h);
  left: 0; right: 0; background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px; z-index: 99;
  flex-direction: column; gap: 12px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-size: 13px; color: #333;
  padding: 8px 0; border-bottom: 1px solid var(--bg-skeleton);
}

/* ─── Footer ─── */
.lib-footer {
  padding: 60px 24px; border-top: 1px solid var(--border-light);
  text-align: center;
}
.lib-footer p { font-size: 12px; color: var(--text-muted); line-height: 1.8; }

/* ─── Section Layout ─── */
.section { padding: 100px 24px; position: relative; }
.section-inner { max-width: 900px; margin: 0 auto; }
.section-alt {
  background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg) 100%);
}
/* ─── Prismatic Edge Refraction ─── */
.section::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(180,200,255,0.2) 25%, rgba(200,180,255,0.15) 50%, rgba(180,255,200,0.2) 75%, transparent 95%);
  pointer-events: none;
}

/* ─── Crystalline Dot Grid ─── */
.bg-dots {
  background-image: radial-gradient(circle, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}
.bg-grid {
  background-image:
    linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
}
.section-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-lighter);
}
.section-title {
  font-size: 32px; font-weight: 900;
  letter-spacing: -0.02em; margin-top: 4px;
}
.section-sub {
  font-size: 16px; color: #444;
  line-height: 1.7; max-width: 600px;
}

/* ─── Cards ─── */
.card {
  background: var(--bg-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-glass);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 8px;
}
.card-value {
  font-size: 32px; font-weight: 900;
  letter-spacing: -0.02em;
}
.card-sub { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* ─── Badges ─── */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 3px; font-size: 10px;
  font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-critical { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-high { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-gap { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.badge-present { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* ─── Tables ─── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-faint); padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.table td {
  font-size: 12px; padding: 8px 12px;
  border-bottom: 1px solid var(--bg-skeleton);
  color: var(--text-lighter);
}
.table tr:hover td { background: var(--bg-subtle); }

/* ─── Chips ─── */
.chip {
  min-height: 36px; display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600;
  text-transform: capitalize; letter-spacing: 0.01em;
  padding: 6px 16px; border: 1px solid #d0d0d0;
  border-radius: 20px; color: #222; cursor: pointer;
  transition: all 0.15s; background: var(--bg);
}
.chip:hover { border-color: #000; color: #000; }
.chip.active { border-color: #000; color: #fff; background: #000; }
.chip-dark { border-color: var(--text); color: var(--text); font-weight: 600; }

/* ─── Book Cards ─── */
.book-card {
  padding: 22px 20px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.book-card:hover {
  border-color: #000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}

/* ─── Search Box ─── */
.search-box {
  width: 100%; max-width: 620px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 18px;
  transition: all 0.2s;
}
.search-box:focus-within {
  border-color: var(--text);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.search-box input {
  flex: 1; background: none; border: none;
  outline: none; font-size: 15px; color: var(--text);
  min-height: 44px;
}
.search-box input::placeholder { color: var(--text-ghost); }
.search-box button {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--text); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.search-box button:hover { background: #333; }
.search-box button:disabled { opacity: 0.2; }

/* ─── Grids ─── */
.grid-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px; background: var(--border); padding: 1px;
}
.grid-kpi > .card { border-radius: 0; border: none; }

.grid-dept {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

/* ─── Loading Skeleton ─── */
.skeleton {
  background: var(--bg-skeleton);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 32px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 120px; border-radius: var(--radius); }
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Bar Charts ─── */
.bar { display: flex; gap: 1px; align-items: end; height: 60px; }
.bar-col {
  flex: 1; background: var(--border);
  border-radius: 2px 2px 0 0; min-width: 4px;
  transition: background 0.15s;
}
.bar-col:hover { background: var(--text); }

/* ─── Genome Properties ─── */
.genome-prop {
  display: flex; justify-content: space-between;
  align-items: center; padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.genome-prop-name { font-size: 12px; color: var(--text-muted); }
.genome-prop-value { font-size: 13px; font-weight: 600; }
.genome-bar-bg {
  width: 120px; height: 6px;
  background: var(--border-light);
  border-radius: 3px; overflow: hidden;
}
.genome-bar-fill { height: 6px; border-radius: 3px; transition: width 0.5s; }

/* ─── Utility Classes ─── */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.px-24 { padding-left: 24px; padding-right: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.w-full { width: 100%; }
.max-w-620 { max-width: 620px; }
.max-w-900 { max-width: 900px; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ─── Tablet ─── */
@media (max-width: 768px) {
  .h1 { font-size: 52px; }
  .section { padding: 60px 20px; }
  .section-inner { padding: 0 8px; }
  .grid-kpi { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

/* ─── Mobile ─── */
@media (max-width: 640px) {
  .h1 { font-size: 36px; letter-spacing: -0.03em; }
  .h2 { font-size: 24px; }
  .section { padding: 48px 16px; }
  .section-inner { padding: 0 4px; }
  .section-title { font-size: 24px !important; }
  .section-label { font-size: 10px !important; }
  .data-num { font-size: 24px; }
  .card-value { font-size: 24px; }

  .grid-dept { grid-template-columns: 1fr !important; gap: 6px !important; }
  .grid-kpi { grid-template-columns: 1fr 1fr; }

  .chip { font-size: 10px; padding: 4px 10px; min-height: 36px; }
  .search-box { padding: 10px 14px; border-radius: 12px; }
  .search-box input { font-size: 14px; min-height: 36px; }

  .table th, .table td { padding: 6px 8px; font-size: 11px; }

  .lib-header nav { display: none; }
  .mobile-menu { display: flex; }

  .lib-footer { padding: 40px 16px; }
  .lib-footer p { font-size: 11px; }
}

/* ─── Small Phone ─── */
@media (max-width: 380px) {
  .h1 { font-size: 28px; }
  .data-num { font-size: 18px; }
  .card-value { font-size: 20px; }
  .chip { font-size: 9px; padding: 3px 8px; }
  .grid-kpi { grid-template-columns: 1fr; }
}
