:root {
  color-scheme: dark;
  --bg: #07131d;
  --panel: #0c1d29;
  --panel-2: #102635;
  --line: rgba(160, 203, 224, .13);
  --line-strong: rgba(160, 203, 224, .22);
  --text: #e8f4f8;
  --muted: #8ea8b7;
  --muted-2: #66808e;
  --cyan: #68d9e9;
  --cyan-2: #28a9c7;
  --blue: #3488c9;
  --ice: #c2f2f8;
  --good: #76e0be;
  --radius: 12px;
  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 { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: radial-gradient(ellipse at 48% -15%, #163448 0%, #091a26 36%, #07131d 78%); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app-shell { width: min(1680px, 100%); margin: 0 auto; padding: 0 28px 20px; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 210px; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(104,217,233,.6); border-radius: 8px; color: var(--cyan); font-weight: 800; font-size: 16px; background: linear-gradient(145deg, rgba(104,217,233,.15), rgba(40,169,199,.03)); }
.brand-word { font-size: 12px; letter-spacing: .16em; font-weight: 800; }
.brand-word span { color: #8ba8b8; font-weight: 500; }
.topbar-meta { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 9px; letter-spacing: .13em; font-weight: 700; }
.live-indicator { display: inline-flex; align-items: center; gap: 8px; color: #b6d6de; }
.live-indicator i, .chip-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px rgba(118,224,190,.8); }
.topbar-divider { height: 16px; width: 1px; background: var(--line-strong); }
.field-tag b { color: var(--cyan); font-weight: 800; margin-left: 6px; }
.topbar-right { display: flex; align-items: baseline; gap: 9px; min-width: 100px; justify-content: flex-end; font-size: 11px; }
.seed-label { color: var(--muted-2); font-size: 8px; letter-spacing: .15em; }
.topbar-right strong { color: #c8e4ec; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.main-layout { display: grid; grid-template-columns: minmax(0, 1.78fr) minmax(340px, .82fr); gap: 24px; padding-top: 24px; align-items: start; }
.exhibit-column { min-width: 0; }
.exhibit-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin: 0 0 16px; }
.eyebrow { color: #76b8c8; font-size: 9px; font-weight: 800; letter-spacing: .16em; line-height: 1.4; }
h1 { margin: 7px 0 6px; font-size: clamp(23px, 2.25vw, 34px); line-height: 1.12; letter-spacing: -.035em; font-weight: 690; }
h1 span { color: var(--cyan); }
.subtitle { margin: 0; color: #9db3bf; font-size: 12px; line-height: 1.6; max-width: 680px; }
.scene-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; color: #a8c2cc; background: rgba(12,29,41,.65); font-size: 8px; letter-spacing: .14em; font-weight: 800; white-space: nowrap; }
.scene-frame { position: relative; overflow: hidden; width: 100%; height: clamp(380px, 48vw, 590px); min-height: 380px; border: 1px solid rgba(127,191,211,.18); border-radius: 14px; background: radial-gradient(ellipse at 52% 38%, #164257 0%, #0b2939 40%, #06121e 100%); box-shadow: 0 22px 60px rgba(0,0,0,.24), inset 0 0 70px rgba(0,0,0,.22); isolation: isolate; }
.three-root { position: absolute; inset: 0; z-index: 1; }
.three-root canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; outline: none; }
.scene-vignette { pointer-events: none; position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, rgba(3,14,23,.36) 0%, transparent 20%, transparent 72%, rgba(3,13,22,.42) 100%), radial-gradient(ellipse at center, transparent 40%, rgba(1,10,17,.24) 100%); }
.scene-hud { position: absolute; z-index: 4; left: 18px; right: 18px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.scene-hud-top { top: 17px; }
.scene-hud-bottom { bottom: 16px; justify-content: flex-start; gap: 18px; flex-wrap: wrap; }
.hud-label, .hud-right, .legend-item, .drag-hint { color: rgba(202,229,237,.76); font-size: 8px; font-weight: 800; letter-spacing: .13em; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.hud-label { display: flex; align-items: center; gap: 8px; }
.hud-square { width: 7px; height: 7px; border: 1px solid var(--cyan); background: rgba(104,217,233,.24); transform: rotate(45deg); }
.hud-right { display: flex; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; }
.scale-mark { color: #83aab8; }
.hud-separator { height: 12px; width: 1px; background: rgba(178,220,232,.28); }
#sceneClock { color: #d8f5f8; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 7px; }
.legend-swatch { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.swatch-ice { background: #bceef4; box-shadow: 0 0 8px rgba(188,238,244,.7); }
.swatch-brine { background: #1fa9e1; box-shadow: 0 0 8px rgba(31,169,225,.7); }
.swatch-crystal { background: #f0ffff; box-shadow: 0 0 8px rgba(240,255,255,.8); }
.drag-hint { margin-left: auto; color: rgba(170,201,211,.55); font-weight: 600; }
.mouse-icon { font-size: 14px; margin-right: 5px; color: var(--cyan); }
.scene-annotations { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.annotation { position: absolute; display: flex; align-items: center; gap: 7px; color: rgba(203,239,244,.72); font-size: 7px; font-weight: 800; letter-spacing: .14em; text-shadow: 0 1px 5px #00111c; transition: opacity .2s ease; }
.annotation-line { display: block; width: 25px; height: 1px; background: rgba(104,217,233,.65); box-shadow: 0 0 6px rgba(104,217,233,.4); }
.annotation-ice { left: 10%; top: 27%; }
.annotation-brine { right: 8%; top: 48%; flex-direction: row-reverse; }
.annotation-tip { left: 11%; bottom: 25%; }
.webgl-fallback { position: absolute; z-index: 8; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px; text-align: center; background: rgba(4,16,25,.92); color: var(--text); }
.webgl-fallback[hidden] { display: none; }
.webgl-fallback strong { font-size: 16px; }
.webgl-fallback span { max-width: 340px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.readout-heading { display: flex; justify-content: space-between; align-items: center; margin: 19px 2px 9px; }
.data-class { color: #668a9a; font-size: 8px; letter-spacing: .14em; font-weight: 800; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.readout-card { min-width: 0; padding: 13px 14px 12px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, rgba(15,37,51,.92), rgba(9,25,37,.92)); }
.readout-label { color: #819eac; font-size: 8px; letter-spacing: .11em; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-value { margin: 8px 0 5px; color: #e6f9fb; font-size: clamp(19px, 2vw, 25px); line-height: 1; letter-spacing: -.04em; font-weight: 650; font-variant-numeric: tabular-nums; }
.readout-value small { margin-left: 5px; color: #82adbb; font-size: 10px; letter-spacing: 0; font-weight: 600; }
.readout-foot { color: #5f8190; font-size: 7px; letter-spacing: .12em; font-weight: 700; }
.validation-panel { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border: 1px solid rgba(118,224,190,.16); border-radius: 10px; background: linear-gradient(100deg, rgba(15,45,48,.48), rgba(10,28,39,.75)); }
.validation-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(118,224,190,.25); border-radius: 8px; color: var(--good); font-size: 18px; }
.validation-copy { min-width: 0; flex: 1; }
.validation-topline { display: flex; gap: 9px; align-items: center; color: #7e9d9d; font-size: 7px; letter-spacing: .13em; font-weight: 800; }
.validation-topline b { color: #8de4c4; font-size: 7px; }
.validation-title { margin-top: 4px; color: #d8eeee; font-size: 11px; font-weight: 650; }
.validation-values { margin-top: 4px; color: #8caeb5; font-size: 9px; font-variant-numeric: tabular-nums; }
.validation-values span { padding: 0 5px; color: #4d7880; }
.validation-status { display: flex; align-items: center; gap: 6px; color: #8de4c4; font-size: 8px; letter-spacing: .1em; font-weight: 800; }
.check-mark { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: rgba(118,224,190,.12); font-size: 11px; }
.control-column { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, rgba(13,31,44,.97), rgba(9,23,34,.97)); box-shadow: 0 18px 55px rgba(0,0,0,.15); overflow: hidden; }
.panel-header { display: flex; justify-content: space-between; align-items: center; padding: 19px 20px 17px; border-bottom: 1px solid var(--line); }
h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.025em; font-weight: 660; }
.panel-index { color: #d2eaf0; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.panel-index span { color: #597786; font-weight: 500; }
.preset-section, .parameter-section, .playback-section { padding: 17px 20px; border-bottom: 1px solid var(--line); }
.section-label { display: flex; align-items: center; justify-content: space-between; color: #9bb5c1; font-size: 8px; letter-spacing: .14em; font-weight: 800; margin-bottom: 12px; }
.section-note { color: #587989; font-size: 7px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 9px 7px; border: 1px solid rgba(142,184,202,.13); border-radius: 8px; background: rgba(17,43,59,.58); cursor: pointer; text-align: left; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.preset-button:hover { border-color: rgba(104,217,233,.45); background: rgba(20,56,73,.7); }
.preset-button.active { border-color: rgba(104,217,233,.55); background: linear-gradient(145deg, rgba(37,103,122,.35), rgba(17,49,66,.75)); box-shadow: inset 0 0 0 1px rgba(104,217,233,.08); }
.preset-icon { display: grid; place-items: center; width: 23px; height: 23px; flex: 0 0 auto; border-radius: 6px; color: var(--cyan); background: rgba(104,217,233,.09); font-size: 14px; }
.preset-button b { display: block; color: #d7eaf0; font-size: 9px; line-height: 1.25; font-weight: 700; }
.preset-button small { display: block; margin-top: 3px; color: #7593a2; font-size: 7px; line-height: 1.25; }
.parameter-section { padding-top: 16px; padding-bottom: 14px; }
.slider-control { margin-bottom: 13px; }
.slider-control:last-child { margin-bottom: 0; }
.slider-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 7px; }
.slider-head label { color: #c5d8df; font-size: 10px; font-weight: 560; }
.slider-head output { color: #7bd7e4; font-size: 9px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 14px; margin: 0; display: block; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, #237c96, #23566f); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, #237c96, #23566f); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #c7f6f7; border-radius: 50%; background: #39afc4; box-shadow: 0 0 0 3px rgba(57,175,196,.13), 0 0 10px rgba(57,175,196,.35); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #c7f6f7; border-radius: 50%; background: #39afc4; box-shadow: 0 0 0 3px rgba(57,175,196,.13); }
.range-ends { display: flex; justify-content: space-between; color: #5f7d8c; font-size: 7px; letter-spacing: .05em; margin-top: 3px; }
.playback-section { padding-top: 16px; }
.transport-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 7px; }
.transport-button { min-height: 36px; display: flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid rgba(142,184,202,.16); border-radius: 7px; background: rgba(19,45,61,.7); color: #b7d0d9; font-size: 8px; letter-spacing: .1em; font-weight: 800; cursor: pointer; transition: .2s ease; }
.transport-button:hover { border-color: rgba(104,217,233,.5); background: rgba(27,67,84,.8); }
.transport-button.primary { border-color: rgba(104,217,233,.45); background: linear-gradient(120deg, #1c8da4, #17617d); color: #f0fdff; box-shadow: 0 5px 18px rgba(23,120,145,.18); }
.transport-button.primary:hover { filter: brightness(1.12); }
.transport-button span { font-size: 12px; }
.speed-row { display: grid; grid-template-columns: 55px 1fr 35px; align-items: center; gap: 10px; margin-top: 15px; }
.speed-row label { color: #7998a6; font-size: 7px; letter-spacing: .13em; font-weight: 800; }
.speed-row output { text-align: right; color: #9fe2e9; font-size: 9px; font-weight: 700; }
.utility-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 13px; }
.utility-button { min-height: 30px; display: flex; justify-content: center; align-items: center; gap: 6px; padding: 0 7px; border: 1px solid rgba(142,184,202,.12); border-radius: 6px; background: rgba(12,32,45,.7); color: #91adba; font-size: 7px; letter-spacing: .08em; font-weight: 750; cursor: pointer; transition: .2s ease; }
.utility-button:hover { color: #c9eef3; border-color: rgba(104,217,233,.36); }
.utility-button span { color: var(--cyan); font-size: 11px; }
.utility-button:last-child { grid-column: 1 / -1; }
.science-panel { border-bottom: 1px solid var(--line); }
.science-panel summary { display: flex; align-items: center; gap: 10px; padding: 15px 20px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-symbol { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(104,217,233,.3); border-radius: 50%; color: var(--cyan); font-family: Georgia, serif; font-style: italic; }
.science-panel summary b { display: block; color: #d5e7ec; font-size: 10px; }
.science-panel summary small { display: block; margin-top: 3px; color: #6d8b9a; font-size: 8px; }
.chevron { margin-left: auto; color: #7ba5b1; font-size: 17px; transition: transform .2s ease; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 20px 18px 52px; }
.science-block { padding: 11px 0; border-top: 1px solid rgba(142,184,202,.1); }
.science-block > b { display: block; color: #9ddbe3; font-size: 9px; margin-bottom: 7px; }
.science-block code { display: block; width: fit-content; max-width: 100%; margin: 4px 0; padding: 4px 7px; border-radius: 4px; color: #d6f5f5; background: rgba(47,117,133,.16); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; overflow-wrap: anywhere; }
.science-block p { margin: 6px 0 0; color: #8ba5b1; font-size: 9px; line-height: 1.55; }
.science-block.limitation > b { color: #e4bd86; }
.footer { display: flex; justify-content: space-between; gap: 18px; padding: 16px 2px 0; color: #5c7785; font-size: 7px; letter-spacing: .09em; }
.footer span:last-child { letter-spacing: 0; text-align: right; }
body.embed .app-shell { padding: 0; }
body.embed .topbar, body.embed .footer, body.embed .exhibit-heading { display: none; }
body.embed .main-layout { padding: 0; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; }
body.embed .scene-frame { border-radius: 0; border: 0; height: 100vh; min-height: 400px; }
body.embed .readout-grid, body.embed .readout-heading, body.embed .validation-panel { display: none; }
@media (max-width: 1080px) {
  .app-shell { padding-left: 18px; padding-right: 18px; }
  .main-layout { grid-template-columns: minmax(0, 1.45fr) minmax(320px, .9fr); gap: 16px; }
  .preset-section, .parameter-section, .playback-section, .panel-header { padding-left: 15px; padding-right: 15px; }
  .science-panel summary { padding-left: 15px; padding-right: 15px; }
  .science-content { padding-left: 45px; padding-right: 15px; }
  .readout-card { padding-left: 10px; padding-right: 10px; }
  .readout-label { font-size: 7px; }
  .preset-button { gap: 5px; padding-left: 5px; padding-right: 5px; }
  .preset-button b { font-size: 8px; }
}
@media (max-width: 820px) {
  body.embed .main-layout { display: flex; flex-direction: column; }
  body.embed .scene-frame { height: 58vh; min-height: 360px; }
  .app-shell { padding: 0 14px 16px; }
  .topbar { height: 56px; }
  .main-layout { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; }
  .exhibit-column, .control-column { width: 100%; }
  .scene-frame { height: min(62vw, 500px); min-height: 360px; }
  .control-column { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .panel-header { grid-column: 1 / -1; }
  .preset-section { grid-column: 1 / -1; }
  .parameter-section { grid-column: 1 / -1; }
  .playback-section { grid-column: 1 / -1; }
  .science-panel { grid-column: 1 / -1; }
  .preset-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .preset-button { padding: 10px; }
  .preset-button b { font-size: 9px; }
  .slider-control { margin-bottom: 14px; }
  .slider-head label { font-size: 11px; }
  .slider-head output { font-size: 10px; }
}
@media (max-width: 520px) {
  .app-shell { padding: 0 10px 12px; }
  .topbar { height: 52px; gap: 8px; }
  .brand { min-width: 0; gap: 7px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-word { font-size: 10px; letter-spacing: .13em; }
  .topbar-meta { gap: 8px; font-size: 7px; }
  .topbar-divider { height: 12px; }
  .topbar-right { min-width: 60px; gap: 5px; font-size: 9px; }
  .seed-label { font-size: 7px; }
  .main-layout { padding-top: 14px; gap: 12px; }
  .exhibit-heading { margin-bottom: 12px; }
  h1 { font-size: 24px; }
  .subtitle { font-size: 10px; max-width: 300px; }
  .scene-chip { display: none; }
  .scene-frame { height: 54vh; min-height: 360px; max-height: 470px; border-radius: 10px; }
  .scene-hud { left: 11px; right: 11px; }
  .scene-hud-top { top: 12px; }
  .scene-hud-bottom { bottom: 11px; gap: 10px; }
  .hud-label, .hud-right { font-size: 7px; }
  .legend-item { font-size: 6px; gap: 5px; }
  .drag-hint { display: none; }
  .annotation { font-size: 6px; }
  .annotation-ice { left: 4%; top: 24%; }
  .annotation-brine { right: 3%; top: 48%; }
  .annotation-tip { left: 5%; bottom: 24%; }
  .annotation-line { width: 15px; }
  .readout-heading { margin-top: 13px; }
  .readout-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
  .readout-card { padding: 11px 12px; }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 22px; margin: 7px 0 4px; }
  .readout-foot { font-size: 6px; }
  .validation-panel { gap: 8px; padding: 10px; }
  .validation-icon { width: 25px; height: 25px; }
  .validation-title { font-size: 10px; }
  .validation-values { font-size: 8px; line-height: 1.45; }
  .validation-status { font-size: 7px; }
  .control-column { display: block; border-radius: 10px; }
  .panel-header { padding: 15px 14px; }
  h2 { font-size: 16px; }
  .preset-section, .parameter-section, .playback-section { padding: 14px; }
  .preset-button { padding: 8px 6px; gap: 5px; }
  .preset-icon { width: 20px; height: 20px; font-size: 12px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 6px; }
  .slider-control { margin-bottom: 13px; }
  .slider-head label { font-size: 10px; }
  .slider-head output { font-size: 9px; }
  .transport-row { gap: 6px; }
  .transport-button { min-height: 35px; font-size: 7px; }
  .utility-button { font-size: 7px; }
  .science-panel summary { padding: 13px 14px; }
  .science-content { padding: 0 14px 14px 46px; }
  .footer { display: block; font-size: 6px; line-height: 1.6; padding-top: 12px; }
  .footer span { display: block; }
  .footer span:last-child { text-align: left; margin-top: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
