/* V2.1: the theme console and the textures. Built from v2's own parts (S1 buttons, the sign-in
   field and arrow, the plain-text block, the menu surface), on tokens, so it re-themes along with the page. */

/* Header button: the palette alone, next to Human / Agent. On a phone the toggle and version menu hide (R219); it stays. */
.th { position: relative; display: inline-flex; }
.th-btn { width: 36px; padding: 0; justify-content: center; }
.th-btn[aria-expanded="true"] { background: var(--hover); }
@media (max-width: 639.98px) {
  .hdr-tools.has-theme { display: inline-flex; }
  .hdr-tools.has-theme > :not(.th) { display: none !important; }
}

/* The console (canvas option A5): the menu surface with native controls. Title in the voice face, the S1 field and
   arrow, the plain-text block for the log (kept mono: it is the AI's activity), outlined word buttons for the picks. */
.th-pop { position: absolute; top: calc(100% + 14px); right: 0; z-index: 30; box-sizing: border-box; width: 400px; max-width: calc(100vw - 32px); max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 16px; padding: 20px; background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--rule), 0 12px 40px var(--shadow); color: var(--text); font-size: 14px; line-height: 20px; letter-spacing: 0; text-align: left; }
.th-pop[hidden] { display: none; }
.th-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.th-h { margin: 0; font-family: var(--voice); font-size: 20px; line-height: 28px; font-weight: var(--display-weight); letter-spacing: var(--display-track); color: var(--heading); }
.th-tools { display: flex; align-items: center; gap: 6px; margin-right: -6px; }
.th-mode > button { width: 36px; height: 30px; padding: 0; justify-content: center; }
.th-pop .btn { display: inline-flex; align-items: center; box-sizing: border-box; height: 36px; min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--well); color: var(--heading); font-size: 14px; line-height: 20px; font-weight: 500; cursor: pointer; }
.th-pop .btn:hover { background: var(--hover); }
.th-div { width: 1px; height: 20px; margin: 0 2px; background: var(--rule-soft); }
.th-lab { display: block; margin: 0 0 8px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); }
.th-pop .fx .in { font-size: 16px; line-height: 24px; padding: 0; }
.th-pop .fx .in::placeholder { color: var(--muted); opacity: 1; }
.th-pop .ibtn:disabled { opacity: .55; cursor: progress; }
.th-log-box { background: var(--well); border-radius: var(--r-md); box-shadow: none; }
.th-log { box-sizing: border-box; min-height: 150px; max-height: 300px; overflow: auto; margin: 0; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 20px; white-space: pre-wrap; color: var(--text); }
.th-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.th-pop .th-pick { height: 32px; min-height: 32px; padding: 0 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--rule-strong); font-size: 13px; }
.th-pop .th-pick:hover { background: var(--well); }
.th-pop .th-pick[aria-pressed="true"], .th-pop .th-pick[aria-pressed="true"]:hover { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.th-note { margin: 0; font-size: 14px; line-height: 20px; font-weight: 400; color: var(--muted); }

@media (max-width: 639.98px) {
  .th-pop { position: fixed; top: auto; right: 0; bottom: 0; left: 0; width: auto; max-width: none; max-height: 82vh; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 16px 20px 20px; }
  .th-log { min-height: 120px; max-height: 200px; }
}

@media print { .th-pop { display: none !important; } }

/* Textures: on the page background, from tokens, so they recolor with the theme */
html[data-texture] body { background-attachment: fixed; }
html[data-texture="grid"] body { background-image: linear-gradient(var(--rule-soft) 1px, transparent 1px), linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px); background-size: 32px 32px; }
html[data-texture="dots"] body { background-image: radial-gradient(var(--rule) 1.2px, transparent 1.6px); background-size: 20px 20px; }
html[data-texture="scan"] body { background-image: repeating-linear-gradient(0deg, transparent 0 2px, var(--hover-soft) 2px 3px); }
html[data-texture="grain"] body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
html[data-texture="paper"] body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035 .6' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
html[data-mode="dark"][data-texture="grain"] body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
html[data-mode="dark"][data-texture="paper"] body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035 .6' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
html[data-mode="dark"][data-img="none"] .thumb img, html[data-mode="dark"][data-img="none"] .fig img { filter: brightness(.94); }

