/* ═══════════════════════════════════════════════════════════
   DEEP PAGES — shared styles for the 5 standalone deep pages
   (laws-encyclopedia, 100-equations, omega-gpu, geometric-proofs,
   papers). Page-specific blocks live below the generic ones.
   ═══════════════════════════════════════════════════════════ */

/* ── Generic deep-page hero ── */
.deep-hero {
  position: relative;
  z-index: 2;
  min-height: 38vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--phi-space-4xl) + 40px) var(--phi-space-xl) var(--phi-space-3xl);
}
.deep-hero .sacred-text { margin-bottom: var(--phi-space-md); }
.deep-hero h1 {
  font-size: var(--phi-h1);
  margin-bottom: var(--phi-space-lg);
}
.deep-hero .deep-sub {
  max-width: 720px;
  margin: 0 auto;
  color: var(--phi-text-dim);
  font-size: var(--phi-body);
}
.deep-hero .deep-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--phi-space-md);
  justify-content: center;
  margin-top: var(--phi-space-xl);
}
.deep-hero .deep-chip {
  padding: var(--phi-space-sm) var(--phi-space-lg);
  background: var(--phi-bg-card);
  border: 1px solid var(--phi-stroke);
  border-radius: 999px;
  font-size: var(--phi-caption);
  color: var(--phi-text-dim);
  font-family: var(--font-sacred);
  letter-spacing: 0.1em;
}
.deep-hero .deep-chip b { color: var(--phi-gold); font-weight: 600; }

/* ── Generic deep-page section ── */
.deep-section {
  position: relative;
  z-index: 2;
  padding: var(--phi-space-3xl) var(--phi-space-xl);
}
.deep-section .section-title {
  text-align: center;
  margin-bottom: var(--phi-space-2xl);
}

/* ── Laws encyclopedia layout ── */
.laws-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--phi-space-xl);
  max-width: 1400px;
  margin: 0 auto;
}

/* Sidebar — faceted filters */
.laws-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
  background: var(--phi-bg-card);
  border: 1px solid var(--phi-stroke);
  border-radius: 12px;
  padding: var(--phi-space-xl);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.laws-sidebar .sacred-text { margin-bottom: var(--phi-space-md); }

.search-box { margin-bottom: var(--phi-space-xl); }
.search-box input {
  width: 100%;
  padding: var(--phi-space-md) var(--phi-space-lg);
  background: var(--phi-bg-elevated);
  border: 1px solid var(--phi-stroke);
  border-radius: 8px;
  color: var(--phi-text-bright);
  font-family: var(--font-body);
  font-size: var(--phi-body);
  outline: none;
  transition: border-color var(--phi-duration) var(--phi-ease),
              box-shadow var(--phi-duration) var(--phi-ease);
}
.search-box input::placeholder { color: var(--phi-text-dim); }
.search-box input:focus {
  border-color: var(--phi-gold-dim);
  box-shadow: 0 0 16px rgba(212, 168, 67, 0.12);
}

.filter-section { margin-bottom: var(--phi-space-xl); }
.filter-section:last-child { margin-bottom: 0; }
.filter-list {
  display: flex;
  flex-direction: column;
  gap: var(--phi-space-xs);
  max-height: 320px;
  overflow-y: auto;
  padding-right: var(--phi-space-xs);
}
.filter-btn {
  background: none;
  border: 1px solid var(--phi-stroke);
  color: var(--phi-text-dim);
  padding: var(--phi-space-sm) var(--phi-space-md);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: var(--phi-caption);
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.2s var(--phi-ease),
    color 0.2s var(--phi-ease),
    background 0.2s var(--phi-ease);
}
.filter-btn:hover {
  border-color: var(--phi-gold-dim);
  color: var(--phi-text);
}
.filter-btn.active {
  border-color: var(--phi-gold);
  color: var(--phi-gold);
  background: rgba(212, 168, 67, 0.06);
}
.filter-btn .filter-count {
  float: right;
  color: var(--phi-text-dim);
  font-size: 0.85em;
}
.filter-btn.active .filter-count { color: var(--phi-gold-dim); }

