/* surface-page.css: what a surface page shows before any module loads: the still, the start press and the line that
   says what was handed over. The modules bring bench.css with them. The field is held under the bench's ceiling from
   the start, so light words read at AA contrast anywhere on it and nothing darkens when the modules arrive. */
body.sx-body .gw-backdrop::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgb(66, 88, 120); mix-blend-mode: darken; }
.sx { margin: clamp(36px, 5vw, 72px) 0; padding-top: clamp(20px, 3vw, 36px); border-top: 1px solid var(--line, rgba(244, 239, 230, .3)); }
.sx > h2 { margin-top: 0; }
.sx > p { max-width: 68ch; }
.sx .demo-form { font-size: .92em; }
.sx-still { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17em), 1fr)); gap: clamp(18px, 3vw, 48px); align-items: start; margin: 24px 0; max-width: 1100px; }
.sx-still figure { margin: 0; }
.sx-still figcaption, .sx-as { font-size: .92em; max-width: 60ch; }
.sx-pal { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.sx-pal li { display: flex; align-items: center; gap: 10px; }
.sx-pal i { width: 34px; height: 34px; flex: none; border: 1px solid rgba(244, 239, 230, .55); }
.sx-pal code, .sx-say code { font-family: var(--face-utility, monospace); font-size: .92em; }
.sx-word { font: 800 clamp(26px, 3vw, 44px)/1.05 var(--face-display, inherit); letter-spacing: -.02em; margin: 0 0 10px; overflow-wrap: anywhere; }
.sx-curve { width: 100%; max-width: 320px; height: auto; display: block; margin-bottom: 10px; }
.sx-curve polyline { fill: none; stroke: currentColor; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.sx-curve path { fill: none; stroke: currentColor; opacity: .45; vector-effect: non-scaling-stroke; }
.sx-go { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 20px 0; }
.sx button { font: inherit; font-weight: 700; color: inherit; background: none; border: 1px solid currentColor; padding: .6em 1.1em; min-height: 44px; cursor: pointer; }
.sx button:hover:not([disabled]) { background: rgba(244, 239, 230, .14); }
.sx button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
/* focus is moved to the group when it appears, so reading and Tab continue from it. The group is not a control and
   is not in the Tab order; a ring round all of it would box the page in, so it draws none. The status line above
   says what happened. */
#sx-hosts:focus-visible { outline: 0 !important; box-shadow: none !important; }
.sx button[disabled] { cursor: default; opacity: .75; }
.sx-say { scroll-margin-top: 120px; min-height: 3em; max-width: 80ch; font-size: .92em; margin: 14px 0 4px; }
.sx-rec { font-size: .92em; margin: 0 0 14px; max-width: 80ch; }
.sx-rec summary { cursor: pointer; display: inline-block; min-height: 44px; line-height: 44px; text-decoration: underline; text-underline-offset: .25em; }
.sx-rec summary:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.sx-rec dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; margin: 0 0 8px; }
.sx-rec dt { font-weight: 700; } .sx-rec dd { margin: 0; overflow-wrap: anywhere; }
.sx-rec code { font-family: var(--face-utility, monospace); }
#sx-hosts h3 { font-size: 18px; margin: 0 0 .5em; }
#sx-hosts[data-surface] { margin: 20px 0; }
#sx-hosts .sf-wide { grid-column: 1 / -1; }
.sx [hidden] { display: none !important; }
.mx-bar { display: grid; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line, rgba(244, 239, 230, .25)); }
.mx-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.mx-row label { display: grid; gap: 4px; font-size: .88em; min-width: 140px; flex: 1 1 150px; }
.mx-row select, .mx-row input[type="range"] { width: 100%; font: inherit; color: inherit; background: transparent; }
.mx-status { margin: 0; font-size: .88em; opacity: .9; }
article.sx-marbled-active { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px 28px; align-items: start; }
article.sx-marbled-active > :not(.rm) { grid-column: 1 / -1; }
article.sx-marbled-active .sx.rm { margin: 0; padding-top: 14px; border-top: 1px solid var(--line, rgba(244, 239, 230, .2)); }
/* A jump to a section (an address that ends in #shader, a link on the page) lands its heading below the hand, the
   navigation fixed at the top of the screen. The hand is 78px tall; it sits clamp(10px, 2vw, 24px) from the top on a
   wide screen and 6px, or the safe area, on a narrow one. tests/surface-rooms-anchor.cjs holds this margin to the
   hand's measured box at 390, 580 and 1440 px. */
