/*
  Primary Forms: exhibition website (Screenery template)
  The page is built from three primaries, black and an off-white ground. Circles, squares, triangles and thick bars are the layout,
  not decoration: the hero is a movable composition, the dividers are its shapes, the floor plan is drawn from them.

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Shared pieces: wrap, headings, side titles (rotated type), buttons, icons, dividers
   4. Header and menu
   5. Hero: title, stage, shapes, tools
   6. The exhibition
   7. Rooms: floor plan and panels
   8. Works timeline
   9. Programme: tabs and events
  10. Tickets: calendar, slots, steppers, fields, summary, success stub
  11. Visit: hours, access, map
  12. Shop
  13. Questions
  14. Footer
  15. Motion
  16. Narrow screens
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* The palette: three primaries, black, off-white */
  --paper: #f3eee3;
  --ink: #161514;
  --red: #c8261b;
  --yellow: #f2bb1a;
  --blue: #1f4ea1;

  /* Derived tones */
  --paper-deep: color-mix(in srgb, var(--ink) 8%, var(--paper));    /* wells, hover on paper */
  --ink-soft: color-mix(in srgb, var(--ink) 80%, var(--paper));      /* secondary text on paper and yellow (7:1+) */
  --grid-line: color-mix(in srgb, var(--ink) 12%, var(--paper));     /* the stage grid */
  --paper-on-blue: var(--paper);                                    /* text on blue: paper only */
  --paper-on-red: var(--paper);                                     /* text on red: paper only (4.8:1) */
  --red-tint: color-mix(in srgb, var(--red) 22%, var(--paper));
  --yellow-tint: color-mix(in srgb, var(--yellow) 34%, var(--paper));
  --blue-tint: color-mix(in srgb, var(--blue) 24%, var(--paper));
  --red-ink: color-mix(in srgb, var(--red) 82%, var(--ink));         /* red text on yellow (4.5:1+) */

  /* The shapes' colours, mirrored from the hero composition by script.js (dividers follow the visitor's choices) */
  --c-sun: var(--red);
  --c-block: var(--yellow);
  --c-beam: var(--ink);
  --c-peak: var(--blue);
  --c-dome: var(--blue);
  --c-fan: var(--ink);
  --c-dot: var(--ink);
  --c-rod: var(--red);

  /* Type */
  --display: "Lexend Zetta", "Lexend", "Futura", "Century Gothic", sans-serif;
  --sans: "Lexend", "Futura", "Century Gothic", "Avenir Next", sans-serif;

  --fs-xs: 0.8125rem;   /* 13 */
  --fs-sm: 0.9375rem;   /* 15 */
  --fs-md: 1.0625rem;   /* 17, body */
  --fs-lg: 1.25rem;     /* 20 */
  --fs-xl: clamp(1.375rem, 1.1rem + 0.9vw, 1.875rem);
  --fs-h3: 1.375rem;
  --fs-h2: clamp(1.75rem, 1rem + 2.6vw, 3.25rem);
  --fs-h1: clamp(2.1rem, 0.4rem + 4.4vw, 4.6rem);

  /* Space (a 4px base, then the grid's own unit) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --gutter: clamp(16px, 3.2vw, 48px);
  --max: 1360px;

  /* Lines and radii: geometry is sharp. The only round things are circles. */
  --line: 2px;
  --bar: 12px;
  --radius: 0;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);   /* exponential-feel ease-out */
  --t-fast: 160ms;
  --t-mid: 320ms;
  --t-slow: 700ms;

  --header-h: 68px;
  color-scheme: light;
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--ink) var(--paper-deep);
  accent-color: var(--red);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-md);
  font-weight: 350;
  line-height: 1.6;
  caret-color: var(--red);
  overflow-x: clip;
}

::selection { background: var(--yellow); color: var(--ink); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper-deep); }
::-webkit-scrollbar-thumb { background: var(--ink); border: 3px solid var(--paper-deep); }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 700; line-height: 1.1; text-wrap: balance; }
p { text-wrap: pretty; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--red); }

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

table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
output, .tnum { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

.skip {
  position: fixed; left: var(--s-4); top: -60px; z-index: 100;
  padding: var(--s-3) var(--s-4); background: var(--ink); color: var(--paper); font-weight: 600;
}
.skip:focus { top: var(--s-4); }

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter;
}

/* ---------- 3. Shared pieces ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

.h2 {
  font-family: var(--display);
  font-size: var(--fs-h2);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1.05;
}
.h3 { font-size: var(--fs-h3); font-weight: 600; margin-bottom: var(--s-4); }
.small { font-size: var(--fs-sm); color: var(--ink-soft); margin-top: var(--s-4); }

/* Section head: heading on the left, a short paragraph on the right, sitting on one thick bar */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--s-5) var(--s-7);
  align-items: end;
  padding-bottom: var(--s-5);
  margin-bottom: var(--s-7);
  border-bottom: var(--bar) solid var(--ink);
}
.section-head p { max-width: 46ch; color: var(--ink-soft); }

/* Rotated type: the heading itself runs up the left edge in a black column */
.side-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.5rem, 0.8rem + 2vw, 2.75rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--s-5) var(--s-3);
}
.side-title span { background: inherit; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.side-title--paper { background: var(--paper); color: var(--ink); }

/* Buttons: square, flat, thick */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5);
  border: var(--line) solid var(--ink); border-radius: var(--radius);
  font-weight: 600; font-size: var(--fs-sm); text-decoration: none; letter-spacing: 0.01em;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn--red { background: var(--red); color: var(--paper); border-color: var(--red); }
