:root {
  --green: #22c670;
  --green-dark: #119655;
  --green-deep: #087044;
  --night: #061914;
  --ink: #122033;
  --muted: #587065;
  --cream: #f4fbf7;
  --paper: #fdfffe;
  --mint: #e3f7ec;
  --mint-strong: #caefdb;
  --line: #d4e9dd;
  --cyan: #63e5ff;
  --violet: #a78bfa;
  --gold: #ffc15a;
  --coral: #ff6b74;
  --shadow: 0 20px 54px rgba(5, 50, 27, .11);
  --shadow-soft: 0 8px 22px rgba(34, 198, 112, .15);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; min-height: 100%; background: var(--cream); -webkit-text-size-adjust: 100%; }
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 400px at 52% -180px, #dff7ea 0%, rgba(223, 247, 234, 0) 72%),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
button, input, select, output { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--green-dark); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-150%); padding: 9px 13px; border-radius: 9px; color: var(--night); background: var(--green); font-weight: 850; }
.skip-link:focus { transform: none; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.site-header {
  width: min(1540px, calc(100% - 28px));
  min-height: 64px;
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(253, 255, 254, .9);
  box-shadow: 0 6px 20px rgba(5, 50, 27, .06);
  backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--night); text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: var(--mint); }
.brand-mark img { display: block; width: 39px; height: 39px; object-fit: contain; }
.brand > span:last-child { display: grid; line-height: 1.1; }
.brand strong { font-size: 1rem; font-weight: 900; letter-spacing: -.02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: .62rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.level-pill { padding: 8px 12px; border: 1px solid var(--mint-strong); border-radius: 999px; color: var(--green-deep); background: var(--mint); font-size: .69rem; font-weight: 900; letter-spacing: .045em; text-transform: uppercase; }

main { width: min(1540px, calc(100% - 28px)); margin: 0 auto; padding: 18px 0 26px; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 470px); align-items: end; gap: 28px; margin-bottom: 16px; }
.eyebrow, .step-label { display: block; color: var(--green-dark); font-size: .68rem; font-weight: 900; letter-spacing: .105em; text-transform: uppercase; }
.intro h1 { margin: 3px 0 4px; color: var(--night); font-size: clamp(1.72rem, 3vw, 2.45rem); line-height: 1.08; letter-spacing: -.04em; }
.intro > div > p { margin: 0; color: var(--muted); font-size: clamp(.92rem, 1.3vw, 1.04rem); }
.learning-goal { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid var(--mint-strong); border-radius: 15px; background: rgba(227, 247, 236, .68); }
.learning-goal > span { flex: 0 0 auto; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: var(--night); background: var(--green); font-weight: 950; }
.learning-goal p { margin: 0; display: grid; gap: 2px; }
.learning-goal small { color: var(--green-deep); font-size: .62rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.learning-goal strong { color: var(--night); font-size: .87rem; line-height: 1.35; }

.laboratory-grid { display: grid; grid-template-columns: minmax(0, 1fr) 365px; gap: 14px; align-items: start; }
.stage-panel, .control-panel, .evidence-panel, .learning-row { border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.stage-panel { grid-column: 1; grid-row: 1; min-width: 0; overflow: hidden; }
.control-panel { grid-column: 2; grid-row: 1 / span 2; padding: 14px; }
.evidence-panel { grid-column: 1; grid-row: 2; min-width: 0; padding: 14px; }
.stage-toolbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.stage-toolbar h2 { margin: 2px 0 0; color: var(--night); font-size: clamp(1rem, 1.8vw, 1.28rem); line-height: 1.2; letter-spacing: -.025em; }
.transport-controls { display: flex; align-items: center; gap: 8px; }
.primary-button, .quiet-button, .launch-button {
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 12px;
  background: var(--paper);
  font-weight: 850;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
}
.primary-button, .launch-button { border-color: var(--green); background: var(--green); box-shadow: var(--shadow-soft); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.primary-button:hover, .quiet-button:hover, .launch-button:hover { transform: translateY(-1px); border-color: var(--green); }
#play-icon { min-width: 14px; font-weight: 950; }

.orbit-frame {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 50%, rgba(25, 73, 108, .35), transparent 36%),
    linear-gradient(180deg, #081a22, #030c11);
}
.orbit-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .34;
  background-image:
    radial-gradient(circle at 16% 18%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 22%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 84% 76%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 34% 82%, #fff 0 1px, transparent 1.5px);
  background-size: 147px 131px, 173px 157px, 191px 173px, 211px 197px;
}
#orbit-canvas { display: block; width: 100%; height: 540px; }
.vector-key { position: absolute; left: 14px; bottom: 13px; display: flex; flex-wrap: wrap; gap: 8px 13px; padding: 7px 9px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; color: rgba(236,255,247,.78); background: rgba(4,20,14,.7); font-size: .67rem; font-weight: 750; backdrop-filter: blur(8px); }
.vector-key span { display: inline-flex; align-items: center; gap: 6px; }
.vector-key i { width: 24px; height: 0; border-top: 3px solid; }
.velocity-key { border-color: var(--cyan) !important; }
.gravity-key { border-color: var(--green) !important; }
.trail-key { border-color: var(--violet) !important; border-top-style: dotted !important; }
.mission-badge { position: absolute; top: 14px; right: 14px; min-width: 145px; display: grid; justify-items: end; padding: 9px 11px; border: 1px solid rgba(99,229,255,.2); border-radius: 11px; color: rgba(236,255,247,.7); background: rgba(4,20,14,.72); backdrop-filter: blur(8px); }
.mission-badge small { font-size: .61rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.mission-badge strong { color: var(--cyan); font-size: .9rem; }
.event-strip { min-height: 70px; display: grid; grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr); align-items: center; gap: 20px; padding: 10px 15px; border-top: 1px solid rgba(34,198,112,.12); color: #dff8ea; background: var(--night); }
.event-strip div { display: grid; gap: 2px; }
.event-strip div span { color: #8fb7a5; font-size: .61rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.event-strip div strong { font-size: .78rem; }
.event-strip p { margin: 0; color: #a8c9ba; font-size: .74rem; }
.event-strip p strong { color: var(--green); }

.step-label { margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.step-label b { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 7px; color: var(--night); background: var(--green); font-size: .67rem; }
.select-control { display: grid; gap: 5px; color: var(--ink); font-size: .72rem; font-weight: 800; }
.select-control select { min-height: 39px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; }
.range-control { display: grid; gap: 5px; margin-top: 12px; }
.range-control > span { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .75rem; }
.range-control output { color: var(--green-deep); font-size: .72rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.range-control input { width: 100%; margin: 0; accent-color: var(--green); cursor: pointer; }
.range-control > small { display: flex; justify-content: space-between; color: var(--muted); font-size: .56rem; }
.scenario-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 12px; }
.scenario-grid button { min-height: 54px; display: grid; align-content: center; justify-items: start; gap: 1px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #f9fcfa; cursor: pointer; }
.scenario-grid button:hover, .scenario-grid button[aria-pressed="true"] { border-color: var(--green); background: var(--mint); }
.scenario-grid button strong { font-size: .7rem; }
.scenario-grid button small { color: var(--muted); font-size: .58rem; }
.launch-button { width: 100%; margin-top: 9px; color: var(--night); }
.control-note { margin: 7px 1px 0; color: var(--muted); font-size: .59rem; }
.prediction-card { margin: 12px 0; padding: 11px 12px; border-left: 4px solid var(--green); border-radius: 10px; background: var(--mint); }
.prediction-card > span { display: block; color: var(--green-deep); font-size: .59rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.prediction-card > strong { display: block; margin-top: 2px; color: var(--night); font-size: .88rem; }
.prediction-card p { margin: 4px 0 0; color: #3f6153; font-size: .69rem; line-height: 1.4; }
.playback-section { padding-top: 2px; border-top: 1px solid var(--line); }
.range-control.compact { margin-top: 8px; }
.range-control.compact > small { display: block; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.readout-grid div { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.readout-grid span { display: block; color: var(--muted); font-size: .57rem; font-weight: 750; }
.readout-grid strong { display: block; margin-top: 2px; color: var(--green-deep); font-size: .78rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.evidence-panel > header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 10px; }
.evidence-panel h2 { margin: 2px 0 0; font-size: clamp(1.05rem, 1.8vw, 1.3rem); letter-spacing: -.025em; }
.evidence-panel header p { max-width: 370px; margin: 0; color: var(--muted); font-size: .7rem; text-align: right; }
.evidence-grid { display: grid; grid-template-columns: 1.1fr 1.2fr .9fr; gap: 9px; }
.evidence-grid article { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: #f9fcfa; }
.evidence-grid article > span { display: block; color: var(--green-deep); font-size: .58rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.evidence-grid article > strong { display: block; min-height: 35px; margin-top: 3px; font-size: .76rem; line-height: 1.3; }
.balance-equation { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 7px; margin-top: 8px; }
.balance-equation span { display: grid; gap: 2px; padding: 7px; border-radius: 9px; background: var(--mint); text-align: center; }
.balance-equation i { color: var(--muted); font-size: .58rem; font-style: normal; }
.balance-equation b { color: var(--green-deep); font-size: .67rem; }
.balance-equation em { color: var(--violet); font-size: 1.1rem; font-style: normal; font-weight: 950; }
.energy-axis { position: relative; height: 16px; margin: 12px 2px 8px; }
.energy-axis b { position: absolute; top: -3px; bottom: -3px; left: 50%; width: 2px; background: var(--ink); }
.energy-axis i { position: absolute; top: 3px; height: 10px; border-radius: 99px; }
#potential-bar { right: 50%; width: 48%; background: var(--violet); border-radius: 99px 0 0 99px; }
#kinetic-bar { left: 50%; width: 24%; background: var(--green); border-radius: 0 99px 99px 0; }
.energy-card p { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.energy-card p span { min-width: 0; color: var(--muted); font-size: .54rem; }
.energy-card p b { display: block; color: var(--ink); font-size: .62rem; overflow-wrap: anywhere; }
.orbit-card dl { margin: 7px 0 0; display: grid; gap: 4px; }
.orbit-card dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.orbit-card dt { color: var(--muted); font-size: .56rem; }
.orbit-card dd { margin: 0; color: var(--green-deep); font-size: .63rem; font-weight: 850; text-align: right; }

.learning-row { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; }
.learning-row article { min-width: 0; display: flex; gap: 10px; padding: 13px 15px; border-right: 1px solid var(--line); }
.learning-row article:last-child { border-right: 0; }
.learning-row article > span { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--night); background: var(--green); font-size: .69rem; font-weight: 950; }
.learning-row article strong { display: block; font-size: .78rem; }
.learning-row article p { margin: 2px 0 0; color: var(--muted); font-size: .67rem; }
.site-footer { width: min(1540px, calc(100% - 28px)); margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: .65rem; }
.site-footer img { width: 25px; height: 25px; object-fit: contain; }
.site-footer i { width: 4px; height: 4px; border-radius: 50%; background: var(--green); }

@media (max-width: 1080px) {
  .laboratory-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .orbit-frame, #orbit-canvas { min-height: 500px; height: 500px; }
  .event-strip { grid-template-columns: 1fr; gap: 4px; }
  .evidence-grid { grid-template-columns: 1fr 1fr; }
  .orbit-card { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .intro { grid-template-columns: 1fr; gap: 12px; }
  .learning-goal { max-width: 620px; }
  .laboratory-grid { grid-template-columns: 1fr; }
  .stage-panel { grid-column: 1; grid-row: 1; }
  .control-panel { grid-column: 1; grid-row: 2; }
  .evidence-panel { grid-column: 1; grid-row: 3; }
  .control-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .prediction-card { margin: 0; }
  .playback-section { align-self: end; }
  .readout-grid { margin-top: 0; align-self: end; }
}
@media (max-width: 680px) {
  .site-header, main, .site-footer { width: min(100% - 18px, 1540px); }
  main { padding-top: 13px; }
  .level-pill { display: none; }
  .intro h1 { font-size: 1.65rem; }
  .stage-toolbar { align-items: start; }
  .transport-controls { flex-direction: column; align-items: stretch; }
  .transport-controls button { min-height: 34px; padding: 6px 9px; font-size: .7rem; }
  .orbit-frame, #orbit-canvas { min-height: 440px; height: 440px; }
  .mission-badge { min-width: 125px; }
  .event-strip { min-height: 82px; }
  .control-panel { display: block; }
  .control-panel > * + * { margin-top: 12px; }
  .evidence-panel > header { align-items: start; flex-direction: column; gap: 4px; }
  .evidence-panel header p { text-align: left; }
  .evidence-grid { grid-template-columns: 1fr; }
  .orbit-card { grid-column: auto; }
  .learning-row { grid-template-columns: 1fr; }
  .learning-row article { border-right: 0; border-bottom: 1px solid var(--line); }
  .learning-row article:last-child { border-bottom: 0; }
}
@media (max-width: 430px) {
  .brand > span:last-child small { display: none; }
  .site-header { min-height: 56px; }
  .brand-mark { width: 37px; height: 37px; }
  .brand-mark img { width: 34px; height: 34px; }
  .learning-goal { align-items: start; }
  .stage-toolbar { display: grid; }
  .transport-controls { flex-direction: row; }
  .orbit-frame, #orbit-canvas { min-height: 400px; height: 400px; }
  .vector-key { right: 12px; }
  .scenario-grid { grid-template-columns: 1fr 1fr; }
  .energy-card p { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
