:root {
  color-scheme: dark;
  --bg: #111514;
  --panel: #191f1d;
  --panel-2: #202724;
  --line: #343c38;
  --line-soft: #29312d;
  --text: #eef0e9;
  --muted: #a1aaa1;
  --dim: #737e76;
  --accent: #e6ad62;
  --accent-soft: rgba(230,173,98,.13);
  --shadow: 0 18px 48px rgba(0,0,0,.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--text); background: radial-gradient(ellipse at 50% -20%, #27312c 0%, var(--bg) 55%); font-size: 14px; line-height: 1.5; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { max-width: 1480px; margin: 0 auto; padding: 0 36px 40px; }
.site-header { height: 56px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(160,174,162,.14); color: var(--muted); font-size: 10px; letter-spacing: .16em; }
.header-mark { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.mark-dot, .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; box-shadow: 0 0 12px rgba(230,173,98,.5); }
.header-divider { color: #59635c; }
.header-note { letter-spacing: .04em; font-size: 11px; }
.page-content { padding-top: 28px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.intro-copy { max-width: 820px; }
.kicker { margin: 0 0 7px; color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .19em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; max-width: 850px; font-size: clamp(28px, 3.1vw, 43px); line-height: 1.08; letter-spacing: -.045em; font-weight: 650; }
.dek { margin: 12px 0 0; max-width: 760px; color: #aab3aa; font-size: 14px; line-height: 1.6; }
.intro-stamp { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 88px; height: 88px; flex: 0 0 auto; border: 1px solid #485047; border-radius: 50%; color: var(--muted); font-size: 8px; letter-spacing: .16em; transform: rotate(-9deg); }
.intro-stamp strong { color: var(--accent); font-size: 15px; line-height: 1.05; font-weight: 650; letter-spacing: .02em; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .8fr); gap: 16px; align-items: start; }
.visual-column, .control-column { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.stage-card, .readout-card, .control-card, .experiment-card, .checks-card, .science-panel { background: linear-gradient(145deg, rgba(31,39,35,.98), rgba(23,29,26,.98)); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); overflow: hidden; }
.stage-topline { height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 9px; letter-spacing: .16em; }
.stage-label { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.stage-mode { color: var(--accent); font-weight: 800; margin-left: auto; }
.quality-toggle { margin-left: 13px; padding: 4px 7px; border: 1px solid #465047; border-radius: 5px; background: transparent; color: #aeb8ae; font-size: 8px; letter-spacing: .1em; font-weight: 800; cursor: pointer; }
.quality-toggle:hover { border-color: var(--accent); color: var(--accent); }
.canvas-wrap { position: relative; height: clamp(390px, 42vw, 540px); min-height: 330px; overflow: hidden; background: radial-gradient(ellipse at 50% 45%, #303b34 0%, #202923 44%, #171e1b 100%); }
#scene { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
#scene:active { cursor: grabbing; }
.canvas-caption-left, .canvas-caption-right { position: absolute; bottom: 17px; color: #aeb7ad; font-size: 9px; letter-spacing: .14em; pointer-events: none; }
.canvas-caption-left { left: 18px; display: flex; align-items: center; gap: 8px; }
.canvas-caption-right { right: 18px; color: var(--accent); font-weight: 800; }
.tiny-rule { width: 20px; height: 1px; background: var(--accent); display: inline-block; }
.stage-foot { display: flex; align-items: center; gap: 20px; min-height: 40px; padding: 0 18px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
.stage-foot > span { display: flex; align-items: center; gap: 7px; }
.legend-line { display: inline-block; width: 14px; height: 4px; border-radius: 3px; background: #b9854d; }
.legend-layer { display: inline-block; width: 14px; height: 4px; border-radius: 3px; background: #e0bd83; }
.stage-foot-note { margin-left: auto; color: var(--dim); }
.humidity-foot { margin-left: auto; color: var(--accent); font-weight: 800; letter-spacing: .1em; font-size: 9px; }
.readout-card { padding: 17px 18px 15px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-heading .kicker { margin-bottom: 3px; }
h2 { margin: 0; font-size: 17px; line-height: 1.2; letter-spacing: -.02em; font-weight: 620; }
.units-note, .checks-note { color: var(--dim); font-size: 8px; letter-spacing: .16em; font-weight: 700; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readout { min-width: 0; padding: 11px 11px 9px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(11,16,14,.18); }
.readout-name { display: block; color: var(--muted); font-size: 10px; min-height: 29px; }
.readout strong { display: block; margin: 2px 0 2px; font-size: clamp(18px, 2vw, 24px); font-weight: 560; letter-spacing: -.04em; white-space: nowrap; }
.readout strong small { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.readout-sub { display: block; color: var(--dim); font-size: 9px; line-height: 1.35; }
.state-caption { margin: 12px 0 0; padding: 10px 12px; border-left: 2px solid var(--accent); background: rgba(230,173,98,.055); color: #c1c9bf; font-size: 11px; line-height: 1.5; }
.control-card { padding: 17px 17px 14px; }
.control-heading { margin-bottom: 16px; }
.control-icon { width: 28px; height: 28px; border: 1px solid #485047; border-radius: 50%; display: grid; place-items: center; color: var(--accent); font-size: 15px; }
.section-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; letter-spacing: .15em; font-weight: 800; margin-bottom: 9px; }
.section-label span { color: var(--dim); font-size: 8px; }
.settings-label { margin-top: 13px; margin-bottom: -3px; color: var(--accent); }
.preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.preset { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 9px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #1a211e; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.preset:hover { border-color: #657064; transform: translateY(-1px); }
.preset.active { border-color: rgba(230,173,98,.72); background: var(--accent-soft); }
.preset-icon { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; border-radius: 7px; background: #303831; color: var(--accent); font-size: 16px; }
.preset b, .preset small { display: block; white-space: nowrap; }
.preset b { font-size: 10px; font-weight: 650; }
.preset small { margin-top: 1px; color: var(--muted); font-size: 9px; }
.slider-block { padding-top: 15px; }
.slider-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.slider-row label { color: #d9dfd7; font-size: 11px; font-weight: 550; }
.slider-row output { color: var(--accent); font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 17px; margin: 7px 0 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--fill,50%), #46514a var(--fill,50%), #46514a 100%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 99px; background: #46514a; }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; margin-top: -5px; border-radius: 50%; border: 2px solid #1a211e; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #1a211e; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 5px; }
.range-ends { display: flex; justify-content: space-between; color: var(--dim); font-size: 8px; letter-spacing: .02em; }
.last-slider { padding-bottom: 2px; }
.transport-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 7px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.transport { display: flex; justify-content: center; align-items: center; gap: 7px; min-height: 36px; padding: 0 9px; border: 1px solid #48524b; border-radius: 7px; background: #202824; color: #d7ddd5; font-size: 10px; font-weight: 650; cursor: pointer; }
.transport:hover { border-color: #7a8378; }
.transport.primary { border-color: var(--accent); background: var(--accent); color: #1b1d19; }
.transport.primary:hover { background: #f0bd78; }
.sim-time { display: flex; align-items: center; gap: 9px; padding-top: 12px; color: var(--dim); font-size: 8px; letter-spacing: .13em; }
.sim-time strong { color: var(--text); font-size: 11px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.sim-time span:last-child { margin-left: auto; color: var(--accent); font-weight: 800; }
.experiment-card { padding: 16px 17px; }
.experiment-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.experiment-top .kicker { margin-bottom: 3px; }
.experiment-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; border: 1px solid rgba(230,173,98,.55); color: var(--accent); font-size: 13px; font-weight: 700; }
.experiment-card p:not(.kicker) { margin: 10px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.experiment-button { width: 100%; display: flex; justify-content: space-between; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid rgba(230,173,98,.55); border-radius: 7px; background: var(--accent-soft); color: var(--text); font-size: 10px; font-weight: 700; cursor: pointer; }
.experiment-button:hover { background: rgba(230,173,98,.2); }
.experiment-button span { color: var(--accent); font-size: 15px; }
.experiment-result { margin-top: 10px; padding: 9px 10px; min-height: 44px; border-radius: 6px; background: rgba(8,12,10,.26); color: #aeb8ae; font-size: 9px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.checks-card { margin-top: 16px; padding: 18px; }
.checks-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 13px; }
.checks-heading .kicker { margin-bottom: 3px; }
.checks-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.check-item { display: flex; align-items: center; gap: 9px; padding: 11px; min-width: 0; border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(10,15,12,.2); }
.check-mark { width: 19px; height: 19px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; }
.check-item div { min-width: 0; flex: 1; }
.check-item b, .check-item small { display: block; }
.check-item b { font-size: 10px; font-weight: 650; }
.check-item small { margin-top: 2px; color: var(--dim); font-size: 8px; line-height: 1.35; }
.check-item strong { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.checks-foot { margin: 11px 0 0; color: var(--dim); font-size: 9px; }
.science-panel { margin-top: 16px; }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; list-style: none; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.science-panel summary .kicker { margin: 0; }
.science-panel summary strong { font-size: 16px; }
.summary-plus { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid #4a554c; border-radius: 50%; color: var(--accent); font-size: 17px; transition: transform .2s; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(200px,.7fr); gap: 28px; padding: 2px 20px 22px; border-top: 1px solid var(--line-soft); }
.science-copy { padding-top: 18px; }
.science-copy h3 { margin: 16px 0 6px; color: #e8ece5; font-size: 13px; }
.science-copy h3:first-child { margin-top: 0; }
.science-copy p, .science-copy li { color: #aab4aa; font-size: 11px; line-height: 1.65; }
.science-copy ul { padding-left: 18px; }
.science-copy li { margin: 4px 0; }
.equation { margin: 9px 0; padding: 10px 13px; border-left: 2px solid var(--accent); border-radius: 0 6px 6px 0; background: rgba(230,173,98,.07); color: #f0d3a8; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.not-affiliated { padding-top: 9px; border-top: 1px solid var(--line-soft); color: var(--dim) !important; font-size: 10px !important; }
.science-aside { padding-top: 20px; }
.mini-diagram { position: relative; height: 150px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: radial-gradient(ellipse at 50% 60%, #313b34, #1a211e); }
.mini-layer { position: absolute; left: 35px; width: 130px; height: 22px; border-radius: 50% 12% 12% 50%; transform: rotate(-12deg); }
.layer-a { top: 54px; background: linear-gradient(90deg,#8e633e,#c38a51); }
.layer-b { top: 75px; left: 42px; background: linear-gradient(90deg,#d4b17d,#8e6a42); transform: rotate(-2deg); }
.mini-diagram span { position: absolute; right: 10px; color: #c3cabe; font-size: 8px; }
.mini-diagram span:nth-of-type(1) { top: 43px; }
.mini-diagram span:nth-of-type(2) { top: 91px; }
.mini-diagram i { position: absolute; top: 15px; left: 18px; color: var(--accent); font-size: 10px; font-style: normal; }
.aside-caption { margin: 10px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.constant-list { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--dim); font-size: 9px; }
.constant-list b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; padding: 20px 2px 0; color: #69736b; font-size: 8px; letter-spacing: .13em; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 1050px) {
  .app-shell { padding-left: 22px; padding-right: 22px; }
  .workspace { grid-template-columns: minmax(0,1.35fr) minmax(300px,.9fr); }
  .readout-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .readout-name { min-height: 0; }
  .canvas-wrap { height: 460px; }
}
@media (max-width: 760px) {
  .app-shell { padding: 0 14px 26px; }
  .site-header { height: 45px; }
  .header-note { display: none; }
  .page-content { padding-top: 21px; }
  .intro { margin-bottom: 18px; align-items: flex-start; }
  h1 { font-size: clamp(27px, 7vw, 36px); }
  .dek { font-size: 12px; }
  .intro-stamp { width: 60px; height: 60px; margin-top: 14px; font-size: 6px; }
  .intro-stamp strong { font-size: 12px; }
  .workspace { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .visual-column, .control-column { gap: 12px; }
  .canvas-wrap { height: clamp(340px, 105vw, 460px); min-height: 340px; }
  .stage-foot { gap: 12px; padding: 0 12px; font-size: 9px; flex-wrap: wrap; }
  .stage-foot-note { display: none !important; }
  .humidity-foot { margin-left: auto; }
  .readout-card { padding: 14px; }
  .readout-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .readout strong { font-size: 22px; }
  .control-card, .experiment-card { padding-left: 14px; padding-right: 14px; }
  .checks-card { margin-top: 12px; padding: 14px; }
  .checks-grid { grid-template-columns: 1fr; }
  .check-item { padding: 10px; }
  .science-content { grid-template-columns: 1fr; gap: 10px; padding-left: 15px; padding-right: 15px; }
  .science-aside { padding-top: 0; }
  .mini-diagram { max-width: 300px; }
  .page-footer { flex-direction: column; gap: 6px; }
}
@media (max-width: 390px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .intro-stamp { display: none; }
  .stage-topline { padding: 0 12px; }
  .quality-toggle { margin-left: 8px; padding: 4px 5px; font-size: 7px; }
  .canvas-wrap { height: 350px; }
  .canvas-caption-left { left: 12px; font-size: 8px; }
  .canvas-caption-right { right: 12px; }
  .preset { gap: 6px; padding: 8px 7px; }
  .preset b { font-size: 9px; }
  .preset small { font-size: 8px; }
  .range-ends { font-size: 7px; }
  .transport { font-size: 9px; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .site-header { display: none; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; max-width: none; padding-top: 0; padding-bottom: 0; overflow: auto; }
body.embed-mode .page-content { padding-top: 12px; }
body.embed-mode .intro { margin-bottom: 12px; }
body.embed-mode .intro-stamp { display: none; }
body.embed-mode .canvas-wrap { height: clamp(330px, 48vh, 520px); }
body.embed-mode .page-footer { padding-bottom: 14px; }
@media (max-width: 760px) {
  body.embed-mode .app-shell { padding-left: 10px; padding-right: 10px; }
  body.embed-mode .page-content { padding-top: 8px; }
  body.embed-mode .intro { margin-bottom: 9px; }
  body.embed-mode .intro .kicker { margin-bottom: 3px; }
  body.embed-mode h1 { font-size: 23px; }
  body.embed-mode .dek { margin-top: 5px; font-size: 10px; line-height: 1.35; }
  body.embed-mode .canvas-wrap { height: 42vh; min-height: 300px; max-height: 410px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
