/* =====================================================================
   Navigational Mind Architecture — shared styles
   =====================================================================
   Used by index.html (demo), understanding.html, governance.html,
   about.html. Single file so visual identity is consistent and edits
   propagate without per-page duplication.
   ===================================================================== */

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

:root {
  --bg-deep:      #0a0a0f;
  --bg-primary:   #12121a;
  --bg-secondary: #1a1a24;
  --bg-elevated:  #22222e;
  --bg-hover:     #2a2a38;
  --text-primary:   #e8e6e3;
  --text-secondary: #a8a6a3;
  --text-muted:     #6b6966;
  --accent:         #d4a574;
  --accent-dim:     #a67c4e;
  --accent-glow:    rgba(212,165,116,0.15);
  --accent-border:  rgba(212,165,116,0.25);
  --success:        #7cb87c;
  --danger:         #c87c7c;
  --border:         rgba(255,255,255,0.08);
  --border-light:   rgba(255,255,255,0.12);
  --serif: 'Crimson Pro', Georgia, serif;
  --sans:  'DM Sans', system-ui, sans-serif;
  --mono:  'DM Mono', 'Courier New', monospace;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ── HEADER ── */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.header-logo {
  font-family: var(--serif); font-size: 1.2rem; font-weight: 400;
  color: var(--text-primary); text-decoration: none; cursor: default;
  user-select: none;
}
.header-logo span { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 1.25rem; }
#arch-badge {
  display: none; font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: #fff; background: #2e5090;
  border-radius: 3px; padding: 2px 7px;
}
#status { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.nav-link {
  font-size: 0.875rem; color: var(--text-secondary); text-decoration: none;
  transition: color 150ms ease;
}
.nav-link:hover { color: var(--text-primary); }
.nav-link.active { color: var(--text-primary); border-bottom: 1px solid var(--accent-border); padding-bottom: 2px; }

/* ── MAIN ── */
.main { flex: 1; padding: 3rem 1.5rem 5rem; }
.wrap { max-width: 760px; margin: 0 auto; }
.wrap-wide { max-width: 1100px; margin: 0 auto; }

/* ── LANDING HERO ── */
.landing { text-align: center; padding: 3rem 0 2.5rem; }
.landing-title {
  font-family: var(--serif); font-size: 3.25rem; font-weight: 300;
  line-height: 1.18; letter-spacing: -0.01em; margin-bottom: 1rem;
}
.landing-title span { color: var(--accent); }
.landing-subtitle {
  font-family: var(--serif); font-size: 1.375rem; font-weight: 300;
  font-style: italic; color: var(--text-secondary); margin-bottom: 2rem;
}
.landing-intro {
  max-width: 600px; margin: 0 auto 2.5rem;
  font-size: 1.05rem; color: var(--text-secondary); line-height: 1.75;
}

/* ── PROSE PAGE LAYOUT (understanding / governance / about) ── */
.page-header {
  text-align: center; padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border); margin-bottom: 3rem;
}
.page-eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-dim); margin-bottom: 1rem;
}
.page-title {
  font-family: var(--serif); font-size: 2.75rem; font-weight: 300;
  line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 0.875rem;
}
.page-title span { color: var(--accent); }
.page-subtitle {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 300;
  font-style: italic; color: var(--text-secondary);
  max-width: 620px; margin: 0 auto;
}

.prose h2 {
  font-family: var(--serif); font-size: 1.75rem; font-weight: 400;
  letter-spacing: -0.005em; line-height: 1.3;
  margin-top: 3rem; margin-bottom: 1rem; color: var(--text-primary);
}
.prose h3 {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 400;
  font-style: italic; line-height: 1.4;
  margin-top: 2.25rem; margin-bottom: 0.75rem; color: var(--text-primary);
}
.prose p {
  font-size: 1rem; color: var(--text-secondary); line-height: 1.85;
  margin-bottom: 1.125rem;
}
.prose p strong, .prose strong { color: var(--text-primary); font-weight: 500; }
.prose p em, .prose em { color: var(--text-primary); }
.prose ul, .prose ol {
  margin-bottom: 1.125rem; padding-left: 1.5rem;
}
.prose li { color: var(--text-secondary); line-height: 1.85; margin-bottom: 0.5rem; }
.prose blockquote {
  border-left: 3px solid var(--accent-dim);
  padding: 0.5rem 0 0.5rem 1.25rem; margin: 1.5rem 0;
  font-family: var(--serif); font-style: italic; font-size: 1.1rem;
  color: var(--text-primary);
}

