/* Notebook-only polish. Keep the main profile and publications unchanged. */
body.mind-page {
  --notebook-body-size: 1rem;
  --notebook-label-size: 0.875rem;
  --notebook-meta-size: 0.875rem;
  --notebook-equation-size: 1.125rem;
}

body.mind-page .mind-opening {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
}

body.mind-page .mind-heading {
  justify-content: center;
  padding: 1.8rem 2rem;
}

body.mind-page .mind-page-title {
  margin: 0.7rem 0 0;
  font-size: clamp(2.6rem, 4.6vw, 3.65rem);
  line-height: 1.02;
  text-wrap: balance;
}

body.mind-page .mind-page-intro {
  margin-top: 1rem;
  font-size: var(--notebook-body-size);
  line-height: 1.65;
  text-align: left;
}

body.mind-page .mind-heading .section-kicker {
  font-size: var(--notebook-label-size);
}

body.mind-page :is(.mind-play-card .detail-label, .mind-play-label) {
  font-size: var(--notebook-label-size);
}

body.mind-page .mind-aside {
  padding: 1.6rem 1.8rem;
}

body.mind-page .mind-aside > p:not(.mind-preface-pill, .detail-label, .mind-notebook-status) {
  margin: 0;
  font-size: var(--notebook-body-size);
  line-height: 1.55;
}

body.mind-page .mind-aside .detail-label {
  margin-bottom: 0.55rem;
  font-size: var(--notebook-meta-size);
}

body.mind-page .mind-preface-pill {
  margin-bottom: 0.65rem;
  font-size: var(--notebook-meta-size);
  letter-spacing: 0.08em;
}

body.mind-page .mind-manifesto {
  gap: 0.35rem;
  margin-top: 0.85rem;
}

body.mind-page .mind-manifesto > span {
  min-height: 1.9rem;
  padding-block: 0.3rem;
}

body.mind-page .mind-manifesto b {
  font-size: var(--notebook-meta-size);
}

body.mind-page .mind-manifesto strong {
  font-size: 1.1rem;
}

body.mind-page .mind-aside .mind-notebook-status {
  margin-top: 0.85rem;
  font-size: var(--notebook-meta-size);
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
}

body.mind-page .mind-theme-browser {
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr);
  gap: 1.4rem;
  padding: 1.35rem 1.5rem;
}

body.mind-page .mind-theme-copy > p:last-child {
  font-size: var(--notebook-body-size);
  line-height: 1.55;
}

body.mind-page .mind-theme-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

body.mind-page .mind-theme-button {
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.65rem 0.8rem;
  font-size: var(--notebook-label-size);
  line-height: 1.25;
  text-align: left;
}

body.mind-page .mind-theme-count {
  min-width: 1.4rem;
  height: 1.4rem;
  font-size: var(--notebook-meta-size);
}

body.mind-page .mind-theme-interface-label,
body.mind-page .mind-theme-interface-label small,
body.mind-page .mind-theme-copy .detail-label {
  font-size: var(--notebook-meta-size);
  letter-spacing: 0.05em;
}

body.mind-page .mind-theme-status {
  font-size: var(--notebook-label-size);
  line-height: 1.45;
}

