/* Layout: the Computer week strip on paper, then one dark screen that fills the rest.
   Stage tokens below are the shared site's, repeated so the page also stands alone;
   on the site the shared sheet loads after this one with the same values. Selectors
   that must hold against the shared button and heading rules are scoped by ID. */
:root {
  --paper: #eceee9;
  --plate: #f9faf7;
  --ink: #14171a;
  --soft: #464c52;
  --mid: #737980;
  --hair: #cfd3cd;
  --screen: #0b0d10;
  --screen-edge: #2a2f36;
  --chalk: #eef1ea;
  --chalk-dim: #bcc7bf;
  --focus: #2a78d6;
  --past: #ff5a2a;
  --future: #dfe8ff;
  --own: #7fe3ab;
  --display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1113; --plate: #16191c; --ink: #e5e7e2; --soft: #b7bcc2; --mid: #8d939a;
    --hair: #2b3036; --screen-edge: #3a414a; --focus: #7aa7ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1113; --plate: #16191c; --ink: #e5e7e2; --soft: #b7bcc2; --mid: #8d939a;
  --hair: #2b3036; --screen-edge: #3a414a; --focus: #7aa7ff;
  color-scheme: dark;
}
html:root { height: 100%; scrollbar-gutter: auto; }
body { height: 100%; margin: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); color: var(--ink); -webkit-tap-highlight-color: transparent; }

/* the Computer week strip */
#topnav {
  flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  margin: 0; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  font: 600 14px/1.4 var(--display); letter-spacing: .05em;
  border-bottom: 1px solid var(--hair); background: var(--paper);
}
#topnav a {
  display: inline-block; border: 1px solid var(--hair); border-radius: 5px; padding: 5px 11px;
  font: 600 14px/1.35 var(--display); letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; background: transparent;
}
#topnav a:hover { border-color: var(--mid); }
#topnav .wd-title {
  flex: 1 1 auto; min-width: 0; margin: 0; padding: 0;
  font: 800 26px/1 var(--display); letter-spacing: .02em; text-transform: uppercase;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#topnav .wd-links { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#topnav .wd-theme {
  width: 32px; height: 32px; padding: 0; border: 1px solid var(--hair); border-radius: 5px;
  background: transparent; color: var(--ink); font: 16px/1 var(--mono); cursor: pointer;
}
#topnav .wd-theme:hover { border-color: var(--mid); }

/* the screen */
#stage { position: relative; flex: 1 1 auto; min-height: 0; background: var(--screen); overflow: hidden; }
#stage:fullscreen { width: 100%; height: 100%; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#gl.driving { cursor: grabbing; }
#veil {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, rgba(0,0,0,0) 42%, rgba(0,0,0,0.5) 100%);
}
#stage button:focus-visible, #line:focus-visible, #stage label.ver:focus-within, #topnav a:focus-visible, #topnav button:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px;
}

/* the first circle */
#stage #begin {
  position: absolute; left: 50%; top: 50%;
  width: min(30vmin, 168px); height: min(30vmin, 168px);
  transform: translate(-50%, -50%);
  border: 0; padding: 0; border-radius: 50%; margin: 0;
  background: radial-gradient(circle, rgba(8,8,14,0.35) 0%, rgba(8,8,14,0) 70%);
  cursor: pointer;
  transition: opacity 1.2s ease, transform 1.2s ease;
}
#begin svg { width: 100%; height: 100%; display: block; overflow: visible; }
#begin .track { fill: none; stroke: rgba(238,241,234,0.16); stroke-width: 1.5; }
#begin .load {
  fill: none; stroke: var(--chalk); stroke-width: 1.5; stroke-linecap: round;
  stroke-dasharray: 0 100; transform: rotate(-90deg); transform-origin: 60px 60px;
  transition: stroke-dasharray 0.4s ease;
}
#begin .tri { fill: var(--chalk); opacity: 0.25; transition: opacity 0.6s ease; }
#stage #begin.ready .tri { opacity: 0.95; }
#stage #begin.ready:hover .tri { fill: #ffd88a; }
#stage #begin.gone { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(1.25); }
#begin.ready .track { animation: breathe 4.8s ease-in-out infinite; }
@keyframes breathe { 50% { stroke: rgba(238,241,234,0.4); } }

