/* ═══════════════════════════════════════════════════════════════
   THE AUGMENTED SCHOLAR — REFINEMENT LAYER v2
   Loads after main.css. Reading-first, modern technical-publication
   design: Inter, slate + blue, semantic annotations, quiet chrome.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Global polish ─── */
body { letter-spacing: -0.011em; }
h1, h2, h3, h4 { letter-spacing: -0.022em; }
::selection { background: var(--blue-100); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.btn, .btn--primary, .btn--secondary {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: 0.95rem;
  border-radius: 10px; padding: 11px 22px;
  text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s ease;
}
.btn--primary { background: var(--blue-800); color: #fff; }
.btn--primary:hover { background: var(--blue-700); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--secondary { background: transparent; color: var(--color-text); border-color: var(--color-border-strong); }
.btn--secondary:hover { background: var(--color-bg-alt); text-decoration: none; }

/* ─── Article reading experience ─── */
.article-content, .single-content {
  font-size: 1.09rem;
  line-height: 1.78;
  color: var(--color-text);
}
.article-content > p:first-of-type { font-size: 1.19rem; color: var(--color-text); line-height: 1.7; }
.article-content p { margin: 0 0 1.15em; }
.article-content h2 {
  font-size: 1.6rem; font-weight: 700; line-height: 1.25;
  margin: 2.4em 0 0.7em; padding-top: 1.2em;
  border-top: 1px solid var(--color-border);
}
.article-content h3 { font-size: 1.25rem; font-weight: 600; margin: 1.9em 0 0.6em; }
.article-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--blue-200); }
.article-content a:hover { text-decoration-thickness: 2px; text-decoration-color: var(--blue-500); }
.article-content ul, .article-content ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.article-content li { margin-bottom: 0.45em; }
.article-content li::marker { color: var(--color-text-subtle); }
.article-content img { border-radius: var(--radius-md); }
.article-content hr { border: 0; border-top: 1px solid var(--color-border); margin: 2.5em 0; }

/* Inline code + blocks */
.article-content code {
  font-family: var(--font-mono); font-size: 0.86em;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 6px; padding: 1.5px 6px;
}
.article-content pre {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px 20px; margin: 1.4em 0;
  overflow-x: auto; line-height: 1.65; font-size: 0.875rem;
}
.article-content pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* Tables: journal-clean */
.article-content table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 0.95rem; font-family: var(--font-body); }
.article-content thead th {
  text-align: left; font-weight: 600; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border-strong);
  padding: 10px 12px;
}
.article-content td { border-bottom: 1px solid var(--color-border); padding: 10px 12px; }
.article-content tbody tr:hover { background: var(--color-bg-alt); }

.article-content blockquote {
  border-left: 3px solid var(--color-border-strong);
  margin: 1.6em 0; padding: 4px 0 4px 20px;
  color: var(--color-text-muted); font-style: italic;
}

/* Mono metadata row under titles */
.article-meta-row, .post-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem; letter-spacing: 0.03em;
  color: var(--color-text-subtle);
  margin: 10px 0 26px;
}

/* ─── Semantic annotation system (the signature) ─── */
.note {
  border-left: 3px solid var(--color-border-strong);
  background: var(--color-bg-alt);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px; margin: 1.6em 0;
  font-size: 0.98rem;
}
.note > :last-child { margin-bottom: 0; }
.note__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  margin-bottom: 8px;
}
.note__foot { font-family: var(--font-mono); font-size: 0.78rem; color: var(--color-text-subtle); margin: 10px 0 0; }

