/* TXFR Foundation — publication stylesheet
   Generated site chrome + document reading experience.
   Restrained: deep navy/near-black, warm gold accent, warm document surface. */

:root {
  --navy-900: #0b0e14;
  --navy-800: #10141d;
  --navy-700: #171d2b;
  --navy-600: #232a3b;
  --gold-500: #c9a24b;
  --gold-400: #d9b968;
  --paper: #faf7f1;
  --paper-border: #e6ddc9;
  --ink-900: #1b1a17;
  --ink-700: #3a382f;
  --ink-500: #6b6a5e;
  --muted-bg: #eceae4;
  --muted-border: #d8d5cb;
  --status-ratified-bg: #f1e8cf;
  --status-ratified-fg: #7a5c14;
  --status-historical-bg: #e4e2dc;
  --status-historical-fg: #5c5a52;
  --max-width: 780px;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--navy-900);
  color: var(--ink-900);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  font-size: 17px;
  overflow-x: hidden;
}

a { color: #8a6a1e; text-decoration: none; border-bottom: 1px solid rgba(138,106,30,0.35); }
a:hover { border-bottom-color: #8a6a1e; }

/* ---------- Header / Nav ---------- */

.site-header {
  background: var(--navy-900);
  border-bottom: 1px solid var(--navy-600);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 1rem 1.5rem;
}

.wordmark {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--gold-400);
  border-bottom: none;
  white-space: nowrap;
}
.wordmark span {
  font-weight: 400;
  color: #cfd3dc;
  margin-left: 0.4em;
  letter-spacing: 0.02em;
}
.wordmark:hover { border-bottom: none; opacity: 0.9; }

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  align-items: center;
}
.site-header nav a {
  color: #cfd3dc;
  border-bottom: 1px solid transparent;
  font-size: 0.95rem;
}
.site-header nav a:hover,
.site-header nav a.active {
  color: var(--gold-400);
  border-bottom-color: var(--gold-400);
}
.nav-sep {
  color: var(--navy-600);
  font-size: 0.9rem;
}
.nav-historical {
  color: #9a978c !important;
  font-style: italic;
}
.nav-historical:hover { color: var(--gold-400) !important; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-900);
  border-top: 1px solid var(--navy-600);
  color: #9aa0ad;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}
.site-footer a { color: #b9bfca; border-bottom-color: rgba(185,191,202,0.35); }
.site-footer a:hover { color: var(--gold-400); border-bottom-color: var(--gold-400); }

/* ---------- Main / document surface ---------- */

main { background: var(--navy-900); }

.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.doc-surface {
  background: var(--paper);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius);
  padding: 2.25rem 2rem 2.75rem;
}

@media (max-width: 640px) {
  .doc-surface { padding: 1.5rem 1.1rem 2rem; }
  .page-wrap { padding: 1.5rem 0.85rem 3rem; }
  body { font-size: 16px; }
}

/* ---------- Metadata banner ---------- */

.pub-banner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 0;
}

