/* Caffelytics site. World: The Table Plan.
   A laminated cafe seating plan marked up in dry-wipe pen. */

@font-face {
  font-family: "Sofia Sans Semi Condensed";
  src: url("assets/fonts/SofiaSansSemiCondensed-latin.woff2") format("woff2");
  font-weight: 1 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Shantell Sans";
  src: url("assets/fonts/ShantellSans-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surface and ink */
  --laminate: #f1f3ef;
  --laminate-lift: #f8f9f6;
  --sheet: #f3f5f1;       /* the plan is its own laminated sheet on the page */
  --ink: #0b0d14;
  --ink-2: #3d444c;
  --grid-line: rgb(16 19 24 / 0.055);
  --rule: 1.5px;

  /* Markers. Each has one job. */
  --green: #187a58;      /* occupied, and the one action */
  --green-deep: #10553c;
  --red: #c4321f;        /* only what held too long */
  --blue: #2058d0;       /* lines, queues, selection, links */
  --blue-wash: rgb(32 88 208 / 0.12);

  --font: "Sofia Sans Semi Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --hand: "Shantell Sans", "Segoe Print", "Bradley Hand", cursive;

  --gutter: clamp(1rem, 2.6vw, 2.75rem);
  --sheet-gap: clamp(4.5rem, 9vw, 8.5rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--ink) var(--laminate);
  scrollbar-width: thin;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--laminate);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 20px 20px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--blue);
}

::selection { background: var(--blue); color: #fff; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--laminate); border-left: var(--rule) solid var(--ink); }
::-webkit-scrollbar-thumb { background: var(--ink); border: 3px solid var(--laminate); }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 20;
  padding: 0.6rem 1rem; background: var(--ink); color: var(--laminate);
  font-weight: 700; text-decoration: none;
  transition: top 0.2s var(--ease-out);
}
.skip:focus { top: 0.5rem; }

.hand {
  font-family: var(--hand);
  font-weight: 500;
  font-variation-settings: "INFM" 38, "BNCE" 14, "SPAC" 6;
  letter-spacing: 0.005em;
}

/* ------------------------------------------------------------------ masthead */

.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  height: clamp(3.75rem, 5.21vw, 5.5rem);
  padding-inline: var(--gutter) calc(var(--gutter) + 0.64vw);
  border-bottom: var(--rule) solid var(--ink);
  background: var(--laminate);
  position: relative; z-index: 10;
}

.wordmark {
  display: inline-flex; align-items: center; gap: clamp(0.6rem, 1.05vw, 1rem);
  text-decoration: none; color: var(--ink);
  font-weight: 900;
  font-size: clamp(1.75rem, 3.17vw, 3.2rem);
  line-height: 1; letter-spacing: -0.012em;
}
.wordmark svg { width: 1.08em; height: 1.08em; flex: none; }

.nav { display: flex; align-items: center; }
.nav ul { display: flex; gap: clamp(1.25rem, 3.3vw, 3.75rem); margin: 0; padding: 0; list-style: none; }
.nav a {
  position: relative; display: inline-block;
  font-size: clamp(1rem, 1.25vw, 1.35rem); letter-spacing: -0.03em; font-weight: 470;
  text-decoration: none; padding-block: 0.4rem;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.15rem;
  border-bottom: 2px solid var(--blue);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.35s var(--ease-out);
}
.nav a:hover::after, .nav a[aria-current="true"]::after { transform: scaleX(1); }

.key-toggle {
  display: none;
  font: inherit; font-weight: 700; line-height: 1.3;
  padding: 0.45rem 0.9rem; border-radius: 0;
  background: var(--laminate); color: var(--ink);
  border: var(--rule) solid var(--ink); cursor: pointer;
}
.key-toggle[aria-expanded="true"] { background: var(--ink); color: var(--laminate); }

/* --------------------------------------------------------------------- cover */

.cover {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 43.7fr) minmax(0, 56.3fr);
  column-gap: 0;
  padding-inline: var(--gutter);
  min-height: calc(100svh - clamp(3.75rem, 5.21vw, 5.5rem) - var(--index-h));
  --index-h: clamp(4rem, 5.6vw, 5.75rem);
}

.cover-words { padding-top: clamp(1.5rem, 2.75vw, 3.1rem); padding-bottom: 2rem; }

.cover h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(2.7rem, 4.94vw, 6rem);
  line-height: 1;
  letter-spacing: -0.014em;
  text-wrap: balance;
}
.cover h1 .line { display: block; white-space: nowrap; }