/* Short reflections share two columns; dense explanations retain a full row. */
body.mind-page .mind-layout {
  --mind-card-gap: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.mind-page .mind-layout > [data-themes] {
  container-type: inline-size;
  grid-column: auto;
  min-width: 0;
}

body.mind-page .mind-layout > :is([data-note-width="wide"], .mind-card-wide, .mind-feature) {
  grid-column: 1 / -1;
}

body.mind-page .mind-layout h2 {
  max-width: none;
  font-size: clamp(1.85rem, 3vw, 2.3rem);
  line-height: 1.1;
}

body.mind-page .mind-layout h3 {
  font-size: 1.15rem;
  line-height: 1.25;
}

body.mind-page .mind-layout p:not(.mind-formula):not(.detail-label),
body.mind-page .mind-layout li {
  font-size: var(--notebook-body-size);
  line-height: 1.6;
}

body.mind-page .mind-layout .detail-label {
  font-size: var(--notebook-label-size);
  letter-spacing: 0.07em;
}

/* Legacy cards set their dates with !important; keep one readable metadata size. */
body.mind-page .mind-layout .mind-note-date {
  font-size: var(--notebook-meta-size) !important;
  line-height: 1.4;
  color: var(--muted);
  letter-spacing: 0.025em;
}

body.mind-page .mind-layout figcaption,
body.mind-page .mind-layout p[class$="-source"],
body.mind-page .mind-layout p[class$="-caption"],
body.mind-page .mind-layout p[class$="-kicker"],
body.mind-page .mind-layout .progress-stream-tags li {
  font-size: var(--notebook-label-size);
  line-height: 1.5;
}

body.mind-page .mind-layout :is(
  .progress-stream-status, .progress-stream-question > span,
  .cnn-study-status, .cnn-principles small, .ai2040-pillar > span,
  .method-tag, .mind-inline-reference .detail-label
) {
  font-size: var(--notebook-meta-size);
  line-height: 1.4;
}

body.mind-page .mind-layout [class$="-tagline"] {
  font-size: var(--notebook-label-size) !important;
  line-height: 1.45;
}

body.mind-page .mind-layout .box-quote-stage p {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.08;
}

body.mind-page .mind-layout :is(
  .method-domain, .method-detail, .mind-methods-list p > strong,
  .chemo-coupling-node small, .chemo-state-pills > span,
  .rheology-parameter-grid span, .ml-bayes-panel > span,
  .cole-equation-strip section > span, .supervised-formalism section > span,
  .lca-equation-key > span, .perelman-concepts > span,
  .perelman-reading-panel > span, .cnn-reference-label,
  .wigner-translation section > span, .wigner-translation section > small,
  .wigner-bridge small, .box-quote-orbit > span
) {
  font-size: var(--notebook-meta-size);
  line-height: 1.45;
}

/* Avoid enlarging diagrams simply because a technical note spans both columns. */
body.mind-page .mind-layout > [data-note-width="wide"] figure > img {
  width: 100%;
  max-width: 850px;
  height: auto;
  margin-inline: auto;
}

/* A single type scale overrides the older, individually sized note components.
   Inherit inside rich text so emphasis and inline notation keep the text size. */
body.mind-page #main-content .mind-layout {
  font-size: var(--notebook-body-size);
}

body.mind-page #main-content .mind-layout :is(span, small, strong, b, em, i, a, cite):not(
  svg *, mjx-container *, .box-quote-mark
) {
  font-size: max(1em, var(--notebook-label-size));
}

body.mind-page #main-content .mind-layout :is(p, li, dd):not(.mind-formula) {
  font-size: var(--notebook-body-size);
  line-height: 1.6;
}

body.mind-page #main-content .mind-layout :is(section, div, article) > strong {
  font-size: 1.125rem;
  line-height: 1.35;
}

body.mind-page #main-content .mind-layout :is(
  .detail-label, .mind-note-date, figcaption, p[class$="-source"],
  p[class$="-caption"], p[class$="-kicker"], [class$="-tagline"],
  .method-domain, .method-detail, .progress-stream-status,
  .progress-stream-question > span, .progress-stream-tags li,
  .cnn-study-status, .cnn-reference-label, .chemo-state-pills > span,
  .rheology-parameter-grid span, .ml-bayes-panel > span,
  .lca-equation-key > span, .perelman-concepts > span,
  .perelman-reading-panel > span, .wigner-translation section > span,
  .wigner-translation section > small, .wigner-bridge small,
  .box-quote-orbit > span
) {
  font-size: var(--notebook-label-size) !important;
  line-height: 1.45;
}

body.mind-page #main-content .mind-layout .box-quote-stage p {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.08;
}

body.mind-page #main-content .mind-layout :is(.mind-formula, mjx-container[display="true"]) {
  font-size: var(--notebook-equation-size) !important;
}

/* Keep long mathematics readable: scroll within its frame rather than shrink it.
   Auto margins center short formulas without hiding the start of long ones. */
body.mind-page #main-content .mind-layout .mind-formula {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding-block: 0.8rem;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
  scrollbar-width: thin;
}

body.mind-page #main-content .mind-layout .mind-formula mjx-container[display="true"] {
  display: block;
  width: max-content;
  min-width: 0;
  max-width: none;
  margin: 0.45rem auto !important;
}

body.mind-page #main-content .mind-layout mjx-container:not([display="true"]) {
  font-size: 1em !important;
}

body.mind-page #main-content .mind-layout .mind-formula mjx-container > svg {
  max-width: none;
}

body.mind-page #main-content .mle-chain {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

body.mind-page #main-content :is(.risk-bridge-arrow, .mle-chain-arrow) {
  width: auto;
  min-width: 6rem;
}

body.mind-page #main-content :is(.risk-bridge-arrow, .mle-chain-arrow) > span {
  font-size: var(--notebook-label-size);
  line-height: 1.4;
  letter-spacing: 0.025em;
}

body.mind-page #main-content :is(.risk-bridge-arrow, .mle-chain-arrow) > b {
  font-size: 1.5rem;
}

