:root {
  --ink: #191713;
  --ink-soft: #5f574c;
  --paper: #efe9dc;
  --paper-light: #f8f4eb;
  --line: #c9bead;
  --line-dark: #918474;
  --tendon: #bf573d;
  --tendon-dark: #793725;
  --measure: #6b7d65;
  --measure-dark: #425342;
  --bone: #e0d2b9;
  --shadow: rgba(25, 23, 19, 0.16);
  --display: Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia, serif;
  --body: Avenir Next, Helvetica Neue, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --max: 1180px;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(191, 87, 61, 0.05) 1px, transparent 1px) 0 0 / 84px 84px,
    var(--paper);
}

a { color: inherit; }

button, input { font: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--tendon);
  outline-offset: 4px;
}

.shell {
  width: min(calc(100% - 48px), var(--max));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 48px), var(--max));
  min-height: 72px;
  margin-inline: auto;
  border-bottom: 1px solid var(--line-dark);
}

.brand {
  font-family: var(--mono);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.language {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.language a, .language-current {
  min-width: 44px;
  padding: 8px 10px;
  text-align: center;
  text-decoration: none;
}

.language-current {
  color: var(--paper-light);
  background: var(--ink);
}

main { padding-bottom: 100px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: clamp(36px, 7vw, 100px);
  align-items: center;
  min-height: 630px;
  padding-top: 68px;
  padding-bottom: 74px;
}

.hero-copy { position: relative; z-index: 2; }

.eyebrow, .section-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  color: var(--tendon-dark);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 2px solid var(--tendon);
  border-radius: 50%;
}

h1, h2, p { margin-top: 0; }

h1, h2 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 8ch;
  margin-bottom: 25px;
  font-size: clamp(4.5rem, 9vw, 8.2rem);
  line-height: 0.87;
}

.dek {
  max-width: 37rem;
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-size: clamp(1.15rem, 1.65vw, 1.43rem);
  line-height: 1.4;
}

.hero-answer {
  max-width: 35rem;
  margin-bottom: 26px;
  font-size: 1rem;
  line-height: 1.5;
}

.hero-answer strong { color: var(--tendon-dark); }

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 13px 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-dark);
}

.formula {
  font-family: var(--mono);
  font-size: 0.94em;
  letter-spacing: -0.04em;
}

.proof-source {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.proof-source a, .sources-list a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

.hinge-stage {
  position: relative;
  min-height: 470px;
  border-left: 1px solid var(--line-dark);
  background: rgba(248, 244, 235, 0.55);
  isolation: isolate;
}

.hinge-stage::before, .hinge-stage::after {
  position: absolute;
  z-index: -1;
  content: "";
  border: 1px solid var(--line);
  border-radius: 50%;
}

.hinge-stage::before { width: 390px; height: 390px; left: 18%; top: 2%; }
.hinge-stage::after { width: 280px; height: 280px; left: 29%; top: 14%; border-color: rgba(191, 87, 61, 0.3); }

.arm-figure { position: absolute; inset: 0; }

.upper-arm {
  position: absolute;
  left: 15%;
  top: 49%;
  width: 37%;
  height: 24px;
  transform: rotate(-65deg);
  transform-origin: right center;
  border: 2px solid var(--ink);
  border-radius: 50% 12px 12px 50%;
  background: var(--bone);
}

.forearm {
  position: absolute;
  left: 41%;
  top: 55%;
  width: 44%;
  height: 29px;
  transform: rotate(-4deg);
  transform-origin: left center;
  border: 2px solid var(--ink);
  border-radius: 16px 48% 48% 16px;
  background: var(--bone);
  box-shadow: 0 7px 0 rgba(25, 23, 19, 0.08);
}

.elbow-joint {
  position: absolute;
  left: 38%;
  top: 49%;
  width: 61px;
  height: 61px;
  border: 5px solid var(--tendon);
  border-radius: 50%;
  background: var(--paper-light);
  box-shadow: inset 0 0 0 9px var(--bone);
}

.muscle-band {
  position: absolute;
  left: 32%;
  top: 29%;
  width: 18%;
  height: 30%;
  transform: rotate(19deg);
  border: 5px solid var(--tendon);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 60% 30% 0 0;
}

.weight-block {
  position: absolute;
  right: 7%;
  top: 50%;
  min-width: 72px;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper-light);
  font-family: var(--mono);
  font-size: 0.83rem;
  text-align: center;
  transform: rotate(2deg);
}

.gravity-arrow {
  position: absolute;
  right: 11%;
  top: 57%;
  color: var(--tendon);
  font-family: var(--display);
  font-size: 2.4rem;
  line-height: 1;
}

