@font-face {
  font-family: "EB Garamond";
  src: url("EBGaramond.ttf") format("truetype");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ink: #0a2035;
  --muted: #486071;
  --blue: #075e84;
  --stroke: #cfdbdf;
  --paper: #f6f8f8;
  --serif: "EB Garamond", Georgia, serif;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--blue); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid #167eaf; outline-offset: 4px; }
button, .notes-link { touch-action: manipulation; }
.shell { width: min(86rem, 100%); margin-inline: auto; padding-inline: clamp(1rem, 4.5vw, 4.5rem); }
.masthead { background: #fff; border-bottom: 1px solid var(--stroke); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 5rem; padding-block: .85rem; }
.wordmark { width: clamp(10rem, 17vw, 14rem); height: auto; display: block; }
.masthead nav { display: flex; align-items: center; gap: clamp(.8rem, 2.5vw, 2rem); }
.notes-link { display: inline-flex; gap: .38rem; align-items: baseline; font-size: .92rem; font-weight: 550; color: var(--ink); text-decoration: none; }
.notes-link span { font-size: .68rem; letter-spacing: .06em; color: var(--muted); }
.notes-link:hover, .text-button:hover { text-decoration: underline; }
.export, .challenge-button { display: inline-flex; align-items: center; justify-content: center; gap: .52rem; border: 1px solid var(--ink); border-radius: .32rem; font-weight: 560; line-height: 1.3; font-size: .91rem; padding: .7rem 1rem; }
.export { background: var(--ink); color: white; }
.export:hover { background: #16435f; }
.export svg { width: 1.12em; height: 1.12em; }
.intro { padding-block: clamp(1.8rem, 3.2vw, 2.8rem) clamp(1.55rem, 2.3vw, 2rem); }
.overline { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .75rem; line-height: 1.4; font-weight: 650; text-transform: uppercase; letter-spacing: .13em; margin: 0; }
.intro .overline::before { content: ""; height: 2px; width: 1.6rem; background: var(--blue); }
.intro .overline span:first-child { color: var(--blue); }
.slash { color: #869aa4; font-weight: 400; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; }
h1 { font-size: clamp(3.1rem, 5.45vw, 4.9rem); line-height: 1.03; letter-spacing: -.042em; margin-block: .42rem .45rem; }
.deck { color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.14rem); line-height: 1.55; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.92fr) minmax(18.7rem, 1fr); gap: 1.15rem; align-items: stretch; }
.panel, .challenge { border: 1px solid var(--stroke); border-radius: .55rem; min-width: 0; background: #fff; padding: clamp(1rem, 1.75vw, 1.55rem); }
.section-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }
h2, .model summary { font-size: clamp(1.6rem, 2.05vw, 1.95rem); line-height: 1.1; letter-spacing: -.028em; }
.figure-intro, .caption, .control-note, .model p { font-size: .92rem; line-height: 1.5; color: var(--muted); }
.figure-intro { margin-block: .45rem .75rem; }
.switch { border: 1px solid #d4dfe3; margin: 0; padding: 2px; display: inline-flex; border-radius: .35rem; background: #f2f5f6; }
.switch label { position: relative; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { display: block; font-size: .85rem; line-height: 1.25; padding: .42rem .7rem; color: var(--muted); border-radius: .23rem; }
.switch input:checked + span { background: var(--ink); color: #fff; }
.switch input:focus-visible + span { outline: 3px solid #167eaf; outline-offset: 2px; }
canvas { display: block; width: 100%; }
#field-canvas { height: clamp(20rem, 26vw, 24rem); cursor: crosshair; }
#profile-canvas { height: clamp(12.75rem, 16vw, 14.25rem); }
.caption { display: flex; gap: .55rem; align-items: baseline; margin-top: .65rem; font-size: .87rem; }
.probe-key { flex: 0 0 .56rem; height: .56rem; border: 2px solid var(--ink); background: white; border-radius: 50%; }
.controls { display: flex; flex-direction: column; }
.controls .section-top { margin-bottom: .1rem; }
.text-button { border: 0; background: transparent; color: var(--blue); padding: .4rem .08rem; font-size: .88rem; font-weight: 550; }
.slider-group { padding-top: 1.2rem; }
.slider-label { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.slider-label label { font-size: .96rem; font-weight: 550; }
.slider-label i { color: var(--muted); font: italic 1rem Georgia, serif; margin-left: .18rem; }
sub { line-height: 0; font-size: .71em; }
.slider-label output { font-size: .92rem; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
input[type="range"] { --fill: 0%; appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 1.55rem; background: transparent; cursor: pointer; margin: .32rem 0 0; }
input[type="range"]::-webkit-slider-runnable-track { height: .24rem; border-radius: 1rem; background: linear-gradient(to right, var(--blue) var(--fill), #d7e1e5 var(--fill)); }
input[type="range"]::-moz-range-track { height: .24rem; border-radius: 1rem; background: #d7e1e5; }
input[type="range"]::-moz-range-progress { background: var(--blue); height: .24rem; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; margin-top: -.4rem; width: 1.04rem; height: 1.04rem; border: .18rem solid var(--blue); border-radius: 50%; background: #fff; }
input[type="range"]::-moz-range-thumb { width: .7rem; height: .7rem; border: .18rem solid var(--blue); border-radius: 50%; background: #fff; }
.endpoints { display: flex; justify-content: space-between; font-size: .78rem; line-height: 1.25; color: var(--muted); }
.probe-control { border-top: 1px solid var(--stroke); margin-top: 1.05rem; padding-top: 1rem; }
.control-note { font-size: .84rem; margin-top: .65rem; }
.readout { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem .6rem; border-left: 3px solid #ed8c43; padding: .75rem .85rem; margin-top: auto; background: #f9f5ef; }
.controls .control-note { margin-bottom: .95rem; }
h3 { font-size: .96rem; font-weight: 600; line-height: 1.4; }
.readout h3 { font-size: .86rem; }
.readout p { color: var(--muted); font-size: .81rem; margin-top: .18rem; font-variant-numeric: tabular-nums; }
.stress-value { font: 500 clamp(1.9rem, 2.9vw, 2.7rem)/1.02 var(--serif); letter-spacing: -.045em; font-variant-numeric: lining-nums tabular-nums; }
.stress-value small { font-family: system-ui,sans-serif; font-size: .78rem; font-weight: 500; letter-spacing: 0; }
.profile-radius { display: grid; grid-template-columns: auto minmax(4rem, 14rem) 3.2rem; align-items: center; justify-content: start; gap: .8rem; margin-top: 1rem; }
.profile-radius label { font-size: .93rem; font-weight: 550; }
.profile-radius label i { font: italic 1rem Georgia, serif; color: var(--muted); }
.profile-radius input { margin: 0; }
.profile-radius output { font-size: .92rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.curve-readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1rem; margin-top: .65rem; font-size: .85rem; line-height: 1.5; }
.probe-position { color: var(--muted); }
.curve-value { display: inline-flex; gap: .28rem; align-items: center; }
.curve-value[hidden] { display: none; }
.curve-value i { display: inline-block; width: 1.15rem; border-top: 2px solid #03045e; }
.curve-value[data-series="radial"] i { border-top: 3px dashed #fd8b3a; }
.curve-value[data-series="shear"] i { border-top: 3px dotted #007db9; }
.curve-value strong { font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 37rem) {
  .profile-radius { grid-template-columns: auto minmax(3rem, 1fr) auto; gap: .55rem; }
  .profile-switch span { padding-inline: .56rem; }
}
.challenge { background: #eaf1f3; border-color: #cddde1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.challenge .overline { color: #2d6476; margin-bottom: .68rem; }
.challenge h2 { font-size: clamp(2rem, 3vw, 2.7rem); }
.challenge p:not(.overline) { margin-block: .65rem 1.1rem; font-size: .97rem; line-height: 1.55; color: #354f5e; max-width: 41ch; }
.challenge-button { color: var(--ink); border-color: #96adb6; background: transparent; }
.challenge-button:hover { background: #fff; }
.model { margin: 1.3rem 0 3rem; border-block: 1px solid var(--stroke); }
.model summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-family: var(--serif); padding: 1.15rem .1rem; cursor: pointer; list-style: none; }
.model summary::-webkit-details-marker { display: none; }
.expand-icon { height: 1rem; width: 1rem; margin-right: .25rem; position: relative; }
.expand-icon::before, .expand-icon::after { content: ""; position: absolute; top: 50%; left: 0; width: 100%; height: 1.5px; background: var(--ink); }
.expand-icon::after { transform: rotate(90deg); }
.model[open] .expand-icon::after { display: none; }
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.4rem,4vw,4rem); padding-bottom: 1.5rem; }
.model p { margin-top: .45rem; }
.model p + h3 { margin-top: 1rem; }
.equation { font: 1.11rem/1.45 var(--serif); margin: .6rem 0; }
.rim-rule { border-top: 1px solid var(--stroke); padding-top: .7rem; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip:focus { position: absolute; top: .5rem; left: .5rem; padding: .7rem 1rem; background: white; z-index: 2; }
noscript { display: block; margin-bottom: 1rem; }
@media (max-width: 53rem) {
  .workspace { grid-template-columns: 1fr; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; }
  .controls .section-top { grid-column: 1/-1; }
  .slider-group, .probe-control { margin: 0; padding: 0; border: 0; }
  .readout { align-self: center; margin: 0; }
  .challenge { padding-block: 1.4rem; }
  .challenge p:not(.overline) { max-width: 62ch; }
}
@media (max-width: 37rem) {
  .masthead-inner { min-height: 4rem; gap: .5rem; }
  .wordmark { width: clamp(6.4rem, 31vw, 10rem); }
  .masthead nav { gap: .7rem; }
  .notes-link, .export { font-size: .82rem; }
  .export { padding: .55rem .66rem; }
  .export svg, .notes-link span { display: none; }
  .workspace { gap: .85rem; }
  .intro { padding-block: 1.65rem 1.4rem; }
  .overline { font-size: .68rem; letter-spacing: .105em; }
  .deck { max-width: 36ch; }
  .field .section-top { align-items: center; }
  .switch span { padding: .42rem .48rem; font-size: .8rem; }
  .controls { display: flex; gap: 0; }
  .slider-group { padding-top: 1rem; }
  .probe-control { border-top: 1px solid var(--stroke); margin-top: 1rem; }
  .readout { align-self: stretch; margin-top: 1rem; }
  .model-grid { grid-template-columns: 1fr; }
}
@media print {
  :root { background: white; }
  .masthead nav, .challenge, .text-button, .caption, .skip, .model { display: none; }
  .shell { width: 100%; padding: 0; }
  .intro { padding: 1rem 0; }
  .workspace { display: block; }
  .panel { break-inside: avoid; margin-bottom: .75rem; }
  .controls { display: none; }
}
