/* ─── Myth Meets Molecules · PK One-Compartment Website ─── */

:root {
  --navy:       #0F172A;
  --navy-mid:   #1E293B;
  --navy-light: #334155;
  --teal:       #0EA5E9;
  --teal-dark:  #0284C7;
  --teal-glow:  rgba(14,165,233,0.15);
  --cyan:       #38BDF8;
  --text:       #E2E8F0;
  --text-muted: #94A3B8;
  --text-dim:   #64748B;
  --border:     rgba(51,65,85,0.8);
  --surface:    rgba(30,41,59,0.7);
  --green:      #22C55E;
  --green-bg:   rgba(34,197,94,0.12);
  --amber:      #F59E0B;
  --amber-bg:   rgba(245,158,11,0.12);
  --red:        #EF4444;
  --radius:     12px;
  --radius-sm:  8px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--navy);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--navy-light); border-radius: 3px; }

/* ─── NAVBAR ─── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,23,42,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  flex-shrink: 0;
}

.nav-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.nav-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--cyan);
  background: var(--teal-glow);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.3rem 0.75rem;
  background: var(--teal-glow);
  border: 1px solid rgba(14,165,233,0.3);
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--cyan);
  font-weight: 600;
  white-space: nowrap;
}

/* ─── HERO ─── */
.hero {
  padding: 5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(14,165,233,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 1rem;
  background: var(--teal-glow);
  border: 1px solid rgba(14,165,233,0.3);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.hero h1 span { color: var(--cyan); }

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

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

.hero-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.hero-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 0;
}

/* ─── SECTION SHELL ─── */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.section-label {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--navy);
}

.section-info h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-info p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ─── CARDS ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.card:hover { border-color: rgba(14,165,233,0.3); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  gap: 1rem;
}

.card-head-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cyan);
  background: var(--teal-glow);
  border: 1px solid rgba(14,165,233,0.25);
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-chevron {
  color: var(--text-dim);
  font-size: 0.75rem;
  transition: transform 0.25s;
  flex-shrink: 0;
}

.card.open .card-chevron { transform: rotate(180deg); }

.card-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
}

.card.open .card-body { display: block; }

/* ─── BULLET LIST ─── */
.bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bullet-list li {
  display: flex;
  gap: 0.6rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
}

.bullet-list li::before {
  content: '›';
  color: var(--teal);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.05em;
}

.bullet-list li code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.82em;
  background: rgba(14,165,233,0.12);
  color: var(--cyan);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* ─── CITE BADGE ─── */
.cite {
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(100,116,139,0.15);
  padding: 0.1em 0.45em;
  border-radius: 4px;
  white-space: nowrap;
}

/* ─── INLINE TABLES ─── */
.pk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  margin-top: 0.75rem;
}

.pk-table th {
  background: rgba(14,165,233,0.1);
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.6rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.pk-table td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(51,65,85,0.5);
  color: var(--text);
  vertical-align: top;
}

.pk-table tr:last-child td { border-bottom: none; }

.pk-table tr:hover td { background: rgba(14,165,233,0.04); }

.pk-table code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  color: var(--cyan);
  background: rgba(14,165,233,0.1);
  padding: 0.15em 0.45em;
  border-radius: 4px;
}

.pk-table .muted { color: var(--text-muted); font-size: 0.8em; }

/* ─── TABLE CATEGORY BADGE ─── */
.cat-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  white-space: nowrap;
}

/* ─── VD TABLE ─── */
.vd-table { margin-top: 1rem; }

/* ─── EQUATION BLOCKS (coloured sub-tables) ─── */
.eq-section { margin-top: 1rem; }

.eq-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* ─── PROTOCOL STEPS ─── */
.protocol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
  transition: border-color 0.2s;
}

.step-card:hover { border-color: rgba(14,165,233,0.3); }

.step-num {
  position: absolute;
  top: -12px;
  left: 1rem;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--navy);
}

.step-card p {
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.55;
}

/* ─── OBSERVATION TABLE (B04) ─── */
.obs-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 0.75rem;
}

