/* How Path Tracing Works — widget-local styles. This page is an interactive
   essay, not an arena game, so instead of the shared .arena chrome it lays
   out two acts of captions + canvas. The 2D scene is deliberately a *dark
   room with a lamp* in both color schemes — ray paths are drawn in light,
   and light needs darkness to read — so only the page chrome around the
   canvases follows the site light/dark variables. */

.pt-page h2 {
  margin: 34px 0 10px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.pt-actnum {
  display: inline-block;
  margin-right: 10px;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.8em;
  vertical-align: 2px;
}

.pt-caption {
  max-width: 62ch;
  margin: 0 0 14px;
}

.pt-fine {
  max-width: 62ch;
  margin: 6px 0 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* --- canvases -------------------------------------------------------------- */

.pt-stage {
  margin: 6px 0 6px;
}

/* Act 1: room (1.3 x 1.0) plus the film strip margin — 3:2 overall. */
#flat {
  display: block;
  width: min(100%, 640px);
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #10182a;
  touch-action: manipulation;
  cursor: pointer;
}

/* Act 2: the render. Internal resolution is low (~176px) and the browser
   upscales it SMOOTHLY on purpose: crisp/pixelated scaling would read as
   blocky retro art, while bilinear reads as a photograph developing — the
   noise itself is the texture we want visible, not the pixel grid. */
#render {
  display: block;
  width: min(100%, 460px);
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
}

.pt-readout {
  margin: 8px 0 2px;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

/* --- controls (house toolbar pattern, plus wide text tools and sliders) ---- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.tool-group {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}

.toolbar > .tool {
  background: var(--surface);
  border: 1px solid var(--line);
}

.tool[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.tool-wide {
  padding: 0 16px;
  font-size: 0.95rem;
}

.btn.pt-fire {
  min-height: 44px;
  padding: 0 20px;
}

.pt-sliderwrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.pt-sliderwrap output {
  min-width: 1.2ch;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pt-sliderwrap input[type="range"] {
  width: min(150px, 32vw);
  accent-color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
