/* ==========================================================
   HOME HERO — the workbench (studio.js)
   Full-viewport WebGL scene, the intro copy on top, five numbered
   hotspots joined to their props by leader lines, and a side panel.
   Colours come from the site tokens so the day/night theme just works.
   Without WebGL (no .is-3d) the same markup is a poster and a list.
   ========================================================== */

.studio {
  position: relative;
  z-index: 2; /* the side panel and hotspots sit above the sections that follow */
  --studio-pad: calc(var(--gutter) + clamp(14px, 3vw, 48px));
  --card-w: 360px; /* the station card; CARD_W in studio.js must match */
}

.studio-stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--paper-2);
  isolation: isolate;
}

/* ---------- Scene layer ---------- */

/* A soft wash of the page colour behind the copy keeps it readable over the scene; a second one
   along the top keeps the transparent header's nav and the sheet's meta line readable over the ceiling */
.studio-view::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1; /* above the canvas, below the hotspot labels */
  pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper) 90%, transparent) 0, color-mix(in srgb, var(--paper) 72%, transparent) calc(var(--header-h) + 12px), transparent calc(var(--header-h) + 72px)),
    linear-gradient(90deg, var(--paper) 0%, color-mix(in srgb, var(--paper) 94%, transparent) 36%, color-mix(in srgb, var(--paper) 70%, transparent) 50%, color-mix(in srgb, var(--paper) 24%, transparent) 62%, transparent 74%);
  transition: opacity 0.6s;
}
.studio.is-focus .studio-view::before {
  opacity: 0;
}

.studio-view {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.studio-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  outline: none;
  opacity: 0;
}
.studio.is-ready .studio-canvas {
  opacity: 1;
}
.studio-poster {
  position: absolute;
  inset: 0;
  display: block;
}
.studio-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 62% 50%;
}
.studio-poster-night {
  display: none !important;
}
:root[data-theme="dark"] .studio-poster-night {
  display: block !important;
}
:root[data-theme="dark"] .studio-poster-day {
  display: none;
}
.studio.is-3d .studio-poster {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s;
}
.studio.is-3d:not(.is-ready) .studio-poster {
  opacity: 0.55;
}