.btn--red:hover { background: var(--ink); border-color: var(--ink); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--red); border-color: var(--red); }
.btn--line { background: transparent; color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }
.btn--paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--paper:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--paper[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--wide { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: progress; }

.link-arrow {
  display: inline-flex; align-items: center; min-height: 48px; font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--yellow);
}
.link-arrow:hover { text-decoration-color: var(--red); }

/* Dividers: rows of the hero's shapes, coloured by the hero's current colours */
.divider { padding: var(--s-6) var(--gutter); }
.divider svg { width: 100%; height: clamp(40px, 5vw, 70px); }
.d-sun { fill: var(--c-sun); }
.d-block { fill: var(--c-block); }
.d-beam { fill: var(--c-beam); }
.d-peak { fill: var(--c-peak); }
.d-dome { fill: var(--c-dome); }
.d-fan { fill: var(--c-fan); }
.d-dot { fill: var(--c-dot); }
.d-rod { fill: var(--c-rod); }
.d-sun, .d-block, .d-beam, .d-peak, .d-dome, .d-fan, .d-dot, .d-rod { transition: fill var(--t-mid) var(--ease-out); }

/* Drawing fills shared by timeline, stub, catalogue */
.a-paper { fill: var(--paper); }
.a-ink { fill: var(--ink); }
.a-red { fill: var(--red); }
.a-yellow { fill: var(--yellow); }
.a-blue { fill: var(--blue); }
.a-line { fill: none; stroke: var(--ink); stroke-width: 5; }
.a-tube { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linejoin: round; }

/* ---------- 4. Header and menu ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 4px solid var(--ink);
}
.top__in {
  width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto;
  height: var(--header-h);
  display: flex; align-items: center; gap: var(--s-5);
}
.mark { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; margin-right: auto; }
.mark__shapes { width: 48px; height: 32px; }
.mark__name { font-size: var(--fs-xs); font-weight: 600; line-height: 1.2; text-transform: uppercase; letter-spacing: 0.08em; }
.nav ul { display: flex; gap: var(--s-1); }
.nav a {
  display: flex; align-items: center; min-height: 44px; padding: 0 var(--s-3);
  font-size: var(--fs-sm); font-weight: 500; text-decoration: none;
  border-bottom: 4px solid transparent; margin-bottom: -4px;
}
.nav a:hover { border-bottom-color: var(--red); }
.nav a[aria-current="true"] { border-bottom-color: var(--ink); }
.top__cta { min-height: 44px; }
.menu-btn {
  display: none; align-items: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-3);
  background: none; border: var(--line) solid var(--ink); font-weight: 600; font-size: var(--fs-sm);
}

/* ---------- 5. Hero ---------- */
.hero {
  width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--s-7);
  align-items: center;
  padding-block: var(--s-7) var(--s-6);
  min-height: calc(100svh - var(--header-h));
}
.hero__title {
  width: fit-content;
  font-family: var(--display);
  font-size: var(--fs-h1);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.hero__title span { display: block; }
.hero__title span + span {
  margin-top: 0.12em; padding-top: 0.14em;
  border-top: 0.16em solid var(--red);
}
.hero__sub { margin-top: var(--s-6); font-size: var(--fs-xl); font-weight: 300; line-height: 1.35; max-width: 30ch; }
.hero__facts { margin-top: var(--s-6); display: grid; gap: 0; border-top: var(--line) solid var(--ink); max-width: 34rem; }
.hero__facts div { display: grid; grid-template-columns: 5.5rem 1fr; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: var(--line) solid var(--ink); }
.hero__facts dt { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; padding-top: 0.2em; }
.hero__facts dd { font-size: var(--fs-sm); }
.hero__actions { margin-top: var(--s-6); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); }

.hero__stage { display: grid; justify-items: center; gap: var(--s-4); min-width: 0; container-type: inline-size; }
.stage-row { display: flex; align-items: stretch; max-width: 100%; }

/* The stage: a strict grid. --cols/--rows are set by script.js per layout (8 x 8 landscape, 6 x 8 portrait). */
.stage {
  --cols: 8;
  --rows: 8;
  position: relative;
  aspect-ratio: var(--cols) / var(--rows);
  width: min(100cqw - 44px, calc((100svh - var(--header-h) - 210px) * var(--cols) / var(--rows)));
  min-width: min(100cqw - 44px, 300px);
  overflow: clip;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: calc(100% / var(--cols)) calc(100% / var(--rows));
  outline: var(--line) solid var(--ink);
  touch-action: pan-y;
}
.stage.is-dragging { background-color: var(--paper-deep); }

.shape {
  position: absolute;
  left: calc(var(--x) / var(--cols) * 100%);
  top: calc(var(--y) / var(--rows) * 100%);
  width: calc(var(--w) / var(--cols) * 100%);
  height: calc(var(--h) / var(--rows) * 100%);
  transform: rotate(calc(var(--r) * 1deg));
  padding: 0; margin: 0; border: 0; background: none;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  min-width: 24px; min-height: 24px; /* thin bars stay a usable touch target on phones */
}
.shape svg { width: 100%; height: 100%; overflow: visible; transition: fill var(--t-mid) var(--ease-out); }
.shape[data-color="red"] svg { fill: var(--red); }
.shape[data-color="yellow"] svg { fill: var(--yellow); }
.shape[data-color="blue"] svg { fill: var(--blue); }
.shape[data-color="black"] svg { fill: var(--ink); }
.shape.is-held { cursor: grabbing; filter: drop-shadow(0 10px 14px rgb(22 21 20 / 0.28)); }
.shape:focus-visible, .shape.is-selected {
  outline: 3px dashed var(--ink);
  outline-offset: 5px;
}
.shape:focus-visible { outline-style: solid; outline-color: var(--blue); }
.stage.is-settling .shape {
  transition:
    left var(--t-slow) var(--ease-out), top var(--t-slow) var(--ease-out),
    width var(--t-slow) var(--ease-out), height var(--t-slow) var(--ease-out),
    transform var(--t-slow) var(--ease-out);
}
.shape.is-turning { transition: transform var(--t-mid) var(--ease-out), left 120ms linear, top 120ms linear; }

