@font-face{font-family:"Onest";font-style:normal;font-weight:100 900;font-display:swap;src:url("fonts/onest-cyrillic-wght-normal.woff2") format("woff2");unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}
@font-face{font-family:"Onest";font-style:normal;font-weight:100 900;font-display:swap;src:url("fonts/onest-latin-wght-normal.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:"JetBrains Mono";font-style:normal;font-weight:100 900;font-display:swap;src:url("fonts/jetbrains-mono-cyrillic-wght-normal.woff2") format("woff2");unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116}
@font-face{font-family:"JetBrains Mono";font-style:normal;font-weight:100 900;font-display:swap;src:url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
/*
 * The Init entry page. The same family as Frame's entry: cool paper, graphite ink, one soft light from above,
 * Onest for display and text, JetBrains Mono for small labels. The pictures are the product's own: the editor in
 * system fonts and neutral greys, the author's site in its theme's colours, which are the only colour on the page.
 * Rhythm: a centred poster where the example site assembles on the canvas and switches between three widths; five
 * chapters whose figure is pinned at 1280 × 620 and wider (html.pinned, with motion allowed) and changes one
 * sentence at a time, stacked in their final state below that; what else the editor does; the demo; the footer.
 * Breakpoints: 1360 the figure bleeds off the window, 1280 the pin and two columns, 1100 the poster's flanks,
 * 900 the tablet, 760 the figures recompose for a phone, 480 the narrow phone.
 */

:root {
  --paper: #ecedee;
  --paper-2: #e2e4e6;
  --plate: #f8f9f9;
  --ink: #14161a;
  --ink-2: #434850;
  --ink-3: #5e646c;
  --line: rgb(20 22 26 / 0.14);
  --line-2: rgb(20 22 26 / 0.08);
  --dot: rgb(20 22 26 / 0.15);
  --sans: Onest, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ui-line: #e4e4e7;
  --ui-mute: #71717a;
  --ui-fill: #f4f4f5;
  --ok: #15803d;
  --warn: #ea580c;
  --gutter: clamp(20px, 5vw, 72px);
  --page: 1296px;
  --hdr: 64px;
  --ease: cubic-bezier(0.3, 0.7, 0.2, 1);
  --shadow: 0 1px 0 rgb(255 255 255 / 0.8) inset, 0 40px 80px -40px rgb(20 22 26 / 0.4), 0 14px 28px -14px rgb(20 22 26 / 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--hdr) + 16px);
}

body {
  margin: 0;
  font: 400 clamp(1rem, 0.25vw + 0.94rem, 1.125rem) / 1.55 var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
ul,
ol,
fieldset {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

fieldset {
  padding: 0;
  border: 0;
  min-width: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.defs {
  position: absolute;
}

.sr,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 30;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

.nw {
  white-space: nowrap;
}

.ar {
  display: inline-block;
  width: 0.9em;
  height: 0.56em;
  vertical-align: 0.02em;
  margin-inline: 0.12em;
}

.ic {
  display: block;
  flex: none;
  width: 1.25em;
  height: 1.25em;
}

/* ---------- ink strokes: drawn once when their section arrives ---------- */

.ink {
  display: block;
  overflow: visible;
  pointer-events: none;
  color: var(--ink);
}

@keyframes draw {
  from {
    clip-path: inset(-80% 100% -80% 0);
  }
  to {
    clip-path: inset(-80% -2% -80% 0);
  }
}

/* the poster is in view at once: its underline is drawn on load, by CSS alone */
@media (prefers-reduced-motion: no-preference) {
  .cover .ink {
    animation: draw 0.9s var(--ease) 0.35s both;
  }
}

.uw {
  position: relative;
  display: inline-block;
}

.ink-ul {
  position: absolute;
  left: -1%;
  bottom: -0.1em;
  width: 102%;
  height: 0.12em;
}

/* ---------- type ---------- */

h1 {
  font: 500 clamp(2.3rem, 5.2vw, 4.7rem) / 1.03 var(--sans);
  letter-spacing: -0.042em;
  text-wrap: balance;
}

h2 {
  font: 500 clamp(1.9rem, 3vw, 2.9rem) / 1.08 var(--sans);
  letter-spacing: -0.032em;
  text-wrap: balance;
}

h3 {
  font: 500 1.375rem / 1.2 var(--sans);
  letter-spacing: -0.02em;
}

p {
  text-wrap: pretty;
}

.ln {
  display: block;
}

.cap,
.tag {
  font: 500 0.8125rem / 1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.tag {
  margin-bottom: 18px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: 600 0.95rem / 1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.btn-l {
  min-height: 56px;
  padding: 0 32px;
  font-size: 1.05rem;
}

.btn-s {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.875rem;
}

.btn-ink {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgb(20 22 26 / 0.6);
}

.btn-ink:hover {
  background: #2c3037;
  transform: translateY(-1px);
}

.btn-line {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-line:hover {
  background: var(--ink);
  color: #fff;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

.cta-demo {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.cta small {
  font-size: 0.875rem;
  color: var(--ink-2);
}

/* ---------- header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(236 237 238 / 0.95);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100% - 2 * var(--gutter), var(--page));
  height: var(--hdr);
  margin-inline: auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 1.125rem / 1 var(--sans);
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.logo b {
  font-weight: 650;
}

.logo svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.langs {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.7);
  box-shadow: inset 0 0 0 1px var(--line);
  font: 600 0.8125rem / 1 var(--sans);
}

.langs a {
  min-width: 40px;
  padding: 7px 0;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  color: var(--ink-3);
}

.langs a[aria-current] {
  background: var(--ink);
  color: #fff;
}

.link {
  font: 500 0.95rem / 1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
}

.link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.pbar {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  pointer-events: none;
}

.pbar i {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(var(--pg, 0));
  transform-origin: 0 50%;
}

/* ---------- the poster ---------- */

.cover {
  padding: clamp(16px, 2vw, 28px) 0 clamp(32px, 4vw, 64px);
}

.head {
  width: min(100% - 2 * var(--gutter), 980px);
  margin-inline: auto;
  text-align: center;
}

.lede {
  max-width: 34em;
  margin: 26px auto 0;
  font: 400 clamp(1.1rem, 1.5vw, 1.35rem) / 1.42 var(--sans);
  color: var(--ink-2);
  text-wrap: balance;
}

.head .cta {
  justify-content: center;
  margin-top: 24px;
}

.poster {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 210px;
  gap: clamp(20px, 2.4vw, 36px);
  align-items: start;
  width: min(100% - 2 * var(--gutter), var(--page));
  margin: clamp(20px, 2.4vw, 34px) auto 0;
}

.flank {
  padding-top: 64px;
}

.flank .cap {
  margin-bottom: 12px;
}

.flank ul + .cap {
  margin-top: 28px;
}

.lib,
.pages,
.outline {
  display: grid;
  gap: 2px;
}

.lib li,
.pages li,
.outline li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  font: 500 0.9375rem / 1.2 var(--sans);
  color: var(--ink-2);
}

.lib .ic,
.pages .ic,
.outline .ic {
  width: 20px;
  height: 20px;
}

.lib li.is-used,
.pages li.on {
  color: var(--ink);
  background: rgb(255 255 255 / 0.66);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.outline li {
  border-left: 2px solid var(--line);
  border-radius: 0 10px 10px 0;
  color: var(--ink);
}

.outline .shared {
  margin-left: auto;
  color: var(--ink-3);
}

.outline .shared .ic {
  width: 15px;
  height: 15px;
}

/* the width switch: the radios sit before the labels and the stage (see build.mjs) */

.stage-col {
  position: relative;
  display: grid;
  gap: 16px;
  justify-items: center;
  min-width: 0;
}

.dv-r {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.dv {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.72);
  box-shadow: inset 0 0 0 1px var(--line);
}

.dv-o {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  font: 600 0.875rem / 1 var(--sans);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}

.dv-o .ic {
  width: 18px;
  height: 18px;
}

#dv-desktop:checked ~ .dv [for="dv-desktop"],
#dv-tablet:checked ~ .dv [for="dv-tablet"],
#dv-mobile:checked ~ .dv [for="dv-mobile"] {
  background: var(--ink);
  color: #fff;
}

#dv-desktop:focus-visible ~ .dv [for="dv-desktop"],
#dv-tablet:focus-visible ~ .dv [for="dv-tablet"],
#dv-mobile:focus-visible ~ .dv [for="dv-mobile"] {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.stage {
  width: 100%;
}

.dv-caps {
  min-height: 3em;
  max-width: 34em;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.dv-cap {
  display: none;
}

#dv-desktop:checked ~ .dv-caps [data-dv="desktop"],
#dv-tablet:checked ~ .dv-caps [data-dv="tablet"],
#dv-mobile:checked ~ .dv-caps [data-dv="mobile"] {
  display: block;
}

/* ---------- the editor, as a picture: system fonts, neutral greys, like the product ---------- */

.ed,
.fig {
  font-family: var(--ui);
  letter-spacing: 0;
  line-height: 1.35;
  color: #18181b;
}

.ed {
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.ed-top {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--ui-line);
  font-size: 13px;
}

.ed-dots {
  display: inline-flex;
  gap: 6px;
}

.ed-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d4d4d8;
}

.ed-saved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--ui-mute);
}

.ed-saved .ic {
  width: 14px;
  height: 14px;
  color: var(--ok);
}

.ed-pub {
  padding: 6px 12px;
  border-radius: 7px;
  background: #18181b;
  color: #fff;
  font-weight: 600;
}

.ed-body {
  position: relative;
  padding: 14px;
  background: var(--ui-fill);
}

.ed-cap {
  margin-bottom: 0.6em;
  font: 600 0.72em / 1.2 var(--ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ui-mute);
}

/* small buttons inside pictures */
.b {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.45em 0.8em;
  border-radius: 0.5em;
  font-size: 0.85em;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--ui-line);
  background: #fff;
}

.b-ink {
  background: #18181b;
  color: #fff;
  box-shadow: none;
}

.b-ghost {
  box-shadow: none;
  color: var(--ui-mute);
}

/* ---------- the author's site, as a picture ----------
   .cv is the canvas (a size container), .dev the device: its em is a part of the canvas width (--vw ems fill it)
   and its width is --fw ems. The site's own sizes are in those ems, after the product's Tailwind classes. */

.cv {
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.dev {
  --vw: 72;
  font-size: calc(100cqw / var(--vw));
  width: calc(var(--fw, var(--vw)) * 1em);
  margin-inline: auto;
  transition: font-size 0.6s var(--ease), width 0.6s var(--ease), margin 0.6s var(--ease), border-radius 0.6s;
}

.site {
  --s-bg: #fbfaf8;
  --s-surface: #f3f1ec;
  --s-fg: #1c1917;
  --s-muted: #57534e;
  --s-border: #e7e3dc;
  --s-accent: #1c1917;
  --s-accent-fg: #fbfaf8;
  --s-inv-bg: #1c1917;
  --s-inv-fg: #f5f3ef;
  --s-inv-muted: #a8a29e;
  --s-r: 1.75em;
  --s-rs: 0.75em;
  --s-rb: 999px;
  --s-sans: var(--ui);
  --s-display: var(--ui);
  position: relative;
  min-height: 100%;
  background: var(--s-bg);
  color: var(--s-fg);
  font: 400 1em / 1.5 var(--s-sans);
  text-align: left;
  transition: background 0.5s, color 0.5s;
}

.s-blk {
  position: relative;
}

.s-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75em 2em;
  min-height: 4.5em;
  padding: 1em 3em;
  border-bottom: 1px solid var(--s-border);
}

.s-logo {
  font-size: 1.125em;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.s-nav {
  display: flex;
  flex: 1;
  gap: 0.25em;
  min-width: 0;
}

.s-nav i {
  padding: 0.4em 0.8em;
  border-radius: 999px;
  font-size: 0.94em;
  font-style: normal;
  color: var(--s-muted);
  white-space: nowrap;
}

.s-nav i.on {
  background: var(--s-surface);
  color: var(--s-fg);
}

.s-btnw {
  position: relative;
  display: inline-flex;
}

.s-btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.9em;
  padding: 0 1.5em;
  border-radius: var(--s-rb);
  background: var(--s-accent);
  color: var(--s-accent-fg);
  font-size: 1em;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.5s, color 0.5s, border-radius 0.5s;
}

.s-btn-s {
  min-height: 2.5em;
  padding: 0 1.25em;
  font-size: 0.875em;
}

.s-btn-inv {
  background: var(--s-inv-fg);
  color: var(--s-inv-bg);
}

.s-btn-sk {
  width: 8em;
}

.s-hero {
  position: relative;
  overflow: hidden;
  padding: 4.5em 3em 4.5em;
  /* the product's soft light in the corner, drawn on the block itself (a separate layer showed its box while the
     block was arriving) */
  background: radial-gradient(circle at 96% 0%, var(--s-surface), transparent 40%);
}

.s-hero > * {
  position: relative;
}

.s-h1 {
  max-width: 13em;
  font: 600 3.6em / 1.02 var(--s-display);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.s-sub {
  max-width: 34em;
  margin-top: 1.1em;
  font-size: 1.15em;
  line-height: 1.6;
  color: var(--s-muted);
}

.s-act {
  margin-top: 2.2em;
}

.s-feat {
  padding: 3.5em 3em;
}

.s-h2 {
  max-width: 20em;
  font: 600 2.2em / 1.15 var(--s-display);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.s-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1em;
  margin-top: 2.6em;
}

.s-card {
  display: flex;
  flex-direction: column;
  padding: 1.6em;
  border-radius: var(--s-rs);
  background: var(--s-surface);
  transition: background 0.5s, border-radius 0.5s;
}

.s-num {
  display: grid;
  place-items: center;
  width: 2.25em;
  height: 2.25em;
  border-radius: 50%;
  background: var(--s-bg);
  box-shadow: inset 0 0 0 1px var(--s-border);
  font: 0.75em / 1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--s-muted);
}

.s-ct {
  margin-top: 2.4em;
  font-size: 1.25em;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.s-cx {
  margin-top: 0.6em;
  color: var(--s-muted);
}

.s-cta {
  padding: 2.5em 2em;
}

.s-cta-in {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2em;
  padding: 3.5em;
  border-radius: var(--s-r);
  background: var(--s-inv-bg);
  color: var(--s-inv-fg);
  transition: background 0.5s, border-radius 0.5s;
}

.s-ctx {
  margin-top: 0.8em;
  font-size: 1.15em;
  color: var(--s-inv-muted);
}

.s-text {
  padding: 4em 3em 2em;
}

.s-text .s-h2 {
  margin-bottom: 1em;
}

.s-foot {
  margin-top: 1.5em;
  padding: 2.5em 3em;
  border-top: 1px solid var(--s-border);
  font-size: 0.875em;
  color: var(--s-muted);
}

/* the shape of text that is not written yet */
.sk {
  display: block;
  height: 0.8em;
  margin-top: 0.75em;
  border-radius: 0.4em;
  background: color-mix(in oklab, var(--s-fg) 12%, transparent);
}

.sk-inv {
  background: color-mix(in oklab, var(--s-inv-fg) 22%, transparent);
}

.sk.w9 {
  width: 90%;
}

.sk.w8 {
  width: 78%;
}

.sk.w7 {
  width: 64%;
}

.sk.w6 {
  width: 56%;
}

.sk.w5 {
  width: 42%;
}

/* ---------- the poster's editor: the canvas at three widths ---------- */

.ed-cover .ed-body {
  padding: 18px 18px 0;
}

.ed-cover .cv {
  aspect-ratio: 72 / 40;
  border-radius: 8px 8px 0 0;
  background: var(--ui-fill);
}

.ed-cover .dev {
  overflow: hidden;
}

#dv-tablet:checked ~ .stage .dev {
  --vw: 60;
  --fw: 48;
  margin-top: 1.2em;
  border-radius: 1.4em 1.4em 0 0;
  box-shadow: 0 0 0 0.5em #fff, 0 0 0 calc(0.5em + 1px) var(--ui-line), 0 2em 3em -1.6em rgb(20 22 26 / 0.35);
}

#dv-mobile:checked ~ .stage .dev {
  --vw: 46;
  --fw: 25;
  margin-top: 1.2em;
  border-radius: 2em 2em 0 0;
  box-shadow: 0 0 0 0.55em #fff, 0 0 0 calc(0.55em + 1px) var(--ui-line), 0 2em 3em -1.6em rgb(20 22 26 / 0.35);
}

/* a phone: the menu goes under the name, the blocks stand in one column (the product's @3xl breakpoint) */
#dv-mobile:checked ~ .stage .s-head {
  padding: 1em 1.5em;
}

#dv-mobile:checked ~ .stage .s-nav {
  order: 3;
  flex: 0 0 100%;
  margin-inline: -0.5em;
}

#dv-mobile:checked ~ .stage .s-head .s-btnw {
  margin-left: auto;
}