/* Results header */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--phi-space-lg);
  margin-bottom: var(--phi-space-lg);
}
.result-count {
  font-size: var(--phi-caption);
  color: var(--phi-text-dim);
  font-family: var(--font-sacred);
  letter-spacing: 0.08em;
}
.sort-select {
  padding: var(--phi-space-sm) var(--phi-space-md);
  background: var(--phi-bg-card);
  border: 1px solid var(--phi-stroke);
  border-radius: 6px;
  color: var(--phi-text);
  font-family: var(--font-body);
  font-size: var(--phi-caption);
  cursor: pointer;
  outline: none;
  transition: border-color var(--phi-duration) var(--phi-ease);
}
.sort-select:hover, .sort-select:focus { border-color: var(--phi-gold-dim); }
.sort-select option { background: var(--phi-bg-elevated); color: var(--phi-text); }

/* Laws grid + cards */
.laws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--phi-space-lg);
}
.law-card {
  display: flex;
  flex-direction: column;
  gap: var(--phi-space-sm);
  text-decoration: none;
  color: inherit;
}
.law-card .law-number {
  color: var(--phi-gold-dim);
  font-size: var(--phi-caption);
}
.law-card:hover .law-number { color: var(--phi-gold); }
.law-card h3 {
  font-size: var(--phi-body);
  font-weight: 600;
  line-height: 1.3;
}
.law-card .law-domain {
  font-size: var(--phi-caption);
  color: var(--phi-text-dim);
  font-family: var(--font-sacred);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.law-card .law-statement {
  font-size: var(--phi-caption);
  color: var(--phi-text-dim);
  font-style: italic;
  line-height: 1.5;
  flex-grow: 1;
}
.law-card .status-badge { margin-top: var(--phi-space-xs); }

/* Status badges — validated solid, simulated dashed */
.status-badge {
  display: inline-block;
  align-self: flex-start;
  padding: var(--phi-space-xs) var(--phi-space-md);
  border-radius: 4px;
  font-family: var(--font-sacred);
  font-size: var(--phi-caption);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--phi-gold-dim);
  color: var(--phi-gold);
}
.status-badge.status-validated {
  border: 1px solid var(--phi-gold-dim);   /* solid gold-dim */
  color: var(--phi-gold);
  background: rgba(212, 168, 67, 0.05);
}
.status-badge.status-simulated {
  border: 1px dashed var(--phi-gold-dim);  /* dashed */
  color: var(--phi-text-dim);
  background: transparent;
}

/* Load more */
.load-more-btn {
  display: block;
  margin: var(--phi-space-2xl) auto 0;
  padding: var(--phi-space-md) var(--phi-space-2xl);
  background: var(--phi-bg-card);
  border: 1px solid var(--phi-gold-dim);
  color: var(--phi-gold);
  border-radius: 8px;
  font-family: var(--font-sacred);
  font-size: var(--phi-caption);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background var(--phi-duration) var(--phi-ease),
    border-color var(--phi-duration) var(--phi-ease),
    box-shadow var(--phi-duration) var(--phi-ease);
}
.load-more-btn:hover {
  background: var(--phi-bg-elevated);
  border-color: var(--phi-gold);
  box-shadow: 0 0 24px rgba(212, 168, 67, 0.15);
}

/* Loading / empty states */
.laws-loading, .laws-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--phi-space-3xl) 0;
  color: var(--phi-text-dim);
  font-family: var(--font-sacred);
  letter-spacing: 0.15em;
  font-size: var(--phi-caption);
  text-transform: uppercase;
}
.laws-empty { text-transform: none; font-family: var(--font-body); font-size: var(--phi-body); }

