  :root {
    --paper: #f3ebd9;
    --paper-2: #e9dfc7;
    --ink: #262420;
    --ink-2: #5a544a;
    --rule: #cdbf9f;
    --blue: #2757a6;
    --blue-ink: #1d4482;
    --blue-wash: rgba(39, 87, 166, 0.16);
    --brass: #b8862b;
    --lawn: #5b7a4c;
    --card: #fbf7ee;
    --shadow: 0 10px 30px rgba(38, 36, 32, 0.18);
    --display: "Fraunces", "Iowan Old Style", Georgia, serif;
    --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
    --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --paper: #1b1d21;
      --paper-2: #24272d;
      --ink: #ece4d2;
      --ink-2: #b0a892;
      --rule: #3d4149;
      --blue: #7fa6e6;
      --blue-ink: #a9c4f0;
      --blue-wash: rgba(127, 166, 230, 0.22);
      --brass: #d6a94a;
      --lawn: #8db07a;
      --card: #24272d;
      --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
  }
  :root[data-theme="dark"] {
    --paper: #1b1d21;
    --paper-2: #24272d;
    --ink: #ece4d2;
    --ink-2: #b0a892;
    --rule: #3d4149;
    --blue: #7fa6e6;
    --blue-ink: #a9c4f0;
    --blue-wash: rgba(127, 166, 230, 0.22);
    --brass: #d6a94a;
    --lawn: #8db07a;
    --card: #24272d;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  * { box-sizing: border-box; }
  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.5;
    padding-block: 0 32px;
    padding-inline: 16px;
  }
  a { color: var(--blue-ink); }
  a:focus-visible, button:focus-visible, .hot:focus-visible {
    outline: 3px solid var(--brass);
    outline-offset: 2px;
  }

  .wrap { max-width: 1180px; margin: 0 auto; }

  /* Header: campus sign */
  header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 24px;
    padding-block: 18px 10px;
    border-bottom: 2px solid var(--ink);
  }
  .brand {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.005em;
    text-decoration: none;
    color: var(--ink);
  }
  .brand small {
    display: block;
    font-family: var(--mono);
    font-weight: 400;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-2);
  }
  .mock {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brass);
    border: 1px solid var(--brass);
    padding: 3px 8px;
    border-radius: 2px;
  }

  /* Breadcrumb */
  nav.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding-block: 12px;
    font-family: var(--mono);
    font-size: 0.85rem;
  }
  nav.crumbs a { text-decoration: none; }
  nav.crumbs a:hover { text-decoration: underline; }
  nav.crumbs .sep { color: var(--rule); }
  nav.crumbs .here { color: var(--ink); font-weight: 500; }
  nav.crumbs .keys {
    margin-left: auto;
    color: var(--ink-2);
    font-size: 0.75rem;
  }
  nav.crumbs kbd {
    font-family: var(--mono);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0 5px;
    background: var(--paper-2);
  }

  /* Scene */
  .scene {
    position: relative;
    aspect-ratio: 3 / 2;
    max-width: 100%;
    background: var(--paper-2);
    border: 1px solid var(--rule);
    overflow: hidden;
  }
  .scene svg { display: block; width: 100%; height: 100%; }
  .scene image { transition: opacity 240ms ease; }
  .hot polygon {
    fill: transparent;
    stroke: transparent;
    stroke-width: 3;
    stroke-linejoin: round;
    transition: fill 120ms ease, stroke 120ms ease;
    cursor: pointer;
  }
  .hot:hover polygon, .hot:focus-visible polygon, .hot.lit polygon {
    fill: var(--blue-wash);
    stroke: var(--blue);
  }
  .hot.soon:hover polygon, .hot.soon:focus-visible polygon, .hot.soon.lit polygon {
    fill: rgba(184, 134, 43, 0.16);
    stroke: var(--brass);
  }
  .hot:focus-visible polygon { stroke-dasharray: 8 5; }

  /* Caption card */
  .caption {
    position: absolute;
    max-width: 300px;
    min-width: 200px;
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--rule);
    border-top: 3px solid var(--blue);
    box-shadow: var(--shadow);
    padding: 10px 14px 12px;
    pointer-events: none;
    transform: translate(-50%, 0);
    z-index: 2;
  }
  .caption.soon { border-top-color: var(--brass); }
  .caption .kind {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-2);
  }
  .caption h3 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    margin: 2px 0 4px;
    text-wrap: balance;
  }
  .caption p { margin: 0; font-size: 0.85rem; color: var(--ink-2); }
  .caption .children { margin-top: 6px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink); }
  .caption .enter {
    margin-top: 8px;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--blue-ink);
  }
  .caption.soon .enter { color: var(--brass); }

  /* Directory (text equivalent under a scene) */
  .dir { margin-top: 28px; }
  .dir h2, .page h2 {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--rule);
  }
  .dir ul, .page ul { list-style: none; margin: 0; padding: 0; }
  .dir ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0 28px;
  }
  .dir li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-block: 8px;
    border-bottom: 1px dotted var(--rule);
  }
  .dir li a { text-decoration: none; font-weight: 500; }
  .dir li a:hover { text-decoration: underline; }
  .chip {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 2px;
    white-space: nowrap;
  }
  .chip.open { color: var(--lawn); border: 1px solid var(--lawn); }
  .chip.soon { color: var(--brass); border: 1px solid var(--brass); }
  .chip.ph { color: var(--ink-2); border: 1px dashed var(--ink-2); }

  /* Landing page */
  .page { padding-top: 12px; }
  .page .eyebrow {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-2);
  }
  .page h1 {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3rem);
    line-height: 1.05;
    margin: 6px 0 8px;
    text-wrap: balance;
  }
  .page .tagline {
    font-family: var(--display);
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--ink-2);
    margin: 0 0 22px;
    max-width: 40ch;
    text-wrap: balance;
  }
  .cols {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 28px 48px;
    align-items: start;
  }
  @media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
  .prose { max-width: 62ch; }
  .prose p { margin: 0 0 14px; }
  .placeholder {
    border-left: 3px solid var(--brass);
    padding: 10px 14px;
    background: var(--paper-2);
    color: var(--ink-2);
    font-style: italic;
  }
  .placeholder .chip { font-style: normal; margin-right: 8px; }

  .demos li, .repos li { padding-block: 8px; border-bottom: 1px dotted var(--rule); }
  .demos li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .demos .name { font-weight: 500; }
  .demos .name small { display: block; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2); font-weight: 400; }
  .run {
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--paper);
    background: var(--blue);
    padding: 7px 12px;
    border-radius: 2px;
    white-space: nowrap;
  }
  .run:hover { background: var(--blue-ink); }
  .repos li a { font-family: var(--mono); font-size: 0.85rem; text-decoration: none; }
  .repos li a:hover { text-decoration: underline; }
  .repos li span { color: var(--ink-2); font-size: 0.85rem; }
  .section + .section { margin-top: 26px; }
  .exhibits li { display: flex; justify-content: space-between; gap: 12px; padding-block: 7px; border-bottom: 1px dotted var(--rule); }
  .back { display: inline-block; margin-top: 30px; font-family: var(--mono); font-size: 0.85rem; text-decoration: none; }
  .back:hover { text-decoration: underline; }

  footer {
    margin-top: 40px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-2);
  }
  footer a { color: var(--ink-2); }

  @media (prefers-reduced-motion: reduce) {
    .scene image, .hot polygon { transition: none; }
  }

  /* Draft prose (real text, not yet final) */
  .draft { max-width: 62ch; margin: 0 0 14px; }
  .draft .chip { margin-right: 8px; vertical-align: middle; }
  .chip.draft { color: var(--lawn); border: 1px solid var(--lawn); }

  /* ---------- Easel: the tour handset stand, same corner of every scene ---------- */
  .scene .easel { position: absolute; right: 2%; bottom: 3%; width: 240px; max-width: 42%; z-index: 3; }
  .page .easel { margin-bottom: 26px; }
  .easel { color: var(--ink); }
  .placard {
    background: var(--card);
    border: 1px solid var(--rule);
    border-bottom: 4px solid var(--brass);
    box-shadow: var(--shadow);
    padding: 10px 14px 12px;
    transform: rotate(-1.2deg);
  }
  .page .placard { transform: none; }
  .placard .kind { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
  .placard h3 { font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.2; margin: 2px 0 4px; text-wrap: balance; }
  .placard p { margin: 0 0 8px; font-size: 0.82rem; color: var(--ink-2); }
  .placard .visit { font-family: var(--mono); font-size: 0.78rem; text-decoration: none; }
  .placard .stop { margin-top: 10px; font-size: 0.8rem; min-height: 1.2em; }
  .placard .stop small { color: var(--ink-2); }
  .badge { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper); background: var(--brass); padding: 2px 6px; border-radius: 2px; }
  .ask-docent {
    margin-top: 8px; width: 100%;
    font-family: var(--mono); font-size: 0.8rem; font-weight: 500;
    color: var(--paper); background: var(--blue); border: 0; border-radius: 2px; padding: 8px 10px; cursor: pointer;
  }
  .ask-docent:hover { background: var(--blue-ink); }
  .easel .legs { display: block; width: 120px; height: 40px; margin: -2px auto 0; color: var(--brass); }
  .page .easel .legs { display: none; }
  @media (max-width: 640px) {
    .scene .easel { position: static; width: auto; max-width: none; margin-top: 12px; }
    .placard { transform: none; }
    .easel .legs { display: none; }
  }

  /* ---------- Docent drawer: the tour player ---------- */
  .drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw);
    background: var(--card); color: var(--ink);
    border-left: 1px solid var(--rule); box-shadow: var(--shadow);
    display: flex; flex-direction: column; z-index: 20;
  }
  .drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px 8px; border-bottom: 2px solid var(--ink); }
  .drawer-head .kind { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
  .drawer-head h2 { font-family: var(--display); font-weight: 700; font-size: 1.3rem; margin: 0; border: 0; padding: 0; letter-spacing: 0; text-transform: none; color: var(--ink); }
  .drawer .icon { background: none; border: 1px solid var(--rule); color: var(--ink); font-size: 1.2rem; line-height: 1; width: 32px; height: 32px; border-radius: 2px; cursor: pointer; }
  .edition { font-family: var(--mono); font-size: 0.68rem; color: var(--brass); padding: 6px 16px; border-bottom: 1px dotted var(--rule); }
  .transcript { list-style: none; margin: 0; padding: 12px 16px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
  .transcript li { max-width: 92%; padding: 10px 12px; border: 1px solid var(--rule); }
  .transcript li.you { align-self: flex-end; background: var(--paper-2); border-radius: 12px 12px 2px 12px; }
  .transcript li.docent { align-self: flex-start; background: var(--paper); border-left: 3px solid var(--blue); }
  .transcript p { margin: 4px 0 0; font-size: 0.9rem; }
  .transcript h4 { font-family: var(--display); font-weight: 700; font-size: 1rem; margin: 4px 0 0; }
  .transcript .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .act { font-family: var(--mono); font-size: 0.74rem; text-decoration: none; color: var(--blue-ink); background: none; border: 1px solid var(--blue); border-radius: 2px; padding: 4px 8px; cursor: pointer; }
  .act:hover { background: var(--blue-wash); }
  .why { margin-top: 8px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2); }
  .why summary { cursor: pointer; color: var(--brass); }
  .why div { margin-top: 4px; line-height: 1.5; }
  .chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px 0; }
  .chips button { font-family: var(--mono); font-size: 0.72rem; background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule); border-radius: 12px; padding: 4px 10px; cursor: pointer; }
  .chips button:hover { border-color: var(--blue); }
  .ask { display: flex; gap: 8px; padding: 10px 16px; }
  .ask input { flex: 1; min-width: 0; font-family: var(--body); font-size: 0.95rem; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 2px; background: var(--paper); color: var(--ink); }
  .ask button { font-family: var(--mono); font-size: 0.8rem; font-weight: 500; color: var(--paper); background: var(--blue); border: 0; border-radius: 2px; padding: 8px 14px; cursor: pointer; }
  .drawer-foot { display: flex; justify-content: space-between; gap: 12px; padding: 6px 16px 12px; font-family: var(--mono); font-size: 0.72rem; }
  .drawer-foot a { color: var(--ink-2); }
  .link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline; cursor: pointer; }
  .sr { position: absolute; left: -9999px; }

  /* Maturity chips: the work-in-progress voice */
  .chip.m-finished { color: var(--lawn); border: 1px solid var(--lawn); }
  .chip.m-working  { color: var(--blue-ink); border: 1px solid var(--blue); }
  .chip.m-early    { color: var(--brass); border: 1px solid var(--brass); }
  .chip.m-planned  { color: var(--ink-2); border: 1px dashed var(--ink-2); }
  .placard .chip { vertical-align: middle; margin-left: 6px; }

  /* Layout fixes: the drawer pushes the page left; the easel sits bottom centre of a lobby */
  :root { --drawer-w: 400px; }
  .drawer { width: min(var(--drawer-w), 100vw); }
  @media (min-width: 900px) {
    body.docent-open { padding-right: calc(var(--drawer-w) + 16px); transition: padding-right 160ms ease; }
  }
  .scene .easel { right: auto; left: 50%; bottom: 2%; transform: translateX(-50%); width: 300px; max-width: 60%; }
  .placard { transform: none; }
  .head-right { display: flex; align-items: center; gap: 12px; }
  .docent-btn {
    font-family: var(--mono); font-size: 0.78rem; font-weight: 500;
    color: var(--paper); background: var(--blue); border: 0; border-radius: 2px; padding: 6px 12px; cursor: pointer;
  }
  .docent-btn:hover { background: var(--blue-ink); }
  @media (prefers-reduced-motion: reduce) { body.docent-open { transition: none; } }

  /* The hidden attribute must beat the drawer's display:flex */
  .drawer[hidden] { display: none; }
  body.no-anim, body.no-anim.docent-open { transition: none; }

  .drawer-foot { flex-wrap: wrap; justify-content: flex-start; row-gap: 4px; }
  .drawer-foot .link { margin-right: auto; }

  /* Caption tips and the links block under a wing painting */
  .caption .tip { margin-top: 6px; font-size: 0.78rem; color: var(--ink); border-top: 1px dotted var(--rule); padding-top: 6px; }
  .caption .kind .chip { margin-left: 6px; vertical-align: middle; }
  .cols.links { margin-top: 28px; }

  /* Scene notice: a large disclaimer across the top of a rough painting */
  .scene .notice {
    position: absolute; left: 3%; right: 3%; top: 9%;
    background: rgba(184, 134, 43, 0.94); color: #1d1a14;
    border: 3px solid #1d1a14; padding: 12px 18px;
    font-size: clamp(0.85rem, 1.6vw, 1.15rem); line-height: 1.35; z-index: 4;
    box-shadow: var(--shadow); text-wrap: balance;
  }
  .scene .notice strong { font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; margin-right: 10px; }
  @media (max-width: 640px) { .scene .notice { position: static; margin-bottom: 8px; } }

  /* Licensed photographs: on exhibit pages, and small in the hover caption */
  .photo { margin: 0 0 16px; }
  .photo img { display: block; width: 100%; max-width: 100%; height: auto; border: 1px solid var(--rule); }
  .photo figcaption { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-2); margin-top: 6px; line-height: 1.4; }
  .photo.small { margin: 8px 0 0; }
  .photo.small img { max-height: 150px; width: auto; }
  .caption { max-width: 320px; }

  /* Schematic boxes drawn over wrong machines in a rough painting */
  .sketch { pointer-events: none; }
  .sk-patch { fill: #dcd8cf; opacity: 0.96; }
  .sk-front { fill: #5d86b3; stroke: #262420; stroke-width: 3; stroke-linejoin: round; }
  .sk-side  { fill: #3f6390; stroke: #262420; stroke-width: 3; stroke-linejoin: round; }
  .sk-top   { fill: #e3e6ea; stroke: #262420; stroke-width: 3; stroke-linejoin: round; }
  .sk-slot  { fill: #2b3a4d; stroke: #262420; stroke-width: 2; }
  .sk-key   { fill: #cfd4da; stroke: #262420; stroke-width: 2; }
  .sk-lamp  { fill: #f2c14e; stroke: #262420; stroke-width: 1.5; }
  .sk-detail{ fill: #cfd4da; stroke: #262420; stroke-width: 2; }
  .sk-label { font-family: "IBM Plex Mono", monospace; font-size: 30px; font-weight: 500; fill: #fbf7ee; text-anchor: middle; }
  .sk-sub   { font-family: "IBM Plex Mono", monospace; font-size: 16px; fill: #fbf7ee; text-anchor: middle; letter-spacing: 0.08em; }
  .sk-label { font-size: 26px; }
  .sk-sub { font-size: 14px; }

  /* Call to action: a slow glow fades in and out on the docent controls while the drawer is closed */
  @keyframes docent-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(120, 170, 255, 0); }
    50%      { box-shadow: 0 0 22px 8px rgba(130, 180, 255, 1); }
  }
  body:not(.docent-open) .docent-btn,
  body:not(.docent-open) .ask-docent { animation: docent-glow 2.2s ease-in-out infinite; }
  @media (prefers-reduced-motion: reduce) {
    .docent-btn, .ask-docent { animation: none !important; }
    body:not(.docent-open) .docent-btn, body:not(.docent-open) .ask-docent { box-shadow: 0 0 14px 4px rgba(120, 170, 255, 0.6); }
  }
