:root {
  color-scheme: dark;
  --background: #002b36;
  --surface: #073642;
  --line: #31505a;
  --muted: #93a1a1;
  --body: #b5c1bf;
  --paper: #eee8d5;
  --cyan: #2aa198;
  --blue: #268bd2;
  --gold: #b58900;
  --orange: #cb4b16;
  --green: #859900;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--body); font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .65; }
a { color: inherit; text-underline-offset: .22em; text-decoration-color: var(--line); }
a:hover { color: var(--paper); text-decoration-color: var(--cyan); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }
button:focus:not(:focus-visible) { outline: none; }
strong { color: var(--paper); font-weight: 550; }
::selection { background: #2aa198; color: #002b36; }
[hidden] { display: none !important; }
.page-shell { width: min(1240px, calc(100% - 88px)); margin-inline: auto; }
.skip-link { position: absolute; top: -80px; left: 20px; z-index: 5; background: var(--paper); color: var(--background); padding: 10px 18px; }
.skip-link:focus { top: 16px; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 27px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.masthead a { text-decoration: none; }
.author-link { color: var(--paper); font-weight: 550; letter-spacing: -.015em; }
.author-link span { margin-left: 7px; color: var(--muted); }
nav { display: flex; gap: 30px; }
nav span { color: var(--muted); margin-left: 3px; }
.eyebrow { font: 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .13em; color: var(--muted); margin: 0 0 28px; }
.hero { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: start; padding: 76px 0 88px; }
.hero-copy { padding-top: 30px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { color: var(--paper); font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { font-size: clamp(48px, 6vw, 82px); line-height: 1.03; letter-spacing: -.052em; margin: 0 0 30px; }
h1 em { color: var(--cyan); font-weight: 400; }
.hero-deck { max-width: 360px; color: var(--paper); font-size: 19px; line-height: 1.6; margin-bottom: 29px; }
.equation { display: flex; gap: 16px; align-items: center; color: var(--paper); font: 33px/1.3 Georgia, "Times New Roman", serif; width: max-content; }
.math-italic { font-style: italic; font-size: 1.15em; }
.equals { color: var(--muted); font-size: .9em; }
.fraction { display: inline-flex; flex-direction: column; align-items: center; font-size: .95em; }
.fraction span:first-child { border-bottom: 1px solid var(--paper); padding: 0 8px 6px; }
.fraction span:last-child { padding-top: 3px; font-size: .85em; }
.decimal { margin: 12px 0 30px; color: var(--muted); font: 12px/1.7 var(--mono); }
.decimal span { display: block; font-size: 11px; margin-top: 2px; }
.hero-summary { margin-bottom: 24px; font-size: 15px; }
.primary-link { display: inline-flex; align-items: center; gap: 30px; padding: 12px 18px; color: var(--background); background: var(--paper); text-decoration: none; font-size: 14px; font-weight: 600; border: 1px solid var(--paper); }
.primary-link:hover { background: var(--cyan); border-color: var(--cyan); color: var(--background); }
.primary-link span { font-size: 18px; }
.publication-status { margin: 17px 0 0; color: var(--muted); font-size: 11px; }
.construction-figure { margin: 0; min-width: 0; }
.figure-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 35px; }
.figure-topline .eyebrow { margin: 0; font-size: 10px; }
.quiet-button { border: 0; color: var(--body); background: transparent; padding: 8px 3px 8px 12px; font: 12px/1.5 var(--mono); min-height: 36px; }
.quiet-button:hover { color: var(--paper); }
#rotate span { font-size: 20px; vertical-align: -1px; margin-right: 6px; }
#packing { display: block; width: 100%; overflow: visible; }
.container-outline { stroke: var(--paper); stroke-width: 1.3; fill: none; opacity: .75; }
.piece { stroke-width: 1.2; stroke-linejoin: round; fill-opacity: .37; stroke-opacity: .95; transition: fill-opacity .2s, stroke-opacity .2s; }
.piece[data-name="A"], .piece[data-name="C"] { fill: var(--green); stroke: var(--green); }
.piece[data-name="B"] { fill: var(--gold); stroke: var(--gold); }
.piece[data-name="D"] { fill: var(--blue); stroke: var(--blue); }
.piece[data-name="E"] { fill: var(--cyan); stroke: var(--cyan); }
.piece[data-name="F"] { fill: var(--orange); stroke: var(--orange); }
.piece-label { fill: var(--paper); font: 14px var(--mono); text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.dimension-label { fill: var(--muted); font: 12px var(--mono); letter-spacing: .02em; }
.hexagon-region { fill: var(--cyan); fill-opacity: .055; stroke: var(--cyan); stroke-width: 1.4; stroke-dasharray: 5 5; }
.ghost-piece { stroke: var(--gold); stroke-width: 1.1; stroke-dasharray: 3 4; fill: none; opacity: .65; }
.wall-contact { fill: var(--paper); stroke: var(--background); stroke-width: 2; }
.mode-controls { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mode-controls button { border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; min-height: 48px; padding: 12px 3px; font-size: 12px; white-space: nowrap; }
.mode-controls button:hover { color: var(--paper); }
.mode-controls button[aria-pressed="true"] { border-bottom-color: var(--cyan); color: var(--paper); }
#mode-caption { font-size: 14px; line-height: 1.7; margin-top: 20px; min-height: 72px; color: var(--body); }
.drawing-note { font-size: 10px; line-height: 1.7; color: var(--muted); max-width: 440px; margin: 12px 0 0; }
.rattler-controls { display: grid; grid-template-columns: 1fr 190px; gap: 14px; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 17px; }
.slider-label { display: flex; justify-content: space-between; gap: 12px; color: var(--paper); font-size: 12px; }
.slider-label output { font: 11px var(--mono); }
input[type="range"] { width: 100%; accent-color: var(--gold); height: 27px; margin: 12px 0 7px; cursor: ew-resize; }
#rattler-help { color: var(--muted); font-size: 11px; line-height: 1.7; margin: 0; }
.motion-button { border: 1px solid var(--line); background: transparent; color: var(--paper); font-size: 12px; padding: 7px 13px; min-height: 36px; margin: 0 0 12px; }
.motion-button:hover, .motion-button[aria-pressed="true"] { border-color: var(--gold); background: var(--surface); }
.inset-wrap { min-width: 0; }
#rattler-inset { width: 100%; display: block; background: var(--surface); }
.inset-wall { stroke: var(--muted); stroke-width: 1; }
.inset-ghost { fill: none; stroke: var(--gold); stroke-width: 1; stroke-dasharray: 3 3; opacity: .75; }
.inset-moving { fill: var(--gold); fill-opacity: .35; stroke: var(--gold); stroke-width: 1.3; }
#inset-dot { fill: var(--paper); }
.inset-caption { display: block; font-size: 9px; line-height: 1.6; color: var(--muted); margin-top: 6px; }
.section-rule { border-top: 1px solid var(--line); padding-block: 72px; }
h2 { font-size: clamp(34px, 3.7vw, 48px); line-height: 1.14; letter-spacing: -.035em; margin-bottom: 34px; }
h3 { color: var(--paper); font-size: 20px; font-weight: 500; line-height: 1.4; letter-spacing: -.025em; }
.context-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; }
.context-grid h2 { margin: 0; }
.body-copy p { margin-bottom: 20px; }
.body-copy p:last-child { margin-bottom: 0; }
.body-copy a { text-decoration-color: var(--cyan); }
.bound-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 28px 0; border-block: 1px solid var(--line); padding-block: 22px; }
.bound-comparison dt { font: 10px/1.7 var(--mono); color: var(--muted); }
.bound-comparison dd { margin: 9px 0 0; font-size: 13px; }
.bound-comparison dd span { display: block; }
.bound-comparison .bound-formula { font: 28px/1.4 Georgia, "Times New Roman", serif; color: var(--paper); margin-bottom: 8px; }
.proof-section { scroll-margin-top: 35px; }
.proof-section > h2 { margin-bottom: 48px; }
.proof-step { display: grid; grid-template-columns: 40px 1fr 1.42fr; gap: 24px; padding: 28px 0 33px; border-top: 1px solid var(--line); }
.step-number { font: 12px/1.8 var(--mono); color: var(--cyan); padding-top: 3px; }
.proof-step h3 { margin: 0; padding-right: 30px; }
.proof-step .body-copy { font-size: 15px; }
.text-button, .text-link { color: var(--paper); font-size: 13px; background: transparent; border: 0; border-bottom: 1px solid var(--cyan); padding: 0 0 3px; text-decoration: none; }
.text-button:hover, .text-link:hover { color: var(--cyan); }
.text-button span, .text-link span { display: inline-block; margin-left: 12px; }
.certificate-summary { margin-top: 42px; padding-top: 32px; border-top: 1px solid var(--line); }
.summary-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 25px; }
.summary-heading h3 { margin: 0 0 22px; }
.summary-heading p { font-size: 12px; color: var(--muted); }
.terminal-bar { height: 26px; display: flex; gap: 2px; }
.terminal-bar span { transition: opacity .15s; }
[data-leaf="empty"] { --leaf-color: var(--blue); }
[data-leaf="pair"] { --leaf-color: var(--cyan); }
[data-leaf="joint"] { --leaf-color: var(--gold); }
[data-leaf="capture"] { --leaf-color: var(--orange); }
.terminal-bar span { background: var(--leaf-color); }
.terminal-bar.has-selection span:not(.selected) { opacity: .23; }
.terminal-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 15px; }
.terminal-legend button { display: grid; grid-template-columns: 8px 1fr; gap: 3px 9px; align-items: center; padding: 5px 0 9px; text-align: left; color: var(--body); background: transparent; border: 0; border-bottom: 1px solid transparent; font-size: 11px; }
.terminal-legend button:hover, .terminal-legend button[aria-pressed="true"] { color: var(--paper); border-bottom-color: var(--leaf-color); }
.legend-dot { width: 7px; height: 7px; background: var(--leaf-color); }
.terminal-legend strong { grid-column: 2; font: 17px/1.6 var(--mono); color: var(--paper); }
.leaf-detail { color: var(--muted); font-size: 12px; margin: 22px 0 35px; min-height: 42px; max-width: 750px; }
.proof-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 0; padding-top: 25px; border-top: 1px solid var(--line); }
.proof-stats div { display: flex; flex-direction: column-reverse; }
.proof-stats dd { margin: 0 0 5px; font: 32px/1.2 var(--mono); color: var(--paper); letter-spacing: -.04em; }
.proof-stats dt { color: var(--muted); font-size: 11px; }
.verification-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 76px; margin-top: 43px; }
.verification-column { min-width: 0; }
.verification-column p { font-size: 15px; margin-bottom: 20px; }
.outline-button { display: inline-flex; gap: 26px; justify-content: space-between; align-items: center; border: 1px solid var(--cyan); padding: 11px 15px; background: transparent; color: var(--paper); font-size: 13px; margin-top: 3px; }
.outline-button:hover { background: var(--surface); }
.verification-result { display: block; white-space: pre-line; color: var(--muted); min-height: 80px; margin-top: 17px; font: 11px/1.85 var(--mono); }
.verification-result.passed { color: var(--cyan); }
.verification-result.failed { color: #dc9181; }
.command { display: flex; gap: 12px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 9px 0 9px 14px; margin: 27px 0 20px; background: var(--surface); }
.command code { color: var(--paper); font: 13px var(--mono); overflow-wrap: anywhere; }
.command .quiet-button { padding-right: 13px; }
.verification-column .small-copy { color: var(--muted); font-size: 12px; }
.paper-section { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; }
.paper-section h2 { margin-bottom: 0; }
.paper-section .body-copy { padding-top: 40px; font-size: 15px; }
.paper-section strong { font-weight: 500; }
.paper-links { display: flex; flex-wrap: wrap; gap: 27px; align-items: center; margin-top: 29px; }
.credits-section { padding-block: 45px; }
.credits-section h2 { font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; margin-bottom: 18px; }
.credits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 76px; color: var(--muted); font-size: 12px; }
.credits-grid p { margin-bottom: 0; }
.credits-grid strong { font-weight: 400; }
footer { display: flex; justify-content: space-between; gap: 30px; padding: 24px 0 35px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
footer div { display: flex; gap: 23px; }
footer a { text-decoration: none; }
.noscript-note { font-size: 13px; border-left: 2px solid var(--gold); padding-left: 15px; }
@media (min-width: 1440px) { .hero { gap: 38px; } }
@media (max-width: 1050px) {
  .page-shell { width: calc(100% - 56px); }
  .hero { gap: 10px; padding-top: 48px; }
  h1 { font-size: clamp(48px, 6vw, 68px); }
  .hero-deck { font-size: 17px; max-width: 300px; }
  .mode-controls button { font-size: 10px; }
  .hero-copy { padding-top: 15px; }
  .verification-grid, .credits-grid { gap: 44px; }
  .context-grid, .paper-section { gap: 40px; }
  .rattler-controls { grid-template-columns: 1fr 150px; }
}
@media (max-width: 760px) {
  .page-shell { width: calc(100% - 40px); }
  .masthead { padding-block: 21px; font-size: 12px; gap: 15px; }
  nav { gap: 17px; }
  nav a:first-child { display: none; }
  .hero { display: block; padding: 40px 0 54px; }
  .hero-copy { padding: 0; }
  .hero-copy .eyebrow { margin-bottom: 22px; }
  h1 { font-size: clamp(49px, 10.5vw, 74px); margin-bottom: 25px; }
  .hero-deck { max-width: 390px; font-size: 18px; }
  .equation { font-size: 32px; }
  .decimal { margin-bottom: 25px; }
  .hero-summary { margin-bottom: 22px; }
  .construction-figure { margin-top: 45px; }
  .figure-topline .eyebrow { font-size: 10px; }
  .mode-controls { margin-top: 8px; }
  .mode-controls button { font-size: 11px; }
  #mode-caption { min-height: 72px; }
  .section-rule { padding-block: 48px; }
  h2 { font-size: 37px; }
  .context-grid, .paper-section { grid-template-columns: 1fr; gap: 24px; }
  .body-copy { font-size: 15px; }
  .proof-section > h2 { margin-bottom: 32px; }
  .proof-step { grid-template-columns: 28px 1fr; gap: 12px; padding: 25px 0 30px; }
  .proof-step h3 { font-size: 20px; padding: 0; }
  .proof-step .body-copy { grid-column: 2; }
  .certificate-summary { margin-top: 20px; }
  .summary-heading { display: block; }
  .summary-heading h3 { margin-bottom: 5px; }
  .summary-heading p { margin-bottom: 21px; }
  .terminal-legend { grid-template-columns: 1fr 1fr; gap: 10px 20px; }
  .terminal-legend button { font-size: 12px; }
  .proof-stats { gap: 15px; }
  .proof-stats dd { font-size: 25px; }
  .proof-stats dt { font-size: 10px; }
  .verification-grid { grid-template-columns: 1fr; gap: 30px; margin-top: 30px; }
  .verification-result { min-height: 60px; }
  .verification-column + .verification-column { border-top: 1px solid var(--line); padding-top: 30px; }
  .paper-section .body-copy { padding-top: 0; }
  .credits-grid { grid-template-columns: 1fr; gap: 20px; }
  .credits-section { padding-block: 34px; }
  footer { flex-direction: column; gap: 12px; padding-bottom: 27px; }
}
@media (max-width: 390px) {
  .page-shell { width: calc(100% - 30px); }
  h1 { font-size: 45px; }
  .mode-controls button { font-size: 10px; }
  .rattler-controls { grid-template-columns: 1fr; }
  .inset-wrap { width: 170px; }
  .bound-comparison { grid-template-columns: 1fr; gap: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
