/* OpenTRE Editorial Design System
   Inspired by: explainers.blog, paraschopra.github.io/explainers
   Typography: Newsreader (headlines) + Source Serif 4 (body) + Inter (UI)
   Palette: Warm editorial with teal/navy/amber accents
*/

/* ================================================================
   CSS CUSTOM PROPERTIES
   ================================================================ */
:root {
  /* Backgrounds */
  --bg-primary: #FAFAF7;
  --bg-surface: #F3F1EC;
  --bg-card: #FFFFFF;
  --bg-code: #F7F5F0;
  --bg-blockquote: #F0EDE6;

  /* Text */
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #7a7a8a;
  --text-inverse: #FAFAF7;

  /* Accents */
  --accent-teal: #0A6E6E;
  --accent-teal-light: #E0F2F1;
  --accent-navy: #1B2A4A;
  --accent-amber: #C17817;
  --accent-amber-light: #FFF8E1;
  --accent-purple: #4A1B6D;
  --accent-green: #2E7D32;
  --accent-red: #B71C1C;
  --accent-gold: #B8860B;
  --accent-gold-light: #FFF8E1;
  --accent-steel: #4A6274;
  --accent-steel-light: #E8EEF2;

  /* Borders */
  --border-light: #E8E4DD;
  --border-medium: #D0CCC4;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 8px 30px rgba(26, 26, 46, 0.12);

  /* Typography scale (modular, 1.25 ratio) */
  --font-headline: 'Newsreader', 'Georgia', serif;
  --font-body: 'Source Serif 4', 'Georgia', serif;
  --font-ui: 'Inter', -apple-system, sans-serif;

  --text-xs: 0.8rem;
  --text-sm: 0.875rem;
  --text-base: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;
  --text-5xl: 3.75rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --content-width: 720px;
  --wide-width: 960px;
  --full-width: 1200px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

/* ================================================================
   READING PROGRESS BAR
   ================================================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  z-index: 1000;
  transition: width 100ms linear;
}

/* Per-document accent colors */
.doc-blueprint .progress-bar { background: linear-gradient(90deg, var(--accent-navy), var(--accent-teal)); }
.doc-blog .progress-bar { background: linear-gradient(90deg, var(--accent-amber), #D4451A); }
.doc-sixpages .progress-bar { background: linear-gradient(90deg, var(--accent-teal), var(--accent-green)); }
.doc-manifesto .progress-bar { background: linear-gradient(90deg, var(--accent-purple), var(--accent-navy)); }
.doc-roadmap .progress-bar { background: linear-gradient(90deg, var(--accent-green), var(--accent-teal)); }
.doc-rights .progress-bar { background: linear-gradient(90deg, var(--accent-gold), var(--accent-amber)); }
.doc-techspec .progress-bar { background: linear-gradient(90deg, var(--accent-steel), var(--accent-navy)); }
.doc-blog-us .progress-bar { background: linear-gradient(90deg, var(--accent-navy), var(--accent-teal)); }

/* ================================================================
   HERO SECTION
   ================================================================ */
.hero {
  position: relative;
  padding: var(--space-3xl) var(--space-xl) var(--space-2xl);
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Optional background image support - sits above gradient, below text */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  mix-blend-mode: luminosity;
}

/* Per-document hero gradients */
.doc-blueprint .hero::before {
  background: linear-gradient(135deg, #1B2A4A 0%, #0A6E6E 50%, #0D8B8B 100%);
}
.doc-blog .hero::before {
  background: linear-gradient(135deg, #8B4513 0%, #C17817 40%, #D4451A 100%);
}
.doc-sixpages .hero::before {
  background: linear-gradient(135deg, #0A6E6E 0%, #1B5E20 50%, #2E7D32 100%);
}
.doc-manifesto .hero::before {
  background: linear-gradient(135deg, #311B6D 0%, #4A1B6D 40%, #1B2A4A 100%);
}
.doc-roadmap .hero::before {
  background: linear-gradient(135deg, #2E7D32 0%, #0A6E6E 50%, #1B5E20 100%);
}
.doc-rights .hero::before {
  background: linear-gradient(135deg, #8B6914 0%, #B8860B 40%, #C17817 100%);
}
.doc-techspec .hero::before {
  background: linear-gradient(135deg, #2C3E50 0%, #4A6274 50%, #1B2A4A 100%);
}
.doc-blog-us .hero::before {
  background: linear-gradient(135deg, #1B2A4A 0%, #0A6E6E 50%, #0D8B8B 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--wide-width);
  margin: 0 auto;
  width: 100%;
}

.hero-label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-md);
}

.hero-title {
  font-family: var(--font-headline);
  font-size: var(--text-5xl);
  font-weight: 500;
  line-height: 1.1;
  color: #fff;
  margin-bottom: var(--space-lg);
  max-width: 14ch;
}

.hero-subtitle {
  font-family: var(--font-headline);
  font-size: var(--text-xl);
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.85);
  max-width: 40ch;
  margin-bottom: var(--space-2xl);
}

.hero-meta {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ================================================================
   SUITE NAVIGATION (inter-document links)
   ================================================================ */
.suite-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-md) var(--space-xl);
  position: sticky;
  top: 3px;
  z-index: 999;
  overflow: visible;
}

.suite-nav-inner {
  max-width: var(--full-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  overflow: visible;
}


a.suite-nav-label,
.suite-nav-label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  padding: 0;
  background: none;
}
a.suite-nav-label:hover {
  color: var(--text-primary);
  background: none;
}

.suite-nav a {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.suite-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.suite-nav a.active {
  color: var(--accent-teal);
  font-weight: 600;
  background: var(--accent-teal-light);
}

/* Nav logo icon */
.nav-logo {
  height: 20px;
  width: auto;
  vertical-align: middle;
  margin-right: var(--space-xs);
  opacity: 0.7;
}
a.suite-nav-label:hover .nav-logo { opacity: 1; }

/* Nav separator */
.nav-sep {
  color: var(--border-light);
  font-weight: 300;
  margin: 0 var(--space-xs);
  user-select: none;
}

/* Suite dropdown (CSS-only) */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  transition: all var(--transition-fast);
  cursor: pointer;
  background: none;
  border: none;
}
.nav-dropdown-toggle::after {
  content: " \25BE";
  font-size: 0.7em;
  opacity: 0.6;
}
.nav-dropdown-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  z-index: 1000;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: var(--space-sm) 0;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: block;
  padding: var(--space-xs) var(--space-md);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.nav-dropdown-menu a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.nav-dropdown-menu .dropdown-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md) var(--space-xs);
  cursor: default;
}
.nav-dropdown-menu .dropdown-label:hover {
  background: none;
  color: var(--text-muted);
}
.nav-dropdown-menu .dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-xs) 0;
}

/* Subscribe button in nav */
.suite-nav a.nav-subscribe {
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  background: var(--accent-teal);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition-fast);
}
.suite-nav a.nav-subscribe:hover {
  background: var(--accent-teal-dark, #085858);
  color: #fff;
}

/* ================================================================
   TABLE OF CONTENTS (sidebar on desktop)
   ================================================================ */
.toc-wrapper {
  position: fixed;
  left: max(calc((100vw - var(--full-width)) / 2 - 40px), 16px);
  top: 80px;
  width: 200px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  z-index: 50;
  background: rgba(250, 250, 247, 0.95);
  backdrop-filter: blur(8px);
  padding: var(--space-md);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.toc-wrapper.toc-visible {
  opacity: 1;
  pointer-events: auto;
}

.toc {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  line-height: 1.6;
}

.toc-title {
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  font-size: 0.7rem;
}

.toc a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  padding: 3px 0 3px 12px;
  border-left: 2px solid var(--border-light);
  transition: all var(--transition-fast);
}

.toc a:hover {
  color: var(--text-primary);
  border-left-color: var(--border-medium);
}

.toc a.active {
  color: var(--accent-teal);
  border-left-color: var(--accent-teal);
  font-weight: 600;
}

@media (max-width: 1500px) {
  .toc-wrapper { display: none; }
}

/* ================================================================
   MAIN CONTENT AREA
   ================================================================ */
.article-body {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl) var(--space-4xl);
}

/* ================================================================
   HEADINGS
   ================================================================ */
.article-body h2 {
  font-family: var(--font-headline);
  font-size: var(--text-3xl);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-primary);
  margin-top: var(--space-4xl);
  margin-bottom: var(--space-lg);
  scroll-margin-top: 80px;
}

.article-body h2::before {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  margin-bottom: var(--space-md);
  border-radius: 2px;
}

.doc-blueprint .article-body h2::before { background: var(--accent-teal); }
.doc-blog .article-body h2::before { background: var(--accent-amber); }
.doc-sixpages .article-body h2::before { background: var(--accent-green); }
.doc-manifesto .article-body h2::before { background: var(--accent-purple); }
.doc-roadmap .article-body h2::before { background: var(--accent-green); }
.doc-rights .article-body h2::before { background: var(--accent-gold); }
.doc-techspec .article-body h2::before { background: var(--accent-steel); }
.doc-blog-us .article-body h2::before { background: var(--accent-teal); }

.article-body h3 {
  font-family: var(--font-headline);
  font-size: var(--text-2xl);
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-primary);
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-md);
  scroll-margin-top: 80px;
}

