:root {
  color-scheme: dark;
  --back: #0a0f14;
  --panel: #131e28;
  --line: #374954;
  --text: #f2eee7;
  --soft: #b6c4cb;
  --gold: #e5c19b;
  --active: #ffb080;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--back); color: var(--text); font: 16px/1.55 system-ui,sans-serif; }
a { color: #f1ca9c; text-underline-offset: .2em; }
button { font: inherit; color: var(--text); background: #1e303d; border: 1px solid #6e899b; padding: .52rem .75rem; cursor: pointer; }
button:hover { background: #314857; }
:focus-visible { outline: 3px solid #ffd19e; outline-offset: 4px; }
.skip { position: absolute; top: .5rem; left: .5rem; z-index: 5; padding: .5rem; background: #17222c; transform: translateY(-160%); }
.skip:focus { transform: translateY(0); }
.mast, main, footer {
  margin-inline: auto;
  width: min(100% - clamp(1.5rem,5vw,5rem),76rem);
}
.mast { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border-bottom: 1px solid var(--line); padding: .9rem 0; flex-wrap: wrap; }
.brand { color: var(--text); font-weight: 700; letter-spacing: .07em; text-decoration: none; }
.mast nav, footer { display: flex; flex-wrap: wrap; gap: .45rem 1rem; }
.mast nav a { font-size: .88rem; }
.intro { display: grid; grid-template-columns: minmax(0,1fr) minmax(10rem,19rem); align-items: end; gap: .5rem 2rem; margin: 2rem 0 1.35rem; }
.eyebrow { color: var(--gold); font-size: .72rem; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; margin: 0 0 .45rem; }
h1, h2, h3 { font-family: Georgia,serif; font-weight: 500; line-height: 1.06; margin: 0; }
h1 { font-size: clamp(3.25rem,10vw,7.7rem); letter-spacing: -.07em; line-height: .86; }
h1 br { display: none; }
.intro > p { margin: 0; color: var(--soft); }
.instrument { display: grid; grid-template-columns: minmax(0,1.95fr) minmax(17rem,1fr); border: 1px solid var(--line); }
.viewport { min-height: clamp(23rem,43vw,34rem); background: #0b1119; position: relative; isolation: isolate; }
.preview, .world { position: absolute; inset: 0; overflow: hidden; }
.preview {
  pointer-events: none;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 48% 41%,#273642 0%,#172530 31%,#0a1018 74%);
}
.preview-stage { width: min(67%,23rem); position: relative; transform: translateY(-2%); perspective: 650px; }
.preview-glass {
  position: relative;
  min-height: clamp(9.5rem,25vw,18rem);
  display: grid;
  place-items: center;
  border: 1px solid #a3d4da;
  border-top: 8px double #9bc9d1;
  border-bottom: 8px double #7a878b;
  background: linear-gradient(145deg,#80d7ef30,#7cc6d30d 32%,#3e626516 63%,#9ff1ff18 66%,#87c7d130 68%,#111c250d 72%);
  box-shadow: inset 0 0 0 .45rem #a2deed12, inset 0 0 35px #9cbdba21, 0 0 28px #84cbd330;
  transform: rotateY(-13deg);
}
.preview-glass::before {
  content: "";
  position: absolute;
  inset: -.44rem -2.1rem -.5rem auto;
  width: 2rem;
  border: 1px solid #7dabb7;
  background: linear-gradient(90deg,#afbfc833,#3d546227);
  transform: skewY(-18deg);
  transform-origin: left center;
}
.preview-label {
  width: 86%;
  overflow-wrap: anywhere;
  text-align: center;
  color: var(--active);
  font: 650 clamp(.68rem,2.1vw,1.4rem)/1.35 ui-monospace,monospace;
  background: #111b24;
  border: 1px solid var(--active);
  padding: .9rem .5rem;
  box-shadow: 0 12px 30px #01070b75;
}
.preview-label i { display: block; margin: .5rem auto 0; width: 2.5rem; height: 1px; background: var(--active); }
.preview-plinth { background: linear-gradient(#475861 0 11%,#232e34 12% 64%,#15212a 65%); height: clamp(2.75rem,7vw,5rem); border: 1px solid #5b717d; box-shadow: 0 18px 20px #0008; transform: translate(-1%,.28rem) rotateY(-13deg); }
.world canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.world canvas:active { cursor: grabbing; }
.world canvas:focus-visible { outline-offset: -4px; }
.viewport-note { position: absolute; left: .7rem; top: .65rem; display: flex; align-items: center; gap: .42rem; color: #c9d9e2; background: #101820e3; padding: .28rem .45rem; font-size: .7rem; letter-spacing: .02em; pointer-events: none; }
.lamp { width: .42rem; height: .42rem; border-radius: 50%; display: inline-block; background: var(--active); }
.viewer-actions { bottom: .75rem; left: .75rem; right: .75rem; position: absolute; display: grid; justify-items: start; gap: .45rem; }
#load-viewer { background: #ebc18e; color: #171311; font-weight: 700; border-color: #ebc18e; }
#load-viewer:disabled { cursor: wait; opacity: .87; }
.viewer-status { margin: 0; padding: .1rem .32rem; color: #e4edf1; background: #101820; font-size: .75rem; }
.viewer-status:empty { display: none; }
.orbit-tools { display: flex; flex-wrap: wrap; gap: .25rem; }
.orbit-tools button { background: #12212fdc; min-width: 2.05rem; min-height: 2.15rem; padding: .18rem .45rem; font-size: .83rem; }
.console { background: linear-gradient(150deg,#192631,#111a23); border-left: 1px solid var(--line); padding: clamp(.9rem,2vw,1.45rem); }
.selector { display: grid; gap: .35rem; }
.selector a { display: block; padding: .5rem .7rem; border: 1px solid #425865; color: var(--text); text-decoration: none; }
.selector a:hover { background: #263644; }
.selector a[aria-current="true"] { border-color: var(--active); box-shadow: inset 3px 0 var(--active); }
.selection { border-top: 1px solid var(--line); margin-top: .9rem; padding-top: .95rem; }
.selection p { margin: 0 0 .5rem; color: var(--soft); font-size: .91rem; }
.selection .domain, .domain { color: var(--gold); font: .9rem/1.48 ui-monospace,monospace; overflow-wrap: anywhere; margin: .45rem 0 .3rem; }
.selection a { font-size: .86rem; }
.records { margin: 3rem 0; scroll-margin-top: 1rem; }
.records h2 { font-size: clamp(2rem,5vw,3.8rem); letter-spacing: -.04em; }
.records header p { color: var(--soft); max-width: 57ch; }
.record-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--line); gap: 1px; background: var(--line); }
.record-grid article { background: #121d25; min-width: 0; padding: clamp(.95rem,2vw,1.6rem); scroll-margin-top: 1rem; }
.record-grid article:target { box-shadow: inset 0 0 0 2px var(--gold); }
.record-grid h3 { font-size: clamp(1.3rem,3vw,2.05rem); }
.record-copy p { color: var(--soft); max-width: 54ch; }
.record-copy ul, .selection ul { margin: 0; padding-inline-start: 1.2rem; }
.record-copy li + li, .selection li + li { margin-top: .22rem; }
footer { padding: 1.4rem 0 2.7rem; border-top: 1px solid var(--line); }
@media (max-width: 47rem) {
  .instrument { grid-template-columns: minmax(0,1fr); }
  .console { border-left: 0; border-top: 1px solid var(--line); }
  .intro { grid-template-columns: minmax(0,1fr); }
  .intro > p { max-width: 42ch; margin-top: .55rem; }
}
@media (max-width: 34rem) { .record-grid { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 25rem) { h1 br { display: block; } }
.embed .mast, .embed .records, .embed footer { display: none; }
.embed main { width: calc(100% - 1rem); }
.embed .intro { margin: .65rem 0 .8rem; }
.embed h1 { font-size: clamp(2.15rem,6vw,3.3rem); letter-spacing: -.04em; }
.embed h1 br { display: none; }
.embed .viewport { min-height: clamp(20rem,35vw,32rem); }
.orbit-tools button { min-width: 2.7rem; min-height: 2.7rem; }
