/* ============================================================================
   THE SCALE OF EVERYTHING
   The visual language of the original field guide — ink, gold, Space Grotesk,
   generous margins — carrying the expanded scientific readout.
   ========================================================================== */

@font-face{font-family:Space;src:url('assets/SpaceGrotesk.ttf');font-display:swap}
@font-face{font-family:DM;src:url('assets/DMSans.ttf');font-display:swap}
@font-face{font-family:Mono;src:url('assets/IBMPlexMono.ttf');font-display:swap}

:root{
  color-scheme:dark;
  --bg:#090d10;
  --white:#f3f4ee;
  --muted:#94a1a6;
  --gold:#dcc66e;
  --line:#ffffff20;
  --realm:#dcc66e;
  font-family:DM,sans-serif;
  background:var(--bg);
  color:var(--white);
}
*{box-sizing:border-box}
body{margin:0;overflow:hidden;height:100svh}
button,a,input{-webkit-tap-highlight-color:transparent}
button,a{touch-action:manipulation}
button{font:inherit;color:inherit;cursor:pointer;background:transparent;border:1px solid var(--line)}
button:hover{border-color:var(--gold);color:var(--gold)}
button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid var(--gold);outline-offset:5px}
a{color:inherit;text-decoration:none}

#stage{position:absolute;inset:0;touch-action:none}
#stage canvas{display:block;width:100%;height:100%}

#leaders{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:2}
#leaders line{stroke:#dcc66e66;stroke-width:1}
#leaders circle{fill:none;stroke:#dcc66ebb;stroke-width:1}