.obs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  min-width: 600px;
}

.obs-table th {
  background: rgba(14,165,233,0.12);
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.7rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.obs-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(51,65,85,0.5);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.obs-table tr:last-child td { border-bottom: none; }

/* ─── RESULTS TABLE (B05) ─── */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.results-table th {
  background: rgba(14,165,233,0.1);
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.results-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(51,65,85,0.4);
  vertical-align: middle;
}

.results-table tr:last-child td { border-bottom: none; }

.results-table td:first-child { font-weight: 600; color: var(--text); }
.results-table td:nth-child(2) { font-family: monospace; font-size: 0.82em; color: var(--cyan); }
.results-table td:nth-child(3) { color: var(--text-muted); font-style: italic; font-size: 0.8em; }
.results-table td:last-child { color: var(--amber); font-size: 0.8em; font-weight: 600; }

.results-fill {
  display: inline-block;
  min-width: 80px;
  border-bottom: 1px dashed var(--navy-light);
  color: transparent;
}

/* ─── VIVA QUESTIONS ─── */
.viva-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.viva-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
}

.viva-q {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}

.viva-cite {
  margin-top: 0.4rem;
  font-size: 0.73rem;
  color: var(--text-dim);
}

/* ─── FORMULA SECTION D ─── */
.formula-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: center;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

#formula-search {
  width: 100%;
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

#formula-search:focus { border-color: var(--teal); }
#formula-search::placeholder { color: var(--text-dim); }

.filter-btns {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-btn:hover { border-color: var(--teal); color: var(--cyan); }
.filter-btn.active { background: var(--teal-glow); border-color: var(--teal); color: var(--cyan); }

.formula-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.formula-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  min-width: 600px;
}

.formula-table thead th {
  background: rgba(14,165,233,0.1);
  color: var(--cyan);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 60px;
}

.formula-table tbody tr { transition: background 0.15s; }
.formula-table tbody tr:hover td { background: rgba(14,165,233,0.04); }
.formula-table tbody tr.hidden { display: none; }

.formula-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(51,65,85,0.4);
  vertical-align: top;
  line-height: 1.5;
}

.formula-table tr:last-child td { border-bottom: none; }

.formula-table td:first-child { color: var(--text); font-weight: 500; min-width: 140px; }
.formula-table td:nth-child(2) {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.82em;
  color: var(--cyan);
  min-width: 220px;
}
.formula-table td:nth-child(3) { color: var(--text-muted); font-size: 0.82em; min-width: 200px; }

.cat-row td {
  background: rgba(14,165,233,0.06) !important;
  color: var(--teal) !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  padding: 0.5rem 1rem !important;
  font-family: inherit !important;
}

.formula-count {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-left: auto;
}

/* ─── WORKED EXAMPLE (A06) ─── */
.example-box {
  background: rgba(14,165,233,0.05);
  border: 1px solid rgba(14,165,233,0.2);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 0.75rem;
}

.example-given {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.eg-pill {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-family: monospace;
  color: var(--text);
}

.eg-steps {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.eg-step {
  display: flex;
  gap: 0.6rem;
  font-size: 0.86rem;
}

.eg-step-n {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--teal);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1em;
}

.eg-result {
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--green);
  font-family: monospace;
}

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
}

footer p { font-size: 0.8rem; color: var(--text-dim); line-height: 1.7; }
footer a { color: var(--teal); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ─── SECTION DIVIDER ─── */
.section-divider {
  height: 1px;
  background: var(--border);
  max-width: 1100px;
  margin: 0 auto;
}

/* ─── SUBSECTION LABEL ─── */
.subsec-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.75rem 0 0.75rem;
}

/* ─── NO-RESULTS ─── */
#no-results {
  display: none;
  text-align: center;
  padding: 3rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-links { display: none; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .section { padding: 2.5rem 1rem; }
  .protocol-grid { grid-template-columns: 1fr; }
  .hero-meta { gap: 1rem; }
  .hero-divider { display: none; }
}