.dimension-line {
  position: absolute;
  left: 41%;
  right: 11%;
  top: 73%;
  border-top: 2px solid var(--measure-dark);
}

.dimension-line::before, .dimension-line::after {
  position: absolute;
  top: -6px;
  width: 10px;
  height: 10px;
  content: "";
  border: 2px solid var(--measure-dark);
  border-radius: 50%;
  background: var(--paper);
}

.dimension-line::before { left: -5px; }
.dimension-line::after { right: -5px; }

.dimension-label {
  position: absolute;
  right: 35%;
  top: 75%;
  color: var(--measure-dark);
  font-family: var(--mono);
  font-size: 0.84rem;
}

.stage-note {
  position: absolute;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.stage-note-top { right: 5%; top: 43%; }
.stage-note-bottom { left: 8%; bottom: 14%; }

.stage-result {
  position: absolute;
  left: 7%;
  bottom: 8%;
  color: var(--tendon-dark);
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1;
}

.stage-result small { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0; }

.measure-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line-dark);
}

.measure-strip > div {
  min-height: 106px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.measure-strip > div:last-child { border-right: 0; }

.measure-strip span, .measure-strip strong {
  display: block;
}

.measure-strip span {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.69rem;
  line-height: 1.25;
  text-transform: uppercase;
}

.measure-strip strong {
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.measure-strip .measure-emphasis strong { color: var(--tendon-dark); }

.article { padding-top: 110px; }

.article-section {
  max-width: 760px;
  margin-bottom: 118px;
}

.article-section h2 {
  margin-bottom: 24px;
  font-size: clamp(2.5rem, 5vw, 4.9rem);
  line-height: 0.97;
}

.article-section > p:not(.section-kicker):not(.method-note), .source-note, .measure-warning {
  font-size: 1.08rem;
  line-height: 1.75;
}

.comparison-figure { margin: 38px 0 0; }

.comparison-bars {
  display: grid;
  gap: 20px;
  padding-block: 22px 18px;
  border-block: 1px solid var(--line-dark);
}

.comparison-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 60px;
  gap: 14px;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.comparison-row i {
  display: block;
  width: var(--bar);
  min-width: 13px;
  height: 18px;
  background: var(--measure);
}

.comparison-row:last-child i { background: var(--tendon); }
.comparison-row strong { font-size: 1.03rem; }
.comparison-figure figcaption { margin-top: 14px; color: var(--ink-soft); font-size: 0.84rem; }

.tool-section { max-width: none; }

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(280px, 0.68fr);
  margin-top: 38px;
  border: 1px solid var(--ink);
  background: var(--paper-light);
}

.tool-visual {
  min-width: 0;
  padding: 20px;
  background:
    linear-gradient(90deg, rgba(107, 125, 101, 0.14) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(rgba(107, 125, 101, 0.14) 1px, transparent 1px) 0 0 / 34px 34px,
    #e6e0d3;
}

#leverCanvas { display: block; width: 100%; height: auto; min-height: 270px; }

.tool-controls {
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: 25px 24px 24px;
  border-left: 1px solid var(--ink);
}

.control label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.control-definition {
  margin: -2px 0 7px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.control output { color: var(--tendon-dark); font-family: var(--mono); font-size: 0.78rem; white-space: nowrap; }

input[type="range"] {
  display: block;
  width: 100%;
  height: 28px;
  accent-color: var(--tendon);
}

.reset-button, .preset-row button {
  min-height: 44px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.71rem;
  text-align: left;
}

.reset-button { padding: 10px 12px; }
.reset-button:hover, .preset-row button:hover { background: var(--ink); color: var(--paper-light); }

.tool-readout {
  margin-top: 4px;
  border-top: 2px solid var(--tendon);
}

.tool-readout p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.77rem;
  line-height: 1.25;
}

.tool-readout strong { color: var(--tendon-dark); font-family: var(--mono); font-size: 1.08rem; white-space: nowrap; }
.tool-readout small { font-size: 0.65rem; }

.tool-caveat { margin: 0; color: var(--ink-soft); font-size: 0.73rem; line-height: 1.55; }

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.preset-row button { padding: 10px 12px; }

.equation-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
  margin: 36px 0 25px;
  padding-block: 21px;
  border-block: 1px solid var(--line-dark);
  color: var(--tendon-dark);
  font-family: var(--mono);
  font-size: clamp(1.1rem, 2.6vw, 2rem);
}

.equation-line b { color: var(--ink-soft); font-weight: 400; }
.equation-line strong { color: var(--ink); }

.source-note {
  margin-top: 32px;
  padding: 20px 22px;
  border-left: 4px solid var(--measure);
  background: rgba(107, 125, 101, 0.1);
}

.source-note strong { color: var(--measure-dark); }

.measure-list {
  display: grid;
  gap: 0;
  margin: 37px 0 25px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-dark);
}