/* Rotated type in a black bar beside the stage */
.stage__label {
  flex: none; width: 44px;
  display: flex; justify-content: center; align-items: flex-start;
  writing-mode: vertical-rl; transform: rotate(180deg);
  padding: var(--s-4) 0;
  background: var(--ink); color: var(--paper);
  font-family: var(--display); font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden;
}

/* Tools under the stage */
.tools { width: 100%; max-width: 46rem; display: grid; gap: var(--s-3); }
.tools__state { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-4); font-size: var(--fs-sm); }
.tools__state [data-comp-name] { font-weight: 600; }
.tools__sel { color: var(--ink-soft); }
.tools__row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.tools__gap { flex: 1 1 0; }
.tool {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-4);
  background: var(--paper); border: var(--line) solid var(--ink);
  font-size: var(--fs-sm); font-weight: 500;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.tool:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.tool:disabled { cursor: not-allowed; border-color: var(--grid-line); color: var(--ink-soft); background: var(--paper-deep); }
.tools__help { font-size: var(--fs-xs); color: var(--ink-soft); max-width: 70ch; }
html:not(.js) .tools { display: none; }

/* ---------- 6. The exhibition ---------- */
.intro { position: relative; padding-block: var(--s-6) var(--s-9); overflow: clip; }
.intro__grid {
  position: relative;
  display: grid;
  grid-template-columns: 7rem minmax(0, 7fr) minmax(0, 4fr);
  gap: var(--s-7);
  align-items: start;
}
.intro .side-title { grid-row: 1 / span 2; align-self: stretch; min-height: 30rem; }
.intro__body { display: grid; gap: var(--s-5); max-width: 68ch; position: relative; z-index: 1; }
.lead { font-size: var(--fs-xl); font-weight: 300; line-height: 1.4; }
.lead::first-line { font-weight: 500; }
.intro__facts { position: relative; z-index: 1; display: grid; border-top: var(--bar) solid var(--blue); background: var(--paper); }
.intro__facts div { padding: var(--s-4) 0; border-bottom: var(--line) solid var(--ink); }
.intro__facts dt { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.intro__facts dd { margin-top: var(--s-1); font-size: var(--fs-lg); line-height: 1.35; }
.intro__shape { position: absolute; right: -9rem; bottom: -14rem; width: 26rem; z-index: 0; opacity: 1; }
.intro__shape svg { width: 100%; height: auto; }

/* ---------- 7. Rooms ---------- */
.rooms { padding-block: var(--s-9) var(--s-7); }
.rooms__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-7); align-items: start; }
.plan__svg { width: 100%; height: auto; overflow: visible; }
.plan__wall { fill: var(--paper); stroke: var(--ink); stroke-width: 10; }
.plan__corridor { fill: var(--paper-deep); }
.plan__foyer rect { fill: var(--ink); }
.plan__foyer text { fill: var(--paper); font-family: var(--sans); font-size: 26px; font-weight: 600; }
.plan__foyer .plan__small { font-size: 18px; font-weight: 400; }
.plan__route { fill: none; stroke: var(--ink); stroke-width: 3; stroke-dasharray: 2 10; stroke-linecap: square; pointer-events: none; }
.plan__hint { margin-top: var(--s-3); font-size: var(--fs-xs); color: var(--ink-soft); }
html:not(.js) .plan__hint { display: none; }

.room { cursor: pointer; outline: none; }
.room > rect, .room > circle, .room > path { stroke: var(--ink); stroke-width: 6; transition: fill var(--t-mid) var(--ease-out); }
.room[data-tone="red"] > :first-child { fill: var(--red-tint); }
.room[data-tone="yellow"] > :first-child { fill: var(--yellow-tint); }
.room[data-tone="blue"] > :first-child { fill: var(--blue-tint); }
.room text { fill: var(--ink); font-family: var(--sans); pointer-events: none; }
.room__no { font-family: var(--display); font-size: 56px; font-weight: 900; }
.room__name { font-size: 22px; font-weight: 600; }
.room:hover > :first-child { fill: var(--paper-deep); }
.room[aria-pressed="true"][data-tone="red"] > :first-child { fill: var(--red); }
.room[aria-pressed="true"][data-tone="yellow"] > :first-child { fill: var(--yellow); }
.room[aria-pressed="true"][data-tone="blue"] > :first-child { fill: var(--blue); }
.room[aria-pressed="true"][data-tone="red"] text,
.room[aria-pressed="true"][data-tone="blue"] text { fill: var(--paper); }
.room:focus-visible > :first-child { stroke: var(--blue); stroke-width: 12; }
.room[aria-pressed="true"][data-tone="blue"]:focus-visible > :first-child { stroke: var(--ink); }