/* ── Law detail overlay ── */
.law-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--phi-space-xl);
  background: rgba(6, 6, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--phi-ease);
}
.law-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.law-overlay-card {
  width: min(720px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--phi-bg-card);
  border: 1px solid var(--phi-gold-dim);
  border-radius: 12px;
  padding: var(--phi-space-2xl);
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(212, 168, 67, 0.08);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.3s var(--phi-ease);
}
.law-overlay.open .law-overlay-card { transform: translateY(0) scale(1); }
.law-overlay-close {
  position: absolute;
  top: var(--phi-space-lg);
  right: var(--phi-space-lg);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--phi-stroke);
  border-radius: 50%;
  color: var(--phi-text-dim);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s var(--phi-ease);
}
.law-overlay-close:hover {
  border-color: var(--phi-gold);
  color: var(--phi-gold);
}
.law-overlay .law-number {
  color: var(--phi-gold);
  font-size: var(--phi-caption);
  margin-bottom: var(--phi-space-md);
}
.law-overlay h2 {
  font-size: var(--phi-h2);
  margin-bottom: var(--phi-space-lg);
  padding-right: var(--phi-space-2xl);
}
.law-overlay .law-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--phi-space-md);
  align-items: center;
  margin-bottom: var(--phi-space-xl);
}
.law-overlay .law-meta .law-domain {
  font-size: var(--phi-caption);
  color: var(--phi-text-dim);
  font-family: var(--font-sacred);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.law-overlay .law-statement-full {
  font-size: var(--phi-body);
  color: var(--phi-text);
  font-style: italic;
  line-height: 1.7;
  border-left: 2px solid var(--phi-gold-dim);
  padding-left: var(--phi-space-xl);
  margin-bottom: var(--phi-space-xl);
}
.law-overlay .law-source {
  font-size: var(--phi-caption);
  color: var(--phi-text-dim);
  font-family: var(--font-mono);
  word-break: break-all;
  margin-bottom: var(--phi-space-lg);
}
.law-overlay .law-github-note {
  font-size: var(--phi-caption);
  color: var(--phi-text-dim);
}
.law-overlay .law-github-note a {
  color: var(--phi-gold);
  text-decoration: underline;
  text-decoration-color: var(--phi-gold-dim);
}

/* ── Shared footer for deep pages ── */
.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--phi-space-3xl) var(--phi-space-xl) var(--phi-space-2xl);
  border-top: 1px solid var(--phi-stroke);
  background: linear-gradient(180deg, transparent, rgba(6, 6, 15, 0.8));
}
.site-footer .footer-phi {
  font-family: var(--font-heading);
  font-size: 2.618rem;
  color: var(--phi-gold-dim);
  line-height: 1;
  margin-bottom: var(--phi-space-lg);
}
.site-footer .footer-seed {
  font-family: var(--font-sacred);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: var(--phi-caption);
  color: var(--phi-gold);
  margin-bottom: var(--phi-space-md);
}
.site-footer .footer-repo a {
  font-size: var(--phi-caption);
  color: var(--phi-text-dim);
  font-family: var(--font-mono);
}
.site-footer .footer-repo a:hover { color: var(--phi-gold); }
.site-footer .footer-note {
  margin-top: var(--phi-space-md);
  font-size: var(--phi-caption);
  color: var(--phi-text-dim);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .laws-layout { grid-template-columns: 240px 1fr; }
}

@media (max-width: 768px) {
  .deep-hero { min-height: 30vh; padding-top: var(--phi-space-3xl); }
  .laws-layout { grid-template-columns: 1fr; }
  .laws-sidebar {
    position: static;
    max-height: none;
  }
  .laws-grid { grid-template-columns: 1fr; }
  .results-header { flex-direction: column; align-items: flex-start; }
  .law-overlay { padding: var(--phi-space-md); }
  .law-overlay-card { padding: var(--phi-space-xl); max-height: 88vh; }
}

/* related-note — small cross-reference note under related-links */
.related-note {
  font-family: var(--font-body);
  font-size: var(--phi-caption);
  color: var(--phi-text-dim);
  margin-top: var(--phi-space-md);
  font-style: italic;
}

/* ── About page ── */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--phi-space-lg); max-width: 1100px; margin: 0 auto; }
.about-card { background: var(--phi-bg-card); border: 1px solid var(--phi-stroke); border-radius: 12px; padding: var(--phi-space-xl); }