/* Sheet frame and meta: engineering-drawing furniture */
.studio {
  --bench: 0;
  --frame-x: calc(var(--gutter) * (1 - var(--bench)) + 8px * var(--bench));
  --frame-top: calc((var(--header-h) + 8px) * (1 - var(--bench)) + 6px * var(--bench));
  --frame-bottom: calc(20px * (1 - var(--bench)) + 8px * var(--bench));
}
.studio-sheet {
  position: absolute;
  inset: var(--frame-top) var(--frame-x) var(--frame-bottom);
  border: 1px solid var(--rule);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.3s;
}
.studio-sheet i {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid var(--ink);
}
.studio-sheet i:nth-child(1) { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.studio-sheet i:nth-child(2) { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.studio-sheet i:nth-child(3) { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.studio-sheet i:nth-child(4) { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.studio-meta {
  position: absolute;
  top: calc(var(--frame-top) + 10px);
  left: calc(var(--frame-x) + 14px);
  right: calc(var(--frame-x) + 14px);
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  color: var(--ink-3);
  pointer-events: none;
}

/* ---------- Intro copy ---------- */

.studio-copy {
  position: absolute;
  z-index: 3;
  left: var(--studio-pad);
  top: calc(var(--header-h) + 40px);
  bottom: 56px;
  width: min(600px, 46vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.5s, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0s;
}
.studio-copy a,
.studio-copy .btn {
  pointer-events: auto;
}
.studio.is-focus .studio-copy {
  opacity: 0;
  transform: translateX(-40px);
  visibility: hidden;
  transition: opacity 0.4s, transform 0.5s, visibility 0s 0.5s;
}
.studio-name {
  font-size: clamp(2.2rem, min(12.5vh, 8.2vw, 106px), 106px);
  margin: 20px 0 22px;
}
.studio-name .line {
  display: block;
  white-space: nowrap;
  padding-bottom: 0.04em;
}
.studio-name .line + .line {
  color: var(--cobalt);
}
.studio-role {
  margin: -6px 0 16px;
  color: var(--cobalt);
}
.studio-lede {
  margin: 0 0 28px;
  max-width: 33em;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.55;
  color: var(--ink-2);
}
.studio-lede a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--cobalt);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.studio-lede a:hover {
  color: var(--cobalt);
}
.studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.studio-hint {
  position: absolute;
  z-index: 3;
  left: var(--studio-pad);
  bottom: 34px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  pointer-events: none;
  transition: opacity 0.4s;
}
.studio-hint .scroll-cue-track {
  display: block;
  width: 28px;
  height: 1px;
  background: var(--rule);
  overflow: hidden;
}
.studio-hint .scroll-cue-track span {
  display: block;
  width: 10px;
  height: 1px;
  background: var(--cobalt);
}
.studio.is-focus .studio-hint {
  opacity: 0;
}

/* ---------- Legend (hotspots) ---------- */

.studio-legend {
  list-style: none;
  margin: 0;
  padding: 0;
}
.studio-hot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.studio-hot .balloon {
  flex: none;
  width: 30px;
  height: 30px;
  transition: background 0.25s, color 0.25s, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.studio-hot-name {
  padding: 3px 8px 3px 7px;
  background: var(--paper);
  border: 1px solid var(--ink);
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.25s, color 0.25s;
}
.studio-hot:hover .balloon,
.studio-hot:focus-visible .balloon,
.studio-legend li.is-hot .balloon {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: var(--paper);
  transform: scale(1.12);
}
.studio-hot:hover .studio-hot-name,
.studio-hot:focus-visible .studio-hot-name,
.studio-legend li.is-hot .studio-hot-name {
  background: var(--ink);
  color: var(--paper);
}
.studio-legend li.is-active .balloon {
  background: var(--signal);
  border-color: var(--ink);
  color: #121418;
}

.studio-detail {
  display: none;
}

/* Interactive 3D mode: each item is placed by script at its projected point */
.studio.is-3d .studio-legend li {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  opacity: 0;
  visibility: hidden;
  will-change: transform;
}
.studio.is-3d.is-ready .studio-legend li {
  visibility: visible;
}
.studio.is-3d .studio-legend li.is-left .studio-hot {
  flex-direction: row-reverse;
}
.studio.is-3d .studio-legend li.is-left .studio-hot-name {
  padding: 3px 7px 3px 8px;
}
.studio.is-3d .studio-legend li.is-dim {
  pointer-events: none;
}

.studio-leaders {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}
.studio-leaders path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.studio-leaders circle {
  fill: var(--signal);
  stroke: var(--ink);
  stroke-width: 1;
}
.studio-leaders .is-hot path {
  stroke: var(--cobalt);
}

/* ---------- Station card (the old project-card copy) ---------- */

.studio-panel {
  position: absolute;
  z-index: 6;
  top: calc(var(--header-h) + 36px);
  right: var(--gutter);
  width: min(var(--card-w), calc(100vw - 2 * var(--gutter)));
  max-height: calc(100% - var(--header-h) - 96px);
  overflow-y: auto;
  overscroll-behavior: auto;
  padding: 22px 24px 18px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 var(--cobalt);
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 0.3s, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  scrollbar-width: thin;
}
.studio-panel[hidden] {
  display: none;
}
.studio-panel.is-open {
  opacity: 1;
  transform: none;
}
/* About and Ask: the scene is the content, so the card shrinks to a strip in the corner */
.studio-panel.is-strip {
  top: auto;
  bottom: 24px;
  width: auto;
  max-width: min(380px, calc(100vw - 2 * var(--gutter)));
  padding: 14px 18px 14px;
  box-shadow: 5px 5px 0 var(--cobalt);
}
.studio-card {
  display: none;
}
.studio-card.is-active {
  display: block;
}
.studio-detail-kicker {
  margin: 0 0 8px;
  color: var(--cobalt);
}
.studio-detail-title {
  margin: 0 0 12px;
  font-family: var(--f-display);
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(1.35rem, 1.9vw, 1.75rem);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: -0.005em;
}
.studio-detail-sum,
.studio-detail-win {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}
.studio-detail-win {
  padding-left: 12px;
  border-left: 3px solid var(--signal);
  color: var(--ink);
  font-weight: 500;
}
.studio-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 14px 0 4px;
}
.studio-panel.is-strip .studio-detail-links {
  margin: 4px 0 0;
}
/* CloudClean: the part on the scanner */
.scan-pick {
  margin: 2px 0 12px;
}
.scan-pick-label {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.scan-pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.scan-chip {
  padding: 5px 10px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.scan-chip:hover {
  background: color-mix(in srgb, var(--cobalt) 12%, transparent);
}
.scan-chip.is-on {
  background: var(--ink);
  color: var(--paper);
}
.scan-chip.is-busy {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #fff;
}
.scan-chip:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}
/* the AMR card's "Open the live console" is a button styled as the card's links */
.studio-holo-open {
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  color: inherit;
  cursor: pointer;
}
.studio-holo-open[hidden] {
  display: none;
}
/* landscape: the console is always on under the card (its own "Full console" button expands it) */
@media (min-aspect-ratio: 1/1) and (min-width: 761px) {
  .studio-holo-open {
    display: none;
  }
}
.studio-panel.is-strip .studio-detail-kicker {
  margin-bottom: 4px;
}
.studio-panel.is-strip .studio-detail-sum {
  margin: 0;
  font-size: 14px;
}
.studio-more {
  margin-top: 14px;
  border-top: 1px solid var(--rule);
}
.studio-more summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 4px;
  cursor: pointer;
  list-style: none;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cobalt);
}
.studio-more summary::-webkit-details-marker {
  display: none;
}
.studio-more summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  line-height: 1;
}
.studio-more[open] summary::before {
  content: "−";
}
.studio-more summary:focus-visible,
.studio-card a:focus-visible,
.studio-card button:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}
.studio-more > p,
.studio-more .scorecard,
.studio-more .readouts,
.studio-more .stack-list,
.studio-more .autopilot {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: none;
}
.studio-more .studio-detail-meta {
  margin-top: 10px;
  font-size: 11px;
  color: var(--ink-3);
}
.studio-more .use-line {
  font-size: 11px;
}
.studio-more .use-line b {
  margin-right: 8px;
  color: var(--cobalt);
}
.studio-more .scorecard {
  gap: 10px;
  padding: 12px 14px 10px;
}
.studio-more .score-value {
  font-size: 1.4rem;
}
.studio-more .score-note {
  font-size: 12.5px;
}
.studio-more .readouts {
  grid-template-columns: 1fr 1fr;
}
.studio-more .readout {
  padding: 10px 12px;
}
.studio-more .readout-value {
  font-size: 1.35rem;
}
.studio-more .readout-label {
  font-size: 10px;
}
.studio-more .stack-list li {
  padding: 4px 8px;
  font-size: 11px;
}
.studio-more .autopilot {
  padding: 12px 12px 10px;
  border-color: var(--rule);
  background: var(--paper-2);
}
.studio-more .autopilot-head {
  color: var(--ink-2);
}
.studio-more .autopilot-steps li {
  border-color: var(--rule);
  color: var(--ink-2);
  font-size: 9.5px;
}
.studio-more .autopilot-steps li.is-you {
  border-color: var(--ink);
  color: var(--ink);
}
.studio-more .autopilot-steps li.is-on {
  background: var(--signal);
  border-color: var(--signal);
  color: #121418;
}
.studio-more .autopilot-steps li.is-done {
  border-color: var(--cobalt);
  color: var(--cobalt);
}
.studio-more .autopilot-foot {
  color: var(--ink-3);
}
.studio-card .live-strip {
  margin: 0 0 10px;
  padding: 10px 12px;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  border-color: var(--rule);
  background: var(--paper-2);
}
.studio-card .live-strip p .mono {
  color: var(--ink-3);
}
.studio-card .live-strip b {
  font-size: 13px;
}
.studio-card .live-pill.is-off,
.studio-card .live-strip.is-off .live-pill {
  border-color: var(--rule);
  color: var(--ink-3);
}
.studio-card .live-pill {
  color: #c4361f;
}
.studio-card.is-active {
  animation: studio-slide 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.studio-soon {
  margin: 0;
  padding: 10px 12px;
  display: inline-block;
  border: 1px dashed var(--ink-3);
  color: var(--ink-2);
}

/* ---------- Loader ---------- */

.studio-loader {
  position: absolute;
  z-index: 7;
  right: var(--studio-pad);
  bottom: 56px;
  width: min(260px, 70%);
  display: grid;
  gap: 10px;
  color: var(--ink-2);
  transition: opacity 0.5s;
}
.studio-loader b {
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.studio-loader-rule {
  display: block;
  height: 1px;
  background: var(--rule);
}
.studio-loader-rule i {
  display: block;
  height: 3px;
  margin-top: -1px;
  background: var(--cobalt);
  transform: scaleX(0);
  transform-origin: left;
}
.studio-loader.is-done {
  opacity: 0;
  pointer-events: none;
}
.studio:not(.is-3d) .studio-loader {
  display: none;
}

/* ---------- Without WebGL: poster + list ---------- */

.studio:not(.is-3d) .studio-stage {
  height: auto;
  min-height: 0;
  padding: calc(var(--header-h) + 56px) var(--studio-pad) 56px;
  display: grid;
  gap: 36px;
}
.studio:not(.is-3d) .studio-view {
  position: static;
  order: 2;
  /* as a grid item, z-index 0 would make this a stacking context under the copy's wash (::before) */
  z-index: auto;
}
.studio:not(.is-3d) .studio-poster {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
}
.studio:not(.is-3d) .studio-copy {
  position: static;
  width: min(640px, 100%);
}
.studio:not(.is-3d) .studio-hint,
.studio:not(.is-3d) .studio-meta,
.studio:not(.is-3d) .studio-panel,
.studio:not(.is-3d) .studio-leaders {
  display: none;
}
.studio:not(.is-3d) .studio-legend {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}
.studio:not(.is-3d) .studio-legend li {
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--ink);
}
.studio:not(.is-3d) .studio-hot {
  display: none;
}
.studio:not(.is-3d) .studio-detail {
  display: block;
}
.studio:not(.is-3d) .studio-detail-title {
  font-size: 1.15rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .studio-copy {
    width: min(520px, 50vw);
  }
  .studio-hot-name {
    font-size: 10.5px;
  }
}

/* Phones, narrow tablets and any portrait window: the same tour, the scene fills the screen, the hero copy
   sits over the top of it and a station card is a sheet on the bottom */
@media (max-width: 760px), (max-aspect-ratio: 9/10) {
  .studio.is-3d .studio-view::before {
    background: linear-gradient(180deg, var(--paper) 0, color-mix(in srgb, var(--paper) 92%, transparent) 40%, color-mix(in srgb, var(--paper) 55%, transparent) 62%, transparent 82%);
  }
  .studio-sheet {
    inset: calc(var(--header-h) + 4px) 10px 10px;
  }
  .studio-meta {
    display: none;
  }
  .studio.is-3d .studio-copy {
    top: 0;
    bottom: auto;
    width: auto;
    right: var(--gutter);
    padding: calc(var(--header-h) + 18px) 0 0;
    justify-content: flex-start;
  }
  .studio-name {
    font-size: clamp(2.4rem, 14vw, 4.2rem);
    margin: 10px 0 10px;
  }
  .studio-name .line {
    display: inline;
  }
  .studio-name .line + .line::before {
    content: " ";
  }
  .studio-lede {
    font-size: 14.5px;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .studio.is-3d .studio-hint {
    display: none;
  }
  .studio-loader {
    right: auto;
    left: 50%;
    bottom: 50%;
    transform: translateX(-50%);
  }
  .studio-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 48svh;
    padding: 18px var(--gutter) calc(18px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    box-shadow: 0 -6px 0 var(--cobalt);
    transform: translateY(40px);
  }
  .studio-panel.is-strip {
    max-width: none;
    padding-top: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .studio-detail-title {
    font-size: 1.3rem;
  }
  .studio-detail-sum,
  .studio-detail-win {
    font-size: 14px;
  }
  .studio .studio-rail {
    left: 12px;
    right: 12px;
    bottom: auto;
    top: calc(var(--header-h) + 8px);
  }
  .studio .studio-rail-list {
    flex: 1;
    min-width: 0;
  }
  .studio .studio-rail-list li {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .studio .studio-rail-list button,
  .studio .studio-rail-step {
    height: 28px;
  }
  .studio .studio-rail-step {
    width: 28px;
  }
  .studio-hot-name {
    display: none;
  }
  .studio-legend li.is-active .studio-hot-name {
    display: block;
  }
  .studio:not(.is-3d) .studio-stage {
    display: grid;
    padding: calc(var(--header-h) + 28px) var(--gutter) 40px;
  }
  .studio:not(.is-3d) .studio-copy {
    padding: 0;
  }
  .studio:not(.is-3d) .studio-view {
    height: auto;
    margin: 0;
  }
  .studio:not(.is-3d) .studio-hot-name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .studio.is-3d .studio-poster {
    transition: none;
  }
  .studio-copy,
  .studio-panel,
  .studio-loader {
    transition: none;
  }
}

/* ==========================================================
   Round 2: bench mode, race, whiteboard, grade
   ========================================================== */

/* The section is as tall as the tour (JS sets --tour-vp); the stage pins for all of it */
.studio.is-3d {
  height: calc(var(--tour-vp, 18) * 100svh);
}
.studio.is-3d .studio-stage {
  position: sticky;
  top: 0;
}
.studio.is-3d .studio-copy {
  opacity: max(0, calc(1 - var(--bench) * 2.6));
  transform: translateX(calc(var(--bench) * -110px));
  transition: none;
}
.studio.is-3d.is-bench-early .studio-copy a,
.studio.is-3d.is-bench-early .studio-copy .btn {
  pointer-events: none;
}
.studio.is-3d.is-bench .studio-copy {
  visibility: hidden;
}
.studio.is-3d .studio-view::before {
  opacity: max(0, calc(1 - var(--bench) * 2));
}
.studio.is-3d .studio-hint {
  opacity: max(0, calc(1 - var(--bench) * 7));
}
.tour-mark {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.studio-canvas.is-cut {
  opacity: 0.001;
}

.studio-stage {
  --studio-pad: calc(var(--gutter) + clamp(14px, 3vw, 48px));
}

/* Subtle vignette where the post-process grade is not running (phones) */
.studio.is-3d:not(.has-grade) .studio-view::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 58%, rgba(0, 0, 0, 0.2));
}

/* About: the whiteboard carries it; the real text stays for screen readers (and is the page when there is no WebGL) */
.studio.is-3d .studio-about-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.studio:not(.is-3d) .studio-about-text {
  position: relative;
  z-index: 3;
  max-width: 44em;
}
.studio:not(.is-3d) .studio-about-text .about-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}
.studio:not(.is-3d) li[data-hot="ask"],
.studio:not(.is-3d) [data-race],
.studio:not(.is-3d) [data-gp] {
  display: none;
}
.studio-detail-lead {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}
.studio-specs {
  margin: 0 0 18px;
  border-top: 1px solid var(--ink);
}
.studio-specs > div {
  display: grid;
  grid-template-columns: 6.5em 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}
.studio-specs dt {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cobalt);
  padding-top: 3px;
}
.studio-specs dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.4;
}
.studio-specs small {
  display: block;
  color: var(--ink-2);
  font-size: 12.5px;
}
.studio-race-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--ink-2);
}

