@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,700;1,400&family=Alegreya:ital,wght@0,400;0,500;0,700;1,400;1,700&display=swap");

/* One stylesheet for the whole site: showcase, docs, curation engine and all
   example pages. The default layout is a centered column (--page-max wide);
   backgrounds run full-bleed while content is held in the column by
   padding-inline: var(--col-pad). */

:root {
  --paper: #f5f5f5;
  --paper-deep: #e8e8e8;
  --ink: #151515;
  --muted: #625d55;
  --rule: #b8ae9d;
  --red: #b5362b;
  --blue: #244f73;
  --red-on-dark: #df695c;
  --blue-on-dark: #79a9cc;
  --text-on-dark: #d8d0c4;
  --green: #37614f;
  --white: #fbfaf5;
  --sheet: #f0efe9;
  --page-max: 1100px;
  --col-pad: max(28px, calc((100% - var(--page-max)) / 2));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Leave room for the sticky title row so an anchor jump lands on the
     content, not behind the bar. The mobile value clears the wrapped menu. */
  scroll-padding-top: 80px;
}

/* The former long homepage always reserved a scrollbar. Keep that same
   viewport width now that Enter ends after its hero. */
html.enter-page {
  overflow-y: scroll;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Mono", Consolas, "Courier New", monospace;
  line-height: 1.5;
}

a {
  color: inherit;
}

code,
pre {
  font-family: Consolas, "Courier New", monospace;
}

/* Running text reads in Alegreya; UI chrome stays in the mono voice. A whole
   sentence is running text wherever it stands - a card, a step, a caption. */
p,
figcaption,
.demo-header li,
.guide-block li,
.legend li {
  font-family: "Alegreya", Georgia, serif;
}

/* Mono runs wider and taller than Alegreya - tuck inline code in a step. */
p code,
.demo-header li code,
.guide-block li code,
.legend li code {
  font-size: 0.88em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* ── navbar ─────────────────────────────────────────────────────────── */

#navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 var(--col-pad);
  background: rgba(245, 245, 245, 0.94);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(10px);
}

.nav-logo {
  font-family: "Oswald", sans-serif;
  text-decoration: none;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-logo span,
.accent {
  color: var(--red);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

/* ── hero (showcase home) ───────────────────────────────────────────── */

#hero {
  position: relative;
  min-height: calc(100vh - 64px);
  overflow: hidden;
  background: var(--paper);
}

#hero-canvas {
  position: absolute;
  inset: 0;
}

#hero-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.hero-overlay {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  padding: 9vw var(--col-pad);
  /* The wash protects only the title zone; the worked sheet stays
     at full strength on the right, ghosted at the left edge. */
  background: linear-gradient(100deg,
    rgba(240, 239, 233, 0.94) 0%,
    rgba(240, 239, 233, 0.87) 30%,
    rgba(240, 239, 233, 0.55) 48%,
    rgba(240, 239, 233, 0.12) 62%,
    rgba(240, 239, 233, 0) 75%);
}

.hero-text {
  max-width: 660px;
}

/* ── typography ─────────────────────────────────────────────────────── */

.hero-badge,
.section-tag,
.code-label,
.demo-number {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  margin: 0;
  line-height: 1.02;
  letter-spacing: 0;
}

h1 {
  margin-top: 10px;
  font-size: clamp(64px, 14vw, 150px);
}

h2 {
  font-size: clamp(36px, 7vw, 78px);
}

h3 {
  font-size: 24px;
}

.hero-sub,
.section-desc {
  max-width: 720px;
  color: var(--muted);
  font-size: 20px;
}

/* The contact sheet: every work at a glance; a tile reveals its plate below */
.contact-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-width: 1100px;
}