#dv-mobile:checked ~ .stage .s-hero {
  padding: 3.5em 1.5em;
}

#dv-mobile:checked ~ .stage .s-h1 {
  font-size: 2.6em;
}

#dv-mobile:checked ~ .stage .s-sub {
  font-size: 1.05em;
}

#dv-mobile:checked ~ .stage .s-feat {
  padding: 3em 1.5em;
}

#dv-mobile:checked ~ .stage .s-h2 {
  font-size: 1.8em;
}

#dv-mobile:checked ~ .stage .s-cards {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75em;
}

#dv-mobile:checked ~ .stage .s-ct {
  margin-top: 1.4em;
}

#dv-mobile:checked ~ .stage .s-cta {
  padding: 2em 1em;
}

#dv-mobile:checked ~ .stage .s-cta-in {
  flex-direction: column;
  align-items: flex-start;
  padding: 2.2em 1.8em;
}

/* the site assembles on load: the blocks come in from the library one after another and the outline follows.
   CSS alone, because the poster is in view at once; `both` keeps each block out until its turn. */
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateX(-3em) scale(0.97);
  }
}

@keyframes lit {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px var(--line-2);
  }
  40% {
    box-shadow: inset 0 0 0 2px var(--ink);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cover .site > .s-blk {
    animation: arrive 0.75s var(--ease) calc(0.5s + var(--k) * 0.32s) both;
  }
  .cover .outline li {
    animation: arrive 0.6s var(--ease) calc(0.55s + var(--k) * 0.32s) both;
  }
  .cover .lib li.is-used {
    animation: lit 0.9s ease calc(0.6s + var(--k, 1) * 0.32s);
  }
}