/* the control strip, a panel on the screen */
#bar {
  position: absolute; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(680px, calc(100% - 32px));
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; box-sizing: border-box;
  border-radius: 6px;
  background: rgba(11, 13, 16, 0.62);
  border: 1px solid var(--screen-edge);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
#bar.hide { opacity: 0; transform: translateX(-50%) translateY(8px); pointer-events: none; }
#bar.off { opacity: 0; pointer-events: none; }
#bar .icon {
  flex: none; width: 38px; height: 38px; margin: 0; padding: 0;
  border: 1px solid var(--screen-edge); border-radius: 5px; background: transparent;
  color: var(--chalk); cursor: pointer; display: grid; place-items: center;
}
#bar .icon:hover { border-color: var(--chalk-dim); }
#bar .icon svg { width: 20px; height: 20px; }
#pp .i-play, #pp .i-pause rect { fill: var(--chalk); }
#pp .i-pause { display: none; }
#pp.on .i-play { display: none; }
#pp.on .i-pause { display: inline; }
#fs path { fill: none; stroke: var(--chalk); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#line { flex: 1 1 auto; min-width: 0; height: 38px; position: relative; cursor: pointer; touch-action: none; border-radius: 5px; }
#lineSvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#lineSvg .rail { stroke: rgba(238,241,234,0.24); stroke-width: 1.2; }
#lineSvg .done { stroke: var(--chalk); stroke-width: 1.6; }
#lineSvg .glyph { fill: none; stroke: var(--chalk-dim); stroke-width: 1.3; vector-effect: non-scaling-stroke; opacity: .7; }
#lineSvg .glyph.here { stroke: var(--chalk); opacity: 1; }
#lineSvg .tick { stroke: rgba(238,241,234,0.35); stroke-width: 1; }
#lineSvg .head { fill: var(--chalk); }

#bar .vers { flex: none; display: flex; gap: 4px; }
#bar .ver {
  width: 34px; height: 38px; margin: 0; padding: 0; position: relative; cursor: pointer;
  border: 1px solid transparent; border-radius: 5px; background: transparent;
  display: grid; place-items: center;
}
#bar .ver:hover { border-color: var(--screen-edge); }
#bar .ver[aria-pressed="true"] { background: transparent; border-color: var(--screen-edge); }
.dot { width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; transition: background 0.3s, box-shadow 0.3s, transform 0.3s; }
.d1 { background: var(--past); box-shadow: 0 0 10px var(--past); }
.d2 { background: var(--future); box-shadow: 0 0 10px var(--future); }
.d3 { border: 1.6px solid var(--own); background: transparent; position: relative; }
.d3::before, .d3::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--own); transform: translate(-50%, -50%); }
.d3::before { width: 6px; height: 1.4px; }
.d3::after { width: 1.4px; height: 6px; }
#own.has .d3 { background: var(--own); box-shadow: 0 0 10px var(--own); }
#own.has .d3::before, #own.has .d3::after { display: none; }
#own.busy .d3 { animation: spin 1s linear infinite; border-style: dashed; }
@keyframes spin { to { transform: rotate(360deg); } }
#bar .ver[aria-pressed="true"] .dot { background: transparent; box-shadow: none; border: 1.6px solid var(--chalk-dim); transform: scale(0.85); }
#own input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; margin: 0; }

@media (max-width: 560px) {
  #topnav { gap: 6px 8px; padding-inline: 10px; }
  #topnav .wd-title { display: none; }
  #topnav a { padding: 4px 8px; font-size: 13px; }
  #bar { gap: 2px; padding: 4px 6px; }
  #bar .icon { width: 34px; height: 34px; }
  #bar .ver { width: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  #begin, #bar, .dot { transition: none; }
  #begin.ready .track { animation: none; }
}