.work-band {
  display: grid;
  grid-template-columns: minmax(130px, 170px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  max-width: 1100px;
}

.work-band + .work-band {
  margin-top: 24px;
}

.work-band .contact-sheet {
  grid-template-columns: repeat(auto-fit, minmax(150px, 220px));
  max-width: none;
}

.work-band-head {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}

.work-band-head strong {
  color: var(--red);
  font-family: "Oswald", sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.work-band-head small {
  color: var(--muted);
  font-family: "IBM Plex Mono", Consolas, "Courier New", monospace;
  font-size: 10.5px;
  line-height: 1.5;
}

.work-band-word .work-band-head {
  border-top: 0;
}

.work-band-surface .work-band-head {
  border-top-style: dashed;
}

/* Every tile stands the same height on every sheet: the core sheet has a tile
   whose second line wraps and stretches its row, so the two-plate sheets below
   are held to the same measure instead of sitting a line shorter. */
.cs-tile {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 102px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  background: rgba(251, 250, 245, 0.56);
  color: var(--ink);
  text-decoration: none;
}

.cs-tile strong {
  font-family: "Oswald", sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.05;
}

.cs-tile small {
  font-family: "IBM Plex Mono", Consolas, "Courier New", monospace;
  font-size: 10.5px;
  color: var(--muted);
}

.cs-tile:hover,
.cs-tile:focus-visible {
  background: var(--ink);
  color: var(--white);
}

.cs-tile:hover small,
.cs-tile:focus-visible small {
  color: var(--text-on-dark);
}

.cs-tile.active {
  padding: 11px 13px;
  border: 2px solid var(--ink);
  background: rgba(251, 250, 245, 0.56);
  color: var(--ink);
}

.cs-tile.active small {
  color: var(--muted);
}

/* With the chapter turner available, only the selected plate enters the normal
   document flow. Without JavaScript body.folder is never set, so every plate
   remains reachable as a plain page. */
body.folder .plate {
  display: none;
}

body.folder .plate.plate-active {
  display: block;
  scroll-margin-top: 64px;
}

/* An example page opened on its own inside a frame drops its own chrome. The
   showcase no longer frames anything, but the example pages keep this so any
   other embedding stays clean. */
html.embedded #navbar,
html.embedded footer {
  display: none;
}

.plate-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  width: 46px;
  height: 46px;
  border: 1px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}

.plate-arrow:hover {
  background: var(--ink);
  color: var(--white);
}

#plate-prev,
#chapter-prev {
  left: 10px;
}

#plate-next,
#chapter-next {
  right: 10px;
}

/* Collage chapters: one module at a time; the chips stay as the visible index */
body.chapters .ce-module {
  display: none;
}

body.chapters .ce-module.chapter-active {
  display: block;
}

.ce-chips a.active {
  background: var(--ink);
  color: var(--white);
}

/* the calibration sheet gets room: a tall sheet at full width beside its code */
.ex-preview.ex-sheet {
  max-width: 1100px;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  align-items: start;
}

.ex-preview.ex-sheet .ex-canvas {
  grid-row: 1 / 3;
}

@media (max-width: 900px) {
  .ex-preview.ex-sheet {
    grid-template-columns: 1fr;
  }

  .ex-preview.ex-sheet .ex-canvas {
    grid-row: auto;
  }
}

/* a card that loads more than its group's file names every file it needs */
.lib-req {
  margin-top: 10px;
  font-family: "IBM Plex Mono", Consolas, "Courier New", monospace;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--blue);
}

.section-dark .lib-req {
  color: var(--blue-on-dark);
}

.hero-sub {
  margin: 20px 0 28px;
  font-size: 24px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.cta-btn.secondary {
  background: transparent;
  color: var(--ink);
}

/* ── sections (centered column by default) ──────────────────────────── */

.section {
  padding: 92px var(--col-pad);
}

.section-dark {
  background: #25231f;
  color: var(--white);
}

.section-dark .section-desc {
  color: var(--text-on-dark);
}

/* The base tag and accent colors are tuned for paper; on dark ground
   they fall below readable contrast, so lift them here. */
.section-dark .section-tag {
  color: var(--blue-on-dark);
}

.section-dark .accent {
  color: var(--red-on-dark);
}

.section-header {
  max-width: 920px;
  margin-bottom: 36px;
}

.group-intro {
  padding-top: 70px;
  padding-bottom: 70px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* the strip wears the same closed frames as the feature cards at the bottom */
.method-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1100px;
  gap: 18px;
}

.method-strip + .section-header {
  margin-top: clamp(36px, 6vw, 72px);
}

.method-strip a {
  display: grid;
  min-height: 180px;
  align-content: space-between;
  gap: 12px;
  padding: 22px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--rule);
  background: rgba(251, 250, 245, 0.56);
}

