/*
 * Katofli website styles.
 * Colours come from the app's Bento theme, "cool" variant (src/lib/themes/data.ts):
 *   tray #0d0f15, text #e9edf5, accent #8ab4ff, accent text #0b1530.
 * Bento is dark only, so the light scheme is derived: the same blue hue,
 * darkened until text and links pass 4.5:1 on every background they sit on.
 * No web fonts: the stack below is the one the app's themes use.
 * build.mjs appends the generated rules for the theme switcher.
 */
:root {
  color-scheme: light dark;
  --bg: #f6f7fb;
  --bg-2: #eef0f6;
  --card: #ffffff;
  --card-2: #eceef5;
  --edge: #d3d8e4;
  --edge-strong: #aab2c5;
  --fg: #0d0f15;
  --muted: #485166;
  --accent: #2a5bd7;
  --on-accent: #ffffff;
  --link: #1f4fc0;
  --code-bg: #e8ebf3;
  --warn-bg: #fff6e6;
  --warn-edge: #c98a1b;
  --focus: #1f4fc0;
  /* Elevation: stacked soft shadows tinted towards the page's blue-grey, three levels. */
  --e1: 0 1px 1px hsl(226 40% 22% / 0.05), 0 2px 6px hsl(226 40% 22% / 0.06);
  --e2: 0 1px 2px hsl(226 40% 22% / 0.06), 0 4px 10px hsl(226 40% 22% / 0.06), 0 14px 30px -6px hsl(226 40% 22% / 0.12);
  --e3: 0 2px 4px hsl(226 45% 20% / 0.06), 0 10px 22px -4px hsl(226 45% 20% / 0.12), 0 32px 64px -16px hsl(226 45% 20% / 0.24);
  --hi: inset 0 1px 0 rgb(255 255 255 / 0.7);
  --shadow: var(--e2);
  --shot-shadow: drop-shadow(0 2px 3px hsl(226 40% 22% / 0.10)) drop-shadow(0 14px 22px hsl(226 40% 22% / 0.16));
  --shot-shadow-up: drop-shadow(0 3px 4px hsl(226 40% 22% / 0.10)) drop-shadow(0 22px 30px hsl(226 40% 22% / 0.20));
  --pick-on-bg: #0d0f15;
  --pick-on-fg: #ffffff;
  /* The light from the mark's slit. */
  --slit: #ffb070;
  --slit-hot: #ffe2c4;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", "SFMono-Regular", Menlo, monospace;
  --r-card: 14px;
  --r-item: 9px;
  --measure: 42rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f15;
    --bg-2: #11141c;
    --card: #151922;
    --card-2: #1c212c;
    --edge: #2a3040;
    --edge-strong: #3d4558;
    --fg: #e9edf5;
    --muted: #a6aec0;
    --accent: #8ab4ff;
    --on-accent: #0b1530;
    --link: #8ab4ff;
    --code-bg: #1a1e29;
    --warn-bg: #221b10;
    --warn-edge: #a87a2a;
    --focus: #8ab4ff;
    --e1: 0 1px 1px hsl(228 50% 3% / 0.35), 0 3px 8px hsl(228 50% 3% / 0.25);
    --e2: 0 1px 2px hsl(228 50% 3% / 0.4), 0 6px 14px hsl(228 50% 3% / 0.3), 0 18px 36px -8px hsl(228 50% 3% / 0.45);
    --e3: 0 2px 4px hsl(228 50% 3% / 0.4), 0 14px 28px -6px hsl(228 50% 3% / 0.5), 0 40px 80px -20px hsl(228 50% 2% / 0.7);
    --hi: inset 0 1px 0 rgb(255 255 255 / 0.06), inset 0 0 0 1px rgb(255 255 255 / 0.02);
    --shot-shadow: drop-shadow(0 2px 3px hsl(228 50% 3% / 0.45)) drop-shadow(0 16px 24px hsl(228 50% 3% / 0.5));
    --shot-shadow-up: drop-shadow(0 3px 4px hsl(228 50% 3% / 0.45)) drop-shadow(0 26px 34px hsl(228 50% 3% / 0.6));
    --pick-on-bg: #e9edf5;
    --pick-on-fg: #0d0f15;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.65 var(--font);
}
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 0.5rem; top: -4rem;
  background: var(--accent); color: var(--on-accent);
  padding: 0.5rem 0.9rem; border-radius: var(--r-item); z-index: 10;
}
.skip:focus { top: 0.5rem; }

.wrap { width: 100%; max-width: 74rem; margin: 0 auto; padding: 0 1.25rem; }
.wrap.wide { max-width: 84rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--edge); background: var(--bg); }
.site-header .wrap {
  display: flex; align-items: center; gap: 0.5rem 1.5rem; min-height: 3.75rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem; flex: none;
  font: 650 1.15rem/1 var(--font-display); letter-spacing: -0.01em; color: var(--fg); text-decoration: none;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand.small { font-size: 1rem; }
.brand.small img { width: 24px; height: 24px; border-radius: 6px; }
.site-nav { margin-left: auto; min-width: 0; }
.site-nav ul { display: flex; gap: 0.15rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 0.4rem 0.7rem; border-radius: var(--r-item); white-space: nowrap;
  color: var(--fg); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.site-nav a:hover { background: var(--card-2); }
.site-nav a[aria-current="page"] { background: var(--card-2); box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 56rem) {
  .site-header .wrap { flex-wrap: wrap; padding-top: 0.6rem; }
  .site-nav { margin-left: 0; width: 100%; margin-bottom: 0.4rem; }
  .site-nav ul { flex-wrap: wrap; }
  .site-nav a { padding: 0.35rem 0.6rem; font-size: 0.92rem; }
}

/* Page */
main { padding: 0 0 4rem; }
main:focus { outline: none; }
h1, h2, h3, h4 { line-height: 1.22; margin: 2.2rem 0 0.6rem; font-weight: 650; font-family: var(--font-display); text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); margin-top: 0; letter-spacing: -0.02em; font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p, ul, ol, table, pre, blockquote { margin: 0 0 1rem; }
li { margin: 0.25rem 0; }
.prose { max-width: var(--measure); overflow-wrap: break-word; }
.prose h1 + p, .page-head .lead { font-size: 1.15rem; }
.prose h2 { padding-top: 0.4rem; }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--fg); max-width: 40rem; }
.muted { color: var(--muted); }
.page-head { padding-top: 2.5rem; }
.wrap > .prose:first-child, .wrap > article.prose { padding-top: 2.5rem; }

code, kbd {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 5px;
  overflow-wrap: anywhere;
}
kbd { border: 1px solid var(--edge); border-bottom-width: 2px; white-space: nowrap; }
pre {
  background: var(--code-bg); padding: 0.9rem 1rem; border-radius: var(--r-item);
  overflow-x: auto; border: 1px solid var(--edge); line-height: 1.5;
}
pre.plain { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.88rem; }
pre code { background: none; padding: 0; font-size: 0.86rem; overflow-wrap: normal; }
blockquote {
  border-left: 4px solid var(--accent); background: var(--card);
  padding: 0.6rem 1rem; border-radius: 0 var(--r-item) var(--r-item) 0;
}
blockquote > :last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--edge); margin: 2rem 0; }

.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--edge); border-radius: var(--r-item); background: var(--card); }
.table-wrap:focus-visible { outline-offset: 0; }
table { border-collapse: collapse; width: 100%; margin: 0; font-size: 0.92rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--edge); }
th { background: var(--card-2); white-space: nowrap; font-weight: 650; }
td { min-width: 8rem; }
td:first-child { min-width: 9rem; }
tr:last-child td { border-bottom: 0; }
@media (max-width: 40rem) {
  table { font-size: 0.88rem; }
  th, td { padding: 0.5rem 0.6rem; }
}

/* Buttons, badges, notes */
.btn {
  display: inline-flex; align-items: center; min-height: 2.75rem; background: var(--accent); color: var(--on-accent);
  padding: 0.6rem 1.25rem; border-radius: var(--r-item); font-weight: 700; text-decoration: none;
  border: 2px solid var(--accent);
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--edge-strong); }
.btn.ghost:hover { background: var(--card-2); filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.badge {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--card); border: 1px solid var(--edge); padding: 0.2rem 0.7rem; border-radius: 999px; color: var(--muted);
  margin: 0 0 1rem;
}
.more { font-weight: 600; }
.more::after { content: " \2192"; }

.note {
  background: var(--warn-bg); border: 1px solid var(--warn-edge); border-left-width: 4px; border-radius: var(--r-item);
  padding: 0.9rem 1.1rem; margin: 1.25rem 0; max-width: var(--measure);
}
.note > :last-child { margin-bottom: 0; }
.note-title { font-weight: 700; margin-bottom: 0.35rem; }

/* Screenshots */
figure.shot { margin: 1.5rem 0; }
figure.shot img { display: block; }
figure.shot figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 0.6rem; max-width: var(--measure); }
.render-note { white-space: nowrap; }
@media (max-width: 30rem) { .render-note { white-space: normal; } }
.prose figure.shot.wide img {
  border-radius: var(--r-item); border: 1px solid var(--edge); background: var(--card-2);
}
.prose figure.shot.wide { padding: 0.75rem; border: 1px solid var(--edge); border-radius: var(--r-card); background: var(--bg-2); }
.prose figure.shot.wide img { border: 0; background: none; margin: 0 auto; }
.shot.narrow img { max-width: min(100%, 27.5rem); }
.trio-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; align-items: start; }
@media (max-width: 34rem) { .trio-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .trio-row img:last-child { display: none; } }