.pub-banner .eyebrow {
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.pub-banner h1 {
  color: #f2eee2;
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0 0 1rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28em 0.7em;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-id { background: var(--navy-700); color: #cfd3dc; border-color: var(--navy-600); }
.badge-version { background: var(--navy-700); color: #cfd3dc; border-color: var(--navy-600); }
.badge-class { background: var(--navy-700); color: #cfd3dc; border-color: var(--navy-600); }
.badge-status-ratified { background: var(--status-ratified-bg); color: var(--status-ratified-fg); }
.badge-status-historical { background: var(--status-historical-bg); color: var(--status-historical-fg); }
.badge-supreme { background: var(--gold-500); color: #241b04; }

.pub-meta-line {
  color: #b9bfca;
  font-size: 0.92rem;
  margin: 0 0 0.35rem;
}
.pub-meta-line code {
  background: var(--navy-700);
  color: var(--gold-400);
  border-radius: 3px;
  padding: 0.1em 0.4em;
  font-size: 0.85em;
}

.historical-callout {
  margin-top: 1rem;
  background: var(--navy-700);
  border: 1px solid var(--navy-600);
  border-left: 3px solid #9a978c;
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  color: #cfd3dc;
  font-size: 0.92rem;
}
.historical-callout strong { color: #f2eee2; }

.back-link {
  display: inline-block;
  margin-top: 0.25rem;
  color: #9aa0ad;
  font-size: 0.88rem;
  border-bottom-color: rgba(154,160,173,0.35);
}
.back-link:hover { color: var(--gold-400); border-bottom-color: var(--gold-400); }

/* ---------- Document typography (inside .doc-surface) ---------- */

.doc-surface h1 {
  font-size: 1.65rem;
  color: var(--ink-900);
  margin: 0 0 0.6em;
  line-height: 1.3;
}
.doc-surface h2 {
  font-size: 1.32rem;
  color: var(--ink-900);
  margin: 2.1em 0 0.7em;
  padding-top: 0.2em;
  border-top: 1px solid var(--muted-border);
  line-height: 1.35;
}
.doc-surface > h2:first-of-type,
.doc-surface > *:first-child.doc-surface h2 { border-top: none; }
.doc-surface h3 {
  font-size: 1.08rem;
  color: var(--ink-900);
  margin: 1.6em 0 0.5em;
}
.doc-surface h4 {
  font-size: 0.98rem;
  color: var(--ink-700);
  margin: 1.4em 0 0.4em;
  text-transform: none;
}

.doc-surface p { margin: 0 0 1.05em; color: var(--ink-900); }
.doc-surface strong { color: var(--ink-900); font-weight: 700; }
.doc-surface em { color: var(--ink-700); }

.doc-surface ul, .doc-surface ol {
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}
.doc-surface li { margin-bottom: 0.4em; }
.doc-surface li > ul, .doc-surface li > ol { margin-top: 0.4em; }

.doc-surface blockquote {
  margin: 1.3em 0;
  padding: 0.2em 1.1em;
  border-left: 3px solid var(--gold-500);
  background: var(--muted-bg);
  color: var(--ink-700);
  border-radius: 0 4px 4px 0;
}
.doc-surface blockquote p:last-child { margin-bottom: 0.3em; }

.doc-surface hr {
  border: none;
  border-top: 1px solid var(--muted-border);
  margin: 2.4em 0;
}

.doc-surface code {
  background: var(--muted-bg);
  border: 1px solid var(--muted-border);
  border-radius: 3px;
  padding: 0.12em 0.4em;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #6a4e0f;
  word-break: break-word;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.4em 0;
  border: 1px solid var(--muted-border);
  border-radius: 5px;
  -webkit-overflow-scrolling: touch;
}
.doc-surface table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 0.94rem;
}
.doc-surface th, .doc-surface td {
  border-bottom: 1px solid var(--muted-border);
  padding: 0.55em 0.8em;
  text-align: left;
  vertical-align: top;
}
.doc-surface thead th {
  background: var(--muted-bg);
  color: var(--ink-700);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.doc-surface tr:last-child td { border-bottom: none; }

/* ---------- Landing page ---------- */

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 1.5rem;
  text-align: left;
}
.hero .eyebrow {
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
}
.hero h1 {
  color: #f6f2e6;
  font-size: 2.5rem;
  margin: 0 0 0.9rem;
  line-height: 1.15;
}
.hero p.lede {
  color: #cfd3dc;
  font-size: 1.08rem;
  max-width: 620px;
  margin: 0 0 1.2rem;
}
.status-line {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--navy-700);
  border: 1px solid var(--navy-600);
  border-radius: 999px;
  padding: 0.4em 1em;
  color: #e7e2d2;
  font-size: 0.9rem;
  font-weight: 600;
}
.status-line .dot {
  width: 0.55em; height: 0.55em; border-radius: 50%;
  background: var(--gold-500);
  display: inline-block;
}

.hierarchy-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}
.hierarchy-section h2 {
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 2.2rem 0 1rem;
  border: none;
}
.hierarchy-section h2:first-child { margin-top: 0; }

.pub-card {
  display: block;
  background: var(--navy-700);
  border: 1px solid var(--navy-600);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 0.9rem;
  color: #e7e2d2;
}
.pub-card:hover { border-color: var(--gold-500); }
.pub-card.supreme { border-color: var(--gold-500); border-width: 1.5px; }
.pub-card .pub-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #f6f2e6;
  margin: 0 0 0.3rem;
  border: none;
}
.pub-card .pub-card-desc {
  color: #b9bfca;
  font-size: 0.94rem;
  margin: 0 0 0.6rem;
}
.pub-card .badge-row { margin-bottom: 0; }

.hierarchy-flow {
  color: #9aa0ad;
  font-size: 0.85rem;
  text-align: center;
  margin: -0.3rem 0 1.1rem;
  letter-spacing: 0.02em;
}

.divider-note {
  color: #7a7f8c;
  font-size: 0.82rem;
  text-align: center;
  margin: 2.6rem 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pub-card.historical {
  background: var(--navy-800);
  border-style: dashed;
  opacity: 0.92;
}
.pub-card.historical .pub-card-title { color: #cfd3dc; }

/* Focus visibility for keyboard nav */
a:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }
