/* ============================================================
   xPRIMEray Documentation Stylesheet
   GitHub Pages · MkDocs Material
   Density-aligned with MisterY Labs
   ============================================================ */

/* ── Global layout density ─────────────────────────────────── */
.md-grid {
  max-width: 96rem;
}

.md-content__inner {
  max-width: 88rem;
}

/* ── Typography (compact observatory mode) ─────────────────── */
.md-typeset {
  font-size: 0.82rem;
  line-height: 1.48;
}

.md-typeset h1 {
  font-size: 1.85rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  margin-bottom: 0.8rem;
}

.md-typeset h2 {
  font-size: 1.35rem;
  font-weight: 400;
  border-bottom: 1px solid rgba(128,128,128,0.2);
  padding-bottom: 0.25em;
  margin-top: 1.45em;
  margin-bottom: 0.55em;
}

.md-typeset h3 {
  font-size: 1.02rem;
  font-weight: 500;
  margin-top: 1.05em;
  margin-bottom: 0.35em;
}

.md-typeset p,
.md-typeset ul,
.md-typeset ol {
  margin-top: 0.45em;
  margin-bottom: 0.45em;
}

/* ── Hero / Logo block ─────────────────────────────────────── */
.xp-hero {
  text-align: center;
  padding: 1.6rem 1rem 1rem;
  margin-bottom: 0.6rem;
}

