/* The drawing board: adapted from "Flat to 3D" by Samnang Aing (MIT, see LICENSE-flat-to-3d.txt). */
:root {
  --paper: #f2efe7;
  --paper-hi: #f8f6ef;
  --ink: #1d1c19;
  --ink-line: rgba(29, 28, 25, 0.24);
  --ink-faint: rgba(29, 28, 25, 0.11);
  --mute: #6b665c;
  --accent: #B8892B;
  --accent-hi: #E5C76B;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --display: 'Chakra Petch', sans-serif;
  --sans: 'Inter', sans-serif;
  --serif: 'Cormorant Garamond', serif;
}
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .24; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .42  0 0 0 0 .38  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* CAD sheet registration frame & corner brackets */
#cad-frame {
  position: absolute; inset: 12px; pointer-events: none; z-index: 1;
  border: 1px solid rgba(29, 28, 25, 0.16);
}
#cad-frame .c { position: absolute; width: 14px; height: 14px; border-color: rgba(29, 28, 25, 0.65); border-style: solid; }
#cad-frame .tl { top: -1px; left: -1px; border-width: 1.5px 0 0 1.5px; }
#cad-frame .tr { top: -1px; right: -1px; border-width: 1.5px 1.5px 0 0; }
#cad-frame .bl { bottom: -1px; left: -1px; border-width: 0 0 1.5px 1.5px; }
#cad-frame .br { bottom: -1px; right: -1px; border-width: 0 1.5px 1.5px 0; }
#cad-frame .reg {
  position: absolute; font-family: var(--mono); font-size: 9px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--mute); background: var(--paper); padding: 0 8px;
}
#cad-frame .reg-t { top: -6px; left: 50%; transform: translateX(-50%); }
#cad-frame .reg-r { right: -92px; top: 50%; transform: translateY(-50%) rotate(90deg); }

#leaders { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 2; }
#labels { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
#ui { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
#ui a, #ui #cad-map.interactive { pointer-events: auto; }

/* Hero specification block */
#hero { position: absolute; left: 30px; top: 104px; width: 32vw; max-width: 470px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px; padding: 4px 10px;
  background: rgba(242, 239, 231, 0.92);
  border: 1px solid rgba(184, 137, 43, 0.35);
  border-left: 3px solid var(--accent);
}
#hero h1 {
  font: 600 clamp(40px, 4vw, 62px)/0.98 var(--serif);
  letter-spacing: -.005em; margin: 0; color: var(--ink);
}
#hero h1 em {
  font-style: normal; color: var(--accent);
  background: rgba(184, 137, 43, 0.1); padding: 0 8px; border-left: 3px solid var(--accent);
}
#lede {
  margin-top: 16px;
  font: 500 10.5px/1.65 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  max-width: 345px; color: var(--ink);
  background: rgba(242, 239, 231, 0.88);
  padding: 8px 12px; border-left: 2px solid var(--ink);
}
#spec {
  margin-top: 18px; display: grid; grid-template-columns: auto 1fr; gap: 0;
  width: max-content; min-width: 280px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .11em; text-transform: uppercase;
  border: 1.5px solid var(--ink);
  background: rgba(242, 239, 231, 0.94);
}
#spec dt, #spec dd { padding: 6px 13px; border-bottom: 1px solid var(--ink-line); }
#spec dt:last-of-type, #spec dd:last-of-type { border-bottom: none; }
#spec dt { color: var(--mute); border-right: 1px solid var(--ink-line); background: rgba(29, 28, 25, 0.04); font-weight: 500; }
#spec dd { color: var(--ink); font-weight: 600; }

/* Bottom CAD status bar */
.bottom {
  position: absolute; left: 30px; right: 30px; bottom: 20px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
}
.hint-wrap, .cam-readout, #counter:not(:empty) {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--paper);
  padding: 6px 12px;
}
.hint-wrap {
  background: rgba(242, 239, 231, 0.92); color: var(--ink);
  border: 1px solid rgba(29, 28, 25, 0.25);
}
.hint-dot {
  width: 6px; height: 6px; background: var(--accent); display: inline-block;
}
.hint-wrap { transition: opacity .6s ease; }

