:root{color-scheme:dark;--bg:#03060c;--text:#e6efff;--dim:#9eb3d1;--one:#59e6f2;--two:#ffd659;--line:#223243;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
*{box-sizing:border-box}body{margin:0}main{max-width:1720px;margin:auto;padding:34px 42px 20px}header{display:flex;gap:24px;align-items:flex-start;justify-content:space-between}h1{margin:0;font-size:clamp(24px,2.55vw,42px);font-weight:400;line-height:1.16;letter-spacing:-.025em}.subtitle{color:var(--dim);font-size:clamp(15px,1.25vw,21px);line-height:1.5;margin:13px 0 0;max-width:1000px}
button{background:transparent;color:var(--text);border:1px solid #344558;padding:10px 19px;min-height:42px;border-radius:4px;font:inherit;font-size:15px;white-space:nowrap;cursor:pointer}button:hover{background:#111e2c}button:focus-visible,input:focus-visible{outline:2px solid var(--one);outline-offset:5px}
.legend{display:flex;gap:27px;margin-top:26px;font-size:15px}.legend>span{display:flex;align-items:center;gap:9px}.legend .m,.legend .m *{display:inline}.legend>span:before{content:"";width:24px;height:2px;background:currentColor}.one{color:var(--one)}.two{color:var(--two)}.total{color:#fff}.total:before{height:3px!important}
.experiment{display:grid;grid-template-columns:minmax(0,1fr) 232px;gap:24px;margin-top:6px;align-items:stretch}.scene{position:relative;min-width:0;height:clamp(410px,40vw,590px)}#crystal{display:block;width:100%;height:100%;touch-action:pan-y}.scene-label,.axis-label{position:absolute;pointer-events:none;white-space:nowrap;transform:translate(-50%,-50%);font-size:17px;text-shadow:0 1px 5px #03060c}.axis-label{font-size:15px}.scene-note{position:absolute;bottom:5px;left:0;right:0;text-align:center;color:var(--dim);font-size:15px;margin:0}.sections{display:flex;flex-direction:column;justify-content:center;gap:12px;padding-top:12px}.cross-section h2{font-size:17px;font-weight:400;margin:0 0 4px;color:var(--dim)}.cross-section canvas{display:block;width:100%;aspect-ratio:1.12}.cross-section p{font-size:17px;line-height:1.3;margin:0;min-height:24px}.controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:40px;margin-top:28px;padding-top:23px;border-top:1px solid var(--line)}.controls label{display:block;min-width:0;font-size:17px}.controls label>span:first-child{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}.controls output{margin-left:auto;color:#fff;font-variant-numeric:tabular-nums}.controls .m{font-size:1.2em}.controls input{display:block;width:100%;height:24px;margin:15px 0 0;accent-color:#b7c9df;cursor:ew-resize}.ticks{display:flex;justify-content:space-between;color:var(--dim);font-size:12px;margin-top:3px}.readout{display:flex;justify-content:space-between;gap:24px;align-items:center;font-size:18px;line-height:1.45;margin-top:17px}.readout p{margin:0}.phase{font-size:21px;white-space:nowrap;font-variant-numeric:tabular-nums}footer{display:flex;justify-content:space-between;gap:20px;margin-top:25px;color:#7d92ad;font-size:12px;line-height:1.4}#error{position:absolute;inset:30% 10%;color:var(--two);font-size:20px}
@media(min-width:1600px){.experiment{grid-template-columns:minmax(0,1fr) 270px}.cross-section canvas{max-height:235px}}
@media(max-width:900px){main{padding:24px}.experiment{grid-template-columns:minmax(0,1fr) 175px;gap:10px}.scene{height:420px}.legend{gap:20px;font-size:13px}.controls{gap:22px}.controls label{font-size:15px}.readout{font-size:16px}.phase{font-size:20px}.cross-section h2,.cross-section p{font-size:15px}.scene-label{font-size:14px}.axis-label{font-size:13px}}
@media(max-width:620px){main{padding:22px 16px 18px}header{gap:10px}header button{padding:8px 12px;font-size:13px}h1{font-size:25px}.subtitle{font-size:14px}.legend{gap:16px;flex-wrap:wrap;margin-top:22px;font-size:12px}.legend span{gap:6px}.legend span:before{width:17px}.experiment{display:block}.scene{height:325px}.sections{flex-direction:row;gap:28px;padding-top:10px;justify-content:center}.cross-section{width:min(43%,190px)}.cross-section h2{font-size:14px}.cross-section p{font-size:14px;min-height:36px}.scene-note{font-size:12px}.controls{grid-template-columns:1fr;gap:19px;margin-top:16px;padding-top:20px}.controls label{font-size:16px}.controls input{margin-top:8px;height:27px}.ticks{font-size:11px}.readout{align-items:flex-start;flex-direction:column;gap:10px;margin-top:22px;font-size:16px}.phase{font-size:21px}footer{flex-direction:column;gap:8px;font-size:11px;margin-top:24px}.scene-label{font-size:12px}.axis-label{font-size:12px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}
@media(min-width:621px){main{padding-top:25px}.scene{height:clamp(320px,calc(100svh - 400px),560px)}.cross-section canvas{height:clamp(150px,25vh,260px);aspect-ratio:auto}.controls{margin-top:18px;padding-top:18px}.legend{margin-top:21px}}
@media(max-width:620px){header{flex-direction:column;gap:14px}header>div{min-width:0;width:100%}header button{align-self:flex-start}.scene{height:260px}}
.embed main{padding:12px 18px}.embed header h1{font-size:24px}.embed header p,.embed footer{display:none}.embed header button{min-height:32px;padding:7px 13px}.embed .legend{margin-top:14px}.embed .scene{height:clamp(330px,calc(100svh - 275px),550px)}.embed .readout{font-size:16px;margin-top:12px}.embed .controls{margin-top:12px;padding-top:14px}
