@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('./fonts/dm-mono-regular.ttf') format('truetype'); }
:root {
  color-scheme: dark;
  --bg: #000; --fg: #eee; --muted: #929292; --line: #292929;
  --amber: #dfaf71; --blue: #93babd; --green: #82b68b;
  --surface: #080808; --surface-2: #111; --surface-3: #2b2b2b;
  --border: #333; --border-2: #444; --divider-strong: #666;
  --text-dim: #999; --text-faint: #777; --icon: #bbb;
  --canvas-strong: #aaa; --canvas-mid: #999; --canvas-faint: #777;
  --sans: Arial, Helvetica, sans-serif; --mono: 'DM Mono', monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfbf9; --fg: #171715; --muted: #68685f; --line: #e2e2dc;
  --amber: #9c631c; --blue: #2c6672; --green: #3c7648;
  --surface: #f1f1ec; --surface-2: #fff; --surface-3: #e6e6e0;
  --border: #d7d7d0; --border-2: #c5c5bd; --divider-strong: #b6b6ac;
  --text-dim: #79796f; --text-faint: #8c8c81; --icon: #55554d;
  --canvas-strong: #83837a; --canvas-mid: #93938a; --canvas-faint: #9d9d94;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 30px; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); -webkit-font-smoothing: antialiased; transition: background-color .15s ease, color .15s ease; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button, select { color: inherit; font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, canvas:focus-visible, select:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
button { border: 0; }
.site { max-width: 1700px; margin: auto; padding: 0 5%; }
.header { height: 96px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-links { display: flex; align-items: center; gap: 22px; }
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-size: 16px; letter-spacing: -.5px; }
.wordmark svg { width: 44px; height: 36px; stroke: var(--amber); fill: none; stroke-width: 1.15; }
.wordmark .logo-point { fill: var(--fg); stroke: var(--fg); }
.domain { color: var(--muted); }
.text-link { color: var(--text-dim); text-decoration: none; font-size: 12px; }
.text-link span { margin-left: 12px; }
.text-link:hover { color: var(--fg); }
.theme-toggle { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--fg); }
.theme-toggle:hover { border-color: var(--border-2); }
.theme-toggle svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.hero { display: grid; grid-template-columns: 34% 66%; min-height: 575px; height: min(720px, calc(100svh - 265px)); }
.intro { padding-top: clamp(50px, 7.5vh, 95px); }
.eyebrow { font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.intro .eyebrow { margin: 0 0 27px; }
h1 { font-size: clamp(54px, 5.7vw, 96px); line-height: 1.02; letter-spacing: -.065em; font-weight: 500; margin: 0 0 30px; }
.intro-copy { font-size: 19px; line-height: 1.4; margin: 0 0 16px; letter-spacing: -.3px; }
.description { font-size: 13px; line-height: 1.8; color: var(--muted); margin: 0; max-width: 245px; }
.explore-button { display: inline-flex; gap: 38px; border-bottom: 1px solid var(--divider-strong); padding-bottom: 10px; margin-top: 30px; font-size: 12px; color: var(--fg); text-decoration: none; }
.scene { position: relative; min-width: 0; min-height: 0; }
.scene-heading { position: absolute; left: 7%; right: 0; top: 32px; display: flex; justify-content: space-between; font: 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
.scene-controls { position: absolute; bottom: 25px; left: 7%; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mode-switch { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.mode, .motion { background: transparent; color: var(--text-dim); font-size: 11px; padding: 10px 12px; border-radius: 2px; }
.mode.active, .motion.active { background: var(--surface-3); color: var(--fg); }
.mode:hover, .motion:hover { color: var(--fg); }
.motion-controls { display: flex; align-items: center; gap: 12px; }
.reset { width: 32px; height: 32px; background: none; color: var(--icon); font-size: 25px; }
.interaction-bar { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 15px 0; color: var(--muted); font-size: 11px; }
.interaction-bar p { margin: 0; line-height: 1.6; }
.point-control { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.point-control select { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 3px; padding: 5px; min-width: 42px; }
.invariant { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 145px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.invariant-heading { flex: 0 0 22%; }
.invariant-heading p { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 10px 0 0; }
.equation { display: flex; align-items: center; justify-content: center; gap: clamp(22px, 3.3vw, 56px); }
.symbolic { font-size: 27px; letter-spacing: -.035em; margin-bottom: 12px; }
.symbolic span { font-size: 20px; padding: 0 6px; opacity: .7; }
.product-amber { color: var(--amber); }
.product-blue { color: var(--blue); }
.measurement { font: 10px var(--mono); display: flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.measurement > span:not(.times):not(.equals-small) { min-width: 4.3ch; }
.measurement .times, .equals-small { opacity: .5; }
.measurement strong { font-weight: 400; padding: 5px 7px; background: color-mix(in srgb, var(--fg) 4%, transparent); border: 1px solid color-mix(in srgb, var(--fg) 9%, transparent); border-radius: 3px; }
.equal-sign { color: var(--canvas-strong); font-size: 26px; padding-bottom: 5px; }
.constant { margin-left: auto; white-space: nowrap; }
.constant > span { font-size: 18px; }
.constant p { margin: 10px 0 0; color: var(--muted); font: 9px var(--mono); }
.proof { display: grid; grid-template-columns: 34% 1fr; gap: 7%; padding: 65px 0 70px; }
h2 { font-size: clamp(26px, 3vw, 40px); font-weight: 500; line-height: 1.12; letter-spacing: -.045em; margin: 20px 0; max-width: 310px; }
.proof-heading > p:last-child { color: var(--muted); font-size: 13px; line-height: 1.8; max-width: 300px; }
.proof-body { counter-reset: step; }
.proof-step { position: relative; padding: 0 0 24px 38px; }
.proof-step::before { counter-increment: step; content: '0' counter(step); position: absolute; left: 0; top: 3px; font: 10px var(--mono); color: var(--text-faint); }
.proof-step h3 { margin: 0 0 9px; font-size: 14px; font-weight: 500; }
.proof-step p { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 0; max-width: 570px; }
.proof-equation { font-size: clamp(17px, 2vw, 23px); color: var(--fg); margin: 15px 0; line-height: 1.5; letter-spacing: -.02em; }
.proof-result { color: var(--amber); }
.proof-note { border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 11px; line-height: 1.8; }
footer { border-top: 1px solid var(--line); min-height: 70px; display: flex; justify-content: space-between; align-items: center; color: var(--text-faint); font-size: 10px; }
@media (max-width: 1100px) {
  .hero { grid-template-columns: 32% 68%; }
  .scene-controls { left: 3%; }
  .mode, .motion { padding: 9px; }
  .invariant { gap: 15px; }
  .invariant-heading { flex-basis: 18%; }
  .equation { gap: 20px; }
  .measurement { gap: 4px; font-size: 9px; }
  .constant > span { font-size: 16px; }
}
@media (max-width: 760px) {
  .site { padding: 0 6%; }
  .header { height: 78px; }
  .wordmark { font-size: 13px; gap: 5px; }
  .wordmark svg { width: 35px; }
  .text-link { font-size: 10px; }
  .text-link span { margin-left: 3px; }
  .hero { display: block; height: auto; min-height: 0; }
  .intro { padding-top: 35px; }
  .intro .eyebrow { margin-bottom: 18px; }
  h1 { font-size: clamp(45px, 10vw, 70px); margin-bottom: 18px; }
  h1 br { display: none; }
  .intro-copy { font-size: 16px; margin-bottom: 8px; }
  .intro-copy br { display: none; }
  .description { max-width: 350px; font-size: 12px; }
  .explore-button { display: none; }
  .scene { width: 112%; margin-left: -6%; height: clamp(410px, 100vw, 520px); margin-top: 8px; }
  .scene-heading { top: 22px; left: 6%; right: 6%; font-size: 8px; }
  .scene-controls { bottom: 18px; left: 6%; right: 6%; gap: 6px; flex-wrap: wrap; }
  .mode, .motion { font-size: 10px; padding: 9px 10px; }
  .motion-controls { gap: 4px; }
  .reset { width: 25px; }
  .interaction-bar { flex-wrap: wrap; gap: 10px; }
  .invariant { flex-wrap: wrap; padding: 22px 0; gap: 24px 8px; }
  .invariant-heading { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .invariant-heading p { font-size: 10px; margin: 0; }
  .equation { flex: 1; justify-content: space-around; gap: 10px; }
  .symbolic { font-size: 24px; }
  .measurement { font-size: 9px; gap: 3px; }
  .measurement strong { padding: 4px; }
  .constant { width: 100%; margin: 0; display: flex; align-items: center; justify-content: center; gap: 15px; }
  .constant p { margin: 0; }
  .proof { grid-template-columns: 1fr; gap: 24px; padding: 40px 0; }
  h2, .proof-heading > p:last-child { max-width: none; }
  .proof-step { padding-left: 30px; }
  .proof-equation { font-size: 18px; }
}
@media (max-width: 380px) {
  .mode, .motion { padding: 8px; }
  .symbolic { font-size: 21px; }
  .measurement { font-size: 8px; gap: 2px; }
}

/* The live invariant is part of the first view, directly above the drawing. */
.wordmark svg { stroke: var(--green); }
.wordmark .logo-point { fill: var(--green); stroke: var(--green); }
.hero { grid-template-rows: 174px minmax(440px, 1fr); min-height: 650px; height: min(800px, calc(100svh - 170px)); }
.intro { grid-column: 1; grid-row: 1 / 3; }
.invariant { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; align-self: stretch; margin: 24px 0 0 7%; border-top: 0; padding: 0 0 18px; display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; }
.invariant-heading { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.invariant-heading p { font-size: 10px; margin: 0; }
.equation { grid-column: 1 / -1; justify-content: space-between; gap: 15px; }
.symbolic { font-size: clamp(22px, 2.3vw, 33px); letter-spacing: normal; margin-bottom: 8px; }
.symbolic span { font-size: inherit; padding: 0; opacity: 1; }
.katex { font-size: 1.08em; }
.measurement { display: block; font-family: var(--sans); font-size: clamp(11px, 1.1vw, 15px); min-height: 20px; }
.equal-sign { padding-bottom: 17px; }
.constant { grid-column: 1 / -1; margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.constant > span { font-size: 13px; }
.constant p { margin: 0; font-size: 9px; }
.scene { grid-column: 2; grid-row: 2; }
.scene-heading { top: 20px; }
.proof-equation { font-size: clamp(16px, 1.6vw, 21px); overflow-x: auto; padding-bottom: 6px; }
.proof-step p .katex, .proof-heading p .katex, .proof-note .katex { color: var(--muted); }
@media (max-width: 1100px) and (min-width: 761px) {
  .invariant { margin-left: 3%; }
  .symbolic { font-size: 24px; }
  .measurement { font-size: 12px; }
  .invariant-heading { flex-wrap: wrap; gap: 5px; }
}
@media (max-width: 760px) {
  .hero { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .intro { padding-top: 30px; }
  .invariant { display: grid; width: 100%; margin: 24px 0 0; padding: 18px 0; border-top: 1px solid var(--line); gap: 14px; }
  .invariant-heading { flex-wrap: wrap; gap: 7px; }
  .equation { gap: 8px; }
  .symbolic { font-size: clamp(21px, 6vw, 29px); }
  .measurement { font-size: clamp(10px, 2.8vw, 13px); }
  .constant { width: auto; justify-content: space-between; padding-top: 0; }
  .constant > span { font-size: 13px; }
  .scene { flex: none; }
  .proof-equation { font-size: 16px; }
}

.putnam-button { background: none; border: 0; font: inherit; }
dialog#putnam-dialog {
  width: min(680px, 90vw); max-height: min(720px, 84vh); padding: 0; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg); color: var(--fg); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
dialog#putnam-dialog::backdrop { background: rgba(0,0,0,.55); }
:root[data-theme="light"] dialog#putnam-dialog::backdrop { background: rgba(20,20,15,.35); }
.putnam-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.putnam-head h2 { margin: 6px 0 0; font-size: 20px; letter-spacing: -.02em; max-width: none; }
.putnam-close { width: 30px; height: 30px; flex: none; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--fg); font-size: 13px; }
.putnam-close:hover { border-color: var(--border-2); }
.putnam-body { padding: 16px 24px 4px; overflow-y: auto; max-height: calc(84vh - 150px); font-size: 15px; line-height: 1.75; }
.putnam-body p { margin: 0 0 14px; }
.putnam-body .katex-display { margin: 1em 0; overflow-x: auto; overflow-y: hidden; }
.putnam-body .tex-sublist { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.putnam-body .tex-sublist li { display: flex; gap: 8px; }
.putnam-body .tex-item-label { color: var(--muted); font: 12px var(--mono); flex: none; padding-top: .2em; }
.putnam-body .tex-footnotes { border-top: 1px solid var(--line); margin: 6px 0 0; padding: 12px 0 14px 20px; color: var(--muted); font-size: 13px; }
.putnam-body .tex-error { color: #c66; font-family: var(--mono); font-size: .85em; }
.putnam-body .tex-figure-omitted { color: var(--muted); font-style: italic; }
.putnam-credit { margin: 0; padding: 12px 24px 20px; color: var(--muted); font-size: 11px; }
.putnam-credit a { color: inherit; }
@media (max-width: 760px) {
  .header-links { gap: 10px; }
  .putnam-button span { display: none; }
  .putnam-head { padding: 18px 18px 0; }
  .putnam-body { padding: 14px 18px 4px; }
  .putnam-credit { padding: 10px 18px 16px; }
}