/* Images: a duotone, tint or mono ramp from the theme's two hues (the #th-img filter theme.js writes). Hover shows the original. */
html[data-img]:not([data-img="none"]):not([data-img="halftone"]) .page img { filter: url(#th-img); transition: filter .35s ease; }
/* Halftone (review J, Pop art): the image keeps its own colors, a little richer, under Ben-Day dots in the accent,
   drawn on the frame at a fixed screen size and multiplied in, fading out from the top-left corner like comic shading,
   so most of each image stays clean. Nothing is flattened, so screenshots and photos read. */
html[data-img="halftone"] .page img { filter: saturate(1.35) contrast(1.05); }
html[data-img="halftone"] .page :is(.thumb, .strip .th)::after { background-image: radial-gradient(circle, color-mix(in srgb, var(--accent) 60%, transparent) 0 1.5px, transparent 2px); background-size: 7px 7px; mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(135deg, #000, rgba(0, 0, 0, .55) 22%, transparent 45%); mask-image: linear-gradient(135deg, #000, rgba(0, 0, 0, .55) 22%, transparent 45%); }
html[data-img]:not([data-img="none"]) .page :is(a, button):hover img, html[data-img]:not([data-img="none"]) .page img:hover { filter: none; }

/* Section label decoration */
html[data-deco="brackets"] .label::before { content: "<"; }
html[data-deco="brackets"] .label::after { content: ">"; }
html[data-deco="number"] .site { counter-reset: th-sec; }
html[data-deco="number"] .label { counter-increment: th-sec; }
html[data-deco="number"] .label::before { content: counter(th-sec, decimal-leading-zero) " / "; }
html[data-deco="slash"] .label::before { content: "// "; }
html[data-deco="square"] .label::before { content: "\25A0\00a0"; color: var(--accent); }

/* The flame: ink (as is), accent, a gradient from the accent to the second hue, an outline, or a glow on dark */
html[data-flame="accent"] .flame { fill: var(--accent); }
html[data-flame="gradient"] .flame { fill: url(#th-flame); }
html[data-flame="outline"] .flame { fill: none; stroke: var(--accent); stroke-width: .9px; }
html[data-flame="glow"] .flame { fill: var(--accent); filter: drop-shadow(0 0 2px var(--accent)) drop-shadow(0 0 7px var(--accent)); }
html[data-motion="calm"] .flame.live :is(.fa, .fb) { animation-duration: 7.8s; }
html[data-motion="snappy"] .flame.live :is(.fa, .fb) { animation-duration: 3.4s; }
html[data-motion="bouncy"] .flame.live :is(.fa, .fb) { animation-duration: 2.4s; }

/* The browser around the page, and glyphs drawn as text, not emoji */
html[data-mode] ::selection { background: var(--accent); color: var(--on-accent); }
html[data-mode] { scrollbar-color: var(--sep) var(--bg); }
.g { font-variant-emoji: text; }
/* Body x-height matching (--body-adjust) is for running text; headings keep their own size. */
html[data-mode] :is(.title, .subtitle, .sec, .name, .stat-n, .quote p, .dlg-h, .th-pop) { font-size-adjust: none; }
@media (prefers-reduced-motion: reduce) { .th-pop * { transition: none !important; } }
/* A wide display face in caps (arcade, risograph) can make one long word wider than a phone screen.
   Under a theme, a heading word may hyphenate or break, but only when it cannot fit on a line. */
html[data-mode] :is(h1, h2, h3) { overflow-wrap: break-word; hyphens: auto; }
/* Titles and section headings are shrunk by theme.js until their longest word fits, so they wrap only
   between words: automatic hyphens split big titles ("orga-nizations") even when the word would fit. */
html[data-mode] :is(.title, .sec) { hyphens: manual; }

/* ---------- Fourth pass: the one-line header, and expression (scale, rules, heading effects, blocks, patterns) ---------- */

/* The header (canvas option H4): name, nav and one control island fit the 672px reading column on one line.
   The island is the toggle's gray track holding Human / Agent (icons), the palette and the version, with a
   divider between each group. theme.js measures the header: if a wide theme face still overflows it, the masthead
   pattern goes first, then the header wraps as on V2. --frame is only used to size the corner pattern. */
:root { --frame: 624px; }
.hdr > .name { order: 0; flex: 0 0 auto; }
.hdr > .hdr-r { order: 2; }
@media (min-width: 640px) { .hdr { flex-wrap: nowrap; align-items: center; } .hdr > .hdr-r { flex-wrap: nowrap; } }
.hdr.hdr-wrap, .hdr.hdr-wrap > .hdr-r { flex-wrap: wrap; }
.hdr.hdr-wrap { height: auto; min-height: 64px; padding-top: 6px; padding-bottom: 6px; row-gap: 0; }
/* The island is a segmented pill (R231): its styles are in v2.css. */
.site { position: relative; }

/* Type scale: titles, section headings and stats step up together; body text stays 18/32. On a phone the title
   is capped, and theme.js shrinks any title whose longest word still doesn't fit. */
html[data-scale]:not([data-scale="1"]) .title { font-size: var(--t-title); line-height: var(--t-title-lh); }
html[data-scale]:not([data-scale="1"]) .sec { font-size: var(--t-sec); line-height: var(--t-sec-lh); }
html[data-scale]:not([data-scale="1"]) .stat-n { font-size: var(--t-stat); line-height: 1.15; }
@media (max-width: 639.98px) {
  html[data-scale]:not([data-scale="1"]) .title { font-size: min(var(--t-title), 11vw); }
  html[data-scale]:not([data-scale="1"]) .sec { font-size: min(var(--t-sec), 7.5vw); }
}

/* Major rules: thick, double, stripes, dotted or zigzag above each section, the stats, "more" and the footer.
   Row and table rules stay as they are (weight and style from --rule-w and --rule-style). */
html[data-rulefx]:not([data-rulefx="hair"]) .page section:has(> .label:first-child) { padding-top: calc(var(--rx-h) + 14px); background: var(--rx); }
html[data-rulefx]:not([data-rulefx="hair"]) .page section:has(> .label:first-child) > .label + * { border-top-color: transparent; }
html[data-rulefx]:not([data-rulefx="hair"]) .more { border-top: 0; padding-top: calc(24px + var(--rx-h)); background: var(--rx); }
html[data-rulefx]:not([data-rulefx="hair"]) .stats { border-top: 0; border-bottom: 0; padding: calc(24px + var(--rx-h)) 0; background: var(--rx), var(--rx-b); }
html[data-rulefx]:not([data-rulefx="hair"]) .site-foot { border-top: 0; padding-top: calc(12px + var(--rx-h)); background: var(--rx); }

/* Heading effects: one at most. Offset shadow in the second palette color, an outline for big titles, or a marker
   highlight drawn behind the words (an underline under the text, so the heading color still reads on it). */
html[data-heffect="shadow"] :is(.title, .sec, .stat-n) { text-shadow: .06em .06em 0 var(--p2); }
html[data-heffect="outline"] .title { color: transparent; -webkit-text-stroke: max(1.5px, .028em) var(--heading); text-shadow: .05em .05em 0 var(--p2); }
html[data-heffect="marker"] :is(.title, .sec) { text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: .4em; text-underline-offset: -.32em; text-decoration-skip-ink: none; }

/* Blocks: section labels as solid tags; screenshots in an offset color frame */
html[data-blocks~="labels"] .label { display: inline-block; margin-bottom: 10px; padding: 3px 10px; color: var(--on-accent); background: var(--accent); border-radius: var(--r-xs); }
html[data-blocks~="labels"] .ask .label { border-bottom: 0; }
html[data-blocks~="labels"][data-deco="square"] .label::before { color: currentColor; }
html[data-blocks~="frames"] :is(.thumb, .fig img, .wide .shot img, .wide .single img, .player) { box-shadow: 5px 5px 0 var(--p2); }

/* Patterns, in up to four places: a band across the top of the window, the free space in the header, the window
   corner beside the header (wide screens only), and a band above the footer. Drawn by theme.js from the palette. */
html[data-slots~="top"] .site::before { content: ""; display: block; height: var(--slot-top); background-image: var(--pat); background-size: var(--pat-size); background-position: var(--pat-pos); }
html[data-slots~="masthead"] .hdr::after { content: ""; order: 1; flex: 1 1 0; min-width: 0; align-self: center; height: var(--slot-masthead); margin: 0 24px;
  background-image: var(--pat); background-size: var(--pat-size); background-position: var(--pat-pos); border-radius: var(--r-sm); }
html[data-slots~="masthead"] .hdr > .hdr-r { flex: 0 1 auto; }
.hdr.hdr-nomast::after, .hdr.hdr-wrap::after { display: none; }
html[data-slots~="masthead"] .hdr.hdr-nomast > .hdr-r, html[data-slots~="masthead"] .hdr.hdr-wrap > .hdr-r { flex: 1 1 0; }
@media (min-width: 1200px) {
  html[data-slots~="corner"] .site::after { content: ""; position: absolute; top: 0; right: 0; z-index: 0; width: min(240px, calc((100vw - var(--frame)) / 2 - 12px)); aspect-ratio: 1;
    background-image: var(--pat-corner, var(--pat)); background-size: var(--pat-corner-size, var(--pat-size)); background-position: var(--pat-pos); clip-path: circle(100% at 100% 0); pointer-events: none; }
}
/* Review J: below 1200px there is no room for the corner, so the pattern runs as a band above the header. */
@media (max-width: 1199.98px) {
  html[data-slots~="corner"]:not([data-slots~="top"]) .site::before { content: ""; display: block; height: calc(var(--slot-top) + 8px); background-image: var(--pat); background-size: var(--pat-size); background-position: var(--pat-pos); }
}
html[data-slots~="footer"][data-rulefx] .site-foot { border-top: 0; padding-top: 0; background: none; }
html[data-slots~="footer"] .site-foot::before { content: ""; order: -1; flex: 0 0 100%; height: var(--slot-footer); margin-bottom: 4px;
  background-image: var(--pat); background-size: var(--pat-size); background-position: var(--pat-pos); border-radius: var(--r-sm); }
@media print { html[data-slots] .site::before, html[data-slots] .site::after, html[data-slots] .hdr::after, html[data-slots] .site-foot::before { display: none; } }
@media (max-width: 639.98px) { html[data-slots~="masthead"] .hdr::after { display: none; } }

/* Review G fixes (2026-11-24) */
html[data-intensity="loud"][data-ground="colored"]:not([data-heffect="outline"]):not([data-heffect="marker"]) .title { color: var(--hero); }
html[data-intensity="loud"][data-ground="colored"][data-heffect="shadow"] .title { text-shadow: .06em .06em 0 var(--hero-shade); }
.th-long { font-family: var(--sans); font-weight: 700; letter-spacing: -0.01em; }
/* Review J: a light theme keeps a long title light in the body face, and long sentences are not set in caps. */
html[data-tweight="light"] .th-long { font-weight: 400; }
.th-long { text-transform: none; }
.hdr.hdr-snug .nav { padding-left: 6px; padding-right: 6px; }
.hdr.hdr-snug nav { margin-right: -6px; }
.hdr.hdr-snugger .name { font-size: 17px; gap: 8px; }
.hdr.hdr-snugger nav { font-size: 13px; }
.hdr.hdr-snugger .nav { padding-left: 5px; padding-right: 5px; }

/* ---------- Fifth pass (2026-11-24): structure. Shape, material, cards, alignment, title weight, density, ornament,
   and new textures, image treatments and a pattern rail, so themes differ in how they are built, not only in color. ---------- */

/* Shape. Radii come from tokens (--r-xs to --r-lg); pill and mixed also round the toggle, the island and the field. */
html:is([data-shape="pill"], [data-shape="mixed"]) :is(.th-mode, .fx .bx) { border-radius: 999px; }
html:is([data-shape="pill"], [data-shape="mixed"]) :is(.th-mode > button, .isl .btn-sm, .ibtn) { border-radius: 999px; }
html[data-shape="clipped"] { --clip: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); }
html[data-shape="clipped"] :is(.thumb, .strip .th, .pt, .fig img, .wide img, .dlg, .band, .player) { clip-path: var(--clip); }
html[data-shape="clipped"][data-blocks~="labels"] .label { clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px); }

/* Material: what every surface is made of. Edges, shadows and fills come from the solved palette (theme.js). */
html[data-material]:not([data-material="flat"]) :is(.pt, .cm-menu, .th-pop, .fx .bx, .dlg) {
  border: var(--m-edge); box-shadow: var(--m-shadow); background: var(--m-fill); -webkit-backdrop-filter: var(--m-blur); backdrop-filter: var(--m-blur); }
html[data-material]:not([data-material="flat"]) .th-mode > [aria-pressed="true"] { background: var(--m-raise); box-shadow: var(--m-press); }
html[data-material]:not([data-material="flat"]) :is(.th-pick, .pt-acts .btn-sec, .qbtn, .pill:not(.dark), .wp, .tab.on) { border: var(--m-edge); box-shadow: var(--m-shadow); background: var(--m-fill); }
html[data-material]:not([data-material="flat"]) :is(.th-pick[aria-pressed="true"], .th-pick:active, .pt-acts .btn-sec:active, .qbtn:active, .pill:not(.dark):active) { background: var(--m-raise); box-shadow: var(--m-press); }
html[data-material]:not([data-material="flat"]):not([data-blocks~="frames"]) :is(.thumb, .strip .th, .band) { outline: var(--m-edge); box-shadow: var(--m-shadow); }
html[data-material]:not([data-material="flat"]) .pt-bar { background: transparent; }
html[data-material="glass"] .pt-body { background: transparent; }
html[data-material="bitmap"] { -webkit-font-smoothing: none; }
html[data-material="bitmap"] :is(.pt, .cm-menu, .th-pop, .dlg) { transition: none; }
html[data-material="glow"][data-heffect="none"] :is(.title, .sec) { text-shadow: 0 0 14px var(--glow-text); }

/* Cards: each section on its own surface, the bento and index-card look. Cards reach into the page padding, so
   the text keeps its width. */
html:is([data-container="cards"], [data-container="bento"]) :is(.page > section:not(.intro):not(.agent), .case > section) {
  margin-inline: -24px; padding: 24px; box-sizing: border-box; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); }
html:is([data-container="cards"], [data-container="bento"]):not([data-material="flat"]):not([data-material="hairline"]) :is(.page > section:not(.intro):not(.agent), .case > section) {
  border: var(--m-edge); box-shadow: var(--m-shadow); background: var(--m-fill); -webkit-backdrop-filter: var(--m-blur); backdrop-filter: var(--m-blur); }
html:is([data-container="cards"], [data-container="bento"])[data-shape="clipped"] :is(.page > section:not(.intro):not(.agent), .case > section) { clip-path: var(--clip); }
@media (max-width: 639.98px) { html:is([data-container="cards"], [data-container="bento"]) :is(.page > section:not(.intro):not(.agent), .case > section) { margin-inline: -12px; padding: 20px 12px; } }

/* Alignment: centered titles, intro, labels, section headings and footer, as on an invitation or a poster.
   Body paragraphs and rows stay left aligned for reading. */
html[data-align="center"] :is(.intro, .case > .title, .case > .lede, .about > h1, .sec) { text-align: center; }
html[data-align="center"] .facts-line { justify-content: center; }
html[data-align="center"] .page section > .label { display: table; margin-inline: auto; }
html[data-align="center"] .site-foot { justify-content: center; }

/* Density: line height, paragraph gaps and section air. */
html[data-density="airy"] body { line-height: 34px; }
html[data-density="airy"] :is(.about > p, .case section > p) { margin-bottom: 32px; }
html[data-density="airy"] .sec { margin-top: 64px; }
html[data-density="compact"] body { font-size: 17px; line-height: 28px; }
html[data-density="compact"] :is(.about > p, .case section > p) { margin-bottom: 16px; }
html[data-density="compact"] .sec { margin-top: 36px; }

/* Ornament: a drop cap, small capitals, a printer's flower over each section, or numbered sections. Decorative
   content has empty alt text, so screen readers skip it. */
html[data-ornament="dropcap"] :is(.case > .lede, .about > h1 + p)::first-letter { float: left; margin: 6px 10px 0 0; font-family: var(--voice); font-weight: var(--display-weight); font-size: 3.3em; line-height: .82; color: var(--accent-text); }
html[data-ornament="smallcaps"] :is(.label, .facts-line) { font-variant-caps: all-small-caps; text-transform: none; letter-spacing: .06em; }
html[data-ornament="smallcaps"] .sec { font-variant-caps: small-caps; }
html[data-ornament="fleuron"] :is(.page section:has(> .label:first-child), .case .sec)::before { content: "\2766" / ""; display: block; margin-bottom: 8px; font-size: 20px; line-height: 24px; text-align: center; color: var(--accent-text); font-variant-emoji: text; }
html[data-ornament="numerals"] .case { counter-reset: sec; }
html[data-ornament="numerals"] .case .sec::before { counter-increment: sec; content: counter(sec, decimal-leading-zero) / ""; display: block; margin-bottom: 4px; font-family: var(--mono); font-size: 13px; line-height: 20px; letter-spacing: .06em; font-weight: 400; color: var(--accent-text); }

/* Textures: ruled lines on the 32px line with a margin rule (index card), a 1-bit dither around the column
   (classic Mac), distressed paper (grunge), and a soft glow (dark SaaS, and the backdrop glass needs). */
html[data-texture="ruled"] body { background-image: linear-gradient(var(--rule-soft) 1px, transparent 1px); background-size: 100% 32px; background-attachment: scroll; }
html[data-texture="ruled"] .page { background-image: linear-gradient(var(--margin-rule), var(--margin-rule)); background-size: 2px 100%; background-position: 10px 0; background-repeat: no-repeat; }
html[data-texture="dither"] body { background-image: conic-gradient(var(--rule-strong) 25%, transparent 0 50%, var(--rule-strong) 0 75%, transparent 0); background-size: 4px 4px; image-rendering: pixelated; }
html[data-texture="dither"] .page { background-color: var(--bg); box-shadow: 0 0 0 2px var(--heading); }
html[data-texture="distressed"] body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -3 1.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.4 .7'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23b)' opacity='.18'/%3E%3C/svg%3E"); }
html[data-mode="dark"][data-texture="distressed"] body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 -3 1.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 -1.4 .7'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23b)' opacity='.18'/%3E%3C/svg%3E"); }
html[data-texture="radial"] body { background-image: radial-gradient(70% 55% at 50% 0%, var(--glow-a), transparent 70%), radial-gradient(45% 40% at 92% 28%, var(--glow-b), transparent 70%), radial-gradient(40% 35% at 6% 70%, var(--glow-b), transparent 70%); background-attachment: fixed; }

/* The pattern rail: a vertical band left of the column, on screens wide enough to have room for it. */
@media (min-width: 900px) {
  html[data-slots~="rail"] body::before { content: ""; position: fixed; top: 0; bottom: 0; left: max(12px, calc(50% - 336px - 44px)); width: 20px; z-index: 0; pointer-events: none;
    background-image: var(--pat); background-size: var(--pat-size); background-position: var(--pat-pos); }
}

/* ---------- Review H and I fixes (2026-11-24): soft styles with structure of their own, the palette beyond
   patterns, and a pinstripe texture. ---------- */

/* Pinstripes: fine horizontal lines across the window (early Aqua). */
html[data-texture="pinstripe"] body { background-image: repeating-linear-gradient(0deg, transparent 0 2px, var(--hover-soft) 2px 4px); }

/* Multi-color palettes (three or more of Claude's hues, not quiet): label tags and neobrutal card shadows take
   the palette in turn, so De Stijl shows red, blue and yellow, not red alone. Tag text is solved to 4.5:1. */
html[data-multi="on"][data-blocks~="labels"] .page > section:nth-of-type(3n+2) .label { background: var(--tag1); color: var(--tag1-on); }
html[data-multi="on"][data-blocks~="labels"] .page > section:nth-of-type(3n) .label { background: var(--tag2); color: var(--tag2-on); }
html[data-multi="on"][data-blocks~="labels"] .page > section:nth-of-type(3n+1) .label { background: var(--tag3); color: var(--tag3-on); }
html[data-multi="on"][data-material="neobrutal"]:not([data-container="none"]) .page > section:nth-of-type(3n+2):not(.intro) { box-shadow: 6px 6px 0 var(--p1); }
html[data-multi="on"][data-material="neobrutal"]:not([data-container="none"]) .page > section:nth-of-type(3n):not(.intro) { box-shadow: 6px 6px 0 var(--p2); }
html[data-multi="on"][data-material="neobrutal"]:not([data-container="none"]) .page > section:nth-of-type(3n+1):not(.intro) { box-shadow: 6px 6px 0 var(--p3); }
html[data-multi="on"][data-material="neobrutal"] .work:nth-of-type(3n+2) .thumb { box-shadow: 5px 5px 0 var(--p2); }
html[data-multi="on"][data-material="neobrutal"] .work:nth-of-type(3n) .thumb { box-shadow: 5px 5px 0 var(--p3); }

/* Extruded (neumorphism): surfaces are the page itself, pressed out; labels and rows are pressed in. No rules. */
html[data-material="extruded"] .label { display: inline-block; margin-bottom: 14px; padding: 6px 16px; border: 0; border-radius: 999px; box-shadow: var(--m-press); }
html[data-material="extruded"] :is(.work, .fact, .glance tr, .site-foot) { border-top: 0; }
html[data-material="extruded"] .thumb { border-radius: var(--r-md); outline: 0; box-shadow: var(--m-shadow); }
html[data-material="extruded"] .thumb::after { box-shadow: none; }
html[data-material="extruded"] :is(.btn-sec, .qbtn, .th-btn, .pill:not(.dark)) { border-color: transparent; background: var(--bg); box-shadow: var(--m-shadow); }
html[data-material="extruded"] .site-foot { box-shadow: var(--m-press); border-radius: var(--r-lg); padding: 16px 20px; }

/* Gloss (early Aqua): gel buttons and gel label pills across the page, not only in the console. */
html[data-material="gloss"] :is(.btn-sec, .qbtn, .th-btn, .pill:not(.dark)) { border: var(--m-edge); border-radius: 999px; background: var(--m-raise), var(--m-fill); box-shadow: var(--m-shadow); }
html[data-material="gloss"]:not([data-blocks~="labels"]) .label { display: inline-block; margin-bottom: 12px; padding: 3px 14px; border-radius: 999px; }
/* Review J: Aqua is candy. Section labels are blue gel (buttons keep their own fills, so their text stays readable) (the accent with a white highlight on the top half);
   the on-accent text is solved to 4.5:1 against the accent. */
html[data-material="gloss"] .page .label { color: var(--on-accent); border: 1px solid var(--accent-press);
  background: linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0) 51%, rgba(255, 255, 255, 0.18)), var(--accent);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.7); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25); }