/* Home: hero */
.hero-band {
  --beam: var(--slit);
  background: var(--bg-2);
  border-bottom: 1px solid var(--edge);
  padding-bottom: 2.5rem;
  position: relative; isolation: isolate;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-band { transition: --beam 0.6s ease; }
}
.hero {
  padding-top: clamp(2.25rem, 6vw, 4.5rem);
  display: grid; gap: 1rem 4rem; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); align-items: end;
}
.hero .facts { margin-bottom: 1.5rem; }
@media (max-width: 60rem) {
  .hero { grid-template-columns: 1fr; }
  .hero .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-top: -0.5rem; }
  .hero .facts li { font-size: 0.88rem; padding: 0.5rem 0.7rem; }
}
.hero h1 { max-width: 20ch; }
.hero .lead { color: var(--muted); }
@media (prefers-color-scheme: dark) { .hero .lead { color: #c3c9d6; } }

/* Home: the theme switcher (radio inputs + CSS; rules per theme are generated) */
.switcher { position: relative; margin-top: 1rem; }
.t-radio { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.picker { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; }
.pick {
  display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; user-select: none;
  min-height: 2.5rem; padding: 0.35rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--edge); background: var(--bg-2); color: var(--fg);
  font-weight: 600; font-size: 0.93rem; white-space: nowrap;
}
.pick:hover { border-color: var(--edge-strong); }
.pick .dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.45); }
.pick-auto::before { content: ""; width: 0.6rem; height: 0.6rem; border: 2px solid currentColor; border-radius: 50%; border-right-color: transparent; }
#t-auto:checked ~ .picker .pick-auto { background: var(--pick-on-bg); color: var(--pick-on-fg); border-color: var(--pick-on-bg); }
#t-auto:focus-visible ~ .picker .pick-auto { outline: 2px solid var(--focus); outline-offset: 2px; }
.stage { display: grid; position: relative; }
.slide { grid-area: 1 / 1; margin: 0; opacity: 0; visibility: hidden; position: relative; z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  .slide { scale: 0.985; transition: opacity 0.45s ease, scale 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0.45s; }
}
.desk {
  border-radius: var(--r-card); padding: clamp(0.75rem, 2.4vw, 1.75rem) clamp(0.75rem, 2.4vw, 1.75rem) clamp(0.6rem, 1.6vw, 1rem);
  box-shadow: var(--e3); overflow: hidden; position: relative;
}
.lenses { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.6rem, 2vw, 1.25rem); margin-bottom: clamp(1.25rem, 5vw, 3.5rem); }
.lens {
  position: relative; aspect-ratio: 560 / 72; overflow: hidden; border-radius: 10px;
  background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 6px 18px rgba(0, 0, 0, 0.25);
}
.lens img {
  position: absolute; top: 50%; width: 342.857%; max-width: none; height: auto; transform: translateY(-50%);
}
.lens-left img { left: 0; }
.lens-right img { right: 0; }
.full img { display: block; width: 100%; height: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25)); }
.slide figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin-top: 0.85rem; }
.t-name { font: 700 1.25rem/1.3 var(--font-display); }
.t-blurb { color: var(--muted); }
.stage-note { font-size: 0.88rem; color: var(--muted); margin: 0.35rem 0 0; }
@media (max-width: 40rem) {
  .lenses { grid-template-columns: 1fr; }
  .picker { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding: 2px 2px 0.4rem; margin-left: -2px; margin-right: -2px; }
  .pick { min-height: 2.25rem; padding: 0.25rem 0.7rem; font-size: 0.9rem; flex: none; }
}
/* With reduced motion nothing cycles, so "In turn" is not offered; the stage shows the first theme. */
@media (prefers-reduced-motion: reduce) {
  .pick-auto { display: none; }
}

/* Home: sections */
.intro { padding-top: 3rem; }
.intro h2 { margin-top: 0; }
.intro-lead { font-size: 1.15rem; line-height: 1.6; margin: 0; max-width: var(--measure); }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.facts li { margin: 0; padding: 0.65rem 0.9rem; background: var(--card); border: 1px solid var(--edge); border-radius: var(--r-item); font-size: 0.95rem; line-height: 1.45; }

