/* Shared reading scale: white surfaces, near-black text, usable secondary type. */
@media (max-width: 650px) {
  #projects .section-top { flex-direction: column; align-items: flex-start; gap: 16px; }
  #main #projects .section-top > p { max-width: none; margin-top: 0; }
  #main .closing h2 { font-size: clamp(20px, 5.5vw, 24px); text-wrap: balance; }
}
:root {
  --read-body: 18px;
  --read-small: 14px;
  --read-ink: #111;
  --read-secondary: #404040;
  --paper: #fff;
  --ink: #111;
  --muted: #404040;
  --line: #dedede;
  --text-xs: .875rem;
  --text-xs--line-height: 1.5;
  --text-sm: 1rem;
  --text-sm--line-height: 1.5;
}
html { -webkit-text-size-adjust: 100%; }
body { background: #fff; color: var(--read-ink); font-size: var(--read-body); line-height: 1.75; }
button, input, select, textarea { font-size: 16px; }
input::placeholder, textarea::placeholder { color: #595959; opacity: 1; }
:focus-visible { outline: 2px solid #111; outline-offset: 4px; }

/* The portfolio shell. Keep artwork's own foreground/background pairings. */
#main p { font-size: var(--read-body); line-height: 1.85; color: var(--read-ink); }
#main :is(.project-art, .room-art, .space-cover, .wave-poster, .ib-cinema) p { color: inherit; }
#main :is(.eyebrow, .local-hint, .prototype-note, .entry-tag, .project-meta,
  .project-meta span, .status-chip, .room-kicker, .space-topline, .section-index,
  .about-bottom, .journal-date, .room-section-header > p) {
  font-size: var(--read-small); color: var(--read-secondary); line-height: 1.65;
}
#main :is(.local-hint, .prototype-note, .room-section-header > p) { font-size: 14px; }
#main .hero-description { font-size: 19px; color: #222; line-height: 1.8; max-width: 42rem; }
#main .project-title h3, #main .journal-entry h3 { font-size: 23px; color: #111; line-height: 1.5; }
#main .project-card > a > p { font-size: 17px; color: #333; line-height: 1.8; }
#main .section-top > p { font-size: 16px; color: #333; line-height: 1.8; }
#main .about-copy p, #main .about-detailed-copy > p { max-width: 46rem; }
#main .journal-entry p { max-width: 46rem; }
#main .journal-entry .entry-actions { font-size: 15px; color: #333; }
#main .filters { row-gap: 10px; }
#main .filter { font-size: 15px; padding: 9px 15px; color: #333; }
#main .filter[aria-pressed=true] { color: #fff; }
#main .filter sup { font-size: 14px; opacity: 1; }
#main .searchbox input { font-size: 16px; }
#main .method-heading p { font-size: 16px; line-height: 1.8; color: #333; }
#main .method-table thead th { font-size: 14px; color: #404040; }
#main .method-table td:last-child { font-size: 17px; line-height: 1.8; color: #111; }
#main .method-table td span { font-size: 14px; color: #404040; }
#main .method-table td strong { color: #111; }
.site-header { background: #fff; }
.about-section { background: #fff; }
#main-nav .about-nav, #main-nav a:hover, #main-nav a[aria-current=page] { color: #111; }
#main .wave-copy .eyebrow { color: #f5f5f5; }
#main .space-cover .room-kicker { color: inherit; }
#main :is(.wave-caption span, .journal-date b, .about-tags span,
  .space-nav button, .space-nav-status, .draft-badge, .overview-meta dt) { color: #404040; }
#main .overview-meta dd { font-size: 17px; line-height: 1.8; color: #111; }
.footer-spaces, .footer-links, .footer-bottom, .footer-brand span { font-size: 14px; color: #333; }
.footer-spaces > span, .footer-links > span { color: #404040; }
.footer-spaces a, .footer-links a, .footer-links button { line-height: 1.7; }
.dialog-description, .dialog-actions > span { color: #404040; line-height: 1.75; }
.dialog-description { font-size: 16px; }
.field { font-size: 16px; color: #111; }
.field :is(input, textarea, select) { font-size: 17px; line-height: 1.65; }
.search-result p { font-size: 16px; line-height: 1.75; color: #333; }
.search-result small, .search-results-status { font-size: 14px; color: #404040; }

/* Idea box: the screenshot's article and both other reading tabs. */
.ib-space { --ib-ink: #111; --ib-muted: #404040; --ib-line: #dedede; color: #111; }
#main .ib-detail { background: #fff; }
#main .ib-detail :is(h1, h2, h3, h4) { color: #111; }
#main .ib-detail-meta, #main .ib-detail-actions, #main .ib-detail-actions a,
#main .ib-back, #main .ib-tabs button, #main .ib-margin-note,
#main .ib-margin-note > span, #main .ib-margin-note p,
#main .ib-card-meta, #main .ib-card-tags, #main .ib-card-bottom,
#main .ib-results, #main .ib-note, #main .ib-form-foot > span,
#main .ib-archive-note small, #main .ib-concept figcaption {
  color: #404040; font-size: 14px; line-height: 1.7; letter-spacing: 0;
}
#main .ib-tabs { gap: 28px; flex-wrap: wrap; }
#main .ib-tabs button { font-size: 16px; padding: 14px 0; }
#main .ib-tabs button[aria-pressed=true] { color: #111; border-bottom-color: #111; }
#main .ib-reading-layout { grid-template-columns: 160px minmax(0, 1fr); gap: 48px; }
#main .ib-reading { width: 100%; max-width: 760px; }
#main .ib-prose { color: #111; font-size: var(--read-body); line-height: 1.9; letter-spacing: 0; }
#main .ib-prose p { font-size: inherit; color: inherit; line-height: inherit; margin: 0 0 1.4em; }
#main .ib-detail-summary { max-width: 760px; color: #222; }
#main .ib-english { font-size: 16px; color: #404040; }
#main .ib-verdict, #main .ib-discuss-prompt, #main .ib-archive-note {
  background: #fff; border-color: #d6d6d6; color: #111;
}
#main .ib-verdict span, #main .ib-discuss-prompt > span { font-size: 14px; color: #404040; }
#main .ib-original { max-width: 760px; }
#main .ib-original summary { font-size: 18px; line-height: 1.65; color: #111; }
#main .ib-original pre { font-family: inherit; font-size: var(--read-body); line-height: 1.9; color: #111; white-space: pre-wrap; }
#main .ib-original li { font-size: 16px; line-height: 1.8; color: #111; }
#main .ib-discussion { max-width: 960px; color: #111; }
#main .ib-discussion :is(label, select, textarea) { font-size: 17px; color: #111; }
#main .ib-discussion textarea { line-height: 1.85; }
#main .ib-discussion textarea::placeholder { color: #595959; }
#main .ib-card-copy > p { font-size: 17px; line-height: 1.8; }
#main .ib-status { color: #333; }
#main .ib-filters button { font-size: 15px; color: #333; }
#main .ib-filters button[aria-pressed=true] { color: #fff; }

/* Learning, weekly reading and quantitative explanations share the same scale. */
.learning-space { color: #111; }
#main :is(.learning-cover, .learn-workflow, .learn-module, .learn-summary-card,
  .learn-material, .learn-lower-grid article, .learn-progress-meter,
  .weekly-card, .weekly-method, .q-panel, .q-stat, .qr-analysis) { background: #fff; }
#main :is(.learning-heading p, .learning-cover-tags span, .learn-stats span,
  .learn-stats small, .learn-tabs button, .learn-tabs small,
  .learn-material-meta, .learn-summary-source, .learn-material-links,
  .learn-record-actions, .learn-map-title .eyebrow, .learn-map-title p,
  .learn-timeline time, .learn-workflow small, .learn-module-output) {
  font-size: 14px; color: #404040; line-height: 1.75;
}
#main :is(.learn-summary-card, .learn-excerpt, .learn-workflow li) { font-size: 18px; line-height: 1.85; color: #111; }
#main .learn-summary-card h4 { font-size: 19px; line-height: 1.6; color: #111; }
#main .learning-cover h1 em { color: #111; }
#main .learn-module-output span { color: #404040; }
#main .learn-loading, #main .learn-no-match, #main .q-loading { color: #404040; }
.weekly-space { color: #111; }
#main .weekly-toolbar a, #main .weekly-toolbar a span,
#main .weekly-search-label, #main .weekly-categories button { color: #333; }
#main .weekly-categories button[aria-pressed=true] { background: #111; color: #fff; }
#main :is(.weekly-kicker, .weekly-topline, .weekly-status, .weekly-source small,
  .weekly-source-note, .weekly-kind, .weekly-card-foot, .weekly-hint,
  .weekly-original, .weekly-edition-stamp small, .weekly-list-heading > p) {
  font-size: 14px; color: #404040; line-height: 1.75;
}
#main .weekly-card h3 { font-size: 22px; color: #111; line-height: 1.55; }
#main .weekly-method p { font-size: 16px; }
.q-space { --q-ink: #111; --q-pale: #fff; color: #111; }
#main .qr-eyebrow, #main .qr-masthead h1 span { color: #404040; }
#main :is(.q-topline, .q-kicker, .q-caption, .q-source, .q-inline-note,
  .q-note-status, .q-source-grid p, .q-reference-list small, .q-observations small,
  .q-stat > span, .q-stat p, .qr-kicker, .qr-meta, .qr-note, .qr-caption) {
  font-size: 14px; line-height: 1.75; color: #404040;
}
#main :is(.qr-analysis, .q-observations p, .q-method-lead p) { font-size: 18px; color: #111; line-height: 1.85; }
#main :is(.q-table-wrap, .qr-table-wrap) { max-width: 100%; overflow: auto; }
#main :is(.q-table th, .qr-table th, .q-table td, .qr-table td) { font-size: 14px; line-height: 1.65; }

/* The AI reader lives in its own document; use matching light-theme tokens. */
html:not([data-theme=dark]) {
  --bg: #fff; --bg-sunk: #f7f7f7; --bg-muted: #f3f3f3; --well: #f7f7f7;
  --surface: #fff; --surface-2: #fff; --raised: #fff; --sidebar: #fff; --daybar: #fff;
  --ink: #111; --ink-2: #222; --ink-3: #404040; --ink-4: #505050;
  --prose-ink: #111; --line: #dedede; --line-soft: #e8e8e8; --line-strong: #ccc;
  --accent: #111; --accent-ink: #111; --accent-soft: #f1f1f1; --accent-softer: #f7f7f7;
  --page-max-reading: 960px; --text-xs: .875rem; --text-xs--line-height: 1.5;
  --text-sm: 1rem; --text-sm--line-height: 1.5;
}
#root { font-size: 17px; line-height: 1.75; }
#root .prose { max-width: 760px; font-size: 18px; line-height: 1.85; letter-spacing: 0; }
#root .prose p, #root .prose li { font-size: inherit; color: inherit; line-height: inherit; }
#root .prose h2 { font-size: 26px; line-height: 1.45; }
#root .prose h3 { font-size: 22px; line-height: 1.5; }
#root .boom-freshness { font-size: 14px; }
#root .boom-freshness strong { font-size: 16px; }
#root .boom-freshness small { font-size: 14px; opacity: 1; }
[data-theme=dark] {
  --ink: #f3f3f3; --ink-2: #e5e5e5; --ink-3: #d1d1d1; --ink-4: #bdbdbd;
  --prose-ink: #f0f0f0; --line: #454545; --line-soft: #303030; --line-strong: #5a5a5a;
}
[data-theme=dark] body { background: var(--bg); color: var(--ink); }
[data-theme=dark] #main p { color: var(--ink); }

@media (min-width: 901px) {
  .header-inner { gap: 40px; }
  #main-nav { gap: 24px; }
  #main-nav a { font-size: 16px; color: #111; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .header-inner { gap: 24px; }
  #main-nav { gap: 15px; }
  #main-nav a { font-size: 15px; }
}
@media (max-width: 900px) {
  #main .ib-reading-layout { grid-template-columns: 1fr; gap: 24px; }
  #main .ib-margin-note { padding-bottom: 20px; border-bottom: 1px solid #dedede; }
}
@media (max-width: 650px) {
  :root { --read-body: 17px; }
  #main .hero-description { font-size: 17px; max-width: 34rem; }
  #main .project-title h3, #main .journal-entry h3 { font-size: 21px; }
  #main .method-heading p, #main .method-table td:last-child { font-size: 16px; }
  #main .method-table td strong { font-size: 16px; }
  #main .method-table th:first-child { width: 44px; }
  #main .ib-tabs { gap: 22px; }
  #main .ib-tabs button { font-size: 16px; }
  #main .ib-detail-meta { flex-wrap: wrap; row-gap: 10px; }
  #main .ib-prose, #main .ib-original pre { font-size: 17px; line-height: 1.9; }
  #main :is(.qr-analysis, .learn-summary-card, .learn-excerpt, .learn-workflow li) { font-size: 17px; }
  #root .prose { font-size: 17px; line-height: 1.85; }
}

/* Public edition */
.search-result{display:block;padding:18px 0;border-bottom:1px solid #ddd;color:inherit}.search-result p{font-size:14px;line-height:1.7;color:#60615d;margin-top:8px}#global-search{width:100%;padding:14px;border:1px solid #ccc;border-radius:4px;margin:12px 0}.q-source{font-size:12px}.weekly-card-foot{flex-wrap:wrap}.project-grid>.project-card:has(>.eyebrow){padding:26px}.project-grid>.project-card:has(>.eyebrow) p{padding:18px 0;line-height:1.8}.ib-detail h1{overflow-wrap:anywhere}