/* The big scroll cue: a mouse with a rolling wheel, a dark pill and two chevrons, until people start scrolling */
#cue {
  position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  opacity: 0; pointer-events: none;
}
#cue .cue-mouse {
  width: 30px; height: 48px; border: 2px solid var(--ink); border-radius: 16px;
  background: rgba(242, 239, 231, 0.9); position: relative;
}
#cue .cue-mouse i {
  position: absolute; left: 50%; top: 9px; width: 4px; height: 10px; margin-left: -2px;
  border-radius: 2px; background: var(--accent); animation: cue-wheel 1.6s ease-in-out infinite;
}
#cue .cue-t {
  font: 600 14px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; white-space: nowrap;
  background: var(--ink); color: var(--paper); padding: 14px 26px;
  border: 1px solid var(--accent); animation: cue-pulse 2s ease-out infinite;
}
#cue .cue-chev { display: flex; flex-direction: column; align-items: center; margin-top: -2px; }
#cue .cue-chev i {
  width: 14px; height: 14px; border-right: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent);
  transform: rotate(45deg); margin-top: -6px; animation: cue-chev 1.6s ease-in-out infinite;
}
#cue .cue-chev i:nth-child(2) { animation-delay: .2s; }
@keyframes cue-wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { transform: translateY(0); opacity: 0; } }
@keyframes cue-pulse { 0% { box-shadow: 0 0 0 0 rgba(184, 137, 43, 0.55); } 100% { box-shadow: 0 0 0 16px rgba(184, 137, 43, 0); } }
@keyframes cue-chev { 0%, 100% { opacity: .25; transform: translateY(-3px) rotate(45deg); } 50% { opacity: 1; transform: translateY(4px) rotate(45deg); } }
@media (prefers-reduced-motion: reduce) { #cue .cue-mouse i, #cue .cue-t, #cue .cue-chev i { animation: none; } }
.cam-readout { font-size: 10px; letter-spacing: .14em; color: rgba(242, 239, 231, 0.78); }
.cam-readout b { color: var(--accent-hi); font-weight: 600; }
#counter b { color: var(--accent-hi); font-weight: 600; margin: 0 3px; }

/* Stage / Room callout card (matches 10 Section Sweep v4 .room) */
#caption {
  position: absolute; left: 30px; bottom: 58px;
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(29, 28, 25, 0.93); color: var(--paper);
  padding: 14px 18px;
  border: none; border-left: 3px solid var(--accent); border-radius: 0;
  font-family: var(--mono); text-transform: uppercase; opacity: 0;
  z-index: 3;
}
#caption .lv {
  font: 600 10px var(--mono); letter-spacing: .14em; color: var(--accent-hi); display: block;
}
#caption .t {
  font: 600 30px/1 var(--display); text-transform: uppercase; letter-spacing: .01em;
  color: var(--paper); display: block; padding: 0; margin: 0; border: none;
}
#caption .m {
  font: 400 10px var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: rgba(242, 239, 231, 0.82); display: block;
}