.section-title { margin-top: 3.5rem; }
.feature-row {
  display: grid; gap: 1.5rem 3rem; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: center;
  padding: 2rem 0; border-bottom: 1px solid var(--edge);
}
.feature-row.flip .feature-text { order: 2; }
.feature-row h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin: 0.2rem 0 0.6rem; }
.feature-text p { max-width: 32rem; }
.kicker { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0; }
.feature-media figure.shot { margin: 0; }
.feature-media img { filter: drop-shadow(0 10px 24px rgba(13, 15, 21, 0.22)); }
.feature-media .narrow img { margin: 0 auto; }
.feature-media figcaption { text-align: center; margin-left: auto; margin-right: auto; }
@media (max-width: 52rem) {
  .feature-row { grid-template-columns: 1fr; }
  .feature-row.flip .feature-text { order: 0; }
}

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); list-style: none; padding: 0; margin: 2rem 0 1rem; }
.card {
  background: var(--card); border: 1px solid var(--edge); border-radius: var(--r-card);
  padding: 1.1rem 1.2rem; margin: 0;
}
.card h3 { margin: 0 0 0.45rem; font-size: 1.05rem; text-wrap: pretty; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card .num { color: var(--muted); font-weight: 600; margin-right: 0.45rem; font-variant-numeric: tabular-nums; }
.after-grid { margin-top: 0.5rem; }

.split { display: grid; gap: 1rem 3.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 1.5rem; }
.split h2 { margin-top: 2rem; }
@media (max-width: 52rem) { .split { grid-template-columns: 1fr; } }
.ticks { padding-left: 1.25rem; }

.reassure {
  margin-top: 3rem; padding: clamp(1.25rem, 3vw, 2rem); border-radius: var(--r-card);
  background: var(--card); border: 1px solid var(--edge);
}
.reassure h2 { margin-top: 0; }
.reassure-grid { display: grid; gap: 1rem 2rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 1rem 0 0.5rem; }
.reassure-grid p { margin: 0 0 0.35rem; }
.r-key { font-weight: 700; }
@media (max-width: 52rem) { .reassure-grid { grid-template-columns: 1fr; } }

.card-links { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.card-links li { margin: 0; }
.card-links a { display: block; height: 100%; background: var(--card); border: 1px solid var(--edge); border-radius: var(--r-item); padding: 0.65rem 0.9rem; text-decoration: none; color: var(--fg); }
.card-links a:hover { border-color: var(--edge-strong); }
.cl-title { display: block; font-weight: 650; color: var(--link); }
.cl-desc { display: block; font-size: 0.9rem; color: var(--muted); }

/* Guide layout */
.with-side { display: grid; gap: 0 3rem; grid-template-columns: minmax(0, 1fr); padding-top: 1.5rem; }
.doc { min-width: 0; padding-top: 1rem; }
.doc .prose { max-width: 46rem; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin: 0 0 0.75rem; }
.side { font-size: 0.93rem; line-height: 1.4; }
.side h2 { font: 700 0.75rem/1.4 var(--font); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin: 1.25rem 0 0.35rem 0.6rem; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li { margin: 1px 0; }
.side a { display: block; padding: 0.32rem 0.6rem; border-radius: 7px; color: var(--fg); text-decoration: none; }
.side a:hover { background: var(--card-2); }
.side a[aria-current="page"] { background: var(--card-2); font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.side .sub { margin: 0.2rem 0 0.4rem 0.6rem; padding-left: 0.5rem; border-left: 1px solid var(--edge); }
.side .group-title { display: block; font-size: 0.78rem; font-weight: 700; color: var(--muted); margin: 0.6rem 0 0.15rem 0.6rem; }
.side .sub a { padding: 0.22rem 0.6rem; font-size: 0.9rem; }
.side-fold { border: 1px solid var(--edge); border-radius: var(--r-item); background: var(--card); margin-bottom: 0.5rem; }
.side-fold > summary { cursor: pointer; padding: 0.7rem 1rem; font-weight: 650; min-height: 2.75rem; }
.side-fold[open] > summary { border-bottom: 1px solid var(--edge); }
.side-fold .side { padding: 0 0.5rem 0.75rem; max-height: 70vh; overflow-y: auto; }
.side-wide { display: none; }
@media (min-width: 60rem) {
  .with-side { grid-template-columns: 16rem minmax(0, 1fr); padding-top: 2rem; }
  .side-fold { display: none; }
  .side-wide { display: block; position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow-y: auto; padding: 0 0.25rem 1rem 0; scrollbar-width: thin; }
  .doc { padding-top: 0.5rem; }
}

.toc { margin: 1.5rem 0 2rem; padding: 0.9rem 1.1rem; background: var(--card); border: 1px solid var(--edge); border-radius: var(--r-item); }
.toc-title { font: 700 0.75rem/1.4 var(--font); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.4rem; padding: 0; }
.toc ul { columns: 2 14rem; column-gap: 2rem; margin: 0; padding-left: 1.1rem; font-size: 0.93rem; }
.toc li { break-inside: avoid; margin: 0; padding: 0.12rem 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--edge); padding: 2rem 0 2.5rem; color: var(--muted); font-size: 0.92rem; background: var(--bg-2); }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding: 0; margin: 1rem 0 0.75rem; }
.site-footer p { margin: 0; max-width: 46rem; }

/* ------------------------------------------------------------------
 * The beam: light through a door left ajar, as in the mark. A tall,
 * narrow slit stands just right of the hero stage; from its foot a
 * wedge of light falls down and to the left across the stage, the way
 * the mark's trapezoid falls across the floor (its edges lean about 37
 * and 60 degrees from the vertical). The wedge is one conic gradient
 * with soft edges, faded with distance by a radial mask: no blur filter.
 * Its colour is --beam: the mark's warm light for Bento, each theme's
 * own light otherwise (set per theme by the generated rules).
 * ------------------------------------------------------------------ */
@property --beam { syntax: "<color>"; inherits: true; initial-value: #ffb070; }
/* The lamp is the door and its light as one box over the stage: its right edge is the slit, --foot
   down from its top is the slit's foot, and the light falls --fall below that. It is the one element
   that moves (see "The door opens into the page" below); .beam inside it carries the theme colour. */
.lamp {
  --gx: min(3.5rem, 0.65rem + max(0px, (100vw - 74rem) / 2));
  --foot: 1.1rem;
  --fall: clamp(10rem, 14vw, 13rem);
  position: absolute; top: 0; left: 0; right: calc(-1 * var(--gx)); height: calc(var(--foot) + var(--fall));
  pointer-events: none; z-index: 2;
  transform-origin: 100% var(--foot);
}
.beam { position: absolute; inset: 0; }
.beam-slit, .beam-wedge { position: absolute; display: block; }
.beam-slit {
  /* 64px wide box: a 3px hot core and its halo, fading out towards the top. */
  right: -32px; width: 64px; bottom: calc(100% - var(--foot)); height: clamp(12rem, 30vw, 27rem);
  background:
    linear-gradient(90deg, transparent calc(50% - 1.5px), color-mix(in oklab, var(--beam) 40%, #fff) calc(50% - 1.5px) calc(50% + 1.5px), transparent calc(50% + 1.5px)),
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--beam) 5%, transparent) 22%, color-mix(in srgb, var(--beam) 20%, transparent) 40%, color-mix(in srgb, var(--beam) 60%, transparent) 48.5%, color-mix(in srgb, var(--beam) 60%, transparent) 51.5%, color-mix(in srgb, var(--beam) 20%, transparent) 60%, color-mix(in srgb, var(--beam) 5%, transparent) 78%, transparent);
  -webkit-mask-image: linear-gradient(to top, #000, #000 45%, rgb(0 0 0 / 0.35) 80%, transparent);
  mask-image: linear-gradient(to top, #000, #000 45%, rgb(0 0 0 / 0.35) 80%, transparent);
}
.beam-wedge {
  --o: 12rem; /* the box reaches this far right of the slit, so the pool at its foot is whole */
  top: var(--foot); right: calc(-1 * var(--o)); bottom: 0; width: calc(min(100%, 62rem) + var(--o));
  transform-origin: calc(100% - var(--o)) 0;
  background:
    radial-gradient(7rem 2rem at calc(100% - var(--o)) 0, color-mix(in srgb, var(--beam) 55%, transparent), transparent 70%),
    conic-gradient(from 180deg at calc(100% - var(--o)) 0, transparent 0deg 38deg, color-mix(in srgb, var(--beam) 34%, transparent) 40.5deg, color-mix(in srgb, var(--beam) 26%, transparent) 52deg, color-mix(in srgb, var(--beam) 34%, transparent) 64deg, transparent 66.5deg);
  -webkit-mask-image: radial-gradient(farthest-side at calc(100% - var(--o)) 0, #000, rgb(0 0 0 / 0.8) 20%, rgb(0 0 0 / 0.5) 50%, rgb(0 0 0 / 0.2) 80%, transparent);
  mask-image: radial-gradient(farthest-side at calc(100% - var(--o)) 0, #000, rgb(0 0 0 / 0.8) 20%, rgb(0 0 0 / 0.5) 50%, rgb(0 0 0 / 0.2) 80%, transparent);
  mix-blend-mode: screen;
}
/* The door itself, standing just open to the left of the slit: the mark's faint blue panel in the dark,
   a soft door-shaped shade on a light page so the slit reads as light against it. */
.beam::before {
  content: ""; position: absolute; right: 2px; bottom: calc(100% - var(--foot)); height: clamp(12rem, 30vw, 27rem); width: clamp(5rem, 14vw, 12rem);
  background: linear-gradient(to left, var(--door), transparent);
  -webkit-mask-image: linear-gradient(to top, #000, #000 40%, transparent);
  mask-image: linear-gradient(to top, #000, #000 40%, transparent);
}
.beam { --door: rgb(138 180 255 / 0.07); }
@media (prefers-color-scheme: light) {
  .beam { --door: hsl(226 40% 22% / 0.16); }
  .beam-slit {
    background:
      linear-gradient(90deg, transparent calc(50% - 1.5px), color-mix(in oklab, var(--beam) 80%, #fff) calc(50% - 1.5px) calc(50% + 1.5px), transparent calc(50% + 1.5px)),
      linear-gradient(90deg, transparent, color-mix(in srgb, var(--beam) 8%, transparent) 25%, color-mix(in srgb, var(--beam) 30%, transparent) 42%, color-mix(in oklab, var(--beam) 85%, #000 6%) 48.8%, color-mix(in oklab, var(--beam) 85%, #000 6%) 51.2%, color-mix(in srgb, var(--beam) 30%, transparent) 58%, color-mix(in srgb, var(--beam) 8%, transparent) 75%, transparent);
  }
  .beam-wedge { mix-blend-mode: normal; opacity: 0.85; }
}
/* The room: the wall behind the stage takes a little of the light. */
.hero-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(46rem 34rem at calc(100% - max(0px, (100vw - 74rem) / 2) - 1.25rem + min(3.5rem, 0.65rem + max(0px, (100vw - 74rem) / 2))) 62%, color-mix(in srgb, var(--beam) 9%, transparent), transparent 70%);
}
.hero, .switcher { position: relative; z-index: 1; }
.switcher .picker, .switcher .stage-note { position: relative; z-index: 3; }

@media (prefers-reduced-motion: no-preference) {
  /* The door opens once on load: the slit widens, the light swings out and settles; then it breathes. */
  .beam-slit { animation: slit-open 1.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both; }
  .beam-wedge { animation: wedge-open 1.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both, wedge-breathe 8s ease-in-out 2.2s infinite alternate; }
}
@keyframes slit-open { from { opacity: 0; transform: scaleX(0.2); } 30% { opacity: 1; } }
@keyframes wedge-open { from { opacity: 0; transform: rotate(-16deg) scale(0.6); } }
@keyframes wedge-breathe { to { opacity: 0.72; } }

/* ------------------------------------------------------------------
 * The door opens into the page. There is one door and one light per
 * page. On the home page it is the hero's own lamp: once the top of the
 * theme stage scrolls up to the pin line (--pin from the top of the
 * window), the lamp stays there, pinned by a translate that follows the
 * scroll exactly, and over the next screen it opens: it grows about the
 * slit's foot until it fills the window behind the page. The content
 * after the hero paints over it, so it is a background from there on.
 * Scroll-driven CSS only (the CSP allows no script); transform only.
 * With reduced motion, or without scroll timelines, the door stays in
 * the hero and scrolls away with it.
 * On every other page the same lamp stands open behind the page, fixed,
 * where the home page's door ends up.
 * ------------------------------------------------------------------ */
:root { --pin: min(55vh, 30rem); }
main { overflow: clip; } /* the opened light never widens or lengthens the page */
.hero-band ~ .wrap { position: relative; } /* paints over the pinned lamp */
/* The open state: the door grows and steps in from the edge, the light on the floor widens and
   reaches further, and the slit stays a thin line of light rather than thickening with the rest. */
.room .lamp { transform: translateX(-12%) scale(1.6); }
.room .beam-wedge { scale: 1.4 1.5; }
.room .beam-slit { scale: 0.6 1; }
.room .beam::before { opacity: 0.45; } /* the grown door panel stays a shade, not a block */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .stage { view-timeline: --stage block; view-timeline-inset: var(--pin) auto; }
    .stage > .lamp {
      will-change: transform, translate;
      animation: lamp-pin linear both, lamp-open linear both;
      animation-timeline: --stage, --stage;
      animation-range: exit-crossing 0% exit-crossing 20000px, exit-crossing 0% exit-crossing 100vh;
    }
    .stage .beam-wedge {
      animation: wedge-open 1.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both, wedge-breathe 8s ease-in-out 2.2s infinite alternate, wedge-widen linear both;
      animation-timeline: auto, auto, --stage;
      animation-range: normal, normal, exit-crossing 0% exit-crossing 100vh;
    }
    .stage .beam-slit {
      animation: slit-open 1.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both, slit-thin linear both;
      animation-timeline: auto, --stage;
      animation-range: normal, exit-crossing 0% exit-crossing 100vh;
    }
    .stage .beam::before { animation: door-shade linear both; animation-timeline: --stage; animation-range: exit-crossing 0% exit-crossing 100vh; }
  }
}
@keyframes door-shade { to { opacity: 0.45; } }
@keyframes lamp-pin { to { translate: 0 20000px; } }
@keyframes lamp-open { to { transform: translateX(-12%) scale(1.6); } }
@keyframes wedge-widen { to { scale: 1.4 1.5; } }
@keyframes slit-thin { to { scale: 0.6 1; } }
.room { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; contain: strict; }
.room-stage { position: absolute; top: var(--pin); bottom: 0; left: calc(max(0px, (100% - 74rem) / 2) + 1.25rem); right: calc(max(0px, (100% - 74rem) / 2) + 1.25rem); }

/* The motif, used sparingly elsewhere: the mark's slit glows when you point at it,
   the beta pill carries a small slit, and the "taskbar back" panel is lit from its left edge. */
.brand { position: relative; --m: 32px; }
.brand.small { --m: 24px; }
.brand::after {
  content: ""; position: absolute; pointer-events: none; opacity: 0;
  left: calc(var(--m) * 39 / 64); top: calc(50% - var(--m) / 2 + var(--m) * 13 / 64);
  width: calc(var(--m) * 3 / 64); height: calc(var(--m) * 31 / 64);
  background: var(--slit-hot); box-shadow: 0 0 4px 1px var(--slit), 0 0 12px 3px color-mix(in srgb, var(--slit) 55%, transparent);
  transition: opacity 0.2s ease;
}
.brand:hover::after, .brand:focus-visible::after { opacity: 1; }
.badge::before {
  content: ""; display: inline-block; width: 3px; height: 0.95em; margin-right: 0.55rem; vertical-align: -0.12em; border-radius: 1px;
  background: var(--slit); box-shadow: 0 0 6px 1px color-mix(in srgb, var(--slit) 55%, transparent);
}
.reassure { position: relative; overflow: hidden; isolation: isolate; }
.reassure::before, .reassure::after { content: ""; position: absolute; pointer-events: none; }
.reassure::before {
  left: 0; top: 14%; bottom: 14%; width: 3px; border-radius: 0 2px 2px 0;
  background: linear-gradient(transparent, var(--slit) 18%, var(--slit-hot) 50%, var(--slit) 82%, transparent);
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--slit) 50%, transparent), 0 0 26px 4px color-mix(in srgb, var(--slit) 22%, transparent);
}
.reassure::after {
  inset: 0; z-index: -1;
  background: radial-gradient(30rem 75% at 0 50%, color-mix(in srgb, var(--slit) 13%, transparent), color-mix(in srgb, var(--slit) 4%, transparent) 50%, transparent 80%);
}

/* Depth */
.facts li, .card, .card-links a, .toc, .table-wrap, .side-fold, .prose figure.shot.wide { box-shadow: var(--e1), var(--hi); }
.reassure, .note { box-shadow: var(--e2), var(--hi); }
.badge { box-shadow: var(--e1); }
.btn { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 1px 2px color-mix(in srgb, var(--accent) 30%, transparent), 0 6px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.ghost { box-shadow: var(--e1); }
.feature-media img { filter: var(--shot-shadow); }
.lens { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 2px 4px rgba(0, 0, 0, 0.18), 0 10px 22px -4px rgba(0, 0, 0, 0.35); }

/* Micro-interactions: transform and shadow only, short. */
.btn, .card, .card-links a, .facts li { transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.12s, border-color 0.12s; }
.btn:hover { filter: none; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22), 0 2px 4px color-mix(in srgb, var(--accent) 30%, transparent), 0 10px 26px -6px color-mix(in srgb, var(--accent) 85%, transparent); }
.btn.ghost:hover { box-shadow: var(--e2); }
.card:hover, .card-links a:hover { box-shadow: var(--e2), var(--hi); }
.feature-media img { transition: transform 0.2s ease, filter 0.2s ease; }
.feature-media figure.shot:hover img { filter: var(--shot-shadow-up); }
.site-nav a, .side a, .pick { transition: background-color 0.12s, border-color 0.12s, color 0.12s, transform 0.14s ease; }
.btn:active { transform: translateY(0); }
@media (prefers-reduced-motion: no-preference) {
  .btn:hover { transform: translateY(-1px); }
  .card:hover, .card-links a:hover { transform: translateY(-2px); }
  .feature-media figure.shot:hover img { transform: translateY(-4px); }
  .side a:hover { transform: translateX(2px); }
  .pick:hover { transform: translateY(-1px); }

  /* The hero's text arrives once on load. */
  .hero-text > *, .hero .facts li { animation: hero-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-text > :nth-child(2) { animation-delay: 0.06s; }
  .hero-text > :nth-child(3) { animation-delay: 0.12s; }
  .hero-text > :nth-child(4) { animation-delay: 0.18s; }
  .hero .facts li:nth-child(1) { animation-delay: 0.2s; }
  .hero .facts li:nth-child(2) { animation-delay: 0.26s; }
  .hero .facts li:nth-child(3) { animation-delay: 0.32s; }
  .hero .facts li:nth-child(4) { animation-delay: 0.38s; }
}
@keyframes hero-in { from { opacity: 0; translate: 0 10px; } }

/* Sections and cards rise a little as they scroll into view. Only where scroll-driven
   animations exist; elsewhere (and with reduced motion) everything simply shows. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .intro, .section-title, .feature-row > *, .grid > .card, .after-grid, .split > div, .reassure, .card-links li {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
    .feature-row > .feature-media, .grid > .card:nth-child(4n + 2) { animation-range: entry 8% entry 68%; }
    .grid > .card:nth-child(4n + 3) { animation-range: entry 14% entry 74%; }
    .grid > .card:nth-child(4n + 4) { animation-range: entry 20% entry 80%; }
  }
}
@keyframes rise { from { opacity: 0; translate: 0 26px; } }

@media print {
  .site-header, .side, .side-fold, .site-footer, .skip, .picker { display: none; }
  body { background: #fff; color: #000; }
}

/* Generated by build.mjs from the theme list: 7 themes, 35s cycle. */
@keyframes slide-cycle { 0% { opacity: 1; visibility: visible; } 12.286% { opacity: 1; visibility: visible; } 14.286% { opacity: 0; visibility: hidden; } 98.000% { opacity: 0; visibility: hidden; } 100% { opacity: 1; visibility: visible; } }
@keyframes beam-cycle { 0% { --beam: #ffb070; } 13.286% { --beam: #4cc2ff; } 27.571% { --beam: #ffd23f; } 41.857% { --beam: #ffb59e; } 56.143% { --beam: #6cff8f; } 70.429% { --beam: #ff4fd8; } 84.714% { --beam: #ff6fae; } 99.000% { --beam: #ffb070; } }
@keyframes beam-dip { 11.686%, 14.886% { opacity: 1; } 13.286% { opacity: 0.25; } 25.971%, 29.171% { opacity: 1; } 27.571% { opacity: 0.25; } 40.257%, 43.457% { opacity: 1; } 41.857% { opacity: 0.25; } 54.543%, 57.743% { opacity: 1; } 56.143% { opacity: 0.25; } 68.829%, 72.029% { opacity: 1; } 70.429% { opacity: 0.25; } 83.114%, 86.314% { opacity: 1; } 84.714% { opacity: 0.25; } 97.400%, 100.000% { opacity: 1; } 99.000% { opacity: 0.25; } }
@keyframes pick-cycle { 0%, 14.286% { background: var(--pick-on-bg); color: var(--pick-on-fg); border-color: var(--pick-on-bg); } 14.296%, 100% { background: var(--bg-2); color: var(--fg); border-color: var(--edge); } }
.desk-bento { background: linear-gradient(160deg, #1a2236, #33466f); }
.pick-bento .dot { background: #8ab4ff; }
.slide-bento, .pick-bento { --i: 0; }
#t-bento:checked ~ .stage .slide-bento { opacity: 1; visibility: visible; scale: 1; }
#t-bento:checked ~ .picker .pick-bento { background: var(--pick-on-bg); color: var(--pick-on-fg); border-color: var(--pick-on-bg); }
#t-bento:focus-visible ~ .picker .pick-bento { outline: 2px solid var(--focus); outline-offset: 2px; }
.hero-band:has(#t-bento:checked) { --beam: #ffb070; }
.desk-glasswork { background: linear-gradient(160deg, #0f4c75, #5fa6cf); }
.pick-glasswork .dot { background: #4cc2ff; }
.slide-glasswork, .pick-glasswork { --i: 1; }
#t-glasswork:checked ~ .stage .slide-glasswork { opacity: 1; visibility: visible; scale: 1; }
#t-glasswork:checked ~ .picker .pick-glasswork { background: var(--pick-on-bg); color: var(--pick-on-fg); border-color: var(--pick-on-bg); }
#t-glasswork:focus-visible ~ .picker .pick-glasswork { outline: 2px solid var(--focus); outline-offset: 2px; }
.hero-band:has(#t-glasswork:checked) { --beam: #4cc2ff; }
.desk-neo-brutalist { background: linear-gradient(160deg, #e9e2d4, #cfc5b2); }
.pick-neo-brutalist .dot { background: #ffd23f; }
.slide-neo-brutalist, .pick-neo-brutalist { --i: 2; }
#t-neo-brutalist:checked ~ .stage .slide-neo-brutalist { opacity: 1; visibility: visible; scale: 1; }
#t-neo-brutalist:checked ~ .picker .pick-neo-brutalist { background: var(--pick-on-bg); color: var(--pick-on-fg); border-color: var(--pick-on-bg); }
#t-neo-brutalist:focus-visible ~ .picker .pick-neo-brutalist { outline: 2px solid var(--focus); outline-offset: 2px; }
.hero-band:has(#t-neo-brutalist:checked) { --beam: #ffd23f; }
.desk-tonal { background: linear-gradient(160deg, #2c1c17, #76493a); }
.pick-tonal .dot { background: #ffb59e; }
.slide-tonal, .pick-tonal { --i: 3; }
#t-tonal:checked ~ .stage .slide-tonal { opacity: 1; visibility: visible; scale: 1; }
#t-tonal:checked ~ .picker .pick-tonal { background: var(--pick-on-bg); color: var(--pick-on-fg); border-color: var(--pick-on-bg); }
#t-tonal:focus-visible ~ .picker .pick-tonal { outline: 2px solid var(--focus); outline-offset: 2px; }
.hero-band:has(#t-tonal:checked) { --beam: #ffb59e; }
.desk-mono-terminal { background: linear-gradient(160deg, #07100a, #18301f); }
.pick-mono-terminal .dot { background: #6cff8f; }
.slide-mono-terminal, .pick-mono-terminal { --i: 4; }
#t-mono-terminal:checked ~ .stage .slide-mono-terminal { opacity: 1; visibility: visible; scale: 1; }
#t-mono-terminal:checked ~ .picker .pick-mono-terminal { background: var(--pick-on-bg); color: var(--pick-on-fg); border-color: var(--pick-on-bg); }
#t-mono-terminal:focus-visible ~ .picker .pick-mono-terminal { outline: 2px solid var(--focus); outline-offset: 2px; }
.hero-band:has(#t-mono-terminal:checked) { --beam: #6cff8f; }
.desk-crt-vaporwave { background: linear-gradient(160deg, #1a0b33, #8a2f7a); }
.pick-crt-vaporwave .dot { background: #ff4fd8; }
.slide-crt-vaporwave, .pick-crt-vaporwave { --i: 5; }
#t-crt-vaporwave:checked ~ .stage .slide-crt-vaporwave { opacity: 1; visibility: visible; scale: 1; }
#t-crt-vaporwave:checked ~ .picker .pick-crt-vaporwave { background: var(--pick-on-bg); color: var(--pick-on-fg); border-color: var(--pick-on-bg); }
#t-crt-vaporwave:focus-visible ~ .picker .pick-crt-vaporwave { outline: 2px solid var(--focus); outline-offset: 2px; }
.hero-band:has(#t-crt-vaporwave:checked) { --beam: #ff4fd8; }
.desk-risograph { background: linear-gradient(160deg, #efe7d6, #f3c6d5); }
.pick-risograph .dot { background: #25449a; }
.slide-risograph, .pick-risograph { --i: 6; }
#t-risograph:checked ~ .stage .slide-risograph { opacity: 1; visibility: visible; scale: 1; }
#t-risograph:checked ~ .picker .pick-risograph { background: var(--pick-on-bg); color: var(--pick-on-fg); border-color: var(--pick-on-bg); }
#t-risograph:focus-visible ~ .picker .pick-risograph { outline: 2px solid var(--focus); outline-offset: 2px; }
.hero-band:has(#t-risograph:checked) { --beam: #ff6fae; }
@media (prefers-reduced-motion: no-preference) {
  #t-auto:checked ~ .stage .slide { scale: 1; animation: slide-cycle 35s linear infinite; animation-delay: calc(var(--i) * 5s - 35s); }
  #t-auto:checked ~ .picker .pick:not(.pick-auto) { animation: pick-cycle 35s step-end infinite; animation-delay: calc(var(--i) * 5s - 35s); }
  /* The cycling colour runs on the beam and the wall wash only, not the whole hero, so each step restyles two elements. */
  .hero-band:has(#t-auto:checked)::before { animation: beam-cycle 35s step-end infinite; }
  .hero-band:has(#t-auto:checked) .beam { animation: beam-cycle 35s step-end infinite, beam-dip 35s linear infinite; }
  .switcher:hover .slide, .switcher:hover .pick, .switcher:focus-within .slide, .switcher:focus-within .pick { animation-play-state: paused !important; }
  .hero-band:has(.switcher:hover, .switcher:focus-within)::before, .hero-band:has(.switcher:hover, .switcher:focus-within) .beam { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  #t-auto:checked ~ .stage .slide-bento { opacity: 1; visibility: visible; }
  #t-auto:checked ~ .picker .pick-bento { background: var(--pick-on-bg); color: var(--pick-on-fg); border-color: var(--pick-on-bg); }
  #t-auto:focus-visible ~ .picker .pick-bento { outline: 2px solid var(--focus); outline-offset: 2px; }
}