html[data-material="gloss"] .thumb { border-radius: 12px; }

/* Bento: the work list becomes a grid of tiles (thumbnail over text), each its own card; other sections are cards. */
@media (min-width: 640px) {
  html[data-container="bento"] .page > section.works.works.works:not(.intro):not(.agent) { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-inline: 0; padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; clip-path: none; }
  html[data-container="bento"] .works > :not(.work) { grid-column: 1 / -1; }
  html[data-container="bento"] .works > .work { flex-direction: column; flex-wrap: nowrap; gap: 12px; padding: 14px; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--surface); }
  html[data-container="bento"]:not([data-material="flat"]):not([data-material="hairline"]) .works > .work { border: var(--m-edge); box-shadow: var(--m-shadow); background: var(--m-fill); }
  html[data-container="bento"] .works > .work .thumb { flex: 0 0 auto; width: 100%; border-radius: var(--r-md); }
  html[data-container="bento"] .works > .work .work-text { flex: 1 1 auto; }
  html[data-container="bento"] .works > .work:is(:first-of-type, :nth-of-type(3n+1):last-of-type) { grid-column: 1 / -1; flex-direction: row; }
  html[data-container="bento"] .works > .work:is(:first-of-type, :nth-of-type(3n+1):last-of-type) .thumb { width: 46%; }
}
html[data-container="bento"] .page > section:not(.intro):not(.agent) + section { margin-top: 16px; }

