:root {
  color-scheme: light;
  --paper: #f8faff;
  --white: #fff;
  --mist: #eef3ff;
  --ink: #17213d;
  --body: #394762;
  --muted: #54617b;
  --line: #dbe3f2;
  --blue: #4665ff;
  --blue-ink: #324fdd;
  --violet: #9370ff;
  --cyan: #5dddeb;
  --danger: #a12b43;
  --shadow: 0 20px 56px rgba(49, 69, 133, .09), 0 3px 12px rgba(49, 69, 133, .05);
  --heading: "Space Grotesk", Bahnschrift, "Segoe UI", sans-serif;
  --text: Inter, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--paper); color: var(--body); font: 16px/1.65 var(--text); }
a { color: var(--blue-ink); text-underline-offset: .2em; }
a:hover { color: #4932ab; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 4px; }
button, a { touch-action: manipulation; }
a, button, summary { transition: color .18s, background-color .18s, box-shadow .18s, transform .18s; }
h1, h2, h3 { margin: 0; color: var(--ink); font-family: var(--heading); line-height: 1.08; }
h2 { font-size: clamp(2rem, 4.15vw, 3.9rem); letter-spacing: -.065em; }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); letter-spacing: -.035em; }
.wrap { width: min(1536px, calc(100% - 72px)); margin-inline: auto; }
.eyebrow { margin: 0 0 14px; color: var(--blue-ink); font-size: .72rem; font-weight: 700; letter-spacing: .105em; text-transform: uppercase; }
.small { color: var(--muted); font-size: .81rem; }
.skip { position: fixed; top: 12px; left: 12px; z-index: 20; transform: translateY(-170%); padding: 10px 16px; border-radius: 10px; background: var(--white); }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid rgba(167, 181, 219, .35);
  backdrop-filter: blur(16px);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 60px; }
