:root {
  color-scheme: dark;
  --bg: #07121c;
  --panel: #0c1b27;
  --panel-2: #102331;
  --line: rgba(167, 202, 219, .13);
  --line-strong: rgba(167, 202, 219, .24);
  --text: #e7f2f6;
  --muted: #8ea8b7;
  --faint: #5d7787;
  --ice: #7dd8ec;
  --ice-bright: #b8f3ff;
  --teal: #42c5b6;
  --amber: #d8ae72;
  --danger: #ef987e;
  --radius: 15px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse at 16% -10%, rgba(45, 112, 130, .18), transparent 38%),
    radial-gradient(ellipse at 100% 10%, rgba(28, 72, 91, .14), transparent 36%),
    var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
.app-shell { max-width: 1720px; margin: 0 auto; padding: 0 28px 24px; }
.topbar {
  height: 66px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); margin-bottom: 23px;
}
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(125,216,236,.3); border-radius: 10px; color: var(--ice); font-size: 19px; background: rgba(68, 162, 184, .09); }
.eyebrow { color: #7997a7; font-size: 9px; font-weight: 800; letter-spacing: .16em; line-height: 1.4; }
.brand-name { margin-top: 1px; font-size: 11px; font-weight: 850; letter-spacing: .12em; }
.brand-name span { color: var(--ice); }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: #7d97a5; font-size: 9px; letter-spacing: .14em; font-weight: 750; }
.live-dot, .status-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px rgba(66,197,182,.6); }
.meta-divider { width: 1px; height: 12px; background: var(--line-strong); }
.icon-button, .small-icon-button, .dialog-close {
  display: grid; place-items: center; border: 1px solid var(--line-strong); background: rgba(12, 27, 39, .65); color: #a9c2ce; cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.icon-button:hover, .small-icon-button:hover, .dialog-close:hover { background: rgba(79, 162, 185, .14); border-color: rgba(125,216,236,.5); color: var(--ice-bright); }
.help-button { width: 28px; height: 28px; border-radius: 50%; font-size: 12px; font-weight: 800; }
.main-layout { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(340px, .9fr); gap: 22px; align-items: start; }
.visual-column { min-width: 0; }
.exhibit-heading { margin: 0 0 15px; }
.kicker { display: flex; align-items: center; gap: 10px; color: #80a1b1; font-size: 9px; font-weight: 800; letter-spacing: .17em; }
.kicker-line { display: inline-block; width: 25px; height: 1px; background: #477b8b; }
h1 { margin: 7px 0 5px; max-width: 850px; font-size: clamp(25px, 2.65vw, 36px); line-height: 1.1; letter-spacing: -.045em; font-weight: 730; }
h1 em { color: #a7c7d4; font-style: normal; font-weight: 470; }
.title-colon { color: var(--ice); }
.lede { margin: 0; max-width: 760px; color: #93aab7; font-size: 12px; }
.scene-card { overflow: hidden; border: 1px solid rgba(112, 174, 194, .18); border-radius: var(--radius); background: #071722; box-shadow: 0 16px 50px rgba(0,0,0,.22); }
.scene-topline { height: 40px; display: flex; justify-content: space-between; align-items: center; padding: 0 14px; background: rgba(12, 31, 44, .95); border-bottom: 1px solid rgba(130, 188, 205, .12); }
.scene-status { display: flex; align-items: center; gap: 8px; color: #a3bfca; font-size: 9px; letter-spacing: .14em; font-weight: 800; }
.status-pulse { width: 5px; height: 5px; }
.scene-tools { display: flex; gap: 6px; }
.small-icon-button { width: 27px; height: 25px; border-radius: 7px; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.camera-glyph { font-size: 16px; line-height: 1; }
.scene-stage { height: clamp(330px, 38vw, 465px); min-height: 320px; position: relative; overflow: hidden; background: radial-gradient(ellipse at 48% 43%, #143c4a 0%, #0a2432 48%, #06121d 100%); isolation: isolate; }
.scene-mount { position: absolute; inset: 0; z-index: 1; }
.scene-mount canvas { display: block; width: 100%; height: 100%; outline: none; }
.scene-gradient { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(4,13,20,.32), transparent 18%, transparent 72%, rgba(4,13,20,.42)); }
.scene-annotation { position: absolute; z-index: 3; display: flex; align-items: center; gap: 7px; color: rgba(195, 225, 235, .78); font-size: 8px; font-weight: 800; letter-spacing: .14em; text-shadow: 0 1px 8px #06131c; pointer-events: none; }
.annotation-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ice); box-shadow: 0 0 9px var(--ice); }
.annotation-upstream { top: 22%; left: 5%; }
.annotation-anchor { bottom: 24%; left: 8%; }
.annotation-release { top: 31%; right: 6%; }
.flow-indicator { position: absolute; z-index: 3; right: 14px; top: 48%; display: flex; flex-direction: column; align-items: center; gap: 2px; color: rgba(168, 203, 215, .68); font-size: 7px; letter-spacing: .12em; writing-mode: vertical-rl; pointer-events: none; }
.flow-arrow { color: var(--ice); font-size: 17px; line-height: 1; }
.scene-legend { position: absolute; z-index: 3; left: 15px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 12px; color: rgba(169, 197, 207, .76); font-size: 7px; letter-spacing: .1em; font-weight: 750; pointer-events: none; }
.scene-legend span { display: flex; align-items: center; gap: 5px; }
.scene-legend i { width: 6px; height: 6px; border-radius: 2px; display: inline-block; }
.legend-ice { background: #a9efff; box-shadow: 0 0 7px #7dd8ec; }
.legend-frazil { background: #e8faff; }
.legend-rock { background: #8a8e88; }
.webgl-message { position: absolute; z-index: 5; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(5, 16, 24, .88); color: #c8dce5; text-align: center; font-size: 12px; }
.webgl-message.visible { display: flex; }
.scene-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 38px; padding: 7px 14px; background: #0a1b27; border-top: 1px solid rgba(130, 188, 205, .11); }
.cause-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.chain-step { color: #688594; font-size: 8px; letter-spacing: .1em; }
.chain-step b { font-weight: 850; }
.chain-step.active { color: var(--ice); }
.chain-arrow { color: #4e7180; font-size: 10px; }
.scene-scale { color: #607d8c; font-size: 7px; letter-spacing: .13em; white-space: nowrap; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 11px; }
.readout-card { min-width: 0; padding: 10px 11px 9px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, rgba(15,35,48,.94), rgba(8,24,35,.94)); }
.readout-label { display: flex; justify-content: space-between; gap: 5px; color: #88a4b1; font-size: 8px; letter-spacing: .1em; font-weight: 800; white-space: nowrap; }
.readout-label span { color: #5e8293; font-family: Georgia, serif; font-size: 10px; font-style: italic; }
.readout-value { margin-top: 5px; color: #e4f5f9; font-size: clamp(17px, 1.75vw, 23px); font-weight: 690; line-height: 1.2; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { color: #80a7b7; font-size: 9px; font-weight: 650; letter-spacing: 0; }
.readout-note { margin-top: 3px; color: #698593; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-strip { display: grid; grid-template-columns: 110px 1fr 115px; align-items: center; gap: 13px; margin-top: 13px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(10, 26, 38, .72); }
.timeline-copy { display: flex; flex-direction: column; gap: 2px; }
.timeline-copy .eyebrow { font-size: 7px; }
.timeline-copy strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.timeline-track { height: 4px; position: relative; border-radius: 8px; background: #1b3544; overflow: visible; }
.timeline-fill { width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #398f9e, #9be9f5); transition: width .25s linear; }
.timeline-marker { position: absolute; left: 0; top: 50%; width: 8px; height: 8px; border: 2px solid #b6f4ff; border-radius: 50%; background: #31899a; transform: translate(-50%, -50%); box-shadow: 0 0 10px rgba(125,216,236,.7); }
.timeline-caption { color: #71909f; text-align: right; font-size: 8px; font-weight: 800; letter-spacing: .11em; }
.control-column { min-width: 0; display: flex; flex-direction: column; gap: 11px; }
.control-panel, .validation-panel, .science-panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(155deg, rgba(14, 31, 44, .98), rgba(9, 23, 34, .98)); box-shadow: 0 12px 32px rgba(0,0,0,.12); }
.control-panel { padding: 15px 15px 13px; }
.panel-heading, .validation-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading h2, .validation-heading h2 { margin: 3px 0 0; font-size: 17px; letter-spacing: -.03em; font-weight: 680; }
.panel-index { color: #668494; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.preset-block { margin-top: 14px; padding: 10px; border: 1px solid rgba(134, 182, 199, .12); border-radius: 10px; background: rgba(5, 17, 26, .42); }
.control-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.control-label-row label { color: #91aab6; font-size: 8px; letter-spacing: .12em; font-weight: 850; }
.control-label-row output { color: #c7edf5; font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
.tiny-hint { color: #5c7988; font-size: 7px; letter-spacing: .1em; }
.preset-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.preset-button { min-height: 30px; padding: 5px 3px; border: 1px solid rgba(136, 179, 195, .15); border-radius: 6px; background: rgba(18, 42, 56, .7); color: #819eac; font-size: 7px; font-weight: 850; letter-spacing: .07em; cursor: pointer; transition: .18s ease; }
.preset-button:hover { border-color: rgba(125,216,236,.4); color: #c7eff8; }
.preset-button.active { border-color: rgba(100, 199, 216, .5); background: rgba(49, 135, 154, .2); color: #b8f0f9; box-shadow: inset 0 0 0 1px rgba(100,199,216,.08); }
.controls-list { display: grid; gap: 11px; margin-top: 15px; }
.control-row { min-width: 0; }
input[type="range"] { display: block; width: 100%; height: 15px; margin: 5px 0 0; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 8px; background: linear-gradient(90deg, #398f9e, #234555); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 8px; background: linear-gradient(90deg, #398f9e, #234555); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -4px; border: 2px solid #c2f3fa; border-radius: 50%; background: #3b9eb0; box-shadow: 0 0 0 3px rgba(85, 191, 209, .12); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid #c2f3fa; border-radius: 50%; background: #3b9eb0; box-shadow: 0 0 0 3px rgba(85, 191, 209, .12); }
.range-ends { display: flex; justify-content: space-between; color: #577483; font-size: 7px; letter-spacing: .09em; }
.run-controls { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.run-buttons { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 6px; }
.primary-button, .secondary-button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; border-radius: 7px; font-size: 8px; font-weight: 850; letter-spacing: .11em; cursor: pointer; transition: .18s ease; }
.primary-button { border: 1px solid rgba(100, 214, 221, .45); background: linear-gradient(135deg, #287e8e, #1d6678); color: #e3fbff; box-shadow: 0 5px 16px rgba(25, 110, 128, .16); }
.primary-button:hover { filter: brightness(1.15); }
.primary-button span:first-child { font-size: 11px; }
.secondary-button { border: 1px solid var(--line-strong); background: rgba(17, 41, 55, .7); color: #a1bac5; }
.secondary-button:hover { border-color: rgba(125,216,236,.45); color: #d5f6fc; background: rgba(29, 71, 87, .55); }
.secondary-button span { color: var(--ice); font-size: 12px; }
.speed-row { margin-top: 12px; }
.validation-panel { padding: 12px 14px 11px; }
.validation-heading h2 { font-size: 14px; }
.validation-badge { padding: 4px 6px; border: 1px solid rgba(66,197,182,.25); border-radius: 5px; color: #83d7ca; background: rgba(40, 130, 119, .1); font-size: 7px; font-weight: 850; letter-spacing: .11em; }
.validation-panel > p { margin: 7px 0 10px; color: #819aa7; font-size: 9px; line-height: 1.45; }
.validation-values { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.validation-values div { min-width: 0; padding: 7px 8px; border-radius: 7px; background: rgba(5, 17, 26, .55); }
.validation-values span { display: block; color: #668493; font-size: 7px; font-weight: 850; letter-spacing: .1em; }
.validation-values strong { display: block; margin-top: 2px; color: #d3edf3; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.validation-foot { margin-top: 8px; color: #66818f; font-size: 7px; letter-spacing: .08em; }
.science-panel { overflow: hidden; }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary strong { display: block; margin-top: 2px; font-size: 14px; font-weight: 680; }
.summary-plus { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ice); font-size: 15px; transition: transform .2s ease; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 14px 14px; border-top: 1px solid var(--line); color: #92aab6; font-size: 10px; }
.science-content h3 { margin: 13px 0 5px; color: #c7e2ea; font-size: 9px; letter-spacing: .08em; }
.science-content p { margin: 5px 0 8px; line-height: 1.6; }
.science-content b { color: #c8eaf1; }
.equation { margin: 8px 0; padding: 8px 10px; border-left: 2px solid #53a9b8; background: rgba(46, 118, 136, .1); color: #b7eaf2; font-family: Georgia, serif; font-size: 14px; letter-spacing: .01em; }
.science-content ul { margin: 6px 0 10px; padding-left: 16px; }
.science-content li { margin: 4px 0; line-height: 1.5; }
.science-flag { padding: 8px; border: 1px solid rgba(216,174,114,.18); border-radius: 6px; color: #c9b28f; background: rgba(216,174,114,.06); font-size: 8px; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 23px; padding-top: 12px; border-top: 1px solid var(--line); color: #587381; font-size: 8px; letter-spacing: .06em; }
.page-footer i { color: #88a8b5; font-style: normal; padding: 0 4px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(2, 9, 14, .72); backdrop-filter: blur(7px); }
.modal-backdrop[hidden] { display: none; }
.shortcuts-dialog { position: relative; width: min(100%, 360px); padding: 22px; border: 1px solid var(--line-strong); border-radius: 14px; background: #0c1c28; box-shadow: 0 22px 80px rgba(0,0,0,.5); }
.shortcuts-dialog h2 { margin: 4px 0 16px; font-size: 21px; }
.dialog-close { position: absolute; top: 13px; right: 13px; width: 26px; height: 26px; border-radius: 7px; font-size: 17px; }
.shortcut-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); color: #a6bdc7; font-size: 11px; }
kbd { min-width: 48px; padding: 4px 6px; border: 1px solid var(--line-strong); border-radius: 5px; background: #132b3a; color: #d8f5fa; text-align: center; font: 700 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.shortcuts-dialog p { margin: 13px 0 0; color: #6f8a98; font-size: 9px; }
body.embed .app-shell { padding-top: 10px; }
body.embed .topbar, body.embed .page-footer { display: none; }
body.embed .main-layout { grid-template-columns: minmax(0, 1.6fr) minmax(320px, .9fr); }
body.embed .exhibit-heading { margin-top: 0; }
body.embed .scene-stage { height: min(52vh, 430px); }
@media (max-width: 1080px) {
  .app-shell { padding-left: 20px; padding-right: 20px; }
  .main-layout { grid-template-columns: minmax(0, 1.45fr) minmax(320px, .95fr); gap: 15px; }
  .readout-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .readout-value { font-size: 20px; }
  .scene-stage { height: 390px; }
  .scene-footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (max-width: 760px) {
  .app-shell { padding: 0 14px 18px; }
  .topbar { height: 58px; margin-bottom: 17px; }
  .topbar-meta { gap: 6px; font-size: 7px; }
  .help-button { width: 26px; height: 26px; }
  .main-layout, body.embed .main-layout { grid-template-columns: minmax(0,1fr); gap: 15px; }
  .exhibit-heading { margin-bottom: 12px; }
  h1 { font-size: clamp(25px, 7vw, 32px); }
  .lede { max-width: 560px; font-size: 11px; }
  .scene-stage, body.embed .scene-stage { height: clamp(310px, 52vh, 410px); min-height: 300px; }
  .scene-footer { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .cause-chain { gap: 5px; }
  .chain-step { font-size: 7px; }
  .scene-scale { font-size: 6px; }
  .readout-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .readout-card { padding: 10px; }
  .readout-value { font-size: 22px; }
  .timeline-strip { grid-template-columns: 90px 1fr; gap: 8px; }
  .timeline-caption { grid-column: 2; margin-top: -3px; }
  .control-column { gap: 10px; }
  .control-panel { padding: 14px; }
  .controls-list { gap: 13px; }
  .control-row .control-label-row label { font-size: 8px; }
  .page-footer { flex-direction: column; gap: 5px; }
  body.embed .app-shell { padding-top: 0; }
}
@media (max-width: 390px) {
  .app-shell { padding-left: 11px; padding-right: 11px; }
  .topbar-meta { letter-spacing: .08em; }
  .brand-name { font-size: 10px; }
  .scene-stage { height: 315px; }
  .scene-annotation { font-size: 7px; }
  .annotation-upstream { top: 18%; }
  .annotation-release { right: 4%; }
  .readout-card { padding: 9px 8px; }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 20px; }
  .preset-button { font-size: 6px; }
  .scene-footer { padding: 7px 10px; }
  .chain-step { font-size: 6px; }
  .chain-arrow { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
