/*
  AIWiki readability pass.
  Layered after the page-local styles so the content stays intact while the
  whole aiwiki system gains a more editorial, legible presentation.
*/

:root {
  --void: #07080d;
  --deep: #0d1018;
  --surface: #121722;
  --surface-light: #1a2130;
  --dim: #596170;
  --muted: #8d96aa;
  --light: #c5cede;
  --bright: #e0e7f2;
  --white: #f7f4ec;
  --gold: #f0b84f;
  --cyan: #58d7d3;
  --violet: #a88cff;
  --rose: #ff6f9f;
  --green: #69d78b;
}

html {
  font-size: 18px;
}

body {
  background: var(--void);
  color: var(--bright);
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a {
  text-underline-offset: 0.18em;
}

.unified-nav {
  min-height: 58px;
  padding: 0.85rem 2rem;
  background: rgba(7, 8, 13, 0.92);
  border-bottom-color: rgba(240, 184, 79, 0.16);
}

.un-logo,
.un-links a,
.un-mobile-menu a,
.hero-label,
.section-num,
.label,
.card-tag,
.res-tag,
.stat-label,
.method-key,
.footer-tag,
.declaration-title,
.status-pill,
.pill-policy,
.status-legend .key,
.aiwiki-card .stat-label,
.aiwiki-card .empty-line,
.link-btn,
.version {
  letter-spacing: 0;
}

.un-logo {
  font-size: 0.82rem;
  font-weight: 500;
}

.un-links a {
  font-size: 0.76rem;
  color: var(--light);
}

.un-links a.active {
  color: var(--gold);
}

.page {
  max-width: 1240px;
  width: 100%;
  padding: 76px 2.25rem 5rem;
}

.narrow,
.section-narrow {
  max-width: 900px;
}

.hero {
  max-width: 1040px;
  padding: 2.8rem 0 2.4rem;
}

.hero-label {
  font-size: 0.82rem;
  color: var(--gold);
  margin-bottom: 1.3rem;
}

.hero-title {
  font-size: 4.35rem;
  line-height: 1.02;
  color: var(--white);
  margin-bottom: 1.45rem;
  overflow-wrap: break-word;
}

.hero-sub {
  max-width: 880px;
  color: var(--bright);
  font-size: 1.18rem;
  line-height: 1.72;
  overflow-wrap: break-word;
}

.hero-sub strong,
.lead strong,
.method-val strong,
.card-body strong,
.empty-callout strong {
  color: var(--white);
}

.hero-stats {
  max-width: 980px;
  gap: 1rem;
  margin-top: 2.6rem;
}

.stat {
  padding: 1.35rem 1rem;
  border-color: rgba(240, 184, 79, 0.22);
  background: rgba(18, 23, 34, 0.78);
  border-radius: 8px;
}

.stat-value,
.aiwiki-card .stat-val {
  font-size: 2.6rem;
  color: var(--gold);
}

.stat-label,
.aiwiki-card .stat-label {
  color: var(--light);
  font-size: 0.72rem;
  line-height: 1.35;
}

.note-box,
.status-legend,
.method-panel,
.declaration,
.empty-callout,
.res-link,
.card,
.future-card {
  border-radius: 8px;
  background-color: rgba(18, 23, 34, 0.76);
}

.note-box {
  max-width: 900px;
  padding: 1.8rem 2rem;
  font-size: 1.03rem;
  color: var(--bright);
  border-left-width: 4px;
}

.section {
  padding: 4.4rem 0 1.7rem;
}

.section-header {
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.4rem;
  border-bottom-color: rgba(240, 184, 79, 0.2);
}

.section-num {
  font-size: 0.84rem;
  color: var(--gold);
  opacity: 1;
}

.section-title {
  font-size: 2.55rem;
  line-height: 1.1;
}

.lead {
  color: var(--bright);
  font-size: 1.14rem;
  line-height: 1.72;
  margin-bottom: 1.7rem;
}

.note {
  color: var(--light);
  font-size: 1rem;
}

.aiwiki-grid {
  gap: 1.35rem;
}

.aiwiki-card {
  padding: 2rem;
  border-color: rgba(240, 184, 79, 0.24);
  background: rgba(18, 23, 34, 0.78);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.aiwiki-card:hover,
.res-link:hover,
.card:hover {
  transform: translateY(-2px);
}

.aiwiki-card .status-line {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.aiwiki-card .status-pill,
.status-pill,
.pill-policy {
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 0.34rem 0.72rem;
}

.aiwiki-card .version {
  font-size: 0.78rem;
  color: var(--light);
  padding-top: 0.25rem;
}

.aiwiki-card h3 {
  font-size: 2rem;
  line-height: 1.08;
  margin-bottom: 0.8rem;
}

.aiwiki-card .tagline {
  color: var(--bright);
  font-size: 1.02rem;
  line-height: 1.62;
}

.aiwiki-card .stats-row {
  gap: 0.7rem;
  padding: 1.05rem 0;
}

.aiwiki-card .empty-line {
  color: var(--rose);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.98rem;
  line-height: 1.5;
}

.aiwiki-card .links-row {
  gap: 0.55rem;
  font-size: 0.78rem;
}

.link-btn {
  min-height: 2.45rem;
  padding: 0.58rem 0.86rem;
  border-radius: 6px;
  font-weight: 600;
}

.status-legend {
  padding: 1.55rem 1.7rem;
  font-size: 1rem;
  color: var(--bright);
  border-left-width: 4px;
}

.how-to-read {
  margin: 1.7rem 0 !important;
  padding: 1.35rem 1.55rem !important;
  border-left-width: 4px !important;
  border-radius: 8px !important;
  background: rgba(240, 184, 79, 0.075) !important;
  color: var(--bright) !important;
  font-size: 1rem !important;
  line-height: 1.65 !important;
}

.how-to-read span:first-child {
  color: var(--gold) !important;
  font-size: 0.78rem !important;
  letter-spacing: 0 !important;
}

.status-legend .key {
  font-size: 0.78rem;
}

.status-legend .row {
  grid-template-columns: 145px 1fr;
  gap: 1rem;
}

.declaration {
  max-width: 840px;
  padding: 3rem 2.5rem;
  border-color: rgba(240, 184, 79, 0.35);
}

.declaration-title {
  font-size: 0.78rem;
}

.declaration-text {
  font-size: 2rem;
  line-height: 1.38;
}

.bill-grid {
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)) !important;
  gap: 0.55rem;
  margin: 2rem 0 1.2rem;
}

.bill-cell {
  aspect-ratio: auto;
  min-height: 5rem;
  border-radius: 8px;
  font-size: 0.82rem;
  padding: 0.7rem 0.45rem;
}

.bill-cell .bn {
  font-size: 1.32rem;
}

.bill-cell .bc {
  font-size: 0.78rem;
  line-height: 1.18;
}

.heatmap-legend,
.bill-legend {
  gap: 0.9rem 1.25rem;
  color: var(--light);
  font-size: 0.9rem;
  line-height: 1.45;
}

.empty-callout {
  padding: 2.4rem;
  margin: 3rem 0;
  border-width: 2px;
  border-radius: 8px;
}

.empty-callout h3,
.empty-callout-title {
  font-size: 1.95rem;
  line-height: 1.12;
  margin-bottom: 1rem;
}

.empty-callout p,
.empty-callout-text {
  color: var(--bright);
  font-size: 1.06rem;
  line-height: 1.7;
}

.closure-table {
  overflow-x: auto;
}

.closure-table > div {
  grid-template-columns: 64px minmax(0, 1fr) 92px 92px !important;
  gap: 0.75rem 1rem !important;
}

.closure-table > div > span {
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
}

.closure-table strong {
  font-size: 1rem !important;
}

.method-panel {
  padding: 1.85rem 2rem;
  border-color: rgba(88, 215, 211, 0.18);
}

.method-row {
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
  gap: 1rem 1.35rem;
  align-items: start;
  padding: 1rem 0;
}

.method-key {
  color: var(--gold);
  font-size: 0.82rem;
  line-height: 1.35;
  padding-top: 0.05rem;
}

.method-val {
  color: var(--bright);
  font-size: 1.02rem;
  line-height: 1.65;
}

.cards,
.cards-2,
.cards-3,
.resources,
.future-grid {
  gap: 1rem;
}

.cards-3,
.cards-2,
.resources {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.card,
.res-link,
.future-card {
  padding: 1.55rem;
  border-color: rgba(88, 215, 211, 0.16);
}

.card-tag,
.res-tag {
  font-size: 0.76rem;
  color: var(--cyan);
}

.card-title,
.res-title {
  font-size: 1.45rem;
  line-height: 1.22;
}

.card-body,
.res-desc,
.future-card p {
  color: var(--bright);
  font-size: 1rem;
  line-height: 1.65;
}

.card-body a,
.res-link a,
.hero-sub a,
.footer a {
  color: var(--cyan) !important;
}

.neg-list li {
  color: var(--bright);
  font-size: 1.03rem;
  line-height: 1.65;
}

.bill-detail {
  font-size: 1rem;
  gap: 0.75rem 1.6rem;
}

.bill-detail-row {
  align-items: baseline;
}

.bill-detail-num,
.bill-detail-count {
  font-size: 0.86rem;
}

.timeline {
  font-size: 1rem;
}

.tl-date {
  font-size: 0.82rem;
}

.tl-title,
.tl-detail {
  font-size: 1.02rem;
  line-height: 1.6;
}

.footer {
  color: var(--light);
  font-size: 0.96rem;
}

.footer p {
  font-size: 0.96rem;
}

@media (max-width: 920px) {
  html {
    font-size: 17px;
  }

  .page {
    padding: 70px 1.25rem 4rem;
  }

  .hero {
    padding: 2.4rem 0 2rem;
  }

  .hero-title {
    font-size: 3.05rem;
  }

  .hero-sub,
  .lead {
    font-size: 1.08rem;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-title {
    font-size: 2.15rem;
  }

  .aiwiki-grid[style] {
    grid-template-columns: 1fr !important;
  }

  .aiwiki-card[style*="grid-column"] {
    grid-column: auto !important;
  }

  .method-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .unified-nav {
    min-height: 54px;
    padding: 0.75rem 1rem;
  }

  .hero-title {
    font-size: 2.22rem;
    line-height: 1.08;
  }

  .hero-label {
    font-size: 0.72rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
  }

  .stat-value,
  .aiwiki-card .stat-val {
    font-size: 2.05rem;
  }

  .section-header {
    align-items: flex-start;
  }

  .section-line {
    display: none;
  }

  .aiwiki-card,
  .empty-callout,
  .method-panel,
  .note-box,
  .status-legend,
  .declaration {
    padding: 1.35rem;
  }

  .status-legend .row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .bill-grid {
    grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)) !important;
  }

  .closure-table > div {
    grid-template-columns: 1fr !important;
  }
}