.lib li.is-used:nth-child(1) {
  --k: 1;
}

.lib li.is-used:nth-child(3) {
  --k: 2;
}

.lib li.is-used:nth-child(5) {
  --k: 3;
}

/* ---------- chapters: a pinned figure, one sentence at a time ---------- */

/* stacked (phones, tablets, short windows, reduced motion): text, then the figure in its final state */
.chap {
  padding: clamp(40px, 6vw, 80px) 0;
}

.chap-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

.chap-text h2 {
  max-width: 16em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
  gap: 16px 28px;
  margin-top: 28px;
}

.step {
  position: relative;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--line);
  font-size: 1.125rem;
  line-height: 1.45;
}

.step p {
  max-width: 24em;
}

.step .host {
  overflow-wrap: anywhere;
}

.note {
  max-width: 34em;
  margin-top: 22px;
  padding-left: 22px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.chap-fig {
  min-width: 0;
}

.frame {
  container-type: inline-size;
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 44px);
  border-radius: 28px;
  background-color: var(--plate);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.4px);
  background-size: 20px 20px;
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

/* a figure: 64 × 44 of its ems, the em a part of the frame. --fe carries the figure's em, as a length, into the
   site picture, so the editor's controls drawn over the site keep the editor's size, not the site's. */
@property --fe {
  syntax: "<length>";
  inherits: true;
  initial-value: 13px;
}

.fig {
  --fe: 1em;
  position: relative;
  width: 64em;
  height: 44em;
  font-size: clamp(10px, 1.5cqw, 15px);
}