.sx { scroll-margin-top: calc(clamp(10px, 2vw, 24px) + 90px); }
@media (max-width: 860px) { .sx { scroll-margin-top: calc(max(6px, env(safe-area-inset-top, 0px)) + 90px); } }
/* A room's still: the picture its own module made at build time. */
.rm-still { margin: 1rem 0; }
.rm-still svg { display: block; width: 100%; height: auto; max-height: 9rem; }
/* focus is moved into an opened room so a reader lands in it; the room itself is not a control and takes no ring */
.sx .rm-host:focus, .sx .rm-host:focus-visible { outline: none; box-shadow: none; }
/* The sound room's still: the five pieces as written. */
.snd-book { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.snd-book li { display: grid; gap: .15rem; }
.snd-book code { overflow-wrap: anywhere; font-size: .92em; }
/* The shader room's still: its first shader as written. */
.shd-still { margin: 0; max-height: 16rem; overflow: auto; font: 13px/1.5 ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace; white-space: pre; tab-size: 2; }

.rm-still .est-still-svg{max-height:22rem;width:100%;height:auto;border:1px solid var(--line,rgba(244,239,230,.28))}
.sf-estuary{display:grid;gap:14px}
.est-controls,.est-weights{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px 18px;align-items:end}
.est-controls label,.est-slider{display:grid;gap:4px;font-size:.88em}
.est-controls select,.est-controls input[type="range"],.est-slider input[type="range"]{width:100%;font:inherit;color:inherit;background:rgba(12,22,32,.55)}
.est-presets{display:flex;flex-wrap:wrap;gap:8px 12px}
.est-canvas{display:block;width:100%;max-width:960px;height:auto;aspect-ratio:720/380;border:1px solid var(--line,rgba(244,239,230,.34));background:#101318}
.est-readouts{display:grid;grid-template-columns:max-content 1fr;gap:4px 18px;margin:0;font-size:.9em}
.est-readouts dt{color:var(--soft);font-weight:600}
.est-readouts dd{margin:0;overflow-wrap:anywhere}
.est-status{margin:0;font-size:.88em;color:var(--soft)}
.sx-body h1 .pf-mark{font:600 13px/1 var(--face-utility,monospace);letter-spacing:.16em;opacity:.72;margin-left:.4rem}
.pg-jump{display:flex;flex-wrap:wrap;gap:8px 18px;margin:18px 0 0;padding:12px 0 0;border-top:1px solid var(--line,rgba(244,239,230,.3));font:600 .95em/1.4 var(--face-text,inherit)}
.wb-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 20px;margin:14px 0 20px}
.wb-toolbar input[type="search"]{flex:1 1 260px;max-width:440px;min-height:44px;padding:8px 4px;border:0;border-bottom:1.5px solid currentColor;background:transparent;color:inherit;font:500 1rem/1.3 var(--face-text,inherit)}
.wb-count{margin:0;font:500 .88em/1.4 var(--face-utility,monospace);color:var(--soft)}
.wb-group{margin:26px 0 0}
.wb-group>h3{margin:0 0 10px;font:700 1.05em/1.3 var(--face-display,inherit);color:var(--soft);display:flex;align-items:baseline;gap:10px}
.wb-disc-n{font:600 .8em/1 var(--face-utility,monospace);opacity:.72}
.wb-list{list-style:none;padding:0;margin:0;border-top:1px solid var(--line,rgba(244,239,230,.25))}
.wb-list>li{display:grid;grid-template-columns:minmax(12rem,17rem) minmax(0,1fr) auto;gap:6px 18px;align-items:baseline;padding:11px 0;border-bottom:1px solid var(--line,rgba(244,239,230,.22))}
.wb-name{font-weight:700}
.wb-desc{font-size:.92em;color:var(--soft);min-width:0;overflow-wrap:anywhere}
.wb-desc code{font-family:var(--face-utility,monospace);font-size:.88em}
.wb-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.wb-actions button{min-height:36px;padding:.3em .8em;font-size:.85em}
.wb-actions button:focus-visible,.pg-jump a:focus-visible,.wb-toolbar input[type="search"]:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.wb-stage{margin:24px 0;padding:16px 0 0;border-top:2px solid currentColor}
.wb-stage-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;margin-bottom:12px}
.wb-frame{display:block;width:100%;height:min(76vh,720px);border:1px solid var(--line,rgba(244,239,230,.35));background:#0c1620}
.sf-stack{position:relative;aspect-ratio:16/9;border:1px solid var(--line,rgba(244,239,230,.34));overflow:hidden;margin:18px 0 8px;background:#101318;max-width:960px}
.sf-stack .layer{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;clip-path:circle(0% at 50% 50%);transition:clip-path 1.4s cubic-bezier(.6,.05,.25,1)}
.sf-stack .layer.base{clip-path:none}
.sf-readouts{position:absolute;left:12px;bottom:12px;z-index:5;display:flex;flex-wrap:wrap;gap:6px}
.sf-readouts button{font:600 .88em/1 var(--face-text,inherit);padding:8px 12px;border:1px solid #ece6d9;background:rgba(16,19,24,.84);color:#ece6d9;min-height:44px;cursor:pointer}
.sf-readouts button[aria-pressed="true"]{background:#ece6d9;color:#101318}
.pg-media-grid{display:grid;gap:24px;max-width:1040px;margin:18px 0}
.pg-media-videos{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:20px 24px;align-items:start}
.pg-media-grid video{display:block;width:100%;height:auto;border:1px solid var(--line,rgba(244,239,230,.34));background:#0c1620}
.pg-audio-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line, rgba(244, 239, 230, .25)); }
.pg-audio-list li { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--line, rgba(244, 239, 230, .22)); }
.pg-audio-list audio { width: 100%; max-width: 560px; }
@media (max-width: 780px) {
  .wb-list > li { grid-template-columns: 1fr; }
  .wb-actions { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .sf-stack .layer { transition: none; }
}
/* Native RAW & Low Water doors/tables (lightweight rules inside surface-page.css budget) */
.lw-doors { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px 22px; }
.lw-door figure, .lw-plate, .pair { margin: 0 0 12px; }
.lw-door img, .lw-plate img, .pair img { display: block; width: 100%; height: auto; border: 1px solid var(--line, rgba(244, 239, 230, .28)); }
.lw-stills { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.lw-stills figure { margin: 0; }
.lw-eras { padding-left: 1.3em; margin: 12px 0; }
.rn-wrap { overflow-x: auto; margin: 16px 0; max-width: 720px; }
.rn-table { width: 100%; border-collapse: collapse; font-size: .92em; font-variant-numeric: tabular-nums; }
.rn-table th, .rn-table td { text-align: left; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line, rgba(244, 239, 230, .25)); }
.rn-table .num { text-align: right; }
.lw-walk-frame { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; border: 0; padding: 0; background: #0c1620; }
.lw-walk-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.pair-frames { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.pair-frames [hidden] { display: none; }
.figs { list-style: none; padding: 0; margin: 14px 0; border-top: 1px solid var(--line, rgba(244, 239, 230, .24)); }
.fig { border-bottom: 1px solid var(--line, rgba(244, 239, 230, .24)); padding: 8px 0; }
.fig summary { cursor: pointer; }
.fig-src { margin: 6px 0 0; font-size: .92em; color: var(--soft); }