.prose-cta {
  margin: 3.5rem 0 1rem; padding: 1.5rem 1.75rem;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 10px;
}
.prose-cta-title {
  font-family: var(--serif); font-size: 1.15rem; font-weight: 400;
  font-style: italic; color: var(--text-primary); margin-bottom: 0.5rem;
}
.prose-cta-body {
  font-size: 0.95rem; color: var(--text-secondary); line-height: 1.7;
  margin-bottom: 1rem;
}
.prose-cta-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid transparent; padding-bottom: 1px;
  transition: border-color 150ms ease;
}
.prose-cta-link:hover { border-bottom-color: var(--accent-border); }

/* ── SECTION LABELS ── */
.section-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.75rem;
}

/* ── INPUT CARD (demo only) ── */
.input-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem;
}
.input-label {
  font-family: var(--serif); font-size: 1rem; font-style: italic;
  color: var(--text-secondary); margin-bottom: 0.75rem; display: block;
}
textarea {
  width: 100%; padding: 0.875rem 1rem; min-height: 80px; resize: vertical;
  background: var(--bg-primary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--sans); font-size: 0.95rem; line-height: 1.65;
  margin-bottom: 0.875rem; transition: border-color 150ms ease;
}
textarea:focus { outline: none; border-color: var(--accent-dim); }
textarea::placeholder { color: var(--text-muted); }
.input-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.875rem;
}
.input-note { font-size: 0.8rem; color: var(--text-muted); font-style: italic; }
.btn-row { display: flex; gap: 0.625rem; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.625rem 1.375rem; border-radius: 6px; border: none; cursor: pointer;
  background: var(--accent); color: var(--bg-deep);
  font-family: var(--sans); font-size: 0.9rem; font-weight: 500;
  transition: filter 150ms ease;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.625rem 1.25rem; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border-light); background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--sans); font-size: 0.9rem;
  transition: all 150ms ease;
}
.btn-secondary:hover {
  border-color: var(--accent-border); color: var(--accent);
  background: var(--accent-glow);
}
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── SCENARIOS ── */
.scenario-section { margin-bottom: 2.5rem; }
.scenario-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.s-chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 5px 10px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-muted);
  transition: all 120ms ease; white-space: nowrap;
}
.s-chip:hover { border-color: var(--border-light); color: var(--text-secondary); }
.s-chip.active {
  border-color: var(--accent-border); background: var(--accent-glow); color: var(--accent);
}

/* ── LOADING ── */
.loading-state {
  display: none; padding: 2rem; text-align: center;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 1.5rem;
}
.loading-inner { display: inline-flex; align-items: center; gap: 0.875rem; color: var(--text-muted); }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; }
.loading-hint {
  display: block; margin-top: 0.5rem; font-family: var(--sans);
  font-size: 11px; font-style: italic; color: var(--text-muted);
}

/* ── RESULT ── */
.result-wrap { animation: fadeIn 300ms ease forwards; }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

.result-context {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
  border-radius: 0 8px 8px 0; padding: 0.875rem 1.125rem; margin-bottom: 1rem;
}
.result-meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.25rem; }
.result-q { font-family: var(--serif); font-size: 1.1rem; font-style: italic; color: var(--text-primary); line-height: 1.5; }

.output-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.output-head {
  padding: 0.75rem 1.125rem; border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.output-head-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
}
.output-engine {
  font-family: var(--serif); font-size: 0.95rem; font-weight: 500;
  color: var(--text-primary);
}
.route-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 4px;
  border: 1px solid var(--accent-border); background: var(--accent-glow);
  color: var(--accent);
}
.route-badge.deferred {
  border-color: rgba(168,166,163,0.3); background: rgba(168,166,163,0.08);
  color: var(--text-secondary);
}
.route-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.route-badge.deferred .route-dot { background: var(--text-secondary); }
.output-substatus {
  margin-top: 0.4rem; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.06em; color: var(--text-muted);
}
.output-body { padding: 1.25rem 1.5rem; }
.output-text {
  font-family: var(--sans); font-size: 0.95rem; line-height: 1.75;
  color: var(--text-primary); white-space: pre-wrap; word-break: break-word;
}
.output-text code {
  font-family: var(--mono); font-size: 0.85rem;
  background: var(--bg-primary); padding: 0.1rem 0.35rem; border-radius: 3px;
  color: var(--accent); word-break: break-all;
}

