diff --git a/README.md b/README.md index 001687d..06c1b69 100644 --- a/README.md +++ b/README.md @@ -16,5 +16,5 @@ Public site for [Rust to Dust](https://rtd.gamecult.org), built as a `GameCult-Q ## Status -- **Live in this repo:** `GameCult-Quartz` Imperial Chrome overlay, self-hosted Monaspace Krypton font, progressive-enhancement Sion Lobby status bar (`/api/directory/servers`), and Yggdrasil release deploy script. +- **Live in this repo:** `GameCult-Quartz` vector-only military HUD overlay, self-hosted Monaspace Krypton font, progressive-enhancement Sion Lobby status bar (`/api/directory/servers`), and Yggdrasil release deploy script. - **Scaffolded:** `content/Architecture/index.md` (six subsystem teardown slots) and `content/Lore/index.md` (stub for Weksa). diff --git a/THIRD_PARTY_NOTICES.txt b/THIRD_PARTY_NOTICES.txt index b35972b..95c5372 100644 --- a/THIRD_PARTY_NOTICES.txt +++ b/THIRD_PARTY_NOTICES.txt @@ -95,3 +95,15 @@ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. + + +Sion Terrain & Building Data (`site/quartz/static/sion-dem.png`) +================================================================ + +Source: Federal Office of Topography swisstopo - ch.swisstopo.swissalti3d & ch.swisstopo.swissbuildings3d_3_0 + +Provided under swisstopo Open Government Data (OGD) terms of use: +https://www.swisstopo.admin.ch/en/terms-of-use-free-geodata-and-geoservices + +Elevation, urban building footprints, and hydrological masks derived from +swisstopo datasets are packed into `site/quartz/static/sion-dem.png`. diff --git a/content/Lore/index.md b/content/Lore/index.md index 6f10b52..56beecd 100644 --- a/content/Lore/index.md +++ b/content/Lore/index.md @@ -1,8 +1,6 @@ --- title: Lore -description: Setting notes and world documentation for Rust to Dust. +description: Setting notes and operational theater dossiers for Rust to Dust. --- -Setting notes and world documentation authored by Weksa. - -This section is currently a scaffold awaiting prose-council-reviewed lore pages. +Field dossiers, faction briefs, and Sion valley setting documentation are incoming. diff --git a/content/index.md b/content/index.md index c174471..13ca7e2 100644 --- a/content/index.md +++ b/content/index.md @@ -4,15 +4,46 @@ description: Salvage-grid vehicular and mech combat in a 3 km Swiss Alpine valle ---
-

GameCult // Vehicle & Mech Arena

-

RUST TO DUST

-

Salvage-grid vehicular and mech combat across a 3 km Swiss Alpine valley around Sion. Twelve contenders drop in by orbital pod inside a shrinking ring, fighting rival pilots and gilded Imperial spectators while bolting salvaged weapons onto live thermal chassis mid-match.

+
+ SION SECTOR // 46.2331N 7.3606E +
+
+

RUST TO DUST

+

Salvage-grid vehicular and mech combat across a 3 km Swiss Alpine valley around Sion. Twelve contenders drop in by orbital pod inside a shrinking ring, fighting rival pilots and gilded Imperial spectators while bolting salvaged weapons onto live thermal chassis mid-match.

+
-
Sion Lobby · rtd.gamecult.org:3076
+
+ +
+ NODE + SION LOBBY +
+
+ CREW + --/-- +
+
+ SECTOR + SION +
+
+ STATE + DIRECT +
+
+ ENDPOINT + rtd.gamecult.org:3076 +
+
![Jackal buggy engaging gilded Imperial walkers on the Sion valley floor under a single-draw-call Vulkan HUD](media/hud-hbgpu-sion.webp) +
+ ## What the Game Is *Rust to Dust* drops 12 contenders—solo or in squads—into a live arena ring. The last contender or squad left standing after final-ring orbital redeployments close wins the match. On the ground, you pilot one of 15 chassis spanning wheeled buggies, tracked tanks, VTOL craft, four-legged walkers, and tall bipedal mechs. Around the perimeter orbit three tiers of Imperial spectators—heavy gilded Tourist walkers, agile Patron hunters, and stealthy Exemplar escorts—who stay neutral until provoked. Opening fire near them triggers a lethal hunt under live Imperial Broadcast commentary, while bringing one down drops high-tier Imperial weapons and multi-stage ordnance onto the field. @@ -25,11 +56,25 @@ Every vehicle and mech is simulated as a physical 2D thermal grid: That combat plays out over a `3,072 m × 3,072 m` Swiss Alpine valley centered on Sion alongside a `1,536 m × 1,536 m` desert testbed. Artillery craters, blast scorches, and tire tracks stamp straight into the shared `192 m` terrain grid, altering physics collision and surviving from match to match in a persistent scar cache. +
+ ![Sunlight and deep valley shadows across Sion Old Town and the Valère citadel during a skirmish](media/lighting-sdfgi-sion.webp) ![Artillery smoke plumes drifting across the Sion arena behind a Jackal buggy and hostile walkers](media/plume-sion.webp) ## Sections -- [Architecture](/Architecture/) — Six engineering teardowns covering the single-draw-call Vulkan HUD, `0.5 m` swisstopo terrain and tiled physics, lighting and volumetric plumes, thermal-grid netcode, upright mech walkers (work in progress), and planned destructible Sion buildings and valley foliage. -- [Lore](/Lore/) — Setting notes and world documentation authored by Weksa. +
+ + 01 // ARCHITECTURE + Subsystem Teardowns + Six engineering teardowns: single-draw-call Vulkan HUD, 0.5 m swisstopo terrain and tiled physics, lighting and volumetric plumes, thermal-grid netcode, upright mech walkers, and destructible Sion buildings. + ACCESS CHANNEL -> + + + 02 // LORE + Setting & World Notes + Sion valley theater history, factions, and operational field dossiers. + ACCESS CHANNEL -> + +
diff --git a/scripts/deploy-yggdrasil.sh b/scripts/deploy-yggdrasil.sh index d47c142..bb3a3a0 100755 --- a/scripts/deploy-yggdrasil.sh +++ b/scripts/deploy-yggdrasil.sh @@ -23,10 +23,12 @@ node "${WORK}/GameCult-Quartz/scripts/build-site.mjs" build \ --siteRoot "${WORK}/rtd-site" \ --contentDir content \ --overlayDir site \ - --outputDir "${RELEASE_DIR}" + --outputDir "${WORK}/public" -test -s "${RELEASE_DIR}/index.html" -test -s "${RELEASE_DIR}/index.css" +test -s "${WORK}/public/index.html" +test -s "${WORK}/public/index.css" + +mv "${WORK}/public" "${RELEASE_DIR}" ln -sfn "${RELEASE_DIR}" "${CURRENT_LINK}" ACTIVE_TARGET="$(readlink -f "${CURRENT_LINK}")" diff --git a/site/quartz.config.ts b/site/quartz.config.ts index c6f8b78..c8019d2 100644 --- a/site/quartz.config.ts +++ b/site/quartz.config.ts @@ -1,4 +1,4 @@ -import { Fragment, h } from "preact" +import { h } from "preact" import { QuartzConfig } from "./quartz/cfg" import * as Plugin from "./quartz/plugins" import { QuartzEmitterPlugin } from "./quartz/plugins/types" @@ -9,11 +9,8 @@ const RtdMeta: QuartzEmitterPlugin = () => ({ async *partialEmit() {}, externalResources: () => ({ additionalHead: [ - () => - h(Fragment, {}, [ - h("meta", { name: "theme-color", content: "#0E1114" }), - h("meta", { name: "twitter:card", content: "summary_large_image" }), - ]), + () => h("meta", { name: "theme-color", content: "#0D100D" }), + () => h("script", { src: "/static/sion-hud.js", defer: true }), ], }), }) @@ -35,31 +32,31 @@ const config: QuartzConfig = { typography: { title: "JetBrains Mono", header: "JetBrains Mono", - body: "Inter", + body: "JetBrains Mono", code: "Monaspace Krypton", }, colors: { lightMode: { - light: "#0E1114", - lightgray: "#1D252E", - gray: "#6E7D8C", - darkgray: "#C9D3DC", - dark: "#EBF0F5", - secondary: "#E09838", - tertiary: "#38C4D4", - highlight: "rgba(56, 196, 212, 0.12)", - textHighlight: "#E0983844", + light: "#0d100d", + lightgray: "#3e4638", + gray: "#989487", + darkgray: "#e4dfd2", + dark: "#e4dfd2", + secondary: "#9bb06a", + tertiary: "#44d9e8", + highlight: "rgba(155, 176, 106, 0.12)", + textHighlight: "#e08a4a44", }, darkMode: { - light: "#0E1114", - lightgray: "#1D252E", - gray: "#6E7D8C", - darkgray: "#C9D3DC", - dark: "#EBF0F5", - secondary: "#E09838", - tertiary: "#38C4D4", - highlight: "rgba(56, 196, 212, 0.12)", - textHighlight: "#E0983844", + light: "#0d100d", + lightgray: "#3e4638", + gray: "#989487", + darkgray: "#e4dfd2", + dark: "#e4dfd2", + secondary: "#9bb06a", + tertiary: "#44d9e8", + highlight: "rgba(155, 176, 106, 0.12)", + textHighlight: "#e08a4a44", }, }, }, diff --git a/site/quartz/components/RtdMasthead.tsx b/site/quartz/components/RtdMasthead.tsx index 5798df1..f82b211 100644 --- a/site/quartz/components/RtdMasthead.tsx +++ b/site/quartz/components/RtdMasthead.tsx @@ -2,11 +2,13 @@ import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } fro import { FullSlug, resolveRelative } from "../util/path" const routes = [ - { label: "Overview", slug: "index" as FullSlug, prefix: "index" }, - { label: "Architecture", slug: "Architecture/index" as FullSlug, prefix: "Architecture" }, - { label: "Lore", slug: "Lore/index" as FullSlug, prefix: "Lore" }, + { code: "01", label: "OVERVIEW", slug: "index" as FullSlug, prefix: "index" }, + { code: "02", label: "ARCHITECTURE", slug: "Architecture/index" as FullSlug, prefix: "Architecture" }, + { code: "03", label: "LORE", slug: "Lore/index" as FullSlug, prefix: "Lore" }, ] +const compassDegrees = Array.from({ length: 73 }, (_, i) => i * 5) + function isActive(currentSlug: string, prefix: string) { return prefix === "index" ? currentSlug === "index" @@ -21,6 +23,36 @@ const lobbyStatusScript = ` const controller = typeof AbortController === "function" ? new AbortController() : null; const timer = controller ? window.setTimeout(() => controller.abort(), 4000) : null; + function makeCell(label, value, extraClass, withPip, asCode) { + const cell = document.createElement("div"); + cell.className = extraClass ? "rtd-telemetry-cell " + extraClass : "rtd-telemetry-cell"; + + const lbl = document.createElement("span"); + lbl.className = "rtd-telemetry-label"; + lbl.textContent = label; + + const val = document.createElement("span"); + val.className = "rtd-telemetry-value"; + + if (withPip) { + const pip = document.createElement("span"); + pip.className = "rtd-telemetry-pip"; + pip.setAttribute("aria-hidden", "true"); + val.appendChild(pip); + val.appendChild(document.createTextNode(value)); + } else if (asCode) { + const code = document.createElement("code"); + code.textContent = value; + val.appendChild(code); + } else { + val.textContent = value; + } + + cell.appendChild(lbl); + cell.appendChild(val); + return cell; + } + fetch("/api/directory/servers", { headers: { Accept: "application/json" }, signal: controller ? controller.signal : undefined, @@ -31,29 +63,25 @@ const lobbyStatusScript = ` const srv = servers[0]; if (!srv || typeof srv !== "object") return; - const name = typeof srv.name === "string" && srv.name.trim() ? srv.name.trim() : "Sion Lobby"; - const humans = Number.isFinite(srv.humans) ? String(srv.humans) : "?"; - const maxHumans = Number.isFinite(srv.maxHumans) ? String(srv.maxHumans) : "?"; - const map = typeof srv.map === "string" && srv.map.trim() ? srv.map.trim() : "unknown"; - const phase = typeof srv.phase === "string" && srv.phase.trim() ? srv.phase.trim() : "unknown"; + const name = typeof srv.name === "string" && srv.name.trim() ? srv.name.trim() : "SION LOBBY"; + const humans = Number.isFinite(srv.humans) ? String(srv.humans) : "--"; + const maxHumans = Number.isFinite(srv.maxHumans) ? String(srv.maxHumans) : "--"; + const map = typeof srv.map === "string" && srv.map.trim() ? srv.map.trim().toUpperCase() : "SION"; + const phase = typeof srv.phase === "string" && srv.phase.trim() ? srv.phase.trim().toUpperCase() : "DIRECT"; const endpoint = typeof srv.publicHost === "string" && srv.publicHost.trim() && Number.isFinite(srv.udpPort) ? srv.publicHost.trim() + ":" + String(srv.udpPort) : "rtd.gamecult.org:3076"; for (const el of targets) { - const dot = document.createElement("span"); - dot.className = "rtd-telemetry-dot"; - dot.setAttribute("aria-hidden", "true"); - - const summary = document.createElement("span"); - summary.textContent = - name + " · " + humans + "/" + maxHumans + " · " + map + " · " + phase + " · "; - - const code = document.createElement("code"); - code.textContent = endpoint; - - el.replaceChildren(dot, summary, code); + el.replaceChildren( + makeCell("LINK", "LIVE", "rtd-telemetry-link", true, false), + makeCell("NODE", name, "", false, false), + makeCell("CREW", humans + "/" + maxHumans, "", false, false), + makeCell("SECTOR", map, "", false, false), + makeCell("STATE", phase, "", false, false), + makeCell("ENDPOINT", endpoint, "rtd-telemetry-endpoint", false, true) + ); el.setAttribute("data-rtd-lobby-live", "true"); } }) @@ -70,30 +98,94 @@ export default (() => { return (
- - RUST TO DUST - - + + + + + + RUST TO DUST + + SYS // RTD-01 + + + + + +
) } diff --git a/site/quartz/static/sion-dem.png b/site/quartz/static/sion-dem.png new file mode 100644 index 0000000..bcec82b Binary files /dev/null and b/site/quartz/static/sion-dem.png differ diff --git a/site/quartz/static/sion-hud.js b/site/quartz/static/sion-hud.js new file mode 100644 index 0000000..8273425 --- /dev/null +++ b/site/quartz/static/sion-hud.js @@ -0,0 +1,471 @@ +(() => { + "use strict"; + if (typeof window === "undefined" || typeof document === "undefined") return; + if (document.getElementById("rtd-terrain-canvas")) return; + + const GRID = 224, WORLD_SIZE = 10.0, HEIGHT_SCALE = 2.65, RT_SCALE = 0.8, MAX_DPR = 1.75; + const TARGET = [0.05, 0.34, -0.15]; + const BASE_YAW = -0.78, BASE_PITCH = 0.49, BASE_DIST = 6.15, FOV_Y = (38 * Math.PI) / 180; + + const DEM_GLSL = ` +vec3 decodeTexel(ivec2 p, ivec2 maxC) { + vec4 t = texelFetch(uDem, clamp(p, ivec2(0), maxC), 0); + return vec3((t.r * 256.0 + t.g) / 257.0, t.b, t.a); +} +vec3 sampleDem(vec2 uv) { + vec2 maxF = uDemSize - 1.0; + ivec2 maxC = ivec2(maxF); + vec2 fc = clamp(uv, 0.0, 1.0) * maxF; + ivec2 p0 = ivec2(floor(fc)); + vec2 f = fract(fc); + vec3 d00 = decodeTexel(p0, maxC); + vec3 d10 = decodeTexel(p0 + ivec2(1, 0), maxC); + vec3 d01 = decodeTexel(p0 + ivec2(0, 1), maxC); + vec3 d11 = decodeTexel(p0 + ivec2(1, 1), maxC); + return mix(mix(d00, d10, f.x), mix(d01, d11, f.x), f.y); +}`; + + const PASS1_VS = `#version 300 es +precision highp float; +precision highp int; +layout(location = 0) in vec2 aUv; +uniform sampler2D uDem; +uniform vec2 uDemSize; +uniform mat4 uViewProj; +uniform float uWorldSize, uHeightScale; +out vec2 vUv; +out vec3 vWorldPos; +${DEM_GLSL} +void main() { + vec3 dem = sampleDem(aUv); + vec3 wp = vec3((aUv.x - 0.5) * uWorldSize, dem.x * uHeightScale, (aUv.y - 0.5) * uWorldSize); + vUv = aUv; + vWorldPos = wp; + gl_Position = uViewProj * vec4(wp, 1.0); +}`; + + const PASS1_FS = `#version 300 es +precision highp float; +precision highp int; +in vec2 vUv; +in vec3 vWorldPos; +uniform sampler2D uDem; +uniform vec2 uDemSize, uCursorXZ; +uniform vec3 uCamPos; +uniform float uWorldSize, uHeightScale, uTime, uFocusDist, uCursorAlpha; +out vec4 fragColor; +const float TAU = 6.28318530718; +const vec3 GROUND = vec3(0.051, 0.063, 0.051); +const vec3 C_MINOR = vec3(0.180, 0.228, 0.165); +const vec3 C_MAJOR = vec3(0.416, 0.502, 0.314); +const vec3 C_OLIVE = vec3(0.608, 0.690, 0.416); +const vec3 C_BONE = vec3(0.847, 0.824, 0.745); +const vec3 C_CYAN = vec3(0.267, 0.851, 0.910); +const vec3 C_AMBER = vec3(0.878, 0.541, 0.290); +${DEM_GLSL} +float pxLine(float val, float spacing, float pxWidth) { + float s = val / spacing; + float fw = max(fwidth(s), 1e-5); + float d = abs(fract(s + 0.5) - 0.5) / fw; + return (1.0 - smoothstep(pxWidth * 0.5, pxWidth * 0.5 + 1.0, d)) * smoothstep(0.60, 0.20, fw); +} +float pxRing(float dist, float radius, float pxWidth) { + float d = abs(dist - radius) / max(fwidth(dist), 1e-4); + return 1.0 - smoothstep(pxWidth * 0.5, pxWidth * 0.5 + 1.0, d); +} +void main() { + vec3 dem = sampleDem(vUv); + float h = dem.x, urban = dem.y, water = dem.z; + vec2 texel = 1.0 / uDemSize; + float hL = sampleDem(vUv - vec2(texel.x, 0.0)).x; + float hR = sampleDem(vUv + vec2(texel.x, 0.0)).x; + float hD = sampleDem(vUv - vec2(0.0, texel.y)).x; + float hU = sampleDem(vUv + vec2(0.0, texel.y)).x; + vec3 N = normalize(vec3((hL - hR) * uHeightScale, 2.0 * uWorldSize * texel.x, (hD - hU) * uHeightScale)); + + vec3 viewVec = uCamPos - vWorldPos; + float viewDepth = length(viewVec); + vec3 V = viewVec / max(viewDepth, 1e-4); + vec3 L = normalize(vec3(-0.62, 0.66, 0.42)); + float ndl = max(dot(N, L), 0.0); + float rim = pow(1.0 - max(dot(N, V), 0.0), 2.6) * (0.35 + 0.65 * smoothstep(0.06, 0.72, h)); + float slope = 1.0 - clamp(N.y, 0.0, 1.0); + + vec3 col = GROUND; + col += vec3(0.050, 0.068, 0.044) * (0.28 + 0.72 * ndl) * (0.45 + 0.55 * h); + col += vec3(0.085, 0.112, 0.070) * rim * (0.45 + 0.55 * slope); + + float dryMask = 1.0 - smoothstep(0.18, 0.62, water); + float minorC = pxLine(h, 0.018, 0.85) * dryMask; + float majorC = pxLine(h, 0.090, 1.20) * dryMask; + col = mix(col, C_MINOR, minorC * (0.55 + 0.25 * ndl)); + col = mix(col, mix(C_MAJOR, C_OLIVE, clamp(0.25 + 0.55 * ndl + 0.35 * h, 0.0, 1.0)), majorC * 0.78); + + // Rhone river fill and shoreline highlight + float waterFill = smoothstep(0.18, 0.68, water); + float shore = 1.0 - smoothstep(0.6, 1.8, abs(water - 0.36) / max(fwidth(water), 1e-4)); + col = mix(col, mix(GROUND, C_CYAN, 0.26), waterFill * 0.85); + col += C_CYAN * shore * 0.52 * smoothstep(0.06, 0.30, water); + + // Sion building clusters + float urbMask = smoothstep(0.06, 0.75, urban); + float urbEdge = clamp(fwidth(urban) * 1.4, 0.0, 1.0) * step(0.05, urban); + col = mix(col, mix(C_OLIVE, C_BONE, smoothstep(0.15, 0.88, urban)) * 0.64, urbMask * 0.85); + col += C_BONE * urbEdge * 0.22; + + // Projected tactical safe-circle, outer range ring, and slow bearing sweep + vec2 relSion = vWorldPos.xz - vec2(-0.55, 0.35); + float rSion = length(relSion), ang = atan(relSion.y, relSion.x); + float safeRing = pxRing(rSion, 1.62, 1.25) * smoothstep(0.32, 0.38, fract(ang * 28.0 / TAU)); + float outerRing = pxRing(rSion, 2.85, 0.90) * smoothstep(0.50, 0.56, fract(ang * 48.0 / TAU)); + float behind = mod(mod(uTime * 0.20, TAU) - 3.14159265 - ang + TAU, TAU); + float sweep = exp(-behind * 4.8) * smoothstep(2.90, 2.78, rSion) * smoothstep(0.18, 0.55, rSion); + float ray = smoothstep(0.022, 0.0, behind) * smoothstep(2.88, 2.82, rSion); + col += C_AMBER * safeRing * 0.68 + C_OLIVE * outerRing * 0.22 + mix(C_OLIVE, C_AMBER, 0.38) * (sweep * 0.075 + ray * 0.18); + + // Cursor target reticle on valley floor + if (uCursorAlpha > 0.005) { + vec2 relCur = vWorldPos.xz - uCursorXZ; + float cRing = pxRing(length(relCur), 0.22, 1.15); + float tX = (1.0 - smoothstep(0.012, 0.024, abs(relCur.y))) * step(0.11, abs(relCur.x)) * step(abs(relCur.x), 0.31); + float tZ = (1.0 - smoothstep(0.012, 0.024, abs(relCur.x))) * step(0.11, abs(relCur.y)) * step(abs(relCur.y), 0.31); + col += mix(C_AMBER, C_CYAN, 0.25) * (cRing * 0.52 + max(tX, tZ) * 0.32) * uCursorAlpha; + } + + float edgeFade = smoothstep(0.0, 0.08, min(min(vUv.x, 1.0 - vUv.x), min(vUv.y, 1.0 - vUv.y))); + col = mix(GROUND, col, edgeFade * (1.0 - smoothstep(8.2, 13.5, viewDepth))); + + float diff = viewDepth - uFocusDist; + float coc = clamp(max(abs(diff) - 0.58, 0.0) * sign(diff) / 3.35, -1.0, 1.0); + fragColor = vec4(clamp(col, 0.0, 1.0), clamp(0.5 + 0.5 * coc, 0.0, 1.0)); +}`; + + const PASS2_VS = `#version 300 es +precision highp float; +out vec2 vUv; +void main() { + vec2 pos = vec2(float((gl_VertexID & 1) << 2) - 1.0, float((gl_VertexID & 2) << 1) - 1.0); + vUv = pos * 0.5 + 0.5; + gl_Position = vec4(pos, 0.0, 1.0); +}`; + + const PASS2_FS = `#version 300 es +precision highp float; +in vec2 vUv; +uniform sampler2D uScene; +uniform vec2 uSceneRes; +uniform float uAspect, uGrainSeed; +out vec4 fragColor; +const float GOLDEN_ANGLE = 2.39996323; +const vec3 GROUND = vec3(0.051, 0.063, 0.051); +const vec3 HALATION = vec3(1.0, 0.44, 0.16); +void main() { + vec2 invRes = 1.0 / uSceneRes; + vec4 c0 = texture(uScene, vUv); + float blur = abs(c0.a * 2.0 - 1.0); + vec3 acc = c0.rgb; + float wSum = 1.0; + if (blur > 0.012) { + for (int i = 0; i < 24; i++) { + float r = sqrt((float(i) + 0.5) / 24.0); + float a = float(i) * GOLDEN_ANGLE; + vec2 off = vec2(cos(a), sin(a)) * (r * blur * 8.5) * invRes; + vec4 s = texture(uScene, clamp(vUv + off, 0.001, 0.999)); + float sCoc = s.a * 2.0 - 1.0; + float w = ((sCoc < 0.0) ? 1.0 : smoothstep(0.0, 0.24, abs(sCoc) + blur * 0.65)) + * (1.0 + 0.35 * dot(s.rgb, vec3(0.30, 0.58, 0.12))); + acc += s.rgb * w; + wSum += w; + } + } + vec3 col = acc / wSum; + + // Radial lateral chromatic aberration + warm amber halation + vec2 fromC = vUv - 0.5; + vec2 caOff = fromC * (0.0018 + 0.0038 * blur) * (0.35 + 2.1 * dot(fromC, fromC)); + col.r = mix(col.r, texture(uScene, clamp(vUv + caOff, 0.001, 0.999)).r, 0.42); + col.b = mix(col.b, texture(uScene, clamp(vUv - caOff, 0.001, 0.999)).b, 0.42); + + vec2 hs = invRes * 5.5; + vec3 glow = ( + texture(uScene, clamp(vUv + hs, 0.001, 0.999)).rgb + + texture(uScene, clamp(vUv - hs, 0.001, 0.999)).rgb + + texture(uScene, clamp(vUv + vec2(-hs.x, hs.y), 0.001, 0.999)).rgb + + texture(uScene, clamp(vUv + vec2(hs.x, -hs.y), 0.001, 0.999)).rgb + ) * 0.25; + col += HALATION * max(max(glow.r, max(glow.g, glow.b)) - 0.24, 0.0) * 0.26; + + // Low-luminance grade + cos^4 vignette + deterministic 1/255 grain + col = mix(GROUND, col, 0.86); + col = col / (1.0 + col * 0.42); + vec2 vPos = fromC * vec2(uAspect * 0.52, 0.72); + float vig = pow(inversesqrt(1.0 + dot(vPos, vPos)), 4.0); + col = mix(vec3(0.036, 0.044, 0.036), col, mix(0.44, 1.0, vig)); + float ign = fract(52.9829189 * fract(dot(gl_FragCoord.xy + uGrainSeed, vec2(0.06711056, 0.00583715)))); + col += (ign - 0.5) / 255.0 * 1.4; + fragColor = vec4(clamp(col, 0.0, 1.0), 1.0); +}`; + + function compile(gl, type, src) { + const sh = gl.createShader(type); + if (!sh) return null; + gl.shaderSource(sh, src); + gl.compileShader(sh); + if (!gl.getShaderParameter(sh, gl.COMPILE_STATUS)) { gl.deleteShader(sh); return null; } + return sh; + } + + function link(gl, vsSrc, fsSrc) { + const vs = compile(gl, gl.VERTEX_SHADER, vsSrc), fs = compile(gl, gl.FRAGMENT_SHADER, fsSrc); + if (!vs || !fs) return null; + const p = gl.createProgram(); + gl.attachShader(p, vs); gl.attachShader(p, fs); gl.linkProgram(p); + gl.deleteShader(vs); gl.deleteShader(fs); + if (!gl.getProgramParameter(p, gl.LINK_STATUS)) { gl.deleteProgram(p); return null; } + return p; + } + + function uniforms(gl, p, names) { + const out = {}; + for (const n of names) out[n] = gl.getUniformLocation(p, n); + return out; + } + + function buildCamera(eye, target, aspect) { + let zx = eye[0] - target[0], zy = eye[1] - target[1], zz = eye[2] - target[2]; + let len = Math.hypot(zx, zy, zz) || 1; + zx /= len; zy /= len; zz /= len; + let xx = zz, xz = -zx; + len = Math.hypot(xx, xz) || 1; + xx /= len; xz /= len; + const yx = zy * xz, yy = zz * xx - zx * xz, yz = -zy * xx; + const tx = -(xx * eye[0] + xz * eye[2]); + const ty = -(yx * eye[0] + yy * eye[1] + yz * eye[2]); + const tz = -(zx * eye[0] + zy * eye[1] + zz * eye[2]); + const f = 1 / Math.tan(FOV_Y * 0.5), near = 0.25, far = 26.0, nf = 1 / (near - far); + const pa = f / aspect, pc = (far + near) * nf, pd = 2 * far * near * nf; + const vp = new Float32Array([ + pa * xx, f * yx, pc * zx, -zx, + 0, f * yy, pc * zy, -zy, + pa * xz, f * yz, pc * zz, -zz, + pa * tx, f * ty, pc * tz + pd, -tz, + ]); + return { vp, right: [xx, 0, xz], up: [yx, yy, yz], fwd: [-zx, -zy, -zz] }; + } + + function init() { + if (!document.body) return; + const canvas = document.createElement("canvas"); + canvas.id = "rtd-terrain-canvas"; + canvas.setAttribute("aria-hidden", "true"); + canvas.style.cssText = "position:fixed;inset:0;width:100vw;height:100vh;z-index:0;pointer-events:none;display:block;"; + + const gl = canvas.getContext("webgl2", { + alpha: false, antialias: false, depth: false, stencil: false, + powerPreference: "low-power", preserveDrawingBuffer: false, + }); + if (!gl) return; + + const p1 = link(gl, PASS1_VS, PASS1_FS), p2 = link(gl, PASS2_VS, PASS2_FS); + if (!p1 || !p2) return; + + const verts = new Float32Array((GRID + 1) * (GRID + 1) * 2); + for (let j = 0, vi = 0; j <= GRID; j++) { + for (let i = 0; i <= GRID; i++) { verts[vi++] = i / GRID; verts[vi++] = j / GRID; } + } + const indices = new Uint16Array(GRID * GRID * 6); + for (let j = 0, ii = 0, row = GRID + 1; j < GRID; j++) { + for (let i = 0; i < GRID; i++) { + const a = j * row + i; + indices[ii++] = a; indices[ii++] = a + row; indices[ii++] = a + 1; + indices[ii++] = a + 1; indices[ii++] = a + row; indices[ii++] = a + row + 1; + } + } + + const meshVao = gl.createVertexArray(), quadVao = gl.createVertexArray(); + gl.bindVertexArray(meshVao); + gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer()); + gl.bufferData(gl.ARRAY_BUFFER, verts, gl.STATIC_DRAW); + gl.enableVertexAttribArray(0); + gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gl.createBuffer()); + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW); + gl.bindVertexArray(null); + + const demTex = gl.createTexture(), sceneFbo = gl.createFramebuffer(); + const sceneTex = gl.createTexture(), sceneDepth = gl.createRenderbuffer(); + const u1 = uniforms(gl, p1, [ + "uDem", "uDemSize", "uViewProj", "uWorldSize", "uHeightScale", + "uCamPos", "uTime", "uFocusDist", "uCursorXZ", "uCursorAlpha", + ]); + const u2 = uniforms(gl, p2, ["uScene", "uSceneRes", "uAspect", "uGrainSeed"]); + + let width = 1, height = 1, rtW = 1, rtH = 1, demW = 320, demH = 320; + let mounted = false, contextLost = false, rafId = 0; + + function resize() { + const dpr = Math.min(window.devicePixelRatio || 1, MAX_DPR); + const w = Math.max(1, Math.round(window.innerWidth * dpr)); + const h = Math.max(1, Math.round(window.innerHeight * dpr)); + if (w === width && h === height && mounted) return true; + width = w; height = h; canvas.width = w; canvas.height = h; + rtW = Math.max(1, Math.round(w * RT_SCALE)); + rtH = Math.max(1, Math.round(h * RT_SCALE)); + + gl.bindTexture(gl.TEXTURE_2D, sceneTex); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, rtW, rtH, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + + gl.bindRenderbuffer(gl.RENDERBUFFER, sceneDepth); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, rtW, rtH); + gl.bindFramebuffer(gl.FRAMEBUFFER, sceneFbo); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, sceneTex, 0); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, sceneDepth); + const ok = gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE; + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + return ok; + } + + const mql = window.matchMedia ? window.matchMedia("(prefers-reduced-motion: reduce)") : null; + let reduced = Boolean(mql && mql.matches); + let ptrX = 0, ptrY = 0, ptrActive = false, lastTs = 0, elapsed = 0; + let smX = 0, smY = 0, smFocus = BASE_DIST, smCurX = -0.55, smCurZ = 0.35, smCurA = 0; + + function render(dt) { + if (contextLost) return; + const damp = reduced ? 1 : 1 - Math.exp(-dt * 4.5); + const afDamp = reduced ? 1 : 1 - Math.exp(-dt * 3.4); + smX += ((ptrActive && !reduced ? ptrX : 0) - smX) * damp; + smY += ((ptrActive && !reduced ? ptrY : 0) - smY) * damp; + smCurA += ((ptrActive && !reduced ? 1 : 0) - smCurA) * damp; + + const yaw = BASE_YAW + (reduced ? 0 : Math.sin(elapsed * 0.065) * 0.055) + smX * 0.061; + const pitch = BASE_PITCH - smY * 0.031, cp = Math.cos(pitch); + const eye = [ + TARGET[0] + cp * Math.sin(yaw) * BASE_DIST, + TARGET[1] + Math.sin(pitch) * BASE_DIST, + TARGET[2] + cp * Math.cos(yaw) * BASE_DIST, + ]; + const aspect = width / height, cam = buildCamera(eye, TARGET, aspect); + + let targetFocus = BASE_DIST; + if (ptrActive && !reduced) { + const thf = Math.tan(FOV_Y * 0.5); + const rx = cam.fwd[0] + cam.right[0] * (smX * thf * aspect) + cam.up[0] * (-smY * thf); + const ry = cam.fwd[1] + cam.up[1] * (-smY * thf); + const rz = cam.fwd[2] + cam.right[2] * (smX * thf * aspect) + cam.up[2] * (-smY * thf); + if (ry < -0.05) { + const tHit = (0.14 - eye[1]) / ry; + const hx = Math.max(-4.4, Math.min(4.4, eye[0] + rx * tHit)); + const hz = Math.max(-4.4, Math.min(4.4, eye[2] + rz * tHit)); + smCurX += (hx - smCurX) * damp; + smCurZ += (hz - smCurZ) * damp; + targetFocus = Math.max(3.3, Math.min(9.5, Math.hypot(hx - eye[0], 0.14 - eye[1], hz - eye[2]))); + } + } + smFocus += (targetFocus - smFocus) * afDamp; + + // Pass 1: 3D Sion terrain + CoC to 0.8x FBO + gl.bindFramebuffer(gl.FRAMEBUFFER, sceneFbo); + gl.viewport(0, 0, rtW, rtH); + gl.enable(gl.DEPTH_TEST); + gl.depthFunc(gl.LESS); + gl.clearColor(0.051, 0.063, 0.051, 0.92); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + gl.useProgram(p1); + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, demTex); + gl.uniform1i(u1.uDem, 0); + gl.uniform2f(u1.uDemSize, demW, demH); + gl.uniformMatrix4fv(u1.uViewProj, false, cam.vp); + gl.uniform1f(u1.uWorldSize, WORLD_SIZE); + gl.uniform1f(u1.uHeightScale, HEIGHT_SCALE); + gl.uniform3f(u1.uCamPos, eye[0], eye[1], eye[2]); + gl.uniform1f(u1.uTime, elapsed); + gl.uniform1f(u1.uFocusDist, smFocus); + gl.uniform2f(u1.uCursorXZ, smCurX, smCurZ); + gl.uniform1f(u1.uCursorAlpha, smCurA); + gl.bindVertexArray(meshVao); + gl.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_SHORT, 0); + + // Pass 2: Fullscreen optical bokeh DoF + CA + halation + vignette + grain + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.viewport(0, 0, width, height); + gl.disable(gl.DEPTH_TEST); + gl.useProgram(p2); + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, sceneTex); + gl.uniform1i(u2.uScene, 0); + gl.uniform2f(u2.uSceneRes, rtW, rtH); + gl.uniform1f(u2.uAspect, aspect); + gl.uniform1f(u2.uGrainSeed, reduced ? 0.0 : (elapsed * 23.0) % 100.0); + gl.bindVertexArray(quadVao); + gl.drawArrays(gl.TRIANGLES, 0, 3); + gl.bindVertexArray(null); + } + + function tick(ts) { + rafId = 0; + if (reduced || document.hidden || contextLost) return; + const dt = lastTs ? Math.min((ts - lastTs) * 0.001, 0.05) : 0.016; + lastTs = ts; + elapsed += dt; + render(dt); + rafId = window.requestAnimationFrame(tick); + } + const startLoop = () => { if (!reduced && !document.hidden && !contextLost && !rafId) { lastTs = 0; rafId = window.requestAnimationFrame(tick); } }; + const stopLoop = () => { if (rafId) { window.cancelAnimationFrame(rafId); rafId = 0; } }; + + const img = new Image(); + img.decoding = "async"; + img.onload = () => { + if (!img.naturalWidth || !img.naturalHeight || contextLost) return; + demW = img.naturalWidth; demH = img.naturalHeight; + gl.bindTexture(gl.TEXTURE_2D, demTex); + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, gl.RGBA, gl.UNSIGNED_BYTE, img); + if (!resize()) return; + + document.body.insertBefore(canvas, document.body.firstChild); + document.body.classList.add("rtd-webgl-active"); + mounted = true; + render(0); + if (!reduced) startLoop(); + + window.addEventListener("resize", () => { if (resize() && (reduced || !rafId)) render(0); }, { passive: true }); + window.addEventListener("pointermove", (e) => { + if (!window.innerWidth || !window.innerHeight) return; + ptrX = (e.clientX / window.innerWidth) * 2 - 1; + ptrY = (e.clientY / window.innerHeight) * 2 - 1; + ptrActive = true; + }, { passive: true }); + window.addEventListener("pointerleave", () => { ptrActive = false; }, { passive: true }); + window.addEventListener("blur", () => { ptrActive = false; }, { passive: true }); + document.addEventListener("visibilitychange", () => { if (document.hidden) stopLoop(); else if (!reduced) startLoop(); }); + if (mql && typeof mql.addEventListener === "function") { + mql.addEventListener("change", (ev) => { + reduced = ev.matches; + if (reduced) { stopLoop(); render(0); } else startLoop(); + }); + } + canvas.addEventListener("webglcontextlost", (ev) => { + ev.preventDefault(); contextLost = true; stopLoop(); + document.body.classList.remove("rtd-webgl-active"); + }); + }; + img.onerror = () => {}; + img.src = "/static/sion-dem.png"; + } + + if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", init, { once: true }); + else init(); +})(); diff --git a/site/quartz/styles/custom.scss b/site/quartz/styles/custom.scss index 70ec8f9..bfed6f2 100644 --- a/site/quartz/styles/custom.scss +++ b/site/quartz/styles/custom.scss @@ -6,40 +6,128 @@ font-display: swap; } -:root, +:root:root, :root[saved-theme="dark"], :root[saved-theme="light"], +html, body { color-scheme: dark; - --rtd-ground: #0e1114; - --rtd-plate: #151a1f; - --rtd-border: #26303a; - --rtd-amber: #e09838; - --rtd-cyan: #38c4d4; - --rtd-rust: #d94b38; - --rtd-measure: 70ch; + + --rtd-ground: #0d100d; + --rtd-plate: #141814; + --rtd-plate-inner: #1b1f1b; + --rtd-glass: rgba(13, 16, 13, 0.8); + --rtd-glass-inner: rgba(20, 25, 20, 0.84); + --rtd-glass-hover: rgba(25, 31, 24, 0.88); + --rtd-border: #3e4638; + --rtd-olive: #9bb06a; + --rtd-orange: #e08a4a; + --rtd-gold: #e6b838; + --rtd-cyan: #44d9e8; + --rtd-allied: #52e3a8; + --rtd-red: #d93829; + --rtd-ink: #e4dfd2; + --rtd-muted: #989487; + + --light: #0d100d; + --lightgray: #3e4638; + --gray: #989487; + --darkgray: #e4dfd2; + --dark: #e4dfd2; + --secondary: #9bb06a; + --tertiary: #44d9e8; + --highlight: rgba(155, 176, 106, 0.12); + --textHighlight: #e08a4a44; + + --rtd-measure: 68ch; --rtd-column: 72rem; + --titleFont: "Monaspace Krypton", ui-monospace, SFMono-Regular, Menlo, monospace; --headerFont: "Monaspace Krypton", ui-monospace, SFMono-Regular, Menlo, monospace; - --bodyFont: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; + --bodyFont: "Monaspace Krypton", ui-monospace, SFMono-Regular, Menlo, monospace; --codeFont: "Monaspace Krypton", ui-monospace, SFMono-Regular, Menlo, monospace; } -html { scroll-behavior: smooth; } -body { +html { + width: 100%; + scroll-behavior: smooth; overflow-x: clip; - background: var(--rtd-ground); - color: var(--darkgray); + background-color: var(--rtd-ground); font-family: var(--bodyFont); + font-variant-numeric: tabular-nums; +} + +body { + margin: 0; + width: 100%; + overflow-x: clip; + background-color: var(--rtd-ground); + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg stroke='%233e4638' stroke-opacity='0.28' stroke-width='1' fill='none'%3E%3Cpath d='M32 28.5v7M28.5 32h7'/%3E%3C/g%3E%3C/svg%3E"); + background-size: 64px 64px; + background-position: top left; + color: var(--rtd-ink); + font-family: var(--bodyFont); + font-variant-numeric: tabular-nums; +} + +body.rtd-webgl-active { + background-color: transparent; + background-image: none; +} + +#rtd-terrain-canvas { + position: fixed; + inset: 0; + width: 100vw; + height: 100vh; + z-index: 0; + pointer-events: none; + display: block; +} + +button, +input, +select, +textarea, +code, +pre, +kbd, +samp { + font-family: var(--bodyFont); + font-variant-numeric: tabular-nums; +} + +/* Strip all rounded corners inherited from Quartz base styles */ +a.internal, +.text-highlight, +input[type="checkbox"], +pre, +code, +figure[data-rehype-pretty-code-figure] > [data-rehype-pretty-code-title], +pre > code [data-highlighted-chars], +img, +audio, +video, +.external-embed.youtube, +iframe.pdf { + border-radius: 0; +} + +::selection { + background: rgba(155, 176, 106, 0.3); + color: var(--rtd-ink); } .page { + position: relative; + z-index: 1; width: 100%; max-width: var(--rtd-column); margin: 0 auto; padding: 0 1.5rem; box-sizing: border-box; } + .page > #quartz-body { display: block; width: 100%; @@ -47,6 +135,7 @@ body { margin: 0; padding: 0; } + .page > #quartz-body .page-header, .page > #quartz-body .center, .page > #quartz-body .page-footer { @@ -55,110 +144,650 @@ body { margin: 0; padding: 0; } + .page > #quartz-body .page-header > header { display: block; width: 100%; - margin: 0 0 2.25rem; + margin: 0 0 2rem; padding: 0; border: 0; } + .page > #quartz-body .sidebar.left, .page > #quartz-body > hr, .page-listing, -.external-icon { display: none; } +.external-icon { + display: none; +} + .page > #quartz-body .sidebar.right { position: static; height: auto; padding: 1.5rem 0 0; } +/* Top Instrument Masthead */ .rtd-masthead { + display: flex; + flex-direction: column; + width: 100%; + padding-top: 1rem; + background: transparent; +} + +.rtd-masthead-top { + display: flex; + flex-wrap: wrap; + align-items: stretch; + justify-content: space-between; + gap: 0.75rem 1.25rem; + padding-bottom: 0.75rem; +} + +.rtd-brand { display: flex; flex-wrap: wrap; align-items: center; - justify-content: space-between; - gap: 0.9rem 1.75rem; - padding: 1.25rem 0 1rem; - border-bottom: 1px solid var(--rtd-border); + gap: 0.75rem; } + .rtd-wordmark { - color: var(--dark); + display: inline-flex; + align-items: center; + gap: 0.65rem; + color: var(--rtd-ink); font-family: var(--headerFont); - font-size: 1rem; + font-size: 0.96rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; } -.rtd-wordmark:hover { color: var(--rtd-amber); } + +.rtd-wordmark:hover, +.rtd-wordmark:focus-visible { + color: var(--rtd-olive); +} + +.rtd-emblem { + display: block; + width: 24px; + height: 24px; + flex-shrink: 0; +} + +.rtd-sys-tag { + display: inline-flex; + align-items: center; + padding: 0.2rem 0.5rem; + border: 1px solid var(--rtd-border); + background: var(--rtd-glass); + backdrop-filter: blur(4px); + color: var(--rtd-muted); + font-size: 0.68rem; + font-weight: 500; + letter-spacing: 0.14em; + text-transform: uppercase; + white-space: nowrap; +} + .rtd-nav { display: flex; flex-wrap: wrap; - align-items: center; - gap: 0.5rem 1.4rem; + align-items: stretch; + gap: 0; + border: 1px solid var(--rtd-border); + background: var(--rtd-glass); + backdrop-filter: blur(4px); } + .rtd-nav a { - color: var(--darkgray); + position: relative; + display: inline-flex; + align-items: center; + gap: 0.4rem; + padding: 0.45rem 0.8rem; + border-top: 2px solid transparent; + border-left: 1px solid var(--rtd-border); + color: var(--rtd-ink); font-family: var(--headerFont); - font-size: 0.84rem; + font-size: 0.76rem; font-weight: 500; - letter-spacing: 0.06em; + letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; + white-space: nowrap; + background: transparent; } -.rtd-nav a:hover, -.rtd-nav a:focus-visible, -.rtd-nav a.active { color: var(--rtd-amber); } -.rtd-nav .rtd-nav-quiet { color: var(--gray); } +.rtd-nav a:first-child { + border-left: 0; +} + +.rtd-nav-idx { + color: var(--rtd-muted); + font-size: 0.7rem; +} + +.rtd-nav a:hover, +.rtd-nav a:focus-visible { + color: var(--rtd-olive); + background: var(--rtd-plate-inner); + border-top-color: var(--rtd-border); +} + +.rtd-nav a.active { + color: var(--rtd-olive); + background: var(--rtd-plate-inner); + border-top-color: var(--rtd-olive); +} + +.rtd-nav a.active .rtd-nav-idx { + color: var(--rtd-orange); +} + +.rtd-nav a.active::before { + content: "["; + color: var(--rtd-orange); + margin-right: 0.1rem; +} + +.rtd-nav a.active::after { + content: "]"; + color: var(--rtd-orange); + margin-left: 0.1rem; +} + +.rtd-nav .rtd-nav-quiet { + color: var(--rtd-muted); +} + +.rtd-nav .rtd-nav-quiet:hover, +.rtd-nav .rtd-nav-quiet:focus-visible { + color: var(--rtd-cyan); +} + +/* Azimuth Bearing Compass Ruler */ +.rtd-compass { + width: 100%; + overflow: hidden; + border-bottom: 1px solid var(--rtd-border); + padding-bottom: 0.25rem; +} + +.rtd-compass-svg { + display: block; + width: 100%; + height: auto; +} + +.rtd-compass-svg text.rtd-compass-label { + fill: var(--rtd-muted); + font-family: var(--codeFont); + font-size: 8.5px; + letter-spacing: 0.06em; +} + +.rtd-compass-svg text.rtd-compass-center-label { + fill: var(--rtd-orange); + font-family: var(--codeFont); + font-size: 8.5px; + font-weight: 700; + letter-spacing: 0.06em; +} + +/* Hero Instrument Readout */ +.rtd-hero { + position: relative; + margin-bottom: 1.25rem; + background-color: var(--rtd-glass); + backdrop-filter: blur(4px); + border: 1px solid var(--rtd-border); + --rtd-corner: linear-gradient(var(--rtd-olive), var(--rtd-olive)); + background-image: + var(--rtd-corner), var(--rtd-corner), var(--rtd-corner), var(--rtd-corner), + var(--rtd-corner), var(--rtd-corner), var(--rtd-corner), var(--rtd-corner); + background-position: + top left, top left, top right, top right, + bottom left, bottom left, bottom right, bottom right; + background-size: + 14px 2px, 2px 14px, 14px 2px, 2px 14px, + 14px 2px, 2px 14px, 14px 2px, 2px 14px; + background-repeat: no-repeat; +} + +.rtd-hero-rail { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 0.4rem 1rem; + padding: 0.55rem 1.25rem; + border-bottom: 1px solid var(--rtd-border); + background: var(--rtd-glass-inner); + color: var(--rtd-muted); + font-size: 0.7rem; + font-weight: 500; + letter-spacing: 0.14em; + text-transform: uppercase; +} + +.rtd-hero-copy { + min-width: 0; + padding: 1.5rem 1.5rem 1.6rem; +} + +.page article .rtd-hero-copy h1 { + margin: 0 0 0.75rem; + font-family: var(--titleFont); + font-size: clamp(1.8rem, 4vw, 2.75rem); + font-weight: 700; + line-height: 1.12; + letter-spacing: 0.08em; + color: var(--rtd-ink); + text-transform: uppercase; +} + +.page article .rtd-hero-copy h1 a[role="anchor"], +.page article .rtd-hero-copy h1 a.anchor { + display: none; +} + +.page article .rtd-hero-copy p { + margin: 0; + max-width: 58ch; + color: var(--rtd-ink); + font-size: 0.94rem; + line-height: 1.68; +} + +/* Live Telemetry Strip */ +.rtd-telemetry { + position: relative; + display: grid; + grid-template-columns: auto minmax(0, 1.15fr) auto auto auto minmax(0, 1.35fr); + gap: 0; + margin: 1.25rem 0 2rem; + overflow: hidden; + border: 1px solid var(--rtd-border); + background: transparent; +} + +.rtd-telemetry-cell { + display: flex; + flex-direction: column; + justify-content: center; + gap: 0.25rem; + min-width: 0; + padding: 0.65rem 0.9rem; + background: var(--rtd-glass); + backdrop-filter: blur(4px); + box-shadow: -1px 0 0 var(--rtd-border), 0 -1px 0 var(--rtd-border); +} + +.rtd-telemetry-link { + background: var(--rtd-glass-inner); +} + +.rtd-telemetry-label { + color: var(--rtd-muted); + font-size: 0.64rem; + font-weight: 500; + letter-spacing: 0.14em; + text-transform: uppercase; +} + +.rtd-telemetry-value { + display: inline-flex; + align-items: center; + gap: 0.45rem; + color: var(--rtd-ink); + font-size: 0.84rem; + font-weight: 600; + letter-spacing: 0.04em; + overflow-wrap: anywhere; +} + +.rtd-telemetry-link .rtd-telemetry-value { + color: var(--rtd-orange); +} + +.rtd-telemetry-pip { + display: inline-block; + width: 7px; + height: 7px; + background: var(--rtd-orange); + flex-shrink: 0; +} + +.rtd-telemetry[data-rtd-lobby-live="true"] .rtd-telemetry-pip { + background: var(--rtd-allied); +} + +.rtd-telemetry[data-rtd-lobby-live="true"] .rtd-telemetry-link .rtd-telemetry-value { + color: var(--rtd-allied); +} + +.page article .rtd-telemetry-endpoint code { + color: var(--rtd-cyan); + background: transparent; + border: 0; + padding: 0; + font-size: inherit; +} + +/* Directory Index Grid */ +.rtd-index-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 1rem; + margin-top: 1rem; +} + +.page article a.rtd-index-card, +.page article a.rtd-index-card.internal { + display: flex; + flex-direction: column; + gap: 0.55rem; + padding: 1.25rem 1.35rem; + border: 1px solid var(--rtd-border); + background-color: var(--rtd-glass); + backdrop-filter: blur(4px); + --rtd-card-corner: linear-gradient(var(--rtd-border), var(--rtd-border)); + background-image: + var(--rtd-card-corner), var(--rtd-card-corner), var(--rtd-card-corner), var(--rtd-card-corner), + var(--rtd-card-corner), var(--rtd-card-corner), var(--rtd-card-corner), var(--rtd-card-corner); + background-position: + top left, top left, top right, top right, + bottom left, bottom left, bottom right, bottom right; + background-size: + 10px 2px, 2px 10px, 10px 2px, 2px 10px, + 10px 2px, 2px 10px, 10px 2px, 2px 10px; + background-repeat: no-repeat; + text-decoration: none; + color: var(--rtd-ink); +} + +.page article a.rtd-index-card:hover, +.page article a.rtd-index-card:focus-visible, +.page article a.rtd-index-card.internal:hover, +.page article a.rtd-index-card.internal:focus-visible { + border-color: var(--rtd-olive); + background-color: var(--rtd-glass-hover); + --rtd-card-corner: linear-gradient(var(--rtd-olive), var(--rtd-olive)); + color: var(--rtd-ink); +} + +.rtd-index-kicker { + color: var(--rtd-orange); + font-size: 0.7rem; + font-weight: 600; + letter-spacing: 0.14em; + text-transform: uppercase; +} + +.rtd-index-title { + color: var(--rtd-ink); + font-size: 1.05rem; + font-weight: 700; + letter-spacing: 0.05em; + text-transform: uppercase; +} + +.rtd-index-desc { + color: var(--rtd-muted); + font-size: 0.84rem; + line-height: 1.65; +} + +.rtd-index-cue { + margin-top: auto; + padding-top: 0.65rem; + border-top: 1px solid var(--rtd-border); + color: var(--rtd-cyan); + font-size: 0.72rem; + font-weight: 600; + letter-spacing: 0.12em; + text-transform: uppercase; +} + +.page article a.rtd-index-card:hover .rtd-index-cue, +.page article a.rtd-index-card:focus-visible .rtd-index-cue { + color: var(--rtd-olive); +} + +/* Interior Page Typography & Surfaces */ .article-title { margin: 0 0 1.5rem; - font-family: var(--headerFont); - font-weight: 600; - font-size: clamp(1.85rem, 4vw, 2.75rem); - line-height: 1.15; - letter-spacing: -0.01em; - color: var(--dark); + padding: 0.15rem 0 0.75rem 0.9rem; + border-left: 3px solid var(--rtd-olive); + border-bottom: 1px solid var(--rtd-border); + font-family: var(--titleFont); + font-weight: 700; + font-size: clamp(1.5rem, 3.4vw, 2.25rem); + line-height: 1.2; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--rtd-ink); } .page article { width: 100%; max-width: none; - font-size: 1.02rem; - line-height: 1.7; - color: var(--darkgray); + font-family: var(--bodyFont); + font-size: 0.92rem; + line-height: 1.72; + color: var(--rtd-ink); } + +body:not([data-slug="index"]) .page article, +.rtd-panel { + padding: 1.5rem 1.75rem; + margin: 1.5rem 0; + background: var(--rtd-glass); + backdrop-filter: blur(4px); + border: 1px solid var(--rtd-border); + box-sizing: border-box; +} + +.rtd-panel > :first-child { + margin-top: 0; +} + +.rtd-panel > :last-child { + margin-bottom: 0; +} + +.page article p:has(> img) { + max-width: 100%; + margin: 1.5rem 0; +} + +.page article img { + display: block; + width: 100%; + max-width: 100%; + height: auto; + margin: 0; + border: 1px solid var(--rtd-border); + background: var(--rtd-ground); + box-sizing: border-box; +} + .page article p, .page article ul, .page article ol, -.page article blockquote { max-width: var(--rtd-measure); } +.page article blockquote { + max-width: var(--rtd-measure); + line-height: 1.72; + color: var(--rtd-ink); +} + +.page article li { + line-height: 1.72; + margin-bottom: 0.45rem; +} + +.page article ul { + list-style-type: square; +} + +.page article li::marker { + color: var(--rtd-olive); +} + +.page article strong { + color: var(--rtd-ink); + font-weight: 700; +} + .page article h1, .page article h2, -.page article h3 { font-family: var(--headerFont); color: var(--dark); } +.page article h3, +.page article h4, +.page article h5, +.page article h6 { + font-family: var(--headerFont); + color: var(--rtd-ink); + text-transform: uppercase; + letter-spacing: 0.1em; +} + +.page article h2 { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.75rem; + margin-top: 2rem; + margin-bottom: 1rem; + font-size: 0.96rem; + font-weight: 700; + color: var(--rtd-olive); +} + +.page article h2::after { + content: ""; + flex: 1 1 2rem; + height: 1px; + background: var(--rtd-border); +} + +.page article h3 { + margin-top: 1.6rem; + margin-bottom: 0.75rem; + padding-left: 0.65rem; + border-left: 2px solid var(--rtd-orange); + font-size: 0.88rem; + font-weight: 700; + color: var(--rtd-ink); +} + .page article a { color: var(--rtd-cyan); - text-decoration-color: rgba(56, 196, 212, 0.35); - text-underline-offset: 0.18em; + font-weight: 500; + text-decoration: underline; + text-decoration-color: rgba(68, 217, 232, 0.4); + text-underline-offset: 0.2em; } -.page article a:hover { - color: var(--rtd-amber); - text-decoration-color: var(--rtd-amber); + +.page article a.internal:not(.rtd-index-card) { + background-color: transparent; + padding: 0; + border-radius: 0; } + +.page article a:hover, +.page article a:focus-visible { + color: var(--rtd-orange); + text-decoration-color: var(--rtd-orange); +} + +.page article blockquote { + margin: 1.25rem 0; + padding: 0.85rem 1.1rem; + background: var(--rtd-glass); + backdrop-filter: blur(4px); + border: 1px solid var(--rtd-border); + border-left: 2px solid var(--rtd-orange); +} + .page article pre { max-width: 100%; overflow-x: auto; - background: var(--rtd-plate); + background: var(--rtd-glass); + backdrop-filter: blur(4px); border: 1px solid var(--rtd-border); - padding: 1rem 1.2rem; + border-left: 2px solid var(--rtd-olive); + border-radius: 0; + padding: 0.95rem 1.15rem; } + .page article code { font-family: var(--codeFont); - background: var(--rtd-plate); + font-size: 0.88em; + color: var(--rtd-cyan); + background: var(--rtd-plate-inner); border: 1px solid var(--rtd-border); - border-radius: 2px; - padding: 0.1rem 0.35rem; + border-radius: 0; + padding: 0.08rem 0.35rem; } -.page article pre code { background: transparent; border: 0; padding: 0; } + +.page article pre code { + color: var(--rtd-ink); + background: transparent; + border: 0; + padding: 0; +} + +.page article .table-container { + overflow-x: auto; + margin: 1.25rem 0; +} + +.page article table { + width: 100%; + max-width: 100%; + margin: 0; + padding: 0; + border-collapse: collapse; + background: var(--rtd-glass); + backdrop-filter: blur(4px); + border: 1px solid var(--rtd-border); + font-size: 0.84rem; +} + +.page article th, +.page article td { + padding: 0.55rem 0.75rem; + border: 1px solid var(--rtd-border); + text-align: left; + line-height: 1.5; +} + +.page article th { + background: var(--rtd-plate-inner); + color: var(--rtd-olive); + font-size: 0.74rem; + font-weight: 700; + letter-spacing: 0.1em; + text-transform: uppercase; +} + +.page article hr { + height: 1px; + margin: 1.75rem 0; + border: 0; + background: var(--rtd-border); +} + +.rtd-alert { + padding: 0.75rem 1rem; + background: var(--rtd-glass); + backdrop-filter: blur(4px); + border: 1px solid var(--rtd-border); + border-left: 2px solid var(--rtd-red); +} + .katex-display { display: block; max-width: 100%; @@ -167,73 +796,145 @@ body { padding: 0.25rem 0; } -.rtd-hero, -.rtd-telemetry { - position: relative; - background: var(--rtd-plate); +/* Table of Contents */ +.toc { + padding: 0.9rem 1.1rem; + background: var(--rtd-glass); + backdrop-filter: blur(4px); border: 1px solid var(--rtd-border); - --rtd-corner: linear-gradient(var(--rtd-amber), var(--rtd-amber)); - background-image: - var(--rtd-corner), var(--rtd-corner), var(--rtd-corner), var(--rtd-corner), - var(--rtd-corner), var(--rtd-corner), var(--rtd-corner), var(--rtd-corner); - background-position: - top left, top left, top right, top right, - bottom left, bottom left, bottom right, bottom right; - background-size: - 12px 2px, 2px 12px, 12px 2px, 2px 12px, - 12px 2px, 2px 12px, 12px 2px, 2px 12px; - background-repeat: no-repeat; } -.rtd-hero { padding: 2rem 2rem 1.85rem; margin-bottom: 1.5rem; } -.rtd-hero h1 { - margin: 0 0 0.75rem; - font-size: clamp(1.9rem, 4.4vw, 3rem); - font-weight: 700; - letter-spacing: 0.04em; -} -.rtd-kicker { - margin: 0 0 0.65rem; + +button.toc-header h3 { font-family: var(--headerFont); - font-size: 0.75rem; + font-size: 0.76rem; + font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; - color: var(--rtd-amber); + color: var(--rtd-olive); } -.rtd-telemetry { - display: flex; - flex-wrap: wrap; - align-items: center; - gap: 0.6rem; - padding: 0.85rem 1.15rem; - margin: 1.25rem 0 1.75rem; - font-family: var(--codeFont); - font-size: 0.88rem; - color: var(--rtd-cyan); -} -.rtd-telemetry-dot { - width: 0.5rem; - height: 0.5rem; - border-radius: 50%; - background: var(--rtd-cyan); - flex-shrink: 0; -} -.rtd-alert { border-left: 2px solid var(--rtd-rust); padding-left: 0.9rem; } +ul.toc-content.overflow > li > a { + color: var(--rtd-muted); + opacity: 1; + font-size: 0.8rem; +} + +ul.toc-content.overflow > li > a:hover, +ul.toc-content.overflow > li > a.in-view { + color: var(--rtd-cyan); + opacity: 1; +} + +/* Footer */ .page footer { width: 100%; max-width: none; - margin: 3.5rem 0 0; - padding: 1.75rem 0 2.5rem; + margin: 3rem 0 0; + padding: 1.35rem 0 2.25rem; border-top: 1px solid var(--rtd-border); - color: var(--gray); - font-size: 0.88rem; + color: var(--rtd-muted); + font-size: 0.76rem; + letter-spacing: 0.06em; + opacity: 1; +} + +.page footer p { + margin: 0 0 0.75rem; + color: var(--rtd-muted); +} + +.page footer ul { + display: flex; + flex-wrap: wrap; + gap: 0.5rem 1.25rem; + margin: 0; + padding: 0; + list-style: none; +} + +.page footer a { + color: var(--rtd-cyan); + text-transform: uppercase; + letter-spacing: 0.08em; +} + +.page footer a:hover, +.page footer a:focus-visible { + color: var(--rtd-orange); +} + +/* Responsive Breakpoints */ +@media (max-width: 920px) { + .rtd-telemetry { + grid-template-columns: repeat(3, minmax(0, 1fr)); + } } -.page footer a { color: var(--rtd-cyan); } -.page footer a:hover { color: var(--rtd-amber); } @media (max-width: 720px) { - .page { padding: 0 1rem; } - .rtd-masthead { padding: 1rem 0 0.85rem; } - .rtd-hero { padding: 1.35rem 1.15rem; } - .rtd-telemetry { padding: 0.75rem 0.9rem; font-size: 0.82rem; } + body:not([data-slug="index"]) .page article, + .rtd-panel { + padding: 1.1rem 1rem; + } + + .page { + padding: 0 0.9rem; + } + + .rtd-masthead { + padding-top: 0.85rem; + } + + .rtd-nav { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 0; + width: 100%; + overflow: hidden; + background: transparent; + } + + .rtd-nav a { + justify-content: center; + padding: 0.5rem 0.45rem; + font-size: 0.72rem; + border-left: 0; + background: var(--rtd-glass); + box-shadow: -1px 0 0 var(--rtd-border), 0 -1px 0 var(--rtd-border); + } + + .rtd-compass-svg { + width: 160%; + margin-left: -30%; + } + + .rtd-hero-rail { + padding: 0.5rem 0.9rem; + font-size: 0.64rem; + } + + .rtd-hero-copy { + padding: 1.15rem 0.95rem 1.25rem; + } + + .rtd-index-grid { + grid-template-columns: minmax(0, 1fr); + } +} + +@media (max-width: 560px) { + .rtd-telemetry { + grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); + } + + .rtd-telemetry-cell { + padding: 0.55rem 0.7rem; + } + + .rtd-telemetry-value { + font-size: 0.76rem; + } + + .rtd-telemetry-endpoint code { + white-space: nowrap; + } }