.article-body h4 {
  font-family: var(--font-ui);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

/* ================================================================
   PARAGRAPHS & INLINE
   ================================================================ */
.article-body p {
  margin-bottom: var(--space-lg);
}

.article-body strong {
  font-weight: 700;
  color: var(--text-primary);
}

.article-body em {
  font-style: italic;
}

.article-body a {
  color: var(--accent-teal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.article-body a:hover {
  color: var(--accent-navy);
}

/* Drop cap for first paragraph of each section */
.drop-cap::first-letter {
  font-family: var(--font-headline);
  font-size: 3.2em;
  float: left;
  line-height: 0.85;
  margin-right: 0.2em;
  margin-top: 0.07em;
  padding-right: 0.1em;
  color: var(--accent-navy);
  font-weight: 600;
}

@supports (initial-letter: 3) {
  .drop-cap::first-letter {
    initial-letter: 3;
    font-size: unset;
    float: unset;
    line-height: unset;
    margin-top: unset;
    padding-right: unset;
  }
}

/* ================================================================
   BLOCKQUOTES & CALLOUTS
   ================================================================ */
.article-body blockquote {
  background: var(--bg-blockquote);
  border-left: 4px solid var(--accent-teal);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-2xl) 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

.callout {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: var(--space-xl);
  margin: var(--space-2xl) 0;
  box-shadow: var(--shadow-sm);
}

.callout-title {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.callout-teal .callout-title { color: var(--accent-teal); }
.callout-amber .callout-title { color: var(--accent-amber); }
.callout-navy .callout-title { color: var(--accent-navy); }

/* Pull quote */
.pull-quote {
  font-family: var(--font-headline);
  font-size: var(--text-2xl);
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
  color: var(--accent-navy);
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  margin: var(--space-3xl) calc(-1 * var(--space-xl));
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  position: relative;
}

.pull-quote::before {
  content: '\201C';
  font-size: 4rem;
  position: absolute;
  top: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  color: var(--border-light);
  font-family: var(--font-headline);
  line-height: 1;
}

/* ================================================================
   IMAGES
   ================================================================ */
.article-body figure {
  margin: var(--space-3xl) calc(-1 * var(--space-xl));
}

.article-body figure img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.article-body figure figcaption {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-sm);
  padding: 0 var(--space-xl);
}

/* Wide images */
.figure-wide {
  margin-left: calc(-1 * ((var(--wide-width) - var(--content-width)) / 2 + var(--space-xl)));
  margin-right: calc(-1 * ((var(--wide-width) - var(--content-width)) / 2 + var(--space-xl)));
  max-width: var(--wide-width);
}

@media (max-width: 1000px) {
  .figure-wide {
    margin-left: calc(-1 * var(--space-xl));
    margin-right: calc(-1 * var(--space-xl));
  }

  .doc-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .doc-card-wide {
    max-width: 100%;
  }
}

/* ================================================================
   TABLES
   ================================================================ */
.article-body .table-wrapper {
  margin: var(--space-2xl) calc(-1 * var(--space-xl));
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  font-family: var(--font-ui);
}

.article-body thead th {
  background: var(--bg-surface);
  font-weight: 700;
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 2px solid var(--border-medium);
  color: var(--text-primary);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.article-body tbody td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  line-height: 1.5;
}

.article-body tbody tr:hover {
  background: var(--bg-surface);
}

.article-body tbody tr:last-child td {
  border-bottom: none;
}

/* ================================================================
   LISTS
   ================================================================ */
.article-body ul, .article-body ol {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-xl);
}

.article-body li {
  margin-bottom: var(--space-sm);
}

.article-body li::marker {
  color: var(--accent-teal);
}

/* ================================================================
   HORIZONTAL RULE (section dividers)
   ================================================================ */
.article-body hr {
  border: none;
  height: 1px;
  background: var(--border-light);
  margin: var(--space-4xl) 0;
}

.section-divider {
  text-align: center;
  margin: var(--space-4xl) 0;
}

.section-divider::after {
  content: '\2022 \2022 \2022';
  color: var(--border-medium);
  letter-spacing: 1em;
}

/* ================================================================
   CODE / PRE
   ================================================================ */
.article-body code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--accent-navy);
}

