/* ==========================================================================
   Newton-Raphson ROC Viewer stylesheet
   Aesthetic: editorial / scientific publication
   Inspired by Distill.pub, NYT explainers
   ========================================================================== */

/* -- Fonts ----------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* -- Design tokens --------------------------------------------------------- */
:root {
  /* Color: warm off-white paper, deep ink, single accent */
  --bg:           #fbfaf7;
  --bg-card:     #ffffff;
  --bg-soft:     #f4f2ec;
  --ink:         #1c1c1c;
  --ink-soft:    #4a4a4a;
  --ink-muted:   #7a7a7a;
  --rule:        #e2ddd1;
  --rule-soft:   #ece7da;

  /* Aliases. The toy caption/status rules below were written against these
     names, which were never defined -- so those declarations were invalid at
     computed-value time and silently dropped (the status pill lost its
     background entirely). Defined here rather than renaming call sites. */
  --ink-2:       var(--ink-soft);
  --ink-3:       var(--ink-muted);
  --bg-alt:      var(--bg-soft);

  /* Accent: navy, pulled from the blue end of the plot colorscale */
  --accent:        #1F4E79;
  --accent-hover:  #163C5E;
  --accent-warm:   #E07B39;
  --accent-soft:   #eaf0f6;

  /* Solution colours, kept in step with COLOR_HIGH / COLOR_LOW in Python.
     Used by sections 02-04. */
  --sol-high:      #1F77B4;   /* operational, high voltage */
  --sol-low:       #C62828;   /* alternative, low voltage  */

  /* Section 05's convergence map keeps its original palette, so anything
     labelling a map result uses these instead. Matches MAP_COLOR_* in app.py. */
  --map-high:      #F26419;   /* operational, on the map */
  --map-low:       #6A4C93;   /* alternative, on the map */

  /* Slider chrome. Separate from --accent so buttons and sliders can differ,
     and from --sol-high so the plots' meaning does not leak into the UI. */
  --slider:        #1F77B4;

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Spacing scale (8px base) */
  --s-1:  0.25rem;
  --s-2:  0.5rem;
  --s-3:  0.75rem;
  --s-4:  1rem;
  --s-5:  1.5rem;
  --s-6:  2rem;
  --s-7:  3rem;
  --s-8:  4rem;

  /* Radii & shadows */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --shadow-sm:  0 1px 2px rgba(28, 28, 28, 0.04);
  --shadow:     0 4px 16px rgba(28, 28, 28, 0.06);
  --shadow-lg:  0 12px 32px rgba(28, 28, 28, 0.08);

  /* Layout */
  --page-max:   1400px;
  --reading-w:  720px;  /* article-style narrow column for prose */
}

/* -- Reset & base ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: 'kern', 'liga', 'calt';
}

/* -- Page shell ------------------------------------------------------------ */
.page {
  background: var(--bg);
  min-height: 100vh;
  /* subtle paper texture via radial gradients */
  background-image:
    radial-gradient(circle at 20% 10%, rgba(31, 78, 121, 0.015), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(242, 100, 25, 0.015), transparent 50%);
}

.container {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-bottom: var(--s-8);
}

/* -- Header ---------------------------------------------------------------- */
.header {
  padding: var(--s-7) var(--s-6) var(--s-4) var(--s-6);
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.header::before {
  /* small editorial mark, kicker rule */
  content: 'POWER FLOW · INTERACTIVE EXPLAINER';
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink);
  margin-bottom: var(--s-4);
}

.header h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-3) 0;
  color: var(--ink);
  font-variation-settings: 'opsz' 96;
}

.header .subtitle {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: var(--reading-w);
  margin: 0;
  line-height: 1.55;
}

/* -- Section wrappers ------------------------------------------------------ */
.section {
  padding: var(--s-7) var(--s-6) var(--s-6) var(--s-6);
  border-bottom: 1px solid var(--rule-soft);
}

.section:last-of-type {
  border-bottom: none;
}

/* The header already sets off the title with its own padding and rule, so the
   first section does not need a second helping of top padding under it. */
#section-1 {
  padding-top: var(--s-3);
}

.section-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: var(--s-4);
}