.method-strip span,
.method-strip small {
  font-family: "IBM Plex Mono", Consolas, "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.method-strip strong {
  font-family: "Oswald", sans-serif;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 600;
  line-height: 1;
}

.method-strip a:hover,
.method-strip a:focus-visible {
  background: var(--ink);
  color: var(--white);
}

.feature-grid,
.examples-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-grid article,
.example-card,
.guide-block {
  padding: 22px;
  border: 1px solid var(--rule);
  background: rgba(251, 250, 245, 0.56);
}

.feature-grid p,
.example-card p,
.guide-block p,
.guide-block li {
  color: var(--muted);
}

.section-dark .code-preview {
  border-color: #5a5348;
}

.code-preview {
  max-width: 900px;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--rule);
  background: #171614;
  color: #f2eee5;
}

.code-preview code {
  white-space: pre;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.page-header {
  padding: 84px var(--col-pad) 42px;
  border-bottom: 1px solid var(--rule);
}

.page-header p {
  max-width: 780px;
  color: var(--muted);
  font-size: 20px;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

/* Vision reads long, so its text-only sections set in newspaper columns and the
   measure stays comfortable instead of running the full sheet. A section with a
   figure keeps one column, so the float stays clean. 360px is the narrowest
   column, which makes two on the wide sheet and one again on a phone. The
   heading spans both. Scoped to Vision; other guide pages keep one column. */
.vision-essay .guide-block:not(:has(figure)) {
  columns: 360px;
  column-gap: 34px;
}

.vision-essay .guide-block:not(:has(figure)) h2 {
  column-span: all;
}

.vision-essay .guide-block:not(:has(figure)) p {
  margin-top: 0;
}

.guide-block h2 {
  margin-bottom: 14px;
  font-size: 32px;
}

.guide-block ul {
  margin-bottom: 0;
}

.example-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  text-decoration: none;
}

.example-card .example-meta {
  margin-top: auto;
  color: var(--blue);
  font-weight: 700;
}

/* ── example gallery previews ───────────────────────────────────────── */

.ex-page-header {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 86px var(--col-pad) 42px;
  text-align: center;
}

.ex-page-header h1 {
  margin-top: 10px;
  font-size: clamp(56px, 10vw, 120px);
}

.ex-page-header p {
  max-width: 720px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 20px;
}

.ex-preview {
  display: grid;
  gap: 12px;
  max-width: 620px;
}

.ex-canvas {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--sheet);
}

.ex-canvas canvas {
  display: block !important;
  width: 100% !important;
  height: auto !important;
}

.ex-code-block {
  width: 100%;
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: #faf8f3;
  color: #151515;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

.ex-code-block code {
  background: transparent;
  font-family: inherit;
  font-size: inherit;
}

.ex-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

/* The minute-zero block on Enter: the code gets air around and inside it. */
#start-here {
  margin-top: 42px;
}

#start-here .ex-code-block {
  margin: 16px 0 18px;
  padding: 26px 30px;
  line-height: 1.85;
}

.ex-full-link {
  color: var(--muted);
  font-family: "Oswald", sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
}

.ex-full-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.section-dark .ex-full-link {
  color: #d8d0c4;
  border-color: #6e665b;
}

.section-dark .ex-full-link:hover {
  color: var(--white);
  border-color: var(--white);
}

/* ── standalone example (demo) pages ────────────────────────────────── */

.demo-page {
  min-height: calc(100vh - 64px);
  padding: 56px var(--col-pad) 72px;
}

/* The intro takes the same measure as the code and sketch below it: title,
   running text and the two blocks all break on the column edge. One text
   column would read too long at that width, so the prose sets in newspaper
   columns: 400px is the narrowest column allowed, which makes two on the wide
   sheet and one again as soon as the page narrows - no breakpoint needed. */
.demo-header {
  margin: 0 0 28px;
  columns: 400px;
  column-gap: 34px;
  column-rule: 1px solid var(--rule);
}

/* The tag and the title stay one line across the whole sheet - h2 too, for the
   second header some pages set below the sketch. */
.demo-header .demo-number,
.demo-header h1,
.demo-header h2 {
  column-span: all;
}

