/* ============================================================
   INSTRUMENTS: per-page interaction concepts.
   Each page gets its own movement, inside one visual identity.

     research   : force-field constellation
     technical  : system blueprint / exploded view
   ============================================================ */

/* ============================================================
   1. RESEARCH CONSTELLATION
   ============================================================ */
.cons {
  position: relative;
  height: clamp(420px, 46vw, 560px);
  margin-top: 1rem;
  user-select: none;
}
.cons-edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cons-edges line {
  stroke: var(--rule); stroke-width: 1; opacity: .55;
  transition: stroke .35s var(--ease), stroke-width .35s var(--ease), opacity .35s var(--ease);
}
.cons-edges line.lit { stroke: var(--accent); stroke-width: 1.6; opacity: 1; }
.cons-edges line.dim { opacity: .12; }

.cnode {
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, -50%);
  background: none; border: 1px solid var(--rule); color: var(--ink-soft);
  font: inherit; cursor: pointer; white-space: nowrap; border-radius: 2px;
  padding: .4rem .8rem; will-change: transform;
  transition: border-color .3s var(--ease), color .3s var(--ease),
              background-color .3s var(--ease), opacity .35s var(--ease);
}
.cnode.area {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .16em; text-transform: uppercase;
}
.cnode.proj {
  font-family: var(--display); font-size: 1.02rem; letter-spacing: -.01em;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--rule)); color: var(--ink);
  padding: .45rem .95rem;
}
.cnode:hover, .cnode:focus-visible { border-color: var(--accent); color: var(--accent); }
.cnode.lit { border-color: var(--accent); color: var(--accent); }
.cnode.dim { opacity: .2; }
.cnode.focus {
  background: var(--accent); border-color: var(--accent); color: #12100c;
}

