:root,
[data-theme="dark"] {
  --bg-canvas: #090d14;
  --bg-surface: #0f1622;
  --bg-elevated: #151e2e;
  --bg-glass: rgba(15, 22, 34, 0.84);
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(45, 212, 191, 0.35);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-emerald: #2dd4bf;
  --accent-emerald-bg: rgba(45, 212, 191, 0.12);
  --accent-violet: #a78bfa;
  --accent-violet-bg: rgba(167, 139, 250, 0.14);
  --accent-amber: #fbbf24;
  --accent-amber-bg: rgba(251, 191, 36, 0.14);
  --accent-cyan: #38bdf8;
  --accent-cyan-bg: rgba(56, 189, 248, 0.14);
  --shadow-card: 0 14px 34px -10px rgba(0, 0, 0, 0.55);
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg-canvas: #f6f5f0;
  --bg-surface: #ffffff;
  --bg-elevated: #efede6;
  --bg-glass: rgba(246, 245, 240, 0.88);
  --border-subtle: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(13, 148, 136, 0.45);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-emerald: #0f766e;
  --accent-emerald-bg: rgba(15, 118, 110, 0.1);
  --accent-violet: #5b21b6;
  --accent-violet-bg: rgba(91, 33, 182, 0.1);
  --accent-amber: #b45309;
  --accent-amber-bg: rgba(180, 83, 9, 0.1);
  --accent-cyan: #0369a1;
  --accent-cyan-bg: rgba(3, 105, 161, 0.1);
  --shadow-card: 0 10px 28px -8px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

/* Scroll Progress Indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan), var(--accent-violet));
  transform-origin: 0% 50%;
  transform: scaleX(0);
  z-index: 200;
}

/* Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 12px var(--accent-emerald);
}

.brand-text {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 0.98rem;
}

.brand-mono {
  font-family: var(--font-mono);
  color: var(--accent-emerald);
  font-weight: 500;
}

.brand-edition {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.18s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent-emerald);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.btn-ghost:hover {
  border-color: var(--accent-emerald);
}

/* Main Layout Containers */
.hero-section,
.blueprint-section,
.pk-section,
.lexicon-section {
  max-width: 1360px;
  margin: 0 auto;
  padding: 4.5rem 1.75rem;
}

.hero-section {
  padding-top: 3.75rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-emerald {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border: 1px solid rgba(45, 212, 191, 0.3);
}

.badge-violet {
  background: var(--accent-violet-bg);
  color: var(--accent-violet);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.badge-amber {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-cyan {
  background: var(--accent-cyan-bg);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.mono-tag,
.mono-label,
.mono-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.mono-eyebrow {
  display: block;
  color: var(--accent-emerald);
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 4.5vw, 4.3rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.hero-title em {
  font-style: italic;
  color: var(--accent-emerald);
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 60ch;
  margin: 0 0 1.85rem;
  text-wrap: pretty;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 2.4rem;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.35rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.btn-primary {
  background: var(--accent-emerald);
  color: #042f2e;
}

[data-theme="light"] .btn-primary {
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--accent-emerald);
  transform: translateY(-2px);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem;
}

.metric-card dt {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.metric-card dd.mono-val {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.metric-sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Hero SVG Figure Card */
.hero-diagram-card {
  margin: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.diagram-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.85rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.status-dot {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-emerald);
}

.bond-svg,
.signaling-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  background: #070b12;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.svg-atom {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  fill: #f8fafc;
}

.svg-atom-sm {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  fill: #e2e8f0;
}

.svg-angle {
  font-family: var(--font-mono);
  font-size: 10.5px;
  fill: #38bdf8;
}

.svg-tag-accent {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  fill: #2dd4bf;
  letter-spacing: 0.04em;
}

.svg-tag-violet {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  fill: #c4b5fd;
}

.svg-tag-amber {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  fill: #fcd34d;
}

.svg-caption-micro {
  font-family: var(--font-sans);
  font-size: 10px;
  fill: #94a3b8;
}

.svg-caption-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: #e2e8f0;
}

.diagram-caption {
  margin-top: 0.9rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.diagram-caption code {
  font-family: var(--font-mono);
  color: var(--accent-emerald);
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.12;
  margin: 0;
}

.section-subtitle {
  max-width: 54ch;
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.96rem;
}

/* Section 2: Structural Biology Cards */
.blueprint-section {
  border-bottom: 1px solid var(--border-subtle);
}

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

.arch-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.arch-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.arch-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.arch-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
}

.arch-card p {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.arch-formula {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.arch-formula code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

.arch-formula span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Section 3: Pharmacokinetics & GPCR Signaling */
.pk-section {
  border-bottom: 1px solid var(--border-subtle);
}

.pk-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.pk-panel,
.signaling-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

.panel-head h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.3rem;
}

.panel-head p {
  margin: 0 0 1.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.pk-bars {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.pk-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}

.pk-track {
  width: 100%;
  height: 12px;
  background: var(--bg-elevated);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.pk-fill {
  height: 100%;
  width: 0%;
  background: var(--bar-color, var(--accent-emerald));
  border-radius: 99px;
}

/* Sticky Search & Filter Bar */
.filter-bar {
  position: sticky;
  top: 63px;
  z-index: 80;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.9rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

#lexicon-search {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 3rem 0.65rem 2.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

#lexicon-search:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px var(--accent-emerald-bg);
}

.search-kbd {
  position: absolute;
  right: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.filter-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cat-pill {
  min-height: 36px;
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
}

.cat-pill:hover {
  border-color: var(--accent-emerald);
  color: var(--text-primary);
}

.cat-pill[aria-pressed="true"] {
  background: var(--accent-emerald);
  color: #042f2e;
  border-color: var(--accent-emerald);
  font-weight: 600;
}

[data-theme="light"] .cat-pill[aria-pressed="true"] {
  color: #ffffff;
}

.status-filter-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.status-select {
  min-height: 36px;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.results-counter {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-emerald);
  font-variant-numeric: tabular-nums;
}

/* Lexicon Bento Grid */
.lexicon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.lexicon-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.lexicon-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.card-domain {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-title {
  margin: 0.35rem 0 0.15rem;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-subtitle {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent-emerald);
}

.card-summary {
  margin: 0.65rem 0 0;
  color: var(--text-secondary);
  font-size: 0.89rem;
}

.card-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.65rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.spec-item span {
  display: block;
  color: var(--text-muted);
  font-size: 0.67rem;
}

.spec-item strong {
  color: var(--text-primary);
  font-weight: 500;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.target-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.target-chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-inspect {
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-inspect:hover {
  background: var(--accent-emerald-bg);
  border-color: var(--accent-emerald);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: 12px;
  color: var(--text-muted);
}

/* Native Modal Dialog */
.monograph-dialog {
  max-width: 720px;
  width: calc(100% - 2rem);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 0;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
}

.monograph-dialog::backdrop {
  background: rgba(5, 8, 15, 0.76);
  backdrop-filter: blur(6px);
}

.dialog-inner {
  padding: 1.75rem;
}

.dialog-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dialog-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-close {
  min-height: 38px;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  cursor: pointer;
}

.dialog-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 400;
  margin: 0 0 0.25rem;
}

.dialog-subtitle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-emerald);
  margin: 0 0 1.25rem;
}

.dialog-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 0.9rem;
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.dialog-specs dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.dialog-specs dd {
  margin: 0.2rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.dialog-block {
  margin-bottom: 1.25rem;
}

.dialog-block h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-emerald);
  margin: 0 0 0.45rem;
}

.dialog-block p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.dialog-block pre {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.25rem 1.75rem;
  background: var(--bg-surface);
}

.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .hero-grid,
  .pk-layout {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .lexicon-grid {
    grid-template-columns: 1fr;
  }
}