.demo-header h1 {
  margin: 8px 0 10px;
  font-size: clamp(44px, 9vw, 104px);
  line-height: 1;
}

/* Bottom margins only: every column has to start flush with its neighbour. */
.demo-header p,
.demo-header ul {
  margin: 0 0 14px;
}

.demo-header p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.demo-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(340px, 1fr);
  gap: 22px;
  align-items: start;
  margin: 0 auto;
}

.demo-code {
  min-width: 0;
  border: 1px solid var(--rule);
  background: rgba(251, 250, 245, 0.72);
}

.demo-code .code-label {
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}

.demo-code pre {
  overflow: auto;
  margin: 0;
  padding: 18px;
  background: #faf8f3;
  color: #151515;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

.demo-code code {
  font-size: inherit;
}

.demo-right {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.demo-canvas {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--rule);
  background: var(--sheet);
  overflow: hidden;
}

.demo-canvas canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
}

/* The note under the sketch is prose in whatever tag a page happened to use
   for it - p on one page, div on the next - so name the voice on the class
   instead of the tag. 15px because Alegreya sits smaller than mono. */
.demo-note {
  color: var(--muted);
  font-family: "Alegreya", Georgia, serif;
  font-size: 15px;
}

/* An id on a note means the sketch writes into it, so it is a reading and not
   a sentence - seed, path count, mm drawn - and it keeps the machine voice.
   That holds whether the sketch fills a word inside the line or the whole line. */
.demo-note[id],
.demo-note [id] {
  font-family: "IBM Plex Mono", Consolas, "Courier New", monospace;
  font-size: 0.9em;
}

.demo-stats {
  margin: 0 18px 12px;
  padding: 8px 12px;
  border: 1px solid var(--ink);
  background: var(--white);
  font-family: "Courier New", monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 18px;
}

.demo-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-family: "Oswald", sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.demo-actions button:hover {
  background: #000;
}

.control-grid {
  display: grid;
  gap: 14px;
  padding: 0 18px 20px;
}

.control-row {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.control-row span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.control-row output {
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
}

.control-row input {
  width: 100%;
  accent-color: var(--red);
}

/* A clickable sheet (reroll on click) shows the pointer. */
.is-clickable {
  cursor: pointer;
}

/* Three-line legend: one row per decay stage, read at a glance. */
.legend {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
}

.legend li {
  color: var(--muted);
  padding: 0.15rem 0;
}

.legend strong {
  color: var(--ink);
}

/* ── curation engine page ───────────────────────────────────────────── */

.collage-page .page-header .section-tag {
  color: var(--red);
}

.collage-page a:focus-visible,
.collage-page button:focus-visible {
  outline-color: var(--red);
}

.ce-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.ce-chips a {
  display: inline-block;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 6px 11px;
  border-radius: 0;
  background: var(--white);
}

.ce-chips a:hover {
  border-color: var(--ink);
}

.ce-module {
  padding: 46px var(--col-pad);
  border-top: 1px solid var(--rule);
}

/* The page-header already draws the separator above the first module. */
.page-header + .ce-module {
  border-top: none;
}

.ce-module h2 {
  font-size: clamp(28px, 4vw, 44px);
  margin-top: 6px;
}

.ce-module .section-desc {
  max-width: 680px;
  color: var(--muted);
  margin-top: 10px;
}

.ce-preview,
.ce-codewrap {
  min-width: 0;
}

.ce-canvas {
  width: 100%;
  background: var(--sheet);
  border: 1px solid var(--rule);
  min-height: 200px;
}

.ce-canvas canvas {
  display: block;
}

.ce-codewrap {
  position: relative;
}

.ce-codewrap code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}

.ce-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #14140f;
  background: #eee9dc;
  border: 1px solid #eee9dc;
  padding: 5px 9px;
  cursor: pointer;
}

.ce-copy:hover {
  background: #fff;
}

.ce-poster-stage {
  max-width: 760px;
  margin: 26px auto 0;
}

.ce-poster-stage .ce-canvas {
  min-height: 420px;
  border: 1px solid var(--rule);
  box-shadow: none;
}

.ce-route {
  max-width: 760px;
  margin: 22px auto 0;
  text-align: center;
}