/* -- Prose ----------------------------------------------------------------- */
.prose {
  /*max-width: var(--reading-w);*/
  color: var(--ink);
}

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: var(--s-6) 0 var(--s-3) 0;
}

.prose h2 {
  font-size: 1.7rem;
  line-height: 1.25;
}

.prose h3 {
  font-size: 1.25rem;
  line-height: 1.35;
}

.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 var(--s-4) 0;
  line-height: 1.7;
  color: var(--ink-soft);
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-soft);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: var(--ink);
}

.prose ul,
.prose ol {
  margin: 0 0 var(--s-4) 0;
  padding-left: var(--s-5);
  color: var(--ink-soft);
}

.prose li {
  margin-bottom: var(--s-2);
  line-height: 1.65;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: var(--s-6) 0;
}

/* -- Cards ----------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--s-5);
}

.card--soft {
  background: var(--bg-soft);
  border-color: var(--rule-soft);
  box-shadow: none;
}

.card--feature {
  background: var(--bg-card);
  box-shadow: var(--shadow);
  padding: var(--s-6);
}

/* Caption text under figures */
.caption {
  font-size: 0.88rem;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: var(--s-2);
  line-height: 1.5;
}

/* -- Magnet figure grid ---------------------------------------------------- */
.magnet-views {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  margin-top: var(--s-5);
}

@media (max-width: 720px) {
  .magnet-views {
    grid-template-columns: 1fr;
  }
}

.magnet-view img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--rule-soft);
  display: block;
}

/* -- Buttons --------------------------------------------------------------- */
.btn {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--bg-card);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
}

.btn--ghost {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
}

.btn--ghost:hover {
  background: var(--bg-soft);
  color: var(--ink);
  border-color: var(--rule);
  transform: none;
  box-shadow: none;
}

.btn-row {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-5);
  flex-wrap: wrap;
}

/* -- Details / collapsible ------------------------------------------------- */
details.collapsible {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: var(--s-5);
  overflow: hidden;
  transition: box-shadow 0.18s ease;
}

details.collapsible[open] {
  box-shadow: var(--shadow-sm);
}

details.collapsible > summary {
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

details.collapsible > summary::-webkit-details-marker {
  display: none;
}

details.collapsible > summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--ink-muted);
  transition: transform 0.18s ease;
}

details.collapsible[open] > summary::after {
  content: '−';
}

details.collapsible > summary:hover {
  background: var(--bg-soft);
}

details.collapsible > .details-body {
  padding: var(--s-3) var(--s-4) var(--s-4) var(--s-4);
  border-top: 1px solid var(--rule-soft);
  color: var(--ink-soft);
}

/* -- Slider container ------------------------------------------------------ */
.slider-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--s-4) var(--s-5) var(--s-5) var(--s-5);
  margin-bottom: var(--s-5);
  box-shadow: var(--shadow-sm);
}

.slider-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--s-3);
}

/* Slider colours.
   Dash 4 replaced the implementation behind dcc.Slider, so the .rc-slider-*
   selectors this file used to carry matched nothing at all and every slider
   simply showed Dash's own purple. The live classes are
   .dash-slider-{root,track,range,thumb,mark}, all tinted from one design
   token whose default is #7f4bc4.

   Setting that token beats writing rules against those classes: custom
   properties inherit, so a wrapper element can retint a single slider, and
   there is no specificity race with Dash's stylesheet, which is injected at
   runtime and would otherwise win any tie. */
:root {
  --Dash-Fill-Interactive-Strong: var(--slider);
}

/* Unfilled part of the track: follow the page's rule colour, not Dash's gray.
   Scoped through .dash-slider-root purely to outrank Dash's own rule. */
.dash-slider-root .dash-slider-track {
  background-color: var(--rule);
}

.dash-slider-root .dash-slider-mark {
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
}

/* -- Two-column interactive layout ----------------------------------------- */
.lab {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--s-4);
  align-items: start;
}

.lab__left {
  /* Width comes from the grid's 1fr track. min-width:0 stops the Plotly div
     inside from forcing the track wider than its share. */
  min-width: 0;
  /* The map column is several times taller, which left the one-line card
     stranded above a tall void. Sticky keeps it beside whatever part of the
     map is on screen, which is also where it is useful. */
  position: sticky;
  top: var(--s-4);
}

