:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --bg:#100d1d; --surface:#1a152b; --line:#ffffff22; --text:#f8f3ff; --muted:#beb3cd; --pink:#f1bce6; --mint:#9ce1d4; --gold:#f5d597; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--text); background: radial-gradient(circle at 66% 9%, #49315b80, transparent 31%), radial-gradient(circle at 3% 79%, #244c6070, transparent 39%), var(--bg); }
button, select, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; z-index: 99; top: -80px; left: 15px; padding: .7rem 1rem; color: #101020; background: white; border-radius: 8px; }
.skip:focus { top: 15px; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.math-app { min-height: 100dvh; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; min-height: 80px; padding: .8rem clamp(16px, 3vw, 45px); border-bottom: 1px solid #f5e7ff19; background: #100d1bcc; backdrop-filter: blur(22px); }
.brand { display: inline-flex; align-items: center; gap: .72rem; min-width: 178px; text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid #e8c1f16e; border-radius: 14px; color: #2c163f; background: linear-gradient(135deg, #f8d8e9, #aacff3); font: 700 1.35rem Georgia, serif; box-shadow: 0 7px 25px #efacec38; }
.brand strong { display: block; font: 700 1.15rem Georgia, serif; letter-spacing: -.035em; }
.brand small { display: block; margin-top: .13rem; color: #bfb2c9; font-size: .57rem; font-weight: 700; letter-spacing: .05em; }
.app-header__center { color: #c6b7d1; font-size: .65rem; font-weight: 800; letter-spacing: .2em; text-align: center; }
.app-header__center span { color: #f1bce6; }
.app-header__actions { display: flex; align-items: center; gap: .55rem; }
.icon-button, .presentation-link { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 38px; padding: .5rem .78rem; border: 1px solid #c6aed252; border-radius: 11px; color: #e9dce9; background: #ffffff0c; font-size: .75rem; font-weight: 750; text-decoration: none; white-space: nowrap; transition: background .2s, border-color .2s, transform .2s; }
.icon-button:hover, .presentation-link:hover { color: white; border-color: #e1bfef8f; background: #ffffff1c; transform: translateY(-1px); }
.icon-button[aria-pressed="true"] { color: #211532; border-color: var(--pink); background: var(--pink); }
.app-layout { display: grid; grid-template-columns: minmax(264px, 318px) minmax(0, 1fr); gap: clamp(14px, 1.6vw, 26px); max-width: 1810px; min-height: calc(100dvh - 80px); margin: 0 auto; padding: clamp(14px, 1.65vw, 25px); }
.app-sidebar { display: flex; flex-direction: column; gap: 18px; align-self: start; padding: clamp(16px, 1.4vw, 23px); border: 1px solid #eacdfa24; border-radius: 25px; background: linear-gradient(160deg, #241a35ee, #161326f5); box-shadow: 0 24px 55px #08061861; }
.eyebrow { color: var(--pink); font-size: .62rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.sidebar-intro h2 { margin: .65rem 0 .42rem; font: 700 1.47rem/1.13 Georgia, serif; letter-spacing: -.04em; }
.sidebar-intro p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.lab-nav { display: grid; gap: 7px; }
.lab-nav__button { display: grid; grid-template-columns: 19px 30px 1fr; align-items: center; gap: 9px; width: 100%; min-height: 55px; padding: .55rem .65rem; border: 1px solid transparent; border-radius: 14px; color: #cbbdd7; background: transparent; text-align: left; transition: background .2s, border-color .2s, transform .2s; }
.lab-nav__button:hover { background: #ffffff0c; transform: translateX(2px); }
.lab-nav__button.is-active { border-color: #e8bbeb6d; color: white; background: linear-gradient(100deg, #7c497f75, #694b9770); box-shadow: inset 3px 0 #f4c4e6; }
.lab-nav__number { color: #aa9cba; font-size: .65rem; font-weight: 800; }
.lab-nav__icon { display: grid; place-items: center; color: #f3cbe5; font-size: 1.55rem; line-height: 1; }
.lab-nav__button strong, .lab-nav__button small { display: block; }
.lab-nav__button strong { font-size: .85rem; }
.lab-nav__button small { margin-top: 2px; color: #bbabc9; font-size: .67rem; }
.control-panel { display: grid; gap: 11px; padding: 15px; border: 1px solid #ead5fa2a; border-radius: 17px; background: #0e0c1c78; }
.panel-title h3 { margin: .32rem 0 .25rem; font: 700 1.12rem Georgia, serif; }
.control-label, .field-label { display: block; margin: .4rem 0 0; color: #dfd4e7; font-size: .72rem; font-weight: 750; }
.zoom-controls { display: grid; grid-template-columns: 43px 1fr 43px; gap: 6px; }
.zoom-controls button, .preset-list button, .panel-action { min-height: 39px; border: 1px solid #c9acd447; border-radius: 10px; color: #f1e9f5; background: #ffffff0d; font-size: .72rem; font-weight: 750; }
.zoom-controls button:hover, .preset-list button:hover, .panel-action:hover { border-color: #f1c7ecb3; background: #ffffff22; }
.zoom-controls button:first-child, .zoom-controls button:last-child { font-size: 1.35rem; }
.preset-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.preset-list button { min-height: 40px; padding: .45rem .5rem; font-size: .66rem; }
.preset-list button.is-active { color: #2a1738; background: var(--pink); border-color: var(--pink); }
.palette-list { display: flex; gap: 11px; }
.palette { width: 30px; height: 30px; border: 2px solid transparent; border-radius: 50%; box-shadow: 0 0 0 1px #ffffff5c; }
.palette.is-active { box-shadow: 0 0 0 2px #1b1430, 0 0 0 4px #f9dafa; }
.palette--aurora { background: linear-gradient(135deg, #e9b8e5 10%, #8665ca 48%, #83d5c7); }
.palette--ember { background: linear-gradient(135deg, #ffe2a3, #f69b65 45%, #78336d); }
.palette--ocean { background: linear-gradient(135deg, #ace8ef, #56a7c6 45%, #283a87); }
.range-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #e7d9eb; font-size: .72rem; font-weight: 700; }
.range-label output { color: var(--mint); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; margin: 0 0 5px; accent-color: #edb7eb; cursor: pointer; }
select { width: 100%; min-height: 39px; padding: .5rem .65rem; border: 1px solid #c6add14a; border-radius: 10px; color: #f5ecf8; background: #302341; }
.panel-action { width: 100%; padding: .55rem .7rem; }
.panel-action--primary { color: #231331; border-color: #ebbbe5; background: #ebbbe5; }
.panel-action--primary:hover { color: #231331; background: #f5d2ef; }
.control-copy { margin: 0; color: var(--muted); font-size: .73rem; line-height: 1.55; }
.probability-actions { display: grid; grid-template-columns: 1.4fr .8fr; gap: 7px; }
.sidebar-tip { margin: 0; color: #bdb0cb; font-size: .69rem; line-height: 1.5; }
.sidebar-tip span { color: var(--gold); }
.app-main { display: flex; flex-direction: column; min-width: 0; gap: 15px; }
.stage-top { display: flex; align-items: end; justify-content: space-between; gap: 15px; min-height: 120px; padding: 6px 7px 0; }
.stage-top h1 { margin: .38rem 0 .42rem; font: 700 clamp(1.75rem, 3vw, 2.9rem)/1.04 Georgia, serif; letter-spacing: -.06em; }
.stage-top p { max-width: 750px; margin: 0; color: #cfc3d8; font-size: clamp(.75rem, .9vw, .88rem); line-height: 1.5; }
.stage-index { align-self: start; padding: .4rem .6rem; border: 1px solid #d6c2e54a; border-radius: 9px; color: #d7c9e3; font-size: .67rem; font-weight: 900; white-space: nowrap; }
.canvas-shell { display: flex; flex-direction: column; overflow: hidden; min-height: min(63vh, 630px); border: 1px solid #d6b9ee4d; border-radius: 23px; background: #111124; box-shadow: 0 24px 75px #0302108a, inset 0 0 0 1px #ffffff11; }
.canvas-toolbar, .canvas-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 43px; padding: .5rem clamp(13px, 1.3vw, 20px); color: #d6cce1; background: #151126ef; font-size: .61rem; font-weight: 800; letter-spacing: .13em; }
.canvas-toolbar { border-bottom: 1px solid #ffffff1d; }
.canvas-toolbar__live { display: flex; align-items: center; gap: 7px; color: #b6e9dd; white-space: nowrap; }
.canvas-toolbar__live span { width: 7px; height: 7px; border-radius: 50%; background: #9ee3d4; box-shadow: 0 0 12px #9ee3d4; }
.canvas-toolbar > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas-toolbar button { min-height: 27px; padding: .2rem .5rem; border: 1px solid #cab6d557; border-radius: 7px; color: #f5e8f8; background: #ffffff13; font-size: .61rem; font-weight: 800; white-space: nowrap; }
.canvas-toolbar button:hover { border-color: #f7dcf4; background: #ffffff25; }
.canvas-stage { position: relative; flex: 1; min-height: 430px; overflow: hidden; background: radial-gradient(circle at 50% 50%, #30234a, #101126 65%); touch-action: none; }
.canvas-stage canvas { display: block; width: 100%; height: 100%; min-height: 430px; cursor: crosshair; }
.canvas-stage.is-fractal canvas { cursor: grab; }
.canvas-stage.is-dragging canvas { cursor: grabbing; }
.canvas-stage .zoom-ghost { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; pointer-events: none; transition: transform .38s cubic-bezier(.16,.82,.26,1), opacity .38s ease; opacity: .92; cursor: default; }
.canvas-reticle { display: none; position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; border: 1px solid #f6e3fa78; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; opacity: .55; }
.canvas-stage.is-fractal .canvas-reticle { display: block; }
.canvas-reticle::before, .canvas-reticle::after { content: ""; position: absolute; background: #f6e3fa87; }
.canvas-reticle::before { top: 13px; left: -7px; width: 40px; height: 1px; }
.canvas-reticle::after { top: -7px; left: 13px; width: 1px; height: 40px; }
.canvas-caption { position: absolute; right: 14px; bottom: 14px; left: 14px; width: fit-content; max-width: calc(100% - 28px); padding: .5rem .7rem; border: 1px solid #eddcf754; border-radius: 8px; color: #f7f0fb; background: #1b142acc; backdrop-filter: blur(12px); font-size: .68rem; font-weight: 650; pointer-events: none; }
.canvas-bottom { min-height: 42px; border-top: 1px solid #ffffff1d; font-variant-numeric: tabular-nums; }
.canvas-bottom span:last-child { color: var(--mint); white-space: nowrap; }
.insight { display: grid; grid-template-columns: 39px minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 110px; padding: 17px 19px; border: 1px solid #dcc8e839; border-radius: 19px; background: linear-gradient(115deg, #24182dcf, #172334b8); }
.insight__icon { display: grid; place-items: center; width: 37px; height: 37px; border: 1px solid #f6d8fa7a; border-radius: 12px; color: #f1c8e9; font-size: 1.35rem; }
.insight h2 { margin: .22rem 0 .24rem; font: 700 1.05rem Georgia, serif; }
.insight p { max-width: 870px; margin: 0; color: #c9bfd2; font-size: .74rem; line-height: 1.5; }
.insight__formula { padding: .7rem .8rem; border: 1px solid #d3bbdf4d; border-radius: 10px; color: #f7dbed; background: #ffffff0e; font: 700 1rem Georgia, serif; white-space: nowrap; }
@media (max-width: 1100px) { .app-header__center { display: none; } .app-layout { grid-template-columns: 265px minmax(0, 1fr); } .canvas-stage, .canvas-stage canvas { min-height: 390px; } .insight { grid-template-columns: 37px 1fr; } .insight__formula { grid-column: 2; justify-self: start; } }
@media (max-width: 760px) { .app-header { min-height: 68px; } .brand { min-width: 0; } .app-layout { display: flex; flex-direction: column; padding: 11px; } .app-sidebar { gap: 12px; padding: 13px; border-radius: 19px; } .sidebar-intro { display: none; } .lab-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; } .lab-nav__button { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 58px; padding: .35rem .15rem; text-align: center; } .lab-nav__number, .lab-nav__button small { display: none; } .lab-nav__icon { font-size: 1.18rem; } .lab-nav__button strong { font-size: .65rem; } .control-panel { gap: 8px; padding: 11px; } .panel-title { display: none; } .preset-list { grid-template-columns: repeat(4, 1fr); } .preset-list button { font-size: .58rem; } .sidebar-tip { display: none; } .stage-top { min-height: 92px; padding: 4px; } .canvas-shell { min-height: 490px; } .canvas-stage, .canvas-stage canvas { min-height: 410px; } .insight { padding: 13px; } }
@media (max-width: 480px) { .brand small, .presentation-link { display: none; } .brand strong { font-size: 1rem; } .icon-button { min-height: 34px; } .stage-top h1 { font-size: 1.65rem; } .stage-index { display: none; } .canvas-shell { min-height: 450px; border-radius: 16px; } .canvas-stage, .canvas-stage canvas { min-height: 370px; } .canvas-toolbar > span:nth-child(2) { display: none; } .canvas-caption { font-size: .61rem; } .canvas-bottom { font-size: .55rem; letter-spacing: .03em; } .insight__formula { font-size: .85rem; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
