/* ============================================================================
   oculus · fx-pantheon.css
   The 3D Pantheon's canvas and overlays (caption, keynotes, the sun panel),
   injected by fx-pantheon.js into chapter VI's stage and into the lab page.
   Every class is pt- prefixed. Colours come from the drawing system's tokens
   in post.css (blueprint, sheet, amber), with fallbacks for the lab page.
   Hard edges, no shadows, no radius (docs/BRAND_LINEAGE.md).
   ========================================================================== */
.pt-host {
  --pt-ink: var(--blueprint, #023047);
  --pt-ink-soft: rgba(2, 48, 71, 0.68);
  --pt-rule: rgba(2, 48, 71, 0.25);
  --pt-sheet: var(--sheet, #f7f8f8);
  --pt-amber: var(--amber, #ffd000);
  --pt-sky: var(--sky, #8ecae6);
  --pt-display: "Kallisto", "Helvetica Neue", Arial, sans-serif;
  --pt-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pt-left: 5vw;
}
.pt-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; z-index: 1; pointer-events: none; }
.pt-labels, svg.pt-leaders { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
svg.pt-leaders { width: 100%; height: 100%; }
svg.pt-leaders path { stroke: var(--pt-ink); stroke-width: 0.75; fill: none; opacity: 0; }

.pt-k {
  position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap;
  font: 0.72rem/1.2 var(--pt-mono); letter-spacing: 0.02em; color: var(--pt-ink);
  background: var(--pt-sheet); padding: 0.2rem 0.35rem; border: 1px solid rgba(2, 48, 71, 0.35);
}
.pt-k--card { white-space: normal; width: 13.5rem; padding: 0.3rem 0.45rem; }
.pt-k--card b { display: block; font: 700 0.95rem/1.1 var(--pt-display); text-transform: uppercase; letter-spacing: 0.02em; }
.pt-k--card span { display: block; margin-top: 0.15rem; color: var(--pt-ink-soft); }
.pt-k--note { width: 17rem; }
.pt-k--note b { font-size: 0.8rem; letter-spacing: 0.04em; }
.pt-k--small { font-size: 0.66rem; padding: 0.12rem 0.3rem; }

.pt-caption {
  position: absolute; left: var(--pt-left); bottom: 6vh; max-width: 26rem; z-index: 3; opacity: 0;
  background: rgba(247, 248, 248, 0.86); padding: 0.6rem 0.75rem; border: 1px solid rgba(2, 48, 71, 0.18); color: var(--pt-ink);
}
.pt-caption p { margin: 0; font-size: 1rem; line-height: 1.4; }
.pt-caption small { display: block; margin-top: 0.55rem; padding-top: 0.45rem; border-top: 1px solid rgba(2, 48, 71, 0.3); font: 0.74rem/1.4 var(--pt-mono); color: var(--pt-ink-soft); }
.pt-caption small:empty { display: none; }
/* Zack's own words: the blueprint surface, larger type, the fact under it in sky */
.pt-caption--story { max-width: 31rem; padding: 1rem 1.2rem 0.9rem; background: var(--pt-ink); border-color: var(--pt-ink); color: var(--pt-sheet); }
.pt-caption--story p { font-size: clamp(1.08rem, 0.95rem + 0.45vw, 1.3rem); line-height: 1.45; }
.pt-caption--story small { color: var(--pt-sky); border-top-color: rgba(142, 202, 230, 0.35); }

.pt-panel {
  position: absolute; bottom: 4vh; right: 3vw; width: 21rem; opacity: 0; z-index: 4; color: var(--pt-ink);
  border: 1px solid var(--pt-ink); background: rgba(247, 248, 248, 0.9);
  font: 0.72rem/1.35 var(--pt-mono); letter-spacing: 0.02em;
}
.pt-readout { margin: 0; }
.pt-readout > div { display: grid; grid-template-columns: 7.5rem 1fr; border-top: 1px solid var(--pt-rule); }
.pt-readout > div:first-child { border-top: 0; }
.pt-readout dt, .pt-readout dd { margin: 0; padding: 0.34rem 0.55rem; }
.pt-readout dt { text-transform: uppercase; color: var(--pt-ink-soft); border-right: 1px solid var(--pt-rule); }
.pt-readout__check { grid-template-columns: 1fr !important; }
.pt-readout__check:has(dd:empty) { display: none !important; }
.pt-panel__toggle { display: none; }

.pt-sunctl { border-top: 1px solid var(--pt-ink); padding: 0.45rem 0.55rem 0.5rem; display: grid; gap: 0.4rem; }
.pt-sunctl__row { display: grid; grid-template-columns: 2.6rem 1fr 7.6rem; align-items: center; gap: 0.5rem; }
.pt-sunctl__row--chips { display: flex; align-items: center; gap: 0.5rem; }
.pt-sunctl__row label, .pt-sunctl__row > span { width: 2.6rem; text-transform: uppercase; color: var(--pt-ink-soft); }
.pt-sunctl__row output { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-sunctl input[type="range"] { width: 100%; margin: 0; accent-color: var(--pt-ink); height: 1.1rem; }
.pt-chips { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.pt-panel button {
  font: inherit; color: var(--pt-ink); background: transparent; cursor: pointer;
  border: 1px solid rgba(2, 48, 71, 0.45); padding: 0.18rem 0.42rem; border-radius: 0;
}
.pt-panel button:hover { border-color: var(--pt-ink); }
.pt-panel button[aria-pressed="true"] { background: var(--pt-ink); color: var(--pt-sheet); border-color: var(--pt-ink); }
.pt-panel button:focus-visible, .pt-panel input:focus-visible { outline: 2px solid var(--pt-amber); outline-offset: 1px; }
.pt-play { padding: 0.12rem 0.3rem !important; }
.pt-follow { justify-self: start; }
.pt-chart { width: 100%; height: auto; display: block; }
.pt-chart .ax { stroke: rgba(2, 48, 71, 0.35); stroke-width: 1; }
.pt-chart .ax--noon { stroke-dasharray: 2 3; }
.pt-chart .ref { fill: none; stroke: rgba(2, 48, 71, 0.35); stroke-width: 1; }
.pt-chart .today { fill: none; stroke: var(--pt-ink); stroke-width: 1.8; }
.pt-chart .now { fill: var(--pt-amber); stroke: var(--pt-ink); stroke-width: 1.2; }
.pt-chart .moon { fill: none; stroke: #6f8fd6; stroke-width: 1.3; stroke-dasharray: 3 2; }
.pt-chart .moonnow { fill: #dbe6ff; stroke: #3d5a99; stroke-width: 1; }
.pt-chart .below { fill: rgba(2, 48, 71, 0.06); }
.pt-chart .lab { font: 8px var(--pt-mono); fill: var(--pt-ink-soft); }

.pt-debug { display: none; position: absolute; left: 8px; top: 8px; font: 11px var(--pt-mono); z-index: 5; }
.pt-is-debug .pt-debug { display: block; }

@media (max-width: 860px) {
  .pt-panel { width: auto; left: 3vw; right: 3vw; bottom: 2vh; }
  .pt-chart { display: none; }
  .pt-caption { bottom: auto; top: 13vh; right: 5vw; }
}
@media (max-width: 600px) {
  .pt-k, svg.pt-leaders { display: none; }
  .pt-panel { font-size: 0.66rem; }
  .pt-readout > div:nth-child(2), .pt-readout > div:nth-child(3) { display: none; }
  .pt-readout__check { display: none !important; }
  /* on a phone the controls fold away under a button, leaving the readout */
  .pt-panel__toggle { display: block !important; width: 100%; text-transform: uppercase; letter-spacing: 0.06em; border: 0 !important; border-top: 1px solid var(--pt-ink) !important; padding: 0.4rem !important; }
  .pt-panel__toggle::after { content: " +"; }
  .pt-panel.is-open .pt-panel__toggle::after { content: " \2212"; }
  .pt-panel:not(.is-open) .pt-sunctl { display: none; }
}

/* Chapter VI on the home page. With the 3D on (site.js sets data-pantheon), the
   stage runs edge to edge so the model can fill the screen; the copy and the
   drawing keep exactly the column they had. */
.draw[data-pantheon] .draw__stage {
  max-width: none;
  padding-inline: calc(max(0px, (100% - var(--sc-maxw)) / 2) + var(--sc-gutter));
}
@media (min-width: 860.02px) {
  .draw[data-pantheon] .draw__fig {
    --pt-cw: min(100%, var(--sc-maxw));
    right: calc((100% - var(--pt-cw)) / 2 + var(--sc-gutter));
    width: min(calc(var(--pt-cw) - 2 * var(--sc-gutter)), calc(var(--pt-cw) * 0.84), calc((100svh - 22rem) * 1.72));
  }
}