.article-body pre {
  background: var(--accent-navy);
  color: #E8E4DD;
  padding: var(--space-xl);
  border-radius: 8px;
  overflow-x: auto;
  margin: var(--space-2xl) 0;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ================================================================
   AUTHOR / FOOTER
   ================================================================ */
.author-bio {
  border-top: 1px solid var(--border-light);
  margin-top: var(--space-4xl);
  padding-top: var(--space-2xl);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.8;
}

/* Social links bar */
.social-links {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  align-items: center;
  margin-top: var(--space-lg);
}
.social-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
}
.social-links a:hover {
  color: var(--accent-teal);
}
.social-links svg {
  width: 20px;
  height: 20px;
}

.article-footer {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl) var(--space-4xl);
}

.citation-box {
  background: var(--bg-surface);
  border-radius: 8px;
  padding: var(--space-lg);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-2xl);
}

.citation-box strong {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ================================================================
   REFERENCES / FOOTNOTES
   ================================================================ */
.references {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.8;
}

.references h2 {
  font-size: var(--text-xl) !important;
}

.references h3 {
  font-size: var(--text-lg) !important;
  margin-top: var(--space-2xl) !important;
}

.references ol {
  padding-left: var(--space-xl);
}

.references li {
  margin-bottom: var(--space-sm);
}

/* ================================================================
   APPENDIX
   ================================================================ */
.appendix {
  border-top: 2px solid var(--border-light);
  margin-top: var(--space-4xl);
  padding-top: var(--space-2xl);
}

.appendix h2 {
  font-size: var(--text-2xl) !important;
}

/* ================================================================
   LANDING PAGE SPECIFIC
   ================================================================ */
.landing-hero {
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-3xl) var(--space-xl) var(--space-2xl);
  background: linear-gradient(135deg, #1B2A4A 0%, #0A6E6E 50%, #2E7D32 100%);
  position: relative;
}

.landing-hero-title {
  font-family: var(--font-headline);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  color: #fff;
  line-height: 1.15;
  max-width: 16ch;
  margin-bottom: var(--space-lg);
}

.landing-hero-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.8);
  max-width: 50ch;
  line-height: 1.5;
  margin-bottom: var(--space-2xl);
}

