/* Taipei 101: the page around the drawing, in the Control Room look.
 *
 * Graphite first (the page opens dark unless the reader chose light), Steel Blue
 * leads, yellow only highlights, red is force. Matrix Green (shared/control.css)
 * marks one thing: what is live. Here that is the HUD box and the status light.
 * Boxes are a 2px outline at 8px radius, with no UI shadows.
 *
 * Pren Moodley brand guide v2.0, "Site Notebook". EVERY COLOUR HERE IS A SITE
 * TOKEN, from shared/pren.css, so the page and the canvas move together between
 * paper (light) and Graphite (dark). The two values below are the only ones this
 * app needs that the site does not already name; they are declared here rather
 * than hard coded in the script, so that a colour still has exactly one home.
 * The glass of the tower is a wash of Steel Blue.
 */
:root {
  --t101-glass: rgba(29, 78, 216, .07);
  --t101-grid2: rgba(17, 17, 17, .13);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-print]) {
    --t101-glass: rgba(110, 149, 255, .10);
    --t101-grid2: rgba(228, 231, 235, .14);
  }
}
:root[data-theme="dark"]:not([data-print]) {
  --t101-glass: rgba(110, 149, 255, .10);
  --t101-grid2: rgba(228, 231, 235, .14);
}

/* The bar across the top is in shared/pren.css, once, for all of them. */

[hidden] { display: none !important; }
body { color: var(--ink); font: 400 15.5px/1.5 var(--ui); }

.app { max-width: 1180px; margin: 0 auto; padding: clamp(22px, 4vw, 44px) clamp(16px, 4vw, 40px) 28px; }
.wrap { display: grid; gap: clamp(24px, 4vw, 40px); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .wrap { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); align-items: start; } }

.stagecol { display: grid; gap: 12px; width: 100%; max-width: 560px; margin: 0 auto; }
.stagecol .stage-box { max-width: none; }
.hudbox { background: var(--panel); border: 2px solid var(--rule); border-color: var(--mx-line); padding: 10px 14px 12px; }
.hudline.hud-h { border-bottom: 1px solid var(--mx-line); margin-bottom: 4px; padding-bottom: 3px; }
.hudline b { font-variant-numeric: tabular-nums; }
.hudmeter { height: 6px; border: 1px solid var(--mx-line); margin-top: 6px; position: relative; }
.hudmeter i { position: absolute; left: 0; top: 0; bottom: 0; width: 46%; background: var(--mx); }
.stage-box { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1 / 1; margin: 0 auto; }
canvas#stage {
  width: 100%; height: 100%; display: block; cursor: pointer;
  border: 2px solid var(--rule); border-radius: var(--r); background: var(--bg);
}

.side { display: grid; gap: 22px; }
.head { position: relative; overflow: hidden; }
.head > .eyebrow, .head > h1 { position: relative; }
.eyebrow {
  display: inline-block; margin: 0; background: var(--hi); color: var(--on-hi);
  font: 600 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 10px; border-radius: var(--r);
}
h1 {
  font: 400 clamp(38px, 5.6vw, 64px)/.95 var(--display);
  letter-spacing: -.02em; margin: 16px 0 0; text-wrap: balance; color: var(--head);
}
.lede { color: var(--ink); max-width: 58ch; margin: 0; font-size: 17px; line-height: 1.45; }

.tabs { display: flex; gap: 8px; }
.tab {
  font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  background: var(--panel); border: 2px solid var(--rule); border-radius: var(--r);
  color: var(--head); padding: 11px 16px; cursor: pointer;
}
.tab:hover { background: var(--hi); color: var(--on-hi); }
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tab[aria-selected="true"]:hover { background: var(--hi); border-color: var(--hi); color: var(--on-hi); }
.tab:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.panel { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.btn {
  font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  background: var(--panel); color: var(--head); border: 2px solid var(--rule);
  border-radius: var(--r); padding: 12px 16px; cursor: pointer;
}
.btn:hover { background: var(--hi); color: var(--on-hi); }
.btn { background: transparent; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--hi); border-color: var(--hi); color: var(--on-hi); }

input[type="range"] { flex: 1; min-width: 140px; accent-color: var(--accent); }
.time {
  text-transform: uppercase;
  font: 600 11.5px/1 var(--mono); letter-spacing: .06em; color: var(--head);
  font-variant-numeric: tabular-nums; min-width: 110px; text-align: right;
}
.ctl { display: grid; gap: 8px; }
.ctl label {
  display: flex; justify-content: space-between; gap: 12px;
  font: 500 10.5px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--soft);
}
.ctl output { color: var(--head); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-variant-numeric: tabular-nums; text-align: right; }

.notes {
  border-top: 2px solid var(--rule); padding-top: 18px; display: grid; gap: 11px;
  color: var(--ink); font-size: 15px; max-width: 62ch;
}
.notes p { margin: 0; }
.notes strong { color: var(--head); font-weight: 600; }
.fine { font: 400 11px/1.6 var(--mono); letter-spacing: .02em; color: var(--soft); margin: 0; }

.by {
  margin: 26px 0 18px; padding-top: 18px; border-top: 2px solid var(--rule);
  font: 400 11px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--soft);
}
.by b { color: var(--head); font-weight: 600; }
.scale { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* The rain stays in the last fifth of the header, clear of the headline's words. */
.head canvas.rain { opacity: .22; -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 80%, #000 96%); mask-image: linear-gradient(90deg, transparent 0, transparent 80%, #000 96%); }
