/* Notes: long-form text with formulas and a figure. Builds on /style.css. */

.note { max-width: 700px; margin: 0 auto; padding-top: 56px; }
.crumb { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.crumb a { text-decoration: none; color: var(--accent); }
.crumb a:hover { text-decoration: underline; }

.note h1 {
  font-family: var(--display);
  font-weight: normal;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1.12;
  margin-bottom: 8px;
  text-wrap: balance;
}
.note h2 { margin: 44px 0 14px; }
.note h3 { font-family: var(--display); font-weight: normal; font-size: 1.35rem; line-height: 1.25; margin: 28px 0 10px; }
.note p, .note ul, .note ol { margin-bottom: 14px; }
.note ul, .note ol { padding-left: 1.3em; }
.note li { margin-bottom: 8px; }
.note li::marker { color: var(--accent); }
.note em { font-style: italic; }

.claim {
  margin: 20px 0;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}

/* Latin Modern Math (GUST Font License), bundled so formulas look the same everywhere. */
@font-face {
  font-family: 'Latin Modern Math';
  src: url('/fonts/latinmodern-math.woff2') format('woff2');
  font-display: swap;
}
math { font-family: 'Latin Modern Math', "STIX Two Math", "Cambria Math", math; font-size: 1.16em; }
.eq { margin: 18px 0; padding: 2px 0; overflow-x: auto; overflow-y: hidden; }
.eq math { margin: 0 auto; }
/* several short equations side by side; they stack on narrow screens */
.eqs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 2.4em; margin: 18px 0; }
.eqs .eq { margin: 4px 0; }
/* one long chain of equalities, allowed to break before an equals sign */
.eqs.chain { gap: 0 0.3em; }

/* ---- figure ---- */

.fig {
  margin: 28px -60px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
#figure { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; }

.tri { fill: color-mix(in srgb, var(--accent) 9%, transparent); stroke: none; }
.tri-edge { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linejoin: round; }
.circum { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 5; }
.apo { fill: none; stroke-width: 1.6; }
.apo.kc { stroke: var(--blue); }
.apo.ka { stroke: var(--green); }
.apo.kb { stroke: var(--rose); }
.euler { stroke: var(--gold); stroke-width: 1.4; stroke-dasharray: 9 5; }
.centre { fill: var(--text); }
.xpoint { fill: var(--gold); stroke: var(--card); stroke-width: 2; }
.label { font-family: var(--display); font-style: italic; font-size: 19px; fill: var(--text); paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.label.small { font-size: 16px; fill: var(--muted); }
.label.xlabel { fill: var(--gold); }
.aux { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.tangent { stroke: var(--blue); stroke-width: 2.2; stroke-linecap: round; }
.aux-point { fill: var(--muted); }
.label.aux-label { font-size: 16px; }

.handle { cursor: grab; touch-action: none; outline: none; }
.handle.dragging { cursor: grabbing; }
.handle .hit { fill: transparent; }
.handle .dot { fill: var(--card); stroke: var(--text); stroke-width: 2; transition: r 0.12s; }
.handle:hover .dot, .handle.dragging .dot { r: 8px; stroke: var(--accent); }
.handle:focus-visible .hit { stroke: var(--accent); stroke-width: 2; }

.fig figcaption { padding: 14px 18px 16px; border-top: 1px solid var(--border); font-size: 0.92rem; }
.fig figcaption p { margin-bottom: 8px; }
.fig figcaption p:last-child { margin-bottom: 0; }
.readout { min-height: 1.6em; }
.readout .off { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; width: 22px; height: 0; border-top: 2px solid; }
.sw.kc { border-color: var(--blue); }
.sw.ka { border-color: var(--green); }
.sw.kb { border-color: var(--rose); }
.sw.euler { border-color: var(--gold); border-top-style: dashed; }
.sw.circum { border-color: var(--muted); border-top-style: dotted; }
.toggle { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; cursor: pointer; color: var(--text); }
.toggle input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.reset {
  font: inherit;
  font-size: 0.85rem;
  padding: 3px 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}
.reset:hover { color: var(--text); border-color: var(--muted); }
.hint { color: var(--muted); }

.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); }

@media (max-width: 860px) { .fig { margin-left: 0; margin-right: 0; } }
@media (max-width: 640px) { .note { padding-top: 36px; } .label { font-size: 24px; } .label.small { font-size: 20px; } }