.measure-list li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.measure-list li > span {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid var(--measure-dark);
  border-radius: 50%;
  color: var(--measure-dark);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.measure-list p { margin: 0; font-size: 1rem; }
.measure-warning { color: var(--tendon-dark); }

.sources-section { margin-bottom: 50px; }

.sources-list {
  display: grid;
  gap: 0;
  margin: 36px 0 30px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-dark);
}

.sources-list li {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(130px, 0.8fr);
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.87rem;
}

.sources-list span { color: var(--ink-soft); font-family: var(--mono); font-size: 0.68rem; line-height: 1.45; }
.method-note { padding-top: 20px; border-top: 1px solid var(--line-dark); color: var(--ink-soft); font-size: 0.78rem; line-height: 1.6; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 28px;
  padding-block: 22px 38px;
  border-top: 1px solid var(--line-dark);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.site-footer a:first-child { color: var(--ink); font-weight: 700; text-decoration: none; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-copy { max-width: 700px; }
  h1 { max-width: 10ch; }
  .hinge-stage { min-height: 440px; max-width: 700px; }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-controls { border-top: 1px solid var(--ink); border-left: 0; }
}

@media (max-width: 650px) {
  .shell, .site-header { width: min(calc(100% - 32px), var(--max)); }
  .site-header { min-height: 62px; }
  .hero { gap: 35px; padding-top: 48px; padding-bottom: 48px; }
  h1 { max-width: 7ch; font-size: clamp(4rem, 18vw, 6.3rem); }
  .dek { font-size: 1.08rem; }
  .hero-answer { font-size: 0.94rem; }
  .hinge-stage { min-height: 330px; border-left: 0; }
  .hinge-stage::before { width: 280px; height: 280px; left: 12%; top: 4%; }
  .hinge-stage::after { width: 195px; height: 195px; left: 25%; top: 17%; }
  .upper-arm { left: 9%; width: 38%; height: 19px; }
  .forearm { left: 36%; width: 53%; height: 22px; }
  .elbow-joint { left: 33%; top: 47%; width: 48px; height: 48px; border-width: 4px; box-shadow: inset 0 0 0 7px var(--bone); }
  .muscle-band { left: 26%; top: 26%; width: 21%; height: 29%; border-width: 4px; }
  .weight-block { right: 2%; top: 49%; min-width: 59px; padding: 6px 8px; font-size: 0.7rem; }
  .gravity-arrow { right: 6%; top: 56%; font-size: 2rem; }
  .dimension-line { left: 36%; right: 7%; top: 71%; }
  .dimension-label { right: 31%; top: 74%; font-size: 0.72rem; }
  .stage-note { font-size: 0.56rem; }
  .stage-note-top { right: 0; top: 40%; }
  .stage-note-bottom { left: 0; bottom: 12%; }
  .stage-result { left: 0; bottom: 3%; font-size: 2.4rem; }
  .measure-strip { grid-template-columns: repeat(2, 1fr); }
  .measure-strip > div:nth-child(2) { border-right: 0; }
  .measure-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .measure-strip > div { min-height: 92px; padding: 14px 12px; }
  .measure-strip span { font-size: 0.6rem; }
  .measure-strip strong { font-size: 1.55rem; }
  .article { padding-top: 74px; }
  .article-section { margin-bottom: 83px; }
  .article-section h2 { font-size: 2.65rem; }
  .article-section > p:not(.section-kicker):not(.method-note), .source-note, .measure-warning { font-size: 1rem; line-height: 1.65; }
  .comparison-row { grid-template-columns: 104px minmax(0, 1fr) 45px; gap: 8px; font-size: 0.65rem; }
  .comparison-row strong { font-size: 0.9rem; }
  .tool-visual { padding: 8px; }
  #leverCanvas { min-height: 200px; }
  .tool-controls { padding: 20px 16px 18px; }
  .preset-row { display: grid; grid-template-columns: 1fr; }
  .preset-row button { width: 100%; text-align: center; }
  .equation-line { gap: 9px; font-size: 1.06rem; }
  .sources-list li { grid-template-columns: 1fr; gap: 7px; }
  .site-footer { padding-bottom: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