/* Review I (2026-11-24): the console stays readable under glass. Its sheet is near opaque, so the page behind it
   doesn't wash out the last lines on a phone. */
html[data-material="glass"]:not([data-material="flat"]) .th-pop.th-pop.th-pop { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* De Stijl (review J): with the mondrian pattern, cards are white fields in a black grid, each with a primary color
   block down its left edge, instead of neobrutal offset shadows. */
html[data-pattern="mondrian"]:not([data-container="none"]) .page > section:not(.intro):not(.agent) { border: 4px solid var(--heading); border-left-width: 28px; border-radius: 0; box-shadow: none; }
html[data-pattern="mondrian"]:not([data-container="none"]) .page > section:nth-of-type(3n+2):not(.intro):not(.agent) { border-left-color: var(--p1); }
html[data-pattern="mondrian"]:not([data-container="none"]) .page > section:nth-of-type(3n):not(.intro):not(.agent) { border-left-color: var(--p2); }
html[data-pattern="mondrian"]:not([data-container="none"]) .page > section:nth-of-type(3n+1):not(.intro):not(.agent) { border-left-color: var(--p3); }
html[data-pattern="mondrian"] .thumb { box-shadow: none; outline: 3px solid var(--heading); outline-offset: 0; }
html[data-pattern="mondrian"][data-slots~="corner"] .site::after { width: min(300px, calc((100vw - var(--frame)) / 2 - 12px)); clip-path: none; background-size: 300px 150px; background-repeat: no-repeat; aspect-ratio: 2; }
@media (max-width: 639.98px) { html[data-pattern="mondrian"]:not([data-container="none"]) .page > section:not(.intro):not(.agent) { border-width: 3px; border-left-width: 14px; } }

/* R231: a solid pill (Copy, Let's talk) always keeps the accent fill and its text color; materials add only edge and shadow. */
html[data-material]:not([data-material="flat"]) .pill.dark { border: var(--m-edge); box-shadow: var(--m-shadow); background: var(--accent); color: var(--on-accent); }
/* Section labels size to their words, not the row they sit in. */
.works > .label { justify-self: start; }