/* Racing: the page is still, the overlay gets out of the way, the HUD takes over */
html.studio-racing {
  /* scroll is blocked by key, wheel and touch handlers; overflow:hidden would unpin the sticky stage */
  overscroll-behavior: none;
}
.studio.is-racing .studio-legend li,
.studio.is-racing .studio-legend,
.studio.is-racing .studio-leaders,
.studio.is-racing .studio-panel,
.studio.is-racing .studio-hint,
.studio.is-racing .studio-copy {
  visibility: hidden !important;
}
.studio.is-racing .studio-meta {
  opacity: 0;
}
.studio-race {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}
.studio-race[hidden] {
  display: none;
}
.race-hud {
  position: absolute;
  top: calc(var(--header-h) + 22px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 5px 5px 0 var(--cobalt);
}
.race-stat {
  display: grid;
  gap: 2px;
  padding: 8px 18px 9px;
  min-width: 96px;
}
.race-stat + .race-stat {
  border-left: 1px solid var(--rule);
}
.race-stat span {
  color: var(--ink-3);
  font-size: 10.5px;
}
.race-stat b {
  font-family: var(--f-display);
  font-stretch: 118%;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.race-exit {
  position: absolute;
  top: calc(var(--header-h) + 22px);
  right: calc(var(--frame-x) + 14px);
  pointer-events: auto;
  background: var(--paper);
}
.race-help {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  margin: 0;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  padding: 6px 10px;
  white-space: nowrap;
}
.race-lights {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 14px;
  align-items: center;
}
.race-lights.is-out i {
  visibility: hidden;
}
.race-lights i {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #3a1410;
  border: 2px solid var(--ink);
  transition: background 0.1s, box-shadow 0.1s;
}
.race-lights i.is-on {
  background: #ff2a14;
  box-shadow: 0 0 26px 6px rgba(255, 42, 20, 0.55);
}
.race-lights span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--f-display);
  font-stretch: 125%;
  font-weight: 900;
  font-size: 4.2rem;
  color: var(--ink);
  text-shadow: 0 0 0 var(--paper), 3px 3px 0 var(--signal);
  white-space: nowrap;
}
.race-touch {
  display: none;
  position: absolute;
  inset: auto 14px 18px;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}