.brand { display: flex; flex: none; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-weight: 750; line-height: 1.2; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: .67rem; font-weight: 500; }
.mark { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: linear-gradient(140deg, #3556ef, #6551d7); box-shadow: 0 5px 12px rgba(70, 101, 255, .19); }
.mark::before, .mark::after { content: ""; position: absolute; width: 26px; height: 11px; border: 1px solid #fff; border-radius: 50%; transform: rotate(-38deg); }
.mark::after { transform: rotate(38deg); opacity: .7; }
.mark i { width: 5px; height: 5px; border-radius: 50%; background: #fff; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
nav a { padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--body); font-size: .85rem; font-weight: 650; }
nav a:hover { background: var(--mist); color: var(--blue-ink); }

.primary, .text-button, .chart-footer button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 17px;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}
.primary { background: var(--blue-ink); color: var(--white); box-shadow: 0 7px 19px rgba(62, 87, 235, .2); }
.primary:hover { background: #263fc7; color: var(--white); box-shadow: 0 9px 22px rgba(62, 87, 235, .27); transform: translateY(-2px); }
.primary:active, .text-button:active { transform: translateY(1px); }
.text-button, .chart-footer button { border-color: var(--line); color: var(--blue-ink); background: var(--white); }
.text-button:hover, .chart-footer button:not(:disabled):hover { background: var(--mist); border-color: #bccafb; }
.lab {
  position: relative;
  padding-block: clamp(19px, 2.2vw, 32px) clamp(32px, 4.5vw, 68px);
  background: radial-gradient(ellipse at 84% 0%, #e6edff 0%, transparent 46%), var(--paper);
  border-bottom: 1px solid var(--line);
}
.lab-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 22px;
  margin-bottom: 17px;
}
.lab-heading .eyebrow { margin-bottom: 5px; }
.lab-heading .text-button { flex: none; }
h1 { font-size: clamp(2.45rem, 4.3vw, 4rem); letter-spacing: -.07em; }
h1 em { color: var(--blue-ink); font-style: normal; }
.lab-grid, .material-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(276px, 28%);
  min-width: 0;
  border: 1px solid #cbd6ed;
  border-radius: 19px;
  background: var(--white);
  box-shadow: 0 14px 35px rgba(40, 63, 128, .08);
}
.plot-area { min-width: 0; padding: clamp(12px, 1.8vw, 25px); }
.plot-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 13px; }
.plot-head h2, .controls h2 { font-size: 1.16rem; letter-spacing: -.03em; }
.jump-to-controls { display: none; }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 10px 0 11px;
  border: 1px solid #d7e1f8;
  border-radius: 10px;
  background: linear-gradient(106deg, #edf2ff, #f6f8ff 63%, #f2faff);
}
.metrics > div { min-width: 0; padding-inline: clamp(6px, 1.4vw, 18px); }
.metrics > div + div { border-left: 1px solid var(--line); }
.metrics dt, .flight-detail dt { color: var(--muted); font-size: .74rem; font-weight: 650; line-height: 1.3; }
.metrics dd, .flight-detail dd { margin: 3px 0 0; font-variant-numeric: tabular-nums; }
.metrics dd { color: var(--blue-ink); font: 700 clamp(1.15rem, 3vw, 2.45rem)/1.05 var(--heading); letter-spacing: -.055em; }
.metrics > div:nth-child(2) dd { color: #206b7d; }
.metrics > div:nth-child(3) dd { color: var(--ink); }
.chart { position: relative; height: clamp(238px, 25vw, 365px); margin: 10px 0 8px; border-radius: 11px; background: linear-gradient(180deg, #f5f8ff, #fff); }
canvas { display: block; width: 100%; height: 100%; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; text-align: center; color: var(--muted); background: var(--paper); border: 1px dashed #bdc9e2; border-radius: 12px; }
.chart-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chart-legend { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted); font-size: .73rem; }
.chart-legend span { white-space: nowrap; }
.chart-legend i { display: inline-block; width: 14px; margin-right: 4px; border-top: 2px solid var(--blue-ink); vertical-align: middle; }
.chart-legend .legend-dash { border-top: 2px dashed #7654c4; }
.chart-legend .legend-target { border-top: 2px dotted #267687; }
.chart-footer button { padding: 5px 9px; min-height: 35px; font-size: .73rem; }
.flight-timeline { margin-top: 13px; padding: clamp(11px, 1.5vw, 17px); border: 1px solid #d7e1f8; border-radius: 12px; background: #f6f8ff; }
.timeline-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.timeline-head h3 { font-size: 1.05rem; }
.timeline-head p { margin: 4px 0 0; color: var(--muted); font-size: .73rem; }
.timeline-head .text-button { min-height: 36px; flex: none; padding: 5px 10px; font-size: .74rem; }
.timeline-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(112px, 23%); gap: 14px; align-items: stretch; }
.timeline-plot { min-width: 0; }
.timeline-plot canvas { height: 108px; border: 1px solid #dce5f8; border-radius: 8px; background: var(--white); }
.timeline-plot label { margin: 7px 0 0; font-size: .74rem; }
.timeline-plot input { margin: 0; min-height: 29px; }
.timeline-events { display: flex; flex-wrap: wrap; gap: 5px; }
.timeline-events button { min-height: 32px; padding: 4px 8px; border: 1px solid #cbd8f3; border-radius: 7px; background: var(--white); color: var(--blue-ink); font-size: .71rem; font-weight: 650; }
.timeline-events button:not(:disabled):hover, .timeline-events button[aria-pressed="true"] { border-color: #9aadee; background: #e8eeff; }
.timeline-values { display: grid; align-content: start; gap: 8px; margin: 0; padding-left: 12px; border-left: 1px solid #d7e1f8; }
.timeline-values dt { color: var(--muted); font-size: .72rem; font-weight: 650; line-height: 1.25; }
.timeline-values dd { margin: 2px 0 0; color: #206b7d; font: 700 clamp(1rem, 2vw, 1.35rem)/1.16 var(--heading); font-variant-numeric: tabular-nums; }
.timeline-download { min-height: 34px; margin-top: 9px; padding: 4px 8px; font-size: .71rem; }
.flight-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); gap: 10px 14px; margin: 13px 0 0; padding: 11px 0 7px; border-top: 1px solid var(--line); }
.flight-detail dd { color: var(--ink); font: 650 1.08rem/1.25 var(--heading); }
.flight-detail > div:last-child dd { color: #6744bc; }
.status, #modalStatus { margin: 12px 0 7px; padding: 8px 10px; border-radius: 8px; border-left: 3px solid #3796a9; background: #edf9fc; color: #205565; font-size: .78rem; }
.status:not(.error) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.status.error, #modalStatus.error { border-color: var(--danger); color: var(--danger); background: #fff1f3; }
.plot-area > .small { margin: 8px 0 0; font-size: .73rem; }
.controls, .material-controls { min-width: 0; padding: clamp(15px, 1.8vw, 25px); background: #f0f4ff; }
.controls { align-self: stretch; border-left: 1px solid #cbd6ed; border-radius: 0 18px 18px 0; }
.controls h2 { margin-bottom: 14px; }
label { display: block; margin-bottom: 11px; color: var(--ink); font-size: .81rem; font-weight: 650; }
label > span, label > output { float: right; padding-left: 6px; color: var(--muted); font-size: .72rem; }
input[type="number"], select {
  display: block;
  width: 100%;
  min-height: 41px;
  padding: 6px 9px;
  margin-top: 5px;
  border: 1px solid #b2c1df;
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  font-size: .85rem;
}
input[type="range"] { display: block; width: 100%; min-height: 26px; margin: 3px 0 0; accent-color: var(--blue-ink); }
.check { display: flex; align-items: center; gap: 8px; min-height: 29px; }
input[type="checkbox"] { width: 18px; height: 18px; flex: none; accent-color: var(--blue-ink); }
.controls details { margin: 0 0 12px; border-block: 1px solid #d4def3; }
.controls summary { min-height: 37px; padding: 7px 0; color: var(--blue-ink); font-size: .78rem; font-weight: 650; }
.controls .primary { width: 100%; }
.material-controls { border-right: 1px solid #cbd6ed; border-radius: 18px 0 0 18px; }
.section-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.section-title > p { max-width: 36ch; margin: 0 0 2px; color: var(--muted); font-size: .94rem; }
.design-section, .materials, .evidence { padding-block: clamp(35px, 5vw, 76px); }
.spec-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 13px 0; margin-bottom: 26px; border-block: 1px solid var(--line); }
.spec-strip > div { min-width: 0; padding: 3px clamp(7px, 2vw, 20px); }
.spec-strip > div + div { border-left: 1px solid var(--line); }
.spec-strip strong { display: block; color: var(--ink); font: 700 clamp(1.4rem, 2.8vw, 2.05rem)/1.17 var(--heading); letter-spacing: -.045em; }
.spec-strip strong span { margin-left: 4px; color: var(--blue-ink); font-size: .52em; letter-spacing: 0; }
.spec-strip small { display: block; color: var(--muted); margin-top: 3px; font-size: .73rem; }

.comparison { display: grid; grid-template-columns: minmax(185px, 25%) minmax(0, 1fr); gap: 20px; margin-top: 34px; }
.comparison p { margin: 8px 0 0; color: var(--muted); font-size: .82rem; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.comparison table { min-width: 580px; font-variant-numeric: tabular-nums; }
.comparison tbody tr:nth-child(even):not(.best) { background: #f8faff; }
table { width: 100%; border-collapse: collapse; background: var(--white); font-size: .83rem; }
th, td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--mist); color: var(--ink); font-size: .75rem; white-space: nowrap; }
tbody tr.best { background: #eef0ff; color: var(--blue-ink); font-weight: 650; }

.design-grid, .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(20px, 5vw, 70px); align-items: start; }

.prose p { margin: 0 0 17px; }
.process { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 16px; }
.process span { padding: 8px 10px; border-radius: 9px; background: var(--mist); color: var(--blue-ink); font-size: .78rem; }
.process b { color: var(--ink); }
.machine { min-width: 0; margin: 0; padding: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.machine svg { display: block; width: 100%; height: auto; }
.machine text { fill: var(--ink); font: 10px var(--text); }
.machine .drawing-label { font-size: 9px; letter-spacing: .1em; }
.machine figcaption { margin-top: 10px; color: var(--muted); font-size: .76rem; }
.equations { padding-block: 34px clamp(55px, 7vw, 100px); }
.math-line { margin: 14px 0; padding: 12px 9px; overflow-x: auto; border-radius: 12px; background: var(--mist); font-size: clamp(1rem, 2vw, 1.35rem); color: var(--ink); }

.subjects { padding-bottom: clamp(50px, 7vw, 96px); }
.subject-list { border-top: 1px solid var(--line); }
.subject-list details, .project-team details { border-bottom: 1px solid var(--line); }
.subject-list summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; gap: 12px; align-items: center; list-style: none; min-height: 61px; padding: 13px 8px; color: var(--ink); font-weight: 700; }
.subject-list summary::-webkit-details-marker { display: none; }
.subject-list summary:hover { background: var(--mist); }
.subject-list summary::after { content: "+"; color: var(--blue-ink); font-size: 1.4rem; text-align: center; font-weight: 500; }
.subject-list details[open] summary::after { content: "−"; }
.subject-list summary b { color: var(--muted); font-size: .77rem; font-weight: 600; }
.subject-content { max-width: 83ch; padding: 0 12px 16px; font-size: .91rem; }
.subject-content p { margin-top: 0; }

.materials { border-top: 1px solid var(--line); }
.material-layout { grid-template-columns: minmax(208px, 27%) minmax(0, 1fr); }
.material-controls a { font-size: .85rem; font-weight: 650; }
.material-detail { min-width: 0; padding: clamp(18px, 3.2vw, 40px); }
.material-detail h3 { font-size: 1.65rem; }
.material-detail > p { margin: 12px 0; }
.material-detail .eyebrow { margin: 0 0 6px; }
.material-detail caption { padding-bottom: 8px; color: var(--muted); text-align: left; }
#materialSources, #referenceList { overflow-wrap: anywhere; }
.research-note { display: grid; grid-template-columns: minmax(145px, 22%) minmax(0, 1fr); gap: 15px; margin-top: 24px; padding: 17px; border-radius: 14px; background: var(--mist); font-size: .88rem; }
.research-note > span { color: var(--blue-ink); font-weight: 700; }
.research-note > p { margin: 0; }

.evidence { background: #f0f4ff; border-block: 1px solid var(--line); }
.downloads { border-top: 1px solid var(--line); }
.downloads > a { display: grid; grid-template-columns: 53px minmax(0, 1fr) 24px; align-items: center; gap: 14px; padding: 13px 10px; border-bottom: 1px solid var(--line); text-decoration: none; }
.downloads > a:hover { background: var(--white); }
.downloads > a > span { justify-self: start; padding: 3px 5px; border-radius: 6px; border: 1px solid var(--line); background: var(--white); color: var(--blue-ink); font-size: .65rem; font-weight: 700; }
.downloads strong { display: block; color: var(--ink); }
.downloads small { display: block; color: var(--muted); font-size: .78rem; }
.downloads b { text-align: center; }
.closing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 18px; font-size: .86rem; }
.closing b { color: var(--ink); }
.references { padding-block: clamp(45px, 6vw, 82px) 24px; }
.references h2 { font-size: clamp(1.85rem, 3.3vw, 3rem); }
.references ol { columns: 2; column-gap: 42px; padding-left: 22px; font-size: .81rem; }
.references li { padding: 5px 0; break-inside: avoid; }
.project-team { padding-block: 10px 28px; }
.project-team details { border-top: 1px solid var(--line); }
.project-team summary { padding: 13px 0; color: var(--ink); font-weight: 700; }
.project-team summary > span { margin-left: 10px; color: var(--muted); font-size: .74rem; font-weight: 500; }
.project-team ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 23px; margin: 0; padding: 0; list-style: none; }
.project-team li { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding: 8px 0; font-size: .83rem; }
footer { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-block: 18px 24px; color: var(--muted); font-size: .77rem; }
footer strong { color: var(--ink); font-size: .95rem; }

dialog { width: min(720px, calc(100% - 28px)); max-height: 89vh; padding: clamp(17px, 3.4vw, 33px); border: 1px solid var(--line); border-radius: 24px; background: var(--white); color: var(--body); box-shadow: 0 32px 100px rgba(35, 49, 104, .28); }
dialog::backdrop { background: rgba(39, 55, 102, .29); backdrop-filter: blur(4px); }
dialog p { font-size: .88rem; }
.dialog-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog-top h2 { font-size: clamp(1.65rem, 4.4vw, 2.9rem); }
.dialog-top button { width: 44px; min-height: 44px; flex: none; border: 1px solid var(--line); border-radius: 12px; background: var(--mist); color: var(--ink); font-size: 1.55rem; }
#calculatorForm { display: flex; align-items: flex-end; gap: 10px; margin: 19px 0 9px; }
#calculatorForm label { flex: 1; min-width: 0; margin: 0; }
dialog > a { display: inline-block; margin-top: 16px; font-size: .84rem; }

@media (max-width: 1000px) {
  .wrap { width: calc(100% - 56px); }
  nav { gap: 3px; }
  nav a { padding-inline: 7px; }
}
@media (min-width: 1150px) {
  .controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    column-gap: 12px;
  }
  .controls > :is(h2, label, details, button) { grid-column: 1 / -1; }
  .controls > :is(#targetField, #loadField, label:has(> #angle)) { grid-column: auto; }
}
@media (max-width: 770px) {
  html { scroll-padding-top: 98px; }
  .wrap { width: calc(100% - 28px); }
  .header-inner { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding-block: 7px 5px; }
  .mark { width: 31px; height: 31px; border-radius: 10px; }
  nav { width: 100%; justify-content: space-between; }
  nav a { padding: 5px 3px; font-size: .74rem; }
  .lab-heading { display: block; margin-bottom: 15px; }
  .lab-heading .text-button { margin-top: 12px; }
  .section-title { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 17px; }
  .lab-grid, .material-layout, .design-grid, .split, .comparison { grid-template-columns: minmax(0, 1fr); }
  .controls, .material-controls { border-left: 0; border-right: 0; border-radius: 0 0 18px 18px; }
  .controls { border-top: 1px solid #cbd6ed; }
  .material-controls { border-bottom: 1px solid #cbd6ed; border-radius: 18px 18px 0 0; }
  .jump-to-controls { display: inline; align-self: center; flex: none; font-size: .73rem; font-weight: 650; white-space: nowrap; }
  .chart-legend { flex-basis: 100%; }
  .flight-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison { gap: 9px; }
  .spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .spec-strip > div:nth-child(3) { border-left: 0; }
  .equations { padding-top: 8px; }
  .subject-list summary { grid-template-columns: minmax(0, 1fr) 24px; gap: 2px 9px; }
  .subject-list summary b { grid-column: 1; grid-row: 2; }
  .subject-list summary::after { grid-column: 2; grid-row: 1 / span 2; }
  .research-note, .closing, .project-team ul { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .references ol { columns: 1; }
  footer { flex-wrap: wrap; }
}
@media (max-width: 370px) {
  .plot-head { flex-wrap: wrap; }
  .chart-footer button { font-size: .67rem; padding-inline: 7px; }
}
@media (max-width: 540px) {
  .timeline-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .timeline-values { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 7px; padding: 9px 0 0; border-left: 0; border-top: 1px solid #d7e1f8; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .site-header, .skip, .primary, .text-button, .controls, .chart-footer button, dialog { display: none !important; }
  .wrap { width: 100%; }
  .lab-grid, .material-layout { display: block; }
  .lab, .evidence { background: var(--white); }
  .chart { height: 240px; }
  .timeline-head button, .timeline-plot label, .timeline-plot input, .timeline-events, .timeline-download { display: none; }
}