/* ── Contact page ── */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--phi-space-md); max-width: 1100px; margin: 0 auto var(--phi-space-2xl); }
.contact-card { display: block; background: var(--phi-bg-card); border: 1px solid var(--phi-stroke); border-radius: 12px; padding: var(--phi-space-xl); text-decoration: none; transition: border-color 0.3s var(--phi-ease), transform 0.3s var(--phi-ease); }
.contact-card:hover { border-color: var(--phi-gold-dim); transform: translateY(-3px); }
.contact-card-label { font-family: var(--font-mono); font-size: var(--phi-caption); color: var(--phi-gold); letter-spacing: 0.25em; }
.contact-card-title { font-family: var(--font-heading); font-size: var(--phi-h3); color: var(--phi-text-bright); margin-top: var(--phi-space-xs); }
.contact-card-note { font-family: var(--font-body); font-size: var(--phi-caption); color: var(--phi-text-dim); margin-top: var(--phi-space-sm); line-height: 1.7; }
.contact-composer { max-width: 860px; margin: 0 auto; background: var(--phi-bg-card); border: 1px solid var(--phi-stroke); border-radius: 12px; padding: var(--phi-space-xl); display: grid; gap: var(--phi-space-md); }
.contact-input, .contact-textarea { font-family: var(--font-body); font-size: var(--phi-body); color: var(--phi-text-bright); background: var(--phi-bg-deep); border: 1px solid var(--phi-stroke); border-radius: 10px; padding: 0.8em 1em; width: 100%; }
.contact-input:focus, .contact-textarea:focus { outline: none; border-color: var(--phi-gold-dim); }
.contact-send { justify-self: start; font-family: var(--font-mono); font-size: var(--phi-body); color: var(--phi-gold); background: none; border: 1px solid var(--phi-gold-dim); border-radius: 999px; padding: 0.6em 1.8em; cursor: pointer; letter-spacing: 0.08em; transition: background 0.3s var(--phi-ease); }
.contact-send:hover { background: rgba(212, 168, 67, 0.1); }
.contact-privacy { font-family: var(--font-body); font-size: var(--phi-caption); color: var(--phi-text-dim); }

/* ── Spider Web Protocol — the math table ── */
.web-table-wrap { overflow-x: auto; margin: var(--phi-space-md) 0; }
.web-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: var(--phi-caption); }
.web-table th, .web-table td { border: 1px solid var(--phi-stroke); padding: 0.55em 0.9em; text-align: left; white-space: nowrap; }
.web-table th { color: var(--phi-gold); letter-spacing: 0.08em; font-weight: 400; background: var(--phi-bg-deep); }
.web-table td { color: var(--phi-text); }

/* ── Contact page — the Contact Protocol steps reuse claim-step styles ── */
.contact-protocol-steps { margin-top: var(--phi-space-md); }

/* ── Lazy document accordions (md-render.js) ─────────────────────────
   Title + Read button visible on load; full markdown renders only on
   click, deferred off the main thread so large documents never freeze. */
.md-doc-preview { text-align: center; padding: var(--phi-space-lg) 0; }
.md-read-btn {
  font-family: var(--font-mono);
  font-size: var(--phi-caption);
  color: var(--phi-gold);
  background: rgba(212, 168, 67, 0.06);
  border: 1px solid var(--phi-gold-dim);
  border-radius: 999px;
  padding: 0.65em 2.2em;
  cursor: pointer;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.3s var(--phi-ease), box-shadow 0.3s var(--phi-ease);
}
.md-read-btn:hover { background: rgba(212, 168, 67, 0.14); box-shadow: 0 0 18px rgba(212, 168, 67, 0.2); }
.md-read-btn:disabled { opacity: 0.6; cursor: wait; }
.md-loading {
  text-align: center;
  padding: var(--phi-space-lg) 0;
  color: var(--phi-text-dim);
  font-family: var(--font-sacred);
  letter-spacing: 0.15em;
  font-size: var(--phi-caption);
  text-transform: uppercase;
}