/* Interactive Bottom-Right CAD Radar (#cad-map) */
#cad-map {
  position: absolute; right: 30px; bottom: 58px; width: 256px;
  background: rgba(29, 28, 25, 0.93); color: var(--paper);
  border: 1px solid var(--accent);
  padding: 8px 10px;
  font: 500 8.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  opacity: 0; z-index: 3; pointer-events: none; user-select: none;
}
#cad-map .cm-head {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--paper); margin-bottom: 4px;
}
#cad-map #cm-scale { color: var(--accent-hi); font-weight: 600; }
#cad-map svg {
  width: 100%; height: var(--cm-h, 68px); display: block; overflow: visible;
}
#cad-map .cm-zone {
  fill: rgba(184, 137, 43, 0.0); stroke: none; cursor: pointer;
  transition: fill .15s ease;
}
#cad-map .cm-zone.active {
  fill: rgba(184, 137, 43, 0.18); stroke: rgba(184, 137, 43, 0.55); stroke-width: 0.16;
}
#cad-map .cm-zone:hover {
  fill: rgba(184, 137, 43, 0.34); stroke: var(--accent-hi); stroke-width: 0.22;
}
#cad-map .cm-stops {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px;
  margin-top: 6px; padding-top: 5px;
  border-top: 1px solid rgba(242, 239, 231, 0.16);
}
#cad-map .cm-btn {
  appearance: none; background: rgba(242, 239, 231, 0.06);
  border: 1px solid rgba(242, 239, 231, 0.18);
  color: rgba(242, 239, 231, 0.78);
  font: 600 7.5px/1 var(--mono); letter-spacing: .02em; text-transform: uppercase;
  padding: 4px 2px; cursor: pointer; text-align: center;
  transition: background .14s, color .14s, border-color .14s;
}
#cad-map .cm-btn:hover {
  background: rgba(184, 137, 43, 0.28); color: var(--paper); border-color: var(--accent-hi);
}
#cad-map .cm-btn.active {
  background: var(--accent); color: var(--paper); border-color: var(--accent);
}

/* Exploded layer & material callout labels */
.lab {
  position: absolute; left: 0; top: 0;
  font-family: var(--mono); text-transform: uppercase; white-space: nowrap;
  will-change: transform, opacity;
}
.lab:not(.tag) {
  background: rgba(242, 239, 231, 0.94);
  border: 1px solid rgba(29, 28, 25, 0.34);
  border-left: 3px solid var(--ink);
  padding: 5px 11px 5px 8px;
  margin: -6px 0 0 -4px;
  border-radius: 0;
}
.lab:not(.tag).on {
  border-color: var(--ink);
  border-left-color: var(--accent);
  background: var(--ink);
  color: var(--paper);
}
.lab .no {
  color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: .12em;
  margin-right: 8px; padding: 1px 5px;
  background: rgba(184, 137, 43, 0.12);
  border: 1px solid rgba(184, 137, 43, 0.3);
}
.lab.on .no { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.lab .nm { font-family: var(--display); font-size: 13px; font-weight: 600; letter-spacing: .12em; color: var(--ink); }
.lab.on .nm { color: var(--accent-hi); }
.lab .sb { display: block; margin-top: 3px; font-size: 9.5px; letter-spacing: .1em; color: var(--mute); }
.lab.on .sb { color: rgba(242, 239, 231, 0.78); }
.lab.tag { text-align: left; }

.lab.code { font-size: 10px; }
.lab.code .no {
  font-size: 10px; margin: 0;
  background: rgba(29, 28, 25, 0.92);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-left: 2.5px solid var(--accent);
  padding: 2px 6px; border-radius: 0;
}

/* SVG Leader lines & target reticles */
#leaders polyline { fill: none; stroke: var(--ink); stroke-width: 1.1; }
#leaders polyline.halo { stroke: var(--paper); stroke-width: 4.5; stroke-linecap: square; opacity: .92; }
#leaders circle.halo { fill: var(--paper); }
#leaders .on polyline.halo { stroke: var(--paper); }
#leaders .on circle.halo { fill: var(--paper); }
#leaders circle.dot { fill: var(--ink); }
#leaders circle.reticle { fill: none; stroke: var(--ink); stroke-width: 0.9; opacity: 0.55; }
#leaders line.tick { stroke: var(--ink); stroke-width: 1.4; }
#leaders .on polyline { stroke: var(--accent); stroke-width: 1.35; }
#leaders .on circle.dot { fill: var(--accent); }
#leaders .on circle.reticle { stroke: var(--accent); opacity: 0.9; }
#leaders .on line.tick { stroke: var(--accent); }

body.dark { --ink: #f2efe7; --mute: #b9b3a6; }

#fade { position: absolute; inset: 0; background: #12110f; pointer-events: none; z-index: 10; }
#loader {
  position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  min-width: 260px; padding: 11px 16px 12px;
  background: rgba(29, 28, 25, 0.94);
  border: 1px solid var(--accent);
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--paper); pointer-events: none; z-index: 9;
}
#loader .lhead {
  display: flex; justify-content: space-between; font-size: 9px; color: rgba(242, 239, 231, 0.65);
  border-bottom: 1px solid rgba(242, 239, 231, 0.16); padding-bottom: 5px; letter-spacing: .14em;
}
#loader .lhead #lpen { color: var(--accent-hi); font-weight: 600; }
#loader #ltext { font-weight: 600; text-align: center; padding: 2px 0; }
#loader i { display: block; width: 100%; height: 3px; background: rgba(242, 239, 231, 0.16); }
#loader b { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