.cons-read {
  position: absolute; left: 0; bottom: -.4rem; max-width: 40ch;
  pointer-events: none; opacity: 0; transform: translateY(6px);
  /* visibility, not just opacity: until a node is picked the readout holds an
     empty link, and hiding it this way keeps that out of the tab order and
     out of the accessibility tree */
  visibility: hidden;
  transition: opacity .4s var(--ease), transform .4s var(--ease), visibility 0s .4s;
}
.cons-read.on { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.cons-read .q {
  font-family: var(--display); font-size: 1.15rem; line-height: 1.2; color: var(--ink);
}
.cons-read .m {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .3rem;
}
.cons-read a { font-size: .8rem; }

.cons-hint {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: .6rem;
}

/* touch / narrow: static readable layout, taps still work */
.cons-fallback { display: none; }
@media (max-width: 820px) {
  .cons { display: none; }
  .cons-fallback { display: block; }
}

/* ============================================================
   2. TECHNICAL BLUEPRINT
   ============================================================ */
.bp-wrap { background: var(--void); color: #e8e4dc; padding: clamp(2.5rem, 6vw, 5rem) 0; }
.bp-wrap .annot { color: #7a8089; }
.bp-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
@media (max-width: 900px) { .bp-grid { grid-template-columns: 1fr; } }

.bp {
  position: relative; aspect-ratio: 1 / .82; min-height: 330px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 2px;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 34px 34px;
}
.bp-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bp-wires path {
  fill: none; stroke: rgba(255,255,255,.17); stroke-width: 1;
  transition: stroke .3s var(--ease), stroke-width .3s var(--ease);
}
.bp-wires path.hot { stroke: var(--accent); stroke-width: 1.5; }
.bp-wires path.pulse {
  stroke: var(--accent); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 16 400; animation: sig 1.1s linear infinite;
}
@keyframes sig { to { stroke-dashoffset: -416; } }

.bnode {
  position: absolute; transform: translate(-50%, -50%);
  background: #0e1014; border: 1px solid rgba(255,255,255,.22); color: #cfd4db;
  font-family: var(--mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .42rem .7rem; border-radius: 2px; cursor: pointer; white-space: nowrap;
  transition: border-color .25s var(--ease), color .25s var(--ease),
              background-color .25s var(--ease), transform .35s var(--ease);
}
.bnode:hover, .bnode:focus-visible, .bnode.on {
  border-color: var(--accent); color: var(--accent); background: #17120c;
}
.bnode.core {
  font-family: var(--display); font-size: .95rem; letter-spacing: 0; text-transform: none;
  color: #fff; border-color: rgba(255,255,255,.4); padding: .55rem 1rem; cursor: default;
  max-width: 11rem; white-space: normal; text-align: center; line-height: 1.25;
}
.bnode.core:hover { border-color: rgba(255,255,255,.4); color: #fff; background: #0e1014; }

.bp-panel { min-height: 300px; }
.bp-panel .k {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .6rem;
}
.bp-panel h3 {
  font-family: var(--display); font-size: clamp(1.5rem, 3.4vw, 2.3rem); line-height: 1.08;
  color: #fff; margin: 0 0 .7rem;
}
.bp-panel p { color: #a7adb6; font-size: .95rem; margin-bottom: .9rem; }
.bp-panel .stack { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.bp-panel .stack span {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .1em;
  border: 1px solid rgba(255,255,255,.18); color: #cfd4db; padding: .2rem .5rem; border-radius: 2px;
}
.bp-panel .used { font-size: .82rem; color: #7a8089; }
.bp-panel .used a { color: #cfd4db; }
.bp-panel .used a:hover { color: var(--accent); }

/* narrow: the schematic becomes a tappable list */
.bp-list { display: none; }
@media (max-width: 700px) {
  .bp { display: none; }
  .bp-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cnode, .cons-edges line, .bnode, .bp-wires path { transition: none !important; }
  .bp-wires path.pulse { animation: none; stroke-dasharray: none; }
  .cons-read { transition: none; }
}

/* ============================================================
   3. PUBLICATIONS: kinetic archive
   Strips, not list items. Hover shifts the title and slides a
   trajectory motif out of the side. Scroll pushes older work back.
   ============================================================ */
.arch { border-top: 1px solid var(--rule); }
.arch .pubrow { border-bottom: 1px solid var(--rule); position: relative; overflow: hidden; }
.arch .pubrow-head {
  grid-template-columns: 5.5rem minmax(0, 1fr) 13rem auto;
  gap: 1.4rem; align-items: baseline; padding: 1.9rem .2rem;
}
@media (max-width: 860px) {
  .arch .pubrow-head { grid-template-columns: 4rem minmax(0,1fr) auto; gap: .5rem 1rem; }
  .arch .pub-venue { grid-column: 2 / -1; }
}
.pub-year {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .16em; color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.arch .pub-title-x {
  margin-bottom: .3rem;
  transition: transform .5s var(--ease), color .35s var(--ease);
}
.arch .pubrow-head:hover .pub-title-x,
.arch .pubrow-head:focus-visible .pub-title-x { transform: translateX(14px); }
.pub-venue { font-size: .8rem; color: var(--ink-faint); line-height: 1.5; }
.pub-venue .status-chip { margin-top: .4rem; }

/* the motif rides in from the right edge on hover */
.pub-motif {
  position: absolute; right: 0; top: 50%; width: 190px; height: 74px;
  transform: translate(26px, -50%); opacity: 0; pointer-events: none;
  transition: transform .55s var(--ease), opacity .45s var(--ease);
}
.pub-motif svg { width: 100%; height: 100%; }
.pub-motif .tr { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round;
  stroke-dasharray: 300; stroke-dashoffset: 300; }
.arch .pubrow:hover .pub-motif, .arch .pubrow:focus-within .pub-motif {
  transform: translate(0, -50%); opacity: .95;
}
.arch .pubrow:hover .pub-motif .tr, .arch .pubrow:focus-within .pub-motif .tr {
  animation: drawTr 1.1s var(--ease) forwards;
}
@keyframes drawTr { to { stroke-dashoffset: 0; } }
@media (max-width: 1050px) { .pub-motif { display: none; } }

/* depth: entries sitting higher up the archive recede */
.arch .pubrow { --depth: 0; }
.arch .pubrow > .pubrow-head {
  transform: scale(calc(1 - var(--depth) * .022));
  opacity: calc(1 - var(--depth) * .3);
  transform-origin: left center;
  transition: transform .5s var(--ease), opacity .5s var(--ease);
}

/* ============================================================
   4. BACKGROUND: travelling timeline
   Vertical scrolling drives horizontal travel along one path.
   ============================================================ */
.trav-wrap { position: relative; }
.trav-stage {
  position: sticky; top: 0; height: 100svh; height: 100vh;
  display: flex; align-items: center; overflow: hidden;
}
.trav-rail { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--rule); }
.trav-track {
  display: flex; align-items: center; gap: clamp(3rem, 9vw, 8rem);
  padding: 0 46vw; will-change: transform;
}
.tstop { position: relative; flex: none; width: clamp(200px, 21vw, 280px); }
.tstop::before {
  content: ""; position: absolute; left: 0; top: -1.15rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--ink-faint);
  transform: translateY(-50%); transition: all .45s var(--ease);
}
.tstop.live::before {
  border-color: var(--accent); background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
}
.tstop .when {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .18em; color: var(--ink-faint);
  display: block; margin-bottom: .5rem;
}
.tstop .what {
  font-family: var(--display); font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.12;
  color: var(--ink); display: block; margin-bottom: .45rem;
}
.tstop .why {
  font-size: .85rem; color: var(--ink-soft); line-height: 1.55;
  opacity: 0; transform: translateY(6px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.tstop.live .why { opacity: 1; transform: none; }
.tstop { opacity: .32; transition: opacity .45s var(--ease); }
.tstop.live { opacity: 1; }

.trav-hint {
  position: absolute; left: 0; bottom: 12%;
  font-family: var(--mono); font-size: .58rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-faint);
}

/* phones and reduced motion: an ordinary readable list */
.trav-fallback { display: none; }
@media (max-width: 820px) {
  .trav-wrap { height: auto !important; }
  .trav-stage { position: static; height: auto; display: block; }
  .trav-rail, .trav-hint { display: none; }
  .trav-track { display: block; padding: 0; }
  .tstop { width: auto; opacity: 1; padding: .9rem 0 .9rem 1.3rem; border-left: 1px solid var(--rule); }
  .tstop::before { left: -5px; top: 1.6rem; }
  .tstop .why { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .trav-wrap { height: auto !important; }
  .trav-stage { position: static; height: auto; display: block; }
  .trav-track { display: block; padding: 0; }
  .trav-rail, .trav-hint { display: none; }
  .tstop { width: auto; opacity: 1; padding: .9rem 0 .9rem 1.3rem; border-left: 1px solid var(--rule); }
  .tstop::before { left: -5px; top: 1.6rem; }
  .tstop .why { opacity: 1; transform: none; }
  .pub-motif, .arch .pub-title-x, .arch .pubrow > .pubrow-head { transition: none !important; }
  .arch .pubrow:hover .pub-motif .tr { animation: none; stroke-dashoffset: 0; }
}

/* ============================================================
   5. CV: structured living document
   Fixed index, dates on a rail, precise mechanical reveals.
   ============================================================ */
.cv-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
@media (max-width: 900px) { .cv-grid { grid-template-columns: 1fr; gap: 1.6rem; } }

.cv-index { position: sticky; top: 90px; display: flex; flex-direction: column; gap: .55rem; }
@media (max-width: 900px) { .cv-index { position: static; flex-direction: row; flex-wrap: wrap; gap: .4rem 1rem; } }
.cv-index a {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint); text-decoration: none; display: flex; align-items: center; gap: .5rem;
  transition: color .3s var(--ease);
}
.cv-index a s { width: 8px; height: 1px; background: currentColor; text-decoration: none; transition: width .4s var(--ease); }
.cv-index a:hover { color: var(--ink); }
.cv-index a.on { color: var(--accent); }
.cv-index a.on s { width: 22px; }
.cv-dl {
  margin-top: 1.4rem; display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--accent); color: var(--accent); background: none;
  padding: .5rem .85rem; border-radius: 2px; text-decoration: none;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.cv-dl:hover { background: var(--accent); color: #17120c; }

.cv-sec { padding: 0 0 2.6rem; }
.cv-sec > h2 {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 400; margin: 0 0 1.1rem;
  padding-bottom: .6rem; border-bottom: 1px solid var(--rule);
}
.cv-item {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.2rem;
  padding: .95rem 0; border-bottom: 1px dotted var(--rule); position: relative;
}
.cv-item:last-child { border-bottom: 0; }
@media (max-width: 620px) { .cv-item { grid-template-columns: 1fr; gap: .2rem; } }
.cv-when {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; color: var(--ink-faint);
  font-variant-numeric: tabular-nums; padding-top: .35rem;
}
.cv-what { font-family: var(--display); font-size: 1.15rem; line-height: 1.16; color: var(--ink); }
.cv-where { font-size: .86rem; color: var(--ink-soft); margin-top: .18rem; }
.cv-note { font-size: .86rem; color: var(--ink-faint); margin-top: .3rem; }
.cv-item[data-peek] { cursor: default; }
.cv-item[data-peek]::after {
  content: ""; position: absolute; left: -1rem; top: 1.1rem; width: 2px; height: 0;
  background: var(--accent); transition: height .35s var(--ease);
}
.cv-item[data-peek]:hover::after, .cv-item[data-peek]:focus-within::after { height: calc(100% - 1.8rem); }

.peek {
  position: fixed; z-index: 70; width: 230px; pointer-events: none;
  background: var(--card); border: 1px solid var(--accent); border-radius: 2px;
  padding: .75rem .85rem; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(6px); transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.peek.on { opacity: 1; transform: none; }
.peek .k { font-family: var(--mono); font-size: .54rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.peek .t { font-family: var(--display); font-size: 1rem; color: var(--ink); margin: .25rem 0; }
.peek .d { font-size: .78rem; color: var(--ink-soft); line-height: 1.45; }
@media (max-width: 900px) { .peek { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .cv-index a s, .cv-item[data-peek]::after, .peek { transition: none; }
}

/* ============================================================
   4b. BACKGROUND: rotating globe
   The trajectory is literal: the places the work happened in.
   Replaces the horizontal track, which needed too much scrolling.
   ============================================================ */
.globe-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
@media (max-width: 900px) { .globe-wrap { grid-template-columns: 1fr; } }

.globe-stage {
  position: relative; aspect-ratio: 1; max-width: 520px; width: 100%;
  touch-action: none; cursor: grab;
}
.globe-stage:active { cursor: grabbing; }
.globe-stage canvas { width: 100%; height: 100%; display: block; }
.globe-hint {
  position: absolute; left: 0; bottom: 2%;
  font-family: var(--mono); font-size: .56rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-faint); pointer-events: none;
}

.globe-panel { min-height: 240px; }
.globe-panel .place {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .5rem;
}
.globe-panel h3 {
  font-family: var(--display); font-size: clamp(1.6rem, 3.6vw, 2.6rem); line-height: 1.05;
  color: var(--ink); margin: 0 0 1.1rem;
}
.gstop { padding: .7rem 0; border-top: 1px dotted var(--rule); }
.gstop .when { font-family: var(--mono); font-size: .6rem; letter-spacing: .14em; color: var(--ink-faint); display: block; }
.gstop .what { font-family: var(--display); font-size: 1.08rem; color: var(--ink); display: block; margin: .15rem 0 .2rem; }
.gstop .why { font-size: .85rem; color: var(--ink-soft); margin: 0; line-height: 1.5; }

.globe-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.2rem; }
.globe-tab {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--rule); background: none; color: var(--ink-soft);
  padding: .32rem .65rem; border-radius: 2px; cursor: pointer;
  transition: border-color .25s var(--ease), color .25s var(--ease), background-color .25s var(--ease);
}
.globe-tab:hover { border-color: var(--ink-faint); color: var(--ink); }
.globe-tab[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* the accessible source of truth; shown when the globe cannot be */
.globe-list { list-style: none; margin: 1.4rem 0 0; padding: 0; display: none; }
.globe-list li { padding: .7rem 0; border-top: 1px dotted var(--rule); }
.globe-list .when { font-family: var(--mono); font-size: .6rem; letter-spacing: .14em; color: var(--ink-faint); display: block; }
.globe-list .what { font-family: var(--display); font-size: 1.05rem; color: var(--ink); display: block; margin: .15rem 0 .2rem; }
.globe-list .why { font-size: .85rem; color: var(--ink-soft); margin: 0; }
.no-js .globe-list { display: block; }

@media (prefers-reduced-motion: reduce) { .globe-tab { transition: none; } }

/* the panel can run longer than the globe; keep the globe in view while reading */
@media (min-width: 901px) {
  .globe-wrap { align-items: start; }
  .globe-stage { position: sticky; top: 92px; }
}

/* ---- globe: chapters as clickable topics ---- */
.gtopic { border-top: 1px dotted var(--rule); }
.gtopic:first-child { border-top: 0; }
.gtopic-head {
  display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; gap: .9rem; align-items: baseline;
  width: 100%; text-align: left; background: none; border: 0; font: inherit; color: inherit;
  padding: .75rem 0; cursor: pointer;
}
@media (max-width: 520px) { .gtopic-head { grid-template-columns: minmax(0,1fr) auto; } .gtopic-head .when { grid-column: 1 / -1; } }
.gtopic-head .when { font-family: var(--mono); font-size: .6rem; letter-spacing: .14em; color: var(--ink-faint); }
.gtopic-head .what { font-family: var(--display); font-size: 1.08rem; line-height: 1.15; color: var(--ink); transition: color .25s var(--ease); }
.gtopic-head:hover .what { color: var(--accent); }
.gtopic-mark {
  width: 18px; height: 18px; border: 1px solid var(--rule); border-radius: 2px;
  display: grid; place-items: center; color: var(--ink-faint); flex: none;
  transition: transform .3s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.gtopic-mark::before { content: "+"; font-family: var(--mono); font-size: .7rem; line-height: 1; }
.gtopic.open .gtopic-mark { transform: rotate(45deg); border-color: var(--accent); color: var(--accent); }
.gtopic-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s var(--ease); }
.gtopic.open .gtopic-body { grid-template-rows: 1fr; }
.gtopic-body > div { overflow: hidden; min-height: 0; }
.gtopic-body p { font-size: .88rem; color: var(--ink-soft); line-height: 1.55; margin: 0 0 .85rem; padding-left: 7.9rem; }
@media (max-width: 520px) { .gtopic-body p { padding-left: 0; } }
.globe-panel .place.origin { color: #cf2e4a; }
@media (prefers-reduced-motion: reduce) { .gtopic-body, .gtopic-mark, .gtopic-head .what { transition: none; } }

/* globe panel: one chapter at a time */
.globe-panel .gwhy { font-size: .92rem; color: var(--ink-soft); line-height: 1.6; margin: 0 0 1rem; }
.globe-panel .gcount {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .18em; color: var(--ink-faint);
  padding-top: .7rem; border-top: 1px solid var(--rule);
}

/* ---- globe chips: bolder, and a bit more fun ---- */
.globe-tabs { gap: .45rem; }
.globe-tab {
  --c: var(--accent);
  position: relative; display: inline-flex; align-items: center; gap: .45rem;
  font-size: .62rem; font-weight: 500; letter-spacing: .12em;
  padding: .46rem .8rem .46rem .6rem; border-radius: 3px; overflow: hidden;
  transition: transform .22s var(--snap), border-color .22s var(--ease),
              color .22s var(--ease), background-color .22s var(--ease);
}
.globe-tab .gdot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none;
  transition: transform .25s var(--snap), box-shadow .25s var(--ease);
}
.globe-tab .gnum { font-weight: 400; opacity: .45; font-variant-numeric: tabular-nums; }
.globe-tab:hover {
  transform: translateY(-2px);
  border-color: var(--c); color: var(--ink);
  background: color-mix(in srgb, var(--c) 12%, transparent);
}
.globe-tab:hover .gdot { transform: scale(1.35); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.globe-tab:active { transform: translateY(0) scale(.97); }
.globe-tab[aria-pressed="true"] {
  background: var(--c); border-color: var(--c); color: #17120c; transform: none;
}
.globe-tab[aria-pressed="true"] .gnum { opacity: .6; }
.globe-tab[aria-pressed="true"] .gdot { background: #17120c; box-shadow: none; }

/* the panel headline carries the chapter's colour */
.globe-panel h3 { font-size: clamp(1.7rem, 3.8vw, 2.7rem); }
.globe-panel .place { font-size: .62rem; font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  .globe-tab, .globe-tab .gdot { transition: none; }
  .globe-tab:hover { transform: none; }
}

/* ============================================================
   WORK: four projects, four instruments
   ============================================================ */
.work-nav {
  position: sticky; top: 54px; z-index: 40; background: var(--paper);
  border-bottom: 1px solid var(--rule); margin-bottom: 2.5rem;
}
.work-nav .wrap { display: flex; flex-wrap: wrap; gap: .3rem; padding-top: .55rem; padding-bottom: .55rem; }
.work-nav a {
  display: inline-flex; align-items: center; gap: .45rem; text-decoration: none;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); border: 1px solid transparent; border-radius: 3px; padding: .34rem .7rem;
  transition: color .22s var(--ease), border-color .22s var(--ease), background-color .22s var(--ease);
}
.work-nav a i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.work-nav a:hover { color: var(--ink); border-color: var(--rule); }
.work-nav a.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.work-nav a.on i { opacity: 1; }

.proj { padding: 0 0 clamp(3.5rem, 8vw, 6rem); scroll-margin-top: 130px; }
.proj-head { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 2rem; align-items: end; margin-bottom: 1.6rem; }
@media (max-width: 820px) { .proj-head { grid-template-columns: 1fr; gap: .8rem; } }
.proj-head h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.02; margin: .3rem 0 .5rem; }
.proj-q { font-family: var(--sans); font-size: .95rem; color: var(--ink-faint); max-width: 52ch; }
.proj-meta { display: flex; flex-direction: column; gap: .5rem; }
.proj-meta div { font-size: .85rem; }
.proj-meta .k { font-family: var(--mono); font-size: .56rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); }

.instr { border: 1px solid var(--rule); border-radius: 3px; background: var(--void); overflow: hidden; margin-bottom: 1.6rem; }
.instr-stage { position: relative; aspect-ratio: 16 / 7; }
.instr-stage canvas { display: block; width: 100%; height: 100%; }
.instr-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  padding: .7rem .9rem; border-top: 1px solid rgba(255,255,255,.1); background: #0d0f13;
}
.instr-label {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .16em; text-transform: uppercase;
  color: #7a8089; margin-right: auto;
}
.instr-note { font-size: .85rem; color: var(--ink-faint); margin: 0 0 1.6rem; }

.proj-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.6rem 2rem; }
.proj-body h3 {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 400; margin: 0 0 .5rem;
}
.proj-body p { font-size: .92rem; color: var(--ink-soft); margin: 0 0 .8rem; }
.proj-body strong { color: var(--ink); font-weight: 600; }

/* ---- scrub instrument ---- */
.scrub { padding: 1.4rem 1.1rem 1.1rem; }
.scrub-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: 1rem; }
.sframe {
  border: 1px solid rgba(255,255,255,.14); border-radius: 2px; background: #0d0f13;
  padding: .8rem .7rem; cursor: pointer; text-align: left; color: #7a8089;
  font-family: var(--mono); font-size: .56rem; letter-spacing: .14em; text-transform: uppercase;
  transition: border-color .3s var(--ease), color .3s var(--ease), background-color .3s var(--ease), transform .3s var(--ease);
}
.sframe .big { display: block; font-family: var(--display); font-size: 1.5rem; letter-spacing: 0; text-transform: none; color: #4a5059; margin-bottom: .3rem; transition: color .3s var(--ease); }
.sframe.on { border-color: rgba(232,135,58,.5); color: #b9bec6; }
.sframe.on .big { color: var(--accent); }
.sframe.now { border-color: var(--accent); background: #17120c; transform: translateY(-3px); color: #fff; }
.scrub-rail { position: relative; height: 2px; background: rgba(255,255,255,.12); margin: 0 0 .9rem; }
.scrub-handle { position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%); transition: left .32s var(--ease); }
.scrub input[type="range"] { width: 100%; accent-color: var(--accent); }
.scrub-caption { font-size: .9rem; color: #b9bec6; display: flex; gap: .6rem; align-items: baseline; }
.scrub-caption .n { font-family: var(--mono); font-size: .58rem; letter-spacing: .16em; color: var(--accent); }
@media (max-width: 620px) { .scrub-track { grid-template-columns: repeat(2, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  .frame, .scrub-handle, .work-nav a { transition: none; }
  .sframe.now { transform: none; }
}

/* ============================================================
   LIVE DEMO: the real tool, running on the page
   The screenshot is the default. React loads only when someone
   asks for it, so the page costs nothing until then.
   ============================================================ */
.live { position: relative; }
.live-idle {
  display: grid; place-items: center; gap: 1rem;
  min-height: 300px; background: #0c0e12;
}
.live-idle-label {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: #6b717b;
}
.live.is-on .live-idle { display: none; }
.live-launch { position: static; transform: none; }
.live-launch:hover { transform: translateY(-2px); }
.live-launch:active { transform: scale(.97); }
.live-launch {
  position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
  background: var(--accent); color: #17120c; border: 0; border-radius: 3px;
  padding: .6rem 1.1rem; box-shadow: 0 10px 30px -12px rgba(0,0,0,.5);
  transition: transform .2s var(--snap), filter .2s var(--ease);
}
.live-launch:hover { filter: brightness(1.08); transform: translateX(-50%) translateY(-2px); }
.live-launch:active { transform: translateX(-50%) scale(.97); }
.live-launch[disabled] { opacity: .6; cursor: default; }

/* Shown as the device it is used on: a phone sized screen on the dark
   panel. Scrolling inside it reads as a phone rather than as a scrollbox
   embedded in a page. */
.live-host { display: none; background: #0c0e12; padding: 26px 14px; }
.live.is-on .live-host { display: flex; justify-content: center; }
.live-host > div {
  width: 390px; max-width: 100% !important;
  height: 760px; overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border-radius: 26px;
  padding: 16px 12px !important;
  box-shadow: 0 0 0 9px #1b1f26, 0 0 0 10px #2b313a, 0 30px 70px -28px rgba(0,0,0,.85);
  scrollbar-width: thin;
}
@media (max-width: 460px) {
  .live-host { padding: 14px 6px; }
  .live-host > div { height: 620px; border-radius: 20px; box-shadow: 0 0 0 5px #1b1f26; }
}
.live.is-on .live-host { display: block; }
.live.is-on .live-shot, .live.is-on .live-launch { display: none; }
.live-host .step-section { margin: 0 0 14px; }
.live-host .entity-btn { cursor: pointer; }

.live-bar {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  padding: .7rem .9rem; border-top: 1px solid rgba(255,255,255,.1); background: #0d0f13;
}
.live-bar .instr-label { margin-right: auto; }
.live-reset {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase;
  background: none; border: 1px solid rgba(255,255,255,.2); color: #9aa0aa;
  border-radius: 3px; padding: .32rem .6rem; cursor: pointer;
}
.live-reset:hover { color: #fff; border-color: #fff; }
@media (prefers-reduced-motion: reduce) { .live-launch { transition: none; } }