.landing-hero-author {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.5);
}

.doc-cards {
  max-width: var(--full-width);
  margin: 0 auto;
  padding: var(--space-4xl) var(--space-xl);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2xl);
}

.doc-card-wide {
  grid-column: 1 / -1;
  max-width: 66.666%;
  justify-self: center;
}

.doc-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.doc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.doc-card-hero {
  height: 160px;
  display: flex;
  align-items: flex-end;
  padding: var(--space-lg);
}

.doc-card-hero.blueprint { background: linear-gradient(135deg, #1B2A4A, #0A6E6E); }
.doc-card-hero.blog { background: linear-gradient(135deg, #8B4513, #C17817); }
.doc-card-hero.sixpages { background: linear-gradient(135deg, #0A6E6E, #2E7D32); }
.doc-card-hero.manifesto { background: linear-gradient(135deg, #311B6D, #4A1B6D); }
.doc-card-hero.roadmap { background: linear-gradient(135deg, #2E7D32, #0A6E6E); }
.doc-card-hero.rights { background: linear-gradient(135deg, #8B6914, #B8860B); }
.doc-card-hero.techspec { background: linear-gradient(135deg, #2C3E50, #4A6274); }

.doc-card-tag {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 10px;
  border-radius: 4px;
}

.doc-card-body {
  padding: var(--space-xl);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.doc-card-title {
  font-family: var(--font-headline);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.doc-card-description {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.doc-card-meta {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  :root {
    --text-base: 1rem;
    --text-5xl: 2.25rem;
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
    --text-2xl: 1.5rem;
  }

  .hero {
    min-height: 35vh;
    padding: var(--space-2xl) var(--space-md);
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .article-body {
    padding: var(--space-2xl) var(--space-md) var(--space-3xl);
  }

  .article-body figure {
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
  }

  .article-body .table-wrapper {
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
  }

  .pull-quote {
    font-size: var(--text-xl);
    margin-left: 0;
    margin-right: 0;
  }

  .suite-nav {
    padding: var(--space-sm) var(--space-md);
  }

  .doc-cards {
    grid-template-columns: 1fr;
    padding: var(--space-2xl) var(--space-md);
  }

  .doc-card-wide {
    max-width: 100%;
    grid-column: auto;
  }
}

/* ================================================================
   ANIMATION (scroll-triggered fade-in)
   ================================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   PRINT STYLES
   ================================================================ */
@media print {
  .progress-bar,
  .suite-nav,
  .toc-wrapper { display: none; }

  .hero { min-height: auto; page-break-after: always; }

  .article-body { max-width: 100%; padding: 0; }

  body { font-size: 11pt; }
}

/* ================================================================
   PROTOCOL STACK DIAGRAM
   ================================================================ */
.protocol-stack-diagram {
  background: var(--accent-navy) !important;
  color: #fff !important;
  padding: var(--space-xl) !important;
  border-radius: 12px;
  overflow-x: auto;
  line-height: 1.2 !important;
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.protocol-stack-diagram .ecosystem { color: #fff; font-weight: bold; }
.protocol-stack-diagram .layer-7 { color: #81D4FA; } /* Light Steel */
.protocol-stack-diagram .layer-6 { color: #FFD54F; } /* Light Amber */
.protocol-stack-diagram .layer-5 { color: #81C784; } /* Light Green */
.protocol-stack-diagram .layer-4 { color: #CE93D8; font-weight: bold; } /* Light Purple */
.protocol-stack-diagram .layer-3 { color: #9FA8DA; } /* Light Navy/Indigo */
.protocol-stack-diagram .layer-2 { color: #FFE082; } /* Light Gold */
.protocol-stack-diagram .layer-1 { color: #4DB6AC; } /* Light Teal */
.protocol-stack-diagram .waist-text { color: #fff; text-shadow: 0 0 5px rgba(255,255,255,0.5); }