.ce-sheet-specimen,
.ce-layer-specimen {
  display: grid;
  min-height: 420px;
  padding: 28px;
  place-items: center;
}

.ce-page-outline {
  display: flex;
  width: min(68%, 230px);
  aspect-ratio: 210 / 297;
  border: 2px solid var(--ink);
  padding: 20px;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--ink);
  box-shadow: inset 0 0 0 10px var(--sheet), inset 0 0 0 11px var(--rule);
}

.ce-page-outline span {
  font-family: "Oswald", sans-serif;
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
}

.ce-page-outline strong,
.ce-page-outline small {
  display: block;
  margin-top: 7px;
}

.ce-layer-specimen {
  place-items: stretch;
}

.ce-layer-specimen ol {
  width: min(100%, 420px);
  margin: auto;
  padding: 0;
  list-style: none;
}

.ce-layer-specimen li {
  display: grid;
  grid-template-columns: 38px 1fr;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-family: Consolas, "Courier New", monospace;
  color: var(--ink);
}

.ce-layer-specimen li b {
  color: var(--ink);
}

.ce-layer-specimen li.red,
.ce-layer-specimen li.red b {
  color: var(--red);
}

.ce-output-controls {
  display: flex;
  max-width: 760px;
  margin: 22px auto 0;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.ce-output-controls label {
  display: grid;
  gap: 5px;
  min-width: 230px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ce-output-controls select,
.ce-output-controls button {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 9px 13px;
  font: inherit;
  color: var(--ink);
  background: var(--white);
}

.ce-output-controls button {
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#physical-settings {
  display: block;
  max-width: 760px;
  margin: 10px auto 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  color: var(--muted);
}

/* ── syntax highlighting (Prism tokens) ─────────────────────────────── */

.code-preview .token.comment,
.ex-code-block .token.comment,
.demo-code .token.comment {
  color: #8b8b8b;
  font-style: italic;
}

.code-preview .token.keyword,
.ex-code-block .token.keyword,
.demo-code .token.keyword {
  color: #9c2d82;
}

.code-preview .token.string,
.ex-code-block .token.string,
.demo-code .token.string {
  color: #37614f;
}

.code-preview .token.number,
.code-preview .token.boolean,
.ex-code-block .token.number,
.ex-code-block .token.boolean,
.demo-code .token.number,
.demo-code .token.boolean {
  color: #8a5a10;
}

.code-preview .token.function,
.ex-code-block .token.function,
.demo-code .token.function {
  color: #244f73;
}

.code-preview .token.property,
.ex-code-block .token.property,
.demo-code .token.property {
  color: #b5362b;
}

/* ── footer ─────────────────────────────────────────────────────────── */

footer {
  padding: 42px var(--col-pad);
  border-top: 1px solid var(--rule);
  color: var(--muted);
}

.footer-sub {
  font-size: 13px;
}

/* ── responsive ─────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .demo-layout {
    grid-template-columns: 1fr;
  }

  /* Once the columns stack, the sketch comes first so it sits just under
     the header instead of below the whole code block. */
  .demo-right {
    order: -1;
  }

  .demo-canvas {
    min-height: 320px;
  }
}

@media (max-width: 800px) {
  html {
    scroll-padding-top: 128px;
  }

  #navbar {
    align-items: flex-start;
    padding: 12px 18px;
  }

  /* The menu never collapses: on narrow screens the links wrap to a
     second row and stay visible on every page. The hamburger stays
     hidden (it falls back to its base display: none). */
  .nav-links {
    flex-wrap: wrap;
  }

  .hero-overlay {
    padding: 80px 24px;
    background: rgba(245, 245, 245, 0.82);
  }

  .feature-grid,
  .examples-grid,
  .method-strip {
    grid-template-columns: 1fr;
  }

  .method-strip a {
    min-height: 130px;
  }

  .work-band {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .work-band .contact-sheet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body.chapters #chapter-prev,
  body.chapters #chapter-next {
    top: auto;
    bottom: 12px;
    transform: none;
  }

  .ce-output-controls {
    align-items: stretch;
  }

  .ce-output-controls label,
  .ce-output-controls select,
  .ce-output-controls button {
    width: 100%;
  }
}