/* ── GATE BLOCKS (arch mode — easter egg, not advertised) ── */
.gate-block {
  border-left: 3px solid var(--border-light);
  padding: 0.625rem 0.875rem; margin-bottom: 0.625rem;
  background: var(--bg-primary);
  border-radius: 0 6px 6px 0;
}
.gate-block.g0  { border-left-color: #7280a8; }
.gate-block.g1  { border-left-color: #7c8fb8; }
.gate-block.g2  { border-left-color: #88a0c8; }
.gate-block.g3  { border-left-color: #a0b4d8; }
.gate-block.bof { border-left-color: var(--accent-dim); }
.gate-block.g4  { border-left-color: #a0b4d8; }
.gate-block.s8  { border-left-color: var(--accent); }
.gate-block.clarity { border-left-color: var(--success); }
.gate-block.retr-route { border-left-color: var(--accent); background: rgba(212,165,116,0.04); }
.gate-block.retr-trace { border-left-color: var(--accent-dim); background: rgba(166,124,78,0.04); }
.gate-block.retr-attr  { border-left-color: var(--accent-dim); background: rgba(166,124,78,0.04); }
.gate-lbl {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.35rem;
}
.gate-content {
  font-family: var(--mono); font-size: 11px; line-height: 1.65;
  color: var(--text-secondary); white-space: pre-wrap; word-break: break-word;
}

/* ── EXPLAINER ── */
.explainer {
  margin-top: 3.5rem; padding: 1.5rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg-secondary);
}
.explainer-title {
  font-family: var(--serif); font-style: italic; font-size: 1.1rem;
  color: var(--text-primary); margin-bottom: 0.75rem;
}
.explainer-body {
  font-size: 0.92rem; color: var(--text-secondary); line-height: 1.7;
}
.explainer-body strong { color: var(--text-primary); font-weight: 500; }

/* ── QUOTE BLOCK ── */
.landing-quote {
  text-align: center; padding: 2.5rem 1rem;
  border-top: 1px solid var(--border); margin-top: 3.5rem;
}
.landing-quote blockquote {
  font-family: var(--serif); font-size: 1.15rem; font-style: italic;
  font-weight: 300; color: var(--text-secondary); line-height: 1.65;
  max-width: 540px; margin: 0 auto 0.875rem;
}
.landing-quote cite {
  display: block; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
  font-style: normal;
}

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border); padding: 1.5rem;
  text-align: center;
}
.footer-text {
  font-family: var(--sans); font-size: 0.8rem; color: var(--text-muted);
}
.footer-text a {
  color: var(--text-secondary); text-decoration: none;
  transition: color 150ms ease;
}
.footer-text a:hover { color: var(--accent); }

/* ── LIVENESS INDICATOR ── */
.liveness-indicator {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.liveness-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted);
}
.liveness-checking { color: var(--text-muted); }
.liveness-checking .liveness-dot { animation: pulse 1.5s ease-in-out infinite; }
.liveness-online { color: var(--success); }
.liveness-online .liveness-dot { background: var(--success); }
.liveness-offline { color: var(--danger); }
.liveness-offline .liveness-dot { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── OFFLINE BANNER ── */
.offline-banner {
  background: rgba(200,124,124,0.06); border: 1px solid rgba(200,124,124,0.25);
  border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.offline-banner-title {
  font-family: var(--serif); font-size: 1.05rem; font-style: italic;
  color: var(--text-primary); margin-bottom: 0.4rem;
}
.offline-banner-body {
  font-size: 0.92rem; color: var(--text-secondary); line-height: 1.65;
}
.offline-banner-body a { color: var(--accent); text-decoration: none; }
.offline-banner-body a:hover { text-decoration: underline; }

/* ── TRANSPARENCY NOTE (demo footer) ── */
.transparency-note {
  margin-top: 2rem; padding: 1rem 1.25rem;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--sans); font-size: 0.82rem; line-height: 1.7;
  color: var(--text-muted);
}
.transparency-note strong { color: var(--text-secondary); font-weight: 500; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .landing-title { font-size: 2.5rem; }
  .landing-subtitle { font-size: 1.15rem; }
  .page-title { font-size: 2rem; }
  .page-subtitle { font-size: 1.05rem; }
  .input-footer { flex-direction: column; align-items: stretch; }
  .btn-row { justify-content: center; }
  .header-right { gap: 0.75rem; }
  .nav-link { display: none; }
}

/* ── MOBILE NAV FIX (added 2026-05-07) ── */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .header-right { gap: 0.875rem; flex-wrap: wrap; width: 100%; justify-content: flex-start; }
  .nav-link { display: inline; font-size: 0.825rem; }
}