.note-measured, .note-verified { border-color: #059669; background: rgba(5,150,105,0.06); }
.note-measured .note__label, .note-verified .note__label { color: #047857; }
.note-verified--stale { border-color: #D97706; background: rgba(217,119,6,0.07); }
.note-verified--stale .note__label { color: #B45309; }
.note-caveat { border-color: #EA580C; background: rgba(234,88,12,0.06); }
.note-caveat .note__label { color: #C2410C; }
.note-info { border-color: #0284C7; background: rgba(2,132,199,0.06); }
.note-info .note__label { color: #0369A1; }
.note-disclosure { border-color: #D97706; background: rgba(217,119,6,0.07); }
.note-disclosure .note__label { color: #B45309; }

[data-theme="dark"] .note-measured, [data-theme="dark"] .note-verified { background: rgba(5,150,105,0.12); }
[data-theme="dark"] .note-measured .note__label, [data-theme="dark"] .note-verified .note__label { color: #34D399; }
[data-theme="dark"] .note-caveat { background: rgba(234,88,12,0.12); }
[data-theme="dark"] .note-caveat .note__label { color: #FB923C; }
[data-theme="dark"] .note-info { background: rgba(2,132,199,0.12); }
[data-theme="dark"] .note-info .note__label { color: #38BDF8; }
[data-theme="dark"] .note-disclosure, [data-theme="dark"] .note-verified--stale { background: rgba(217,119,6,0.12); }
[data-theme="dark"] .note-disclosure .note__label, [data-theme="dark"] .note-verified--stale .note__label { color: #FBBF24; }

/* Diff metric — before/after in code-diff language */
.diff-metric {
  font-family: var(--font-mono); font-size: 0.86rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 6px 0;
  display: grid; gap: 4px;
}
.diff-metric .row { display: flex; gap: 12px; }
.diff-metric .row .val { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.diff-metric .minus, .diff-metric .row.minus span { color: #C2410C; }
.diff-metric .plus, .diff-metric .row.plus span { color: #047857; }
[data-theme="dark"] .diff-metric .minus, [data-theme="dark"] .diff-metric .row.minus span { color: #FB923C; }
[data-theme="dark"] .diff-metric .plus, [data-theme="dark"] .diff-metric .row.plus span { color: #34D399; }

/* ─── Cards ─── */
.card-article, .card, .tool-card, .card-tool, .workshop-card, .resource-card, .service-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
[data-theme="dark"] .card-article, [data-theme="dark"] .card, [data-theme="dark"] .tool-card,
[data-theme="dark"] .workshop-card, [data-theme="dark"] .resource-card, [data-theme="dark"] .service-card { background: var(--color-bg-alt); }
.card-article:hover, .card:hover, .tool-card:hover, .card-tool:hover, .workshop-card:hover, .resource-card:hover, .service-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card { padding: 22px; }
.card__title { font-weight: 600; font-size: 1.06rem; color: var(--color-text); transition: color 0.12s ease; }
.card:hover .card__title { color: var(--color-accent); }

/* ─── Homepage ─── */
.hero { max-width: 1080px; margin: 0 auto; padding: 88px 20px 56px; }
.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 700; line-height: 1.08;
  margin: 14px 0 18px; max-width: 17ch;
}
.hero .sub { font-size: 1.16rem; color: var(--color-text-muted); max-width: 52ch; line-height: 1.65; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.home-section { max-width: 1080px; margin: 0 auto; padding: 0 20px 72px; }
.home-section .section-heading {
  font-size: 1.5rem; font-weight: 700; margin: 8px 0 22px;
}
.track-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.track-card { text-decoration: none; color: inherit; display: block; }
.track-card p { color: var(--color-text-muted); margin: 8px 0 0; font-size: 0.94rem; line-height: 1.55; }

.proof-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; max-width: 1080px; margin: 0 auto 64px; padding: 0 20px; }
.proof-strip .proof {
  border: 1px solid var(--color-border);
  border-left: 3px solid #059669;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: rgba(5,150,105,0.05);
  padding: 16px; text-decoration: none; color: inherit;
  transition: box-shadow 0.15s ease;
}
.proof-strip .proof:hover { box-shadow: var(--shadow-md); }
.proof-strip .task {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: #047857; display: block; margin-bottom: 8px;
}

/* ─── Newsletter CTA — quiet panel ─── */
.newsletter-cta {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 34px; margin: 56px auto; max-width: 680px;
}
.newsletter-cta h3 { font-size: 1.3rem; font-weight: 700; margin: 8px 0 6px; }
.newsletter-cta p { color: var(--color-text-muted); margin: 0 0 18px; }
.newsletter-cta .trust { font-family: var(--font-mono); font-size: 0.78rem; color: var(--color-text-subtle); margin: 14px 0 0; }

/* ─── Footer ─── */
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px; }
.footer-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.footer-list a { color: var(--color-text-muted); text-decoration: none; font-size: 0.94rem; }
.footer-list a:hover { color: var(--color-text-link); }
.colophon {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--color-text-subtle);
  margin-top: 44px; border-top: 1px solid var(--color-border); padding-top: 22px;
}
.site-footer { background: var(--color-bg); border-top: 1px solid var(--color-border); }
.footer-wrap { max-width: 1080px; margin: 0 auto; padding: 56px 20px 36px; }

/* ─── A11y & motion ─── */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ═══ University learning-hub layer ═══ */
.eyebrow--gold { color: var(--gold-deep); }

.hero-band {
  background: linear-gradient(180deg, var(--blue-50) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-border);
}
[data-theme="dark"] .hero-band { background: linear-gradient(180deg, var(--blue-50) 0%, var(--color-bg) 100%); }
.hero h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  max-width: 22ch;
}
.section-heading { font-family: var(--font-heading); font-weight: 700; }
.page-title, .article-title { font-family: var(--font-heading); }

.stats-row {
  display: flex; flex-wrap: wrap; gap: 12px 36px;
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--color-border);
}
.stat { font-size: 0.94rem; color: var(--color-text-muted); }
.stat strong {
  font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700;
  color: var(--color-text); margin-right: 7px;
}

.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.pillar-card { position: relative; text-decoration: none; color: inherit; display: block; padding-top: 26px; overflow: hidden; }
.pillar-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--pc, var(--color-accent));
}
.pillar-card-count {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--color-text-subtle);
  display: block; margin-bottom: 8px;
}
.pillar-card p { color: var(--color-text-muted); font-size: 0.92rem; line-height: 1.55; margin: 8px 0 0; }

.strip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.strip-card { text-decoration: none; color: inherit; display: block; }
.strip-card .eyebrow { color: var(--gold-deep); font-size: 0.7rem; margin-bottom: 8px; display: block; }
.strip-card p { color: var(--color-text-muted); font-size: 0.92rem; line-height: 1.55; margin: 8px 0 0; }

.section-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.section-header .section-heading { margin-bottom: 0; }
.section-link { font-weight: 500; white-space: nowrap; }
