/* Open Ratings — shared site styles.
   Used by /blog/* and /labs.html. Existing pages (/, /benchmark/*) keep
   their inline styles for now to avoid coupling. Tokens here mirror those
   pages so visual identity stays consistent. */

:root {
  --ink: #1a1a2e;
  --ink-secondary: #4a4a5e;
  --ink-tertiary: #7a7a8e;
  --cream: #faf9f6;
  --cream-warm: #f5f0e8;
  --accent: #1e3a5f;
  --accent-light: #2a5a8f;
  --border: #d4d0c8;
  --border-light: #e8e4dc;
  --highlight: #f0e6d0;
  --grade-aaa: #0a3d1a;
  --grade-aa: #1a5c2a;
  --grade-a: #2a7c3a;
  --grade-bbb: #4a8c2a;
  --grade-bb: #b8860b;
  --grade-b: #c44a00;
  --grade-ccc: #a02020;
  --grade-d: #6b0000;
}

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

body {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.72;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); }

/* HEADER (mirrors index.html / benchmark/*.html) */
.site-header {
  background: var(--ink);
  color: var(--cream);
  padding: 0;
  border-bottom: 3px solid var(--accent-light);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.3px;
  color: var(--cream);
  text-decoration: none;
}
.logo span { color: #6aa3d5; }

.header-nav {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  gap: 32px;
  align-items: center;
}
.header-nav > a {
  color: #a0a8b8;
  text-decoration: none;
  transition: color 0.2s;
}
.header-nav > a:hover, .header-nav > a.active { color: var(--cream); }

.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  color: #a0a8b8;
  text-decoration: none;
  transition: color 0.2s;
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 8px 0;
}
.nav-dropdown-toggle::after { content: ' \25BE'; font-size: 10px; }
.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown-toggle.active { color: var(--cream); }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: -12px;
  background: var(--ink);
  border: 1px solid rgba(255,255,255,0.1);
  min-width: 200px;
  z-index: 100;
  padding: 8px 0;
}
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 16px;
  display: none;
}
.nav-dropdown:hover::after { display: block; }
.nav-dropdown:hover .nav-dropdown-menu { display: block; }

.nav-dropdown-menu a {
  display: block;
  padding: 8px 20px;
  color: #a0a8b8;
  text-decoration: none;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: none;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-menu a:hover {
  background: rgba(255,255,255,0.06);
  color: var(--cream);
}
.nav-dropdown-menu .menu-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #5a6272;
  padding: 8px 20px 4px;
  font-weight: 600;
}
.nav-dropdown-menu .menu-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 6px 0;
}

/* DOC BANNER */
.doc-banner {
  background: linear-gradient(135deg, var(--accent) 0%, #162a45 100%);
  color: var(--cream);
  padding: 48px 40px 40px;
}
.doc-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.doc-type {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #6aa3d5;
  margin-bottom: 12px;
}
.doc-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
}
.doc-subtitle {
  font-size: 18px;
  font-weight: 300;
  color: #b0b8c8;
  margin-bottom: 20px;
  max-width: 680px;
}
.doc-meta {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  color: #8090a8;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.doc-meta strong { color: #a0b0c8; font-weight: 600; }

/* PAGE WRAPPER */
.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px;
}

/* ARTICLE / TYPOGRAPHY */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 {
  font-size: 24px;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 10px;
  color: var(--ink);
}
.prose p {
  margin-bottom: 16px;
  text-align: justify;
  hyphens: auto;
}
.prose p.lead {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-secondary);
  text-align: left;
  margin-bottom: 24px;
}
.prose ul, .prose ol { margin: 0 0 16px 1.4em; }
.prose li { margin-bottom: 6px; }
.prose code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.92em;
  background: var(--cream-warm);
  border: 1px solid var(--border-light);
  padding: 1px 5px;
  border-radius: 3px;
}
.prose pre {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  background: #14141f;
  color: #d8dce6;
  padding: 16px 18px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 16px 0;
}
.prose pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.prose blockquote {
  margin: 16px 0;
  padding: 8px 16px;
  border-left: 3px solid var(--accent-light);
  color: var(--ink-secondary);
  background: var(--cream-warm);
}

/* FOOTER */
.site-footer {
  background: var(--ink);
  color: #6a7080;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  padding: 32px 40px;
  margin-top: 0;
  text-align: center;
  line-height: 1.8;
}
.site-footer strong { color: #a0a8b8; }

/* RESPONSIVE */
@media (max-width: 860px) {
  .header-inner { padding: 16px 20px; }
  .header-nav { gap: 20px; }
  .doc-banner { padding: 32px 20px; }
  .doc-title { font-size: 26px; }
  .page-wrapper { padding: 24px 20px; }
  .prose p { text-align: left; }
}

/* ==========================================================================
   BLOG
   ========================================================================== */

.blog-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  max-width: 760px;
  margin: 0 auto;
}

.post-card {
  border: 1px solid var(--border);
  background: white;
  padding: 24px 28px;
  transition: border-color 0.15s, transform 0.15s;
  text-decoration: none;
  color: var(--ink);
  display: block;
}
.post-card:hover {
  border-color: var(--accent-light);
}
.post-card .post-meta {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin-bottom: 8px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.post-card .post-meta .post-tag {
  color: var(--accent-light);
}
.post-card h2.post-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--accent);
}
.post-card .post-excerpt {
  font-size: 15px;
  color: var(--ink-secondary);
  line-height: 1.65;
  margin-bottom: 12px;
}
.post-card .post-readmore {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent-light);
}

.blog-list-empty {
  text-align: center;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--ink-tertiary);
  padding: 40px 0;
}

/* Post page */
.post-header {
  max-width: 760px;
  margin: 0 auto 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}
.post-header .post-meta {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.post-header .post-meta .post-tag { color: var(--accent-light); }
.post-header h1.post-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 12px;
}
.post-header .post-byline {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  color: var(--ink-secondary);
}

.post-footer-nav {
  max-width: 760px;
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
}
.post-footer-nav a { color: var(--accent-light); text-decoration: none; }
.post-footer-nav a:hover { text-decoration: underline; }

/* ==========================================================================
   LABS / DEMOS
   ========================================================================== */

.lab-section {
  max-width: 920px;
  margin: 0 auto 56px;
  border: 1px solid var(--border);
  background: white;
}
.lab-section-header {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border-light);
}
.lab-section-header h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.lab-section-header p {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.6;
}
.lab-canvas {
  padding: 24px 28px;
  background: var(--cream);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: center;
}
.lab-canvas svg { display: block; max-width: 100%; height: auto; }

.lab-controls {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 28px;
  background: var(--cream-warm);
  border-top: 1px solid var(--border-light);
  align-items: center;
}
.lab-controls label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink-secondary);
}
.lab-controls button {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--cream);
  border: 0;
  padding: 8px 14px;
  cursor: pointer;
}
.lab-controls button:hover { background: var(--accent); }
.lab-controls select, .lab-controls input[type="range"] {
  font-family: inherit;
}

.lab-code {
  border-top: 1px solid var(--border-light);
  background: #14141f;
  color: #d8dce6;
}
.lab-code-toggle {
  width: 100%;
  text-align: left;
  padding: 10px 28px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #a0a8b8;
  background: #14141f;
  border: 0;
  cursor: pointer;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.lab-code-toggle:hover { color: var(--cream); }
.lab-code-toggle::before { content: '\25B8 '; }
.lab-code-toggle.open::before { content: '\25BE '; }
.lab-code pre {
  margin: 0;
  padding: 12px 28px 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  display: none;
}
.lab-code.open pre { display: block; }

.lab-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: var(--cream);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 50;
}