.room-panels { display: grid; gap: var(--s-5); }
.room-panel { border: var(--line) solid var(--ink); background: var(--paper); outline: none; }
.room-panel__head { padding: var(--s-5); background: var(--ink); color: var(--paper); }
.room-panel[data-tone="red"] .room-panel__head { background: var(--red); }
.room-panel[data-tone="blue"] .room-panel__head { background: var(--blue); }
.room-panel[data-tone="yellow"] .room-panel__head { background: var(--yellow); color: var(--ink); }
.room-panel__stop { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.room-panel h3 { margin-top: var(--s-2); font-family: var(--display); font-size: clamp(1.25rem, 0.9rem + 1vw, 1.75rem); font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; }
.room-panel > p, .room-panel__list { padding: var(--s-5) var(--s-5) 0; }
.room-panel__list { display: grid; gap: var(--s-2); }
.room-panel__list li { position: relative; padding-left: 24px; font-size: var(--fs-sm); }
.room-panel__list li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 10px; height: 10px; background: var(--ink); }
.room-panel__list b { font-weight: 600; }
.room-panel__meta { display: flex; flex-wrap: wrap; gap: var(--s-2); padding: var(--s-5) !important; font-size: var(--fs-xs); font-weight: 600; }
.room-panel__meta span { padding: var(--s-1) var(--s-3); border: var(--line) solid var(--ink); }
.room-panel:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.room-nav { display: flex; justify-content: space-between; gap: var(--s-3); }
.room-nav .btn { padding: 0 var(--s-4); }
html.js .room-panels { gap: var(--s-4); }

/* ---------- 8. Works timeline (blue ground) ---------- */
.works { background: var(--blue); color: var(--paper); padding-block: var(--s-9); }
.works__grid { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--s-7); }
.works .side-title { align-self: start; position: sticky; top: calc(var(--header-h) + var(--s-5)); min-height: 36rem; }
/* Two staggered columns: each work spans two rows, the right column starts one row lower */
.timeline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-5) var(--s-7); }
.work {
  grid-column: 1;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: var(--s-3) var(--s-5);
}
.work:nth-child(even) { grid-column: 2; }
.work:nth-child(1) { grid-row: 1 / span 2; }   .work:nth-child(2) { grid-row: 2 / span 2; }
.work:nth-child(3) { grid-row: 3 / span 2; }   .work:nth-child(4) { grid-row: 4 / span 2; }
.work:nth-child(5) { grid-row: 5 / span 2; }   .work:nth-child(6) { grid-row: 6 / span 2; }
.work:nth-child(7) { grid-row: 7 / span 2; }   .work:nth-child(8) { grid-row: 8 / span 2; }
.work:nth-child(9) { grid-row: 9 / span 2; }   .work:nth-child(10) { grid-row: 10 / span 2; }
.work__year {
  grid-column: 1 / -1;
  font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 1.2rem + 2.4vw, 3.5rem); line-height: 1;
  color: var(--yellow);
  letter-spacing: -0.03em;
  padding-bottom: var(--s-3);
  border-bottom: var(--bar) solid var(--yellow);
}
.work__art { width: 120px; height: 150px; }
.work__text h3 { font-size: var(--fs-lg); font-weight: 600; }
.work__text p { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--paper-on-blue); max-width: 52ch; }
.work__text .work__room {
  display: inline-block; margin-top: var(--s-3); padding: 2px var(--s-3);
  background: var(--paper); color: var(--ink); font-size: var(--fs-xs); font-weight: 600;
}
.work--now .work__year { color: var(--paper); border-bottom-color: var(--red); }