body.mind-page #main-content .poisson-stat-grid > div {
  grid-template-columns: 4.5rem minmax(0, 1fr);
  column-gap: 0.75rem;
}

body.mind-page #main-content .poisson-stat-grid span {
  font-size: var(--notebook-label-size);
}

body.mind-page #main-content .mind-layout .mind-formula::-webkit-scrollbar {
  display: block;
  height: 6px;
}

/* The binder atlas leads with a visual readout; supporting detail stays optional. */
body.mind-page #main-content .binder-atlas-note {
  --binder-lens: #176e6c;
}

body.mind-page #main-content .binder-atlas-lede {
  margin: 0.65rem 0 1.6rem;
  max-width: none;
  color: var(--muted);
  text-align: left;
}

body.mind-page #main-content .binder-lens-group {
  margin-top: 1.6rem;
}

body.mind-page #main-content .binder-lens-molecular {
  --binder-lens: #a14e2e;
}

body.mind-page #main-content .binder-lens-physical {
  --binder-lens: #356c96;
}

body.mind-page #main-content .binder-lens-heading {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

body.mind-page #main-content .binder-lens-number {
  display: grid;
  flex: 0 0 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--binder-lens) 26%, transparent);
  border-radius: 50%;
  color: var(--binder-lens);
  font-size: var(--notebook-label-size);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

body.mind-page #main-content .binder-lens-kicker {
  margin: 0 0 0.15rem;
  color: var(--binder-lens);
  font-size: var(--notebook-label-size) !important;
  font-weight: 700;
  letter-spacing: 0.065em;
  line-height: 1.4;
  text-transform: uppercase;
}

body.mind-page #main-content .binder-lens-heading h3 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.2;
}

body.mind-page #main-content .binder-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.mind-page #main-content .binder-method {
  display: grid;
  grid-template-rows: minmax(4.6rem, auto) auto auto 1fr auto;
  gap: 0.65rem;
  min-width: 0;
  padding: 1.1rem;
  border: 1px solid color-mix(in srgb, var(--binder-lens) 22%, transparent);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--panel-strong) 92%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--binder-lens) 4%, transparent);
  text-align: left;
}

body.mind-page #main-content .binder-method h4 {
  margin: 0;
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.3rem;
  line-height: 1.15;
}

body.mind-page #main-content .binder-method-name {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: var(--notebook-label-size) !important;
  line-height: 1.4;
}

body.mind-page #main-content .binder-method-visual {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0.35rem;
  border-radius: 0.7rem;
  color: var(--binder-lens);
  background: color-mix(in srgb, var(--binder-lens) 7%, var(--panel-strong));
}

body.mind-page #main-content .binder-method-visual svg {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 124px;
  overflow: visible;
}

body.mind-page #main-content .binder-v-wash {
  fill: currentColor;
  opacity: 0.16;
}

body.mind-page #main-content .binder-v-solid {
  fill: currentColor;
}

body.mind-page #main-content .binder-v-line,
body.mind-page #main-content .binder-v-contour,
body.mind-page #main-content .binder-v-axis {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.mind-page #main-content .binder-v-contour {
  stroke-width: 1.8;
}

body.mind-page #main-content .binder-v-axis {
  stroke-width: 1.3;
  opacity: 0.4;
}

body.mind-page #main-content .binder-v-faint {
  opacity: 0.35;
}

body.mind-page #main-content .binder-v-label,
body.mind-page #main-content .binder-v-element {
  fill: currentColor;
  font-family: "Source Sans 3", sans-serif;
  font-size: 18px;
  font-weight: 600;
}

body.mind-page #main-content .binder-v-element {
  font-size: 34px;
}

body.mind-page #main-content .binder-method-output {
  margin: 0.25rem 0 0;
  color: var(--binder-lens);
  font-weight: 700;
  line-height: 1.4;
}

body.mind-page #main-content .binder-method-summary,
body.mind-page #main-content .binder-method-more p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

body.mind-page #main-content .binder-method :is(p, summary) {
  max-width: none;
  text-align: left;
  text-justify: auto;
  hyphens: none;
}

body.mind-page #main-content .binder-method-more {
  min-width: 0;
  margin-top: 0.3rem;
  padding-top: 0.4rem;
  border-top: 1px solid color-mix(in srgb, var(--binder-lens) 18%, transparent);
}

body.mind-page #main-content .binder-method-more summary {
  min-height: 2.75rem;
  padding: 0.55rem 0;
  color: var(--binder-lens);
  font-size: var(--notebook-label-size);
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}

body.mind-page #main-content .binder-method-more summary::marker {
  color: var(--binder-lens);
}

body.mind-page #main-content .binder-method-more summary:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