.lab__right {
  min-width: 0;
}

@media (max-width: 1100px) {
  .lab {
    grid-template-columns: 1fr;
  }

  /* Stacked, there is nothing to sit alongside, so sticky would just pin the
     card over the map as you scroll past it. */
  .lab__left {
    position: static;
  }
}

/* Hint banner above the ROC */
.hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-3);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.hint__text {
  flex: 1;
}

/* -- Trace output (raw text) ----------------------------------------------- */
.trace-output {
  white-space: pre-wrap;
  background: var(--ink);
  color: #e8e6e0;
  padding: var(--s-4);
  border-radius: var(--radius);
  margin: var(--s-3) 0 0 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  overflow-x: auto;
}

/* -- ROA static figure ----------------------------------------------------- */
.figure-static {
  width: 100%;
  max-width: 950px;
  display: block;
  margin: var(--s-4) auto var(--s-5) auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

/* -- Bridge text (transition between sections) ----------------------------- */
.bridge {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  max-width: 600px;
  margin: var(--s-6) auto var(--s-3) auto;
  line-height: 1.5;
}

/* -- Section reveal animation ----------------------------------------------
   A revealed section goes display:none -> block, which restarts this
   animation. `both` holds the opening frame so nothing flashes at full
   opacity before the animation starts. The easing is decelerating, so the
   section settles rather than arriving abruptly.
   -------------------------------------------------------------------------- */
.section {
  animation: fade-up 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  /* Keeps the smooth scroll from jamming the heading against the viewport
     edge, which read as a jump even though the scroll itself was animated. */
  scroll-margin-top: var(--s-5);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .section {
    animation: none;
  }
}

/* -- Plot containers ------------------------------------------------------- */
.plot-wrap {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--s-3);
  box-shadow: var(--shadow-sm);
}

.plot-wrap--flush {
  padding: 0;
  overflow: hidden;
}

/* Hide Plotly modebar background */
.modebar {
  background: transparent !important;
}

/* -- Utility classes ------------------------------------------------------- */
.hidden { display: none !important; }
.mt-3 { margin-top: var(--s-3); }
.mt-5 { margin-top: var(--s-5); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* -- Selection ------------------------------------------------------------- */
::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

/* -- Magnet toy ------------------------------------------------------------ */
.toy-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 var(--s-2) 0;
  color: var(--ink);
}

.toy-caption {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.55;
  margin: 0 0 var(--s-4) 0;
  max-width: 64ch;
}

.toy-status {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: var(--s-3);
}

.toy-sliders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}

@media (max-width: 720px) {
  .toy-sliders { grid-template-columns: 1fr; }
}

.toy-slider-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--s-3);
}

/* Dash 4 draws an auto-generated numeric scale beneath a slider whenever its
   `marks` prop is falsy or empty -- marks=False, marks={} and marks=[] all
   still render it, verified against the rendered page -- so there is no prop
   that turns it off. The magnet sliders suppress it here instead, and reclaim
   the bottom padding Dash reserves for it. */
.toy-slider .dash-slider-mark {
  display: none;
}

.toy-slider .dash-slider-root.has-marks {
  padding-bottom: 6px;
}

/* Match each slider to its magnet. The token inherits, so scoping it to the
   wrapper retints just that slider's range, thumb and focus ring together. */
.toy-slider--a {
  --Dash-Fill-Interactive-Strong: var(--sol-high);
}

.toy-slider--b {
  --Dash-Fill-Interactive-Strong: var(--sol-low);
}

/* ==========================================================================
   Alternate-solutions tutorial
   Sections 02 (two answers) and 03 (existence / nose curve), plus the
   verdict banner that names the solution reached in section 05.
   ========================================================================== */

/* -- Impedance readout under the tutorial sliders -------------------------- */
.z-readout {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--rule-soft);
}

/* -- Section 02: phasors beside the comparison table ----------------------- */
.solutions {
  display: flex;
  gap: var(--s-5);
  align-items: center;
  flex-wrap: wrap;
}

.solutions__left {
  flex: 1 1 380px;
  min-width: 0;
}