.xp-hero img {
  max-width: 220px;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.xp-tagline {
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.10em;
  opacity: 0.75;
  margin-top: 0.45rem;
  font-style: italic;
}

.xp-equation {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #cc8844;
  opacity: 0.8;
  margin-top: 0.25rem;
}

/* ── Paper/figure images ───────────────────────────────────── */
.md-typeset img {
  border: 1px solid rgba(100,100,100,0.3);
  padding: 4px;
  background: #0a0a12;
  border-radius: 3px;
  max-width: 100%;
}

.md-typeset figcaption {
  font-size: 0.72rem;
  opacity: 0.75;
  text-align: center;
  margin-top: 0.3em;
  font-style: italic;
}

/* Figure quartet grid */
.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.figure-grid figure {
  margin: 0;
}

/* ── Paper abstract block ──────────────────────────────────── */
.paper-abstract {
  border-left: 3px solid #6644aa;
  padding: 0.75rem 0.95rem;
  margin: 1rem 0;
  background: rgba(102,68,170,0.06);
  border-radius: 0 4px 4px 0;
}

.paper-abstract p:last-child {
  margin-bottom: 0;
}

/* ── Metadata header (papers) ─────────────────────────────── */
.paper-meta {
  font-size: 0.74rem;
  opacity: 0.65;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid rgba(128,128,128,0.15);
  padding-bottom: 0.55rem;
}

.paper-meta strong {
  opacity: 0.9;
}

/* ── Citation / bibtex block ───────────────────────────────── */
.md-typeset blockquote {
  border-left: 3px solid #5566cc;
  background: rgba(85,102,204,0.05);
  padding: 0.65rem 0.85rem;
  border-radius: 0 4px 4px 0;
  margin: 0.85rem 0;
}

/* ── Tables ────────────────────────────────────────────────── */
.md-typeset table {
  font-size: 0.78rem;
  border-collapse: collapse;
  width: 100%;
}

.md-typeset table th {
  background: rgba(102,68,170,0.15);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.md-typeset table tr:hover td {
  background: rgba(102,68,170,0.05);
}

/* ── Inspiration / XenoCitation compact cards ──────────────── */
.xeno-card-grid,
.inspiration-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 0.9rem;
  margin: 1rem 0;
}

.xeno-card,
.inspiration-card {
  border: 1px solid rgba(120,100,220,0.22);
  border-radius: 8px;
  padding: 0.85rem;
  background: rgba(20,20,32,0.45);
  font-size: 0.74rem;
  line-height: 1.38;
}

.xeno-card h3,
.inspiration-card h3 {
  margin-top: 0;
  font-size: 0.9rem;
}

.xeno-card p,
.inspiration-card p {
  margin: 0.35em 0;
}

/* ── Invariant badge ───────────────────────────────────────── */
.invariant-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.invariant-badge.positive {
  background: rgba(40,180,100,0.18);
  color: #44cc88;
  border: 1px solid rgba(40,180,100,0.3);
}

.invariant-badge.negative {
  background: rgba(220,80,80,0.15);
  color: #ee6666;
  border: 1px solid rgba(220,80,80,0.3);
}

.invariant-badge.coupled {
  background: rgba(100,100,220,0.15);
  color: #8899ee;
  border: 1px solid rgba(100,100,220,0.3);
}

/* ── Code blocks ───────────────────────────────────────────── */
.md-typeset pre > code {
  font-size: 0.74rem;
  line-height: 1.4;
}

/* ── Nav — tab bar ─────────────────────────────────────────── */
.md-tabs__link {
  font-size: 0.74rem;
  letter-spacing: 0.05em;
}

/* ── Sidebar density ───────────────────────────────────────── */
.md-nav {
  font-size: 0.76rem;
}

.md-nav__item {
  line-height: 1.25;
}

/* ── Site header ───────────────────────────────────────────── */
.md-header {
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

/* ── Footer ────────────────────────────────────────────────── */
.md-footer-meta {
  opacity: 0.6;
}

/* ════════════════════════════════════════════════════════════
   Observatory Lobby — index.md first-impressions layout
   ════════════════════════════════════════════════════════════ */

/* One-line orientation sentence under logo */
.xp-lobby-intro {
  text-align: center;
  font-size: 1.05rem;
  letter-spacing: 0.025em;
  opacity: 0.88;
  margin: 0.6rem auto 0.4rem;
  max-width: 52rem;
  line-height: 1.5;
}

/* Full-width motto bar */
.xp-motto {
  text-align: center;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  opacity: 0.5;
  font-style: italic;
  margin: 0.3rem 0 1.6rem;
}

/* Three-column exhibit grid */
.xp-exhibit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.1rem;
  margin: 0.5rem 0 1.4rem;
}

/* Individual exhibit card */
.xp-exhibit-card {
  border: 1px solid rgba(120, 100, 220, 0.28);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(14, 14, 22, 0.55);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s;
}

.xp-exhibit-card:hover {
  border-color: rgba(150, 120, 255, 0.55);
}

/* Image fills full card width, no border/padding/background from global img rule */
.xp-exhibit-card > p:first-child img,
.xp-exhibit-card img:first-of-type {
  width: 100%;
  border: none !important;
  padding: 0 !important;
  background: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: block;
  margin: 0 !important;
}

/* Card body (text area below image) */
.xp-exhibit-body {
  padding: 0.85rem 0.95rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Big stat number */
.xp-stat {
  display: block;
  font-size: 2.2rem;
  font-weight: 700;
  color: #9966ff;
  background: rgba(14, 14, 22, 0.55);
  border-radius: 6px;
  line-height: 1;
  margin: 0.45rem 0 0.2rem;
  letter-spacing: -0.02em;
}

/* Stat sub-label */
.xp-stat-label {
  font-size: 0.72rem;
  opacity: 0.6;
  letter-spacing: 0.04em;
  margin-bottom: 0.55rem;
  text-transform: uppercase;
}

/* Hook sentence */
.xp-hook {
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  flex: 1;
}

/* "Why this matters" stripe */
.xp-why {
  font-size: 0.72rem;
  opacity: 0.58;
  border-top: 1px solid rgba(128, 128, 128, 0.18);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  font-style: italic;
  line-height: 1.45;
}

/* Exhibit link at bottom of card */
.xp-exhibit-link {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: #9966ff !important;
  letter-spacing: 0.03em;
}

/* Action button row */
.xp-action-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0.5rem 0 2rem;
}

.xp-action-row .md-button {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  min-width: 10rem;
  text-align: center;
}

/* ── OC-001 Optical Closure Audit ─────────────────────────── */
.oc-tier-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1px;
  background: rgba(128,128,128,0.18);
  border: 1px solid rgba(128,128,128,0.18);
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}
.oc-tier-cell {
  padding: 0.75rem 1rem;
  background: var(--md-default-bg-color);
}
.oc-tier-name {
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.oc-tier-math   .oc-tier-name { color: #38d1e0; }
.oc-tier-engine .oc-tier-name { color: #a5c3f5; }
.oc-tier-valid  .oc-tier-name { color: #4ade80; }
.oc-tier-exp    .oc-tier-name { color: #fbbf24; }
.oc-tier-lore   .oc-tier-name { color: #f5a84a; }
.oc-tier-open   .oc-tier-name { color: #6b7d96; }
.oc-tier-desc {
  font-size: 0.69rem;
  opacity: 0.68;
  line-height: 1.42;
}

.oc-term-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}
.oc-term-card {
  border: 1px solid;
  border-radius: 4px;
  padding: 0.85rem;
  background: rgba(14,14,22,0.4);
}
.oc-term-card.use   { border-color: rgba(74,222,128,0.22); }
.oc-term-card.avoid { border-color: rgba(240,112,112,0.22); }
.oc-term-card .tc-head {
  font-size: 0.64rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.55rem;
}
.oc-term-card.use   .tc-head { color: #4ade80; }
.oc-term-card.avoid .tc-head { color: #f07070; }
.oc-term-card ul { margin: 0; padding-left: 1rem; }
.oc-term-card li { margin-bottom: 0.2rem; }

@media (max-width: 680px) {
  .oc-term-grid { grid-template-columns: 1fr; }
}

/* ── Print / paper export ──────────────────────────────────── */
@media print {
  .md-header,
  .md-tabs,
  .md-sidebar,
  .md-footer {
    display: none !important;
  }

  .md-typeset {
    font-size: 10pt;
    line-height: 1.5;
  }

  .md-content {
    max-width: 100% !important;
    padding: 0 !important;
  }
}