@media (hover: none) {
  .race-touch {
    display: flex;
  }
  .race-help {
    display: none;
  }
}
.race-steer,
.race-pedals {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}
.race-touch button {
  min-width: 68px;
  height: 68px;
  border: 1px solid var(--ink);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 13px;
  text-transform: uppercase;
  touch-action: none;
  user-select: none;
}
.race-steer button {
  font-size: 34px;
  line-height: 1;
}
.race-touch button.is-down {
  background: var(--cobalt);
  color: var(--paper);
}
.race-results {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(430px, calc(100% - 28px));
  padding: 24px 24px 20px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 var(--cobalt);
  pointer-events: auto;
}
.race-results[hidden] {
  display: none;
}
.race-res-kicker {
  margin: 0 0 6px;
  color: var(--cobalt);
}
.race-res-title {
  margin: 0 0 14px;
  font-family: var(--f-display);
  font-stretch: 118%;
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1;
  text-transform: uppercase;
}
.race-res-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  border-top: 1px solid var(--ink);
}
.race-res-list li {
  display: grid;
  grid-template-columns: 26px 14px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
}
.race-res-list li.is-you {
  font-weight: 700;
  background: color-mix(in srgb, var(--signal) 22%, transparent);
}
.race-res-list i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--ink);
}
.race-pos {
  font-family: var(--f-mono);
  color: var(--ink-3);
}
.race-gap {
  color: var(--ink-2);
}
.race-res-note {
  margin: 0 0 16px;
  font-size: 14.5px;
  color: var(--ink-2);
}
.race-res-note a {
  color: var(--ink);
  font-weight: 600;
  text-decoration-color: var(--cobalt);
  text-underline-offset: 3px;
}
.race-res-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 760px) {
  .race-hud {
    top: 70px;
    box-shadow: 3px 3px 0 var(--cobalt);
  }
  .race-stat {
    padding: 6px 10px 7px;
    min-width: 72px;
  }
  .race-stat b {
    font-size: 1.15rem;
  }
  .race-exit {
    top: auto;
    bottom: 100px;
    right: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .race-lights i {
    transition: none;
  }
}

/* ---------- The tour rail: prev/next and the seven stops ---------- */
.studio-rail {
  position: absolute;
  z-index: 6;
  left: var(--studio-pad);
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0s 0.4s;
}
.studio.is-bench-early .studio-rail {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s;
}
.studio.is-racing .studio-rail {
  visibility: hidden;
}
.studio-rail-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
.studio-rail-list li {
  width: 30px;
}
.studio-rail-list button {
  width: 100%;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--f-mono);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.studio-rail-list button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.studio-rail-list b {
  font-weight: 500;
}
.studio-rail-list button:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.studio-rail-list button.is-active {
  background: var(--signal);
  border-color: var(--ink);
  color: #121418;
}
.studio-rail-fill {
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: -7px;
  height: 2px;
  background: var(--cobalt);
  transform-origin: 0 50%;
  transform: scaleX(var(--tour-p, 0));
  pointer-events: none;
}
.studio-rail-step {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.studio-rail-step:hover:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
}
.studio-rail-step:disabled {
  opacity: 0.35;
  cursor: default;
}
.studio-rail button:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}
.studio-rail-step svg {
  width: 14px;
  height: 14px;
}
@keyframes studio-slide {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .studio-card.is-active {
    animation: none;
  }
  .studio-canvas.is-cut {
    transition: opacity 0.13s;
  }
  .studio-rail {
    transition: none;
  }
}

/* The AMR console is docked on the right: the station card steps aside until it closes */
.studio.is-docked .studio-panel {
  opacity: 0;
  transform: translateX(28px);
  pointer-events: none;
  visibility: hidden;
}