#hero h1 .ln { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
#hero h1 .ln > span { display: block; transform: translateY(125%); opacity: 0; will-change: transform; }

/* Phone layout */
body.phone #cad-frame { inset: 8px; }
body.phone #cad-frame .reg { display: none; }
body.phone #hero { top: 84px; left: 16px; width: calc(100vw - 32px); max-width: none; }
body.phone .kicker { margin-bottom: 10px; font-size: 9px; padding: 3px 8px; }
body.phone #hero h1 { font-size: 34px; }
body.phone #lede { margin-top: 10px; font-size: 9.5px; line-height: 1.5; max-width: 290px; padding: 6px 10px; }
body.phone #spec { display: none; }
body.phone .bottom { left: 16px; right: 16px; bottom: 14px; font-size: 9px; }
body.phone .cam-readout { display: none; }
body.phone .hint-wrap, body.phone #counter:not(:empty) { padding: 4px 8px; }
body.phone #loader { bottom: 42px; min-width: 220px; padding: 9px 12px; }
body.phone #cue { bottom: 172px; gap: 9px; }
body.phone #cue .cue-mouse { width: 24px; height: 38px; }
body.phone #cue .cue-t { font-size: 11.5px; padding: 11px 18px; letter-spacing: .2em; }
body.phone #caption { left: 16px; bottom: 48px; padding: 10px 13px; max-width: calc(100vw - 178px); }
body.phone #caption .t { font-size: 20px; }
body.phone #caption .lv, body.phone #caption .m { font-size: 8px; letter-spacing: .1em; }
body.phone #cad-map { right: 16px; bottom: 48px; width: 142px; padding: 6px 8px; font-size: 7.5px; }
body.phone #cad-map svg { height: var(--cm-hp, 48px); }
body.phone #cad-map .cm-stops { display: none; }
body.phone .lab:not(.tag) { padding: 3px 7px 3px 5px; margin: -4px 0 0 -3px; }
body.phone .lab .sb { display: none; }
body.phone .lab .nm { font-size: 10.5px; letter-spacing: .09em; }
body.phone .lab .no { font-size: 9px; margin-right: 5px; padding: 1px 4px; }
.lab .nm-s { display: none; font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: .09em; }
body.phone .lab.has-s .nm { display: none; }
body.phone .lab .nm-s { display: inline; }
body.phone .lab.on .nm-s { color: var(--accent-hi); }

.bottom span { transition: none; }
#legend { display: none; }
body.phone #legend {
  display: block; position: absolute; left: 16px; right: 16px; bottom: 46px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .11em; text-transform: uppercase; line-height: 1.6;
  background: rgba(29, 28, 25, 0.92); color: var(--paper); border-left: 3px solid var(--accent); padding: 5px 8px;
}
body.phone #legend:empty { display: none; }
#legend b { color: var(--accent-hi); font-weight: 600; }
body.phone .lab.tag { display: none; }


