Files
Claude 36f6a01051 dark mode foundation: follow the device like live hanzo.ai (dark t_dark / light t_light), Hanzo's dark palette on every shared token, shared pieces dark-correct
- Theme before paint: app/layout.jsx runs live hanzo.ai's own pre-paint script (localStorage
  "hanzo.appearance.painted", else prefers-color-scheme) and sets light/dark + t_light/t_dark,
  color-scheme and data-scheme; it re-applies when the device setting changes. Measured: "dark
  t_dark" at first paint, after hydration and after client navigation; no flash; JS off stays bright.
  theme-color follows the scheme (#0A0A0A dark, as live). No appearance switch: no captured live
  menu shows one, so no new words.
- Tokens: html.dark gives --ink/--soft/--faint/--line/--card/--bg and Hanzo's --foreground/
  --background/--primary/--border/--hover/--muted Hanzo's own dark values (public/hanzo.css: page
  #0d0d0d, text #e5e5e5, muted #a3a3a3, borders white 10%, #171717 / #0f0f0f / #262626 surfaces);
  rooms (system.css) too. New --x-raised/--x-on-ink/--x-fill/--x-sunk/--x-knob/--x-e10..15
  replace hard-coded whites in shared rules (Hanzo already defines --card/--raised on inner
  elements, so the new names are prefixed). One-off greys keep their exact light value via
  light-dark(); html.light/html.dark pin color-scheme.
- Dark-correct: cookie banner and preferences, announcement strip, sign-in buttons, buttons, search
  palette and scrims, menus and the menu feature card, sheets, drawers, pause buttons, related
  cards, every components/v2/*.css; the hero dot field draws in the page ink at 17% and redraws on
  a theme change. Hanzo's header and footer go dark through hanzo.css.
- docs/DARK-MODE.md: how a page chat converts its pages; scripts/darkcheck.mjs (what is still
  bright in dark) and scripts/lightcheck.mjs (bright mode unchanged vs an older server).

Checks: bright mode 0 computed-colour diffs vs the base commit on / /pricing /chat (1470, 375) and
/enso /kai /api /affiliate /beta /about /dev /security /payments /models (1470); page text
identical (only the live tokens/s counters move); 0 console/page errors in both modes on / /pricing
/chat at 1470x801 and 375x812 (home's media requests to hanzo.ai are blocked in this sandbox, same
in light); taste, unique OK; build exits 0 with HZ_LIVE_OFFLINE=1 (live figure hosts are blocked
here). Page-owned CSS left for the page chats: /pricing .xpr-*, /chat .cht-*, home .xs-*/.xh-pause.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P5YBdxPteCvBL7f74SauJt
2026-11-08 10:59:06 +00:00

46 lines
3.5 KiB
CSS

/* Chaptered (components/v2/Chaptered.jsx): sticky chapters on desktop, a vertical story on phones. */
.xpc { --pinned: 1; position: relative; height: calc(var(--n) * var(--per) * 100svh + 100svh); }
.xpc-pin { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; overflow: clip; }
.xpc-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px clamp(40px, 6vw, 112px); align-items: center; }
.xpc.flip .xpc-words { order: 2; }
.xpc-words { position: relative; display: grid; grid-template-columns: 1fr 28px; column-gap: 24px; align-content: center; }
.xpc-head { grid-column: 1 / -1; margin-bottom: clamp(28px, 3.4vw, 48px); }
.xpc-stack { grid-column: 1; display: grid; }
.xpc-ch { grid-area: 1 / 1; align-self: start; pointer-events: none; }
.xpc-ch.on { pointer-events: auto; }
.xpc-k { margin-bottom: 18px; color: var(--xp-accent); }
.xpc-t { max-width: 14ch; }
.xpc-b { margin-top: 24px; max-width: 40ch; }
.xpc-b p { margin: 0; }
.xpc-b p + p { margin-top: 14px; }
.xpc-rail { position: relative; grid-column: 2; display: grid; align-content: center; justify-items: center; gap: 22px; }
.xpc-track { position: absolute; top: 6px; bottom: 6px; left: 50%; width: 2px; margin-left: -1px; background: var(--line); border-radius: 2px; overflow: hidden; }
.xpc-track i { position: absolute; inset: 0; background: var(--xp-accent); transform-origin: 50% 0; }
.xpc-rail button { position: relative; width: 28px; height: 28px; border: 0; padding: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.xpc-rail button::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--x-raised); border: 2px solid rgba(0, 0, 0, .18); transition: border-color .3s var(--xp-ease), transform .3s var(--xp-ease); }
.xpc-rail button.on::before { border-color: var(--xp-accent); }
.xpc-rail button[aria-current]::before { transform: scale(1.35); background: var(--xp-accent); }
.xpc-rail button:focus-visible { outline: 2px solid var(--xp-accent); outline-offset: 2px; border-radius: 50%; }
.xpc-stage { position: relative; height: min(76svh, 720px); }
.xpc-stage-in { position: absolute; inset: 0; }
.xpc-story { display: none; }
.xpc-t.st { max-width: 22ch; font-size: 26px; line-height: 1.25; letter-spacing: -.02em; font-weight: 497; }
.xp-dark.xpc .xpc-rail button::before { background: #0a0a0a; border-color: rgba(255, 255, 255, .25); }
.xp-dark.xpc .xpc-track { background: rgba(255, 255, 255, .12); }
@media (max-width: 900px) {
.xpc { --pinned: 0; height: auto; padding: 96px 0; }
.xpc-pin { display: none; }
/* phones: the chapters become a rail you swipe, one card per chapter, the next one peeking */
.xpc-story { display: block; width: 100%; }
.xpc-story .xpc-head { width: calc(100% - 32px); margin: 0 auto 28px; }
.xpc-rail-p { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 16px 8px; scrollbar-width: none; }
.xpc-rail-p::-webkit-scrollbar { display: none; }
.xpc-sch { flex: 0 0 84%; scroll-snap-align: center; display: grid; align-content: start; gap: 0; }
.xpc-sstage { position: relative; height: 340px; margin-bottom: 24px; }
.xpc-sch .xpc-b { margin-top: 12px; }
.xpc-dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.xpc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--room-line-strong, rgba(0, 0, 0, .2)); transition: transform .3s var(--xp-ease), background .3s; }
.xpc-dots i.on { background: var(--room-ink); transform: scale(1.4); }
}