.solutions__right {
  flex: 1 1 340px;
  min-width: 0;
}

@media (max-width: 900px) {
  .solutions {
    flex-direction: column;
    align-items: stretch;
  }
}

.solution-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.solution-table th,
.solution-table td {
  padding: var(--s-3) var(--s-3);
  border-bottom: 1px solid var(--rule-soft);
  text-align: left;
}

.solution-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--rule);
}

.solution-table .num {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Column tint ties each solution to its color everywhere else on the page */
.solution-table .col-high {
  color: var(--ink);
  background: rgba(31, 119, 180, 0.06);
}

.solution-table .col-low {
  color: var(--ink);
  background: rgba(198, 40, 40, 0.06);
}

.solution-table thead .col-high,
.solution-table thead .col-low {
  background: transparent;
}

.solution-note {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: var(--s-4) 0 0 0;
  padding-left: var(--s-3);
  border-left: 2px solid var(--rule);
}

.solution-empty {
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0;
}

/* -- Section 03: nose-curve controls and margin readout -------------------- */
.nose-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
}

@media (max-width: 760px) {
  .nose-controls {
    grid-template-columns: 1fr;
  }
}

.nose-control {
  min-width: 0;
}

.nose-readout {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
  margin-top: var(--s-3);
}

/* -- Section 05: which solution did Newton-Raphson actually find? ---------- */
.verdict {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.5;
  border: 1px solid var(--rule);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-3);
  background: var(--bg-card);
  color: var(--ink-soft);
}

.verdict--idle {
  border-left-color: var(--rule);
  color: var(--ink-muted);
}

.verdict--high {
  border-left-color: var(--map-high);
  background: rgba(242, 100, 25, 0.06);
  color: var(--ink);
}

.verdict--low {
  border-left-color: var(--map-low);
  background: rgba(106, 76, 147, 0.07);
  color: var(--ink);
}

.verdict--odd,
.verdict--fail {
  border-left-color: var(--ink-muted);
  background: var(--bg-soft);
  color: var(--ink-soft);
}

/* ==========================================================================
   Static build additions
   The Pages build has no Dash, so the .dash-slider-* rules above are inert
   here and native range inputs need their own styling. Everything else --
   layout, cards, typography, the section reveal -- is shared with the app.
   ========================================================================== */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 9999px;
  background: var(--rule);
  outline: none;
  margin: 10px 0 6px 0;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--slider);
  border: 2px solid var(--bg-card);
  box-shadow: 0 1px 3px rgba(28, 28, 28, 0.25);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--slider);
  border: 2px solid var(--bg-card);
  box-shadow: 0 1px 3px rgba(28, 28, 28, 0.25);
  cursor: pointer;
  border-color: var(--bg-card);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--slider);
  outline-offset: 2px;
}

/* Each magnet's slider takes its magnet's colour, as in the app. */
.toy-slider--a input[type="range"]::-webkit-slider-thumb { background: var(--sol-high); }
.toy-slider--a input[type="range"]::-moz-range-thumb     { background: var(--sol-high); }
.toy-slider--b input[type="range"]::-webkit-slider-thumb { background: var(--sol-low); }
.toy-slider--b input[type="range"]::-moz-range-thumb     { background: var(--sol-low); }

/* Slider end labels, replacing Dash's marks. */
.slider-ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* Native <details> matches the Dash collapsibles closely enough; just make
   the marker consistent. */
.collapsible > summary { cursor: pointer; }

/* The comparison table is built as real markup here rather than by Python. */
.solution-table table { width: 100%; border-collapse: collapse; }

/* Footer with provenance and the link back out. */
.site-footer {
  padding: var(--s-6);
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.site-footer a { color: var(--accent); }

.static-note {
  background: var(--bg-soft);
  border: 1px solid var(--rule-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4);
  margin: var(--s-4) 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* -- Section jump bar -------------------------------------------------------
   Every section is visible on arrival in the static build, so this is how
   someone who came for the convergence map reaches it without scrolling past
   the derivation. */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-4);
}

.toc a {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.toc a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Nothing is revealed progressively here, so the fade would only delay the
   first paint of a page that is already complete. */
.section {
  animation: none;
}