.vignette{
  pointer-events:none;position:absolute;inset:0;
  background:
    linear-gradient(90deg,#090d10e8 0%,#090d1088 28%,transparent 55%),
    linear-gradient(0deg,#090d10 0%,transparent 32%,transparent 75%,#090d10a8 100%);
}

/* ---------- header -------------------------------------------------------- */
header{position:absolute;top:30px;left:42px;right:42px;display:flex;align-items:center;justify-content:space-between;z-index:4}
.brand{display:flex;align-items:center;gap:13px;font-family:Space;font-size:11px;letter-spacing:2px;font-weight:600;line-height:1.25}
.brand img{width:40px;height:40px;object-fit:contain}

.edition,.eyebrow,.scene-label,.object-top,.model-note,.landmarks,.hint,.scale-row,.footnote,
.readout-head,#profile-rows,#telemetry-rows,.callout,#bound-flag,.bar-label{
  font-family:Mono;font-size:10px;font-weight:400;letter-spacing:1.5px;
}
.edition{color:#bdc6c7;display:flex;align-items:center;gap:12px}
.edition-number{margin-left:26px;color:#65767b}
.live-dot{width:5px;height:5px;background:var(--gold);border-radius:50%}
.icon-button{width:35px;height:35px;border-radius:50%;font-size:16px;display:inline-grid;place-items:center}

/* ---------- chapter heading ----------------------------------------------- */
.heading{position:absolute;left:5%;top:16%;max-width:34%;z-index:3;pointer-events:none}
.eyebrow{color:var(--gold);margin:0 0 21px;letter-spacing:3px}
h1{font-family:Space;font-size:clamp(30px,3.5vw,58px);font-weight:400;letter-spacing:-2.6px;line-height:1.04;margin:0}
.intro{font-size:14px;line-height:1.65;color:var(--muted);margin-top:22px}

/* ---------- scene label ---------------------------------------------------- */
.scene-label{position:absolute;left:46%;right:5%;top:15.5%;display:flex;align-items:center;gap:16px;color:#b2c2c6;font-size:9px;z-index:3}
.hairline{height:1px;background:var(--line);flex:1}

/* ---------- the object ----------------------------------------------------- */
.object-info{position:absolute;left:5%;bottom:24%;width:32%;max-width:430px;z-index:3}
.object-top{font-size:8px;color:var(--gold);display:flex;justify-content:space-between;gap:6px}
#measure-label{color:#8b9a9d;font-size:7px;text-align:right}
.object-info h2{font-family:Space;font-size:clamp(25px,2.3vw,34px);letter-spacing:-1px;line-height:1.05;font-weight:400;margin:14px 0 12px}
.measure{display:flex;align-items:baseline;gap:18px;flex-wrap:wrap;row-gap:6px}
#object-size{color:var(--gold);font-family:Space;font-size:26px;letter-spacing:-.4px}
#notation{font-family:Mono;font-size:12px;color:#b1c0c4;letter-spacing:.5px}
#notation sup{font-size:.8em}
#bound-flag{font-size:7px;color:#8b9a9d;border:1px solid var(--line);border-radius:2px;padding:3px 6px;letter-spacing:1.3px;white-space:nowrap}
#bound-flag.caution{color:var(--gold);border-color:#dcc66e55}
.object-info p{max-width:390px;font-size:13px;line-height:1.7;color:#aab8bc;margin:16px 0}
.object-links{display:flex;gap:22px;font-size:10px;font-family:Mono;letter-spacing:1.2px;flex-wrap:wrap}
.object-links a{border-bottom:1px solid #6c787c;padding:0 0 4px}
.object-links button{border:0;padding:0 0 4px;color:#b1b9af;border-bottom:1px solid transparent}
.object-links button:hover{border-bottom-color:var(--gold)}

/* ---------- instrument readout, lower right --------------------------------
   Deliberately unhoused: no panel, no fill. Small gold-and-grey mono laid
   straight over the artwork, the way the original guide annotated its scenes. */
.readout{position:absolute;left:5%;bottom:43.5%;width:27%;max-width:330px;z-index:3;pointer-events:none}
.readout-head{display:flex;align-items:center;gap:12px;color:var(--gold);font-size:8px;letter-spacing:2.4px;margin-bottom:12px}
#profile-rows{display:grid;grid-template-columns:auto 1fr;gap:5px 14px;margin:0 0 14px;font-size:8.5px;letter-spacing:.5px}
#profile-rows dt{color:#73858b;white-space:nowrap;text-align:left}
#profile-rows dd{margin:0;text-align:right;color:#c6d2d4;font-variant-numeric:tabular-nums}
#profile-rows dd.flag{color:var(--gold)}
#telemetry-rows{display:flex;flex-direction:column;gap:10px;border-top:1px solid #29333880;padding-top:12px}
.tel-top{display:flex;justify-content:space-between;gap:10px;color:#73858b;font-size:8.5px;letter-spacing:1px}
.tel-top b{color:#e4ebec;font-weight:400;font-variant-numeric:tabular-nums}
.tel-unit{color:#5e7178;font-size:7px;letter-spacing:1px;margin:2px 0 4px}
.tel .track{height:1px;background:#ffffff1f}
.tel .track i{display:block;height:100%;background:var(--gold);box-shadow:0 0 8px #dcc66e77;transition:width .7s cubic-bezier(.22,1,.36,1)}

/* ---------- field of view --------------------------------------------------- */
.model-note{text-shadow:0 1px 7px rgba(9,13,16,.92);position:absolute;right:5%;top:23%;display:flex;gap:12px;justify-content:flex-end;color:#8b9a9d;line-height:1.7;font-size:8px;z-index:3;text-align:right}
.crosshair{font-size:25px;font-family:Space;color:var(--gold);font-weight:300;line-height:1;order:1}
#view-width{font-size:7px;color:#71858b}

/* ---------- scale bar -------------------------------------------------------- */
#scalebar{position:absolute;right:5%;top:30%;display:flex;align-items:center;justify-content:flex-end;z-index:3;pointer-events:none}
#scalebar .cap{width:1px;height:8px;background:#dcc66e88}
#scalebar .rule{width:92px;height:1px;background:#dcc66e88}
.bar-label{font-size:8px;color:#8b9a9d;margin-left:11px;order:1;letter-spacing:1.4px;white-space:nowrap}

/* ---------- callouts ---------------------------------------------------------- */
#callouts{position:absolute;inset:0;pointer-events:none;z-index:3}
.callout{
  position:absolute;left:0;top:0;will-change:transform;min-width:150px;max-width:230px;
  opacity:0;transition:opacity .6s ease;
  border-left:1px solid #dcc66e55;padding:2px 0 2px 11px;
}
.callout.in{opacity:1}
.callout{text-shadow:0 1px 8px rgba(9,13,16,.96),0 0 3px rgba(9,13,16,.9)}
.callout h3{margin:0 0 5px;font-family:Mono;font-size:8px;letter-spacing:2px;color:var(--gold);text-transform:uppercase;font-weight:400}
.callout p{margin:0;font-family:Mono;font-size:8.5px;line-height:1.75;color:#c6d2d6;letter-spacing:.6px}

/* ---------- landmarks ---------------------------------------------------------- */
.landmarks{position:absolute;bottom:19%;left:46%;right:5%;display:flex;justify-content:space-between;gap:3px;letter-spacing:0;z-index:4}
.landmarks button{border:0;border-bottom:1px solid #ffffff12;padding:10px 4px;color:#929fa1;font-size:9px;font-family:Mono;letter-spacing:.6px}
.landmarks button.active{color:var(--gold);border-bottom-color:var(--gold)}

/* ---------- footer --------------------------------------------------------------- */
footer{position:absolute;bottom:22px;left:5%;right:5%;z-index:4}
.transport{display:flex;align-items:center;gap:12px;margin-bottom:24px}
.primary{background:var(--gold);color:#171b16;font-family:Mono;font-size:11px;font-weight:600;letter-spacing:1.4px;border:0;padding:12px 18px;border-radius:3px;min-width:170px;display:flex;align-items:center;justify-content:center;gap:9px}
.primary:hover{color:#000;background:#f4e5a5}
.hint{color:#7c9096;margin-left:auto;font-size:8px;letter-spacing:1.6px}
.scale-row{display:flex;align-items:center;gap:24px;color:#bdc5be;font-size:8px;letter-spacing:1px}
.scale-edge{color:#7c9096;white-space:nowrap}

/* the scroller: a logarithmic ruler banded by realm */
.ruler{position:relative;flex:1;height:42px}
#locator{position:absolute;left:0;top:0;width:100%;height:17px;display:block}
input[type=range]{
  -webkit-appearance:none;appearance:none;position:absolute;top:-4px;left:0;width:100%;height:26px;
  background:transparent;margin:0;cursor:ew-resize;
}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:3px;height:25px;background:var(--gold);box-shadow:0 0 15px #dcc66e88;border:0}
input[type=range]::-moz-range-thumb{width:3px;height:25px;background:var(--gold);border:0;border-radius:0}
#scale-labels{position:absolute;left:0;right:0;top:25px;pointer-events:none;color:#71878e;font-family:Mono;font-size:9px;letter-spacing:.5px;display:block;height:14px}
#scale-labels span{position:absolute;transform:translateX(-50%);white-space:nowrap}

.footnote{display:flex;justify-content:space-between;gap:16px;border-top:1px solid #29333880;padding-top:13px;margin-top:12px;color:#667b83;font-size:7px;letter-spacing:1px}
#foot-mag{color:var(--gold)}
#foot-readout{color:#5e7178}

/* ---------- dialog ----------------------------------------------------------------- */
dialog{
  width:min(640px,90vw);max-height:82svh;border:1px solid #526365;background:#10181d;
  border-radius:6px;padding:45px;color:var(--white);
}
dialog::backdrop{background:#02080dcc;backdrop-filter:blur(8px)}
dialog h2{font-family:Space;font-size:32px;line-height:1.12;font-weight:400;letter-spacing:-1px;margin:8px 0 16px}
dialog h3{font-family:Mono;font-size:9px;letter-spacing:2.4px;color:var(--gold);text-transform:uppercase;font-weight:400;margin:26px 0 10px}
dialog p,dialog li{font-size:14px;color:#b3c2c7;line-height:1.7;margin:0 0 12px}
dialog a{text-decoration:underline;color:var(--gold)}
dialog .eyebrow{font-family:Mono;font-size:9px;letter-spacing:2.6px;color:#8b9a9d;margin:0}
dialog .big{font-family:Space;font-size:34px;color:var(--gold);margin:6px 0 14px;letter-spacing:-1px;line-height:1.1}
dialog dl{display:grid;grid-template-columns:auto 1fr;gap:7px 20px;font-family:Mono;font-size:11px;margin:0 0 16px;letter-spacing:.5px}
dialog dt{color:#7f9096}
dialog dd{margin:0;text-align:right;color:#cdd8da}
dialog .caution{border-left:2px solid var(--gold);padding:7px 0 7px 14px;color:#b9a77f;font-size:13px}
#close-details{position:absolute;right:15px;top:15px}

/* ---------- loading ------------------------------------------------------------------ */
#loading{
  position:fixed;inset:0;z-index:20;background:var(--bg);display:grid;place-content:center;
  justify-items:center;gap:20px;font-family:Mono;font-size:10px;letter-spacing:3px;
  transition:opacity .8s ease,visibility .8s;
}
#loading img{width:65px}
#loading p{margin:0;color:#94a1a6}
#loading.hidden{opacity:0;visibility:hidden}
.boot-bar{width:190px;height:1px;background:#ffffff14;overflow:hidden}
.boot-bar i{display:block;height:100%;width:38%;background:var(--gold);animation:slide 1.6s ease-in-out infinite}
@keyframes slide{0%{transform:translateX(-100%)}100%{transform:translateX(330%)}}

.noscript{position:fixed;inset:0;display:grid;place-items:center;padding:40px;text-align:center;font-size:15px;line-height:1.7;color:var(--white);background:var(--bg);z-index:30}

/* ---------- responsive ------------------------------------------------------------------ */
@media(max-width:1180px){
  .readout{width:30%}
  .object-info{width:36%}
  .heading{max-width:38%}
}
@media(max-width:1320px){
  #profile-rows{display:none}        /* full table stays in the entry dialog */
  .readout{bottom:38%}
}
@media(max-width:980px){
  .intro{display:none}
  .readout{width:32%}
}
@media(max-height:760px){
  .intro{display:none}
  #profile-rows{display:none}
  .readout{bottom:37%}
}
@media(max-width:760px){
  header{top:22px;left:25px;right:25px}
  .brand{font-size:9px;letter-spacing:1.6px;gap:9px}
  .brand img{width:31px;height:31px}
  .edition{display:none}
  .vignette{background:linear-gradient(0deg,#090d10 0%,#090d1099 27%,transparent 48%,transparent 63%,#090d10aa 100%)}
  .heading{left:7%;top:12%;max-width:86%}
  .eyebrow{font-size:8px;letter-spacing:2.1px;margin-bottom:14px}
  h1{font-size:34px;letter-spacing:-1.6px}
  .scene-label{top:30%;left:7%;right:7%;font-size:7px}
  .object-info{left:7%;bottom:27%;width:86%;max-width:none;pointer-events:none}
  .object-top{font-size:7px}
  #measure-label{font-size:6px}
  .object-info h2{font-size:27px;margin:9px 0}
  #object-size{font-size:23px}
  #notation{font-size:10px}
  .object-info p{display:none}
  .object-links{font-size:9px;margin-top:10px;pointer-events:auto;gap:16px}
  .readout,.model-note,#scalebar,#callouts{display:none}
  .landmarks{left:7%;right:7%;bottom:21%;gap:1px}
  .landmarks button{font-size:8px;padding:10px 2px}
  footer{left:7%;right:7%;bottom:20px}
  .transport{gap:8px;margin-bottom:20px}
  .primary{font-size:10px;padding:12px 14px;min-width:150px}
  .hint{display:none}
  .scale-row{gap:9px}
  .scale-edge{display:none}
  .footnote{font-size:6px;line-height:1.5;margin-top:9px;letter-spacing:.5px}
  #foot-status{display:none}
  dialog{padding:30px}
  dialog h2{font-size:25px}
  dialog .big{font-size:26px}
}
@media(max-width:350px){
  h1{font-size:28px;letter-spacing:-1.3px}
  .scene-label{top:29%}
}
@media(prefers-reduced-motion:reduce){
  *{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto}
}