body.mind-page #main-content .binder-method-more summary:focus-visible {
  outline: 2px solid var(--binder-lens);
  outline-offset: 3px;
  border-radius: 3px;
}

body.mind-page #main-content .binder-method-more[open] p {
  padding: 0.35rem 0 0.25rem;
}

body.mind-page #main-content .binder-atlas-footer {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
}

body.mind-page #main-content .binder-atlas-footer p {
  margin: 0;
  max-width: none;
  color: var(--muted);
  text-align: left;
}

body.mind-page #main-content .binder-atlas-footer strong {
  color: var(--ink);
}

body.mind-page #main-content .binder-atlas-caption {
  margin-top: 0.6rem !important;
  font-size: var(--notebook-label-size) !important;
}

body.mind-page #main-content .binder-atlas-caption a {
  color: var(--binder-lens);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

@container (max-width: 780px) {
  body.mind-page #main-content .binder-method-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.mind-page #main-content .binder-method {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-rows: auto;
    column-gap: 1.2rem;
  }

  body.mind-page #main-content .binder-method > :not(.binder-method-visual) {
    grid-column: 2;
  }

  body.mind-page #main-content .binder-method-visual {
    grid-column: 1;
    grid-row: 1 / span 3;
  }
}

@container (max-width: 480px) {
  body.mind-page #main-content .binder-method {
    grid-template-columns: minmax(0, 1fr);
  }

  body.mind-page #main-content .binder-method > :not(.binder-method-visual),
  body.mind-page #main-content .binder-method-visual {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Internal layouts follow the card width, not the width of the browser. */
@container (max-width: 600px) {
  body.mind-page #main-content .mle-chain {
    grid-template-columns: minmax(0, 1fr);
  }

  body.mind-page :is(
    .cole-readout, .black-space-readout, .time-sweep-readout, .time-sweep-copy,
    .perelman-hero, .perelman-ricci-band, .perelman-reading-panel,
    .rayleigh-equation-band, .rayleigh-reading-grid, .rayleigh-caution,
    .dirac-insight-grid, .wigner-surprises, .box-usefulness-test,
    .box-question-grid, .jung-motif-grid, .jung-distinction, .jung-pattern-band
  ) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.mind-page :is(.perelman-values, .perelman-concepts) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.mind-page .perelman-values > section:last-child {
    grid-column: 1 / -1;
  }

  body.mind-page .perelman-portrait {
    justify-self: center;
    width: min(100%, 245px);
  }

  body.mind-page :is(.jung-distinction, .jung-pattern-band) > span {
    justify-self: center;
  }

  body.mind-page .mind-layout :is(
    .rayleigh-title-row, .dirac-title-row, .jung-title-row, .perelman-title-row
  ) {
    flex-wrap: wrap;
  }
}

@container (max-width: 400px) {
  body.mind-page .perelman-values {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  body.mind-page .mind-opening,
  body.mind-page .mind-theme-browser,
  body.mind-page .mind-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.mind-page .mind-aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 0.7fr);
    gap: 0 1.5rem;
  }

  body.mind-page .mind-aside > p {
    grid-column: 1;
  }

  body.mind-page .mind-manifesto {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin-top: 0;
    align-self: center;
  }

  body.mind-page .mind-aside .mind-notebook-status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  body.mind-page .mind-heading,
  body.mind-page .mind-aside,
  body.mind-page .mind-theme-browser {
    padding: 1.3rem;
  }

  body.mind-page .mind-page-title {
    font-size: clamp(2.35rem, 9vw, 3.2rem);
  }

  body.mind-page .mind-aside {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
  }

  body.mind-page .mind-aside .mind-preface-pill {
    grid-column: 1;
    margin: 0;
  }

  body.mind-page .mind-aside .detail-label {
    grid-column: 2;
    margin: 0;
    align-self: center;
  }

  body.mind-page .mind-aside > p:not(.mind-preface-pill, .detail-label, .mind-notebook-status) {
    grid-column: 1 / -1;
  }

  body.mind-page .mind-manifesto {
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  body.mind-page .mind-manifesto > span {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.3rem;
    padding: 0.55rem 0.3rem;
    text-align: center;
  }

  body.mind-page .mind-manifesto::before,
  body.mind-page .mind-manifesto > span::before {
    display: none;
  }

  body.mind-page .mind-aside .mind-notebook-status {
    margin-top: 0;
  }

  body.mind-page .mind-theme-button {
    padding-inline: 0.65rem;
  }

  body.mind-page .mind-layout p,
  body.mind-page .mind-layout li {
    text-align: left;
    text-justify: auto;
    hyphens: none;
  }
}
