:root {
  color-scheme: dark;
  --bg: #090c11;
  --panel: #111720;
  --panel-2: #151d27;
  --line: rgba(197, 212, 229, .105);
  --line-strong: rgba(197, 212, 229, .17);
  --text: #f1f2ef;
  --muted: #8b96a2;
  --faint: #65717d;
  --amber: #e8ae69;
  --amber-bright: #f4c58a;
  --blue: #83b3cf;
  --radius: 13px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 49% -15%, rgba(55, 73, 91, .19), transparent 42%), var(--bg); color: var(--text); font-size: 13px; letter-spacing: .01em; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.app-shell { max-width: 1600px; margin: 0 auto; padding: 0 36px 24px; }
.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 11px; align-items: center; color: var(--text); text-decoration: none; }
.brand-mark { width: 27px; height: 27px; border: 1px solid rgba(232,174,105,.55); border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(-23deg); }
.brand-mark i { display: block; width: 2px; border-radius: 3px; background: var(--amber); }
.brand-mark i:nth-child(1) { height: 8px; opacity: .6; }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 9px; opacity: .75; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 11px; letter-spacing: .19em; font-weight: 750; }
.brand-copy small { font-size: 8px; letter-spacing: .16em; color: var(--muted); }
.brand-copy small b { color: var(--amber); padding: 0 3px; }
.topbar-right { display: flex; gap: 20px; align-items: center; color: var(--muted); font-size: 9px; letter-spacing: .13em; }
.system-status { display: flex; align-items: center; gap: 8px; }
.status-dot, .live-dot { width: 6px; height: 6px; border-radius: 50%; background: #81bd9a; box-shadow: 0 0 11px rgba(129,189,154,.6); display: inline-block; }
.version-tag { padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; color: #aeb7c1; }
.hero { padding: 25px 0 22px; }
.eyebrow { color: var(--amber); font-size: 9px; font-weight: 700; letter-spacing: .2em; display: flex; align-items: center; gap: 9px; }
.eyebrow-line { width: 19px; height: 1px; background: var(--amber); }
.eyebrow-index { color: var(--faint); margin-left: 5px; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
h1 { margin: 10px 0 6px; font-size: clamp(28px, 3.15vw, 43px); line-height: 1.04; font-weight: 580; letter-spacing: -.055em; }
h1 em { color: var(--amber-bright); font-style: normal; font-weight: 470; }
.hero-subtitle { max-width: 670px; color: #a4adb6; margin: 0; line-height: 1.55; font-size: 12px; }
.hero-meta { display: flex; flex-direction: column; gap: 4px; text-align: right; padding-bottom: 3px; min-width: 205px; }
.meta-label, .meta-note { font-size: 8px; letter-spacing: .15em; color: var(--faint); }
.hero-meta strong { font-size: 11px; font-weight: 600; color: #d9dce0; }
.meta-note { color: #8c785f; font-size: 7px; margin-top: 3px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 334px; gap: 14px; align-items: stretch; }
.stage-card, .control-card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(21,29,39,.98), rgba(13,18,25,.98)); overflow: hidden; min-width: 0; }
.stage-card { display: flex; flex-direction: column; min-height: 0; }
.stage-topline { height: 43px; flex: 0 0 43px; display: flex; justify-content: space-between; align-items: center; padding: 0 14px 0 17px; border-bottom: 1px solid var(--line); }
.stage-label { display: flex; align-items: center; gap: 8px; font-size: 8px; letter-spacing: .13em; color: #bdc6cf; }
.stage-label b { color: #65717d; font-weight: 400; }
.live-dot { width: 5px; height: 5px; }
.stage-tools { display: flex; align-items: center; gap: 13px; }
.axis-hint { color: #73808d; font-size: 8px; letter-spacing: .11em; }
.axis-hint b { color: var(--amber); }
.icon-button { width: 27px; height: 27px; border-radius: 6px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); display: grid; place-items: center; cursor: pointer; transition: border-color .18s, background .18s; }
.icon-button:hover { border-color: rgba(232,174,105,.5); background: rgba(232,174,105,.08); }
.icon-button svg, .screenshot-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.scene-viewport { position: relative; min-height: 350px; height: clamp(380px, 43vw, 540px); overflow: hidden; background: radial-gradient(ellipse at 50% 60%, #3a2b20 0%, #1a2027 60%, #111720 100%); }
.scene-mount { position: absolute; inset: 0; }
.scene-mount canvas { display: block; width: 100%; height: 100%; outline: none; }
.scene-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(7,10,15,.22), transparent 20%, transparent 65%, rgba(7,10,15,.4)); }
.scene-callout { position: absolute; z-index: 2; pointer-events: none; display: flex; flex-direction: column; gap: 4px; color: #f1dfc7; text-shadow: 0 2px 8px rgba(0,0,0,.9); }
.scene-callout strong { font-size: 8px; letter-spacing: .15em; font-weight: 700; }
.callout-kicker { font-size: 7px; letter-spacing: .15em; color: #d7a76f; }
.scene-callout i { display: block; width: 36px; height: 1px; background: rgba(231,188,135,.8); position: relative; margin-top: 2px; }
.scene-callout i::after { content: ""; position: absolute; right: -2px; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: #f1c58c; }
.callout-one { left: 7%; top: 57%; }
.callout-two { left: 54%; top: 29%; }
.callout-three { right: 6%; top: 55%; text-align: right; align-items: flex-end; }
.scene-hud { position: absolute; left: 15px; bottom: 13px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: rgba(8,12,17,.66); border: 1px solid rgba(255,255,255,.1); border-radius: 5px; backdrop-filter: blur(8px); }
.hud-label { color: #87919c; font-size: 7px; letter-spacing: .12em; }
.scene-hud strong { font-size: 9px; letter-spacing: .07em; color: #e9d6be; font-variant-numeric: tabular-nums; }
.scene-hud .quiet-state { color: #93a0aa; }
.hud-divider { height: 13px; width: 1px; background: rgba(255,255,255,.18); margin: 0 2px; }
.scene-legend { position: absolute; right: 15px; bottom: 17px; display: flex; gap: 12px; color: rgba(223,228,232,.68); font-size: 7px; letter-spacing: .1em; }
.scene-legend span { display: flex; align-items: center; gap: 5px; }
.scene-legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.legend-sand { background: #e6b46f; }
.legend-wave { background: #82b6d5; }
.legend-bed { background: #a47a51; }
.readout-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border-top: 1px solid var(--line); min-height: 88px; background: rgba(8,12,17,.38); }
.readout { padding: 13px 15px 11px; border-right: 1px solid var(--line); min-width: 0; }
.readout:last-child { border-right: 0; }
.readout-label { color: #98a3ae; font-size: 7px; letter-spacing: .14em; display: flex; justify-content: space-between; gap: 3px; white-space: nowrap; }
.readout-label b { font-size: 6px; font-weight: 600; color: #b28b60; letter-spacing: .08em; }
.readout strong { display: block; font-size: clamp(17px, 1.7vw, 22px); font-weight: 550; letter-spacing: -.045em; color: #f2e7d8; margin: 7px 0 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout strong small { font-size: 9px; letter-spacing: 0; color: #a8b1ba; font-weight: 500; }
.readout-foot { color: #65717d; font-size: 6px; letter-spacing: .1em; white-space: nowrap; }
.control-card { padding: 17px 17px 13px; display: flex; flex-direction: column; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.panel-kicker { color: var(--amber); font-size: 8px; letter-spacing: .17em; font-weight: 700; }
.panel-heading h2, .science-topline h2 { margin: 5px 0 0; font-size: 17px; font-weight: 550; letter-spacing: -.035em; }
.control-count { color: #a2acb7; font-size: 10px; font-variant-numeric: tabular-nums; margin-top: 8px; }
.control-count i { color: #5c6873; font-style: normal; }
.preset-block { padding: 13px 0 12px; border-bottom: 1px solid var(--line); }
.section-caption { display: flex; justify-content: space-between; color: #a1acb6; font-size: 8px; letter-spacing: .14em; margin-bottom: 9px; }
.section-caption span { color: #6e7a86; font-size: 7px; }
.preset-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
.preset-button { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.018); color: #9ca6b0; font-size: 7px; letter-spacing: .1em; cursor: pointer; transition: .18s; }
.preset-button:hover { border-color: rgba(232,174,105,.35); color: #e7d8c6; }
.preset-button.active { background: rgba(232,174,105,.09); border-color: rgba(232,174,105,.42); color: #f0c48d; }
.preset-dot { width: 5px; height: 5px; border-radius: 50%; background: #d7a36a; }
.preset-dot.blue { background: #7ea9c5; }
.preset-dot.grey { background: #83909a; }
.sliders { display: flex; flex-direction: column; gap: 12px; padding: 14px 0 14px; border-bottom: 1px solid var(--line); }
.slider-row { min-width: 0; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.slider-head label { color: #c8cfd5; font-size: 9px; }
.slider-head output { color: var(--amber-bright); font-size: 9px; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 14px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, #b77f48, #e5bd87 65%, #3a4550 65%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: #39434e; }
input[type="range"]::-moz-range-progress { height: 3px; background: #c28e58; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 10px; height: 10px; margin-top: -3.5px; border: 2px solid #f0c48d; background: #191f27; border-radius: 50%; box-shadow: 0 0 0 3px rgba(232,174,105,.11); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid #f0c48d; background: #191f27; border-radius: 50%; box-shadow: 0 0 0 3px rgba(232,174,105,.11); }
.range-scale { display: flex; justify-content: space-between; color: #5f6b77; font-size: 6px; letter-spacing: .1em; margin-top: -1px; }
.transport-block { padding: 13px 0 12px; border-bottom: 1px solid var(--line); }
.transport-controls { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 6px; }
.play-button, .transport-button { height: 32px; border-radius: 5px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: #c7cfd6; display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 8px; letter-spacing: .1em; cursor: pointer; transition: .18s; }
.play-button { background: linear-gradient(135deg, #c78e54, #a76e3d); border-color: #c18a55; color: #17130f; font-weight: 750; }
.play-button:hover { filter: brightness(1.1); }
.play-button.paused { background: rgba(232,174,105,.12); color: #edc48f; border-color: rgba(232,174,105,.42); }
.play-icon { font-size: 12px; line-height: 1; }
.transport-button:hover { border-color: rgba(232,174,105,.4); color: #eec895; }
.transport-button span { font-size: 12px; color: var(--amber); }
.speed-row, .quality-row { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; }
.speed-row label, .quality-row > span { color: #84909b; font-size: 7px; letter-spacing: .12em; }
.speed-row select { color: #e0e3e5; background: #1a232d; border: 1px solid var(--line-strong); border-radius: 4px; padding: 5px 8px; font-size: 8px; min-width: 72px; }
.quality-toggle { display: flex; gap: 3px; padding: 2px; background: rgba(0,0,0,.22); border-radius: 5px; border: 1px solid var(--line); }
.quality-toggle button { border: 0; background: transparent; color: #788591; font-size: 7px; padding: 5px 9px; border-radius: 3px; cursor: pointer; letter-spacing: .08em; }
.quality-toggle button.selected { background: #303a45; color: #e8c99e; }
.panel-footer { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.science-link { border: 0; background: transparent; color: #a8b2bc; display: flex; align-items: center; gap: 7px; font-size: 7px; letter-spacing: .13em; padding: 3px 0; cursor: pointer; text-align: left; }
.science-link span { width: 13px; height: 13px; border: 1px solid #a17b54; border-radius: 50%; display: grid; place-items: center; color: #d8ad7a; font-family: Georgia, serif; font-size: 9px; letter-spacing: 0; }
.science-link b { margin-left: auto; color: var(--amber); font-size: 12px; }
.science-link:hover { color: #f0d5b1; }
.screenshot-button { width: 100%; height: 32px; border: 1px solid rgba(232,174,105,.35); border-radius: 5px; background: rgba(232,174,105,.065); color: #e8bf8e; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 8px; letter-spacing: .14em; cursor: pointer; transition: .18s; }
.screenshot-button:hover { background: rgba(232,174,105,.14); border-color: rgba(232,174,105,.65); }
.science-section { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(17,23,32,.98), rgba(12,17,24,.98)); padding: 18px 20px 13px; scroll-margin-top: 16px; }
.science-topline { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.science-topline h2 { font-size: 18px; }
.science-badge { font-size: 7px; letter-spacing: .12em; color: #a98c6a; border: 1px solid rgba(232,174,105,.2); padding: 6px 8px; border-radius: 4px; }
.science-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 18px; padding: 12px 0 9px; }
.science-details { min-width: 0; }
.science-details summary { list-style: none; cursor: pointer; color: #d7dce0; font-size: 9px; font-weight: 600; display: flex; align-items: center; gap: 8px; padding: 3px 0 9px; border-bottom: 1px solid var(--line); }
.science-details summary::-webkit-details-marker { display: none; }
.science-details summary > span { color: var(--amber); font-size: 8px; font-variant-numeric: tabular-nums; }
.science-details summary i { margin-left: auto; font-style: normal; color: #8d9aa6; font-size: 12px; }
.science-details[open] summary i { transform: rotate(45deg); }
.science-content { padding-top: 9px; color: #96a1ac; font-size: 9px; line-height: 1.6; }
.science-content p { margin: 0 0 9px; }
.equation { display: flex; align-items: center; gap: 9px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.045); }
.equation span { color: #bd9a72; font-size: 6px; letter-spacing: .12em; width: 86px; flex: 0 0 86px; }
.equation code { color: #e6d6c3; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.variable-note { font-size: 8px; color: #788590; margin-top: 9px !important; }
.variable-note b { color: #c9a579; }
.validation-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin: 10px 0 8px; }
.validation-grid > div { padding: 8px 7px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.02); min-width: 0; }
.validation-grid small { display: block; color: #8d9aa6; font-size: 6px; letter-spacing: .1em; white-space: nowrap; }
.validation-grid strong { display: block; color: #e6d0b4; font-size: 12px; font-weight: 600; margin: 6px 0 3px; font-variant-numeric: tabular-nums; }
.validation-grid span { display: block; color: #697682; font-size: 6px; line-height: 1.3; }
.validation-grid #validationStatus.validation-pass { color: #8ec5a1; }
.validation-note { color: #74818d; font-size: 8px; }
.science-content ul { margin: 0; padding-left: 15px; }
.science-content li { padding: 0 0 6px 1px; }
.disclaimer { margin: 8px 0 0; padding-top: 9px; border-top: 1px solid var(--line); color: #687580; font-size: 8px; letter-spacing: .025em; }
.footer { display: flex; justify-content: space-between; gap: 12px; padding: 15px 2px 0; color: #596571; font-size: 7px; letter-spacing: .14em; }
.footer b { color: #a27b53; padding: 0 4px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 18px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; padding: 9px 14px; border: 1px solid rgba(232,174,105,.3); border-radius: 6px; background: rgba(14,19,26,.94); color: #ead1b0; font-size: 10px; letter-spacing: .03em; box-shadow: 0 8px 30px rgba(0,0,0,.35); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.webgl-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #e7c59b; text-align: center; padding: 20px; }
.webgl-error span { color: #9ba7b2; font-size: 11px; }
.embed-mode .topbar, .embed-mode .hero, .embed-mode .science-section, .embed-mode .footer { display: none; }
.embed-mode .app-shell { padding: 10px; }
.embed-mode .workspace { min-height: calc(100vh - 20px); grid-template-columns: minmax(0,1fr) 320px; }
.embed-mode .scene-viewport { height: calc(100vh - 155px); }
@media (min-width: 1500px) { .app-shell { padding-left: 48px; padding-right: 48px; } .workspace { grid-template-columns: minmax(0,1fr) 360px; } }
@media (max-width: 1080px) {
  .app-shell { padding-left: 22px; padding-right: 22px; }
  .workspace { grid-template-columns: minmax(0,1fr) 306px; gap: 10px; }
  .control-card { padding-left: 13px; padding-right: 13px; }
  .scene-viewport { height: clamp(350px, 43vw, 475px); }
  .readout { padding-left: 10px; padding-right: 10px; }
  .readout-label { letter-spacing: .08em; }
  .science-grid { gap: 12px; }
}
@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; }
  .scene-viewport { height: min(58vw, 510px); min-height: 360px; }
  .control-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; align-items: start; }
  .panel-heading { grid-column: 1 / -1; }
  .preset-block { grid-column: 1 / -1; }
  .sliders { grid-column: 1; grid-row: span 2; }
  .transport-block { grid-column: 2; }
  .panel-footer { grid-column: 2; margin-top: 0; }
  .science-grid { grid-template-columns: 1fr 1fr; }
  .science-details:last-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .app-shell { padding: 0 12px 18px; }
  .topbar { height: 56px; }
  .brand-copy small { font-size: 7px; }
  .topbar-right { gap: 8px; font-size: 7px; }
  .system-status { gap: 5px; }
  .version-tag { padding: 6px; }
  .hero { padding: 19px 0 16px; }
  .hero-row { display: block; }
  h1 { font-size: 34px; margin-top: 9px; }
  .hero-subtitle { font-size: 11px; max-width: 100%; }
  .hero-meta { display: none; }
  .stage-topline { padding: 0 10px; }
  .stage-label { gap: 5px; font-size: 7px; letter-spacing: .08em; }
  .axis-hint { display: none; }
  .scene-viewport { min-height: 330px; height: 94vw; max-height: 430px; }
  .callout-one { left: 4%; top: 55%; }
  .callout-two { left: 45%; top: 22%; }
  .callout-three { right: 3%; top: 53%; }
  .scene-callout strong { font-size: 6px; }
  .callout-kicker { font-size: 6px; }
  .scene-hud { left: 8px; bottom: 8px; gap: 6px; padding: 7px; }
  .hud-label { font-size: 6px; }
  .scene-hud strong { font-size: 7px; }
  .scene-legend { right: 8px; bottom: 11px; gap: 7px; font-size: 5px; }
  .scene-legend span { gap: 3px; }
  .scene-legend i { width: 5px; height: 5px; }
  .readout-strip { grid-template-columns: repeat(2,1fr); }
  .readout { min-height: 76px; padding: 10px 11px; border-bottom: 1px solid var(--line); }
  .readout:nth-child(2) { border-right: 0; }
  .readout:nth-child(3), .readout:nth-child(4) { border-bottom: 0; }
  .readout-label { font-size: 6px; }
  .readout-label b { font-size: 5px; }
  .readout strong { font-size: 20px; margin: 5px 0 3px; }
  .readout-foot { font-size: 5px; }
  .control-card { display: flex; padding: 14px 13px 12px; }
  .panel-heading h2 { font-size: 16px; }
  .sliders { gap: 13px; }
  .slider-head label { font-size: 10px; }
  .slider-head output { font-size: 10px; }
  .range-scale { font-size: 6px; }
  .transport-controls { grid-template-columns: 1.2fr 1fr 1fr; }
  .science-section { padding: 15px 13px 12px; }
  .science-topline { align-items: flex-start; flex-direction: column; gap: 9px; }
  .science-topline h2 { font-size: 16px; }
  .science-grid { grid-template-columns: 1fr; gap: 12px; }
  .science-details:last-child { grid-column: auto; }
  .validation-grid { gap: 4px; }
  .validation-grid > div { padding: 7px 5px; }
  .validation-grid strong { font-size: 10px; }
  .validation-grid small { font-size: 5px; }
  .footer { flex-wrap: wrap; font-size: 6px; gap: 7px; }
  .footer span:last-child { display: none; }
  .embed-mode .workspace { display: flex; flex-direction: column; }
  .embed-mode .scene-viewport { height: 58vh; min-height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