/* ---------- 9. Programme ---------- */
.programme { padding-block: var(--s-9) var(--s-6); }
.tabs { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: var(--s-5); border: var(--line) solid var(--ink); width: fit-content; max-width: 100%; }
.tab {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-4);
  background: var(--paper); border: 0; border-right: var(--line) solid var(--ink);
  font-size: var(--fs-sm); font-weight: 600;
}
.tab:last-child { border-right: 0; }
.tab:hover { background: var(--paper-deep); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tab__n { font-weight: 400; font-variant-numeric: tabular-nums; opacity: 0.85; }
.tab__shape { width: 14px; height: 14px; flex: none; }
.tab__shape--circle { border-radius: 50%; background: var(--red); }
.tab__shape--square { background: var(--blue); }
.tab__shape--triangle { background: var(--yellow); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tab__shape--half { background: currentColor; height: 7px; border-radius: 7px 7px 0 0; }
.tab[aria-selected="true"] .tab__shape--half { background: var(--paper); }

.events { border-top: var(--bar) solid var(--ink); }
.event {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 15rem auto;
  gap: var(--s-5);
  align-items: center;
  padding: var(--s-5) 0;
  border-bottom: var(--line) solid var(--ink);
}
.event__date {
  position: relative;
  display: grid; place-content: center; text-align: center;
  width: 6.5rem; height: 6.5rem;
  font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  line-height: 1.25;
}
.event__date b { display: block; font-family: var(--display); font-size: 2rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.event__date span { display: block; margin-top: 2px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.event[data-type="talk"] .event__date { background: var(--red); color: var(--paper); border-radius: 50%; }
.event[data-type="workshop"] .event__date { background: var(--blue); color: var(--paper); }
.event[data-type="tour"] .event__date { background: var(--yellow); color: var(--ink); clip-path: polygon(50% 0, 100% 100%, 0 100%); padding-top: 2.4rem; }
.event[data-type="tour"] .event__date b { font-size: 1.5rem; }
.event[data-type="tour"] .event__date span { font-size: 0.75rem; }
.event[data-type="family"] .event__date { background: var(--ink); color: var(--paper); border-radius: 3.25rem 3.25rem 0 0; }
.event__body h3 { font-size: var(--fs-lg); font-weight: 600; }
.event__body p { margin-top: var(--s-1); color: var(--ink-soft); font-size: var(--fs-sm); max-width: 60ch; }
.event__meta { display: grid; gap: 2px; font-size: var(--fs-sm); }
.event__meta span:first-child { font-weight: 600; }
.event__btn { white-space: nowrap; }
.event.is-past .event__date { background: var(--paper-deep) !important; color: var(--ink) !important; }
.event__btn:disabled { cursor: not-allowed; border-style: dashed; }
.events__empty { padding: var(--s-6) 0; color: var(--ink-soft); }

/* ---------- 10. Tickets (yellow ground) ---------- */
.tickets { background: var(--yellow); padding-block: var(--s-9); }
.section-head--ink { border-bottom-color: var(--ink); }
.section-head--ink p { color: var(--ink); }

.booking {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(18rem, 22rem);
  grid-template-areas:
    "alert alert alert"
    "cal time sum"
    "people who sum";
  gap: var(--s-5);
  align-items: start;
}
.booking__alert { grid-area: alert; }
.step--cal { grid-area: cal; }
.step--time { grid-area: time; }
.step--people { grid-area: people; }
.step--who { grid-area: who; }
.summary { grid-area: sum; position: sticky; top: calc(var(--header-h) + var(--s-5)); }

.step {
  margin: 0; min-width: 0;
  padding: var(--s-5);
  background: var(--paper);
  border: var(--line) solid var(--ink);
  align-self: stretch;
}
.step__title {
  display: flex; align-items: center; gap: var(--s-3);
  float: left; width: 100%;
  padding: 0; margin-bottom: var(--s-4);
  font-size: var(--fs-lg); font-weight: 600;
}
.step__title + * { clear: both; }
.step__shape { width: 18px; height: 18px; flex: none; background: var(--ink); }
.step__shape--circle { border-radius: 50%; background: var(--red); }
.step__shape--square { background: var(--blue); }
.step__shape--triangle { background: var(--ink); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.step__shape--half { height: 9px; border-radius: 9px 9px 0 0; background: var(--red); }
.step__note { font-size: var(--fs-sm); color: var(--ink-soft); margin-bottom: var(--s-4); }
.step__note:last-child { margin: var(--s-4) 0 0; }
.step.has-error { border-color: var(--red); box-shadow: 0 0 0 2px var(--red); }

/* Calendar */
.cal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.cal__month { font-weight: 600; font-size: var(--fs-md); }
.cal__nav {
  display: grid; place-items: center; width: 44px; height: 44px;
  background: var(--paper); border: var(--line) solid var(--ink);
}
.cal__nav:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.cal__nav:disabled { border-color: var(--grid-line); color: var(--grid-line); cursor: not-allowed; }
.cal__grid { display: grid; gap: 4px; }
.cal__row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal__dow { font-size: var(--fs-xs); font-weight: 600; text-align: center; padding-bottom: var(--s-1); }
.cal__cell { display: block; }
.day {
  position: relative;
  width: 100%; aspect-ratio: 1; min-height: 40px;
  display: grid; place-items: center;
  padding: 0;
  background: var(--paper); border: var(--line) solid var(--ink);
  font-weight: 500; font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.day::after {
  content: ""; position: absolute; left: 4px; right: 4px; bottom: 4px; height: 4px; background: var(--blue);
}
.day[data-level="busy"]::after { background: var(--red); }
.day[data-level="full"]::after { background: var(--ink); height: 2px; bottom: 50%; left: 2px; right: 2px; transform: rotate(-35deg); }
.day:hover:not([aria-disabled="true"]) { background: var(--paper-deep); }
.day[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.day[aria-pressed="true"]::after { background: var(--yellow); }
.day[data-today]::before { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.day[aria-disabled="true"] { cursor: not-allowed; border-color: transparent; background: transparent; color: color-mix(in srgb, var(--ink) 45%, var(--paper)); }
.day[aria-disabled="true"]::after { display: none; }
.day[data-level="full"]:not([aria-pressed="true"]) { background: var(--paper-deep); }
.cal__blank { aspect-ratio: 1; }
.cal__key { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin-top: var(--s-4); font-size: var(--fs-xs); }
.cal__key li { display: inline-flex; align-items: center; gap: var(--s-2); }
.key { width: 16px; height: 4px; background: var(--blue); }
.key--busy { background: var(--red); }
.key--full { background: var(--ink); height: 2px; transform: rotate(-35deg); }
.cal__noscript { margin-top: var(--s-4); font-weight: 500; }

/* Time slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: var(--s-2); }
.slot { position: relative; display: block; }
.slot input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.slot__box {
  display: grid; gap: 2px; padding: var(--s-2) var(--s-3) var(--s-3);
  min-height: 64px;
  border: var(--line) solid var(--ink); background: var(--paper);
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.slot__time { font-weight: 600; font-variant-numeric: tabular-nums; }
.slot__left { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.slot__bar { height: 4px; background: var(--paper-deep); margin-top: 4px; }
.slot__bar i { display: block; height: 100%; background: var(--blue); width: calc(var(--taken) * 100%); }
.slot[data-low] .slot__bar i { background: var(--red); }
.slot:hover input:not(:disabled) + .slot__box { background: var(--paper-deep); }
.slot input:checked + .slot__box { background: var(--ink); color: var(--paper); }
.slot input:checked + .slot__box .slot__bar { background: color-mix(in srgb, var(--paper) 25%, var(--ink)); }
.slot input:checked + .slot__box .slot__bar i { background: var(--yellow); }
.slot input:focus-visible + .slot__box { outline: 3px solid var(--blue); outline-offset: 3px; }
.slot input:disabled { cursor: not-allowed; }
.slot input:disabled + .slot__box .slot__bar i { background: var(--ink-soft); }
.slot input:disabled + .slot__box { background: var(--paper-deep); border-color: var(--paper-deep); color: var(--ink-soft); text-decoration: line-through; text-decoration-thickness: 2px; }
.slots__empty { grid-column: 1 / -1; display: grid; place-items: center; min-height: 12rem; padding: var(--s-5); border: var(--line) dashed var(--ink); font-size: var(--fs-sm); text-align: center; color: var(--ink-soft); }
.slots__empty svg { width: 64px; height: 32px; margin: 0 auto var(--s-3); }

/* Ticket types and steppers */
.types { display: grid; }
.type {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-3) 0; border-bottom: var(--line) solid var(--ink);
}
.type:first-child { border-top: var(--line) solid var(--ink); }
.type__name { font-weight: 600; }
.type__note { font-size: var(--fs-xs); color: var(--ink-soft); max-width: 28ch; }
.stepper { display: flex; align-items: center; border: var(--line) solid var(--ink); flex: none; }
.stepper__btn { display: grid; place-items: center; width: 44px; height: 44px; background: var(--paper); border: 0; }
.stepper__btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.stepper__btn:disabled { color: color-mix(in srgb, var(--ink) 35%, var(--paper)); cursor: not-allowed; }
.stepper__n { min-width: 2.5rem; text-align: center; font-weight: 600; font-size: var(--fs-lg); border-inline: var(--line) solid var(--ink); line-height: 44px; }

/* Fields */
.field { display: grid; gap: var(--s-2); margin-bottom: var(--s-4); }
.field label { font-weight: 500; font-size: var(--fs-sm); }
.field input {
  min-height: 48px; padding: 0 var(--s-3);
  background: var(--paper); border: var(--line) solid var(--ink); border-radius: 0;
  font-size: var(--fs-md);
}
.field input:hover { background: var(--paper-deep); }
.field input:focus { outline: 3px solid var(--blue); outline-offset: 0; border-color: var(--blue); background: var(--paper); }
.field input[aria-invalid="true"] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.field-error {
  display: flex; gap: var(--s-2); align-items: flex-start;
  margin-top: var(--s-2);
  color: var(--red); font-size: var(--fs-sm); font-weight: 500;
}
.field-error .icon { width: 18px; height: 18px; margin-top: 2px; }
.check { display: flex; gap: var(--s-3); align-items: flex-start; font-size: var(--fs-sm); cursor: pointer; min-height: 44px; padding-top: var(--s-2); }
.check input { width: 22px; height: 22px; margin: 0; flex: none; }

/* Summary: the black panel */
.summary { background: var(--ink); color: var(--paper); padding: var(--s-5); }
.summary__title { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: var(--fs-lg); letter-spacing: -0.02em; }
.summary__when { margin-top: var(--s-3); padding-bottom: var(--s-4); border-bottom: var(--line) solid var(--paper); font-size: var(--fs-sm); }
.summary__when b { display: block; font-size: var(--fs-md); font-weight: 600; }
.summary__table { width: 100%; margin: var(--s-3) 0 var(--s-5); font-size: var(--fs-sm); }
.summary__table td, .summary__table th { padding: var(--s-2) 0; text-align: left; vertical-align: top; font-weight: 400; }
.summary__table td:last-child { text-align: right; white-space: nowrap; padding-left: var(--s-3); }
.summary__table tfoot th, .summary__table tfoot td {
  padding-top: var(--s-3); border-top: var(--bar) solid var(--yellow);
  font-family: var(--display); font-weight: 900; font-size: var(--fs-xl); text-transform: uppercase; letter-spacing: -0.02em;
}
.summary__empty td { color: color-mix(in srgb, var(--paper) 78%, var(--ink)); text-align: left !important; }
.summary__small { margin-top: var(--s-3); font-size: var(--fs-xs); color: color-mix(in srgb, var(--paper) 82%, var(--ink)); }
.summary .btn--red { border-color: var(--red); }
.summary .btn--red:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.summary .btn.is-loading { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.spinner { width: 18px; height: 18px; flex: none; position: relative; }
.spinner i { position: absolute; width: 8px; height: 8px; }
.spinner i:nth-child(1) { left: 0; top: 0; background: var(--red); border-radius: 50%; }
.spinner i:nth-child(2) { right: 0; top: 0; background: var(--blue); }
.spinner i:nth-child(3) { left: 5px; bottom: 0; background: var(--yellow); clip-path: polygon(50% 0, 100% 100%, 0 100%); }

/* Alert (error or validation summary) */
.booking__alert {
  display: flex; gap: var(--s-4); align-items: flex-start; flex-wrap: wrap;
  padding: var(--s-4) var(--s-5);
  background: var(--paper); border: 3px solid var(--red);
}
.booking__alert .icon { color: var(--red); width: 24px; height: 24px; }
.booking__alert p { flex: 1 1 20rem; }
.booking__alert b { display: block; font-weight: 600; }
.booking__alert .btn { min-height: 44px; }

/* Success stub */
.done { outline: none; }
.stub { display: grid; grid-template-columns: 220px minmax(0, 1fr); background: var(--paper); border: var(--line) solid var(--ink); max-width: 52rem; }
.stub__art svg { width: 100%; height: 100%; min-height: 260px; }
.stub__art { border-right: 3px dashed var(--ink); }
.stub__body { padding: var(--s-6); display: grid; gap: var(--s-2); align-content: start; }
.stub__title { font-family: var(--display); font-weight: 900; font-size: var(--fs-h2); text-transform: uppercase; letter-spacing: -0.03em; }
.stub__when { font-size: var(--fs-xl); font-weight: 500; margin-top: var(--s-3); }
.stub__ref { font-variant-numeric: tabular-nums; }
.stub__ref b { font-weight: 700; letter-spacing: 0.08em; }
.stub__note { color: var(--ink-soft); font-size: var(--fs-sm); max-width: 50ch; }
.stub .btn { justify-self: start; margin-top: var(--s-4); }

/* ---------- 11. Visit ---------- */
.visit { padding-block: var(--s-9); }
.visit__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-7); }
.hours { width: 100%; }
.hours th, .hours td { padding: var(--s-3) var(--s-2); text-align: left; border-bottom: var(--line) solid var(--ink); font-weight: 400; }
.hours td { text-align: right; }
.hours tr:first-child th, .hours tr:first-child td { border-top: var(--bar) solid var(--ink); }
.hours tr.is-today { background: var(--yellow); }
.hours tr.is-today th { font-weight: 600; }
.facts { display: grid; gap: var(--s-4); }
.facts li { display: grid; grid-template-columns: 20px 1fr; gap: var(--s-3); font-size: var(--fs-sm); }
.facts .icon { margin-top: 2px; }
.map { width: 100%; height: auto; margin-bottom: var(--s-5); border: var(--line) solid var(--ink); }
.m-ground { fill: var(--paper-deep); }
.m-river { fill: var(--blue); }
.m-street { fill: none; stroke: var(--paper); stroke-width: 10; }
.m-tram { fill: none; stroke: var(--red); stroke-width: 4; }
.m-stop { fill: var(--paper); stroke: var(--red); stroke-width: 4; }
.m-walk { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 3 5; }
.m-museum { fill: var(--red); stroke: var(--ink); stroke-width: 3; }
.m-garage { fill: var(--yellow); stroke: var(--ink); stroke-width: 2; }
.m-label { font-family: var(--sans); font-size: 12px; font-weight: 600; fill: var(--ink); }
.m-label--paper { fill: var(--paper); }

/* ---------- 12. Shop (red ground) ---------- */
.shop { background: var(--red); color: var(--paper); padding-block: var(--s-9); }
.shop__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 var(--s-7); align-items: start; }
.shop__intro { grid-column: 1 / -1; border-bottom-color: var(--paper); }
.shop__intro p { color: var(--paper-on-red); }
.product { display: grid; gap: var(--s-5); }
.product__art { background: var(--ink); padding: var(--s-6); display: grid; place-items: center; aspect-ratio: 4 / 3.4; }
.product--book .product__art { background: var(--yellow); }
.poster { width: 46%; height: auto; box-shadow: 0 14px 24px rgb(22 21 20 / 0.45); }
.book { width: 58%; height: auto; }
.poster__title { font-family: var(--display); font-weight: 900; font-size: 5.2px; fill: var(--ink); letter-spacing: -0.02em; }
.poster__small { font-family: var(--sans); font-size: 3.2px; font-weight: 500; fill: var(--ink); }
.b-shadow { fill: rgb(22 21 20 / 0.35); }
.product__text h3 { font-size: var(--fs-lg); font-weight: 600; }
.product__text p { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--paper-on-red); }
.product__text .product__price { font-family: var(--display); font-weight: 900; font-size: var(--fs-xl); color: var(--paper); margin: var(--s-3) 0 var(--s-4); }

/* ---------- 13. Questions ---------- */
.faq { padding-block: var(--s-9); }
.faq__grid { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 15rem; gap: var(--s-7); }
.faq__shape svg { width: 100%; height: auto; }
.faq .side-title { min-height: 26rem; align-self: stretch; background: var(--blue); }
.qs { border-top: var(--bar) solid var(--ink); max-width: 60rem; }
.q { border-bottom: var(--line) solid var(--ink); }
.q summary {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
  min-height: 64px; padding: var(--s-3) 0;
  font-size: var(--fs-lg); font-weight: 500; cursor: pointer; list-style: none;
}
.q summary::-webkit-details-marker { display: none; }
.q summary:hover span { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 3px; text-underline-offset: 0.25em; }
.q summary .icon { width: 24px; height: 24px; transition: transform var(--t-mid) var(--ease-out); }
.q[open] summary .icon { transform: rotate(45deg); }
.q p { padding: 0 0 var(--s-5); max-width: 65ch; color: var(--ink-soft); }

/* ---------- 14. Footer ---------- */
.foot { background: var(--ink); color: var(--paper); padding-block: var(--s-8) var(--s-6); }
.foot__grid { display: grid; grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2fr)); gap: var(--s-5) var(--s-6); align-items: start; }
.foot__mark { grid-column: 1 / -1; padding-bottom: var(--s-6); border-bottom: var(--line) solid var(--paper); margin-bottom: var(--s-3); }
.foot__mark svg { width: min(240px, 60%); height: auto; }
.foot__name { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: var(--fs-lg); letter-spacing: -0.02em; line-height: 1.2; }
.foot p, .foot li { font-size: var(--fs-sm); }
.foot a { text-decoration-color: var(--yellow); }
.foot__links { display: grid; gap: var(--s-1); }
.foot__links a { display: inline-flex; min-height: 32px; align-items: center; }
.foot__small { grid-column: 1 / -1; margin-top: var(--s-6); color: color-mix(in srgb, var(--paper) 78%, var(--ink)); font-size: var(--fs-xs) !important; }
.foot :focus-visible { outline-color: var(--yellow); }

/* Themed focus on dark and coloured grounds */
.works :focus-visible, .shop :focus-visible { outline-color: var(--yellow); }
.tickets :focus-visible { outline-color: var(--blue); }

/* ---------- 15. Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Dividers draw their bars across as they enter (from a visible default: only runs where scroll timelines exist) */
  @supports (animation-timeline: view()) {
    .divider svg rect:first-child, .divider svg path:first-child {
      transform-box: fill-box; transform-origin: left center;
      animation: bar-in linear both; animation-timeline: view(); animation-range: entry 0% cover 40%;
    }
    @keyframes bar-in { from { transform: scaleX(0.35); } to { transform: none; } }
  }
  .room-panel.is-entering { animation: panel-in var(--t-mid) var(--ease-out); }
  @keyframes panel-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
  .done:not([hidden]) .stub { animation: stub-in var(--t-slow) var(--ease-out); }
  @keyframes stub-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
  .spinner { animation: spin 900ms var(--ease-out) infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
}

/* ---------- 16. Narrow screens ---------- */
@media (max-width: 1180px) {
  .booking {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "alert alert" "cal time" "people who" "sum sum";
  }
  .summary { position: static; }
  .event { grid-template-columns: 7.5rem minmax(0, 1fr) auto; }
  .event__meta { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
  .event__btn { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 1040px) {
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 4px solid var(--ink);
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; padding: var(--s-3) 0 var(--s-5); }
  .nav a { min-height: 52px; font-size: var(--fs-lg); border-bottom: var(--line) solid var(--ink); margin: 0; padding: 0; }
  .menu-btn { display: inline-flex; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: var(--s-6); padding-top: var(--s-6); }
  .hero__text { max-width: 44rem; }
  .stage { width: min(100cqw - 44px, 40rem); }
  .hero__title { font-size: clamp(2.4rem, 6.4vw, 4rem); }
  .timeline { grid-template-columns: minmax(0, 1fr); }
  .work, .work:nth-child(n) { grid-column: 1; grid-row: auto; }
  .rooms__grid { grid-template-columns: minmax(0, 1fr); }
  .visit__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .visit__col--map { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 var(--s-6); }
  .visit__col--map .h3 { grid-column: 1 / -1; }
  .intro__grid { grid-template-columns: 6rem minmax(0, 1fr); }
  .intro__facts { grid-column: 2; }
  .intro .side-title { grid-row: 1 / span 2; }
  .foot__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .faq__grid { grid-template-columns: 6rem minmax(0, 1fr); }
  .faq__shape { display: none; }
  .foot__name { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root { --header-h: 60px; --bar: 10px; }
  .mark__name { display: none; }
  .top__in { gap: var(--s-3); }
  /* Mobile hero: title, then the composition, then the words */
  .hero { display: flex; flex-direction: column; align-items: stretch; padding-top: var(--s-5); gap: var(--s-5); }
  .hero__text { display: contents; }
  .hero__title { order: 1; font-size: clamp(1.9rem, 11.6vw, 3.2rem); }
  .hero__stage { order: 2; }
  .hero__sub { order: 3; margin-top: 0; font-size: var(--fs-lg); }
  .hero__facts { order: 4; margin-top: 0; }
  .hero__actions { order: 5; margin-top: 0; }
  .tool__long { display: none; }
  .room-nav { gap: var(--s-2); }
  .room-nav .btn { padding: 0 var(--s-2); }
  .hero__facts div { grid-template-columns: 4.5rem 1fr; }
  .stage { width: calc(100cqw - 44px); }
  .tools__gap { display: none; }
  .tools__row { display: grid; grid-template-columns: 1fr 1fr; }
  .tool { justify-content: center; padding: 0 var(--s-2); }

  .section-head { grid-template-columns: minmax(0, 1fr); margin-bottom: var(--s-6); }

  /* Rotated side titles fold back to horizontal, keeping the bar */
  .intro__grid, .works__grid, .faq__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .side-title { min-height: 0 !important; justify-content: flex-start; padding: var(--s-4) var(--s-4) var(--s-3); position: static !important; font-size: clamp(1.35rem, 5.4vw, 2rem); }
  .side-title span { background: inherit; writing-mode: horizontal-tb; transform: none; white-space: normal; }
  .intro .side-title { grid-row: auto; }
  .intro__facts { grid-column: auto; }
  .intro__shape { width: 16rem; right: -6rem; bottom: -9rem; }

  .room__name { display: none; }
  .room__no { font-size: 72px; }
  .room-nav .btn { flex: 1; }

  .timeline { grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
  .work, .work:nth-child(n) { grid-column: 1; grid-row: auto; grid-template-columns: 88px minmax(0, 1fr); }
  .work__art { width: 88px; height: 110px; }

  .tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: var(--line); background: var(--ink); }
  .tab { border: 0; justify-content: flex-start; }
  .tab:first-child { grid-column: 1 / -1; }
  .event { grid-template-columns: 5.5rem minmax(0, 1fr); gap: var(--s-3) var(--s-4); align-items: start; }
  .event__date { width: 5.25rem; height: 5.25rem; font-size: 0.6875rem; }
  .event__date b { font-size: 1.5rem; }
  .event[data-type="tour"] .event__date { padding-top: 2rem; }
  .event[data-type="tour"] .event__date b { font-size: 1.125rem; }
  .event[data-type="tour"] .event__date span { font-size: 0.6875rem; letter-spacing: -0.01em; }
  .event[data-type="family"] .event__date { border-radius: 2.625rem 2.625rem 0 0; }
  .event__meta { grid-column: 2; grid-row: auto; display: grid; }
  .event__btn { grid-column: 2; grid-row: auto; justify-self: start; }

  .booking { grid-template-columns: minmax(0, 1fr); grid-template-areas: "alert" "cal" "time" "people" "who" "sum"; gap: var(--s-4); }
  .step { padding: var(--s-4); }
  .stub { grid-template-columns: minmax(0, 1fr); }
  .stub__art { border-right: 0; border-bottom: 3px dashed var(--ink); }
  .stub__art svg { min-height: 0; height: 160px; }
  .stub__body { padding: var(--s-5); }

  .visit__grid, .visit__col--map { grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
  .visit__col--map { gap: 0; }
  .shop__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
  .foot__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 400px) {
  .top__cta { padding: 0 var(--s-3); }
  .cal__row, .cal__grid { gap: 3px; }
  .day { min-height: 36px; font-size: var(--fs-xs); }
}