/* two columns: the text beside the figure */
@media (min-width: 1280px) {
  .chap-grid {
    grid-template-columns: minmax(0, clamp(290px, 23vw, 350px)) minmax(0, 1fr);
    gap: clamp(28px, 3vw, 56px);
    align-items: center;
  }
  .chap-text h2 {
    max-width: none;
    font-size: clamp(1.75rem, 2.2vw, 2.2rem);
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .step {
    font-size: 1.0625rem;
  }
}

/* the figure bleeds off the right edge: the canvas goes on beyond the window */
@media (min-width: 1360px) {
  .chap-fig {
    margin-right: calc(-1 * max(var(--gutter), (100vw - var(--page)) / 2));
  }
  .frame {
    border-radius: 28px 0 0 28px;
    justify-items: start;
  }
}

/* pinned: the text and the figure stay, the step follows the scroll (page.js sets html.pinned and the chapter's
   data-step; with reduced motion, no script or a short window nothing is pinned) */
.pinned .chap {
  --pin-h: min(860px, 100svh - var(--hdr) - 48px);
  --run: 46svh;
  height: calc(var(--pin-h) + var(--n) * var(--run));
  margin-bottom: 18svh; /* the previous figure is gone before the next one pins */
  padding: 0;
}

.pinned .chap-pin {
  position: sticky;
  top: max(calc(var(--hdr) + 20px), calc((100svh - var(--pin-h)) / 2));
  display: flex;
  align-items: center;
  height: var(--pin-h);
}

.pinned .chap-grid,
.pinned .chap-fig,
.pinned .frame {
  height: 100%;
}

/* pinned, the figure fits the height of the frame too */
.pinned .frame {
  container-type: size;
}

.pinned .fig {
  font-size: clamp(9px, min(1.5cqw, 2.18cqh), 15px);
}

/* the rail: which sentence of three, and how far the scroll is through the chapter */
.rail {
  display: none;
}

.pinned .rail {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.rail-n {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font: 500 clamp(3.2rem, 5vw, 4.8rem) / 0.8 var(--sans);
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}

.rail-n small {
  font: 500 1rem / 1 var(--mono);
  letter-spacing: 0;
  color: var(--ink-3);
  -webkit-text-stroke: 0;
}

.rail-cur::before {
  content: "01";
}

.chap[data-step="2"] .rail-cur::before {
  content: "02";
}

.chap[data-step="3"] .rail-cur::before {
  content: "03";
}

.pinned .chap[data-step] .rail-cur {
  display: inline-block;
  animation: tick 0.55s var(--ease);
}

.rail-t {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.rail-t i {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}

@keyframes tick {
  from {
    opacity: 0;
    transform: translateY(0.45em) scale(0.8);
  }
}

/* the current sentence steps forward and gets a bar; the others sink back to the third ink, which still reads
   at 5:1 on the paper (a fade would not) */
.pinned .step {
  color: var(--ink-3);
  transition: color 0.45s, transform 0.55s var(--ease);
}

.pinned .step::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: 0 0;
  transition: transform 0.6s var(--ease);
}

.pinned .chap[data-step="1"] .step[data-s="1"],
.pinned .chap[data-step="2"] .step[data-s="2"],
.pinned .chap[data-step="3"] .step[data-s="3"] {
  color: var(--ink);
  transform: translateX(10px);
}

/* a short window: the column of text keeps within the pinned height */
@media (max-height: 820px) {
  .pinned .rail-n {
    font-size: 3rem;
  }
  .pinned .rail {
    margin-bottom: 14px;
  }
  .pinned .tag {
    margin-bottom: 12px;
  }
  .pinned .steps {
    margin-top: 20px;
  }
  .pinned .step {
    font-size: 0.975rem;
    line-height: 1.4;
  }
  .pinned .note {
    margin-top: 16px;
    font-size: 0.875rem;
  }
}

.pinned .chap[data-step="1"] .step[data-s="1"]::before,
.pinned .chap[data-step="2"] .step[data-s="2"]::before,
.pinned .chap[data-step="3"] .step[data-s="3"]::before {
  transform: scaleY(1);
}

/* the canvas drifts under the figure, which leans a little with the scroll */
.pinned .frame {
  background-position: calc(var(--p, 0) * -160px) calc(var(--p, 0) * -110px);
}

.pinned .frame > .fig {
  transform: perspective(1800px) rotateY(calc((var(--p, 0.5) - 0.5) * -5deg)) rotateX(calc((var(--p, 0.5) - 0.5) * 2.5deg));
}

/* ---------- overlays: data-on lists the steps an element shows on, "f" the final state ---------- */

html:not(.pinned) .ov:not([data-on~="f"]) {
  display: none;
}

.pinned .ov {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s 0.3s, transform 0.5s var(--ease);
}

.pinned .chap[data-step="1"] [data-on~="1"],
.pinned .chap[data-step="2"] [data-on~="2"],
.pinned .chap[data-step="3"] [data-on~="3"] {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s 0.1s, visibility 0s, transform 0.6s var(--ease) 0.1s;
}

/* ----- chapter: the canvas ----- */

.ed-canvas {
  display: grid;
  grid-template-columns: 12.5em minmax(0, 1fr);
  border-radius: 1em;
}

.ed-lib {
  padding: 1.3em 1em;
  border-right: 1px solid var(--ui-line);
}

.chip {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 0.35em;
  padding: 0.55em 0.65em;
  border-radius: 0.55em;
  font-size: 0.9em;
  box-shadow: inset 0 0 0 1px var(--ui-line);
}

.chip .ic {
  width: 1.3em;
  height: 1.3em;
  color: var(--ui-mute);
}

.chip.is-src {
  background: var(--ui-fill);
  color: var(--ui-mute);
  box-shadow: inset 0 0 0 1px var(--ui-line), inset 0 0 0 999px rgb(255 255 255 / 0.4);
}

.ed-canvas .ed-body {
  padding: 1.2em;
}

.ed-canvas .cv,
.th-view .cv,
.ag-cv .cv,
.hi-cv .cv,
.pb-page .cv {
  height: 100%;
  border-radius: 0.6em;
  box-shadow: 0 0 0 1px var(--ui-line);
}

.ed-canvas .dev,
.th .dev,
.ag .dev,
.hi .dev,
.pb .dev {
  --vw: 76;
  height: 100%;
}

/* the block being edited: its ring and its toolbar, the caret in the heading */
.ed-canvas .s-hero {
  overflow: visible;
}

.ed-canvas .s-hero::before {
  display: none;
}

.is-sel-hero .s-hero::after {
  content: "";
  position: absolute;
  inset: 0.5em;
  border-radius: 0.5em;
  box-shadow: 0 0 0 0.16em #3b82f6;
  pointer-events: none;
}

.pinned .chap-canvas:not([data-step="1"]) .is-sel-hero .s-hero::after {
  opacity: 0;
}

.tb {
  position: absolute;
  top: 0.9em;
  left: 1.4em;
  z-index: 3;
  font-size: var(--fe);
  display: flex;
  gap: 0.2em;
  padding: 0.3em;
  border-radius: 0.7em;
  background: #fff;
  box-shadow: 0 0.6em 1.4em -0.6em rgb(0 0 0 / 0.35), 0 0 0 1px var(--ui-line);
  font-family: var(--ui);
  color: #3f3f46;
}

.tb i {
  display: grid;
  place-items: center;
  width: 2.4em;
  height: 2.4em;
  border-radius: 0.5em;
}

.tb .ic {
  width: 1.5em;
  height: 1.5em;
}

.edit {
  position: relative;
}

.caret {
  display: inline-block;
  width: 0.06em;
  height: 0.95em;
  margin-left: 0.04em;
  vertical-align: -0.1em;
  background: #3b82f6;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.pop {
  position: absolute;
  top: calc(100% + 0.8em);
  left: 0;
  z-index: 3;
  display: grid;
  gap: 0.35em;
  width: 21em;
  padding: 1.2em;
  border-radius: 0.8em;
  background: #fff;
  box-shadow: 0 1.2em 2.6em -1em rgb(0 0 0 / 0.4), 0 0 0 1px var(--ui-line);
  font: 400 var(--fe) / 1.35 var(--ui);
  color: #18181b;
}

.pop b {
  margin-bottom: 0.4em;
  font-size: 1.1em;
}

.pop-l {
  margin-top: 0.4em;
  font-size: 0.85em;
  color: var(--ui-mute);
}

.pop-sel,
.pop-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55em 0.75em;
  border-radius: 0.5em;
  box-shadow: inset 0 0 0 1px var(--ui-line);
}

.pop-sel {
  box-shadow: inset 0 0 0 2px #3b82f6;
}

.pop-in {
  color: #a1a1aa;
}

.pop .ic {
  width: 1.1em;
  height: 1.1em;
}

.dot {
  position: absolute;
  top: -0.35em;
  right: -0.35em;
  z-index: 3;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 0.22em #fff;
}

.issue {
  position: absolute;
  top: calc(100% + 0.9em);
  right: 0;
  z-index: 3;
  width: 19em;
  padding: 0.9em 1em;
  border-radius: 0.7em;
  background: #fff;
  box-shadow: 0 1em 2em -0.9em rgb(0 0 0 / 0.4), 0 0 0 1px var(--ui-line), inset 0.25em 0 0 var(--warn);
  font: 400 var(--fe) / 1.4 var(--ui);
  color: #3f3f46;
  white-space: normal;
}

.drop {
  position: relative;
  z-index: 2;
  height: 0;
  margin-inline: 3em;
  border-top: 0.25em solid #3b82f6;
  border-radius: 0.2em;
}

.drop span {
  position: absolute;
  top: -1.1em;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35em 0.9em;
  border-radius: 999px;
  background: #3b82f6;
  color: #fff;
  font: 600 var(--fe) / 1.2 var(--ui);
  white-space: nowrap;
}

.ghost {
  position: absolute;
  top: 48%;
  left: 28%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7em 1em;
  border-radius: 0.7em;
  background: #fff;
  box-shadow: 0 1.4em 2.8em -1em rgb(0 0 0 / 0.45), 0 0 0 1px var(--ui-line);
  font-size: 1em;
  font-weight: 600;
  transform: rotate(-3deg);
}

.ghost .ic {
  width: 1.3em;
  height: 1.3em;
  color: var(--ui-mute);
}

.pinned .chap-canvas .ghost {
  transform: translate(-6em, -4em) rotate(0);
}

.pinned .chap-canvas[data-step="2"] .ghost {
  transform: rotate(-3deg);
}

/* ----- chapter: themes ----- */

.th {
  display: grid;
  grid-template-columns: 19em minmax(0, 1fr);
  gap: 1.6em;
  align-items: stretch;
}

.th-r {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.th-pick {
  display: grid;
  align-content: center;
  gap: 0.35em;
}

.th-o {
  display: flex;
  align-items: flex-start;
  gap: 0.9em;
  padding: 0.85em 0.9em;
  border-radius: 0.9em;
  cursor: pointer;
  transition: background 0.25s, box-shadow 0.25s;
}

.th-o:hover {
  background: rgb(255 255 255 / 0.7);
}

/* a swatch: the theme's background with its accent and its corner */
.sw {
  position: relative;
  flex: none;
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  background: var(--s-bg);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
  overflow: hidden;
}

.sw i {
  position: absolute;
  right: -0.35em;
  bottom: -0.35em;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: var(--s-accent);
}

.th-t {
  display: grid;
  gap: 0.2em;
}

.th-t b {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 1.05em;
}

.th-t b::after {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: #3b82f6;
  opacity: 0;
  transition: opacity 0.25s;
}

.th-t small {
  font-size: 0.85em;
  line-height: 1.35;
  color: var(--ui-mute);
}

.th-view {
  position: relative;
  min-width: 0;
  padding: 1em;
  border-radius: 1em;
  background: #fff;
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.th .dev {
  --vw: 70;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 1.8em;
  z-index: 3;
  transform: translateX(-50%);
  white-space: nowrap;
}

.toast span {
  display: none;
  align-items: center;
  gap: 0.6em;
  padding: 0.8em 1.1em;
  border-radius: 0.8em;
  background: #fff;
  box-shadow: 0 1em 2.4em -0.9em rgb(0 0 0 / 0.45), 0 0 0 1px var(--ui-line);
  font-size: 1.05em;
  font-weight: 600;
}

.toast .ic {
  width: 1.2em;
  height: 1.2em;
  color: var(--ok);
}

/* ----- chapter: the agent ----- */

.ag {
  display: grid;
  grid-template-columns: 10.5em minmax(0, 1fr) 21em;
  overflow: hidden;
  border-radius: 1em;
  background: #fff;
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.ag-pages {
  padding: 1.3em 0.9em;
  border-right: 1px solid var(--ui-line);
}

.ag-pages li {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 0.6em;
  border-radius: 0.5em;
  font-size: 0.92em;
}

.ag-pages .ic {
  width: 1.2em;
  height: 1.2em;
  color: var(--ui-mute);
}

.ag-new {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.ag-cv {
  position: relative;
  min-width: 0;
  background: var(--ui-fill);
}

.v-old,
.v-new {
  position: absolute;
  inset: 1em;
}

.s-nav i.s-new {
  box-shadow: inset 0 0 0 0.12em #3b82f6;
}

.ag-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--ui-line);
}

.ag-h {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 1.1em 1.2em;
  border-bottom: 1px solid var(--ui-line);
  font-size: 0.95em;
}

.ag-h .ic,
.ag-who .ic {
  width: 1.2em;
  height: 1.2em;
  color: #6d28d9;
}

.ag-chat {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1em;
  min-height: 0;
  padding: 1.2em;
  overflow: hidden;
}

.bubble {
  align-self: flex-end;
  max-width: 88%;
  padding: 0.75em 0.95em;
  border-radius: 1.1em 1.1em 0.3em 1.1em;
  background: var(--ui-fill);
  font-size: 0.95em;
  line-height: 1.4;
}

/* pinned, the first sentence is about the request: it carries a ring until the steps play */
.pinned .chap-agent[data-step="1"] .bubble {
  box-shadow: 0 0 0 0.15em #3b82f6;
}

.bubble {
  transition: box-shadow 0.4s;
}

.ag-who {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin-bottom: 0.5em;
  font-size: 0.78em;
  color: var(--ui-mute);
}

.ops {
  display: grid;
  gap: 0.4em;
  padding: 0.7em;
  border-radius: 0.7em;
  background: #fafafa;
  box-shadow: inset 0 0 0 1px var(--ui-line);
  font-size: 0.8em;
  line-height: 1.35;
  color: #3f3f46;
  transition: opacity 0.3s;
}

.ops li {
  display: flex;
  gap: 0.5em;
}

.ops .ok {
  width: 1.15em;
  height: 1.15em;
  margin-top: 0.05em;
  color: var(--ok);
}

.pinned .chap-agent[data-step="2"] .ops li {
  animation: arrive 0.5s var(--ease) calc(0.25s + var(--i) * 0.55s) both;
}

.ag-done {
  margin-top: 0.6em;
  font-size: 0.9em;
}

.ag-undo {
  margin-top: 0.7em;
}

.undo-w {
  position: relative;
  display: inline-block;
}

.undo {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.5em 0.85em;
  border: 0;
  border-radius: 0.55em;
  background: #fff;
  box-shadow: inset 0 0 0 1px #d4d4d8;
  font: 600 0.85em / 1.2 var(--ui);
  cursor: pointer;
}

.undo:hover {
  background: var(--ui-fill);
}

.undo .ic {
  width: 1.2em;
  height: 1.2em;
}

.ink-ring {
  position: absolute;
  left: -14%;
  top: -34%;
  width: 128%;
  height: 168%;
}

/* the ring is drawn when the Undo shows: pinned, on the third sentence; stacked, when the figure arrives */
@keyframes draw-again {
  from {
    clip-path: inset(-80% 100% -80% 0);
  }
  to {
    clip-path: inset(-80% -2% -80% 0);
  }
}

.armed .ink-ring {
  clip-path: inset(-80% 100% -80% 0);
}

.armed .in .ink-ring {
  animation: draw 0.9s var(--ease) 0.6s forwards;
}

.armed.pinned .chap-agent[data-step="3"] .ink-ring {
  animation: draw-again 0.9s var(--ease) 0.7s forwards;
}

.ag-undone {
  display: none;
  margin-top: 0.6em;
  font-size: 0.8em;
  color: var(--ui-mute);
}

.ag-undone span {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

.ag-undone .ic {
  width: 1.1em;
  height: 1.1em;
}

.ag-in {
  margin: 0 1em 1em;
  padding: 0.85em 1em;
  border-radius: 0.8em;
  box-shadow: inset 0 0 0 1px var(--ui-line);
  font-size: 0.88em;
  color: #a1a1aa;
}

/* one Undo takes the whole turn away: the page it made, its blocks and its place in the list */
.ag.undone .ag-new,
.ag.undone .v-new {
  display: none !important;
}

.ag.undone .v-old {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.ag.undone .ops {
  opacity: 0.45;
  text-decoration: line-through;
}

.ag.undone .ag-undone {
  display: block;
}

/* ----- chapter: history ----- */

.hi {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21em;
  overflow: hidden;
  border-radius: 1em;
  background: #fff;
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.hi-cv {
  position: relative;
  min-width: 0;
  padding: 1em;
  background: var(--ui-fill);
}

.hi-cv .cv {
  height: 100%;
}

.hi .dev {
  --vw: 66;
}

.hi-banner {
  position: absolute;
  top: 1.8em;
  left: 50%;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em;
  width: calc(100% - 4em);
  padding: 0.9em 1em;
  border-radius: 0.8em;
  background: #fffbeb;
  box-shadow: 0 0.8em 2em -1em rgb(0 0 0 / 0.35), inset 0 0 0 1px #fde68a;
  transform: translateX(-50%);
  font-size: 0.92em;
}

.hi-banner p {
  flex: 1 1 100%;
  font-weight: 600;
}

.hi-dlg {
  position: absolute;
  left: 50%;
  bottom: 2em;
  z-index: 4;
  display: grid;
  gap: 0.6em;
  width: min(30em, calc(100% - 4em));
  padding: 1.3em;
  border-radius: 1em;
  background: #fff;
  box-shadow: 0 1.6em 3.6em -1.2em rgb(0 0 0 / 0.5), 0 0 0 1px var(--ui-line);
  transform: translateX(-50%);
}

.hi-dlg b {
  font-size: 1.1em;
}

.hi-dlg p {
  font-size: 0.9em;
  color: #52525b;
}

.hi-acts {
  display: flex;
  justify-content: flex-end;
  gap: 0.5em;
}

.hi-panel {
  min-width: 0;
  border-left: 1px solid var(--ui-line);
}

.hi-day {
  padding: 1em 1.2em 0.4em;
  font-size: 0.78em;
  font-weight: 600;
  color: var(--ui-mute);
}

.hi-panel ol {
  display: grid;
  gap: 0.15em;
  padding: 0 0.6em;
}

.hi-e {
  position: relative;
  display: grid;
  gap: 0.25em;
  padding: 0.7em 0.7em 0.7em 1.4em;
  border-radius: 0.6em;
  font-size: 0.85em;
}

.hi-e::before {
  content: "";
  position: absolute;
  left: 0.55em;
  top: 1.05em;
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: #a1a1aa;
}

.hi-e b {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 500;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hi-m {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.88em;
  color: var(--ui-mute);
}

.hi-m .ic {
  width: 1.1em;
  height: 1.1em;
  color: #6d28d9;
}

.hi-e em {
  position: absolute;
  top: 0.7em;
  right: 0.7em;
  padding: 0.1em 0.5em;
  border-radius: 999px;
  background: #dcfce7;
  color: var(--ok);
  font-size: 0.8em;
  font-style: normal;
  font-weight: 600;
}

.hi-e.is-now b {
  padding-right: 5em;
}

.hi-e.is-sel {
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.hi-e.is-sel::before {
  background: #3b82f6;
}

.pinned .chap-history[data-step="1"] .hi-e.is-sel {
  background: none;
  box-shadow: none;
}

.pinned .chap-history[data-step="1"] .hi-e.is-sel::before {
  background: #a1a1aa;
}

/* ----- chapter: publishing ----- */

.pb {
  display: grid;
  grid-template-columns: 25em minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.6em 1.6em;
  align-items: center;
}

.pb-dlg {
  display: grid;
  gap: 0.7em;
  padding: 1.6em;
  border-radius: 1em;
  background: #fff;
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.pb-t {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 1.15em;
}

.pb-t .ic {
  width: 1.2em;
  height: 1.2em;
}

.pb-lead {
  font-size: 0.9em;
  color: #52525b;
}

.pb-l {
  display: grid;
  gap: 0.15em;
  margin-top: 0.4em;
  font-size: 0.9em;
}

.pb-l small {
  font-size: 0.85em;
  color: var(--ui-mute);
}

.pb-in {
  padding: 0.65em 0.85em;
  border-radius: 0.55em;
  box-shadow: inset 0 0 0 2px #3b82f6;
  font-size: 0.95em;
}

.pb-help {
  font-size: 0.85em;
  color: var(--ui-mute);
}

.pb-help code,
.pb-bar code {
  font-family: var(--ui);
  font-size: 1em;
}

.pb-st {
  padding: 0.7em 0.85em;
  border-radius: 0.6em;
  background: #fffbeb;
  box-shadow: inset 0 0 0 1px #fde68a;
  font-size: 0.85em;
}

.pb-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5em;
  margin-top: 0.3em;
}

.pb-web {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 1em;
  background: #fff;
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.pb-bar {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 0.8em 1em;
  border-bottom: 1px solid var(--ui-line);
}

.pb-bar code {
  display: inline-flex;
  flex: 1;
  align-items: center;
  gap: 0.45em;
  min-width: 0;
  padding: 0.45em 0.9em;
  border-radius: 999px;
  background: var(--ui-fill);
  font-size: 0.9em;
  white-space: nowrap;
}

.pb-bar .ic {
  width: 1em;
  height: 1em;
  color: var(--ui-mute);
}

.pb-page {
  position: relative;
  flex: 1;
  min-height: 0;
}

.pb-empty,
.pb-site {
  position: absolute;
  inset: 0;
}

.pb-empty {
  --s-fg: #18181b;
  display: grid;
  align-content: center;
  justify-items: center;
}

.pb-empty .sk {
  margin-inline: auto;
}

.pb-page .cv {
  border-radius: 0;
  box-shadow: none;
}

.pb .dev {
  --vw: 68;
}

.pb-toast {
  position: absolute;
  right: 1.2em;
  bottom: 1.2em;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.75em 1em;
  border-radius: 0.8em;
  background: #fff;
  box-shadow: 0 1em 2.4em -0.9em rgb(0 0 0 / 0.45), 0 0 0 1px var(--ui-line);
  font-weight: 600;
}

.pb-toast .ic {
  width: 1.2em;
  height: 1.2em;
  color: var(--ok);
}

.pb-cap {
  grid-column: 2;
  font: 500 0.8em / 1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
}

/* pinned, the two buttons that take turns share one place */
.pinned .pb-acts .ov {
  position: absolute;
}

.pinned .chap-publish[data-step="1"] .pb-acts [data-on~="1"],
.pinned .chap-publish[data-step="2"] .pb-acts [data-on~="2"],
.pinned .chap-publish[data-step="3"] .pb-acts [data-on~="3"] {
  position: static;
}

/* ---------- what else ---------- */

.more {
  padding: clamp(48px, 7vw, 112px) 0;
  border-top: 1px solid var(--line);
}

.more h2 {
  max-width: 18em;
}

.more-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(28px, 3.4vw, 48px);
}

.more-i {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: 22px;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--line), 0 18px 36px -28px rgb(20 22 26 / 0.45);
}

.more-n {
  font: 500 0.8125rem / 1 var(--mono);
  color: var(--ink-3);
}

.more-i p {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}

.chips li {
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  font: 500 0.8125rem / 1.2 var(--ui);
  color: var(--ink-2);
}

/* ---------- finale: the demo ---------- */

.finale {
  padding: clamp(56px, 8vw, 128px) 0;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}

.fin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

.fin h2 {
  font-size: clamp(1.9rem, 3.6vw, 3.4rem);
}

.fin-p {
  max-width: 30em;
  margin: 20px 0 28px;
  font-size: 1.125rem;
  color: var(--ink-2);
}

.fin-note {
  margin-top: 18px;
  font-size: 0.9375rem;
  color: var(--ink-3);
}

/* the trial account's limits: three quiet figures under the sign-in */
.trial {
  max-width: 30em;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.trial-h {
  font: 500 0.8125rem / 1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.trial-l {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.trial-l li {
  display: grid;
  align-content: start;
  gap: 4px;
}

.trial-l b {
  font: 500 1.75rem / 1 var(--sans);
  letter-spacing: -0.03em;
}

.trial-l span {
  font-size: 0.9375rem;
  line-height: 1.3;
  color: var(--ink-2);
}

/* five themes of the same site, fanned like cards */
.fan {
  position: relative;
  height: clamp(300px, 30vw, 420px);
}

.fan-c {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72%;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 30px 60px -36px rgb(20 22 26 / 0.55), 0 0 0 1px var(--line);
  transform: translate(-50%, -50%) translate(calc((var(--i) - 2) * 9%), calc((var(--i) - 2) * 7%)) rotate(calc((var(--i) - 2) * 4deg));
  transition: transform 0.8s var(--ease);
}

.fan-c .cv {
  aspect-ratio: 16 / 10;
  border-radius: 0;
}

.fan-c .dev {
  --vw: 64;
}

.armed .finale:not(.in) .fan-c {
  transform: translate(-50%, -50%) rotate(0);
}

/* ---------- footer: the author's signature ---------- */

.foot {
  padding: 4px 0;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
}

.copy {
  font-size: 0.875rem;
  color: var(--ink-2);
}

.sig {
  position: relative;
  --as-ink: #2c3037;
  display: inline-block;
  padding: 16px 6px 8px 0;
}

.sig svg {
  display: block;
  width: 10.8rem;
  height: auto;
}

/* Separate hit areas keep the original SVG intact, including its writing animation. */
.sig-link {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 6px;
}

.sig-link-studio {
  left: 0;
  width: 71%;
}

.sig-link-id0 {
  left: 74%;
  right: 0;
}

.sig-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* the script takes the mark over and writes it: keep the finished one from showing for a moment before */
.sig[data-as-armed]:not([data-as-ready]) > svg {
  visibility: hidden;
}

/* ---------- responsive ---------- */

@media (max-width: 1279px) {
  .chap-text {
    max-width: 52em;
  }
}

@media (max-width: 1099px) {
  .poster {
    grid-template-columns: minmax(0, 1fr);
  }
  .flank {
    display: none;
  }
  .more-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .fin {
    grid-template-columns: minmax(0, 1fr);
  }
  .fan {
    height: clamp(240px, 56vw, 360px);
  }
}

/* phones and narrow tablets: the figures keep their main part, full width, and stack the rest */
@media (max-width: 759px) {
  .top-nav {
    gap: 12px;
  }
  .frame {
    padding: 14px;
    border-radius: 20px;
  }
  .fig {
    width: 100%;
    height: auto;
    font-size: 13px;
  }
  .ed-canvas {
    grid-template-columns: minmax(0, 1fr);
  }
  .ed-lib,
  .ag-pages {
    display: none;
  }
  .ed-canvas .ed-body {
    height: 30em;
    padding: 0.6em;
  }
  .ed-canvas .dev,
  .th .dev,
  .ag .dev,
  .hi .dev,
  .pb .dev {
    --vw: 30;
  }
  /* at this size the site is the phone layout */
  .fig .s-head {
    padding: 1em 1.5em;
  }
  .fig .s-nav {
    order: 3;
    flex: 0 0 100%;
    margin-inline: -0.5em;
  }
  .fig .s-head .s-btnw {
    margin-left: auto;
  }
  .fig .s-hero {
    padding: 3em 1.5em;
  }
  .fig .s-h1 {
    font-size: 2.4em;
  }
  .fig .s-feat,
  .fig .s-text {
    padding: 2.5em 1.5em;
  }
  .fig .s-h2 {
    font-size: 1.7em;
  }
  .fig .s-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .fig .s-cta-in {
    flex-direction: column;
    align-items: flex-start;
    padding: 2em 1.6em;
  }
  .pop {
    width: 17em;
  }
  /* no room for the note beside the block toolbar: the orange mark on the button stays, the sentence explains it */
  .issue {
    display: none;
  }
  .fan-c {
    width: 62%;
  }
  .th {
    grid-template-columns: minmax(0, 1fr);
  }
  .th-pick {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.3em;
  }
  .th-pick .ed-cap {
    grid-column: 1 / -1;
  }
  .th-o {
    flex-direction: column;
    align-items: center;
    gap: 0.4em;
    padding: 0.6em 0.2em;
    text-align: center;
  }
  .th-t small {
    display: none;
  }
  .th-t b {
    font-size: 0.95em;
  }
  .th-t b::after {
    display: none;
  }
  .th-view {
    height: 30em;
    padding: 0.6em;
  }
  .ag,
  .hi {
    grid-template-columns: minmax(0, 1fr);
  }
  .ag-cv {
    order: 2;
    display: none;
  }
  .ag-panel {
    border-left: 0;
    border-bottom: 1px solid var(--ui-line);
  }
  /* on a phone the agent figure is its chat: the request, the steps, the result, the Undo */
  .ag-chat {
    justify-content: flex-start;
  }
  .ops {
    font-size: 0.92em;
  }
  .hi-e {
    font-size: 0.95em;
  }
  .hi-cv {
    height: 27em;
  }
  .hi-panel {
    border-left: 0;
    border-top: 1px solid var(--ui-line);
  }
  .hi-panel ol {
    padding-bottom: 0.6em;
  }
  .pb {
    grid-template-columns: minmax(0, 1fr);
  }
  .pb-web {
    height: 21em;
  }
  .pb-cap {
    grid-column: 1;
  }
}

@media (max-width: 639px) {
  .bar {
    gap: 10px;
  }
  .logo span {
    font-size: 1rem;
  }
  .top .btn-s {
    padding: 0 14px;
  }
  .cover .btn-l {
    min-height: 52px;
    padding: 0 24px;
  }
  .dv-o {
    padding: 9px 12px;
  }
  .more-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .ed-saved {
    display: none;
  }
  .ed-cover .ed-body {
    padding: 10px 10px 0;
  }
  .ed-cover .cv {
    aspect-ratio: 4 / 5;
  }
  /* on a phone each width fills more of the canvas */
  #dv-tablet:checked ~ .stage .dev {
    --vw: 52;
  }
  #dv-mobile:checked ~ .stage .dev {
    --vw: 28;
  }
}

@media (max-width: 479px) {
  .top .link {
    display: none;
  }
  .langs a {
    min-width: 34px;
  }
  .dv-o .ic {
    display: none;
  }
}

/* ---------- reduced motion: final states at once ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .ink {
    clip-path: none !important;
  }
}

/* site themes, generated from src/site.mjs */
.t-sand,.th-r[value="sand"]:checked~.th-view .th-site{--s-bg:#fbfaf8;--s-surface:#f3f1ec;--s-fg:#1c1917;--s-muted:#57534e;--s-border:#e7e3dc;--s-accent:#1c1917;--s-accent-fg:#fbfaf8;--s-inv-bg:#1c1917;--s-inv-fg:#f5f3ef;--s-inv-muted:#a8a29e;--s-r:1.75em;--s-rs:0.75em;--s-rb:999px;--s-sans:system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--s-display:system-ui, -apple-system, "Segoe UI", Roboto, sans-serif}
.th-r[value="sand"]:checked~.th-pick [for="th-sand"]{background:#fff;box-shadow:0 0.5em 1.2em -0.7em rgb(20 22 26 / 0.45),inset 0 0 0 1px var(--line)}
.th-r[value="sand"]:checked~.th-pick [for="th-sand"] .th-t b::after{opacity:1}
.th-r[value="sand"]:focus-visible~.th-pick [for="th-sand"]{outline:2px solid var(--ink);outline-offset:2px}
.th-r[value="sand"]:checked~.th-view [data-t="sand"]{display:inline-flex}
.t-ink,.th-r[value="ink"]:checked~.th-view .th-site{--s-bg:#0c0a09;--s-surface:#1c1917;--s-fg:#fafaf9;--s-muted:#a8a29e;--s-border:#292524;--s-accent:#fafaf9;--s-accent-fg:#0c0a09;--s-inv-bg:#fafaf9;--s-inv-fg:#1c1917;--s-inv-muted:#57534e;--s-r:1.75em;--s-rs:0.75em;--s-rb:999px;--s-sans:system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--s-display:system-ui, -apple-system, "Segoe UI", Roboto, sans-serif}
.th-r[value="ink"]:checked~.th-pick [for="th-ink"]{background:#fff;box-shadow:0 0.5em 1.2em -0.7em rgb(20 22 26 / 0.45),inset 0 0 0 1px var(--line)}
.th-r[value="ink"]:checked~.th-pick [for="th-ink"] .th-t b::after{opacity:1}
.th-r[value="ink"]:focus-visible~.th-pick [for="th-ink"]{outline:2px solid var(--ink);outline-offset:2px}
.th-r[value="ink"]:checked~.th-view [data-t="ink"]{display:inline-flex}
.t-meadow,.th-r[value="meadow"]:checked~.th-view .th-site{--s-bg:#f7faf5;--s-surface:#e7f1e1;--s-fg:#12261a;--s-muted:#4a6353;--s-border:#d4e5cb;--s-accent:#2f6b3f;--s-accent-fg:#ffffff;--s-inv-bg:#12261a;--s-inv-fg:#eef6ea;--s-inv-muted:#9dbba8;--s-r:2.25em;--s-rs:1.25em;--s-rb:999px;--s-sans:ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--s-display:ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif}
.th-r[value="meadow"]:checked~.th-pick [for="th-meadow"]{background:#fff;box-shadow:0 0.5em 1.2em -0.7em rgb(20 22 26 / 0.45),inset 0 0 0 1px var(--line)}
.th-r[value="meadow"]:checked~.th-pick [for="th-meadow"] .th-t b::after{opacity:1}
.th-r[value="meadow"]:focus-visible~.th-pick [for="th-meadow"]{outline:2px solid var(--ink);outline-offset:2px}
.th-r[value="meadow"]:checked~.th-view [data-t="meadow"]{display:inline-flex}
.t-harbour,.th-r[value="harbour"]:checked~.th-view .th-site,.pinned .chap-history[data-step="1"] .hi .site{--s-bg:#ffffff;--s-surface:#f0f5fc;--s-fg:#0f1c2e;--s-muted:#4a5c72;--s-border:#dbe4f1;--s-accent:#1f4fd8;--s-accent-fg:#ffffff;--s-inv-bg:#0f1c2e;--s-inv-fg:#eef3fa;--s-inv-muted:#93a4bb;--s-r:1em;--s-rs:0.5em;--s-rb:0.5em;--s-sans:system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--s-display:system-ui, -apple-system, "Segoe UI", Roboto, sans-serif}
.th-r[value="harbour"]:checked~.th-pick [for="th-harbour"]{background:#fff;box-shadow:0 0.5em 1.2em -0.7em rgb(20 22 26 / 0.45),inset 0 0 0 1px var(--line)}
.th-r[value="harbour"]:checked~.th-pick [for="th-harbour"] .th-t b::after{opacity:1}
.th-r[value="harbour"]:focus-visible~.th-pick [for="th-harbour"]{outline:2px solid var(--ink);outline-offset:2px}
.th-r[value="harbour"]:checked~.th-view [data-t="harbour"]{display:inline-flex}
.t-bloom,.th-r[value="bloom"]:checked~.th-view .th-site{--s-bg:#fffaf9;--s-surface:#fceef0;--s-fg:#2a1720;--s-muted:#6e4a58;--s-border:#f5dde2;--s-accent:#b73a5c;--s-accent-fg:#ffffff;--s-inv-bg:#2a1720;--s-inv-fg:#fdf1f3;--s-inv-muted:#bb98a4;--s-r:2.5em;--s-rs:1em;--s-rb:999px;--s-sans:system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--s-display:ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif}
.th-r[value="bloom"]:checked~.th-pick [for="th-bloom"]{background:#fff;box-shadow:0 0.5em 1.2em -0.7em rgb(20 22 26 / 0.45),inset 0 0 0 1px var(--line)}
.th-r[value="bloom"]:checked~.th-pick [for="th-bloom"] .th-t b::after{opacity:1}
.th-r[value="bloom"]:focus-visible~.th-pick [for="th-bloom"]{outline:2px solid var(--ink);outline-offset:2px}
.th-r[value="bloom"]:checked~.th-view [data-t="bloom"]{display:inline-flex}