.marked { position: relative; display: inline-block; }
.marked svg {
  position: absolute; left: -0.5%; bottom: -0.2em; width: 101%; height: 0.24em;
  overflow: visible; pointer-events: none;
}
.marked path {
  fill: none; stroke: var(--blue); stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 0;
}

.lede {
  margin: clamp(2.4rem, 3.75vw, 4.25rem) 0 0;
  max-width: 19.6em;
  font-size: clamp(1.15rem, 1.8vw, 2.05rem);
  line-height: 1.36;
  text-wrap: pretty;
}

.actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: clamp(1rem, 2.1vw, 2.5rem);
  margin-top: clamp(1.75rem, 2.75vw, 3.25rem);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: clamp(3rem, 3.95vw, 4.4rem);
  padding: 0 clamp(1.4rem, 2.9vw, 3.2rem);
  border: 0; border-radius: 0; cursor: pointer;
  background: var(--green); color: #fff;
  font: inherit; font-weight: 800;
  font-size: clamp(1.15rem, 1.72vw, 1.95rem);
  letter-spacing: -0.005em; text-decoration: none;
  transition: background-color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.btn:hover { background: var(--green-deep); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { background: var(--ink-2); cursor: progress; }

.textlink {
  font-size: clamp(1.05rem, 1.36vw, 1.55rem);
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.22em;
  transition: color 0.2s var(--ease-out), text-decoration-color 0.2s var(--ease-out);
}
.textlink:hover { color: var(--blue); }

/* ---------------------------------------------------------------------- plan */

.cover-plan { position: relative; padding-top: clamp(1.5rem, 2.3vw, 2.6rem); }

.plan { position: relative; width: 99.7%; }
.plan svg { display: block; width: 100%; height: auto; overflow: visible; }

:is(.plan, .figure) .floor { fill: var(--sheet); stroke: none; }
:is(.plan, .figure) .wall { fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: square; stroke-linejoin: miter; }
:is(.plan, .figure) .wall-thin { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
:is(.plan, .figure) .furniture { fill: var(--sheet); stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
:is(.plan, .figure) .chair { fill: var(--sheet); stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
:is(.plan, .figure) .dot { fill: var(--ink); }

:is(.plan, .figure) .table-top { fill: var(--sheet); stroke: var(--ink); stroke-width: 2.7; stroke-linejoin: round; transition: stroke 0.4s var(--ease-out); }
:is(.plan, .figure) .chair-tick { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
:is(.plan, .figure) .scribble {
  fill: none; stroke: var(--green); stroke-width: 5.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0;
  transition: stroke-dashoffset 0.9s var(--ease-out), opacity 0.2s linear;
}
:is(.plan, .figure) [data-state="occupied"] .scribble { stroke-dashoffset: 0; opacity: 1; }
:is(.plan, .figure) [data-state="uncleared"] .table-top { stroke: var(--red); stroke-width: 3.2; }
:is(.plan, .figure) [data-state="uncleared"] .chair, .plan [data-state="uncleared"] .chair-tick { stroke: var(--red); }

:is(.plan, .figure) text { font-family: var(--hand); font-variation-settings: "INFM" 40, "BNCE" 12, "SPAC" 4; fill: var(--ink); }
:is(.plan, .figure) .t-id { font-family: var(--font); font-variation-settings: normal; font-size: 19px; font-weight: 750; text-anchor: middle; letter-spacing: 0.01em; }
:is(.plan, .figure) .t-state { font-family: var(--font); font-variation-settings: normal; font-size: 16px; font-weight: 450; text-anchor: middle; }
:is(.plan, .figure) [data-state="occupied"] .t-id { fill: var(--green); }
:is(.plan, .figure) [data-state="occupied"] .t-state { opacity: 0; }
:is(.plan, .figure) [data-state="uncleared"] text { fill: var(--red); }
:is(.plan, .figure) [data-state="uncleared"] .t-state { font-size: 15px; font-weight: 550; }
:is(.plan, .figure) [data-state="uncleared"] .t-id { font-size: 17px; }

:is(.plan, .figure) .blue-line { fill: none; stroke: var(--blue); stroke-width: 7; stroke-linecap: round; }
:is(.plan, .figure) .blue-stroke { fill: none; stroke: var(--blue); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
:is(.plan, .figure) .queue-box { fill: none; stroke: var(--blue); stroke-width: 3; stroke-dasharray: 11 9; stroke-linecap: round; }
:is(.plan, .figure) .queue-dot { fill: var(--sheet); stroke: var(--blue); stroke-width: 2.8; transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out); transform-box: fill-box; transform-origin: center; }
:is(.plan, .figure) .queue-dot[data-off] { opacity: 0; transform: scale(0.2); }
:is(.plan, .figure) .blue-text { fill: var(--blue); }
:is(.plan, .figure) .q-label { font-size: 23px; font-weight: 600; letter-spacing: 0.04em; }
:is(.plan, .figure) .q-count { font-size: 24px; font-weight: 500; }
:is(.plan, .figure) .door-count { font-size: 30px; font-weight: 600; }
:is(.plan, .figure) .planter { fill: none; stroke: var(--green); stroke-width: 2.6; stroke-linecap: round; }

:is(.plan, .figure) .arrow { transform-box: fill-box; transform-origin: left center; }
:is(.plan, .figure) .arrow.is-ticking { animation: nudge 0.7s var(--ease-out); }
@keyframes nudge { 0% { transform: translateX(0); } 35% { transform: translateX(9px); } 100% { transform: translateX(0); } }

:is(.plan, .figure) .ring { fill: none; stroke: var(--blue); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset 0.55s var(--ease-out), opacity 0.15s linear; pointer-events: none; }
:is(.plan, .figure) .ring.is-on { stroke-dashoffset: 0; opacity: 1; }

.sample-note {
  position: absolute; left: 25.7%; top: 100%; margin: 2.05em 0 0;
  font-size: clamp(0.95rem, 1.22vw, 1.4rem); line-height: 1; color: var(--blue); white-space: nowrap;
  transform: rotate(-11deg); transform-origin: left center;
}
.sample-note svg { display: inline-block; width: 1.55em; height: 1.75em; margin-left: 0.45em; vertical-align: -0.1em; }
.sample-note path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------- figures */

:is(.plan, .figure) .bar { fill: var(--blue); }
:is(.plan, .figure) .axis { font-family: var(--font); font-variation-settings: normal; font-size: 15px; font-weight: 500; text-anchor: middle; fill: var(--ink-2); }
:is(.plan, .figure) .cap { font-family: var(--font); font-variation-settings: normal; font-size: 17px; font-weight: 500; fill: var(--ink-2); }
:is(.plan, .figure) .cap-strong { font-family: var(--font); font-variation-settings: normal; font-size: 21px; font-weight: 750; }
:is(.plan, .figure) .plan-label { font-family: var(--font); font-variation-settings: normal; font-size: 16px; font-weight: 700; letter-spacing: 0.14em; text-anchor: middle; }
:is(.plan, .figure) .note { font-size: 23px; font-weight: 500; }
:is(.plan, .figure) .red-text { fill: var(--red); }
:is(.plan, .figure) .trail { fill: none; stroke: var(--ink-2); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 0.004 0.018; }
:is(.plan, .figure) .walker { fill: var(--sheet); stroke: var(--ink); stroke-width: 2.8; }
:is(.plan, .figure) .zone { stroke-dasharray: 14 10; }
:is(.plan, .figure) .quiet .t-id { fill: var(--ink-2); font-weight: 600; }
:is(.plan, .figure) [data-state="left"] .t-state { fill: var(--ink-2); }
/* heat is hatched on with the blue pen: closer strokes where the room was busier */
.heat { mix-blend-mode: multiply; }
:is(.plan, .figure) .id-plate { fill: var(--sheet); stroke: none; }
.hatch { fill: none; stroke: var(--blue); stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
:is(.plan, .figure) .quiet .table-top, :is(.plan, .figure) .quiet .chair { fill: none; }

/* --------------------------------------------------------------- detail frame */

.detail {
  position: absolute; z-index: 2;
  right: calc(var(--gutter) * -0.2);
  top: clamp(17rem, 23.6vw, 27rem);
  width: clamp(17rem, 26.9vw, 32rem);
  margin: 0; padding: 0.55rem 0.6rem 0.95rem;
  background: var(--laminate); border: var(--rule) solid var(--ink);
}
.detail figcaption { font-size: clamp(0.8rem, 1vw, 1.1rem); font-weight: 800; line-height: 1.3; margin: 0 0 0.45rem 0.1rem; }
.detail img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--ink); background: var(--laminate-lift); }
.detail-note { margin: 0.6rem 0 0 0.1rem; font-size: clamp(0.72rem, 0.86vw, 0.95rem); line-height: 1.3; color: var(--ink-2); }
/* a proof-reader's mark in the red pen: something on the page is still to be confirmed */
.proof { display: inline-block; color: var(--red); font-size: 0.95em; line-height: 1.25; transform: rotate(-1.2deg); }
.colophon .proof { flex-basis: 100%; margin-top: 0.15rem; }
.viewer-note { margin: 0.85rem 0 0; font-size: 0.9375rem; max-width: 60ch; }
.detail.is-marked, .btn.is-marked { outline: 3px solid var(--blue); outline-offset: 4px; }

/* --------------------------------------------------------------- sheet index */

.index {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: var(--rule) solid var(--ink);
  position: relative; z-index: 3;
}
.index a {
  position: relative; display: block;
  padding: clamp(0.6rem, 0.85vw, 1.1rem) 1rem clamp(0.9rem, 2vw, 2.3rem) clamp(1rem, 2.15vw, 2.4rem);
  text-decoration: none; line-height: 1.32;
  font-size: clamp(0.95rem, 1.24vw, 1.4rem);
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.index a:first-child { padding-left: var(--gutter); }
.index a + a::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 18%;
  border-left: var(--rule) solid var(--ink);
}
.index b { display: block; font-weight: 700; font-size: 0.94em; }
.index a:hover, .index a:focus-visible { background: var(--ink); color: var(--laminate); }
.index a:focus-visible { outline-offset: -5px; outline-color: var(--laminate); }

/* -------------------------------------------------------------------- sheets */

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.sheet {
  border-top: 3px solid var(--ink);
  padding: var(--sheet-gap) var(--gutter);
}

.titleblock {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 0.42fr);
  align-items: stretch;
  border: var(--rule) solid var(--ink);
  background: var(--sheet);
  margin-bottom: clamp(2.25rem, 4.2vw, 4rem);
}
.sheet-no {
  display: grid; place-items: center;
  padding: 0 clamp(1rem, 1.9vw, 2rem);
  border-right: var(--rule) solid var(--ink);
  font-weight: 900; font-size: clamp(1.5rem, 2.4vw, 2.5rem); line-height: 1;
}
.titleblock h2 {
  margin: 0; padding: clamp(1rem, 1.8vw, 1.9rem) clamp(1rem, 2vw, 2.1rem);
  font-weight: 900; font-size: clamp(2rem, 3.7vw, 3.75rem);
  line-height: 1.04; letter-spacing: -0.014em; text-wrap: balance;
}
.titleblock h2 span { font-weight: 400; color: var(--ink-2); letter-spacing: -0.008em; }
.asked {
  margin: 0; height: 100%;
  display: grid; align-content: center;
  padding: 0.9rem clamp(1rem, 1.8vw, 1.9rem);
  border-left: var(--rule) solid var(--ink);
  color: var(--blue); font-size: clamp(1.05rem, 1.45vw, 1.5rem); line-height: 1.32;
}

.sheet-body { display: grid; gap: clamp(2rem, 4.6vw, 5rem); align-items: start; }
.sheet-body--figure-left { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.sheet-body--figure-right { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.sheet-body--thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(2rem, 3.4vw, 3.5rem); }
.sheet-body--halves { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: clamp(3rem, 5.5vw, 5.5rem); }
.sheet-body--yours { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }

.figure { margin: 0; }
.figure svg { display: block; width: 100%; height: auto; overflow: visible; }
.figure--wide { margin-inline: auto; max-width: 78rem; }
.figure-stack { display: grid; gap: 1.25rem; }

.prose > * { margin: 0; }
.prose > * + * { margin-top: 1.1rem; }
.prose p { max-width: 34em; text-wrap: pretty; }
.lead { font-size: clamp(1.3rem, 1.85vw, 1.8rem); line-height: 1.34; font-weight: 500; letter-spacing: -0.004em; }
.fine { font-size: 1rem; line-height: 1.5; color: var(--ink-2); }
.block-title, .worked h3, .sites h3, .viewer-text h3, .sent h3 {
  margin: 0; font-weight: 800; font-size: clamp(1.3rem, 1.75vw, 1.7rem); line-height: 1.3; letter-spacing: -0.008em;
}

.ruled, .struck, .alerts { list-style: none; padding: 0; border-bottom: var(--rule) solid var(--ink); max-width: 34em; }
.prose > .ruled, .prose > .struck, .prose > .alerts { margin-top: 1.6rem; }
.ruled li { padding: 0.72rem 0; border-top: var(--rule) solid var(--ink); }

.worked {
  border: var(--rule) solid var(--ink); background: var(--sheet);
  padding: clamp(1.1rem, 1.6vw, 1.6rem);
  max-width: 34em;
}
.prose > .worked { margin-top: 2.2rem; }
.worked p { margin: 0.7rem 0 0; font-size: 1.0625rem; line-height: 1.5; }
.worked .worked-note { font-size: 0.9375rem; color: var(--ink-2); }

.alerts { max-width: 36em; }
.alerts li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: 0.9rem; padding: 0.85rem 0; border-top: var(--rule) solid var(--ink); }
.alerts strong { display: block; font-weight: 700; font-size: 1.1875rem; line-height: 1.3; }
.alerts span { display: block; margin-top: 0.15rem; font-size: 1rem; line-height: 1.45; color: var(--ink-2); }
.ring-mark { width: 1.5rem; height: 1.5rem; margin-top: 0.12rem; }
.ring-mark path { fill: none; stroke: var(--red); stroke-width: 2.2; stroke-linecap: round; }

/* segmented radio groups: the heat key and the camera count */
.heat-key, .cameras { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; }
.heat-key legend, .cameras legend { grid-column: 1 / -1; padding: 0; margin-bottom: 0.55rem; font-weight: 700; }
.heat-key { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cameras { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.heat-key label, .cameras label { position: relative; display: block; margin: 0 -1.5px -1.5px 0; cursor: pointer; }
.heat-key input, .cameras input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.heat-key span, .cameras span {
  display: grid; place-items: center; min-height: 3rem; padding: 0.4rem 0.6rem; text-align: center;
  border: var(--rule) solid var(--ink); background: var(--sheet); line-height: 1.3;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.heat-key label:hover span, .cameras label:hover span { background: var(--blue-wash); }
.heat-key input:checked + span, .cameras input:checked + span { background: var(--ink); color: var(--laminate); font-weight: 700; }
.heat-key input:focus-visible + span, .cameras input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; position: relative; z-index: 1; }

/* ------------------------------------------------------------------ viewer */

.viewer { border: var(--rule) solid var(--ink); background: var(--sheet); }
.viewer-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: var(--rule) solid var(--ink); }
.viewer-tabs button {
  position: relative; text-align: left; cursor: pointer;
  padding: 0.75rem clamp(0.6rem, 1.2vw, 1.25rem) 0.85rem;
  border: 0; border-radius: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: clamp(0.95rem, 1.15vw, 1.2rem); line-height: 1.32;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.viewer-tabs button + button { border-left: var(--rule) solid var(--ink); }
.viewer-tabs b { display: block; font-weight: 800; font-size: 0.9em; }
.viewer-tabs button:hover { background: var(--blue-wash); }
.viewer-tabs button[aria-selected="true"] { background: var(--ink); color: var(--laminate); }
.viewer-tabs button:focus-visible { outline-offset: -5px; }
.viewer-tabs button[aria-selected="true"]:focus-visible { outline-color: var(--laminate); }

.viewer-panel { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.viewer-panel[hidden] { display: none; }
.shot { display: block; width: 100%; padding: 0; border: 0; border-right: var(--rule) solid var(--ink); border-radius: 0; background: var(--ink); cursor: zoom-in; }
.shot img { width: 100%; }
.shot:focus-visible { outline-offset: -6px; }
.viewer-text { padding: clamp(1.25rem, 2.2vw, 2.4rem); align-self: center; }
.viewer-text p { margin: 0.8rem 0 0; max-width: 30em; }

.struck li { padding: 0.62rem 0; border-top: var(--rule) solid var(--ink); }
.struck li > span:last-child {
  text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px;
  font-weight: 600;
}

.sites {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 4vw, 4rem);
  margin-top: clamp(3rem, 5.5vw, 5.5rem); padding: clamp(1.25rem, 2.2vw, 2.4rem);
  border: var(--rule) solid var(--ink); background: var(--sheet);
}
.sites p { margin: 0; max-width: 38em; }

/* ------------------------------------------------------------- your table */

.reserved {
  position: relative;
  border: 3px solid var(--green); background: var(--sheet);
  padding: clamp(1.5rem, 3vw, 3rem);
  margin: 1.75rem 0;
}
.reserved::before, .reserved::after {
  content: ""; position: absolute; left: 34%; width: min(30%, 12rem); height: 1.6rem;
  transform: translateX(-50%);
  border: 3px solid var(--green); background: var(--sheet);
}
.reserved::before { top: -1.75rem; border-bottom: 0; }
.reserved::after { bottom: -1.75rem; border-top: 0; }
.reserved-tag {
  position: absolute; right: 0.75rem; top: -1.45rem; z-index: 1; margin: 0; padding: 0 0.5rem;
  color: var(--green); background: var(--laminate);
  font-size: clamp(1.05rem, 1.4vw, 1.4rem); line-height: 1.3; transform: rotate(-3deg);
}

.pilot { display: grid; gap: 1.15rem; }
.pilot[hidden] { display: none; }
.field { display: grid; gap: 0.4rem; }
.field label, .field legend { font-weight: 700; }
.field input[type="text"], .field input[type="email"] {
  width: 100%; min-height: 3.1rem; padding: 0.6rem 0.8rem;
  border: var(--rule) solid var(--ink); border-radius: 0; background: var(--laminate-lift); color: var(--ink);
  font: inherit; font-size: 1.125rem;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.field input:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.field input[aria-invalid="true"] { border-color: var(--red); box-shadow: inset 0 0 0 1.5px var(--red); }
.error { margin: 0; color: var(--red); font-weight: 600; font-size: 1rem; }
.error[hidden] { display: none; }
.pilot .btn { justify-self: start; margin-top: 0.4rem; }
.form-note { margin: 0; }
.sent { display: grid; gap: 0.9rem; }
.sent[hidden] { display: none; }
.sent p { margin: 0; max-width: 32em; }
.as-button { justify-self: start; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; font-size: 1.0625rem; }

.questions { max-width: 34em; border-bottom: var(--rule) solid var(--ink); }
.prose > .questions { margin-top: 2.6rem; }
.questions .block-title { margin-bottom: 0.9rem; }
.questions details { border-top: var(--rule) solid var(--ink); }
.questions summary {
  position: relative; list-style: none; cursor: pointer;
  padding: 0.8rem 2.4rem 0.8rem 0; font-weight: 700; font-size: 1.125rem;
}
.questions summary::-webkit-details-marker { display: none; }
.questions summary::before, .questions summary::after {
  content: ""; position: absolute; right: 0.35rem; top: 50%; width: 0.95rem; height: 2px; margin-top: -1px;
  background: var(--ink); transition: transform 0.3s var(--ease-out);
}
.questions summary::after { transform: rotate(90deg); }
.questions details[open] summary::after { transform: rotate(0deg); }
.questions summary:hover { color: var(--blue); }
.questions details p { margin: 0 0 1rem; max-width: 32em; }

/* ---------------------------------------------------------------- colophon */

.colophon { border-top: 3px solid var(--ink); background: var(--sheet); }
.colophon-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) minmax(0, 3fr) minmax(0, 3fr); }
.colophon-grid > * { margin: 0; padding: clamp(1.25rem, 2.2vw, 2.4rem) var(--gutter); }
.colophon-grid > * + * { border-left: var(--rule) solid var(--ink); }
.colophon-mark { font-weight: 900; font-size: clamp(1.6rem, 2.6vw, 2.75rem); line-height: 1; letter-spacing: -0.012em; }
.colophon nav { display: grid; gap: 0.35rem; align-content: start; }
.colophon nav a { text-underline-offset: 0.2em; text-decoration-thickness: 1.5px; }
.colophon nav a:hover { color: var(--blue); }
.colophon-nots { font-weight: 700; }

/* -------------------------------------------------------------------- zoom */

.zoom {
  width: min(96vw, 110rem); max-width: none; max-height: 94vh; padding: 0;
  border: var(--rule) solid var(--laminate); background: var(--ink); color: var(--laminate);
}
.zoom::backdrop { background: rgb(11 13 20 / 0.86); }
.zoom-stage img { display: block; width: 100%; height: auto; max-height: calc(94vh - 3.2rem); object-fit: contain; }
.zoom form { display: flex; justify-content: flex-end; border-bottom: 1px solid rgb(241 243 239 / 0.35); }
.zoom-close {
  min-height: 3rem; padding: 0 1.2rem; border: 0; border-radius: 0; cursor: pointer;
  background: transparent; color: var(--laminate); font: inherit; font-weight: 700;
}
.zoom-close:hover { background: var(--laminate); color: var(--ink); }
.zoom-close:focus-visible { outline-color: var(--laminate); outline-offset: -5px; }

/* ---------------------------------------------------------------- responsive */

.compact-note { display: none; }

/* Tablet and small laptops: the cover keeps two columns but the detail frame stops overlapping. */
/* the room sheet: the plan stands alone on the left, and the key that drives it
   sits under the words on the right, so neither column is left half empty */
@media (min-width: 901px) {
  .sheet--room .figure-stack { display: contents; }
  .sheet--room .sheet-body { grid-template-rows: auto 1fr; row-gap: clamp(1.75rem, 2.6vw, 2.75rem); }
  .sheet--room .figure { grid-column: 1; grid-row: 1 / span 2; }
  .sheet--room .prose { grid-column: 2; grid-row: 1; }
  .sheet--room .heat-key { grid-column: 2; grid-row: 2; align-self: start; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .sheet-body--thirds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-body--thirds > .worked { grid-column: 1 / -1; max-width: none; }
  .colophon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .colophon-grid > *:nth-child(3) { border-left: 0; }
  .colophon-grid > *:nth-child(n + 3) { border-top: var(--rule) solid var(--ink); }
  .titleblock { grid-template-columns: auto minmax(0, 1fr); }
  .asked { grid-column: 1 / -1; border-left: 0; border-top: var(--rule) solid var(--ink); height: auto; }
}

@media (max-width: 900px) {
  .cover { grid-template-columns: minmax(0, 1fr); min-height: 0; row-gap: clamp(1.5rem, 5vw, 2.5rem); padding-bottom: clamp(2rem, 6vw, 3rem); }
  .cover h1 { font-size: clamp(2.2rem, 11.2vw, 5rem); }
  .lede { max-width: 30em; margin-top: clamp(1.75rem, 6vw, 2.75rem); font-size: clamp(1.15rem, 3.4vw, 1.5rem); }
  .btn { font-size: clamp(1.15rem, 3.4vw, 1.45rem); min-height: 3.25rem; padding: 0 1.6rem; }
  .textlink { font-size: clamp(1.05rem, 3vw, 1.25rem); }
  .cover-plan { padding-top: 0; }
  .plan { width: 100%; }
  .sample-note { position: static; transform: rotate(-3deg); margin: 0.9rem 0 0; font-size: 1.15rem; }
  .detail { position: static; width: 100%; margin-top: 1.5rem; }
  .detail figcaption { font-size: 1rem; }
  .detail-note { font-size: 0.9375rem; }
  .index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .index a { font-size: 1.0625rem; padding: 0.85rem var(--gutter) 1rem; }
  .index a:nth-child(n + 4) { border-top: var(--rule) solid var(--ink); }
  .index a:nth-child(4)::before { display: none; }
  .index a + a::before { bottom: 0; }

  .sheet-body--figure-left, .sheet-body--figure-right, .sheet-body--halves,
  .sheet-body--yours, .sheet-body--thirds { grid-template-columns: minmax(0, 1fr); }
  .sheet-body--figure-right .figure { order: -1; }
  .viewer-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .viewer-tabs button:nth-child(4) { border-left: 0; }
  .viewer-tabs button:nth-child(n + 4) { border-top: var(--rule) solid var(--ink); }
  .viewer-panel { grid-template-columns: minmax(0, 1fr); }
  .shot { border-right: 0; border-bottom: var(--rule) solid var(--ink); }
  .sites { grid-template-columns: minmax(0, 1fr); gap: 0.9rem; }
  .compact-note { display: block; margin: 0.8rem 0 0; color: var(--blue); font-size: 1.15rem; line-height: 1.35; }
}

@media (max-width: 760px) {
  .masthead { height: 4rem; padding-inline: var(--gutter); }
  .wordmark { font-size: 1.7rem; }
  .key-toggle { display: inline-block; min-height: 2.75rem; }
  .nav { position: static; }
  .nav ul {
    display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 9;
    flex-direction: column; gap: 0;
    background: var(--sheet); border-bottom: 3px solid var(--ink);
  }
  .nav ul.is-open { display: flex; }
  .nav li + li { border-top: var(--rule) solid var(--ink); }
  .nav a { display: block; padding: 0.95rem var(--gutter); font-size: 1.125rem; letter-spacing: 0; }
  .nav a::after { display: none; }
  .nav a:hover, .nav a[aria-current="true"] { background: var(--blue-wash); }

  .titleblock h2 { font-size: clamp(1.75rem, 8vw, 2.5rem); padding: 0.9rem 1rem; }
  .sheet-no { font-size: 1.4rem; padding: 0 0.9rem; }
  .asked { font-size: 1.15rem; padding: 0.8rem 1rem; }
  .lead { font-size: 1.3rem; }
  .heat-key { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cameras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reserved { padding: 1.25rem; }
  .reserved-tag { right: 0.4rem; font-size: 1.05rem; }
  .colophon-grid { grid-template-columns: minmax(0, 1fr); }
  .colophon-grid > * + * { border-left: 0; border-top: var(--rule) solid var(--ink); }
  .zoom { width: 100vw; max-height: 100vh; border-inline: 0; }
}

@media (max-width: 480px) {
  .index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index a:nth-child(n + 3) { border-top: var(--rule) solid var(--ink); }
  .index a:nth-child(4)::before { display: block; }
  .index a:nth-child(odd)::before { display: none; }
  .viewer-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viewer-tabs button:nth-child(4) { border-left: var(--rule) solid var(--ink); }
  .viewer-tabs button:nth-child(odd) { border-left: 0; }
  .viewer-tabs button:nth-child(n + 3) { border-top: var(--rule) solid var(--ink); }
}

/* Very wide screens: hold the measure rather than stretching the drawing forever. */
@media (min-width: 1800px) {
  :root { --gutter: calc((100vw - 1700px) / 2); }
}

/* Phone drawings are redrawn on a smaller sheet, so their lettering is set larger in drawing units. */
@media (max-width: 760px) {
  :is(.plan, .figure) .t-state { font-size: 17.5px; }
  :is(.plan, .figure) [data-state="uncleared"] .t-state { font-size: 15px; }
  :is(.plan, .figure) .axis { font-size: 20px; }
  :is(.plan, .figure) .cap { font-size: 23px; }
  :is(.plan, .figure) .cap-strong { font-size: 28px; }
  :is(.plan, .figure) .plan-label { font-size: 22px; }
  :is(.plan, .figure) .note { font-size: 30px; }
  :is(.plan, .figure) .q-label, :is(.plan, .figure) .q-count { font-size: 30px; }
  .plan .q-label, .plan .q-count { font-size: 25px; }
}

/* -------------------------------------------------------------------- motion
   Grammar: marker strokes draw on, fills scribble in, counts tick.
   Everything is visible by default. These rules only hold things back,
   briefly, when script is running and the visitor has not asked for less motion. */

.bar { transform-box: fill-box; transform-origin: center bottom; }
.joiner { transform-box: fill-box; transform-origin: center; }
.flow { stroke-dasharray: 1; stroke-dashoffset: 0; }

@media (prefers-reduced-motion: no-preference) {
  .js .marked path { stroke-dashoffset: 1; }
  .js .is-ready .marked path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.9s 0.25s var(--ease-out); }

  /* cover: the three sittings scribble in, one after another */
  .js body:not(.is-ready) .plan [data-state="occupied"] .scribble { stroke-dashoffset: 1; opacity: 0; }
  .js .plan .table:nth-child(1) .scribble { transition-delay: 0.45s; }
  .js .plan .table:nth-child(3) .scribble { transition-delay: 0.62s; }
  .js .plan .table:nth-child(7) .scribble { transition-delay: 0.79s; }
  .js .is-live .plan .table .scribble { transition-delay: 0s; }

  /* 01 the door: the hours rise from the floor */
  .js .figure:not(.is-seen) .bar { transform: scaleY(0); }
  .bar { transition: transform 0.85s var(--ease-out); transition-delay: calc(var(--i) * 32ms + 120ms); }

  /* 02 the queue: six people join, one at a time */
  .js .figure:not(.is-seen) .joiner { opacity: 0; transform: scale(0.2); }
  .joiner { transition: opacity 0.3s linear, transform 0.5s var(--ease-out); transition-delay: calc(var(--i) * 130ms + 200ms); }

  /* 03 the tables: the arrows are drawn in the order things happen */
  .js .figure:not(.is-seen) .flow { stroke-dashoffset: 1; }
  .flow { transition: stroke-dashoffset 0.75s var(--ease-out); transition-delay: calc(var(--i) * 300ms + 200ms); }
  .hatch { transition: stroke-dashoffset 0.95s var(--ease-out); transition-delay: calc(var(--i) * 110ms); }
  .js .figure:not(.is-seen) [data-state="occupied"] .scribble { stroke-dashoffset: 1; opacity: 0; }
  .figure [data-state="occupied"] .scribble { transition-delay: 0.55s; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  :is(.plan, .figure) .scribble, .plan .ring, :is(.plan, .figure) .queue-dot, .hatch, .btn, .nav a::after, .index a,
  .bar, .joiner, .flow, .questions summary::before, .questions summary::after { transition: none; }
  .plan .arrow.is-ticking { animation: none; }
}

/* Capture mode (?still): everything in its settled state, nothing moving. */
.is-still *, .is-still *::before, .is-still *::after { transition: none !important; animation: none !important; }
.is-still .marked path { stroke-dashoffset: 0 !important; }

html.is-still { scroll-behavior: auto; }

/* Full-page capture mode (?page): the cover keeps a first-viewport height in a tall window. */
.is-page .cover { min-height: 42.6vw; }
