/* Type: Argent CF (titles) and Gyst (text) where they are installed; otherwise the nearest
   open fonts, self-hosted in assets/fonts: Fraunces (soft, bold) and Commissioner (flared),
   cut down to Latin. To use the real fonts on the web, add their licensed webfont files
   here under the names "Argent CF" and "Gyst". */
@font-face { font-family: "TP Display"; src: url(../assets/fonts/tp-display-bold.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "TP Display"; src: url(../assets/fonts/tp-display-bold-italic.woff2) format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "TP Text"; src: url(../assets/fonts/tp-text.woff2) format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }

/* =====================================================================
   TURNING POINT — styles
   Grid: 4 columns, outer margin + gutters, 4 rows between top/bottom
   margins (from the 1920×1080 mock: 36px margins, ~34px gutters,
   78px top/bottom margins, four 231px rows). All values are fluid.
   ===================================================================== */

:root {
  --m:  clamp(16px, 1.9vw, 56px);     /* outer margin   */
  --g:  clamp(8px, 1vw, 28px);        /* gutter */
  /* the active area: everything sits inside these margins (wide screens) */
  --ax: 6.5vw;                        /* left margin of the active area */
  --ax2: 5.3vw;                       /* right margin of the active area */
  --pl: var(--ax);                    /* the frame's left padding */
  --sl: 5.2vw;                        /* width of the right-edge pattern strip */
  --mr: calc(var(--ax2) + var(--sl) + 4px);  /* the frame's right padding = margin + strip + hairline gap */
  --mt: clamp(28px, 7.2vh, 104px);    /* top/bottom margin */
  --col: calc((100vw - var(--pl) - var(--mr) - 3 * var(--g)) / 4);

  --ink:  #1f1c19;
  --grey: #5d5853;
  --soft: #8d857d;
  --dim:  #d9d0c6;
  --accent: #449ad4;      /* the blue of the mockup: highlights, numbers, links, "Turning Point." */
  --gold: var(--accent);  /* (the old accent names, now the same blue) */
  --rust: var(--accent);
  --title-ink: var(--accent);
  --line: rgba(31, 28, 25, .14);
  --paper: #ffffff;

  /* surfaces + the layer behind (colour theme) */
  /* the paper texture at 40% (pre-blended over white: assets/img/paper-40.jpg) */
  --surface: #ffffff;   /* plain white (the paper texture, assets/img/paper-40.jpg, is no longer used) */
  --media-bg: #f4efe9;
  --bg-ink: #b9875d;      /* colour of the pattern behind */
  --bg-alpha: .02;        /* its opacity behind the strips */
  --bg-text: .4;          /* fraction of that behind the text */
  --bg-tile: 640px;       /* tile size: smaller = denser */

  --sans:  "Source Sans 3", Calibri, Carlito, "Segoe UI", system-ui, sans-serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --display: "Argent CF", "TP Display", Georgia, serif;     /* titles, headline, menu */
  --text: "Gyst", "TP Text", "Source Sans 3", sans-serif;   /* the home page's text */

  --fs-body: clamp(15px, .6rem + .62vw, 22px);
  --fs-nav:  clamp(20px, 1.66vw, 40px);
  --fs-small: clamp(11px, .45rem + .3vw, 14px);

  /* motion: fast in, crisp stop. --snap overshoots a touch and settles, for things that slide in */
  --ease: cubic-bezier(.3, .85, .2, 1);
  --ease-out: cubic-bezier(.1, 1, .25, 1);
  --snap: cubic-bezier(.2, 1.35, .4, 1);
  /* SPEED of every transition and entrance on the site: 1 = as built, 0.5 = half as fast
     (everything takes twice as long), 2 = twice as fast. main.js reads it too, for the
     timings it runs itself (the strips sliding away, the opening sequence, section swaps). */
  --speed: .5;
  /* how fast the pattern grows and follows the mouse: 1 = as built, 0.5 = half as fast */
  --pattern-speed: .5;
}

/* ---------------------------------------------------------------------
   Black-and-white theme: <html data-theme="mono">
   paper as the base layer, the steel in greyscale, ink-like type
   --------------------------------------------------------------------- */
[data-theme="mono"] {
  --title-ink: var(--ink);
  --ink:  #151413;
  --grey: #3d3b38;
  --soft: #75716c;
  --dim:  #bdb8b2;
  --gold: #2a2826;
  --rust: #151413;
  --line: rgba(21, 20, 19, .18);
  --paper: #f8f8f8;
  --surface: #f8f8f8 url(../assets/img/paper.jpg) 0 0 / 1000px 1000px repeat fixed;
  --media-bg: rgba(21, 20, 19, .05);
  --bg-ink: #1b1a19;
  --bg-alpha: .1;
  --bg-text: .35;
  --ink-bleed: 0 0 .45px rgba(21, 20, 19, .55), 0 0 1.3px rgba(21, 20, 19, .16);
}
[data-theme="mono"] body { text-shadow: var(--ink-bleed); }
[data-theme="mono"] .roll .ch { text-shadow: var(--ink-bleed), 0 1.1em 0 currentColor, 0 1.1em .45px currentColor; }
/* a slight displacement + bleed on the larger type (SVG filter #ink in index.html) */
[data-theme="mono"] .title a,
[data-theme="mono"] .nav__item .roll,
[data-theme="mono"] .phead h2,
[data-theme="mono"] .card h3,
[data-theme="mono"] .card .num,
[data-theme="mono"] .event .day,
[data-theme="mono"] .event h3 { filter: url(#ink); }
[data-theme="mono"] .media img,
[data-theme="mono"] .media video,
[data-theme="mono"] .media iframe { filter: grayscale(1) contrast(1.04); }
[data-theme="mono"] .intro a[data-go] { background-size: 100% 1px; }
[data-theme="mono"] .intro a[data-go]:hover { background-size: 100% 2px; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
img, video, iframe { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: var(--rust); color: #fff; }
:focus-visible { outline: 1px solid var(--rust); outline-offset: 4px; }

/* ---------------------------------------------------------------------
   Frame + grid (desktop)
   --------------------------------------------------------------------- */
.frame {
  position: fixed;
  inset: 0;
  display: grid;
  /* pattern (two columns) | text, a little wider | menu, a little narrower */
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.2fr) minmax(min-content, .8fr);
  grid-template-rows: repeat(4, minmax(0, 1fr));
  column-gap: var(--g);
  padding: var(--mt) var(--mr) var(--mt) var(--pl);
}
#pattern { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.frame > *:not(canvas) { position: relative; z-index: 1; }

.stage {
  grid-column: 1 / 3;
  grid-row: 1 / 5;
  pointer-events: none;
}
/* the finer, still pattern behind the strips — a pre-rendered seamless tile.
   JS (placeBg) sizes it to the content area and sets the ramp stops. */
.bgpat {
  position: absolute !important;
  z-index: 0 !important;
  left: 0; top: 0; width: 0; height: 0;
  pointer-events: none;
  opacity: var(--bg-alpha);
  -webkit-mask-image: linear-gradient(to right, #000 var(--ramp-a, 100%), rgba(0, 0, 0, var(--bg-text)) var(--ramp-b, 100%));
          mask-image: linear-gradient(to right, #000 var(--ramp-a, 100%), rgba(0, 0, 0, var(--bg-text)) var(--ramp-b, 100%));
  clip-path: inset(0 100% 0 0);
  transition: clip-path calc(.6s / var(--speed)) var(--ease), opacity calc(.25s / var(--speed)) var(--ease);
}
.bgpat__tile {
  position: absolute; inset: 0;
  background: var(--bg-ink);
  -webkit-mask: url(../assets/img/pattern-tile.png) 0 0 / var(--bg-tile) var(--bg-tile) repeat;
          mask: url(../assets/img/pattern-tile.png) 0 0 / var(--bg-tile) var(--bg-tile) repeat;
}
.bg-in .bgpat { clip-path: inset(0 0 0 0); }
/* it stays on in the section pages too — evenly, since there are no strips there */
.is-panel .bgpat { -webkit-mask-image: none; mask-image: none; }

.sliver {
  position: absolute !important;
  right: var(--ax2); top: var(--mt); bottom: var(--mt);
  width: var(--sl);
  pointer-events: none;
}

/* right column: meta / title / menu share the page's four rows */
.side {
  grid-column: 4; grid-row: 1 / 5;
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  z-index: 3 !important;
}
.meta {
  grid-row: 1; align-self: start;
  margin: 0;
  font-size: var(--fs-small);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--soft);
  line-height: 1.7;
}
.meta a { position: relative; color: var(--grey); }
.meta a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--rust); transform: scaleX(0); transform-origin: left;
  transition: transform calc(.25s / var(--speed)) var(--ease-out);
}
.meta a:hover::after { transform: scaleX(1); }
.meta .sep { margin: 0 .6em; color: var(--dim); }

.title {
  grid-row: 2; align-self: end;
  margin: 0 0 -.18em;
  font-size: var(--fs-nav);
  font-weight: 600;
  letter-spacing: .035em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.1;
  white-space: nowrap;
  transition: color calc(.4s / var(--speed)) var(--ease);
}
.title a { display: inline-flex; overflow: hidden; vertical-align: bottom; padding-bottom: .28em; margin-bottom: -.28em; }   /* room for the g's descender */
.title .ch { display: inline-block; }

.nav { grid-row: 3 / 5; align-self: end; margin-bottom: -.18em; }
.nav__list { display: flex; flex-direction: column; gap: calc(var(--fs-nav) * .78); }

.intro {
  grid-column: 3 / 5; grid-row: 1 / 5;   /* the lead paragraph runs on into the fourth column */
  padding-top: calc((100vh - 2 * var(--mt)) / 4 * .25);
  font-size: clamp(14px, .5rem + .55vw, 22px);   /* a little under the body size on smaller screens, so it clears the blocks */
  overflow-y: auto;
  scrollbar-width: none;
  transition: opacity calc(.3s / var(--speed)) var(--ease), transform calc(.4s / var(--speed)) var(--ease);
}
.intro::-webkit-scrollbar { display: none; }
.intro p {
  margin: 0 0 1.38em;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  hanging-punctuation: first last;
  max-width: calc(var(--col) * 1.2);
}
/* the first paragraph: larger, set to the right of the block that steps out of the pattern */
.intro p:first-of-type {
  font-size: 1.6em;
  line-height: 1.22;
  text-align: left;
  hyphens: manual; -webkit-hyphens: manual;
  margin: 0 0 .85em var(--lead-in, 0px);
  max-width: calc(var(--col) * 2 + var(--g) - var(--lead-in, 0px));
}
/* spacers that keep the text clear of the blocks stepping out of the pattern column (sized in main.js) */
.intro i.wrap { float: left; clear: left; width: 0; height: 0; }
.sc { font-variant-caps: all-small-caps; letter-spacing: .06em; font-weight: 600; color: var(--gold); }
.intro a[data-go] {
  white-space: nowrap;
  hyphens: none;
  font-variant-caps: all-small-caps;
  letter-spacing: .07em;
  color: var(--rust);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size calc(.25s / var(--speed)) var(--ease-out);
  cursor: pointer;
}
.intro a[data-go]:hover { background-size: 100% 1px; }

/* ---------------------------------------------------------------------
   Rolling letters — menu
   --------------------------------------------------------------------- */
.roll { display: inline-flex; overflow: hidden; line-height: 1.1; vertical-align: bottom; padding-right: .04em; }
.roll .ch {
  display: inline-block;
  white-space: pre;
  text-shadow: 0 1.1em 0 currentColor;
  transition: transform calc(.28s / var(--speed)) var(--ease);
  transition-delay: calc((var(--i) * 12ms) / var(--speed));
}
a:hover .roll .ch, a:focus-visible .roll .ch { transform: translateY(-1.1em); }

.nav__item {
  position: relative;
  display: flex;
  align-items: baseline;
  width: max-content;
  font-size: var(--fs-nav);
  font-weight: 300;
  letter-spacing: .035em;
  text-transform: uppercase;
  color: var(--grey);
  transition: color calc(.3s / var(--speed)) var(--ease), opacity calc(.3s / var(--speed)) var(--ease);
}
.nav__num {
  position: absolute;
  right: calc(100% + .7em);
  bottom: .1em;
  font-family: var(--serif);
  font-style: italic;
  font-size: .62em;
  text-transform: none;
  letter-spacing: 0;
  color: var(--soft);
  opacity: 0;
  transform: translateX(.4em);
  transition: opacity calc(.25s / var(--speed)) var(--ease), transform calc(.25s / var(--speed)) var(--ease);
}
.nav__item:hover .nav__num, .nav__item.is-active .nav__num { opacity: 1; transform: none; }
.nav__item::before {
  content: "";
  position: absolute;
  left: 0; bottom: -.18em;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform calc(.35s / var(--speed)) var(--ease);
}
.nav__item.is-active { color: var(--rust); }
.nav__item.is-active::before { transform: scaleX(1); }

.is-panel .title a:hover { color: var(--ink); }
.is-panel .nav__item:not(.is-active) { color: var(--dim); }
.is-panel .nav__item:not(.is-active):hover { color: var(--grey); }

/* ---------------------------------------------------------------------
   Section open (desktop): the right column slides away, the content
   takes all four columns, the pattern survives as the right-edge strip.
   The column stays away until you go back (with the "side-menu" class on
   <html>, set by SIDE_MENU in main.js, hovering the right edge brings it back).
   --------------------------------------------------------------------- */
.side-hot { display: none; }

@media (min-width: 821px) {
  .is-panel .side {
    position: fixed !important;
    top: 0; bottom: 0;
    right: var(--mr);
    width: calc(var(--col) + var(--g));
    padding: var(--mt) 0 var(--mt) var(--g);
    background: var(--surface);
    transform: translateX(calc(100% + var(--mr) + 10px));
    transition: transform calc(.45s / var(--speed)) var(--ease), box-shadow calc(.45s / var(--speed)) var(--ease);
    z-index: 30 !important;
  }
  /* once it has slid away, out of reach of the keyboard and screen readers too */
  html:not(.side-menu).is-panel .side {
    visibility: hidden;
    transition: transform calc(.45s / var(--speed)) var(--ease), visibility 0s linear calc(.45s / var(--speed));
  }
  .is-panel.side-open .side {
    transform: none;
    box-shadow: -40px 0 60px -50px rgba(31, 28, 25, .35);
  }
  .is-panel.side-open .title { color: var(--ink); }
  .is-panel.side-open .nav__item:not(.is-active) { color: var(--grey); }

  .side-menu.is-panel .side-hot {
    display: block;
    position: fixed;
    top: 0; bottom: 0; right: 0;
    width: calc(var(--mr) + 6px);
    z-index: 31;
    padding: 0; border: 0; background: transparent;
    cursor: w-resize;
  }
  .side-open .side-hot { cursor: e-resize; }
}

/* ---------------------------------------------------------------------
   Panel (section content)
   --------------------------------------------------------------------- */
.panel {
  grid-column: 1 / 5; grid-row: 1 / 5;
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--g);
  row-gap: calc(var(--g) * 1.5);
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 16vh;
  scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent;
  outline: none;
}
/* content is cropped crisply at the strips' top and bottom edges — no fades */
.is-panel .panel { display: grid; }
.is-panel .intro { opacity: 0; transform: translateX(-1.5vw); pointer-events: none; }

.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: 1 / -1; }

/* every box slides up and is uncovered from the top — no fades */
.box {
  clip-path: inset(0 0 100% 0);
  transform: translateY(36px);
  transition: clip-path calc(.34s / var(--speed)) var(--ease), transform calc(.42s / var(--speed)) var(--snap);
  transition-delay: calc((var(--i, 0) * 32ms + var(--wait, 0ms)) / var(--speed));
}
.box.is-in { clip-path: inset(-24px -24px -24px -24px); transform: none; }
.panel.is-leaving .box { clip-path: inset(0 0 100% 0); transform: translateY(-14px); transition-duration: calc(.15s / var(--speed)); transition-delay: 0s; }

/* section header */
.phead {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--g);
  align-items: end;
  padding-bottom: calc(var(--g) * .6);
  border-bottom: 1px solid var(--line);
}
.phead h2 {
  grid-column: 1 / 3;
  margin: 0;
  font-size: clamp(28px, 2.9vw, 64px);
  font-weight: 300;
  letter-spacing: -.005em;
  line-height: 1.02;
}
.phead h2 .num {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  color: var(--gold); margin-right: .25em; font-size: .8em;
}
.phead__aside { grid-column: 3 / 5; display: flex; justify-content: space-between; align-items: flex-end; gap: var(--g); }
.phead .lede { margin: 0; color: var(--grey); font-size: .92em; max-width: 36em; }
.phead .back {
  flex: none;
  display: inline-flex; align-items: center; gap: .7em;
  font-size: clamp(13px, .5rem + .45vw, 19px);
  font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: .65em 1.3em .65em 1.05em;
  cursor: pointer;
  transition: background calc(.17s / var(--speed)) var(--ease), color calc(.17s / var(--speed)) var(--ease), border-color calc(.17s / var(--speed)) var(--ease);
}
.phead .back .arrow { display: inline-block; font-size: 1.15em; line-height: 1; transition: transform calc(.23s / var(--speed)) var(--ease-out); }
.phead .back:hover, .phead .back:focus-visible { background: var(--ink); color: var(--paper); text-shadow: none; }
.phead .back:hover .arrow { transform: translateX(-.35em); }

/* text */
.box-text h3, .box-links h3 {
  margin: 0 0 .9em;
  padding-top: .75em;
  border-top: 1px solid var(--line);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--grey);
}
.box-text p { margin: 0 0 1em; hyphens: auto; -webkit-hyphens: auto; }

/* media */
.media {
  position: relative;
  aspect-ratio: var(--ratio, 4 / 3);
  overflow: hidden;
  background: var(--media-bg);
  clip-path: inset(0 100% 0 0);             /* images are uncovered from the left, fast */
  transition: clip-path calc(.34s / var(--speed)) var(--ease);
  transition-delay: calc((var(--i, 0) * 32ms + var(--wait, 0ms) + 40ms) / var(--speed));
}
.box.is-in .media { clip-path: inset(0 0 0 0); }
.media.is-cutout { background: transparent; }   /* PNGs with transparency */
.media img, .media video, .media iframe {
  width: 100%; height: 100%;
  object-fit: cover;
  border: 0;
  transform: translateX(-14%) scale(1.06);  /* and slide in behind the uncovering, snapping into place */
  transition: transform calc(.5s / var(--speed)) var(--ease-out);
  transition-delay: calc((var(--i, 0) * 32ms + var(--wait, 0ms) + 40ms) / var(--speed));
}
.box.is-in .media img, .box.is-in .media video, .box.is-in .media iframe { transform: none; }
figure { margin: 0; }
figcaption { margin-top: .7em; font-size: var(--fs-small); line-height: 1.5; color: var(--soft); letter-spacing: .02em; }
figcaption .fig { font-family: var(--serif); font-style: italic; font-size: 1.25em; color: var(--gold); margin-right: .45em; }

/* ---------------------------------------------------------------------
   Explore rail: tall cards scrolling sideways
   --------------------------------------------------------------------- */
.rail { grid-column: 1 / -1; min-width: 0; }
.rail__track {
  --cw: clamp(200px, min(26vw, calc((100vh - 2 * var(--mt) - 440px) * .714)), 480px);
  display: flex;
  gap: var(--g);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
  padding-right: 30vw;            /* lets the last card snap to the start */
  user-select: none;
  -webkit-user-select: none;
}
.rail__track::-webkit-scrollbar { display: none; }
.rail__track.is-drag { cursor: grabbing; scroll-snap-type: none; }
.rail__track.is-drag a { pointer-events: none; }
.rail .card {
  flex: 0 0 var(--cw);
  scroll-snap-align: start;
  clip-path: inset(0 100% 0 0);
  transform: translateX(48px);
  transition: clip-path calc(.34s / var(--speed)) var(--ease), transform calc(.42s / var(--speed)) var(--snap);
  transition-delay: calc((var(--k) * 40ms + var(--wait, 0ms)) / var(--speed));
}
.rail.is-in .card { clip-path: inset(-20px -20px -20px -20px); transform: none; }
.rail .card .media { --ratio: 5 / 7; transition-delay: calc((var(--k) * 40ms + var(--wait, 0ms) + 50ms) / var(--speed)); }
.rail .card img { -webkit-user-drag: none; }
.rail__foot {
  display: flex; align-items: center; gap: 1.2em;
  margin-top: 1.4em;
  font-size: var(--fs-small); letter-spacing: .16em; text-transform: uppercase; color: var(--soft);
}
.rail__bar { flex: 1; height: 1px; background: var(--line); position: relative; }
.rail__bar i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); background: var(--rust); transition: width calc(.2s / var(--speed)) linear; }
.rail__btn { background: none; border: 0; padding: .2em .3em; cursor: pointer; color: var(--grey); font-size: 1.3em; letter-spacing: 0; }
.rail__btn:hover { color: var(--rust); }
.rail__btn:disabled { color: var(--dim); cursor: default; }

.card { display: flex; flex-direction: column; }
.card .media img { transition: transform calc(.4s / var(--speed)) var(--ease-out), filter calc(.2s / var(--speed)) var(--ease); }
.card:hover .media img { transform: scale(1.045); }
.card .num {
  display: block; margin: .45em 0 .05em;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(30px, 2.6vw, 56px); line-height: 1; color: var(--gold);
}
.card h3 { margin: 0 0 .5em; font-size: clamp(18px, 1.35vw, 30px); font-weight: 300; letter-spacing: .04em; text-transform: uppercase; }
.card p { margin: 0 0 1em; color: var(--grey); hyphens: auto; -webkit-hyphens: auto; font-size: .92em; }
.rail .card p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .go { margin-top: auto; font-size: var(--fs-small); letter-spacing: .16em; text-transform: uppercase; color: var(--rust); }
.card .go .arrow { display: inline-block; transition: transform calc(.25s / var(--speed)) var(--ease-out); }
.card:hover .go .arrow { transform: translateX(.6em); }
.card.is-disabled { cursor: default; }
.card.is-disabled .go { color: var(--soft); }
.card.is-disabled .media img { filter: grayscale(.6) opacity(.75); }

/* ---------------------------------------------------------------------
   Carousel: several images in one box, sliding sideways
   --------------------------------------------------------------------- */
.cz .media { touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.cz .media.is-drag { cursor: grabbing; }
.cz__track {
  display: flex;
  height: 100%;
  transition: transform calc(.38s / var(--speed)) var(--ease);
  will-change: transform;
}
.cz .media.is-drag .cz__track { transition: none; }
.cz__slide { flex: 0 0 100%; height: 100%; position: relative; }
.cz .media .cz__slide img { width: 100%; height: 100%; object-fit: cover; transform: none; -webkit-user-drag: none; }
.cz__foot {
  display: flex; align-items: center; gap: 1.1em;
  margin-top: .8em;
  font-size: var(--fs-small); color: var(--soft);
}
.cz__cap { flex: 1; min-width: 0; overflow: hidden; line-height: 1.5; letter-spacing: .02em; }
.cz__cap > span { display: block; animation: czIn calc(.3s / var(--speed)) var(--ease-out); }
@keyframes czIn { from { transform: translateY(100%); } to { transform: none; } }
.cz__cap .fig { font-family: var(--serif); font-style: italic; font-size: 1.25em; color: var(--gold); margin-right: .45em; }
.cz__count { letter-spacing: .16em; white-space: nowrap; }
.cz__btn {
  width: 2.4em; height: 2.4em; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer; font-size: 1.05em;
  transition: border-color calc(.15s / var(--speed)) var(--ease), color calc(.15s / var(--speed)) var(--ease);
}
.cz__btn:hover { border-color: var(--rust); color: var(--rust); }
.cz__btn:disabled { opacity: .35; cursor: default; border-color: var(--line); color: var(--ink); }
.cz__dots { display: flex; gap: 5px; position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2; }
.cz__dots i { width: 18px; height: 2px; background: rgba(255,255,255,.55); transition: background calc(.15s / var(--speed)), width calc(.2s / var(--speed)) var(--ease); }
.cz__dots i.on { background: #fff; width: 30px; }

/* events */
.event {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--g);
  padding-top: .9em;
  border-top: 1px solid var(--line);
}
.event .when { display: flex; align-items: baseline; gap: .5em; }
.event .what { grid-column: 2 / 4; }
.event .day { font-family: var(--serif); font-style: italic; font-size: clamp(44px, 4.2vw, 92px); line-height: .85; color: var(--gold); }
.event .mon { font-size: var(--fs-small); letter-spacing: .16em; text-transform: uppercase; color: var(--grey); line-height: 1.5; }
.event h3 { margin: 0 0 .25em; font-size: clamp(18px, 1.35vw, 30px); font-weight: 300; letter-spacing: .04em; text-transform: uppercase; }
.event .place { margin: 0 0 .7em; color: var(--soft); font-size: var(--fs-small); letter-spacing: .1em; text-transform: uppercase; }
.event p { margin: 0; color: var(--grey); }
.event .act { justify-self: end; align-self: start; font-size: var(--fs-small); letter-spacing: .16em; text-transform: uppercase; color: var(--rust); }
.event .arrow { display: inline-block; transition: transform calc(.25s / var(--speed)) var(--ease-out); }
.event .act:hover .arrow { transform: translateX(.4em); }
.event.is-past { opacity: .45; }
.event.is-past .day { color: var(--soft); }

/* credits + links */
.credits { columns: 2; column-gap: var(--g); padding-top: .9em; border-top: 1px solid var(--line); margin: 0; }
.span-3.credits, .span-4.credits { columns: 3; }
.credits .grp { break-inside: avoid; margin: 0 0 1.3em; }
.credits dt { font-size: var(--fs-small); letter-spacing: .16em; text-transform: uppercase; color: var(--soft); margin-bottom: .2em; }
.credits dd { margin: 0; }
.box-links ul { list-style: none; margin: 0; padding: 0; }
.box-links li { border-bottom: 1px solid var(--line); }
.box-links a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .55em 0; font-weight: 300; font-size: 1.15em;
  transition: color calc(.2s / var(--speed)) var(--ease), padding calc(.25s / var(--speed)) var(--ease-out);
}
.box-links a:hover { color: var(--rust); padding-left: .4em; }
.box-links .arrow { font-size: .8em; color: var(--soft); }

/* ---------------------------------------------------------------------
   Opening choreography (only when JS is running)
   --------------------------------------------------------------------- */
.js .title .ch { transform: translateY(110%); }
.js .title.is-in .ch {
  transform: none;
  transition: transform calc(.42s / var(--speed)) var(--snap);
  transition-delay: calc((var(--i) * 24ms + 100ms) / var(--speed));
}
.js .title.is-in.is-settled .ch { transition-delay: 0s; }

/* intro paragraphs: uncovered from the top while sliding up */
.js .intro p {
  clip-path: inset(0 0 100% 0);
  transform: translateY(22px);
  transition: clip-path calc(.4s / var(--speed)) var(--ease), transform calc(.45s / var(--speed)) var(--snap);
  transition-delay: calc((var(--p) * 60ms) / var(--speed));
}
.js .intro.is-in p { clip-path: inset(-.4em -1em -.4em -1em); transform: none; }

/* menu: each label rolls up into place (the same roll as on hover) */
.js .nav:not(.is-in) .roll .ch { transform: translateY(110%); }
.js .nav:not(.is-settled) .roll .ch {
  transition: transform calc(.38s / var(--speed)) var(--snap);
  transition-delay: calc((var(--n) * 40ms + var(--i) * 8ms) / var(--speed));
}
.js .nav:not(.is-in) .nav__item::before { transform: scaleX(0); }
.js .meta { clip-path: inset(0 0 100% 0); transform: translateY(.7em); transition: clip-path calc(.35s / var(--speed)) var(--ease), transform calc(.4s / var(--speed)) var(--snap); }
.js .meta.is-in { clip-path: inset(-.6em -1em -.6em -1em); transform: none; }

/* faint pattern that grows under a resting cursor (or a tap on phones) */
#idle {
  position: fixed;
  left: 0; top: 0;
  width: 380px; height: 380px;
  pointer-events: none;
  z-index: 0;
  visibility: hidden;
}
#idle.is-on { visibility: visible; }

.skip-hint {
  position: absolute !important;
  left: var(--pl); bottom: calc(var(--mt) * .35);
  margin: 0;
  font-size: var(--fs-small); letter-spacing: .16em; text-transform: uppercase; color: var(--dim);
  opacity: 0; transition: opacity calc(.15s / var(--speed)) var(--ease);
  pointer-events: none;
}
.is-intro .skip-hint { opacity: 1; transition-delay: calc(.6s / var(--speed)); }
.is-intro { cursor: progress; }
.is-skip * { transition-duration: .15s !important; transition-delay: 0s !important; }

/* ---------------------------------------------------------------------
   Opening text: shown before the pattern and the title, until Enter
   --------------------------------------------------------------------- */
.preface {
  position: fixed; inset: 0; z-index: 60;
  background: var(--surface);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--g);
  align-content: center;
  padding: var(--mt) calc(var(--ax2) + var(--sl) + 4px) var(--mt) var(--pl);
  overflow-y: auto;
}
/* Enter pressed: the paper lifts so the pattern shows growing underneath, and the
   text dissolves into it (main.js drives the #dissolve filter) */
.preface.is-leaving { background: none; pointer-events: none; overflow: hidden; }
/* it sits where the pattern will grow; all of it in one size */
.preface__body { grid-column: 1 / 3; max-width: 36em; }
.preface__body p { margin: 0 0 1.2em; hyphens: manual; }
.preface__go {
  margin-top: 1.4em;
  display: inline-flex; align-items: center; gap: .7em;
  font-size: clamp(13px, .5rem + .45vw, 19px); font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); background: transparent;
  border: 1px solid var(--ink); border-radius: 0;
  padding: .65em 1.05em .65em 1.3em;
  cursor: pointer;
  transition: background calc(.17s / var(--speed)) var(--ease), color calc(.17s / var(--speed)) var(--ease);
}
.preface__go .arrow { display: inline-block; font-size: 1.15em; line-height: 1; transition: transform calc(.23s / var(--speed)) var(--ease-out); }
.preface__go:hover, .preface__go:focus-visible { background: var(--ink); color: var(--paper); text-shadow: none; }
.preface__go:hover .arrow { transform: translateX(.35em); }
/* its lines are uncovered from the top while sliding up, like the intro's */
.preface__body p, .preface__go {
  clip-path: inset(0 0 100% 0); transform: translateY(22px);
  transition: clip-path calc(.4s / var(--speed)) var(--ease), transform calc(.45s / var(--speed)) var(--snap), background calc(.2s / var(--speed)) var(--ease), color calc(.2s / var(--speed)) var(--ease);
  transition-delay: calc((var(--p, 0) * 70ms) / var(--speed));
}
.preface.is-in .preface__body p, .preface.is-in .preface__go { clip-path: inset(-.4em -1em -.4em -1em); transform: none; }
.preface.is-in .preface__go { transition-delay: calc((var(--p, 0) * 70ms) / var(--speed)), calc((var(--p, 0) * 70ms) / var(--speed)), 0s, 0s; }
@media (max-width: 820px) {
  .preface { display: flex; flex-direction: column; justify-content: center; padding: calc(var(--m) * 2.2) var(--m) calc(var(--m) * 2); }
  .preface__body { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .preface__body p, .preface__go { transition: none; }
}

.no-webgl .stage { background: url(../assets/img/texture.jpg) center / cover; }
.no-webgl .sliver { background: url(../assets/img/texture.jpg) left center / cover; }

.draft-badge {
  position: fixed; z-index: 50; left: 50%; top: 10px; transform: translateX(-50%);
  padding: 4px 12px; border-radius: 99px; background: var(--rust); color: #fff;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
}

/* ---------------------------------------------------------------------
   Horizontal sections (layout: "horizontal"): the header stays put and
   the content runs sideways at full height. Desktop and tablet only.
   --------------------------------------------------------------------- */
@media (min-width: 821px) {
  .panel.is-h { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
  .is-panel .panel.is-h { display: flex; }
  .panel.is-h > .phead { flex: none; margin-bottom: calc(var(--g) * 1.6); }
  .htrack {
    flex: 1; min-height: 0;
    display: flex; align-items: stretch;
    gap: calc(var(--g) * 2.2);
    overflow-x: auto; overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    container-type: size;          /* children size themselves from its height (cqh) */
    padding-right: 10vw;
    outline: none;
    cursor: grab;
  }
  .htrack::-webkit-scrollbar { display: none; }
  .htrack.is-drag { cursor: grabbing; user-select: none; }
  .htrack > * { flex: none; }
  /* images, video, carousels: full height, width from their aspect ratio */
  .htrack > figure {
    --cap: calc(var(--fs-small) * 4.4);
    height: 100cqh;
    width: calc((100cqh - var(--cap)) * var(--ratio, 4/3));
  }
  .htrack > .cz { --cap: calc(var(--fs-small) * 4); }
  .htrack > figure .media { width: 100%; }
  /* text: flows into columns one grid-column wide (JS sets how many) */
  .htrack > .box-text {
    height: 100cqh;
    width: var(--col);
    column-width: var(--col);
    column-gap: calc(var(--g) * 1.6);
    column-fill: auto;
  }
  .htrack > .box-text h3 { break-after: avoid; }
  .htrack > .box-text p { orphans: 3; widows: 3; }
  .htrack > .box:not(figure):not(.box-text):not(.card) { width: calc(var(--col) * 2 + var(--g)); }
  .htrack > .card { height: 100cqh; width: calc(100cqh * .52); }
  .htrack > .card .media { aspect-ratio: auto; flex: 1 1 auto; min-height: 0; }
  /* same text height on every card, so the images line up */
  .htrack > .card h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .htrack > .card > :not(.media) { flex: none; }
  .htrack > .card .num { height: 1em; overflow: visible; }
  .htrack > .card p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; height: 3.9em; flex: none; }
  .hfoot {
    flex: none;
    display: flex; align-items: center; gap: 1.2em;
    margin-top: 1em;
    font-size: var(--fs-small); letter-spacing: .16em; text-transform: uppercase; color: var(--soft);
  }
}
@media (max-width: 820px) {
  .htrack { display: contents; }     /* phones: back to the normal vertical flow */
  .hfoot { display: none; }
}

/* ---------------------------------------------------------------------
   Tablet
   --------------------------------------------------------------------- */
@media (max-width: 1180px) and (min-width: 821px) {
  :root { --fs-body: clamp(14px, .45rem + .75vw, 18px); }
  .panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2, .span-3, .span-4 { grid-column: 1 / -1; }
  .phead { grid-template-columns: 1fr; row-gap: .7em; }
  .phead h2, .phead__aside { grid-column: 1; }
  .credits, .span-3.credits, .span-4.credits { columns: 2; }
}

/* ---------------------------------------------------------------------
   Phone / narrow: single column, page scrolls, sticky menu bar.
   With a section open the pattern lives in a strip on top of the bar.
   --------------------------------------------------------------------- */
@media (max-width: 820px) {
  :root { --m: 18px; --g: 18px; --pl: var(--m); --ax2: 0px; --fs-body: 16.5px; --fs-nav: 13px; --fs-small: 11.5px; }
  body { overflow-x: hidden; overflow-y: auto; }
  .frame {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
      "title meta"
      "stage stage"
      "intro intro"
      "panel panel"
      "nav   nav";
    min-height: 100svh;
    padding: 0;
    column-gap: 0;
  }
  .side { display: contents; }
  .title { grid-area: title; align-self: end; margin: 0; padding: calc(var(--m) * 1.3) 0 calc(var(--m) * .9) var(--m); font-size: clamp(20px, 5.6vw, 26px); }
  .meta { grid-area: meta; align-self: end; text-align: right; line-height: 1.6; padding: 0 var(--m) calc(var(--m) * .9) 1em; }
  .meta .sep { display: none; }
  .meta .meta__place { display: block; }
  .meta a { margin-left: .9em; }

  .stage {
    grid-area: stage;
    position: relative;
    height: 58svh;
    margin: 0;
    transition: height calc(.32s / var(--speed)) var(--ease);
  }
  .stage > #pattern { position: absolute; inset: 0; }
  .stage > .bgpat { inset: 0; width: auto; height: auto; -webkit-mask-image: none; mask-image: none; }
  /* phones: in a section the stage is only a band, so the pattern sits behind the content */
  .is-panel .panel::before {
    content: "";
    position: absolute; inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--bg-ink);
    opacity: var(--bg-alpha);
    -webkit-mask: url(../assets/img/pattern-tile.png) 0 0 / var(--bg-tile) var(--bg-tile) repeat;
            mask: url(../assets/img/pattern-tile.png) 0 0 / var(--bg-tile) var(--bg-tile) repeat;
  }
  /* section open: the layers merge into one band pinned to the top */
  .is-panel .stage { display: none; }   /* in a section: no pattern band at the top */
  .sliver { display: none; }

  .intro { grid-area: intro; padding: calc(var(--m) * 1.4) var(--m) calc(var(--m) * 2); overflow: visible; font-size: inherit; }
  .intro p { max-width: none; }
  .intro p:first-of-type { font-size: 1.32em; margin-left: 0; max-width: none; }
  .is-panel .intro { display: none; }

  .nav {
    grid-area: nav;
    position: sticky !important;
    bottom: 0;
    z-index: 5 !important;
    margin: 0;
    align-self: end;
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .nav__list {
    flex-direction: row;
    justify-content: space-between;
    gap: 0;
    padding: 15px var(--m) calc(15px + env(safe-area-inset-bottom));
  }
  .nav__item { font-weight: 400; letter-spacing: .14em; }
  .nav__num { display: none; }
  .nav__item::before { bottom: -6px; }

  .panel {
    grid-area: panel;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 34px;
    padding: 18px var(--m) 60px;
    overflow: visible;
  }
  .span-1, .span-2, .span-3, .span-4 { grid-column: 1 / -1; }
  .phead { grid-template-columns: 1fr; row-gap: .6em; }
  .phead h2 { grid-column: 1; font-size: 30px; }
  .phead__aside { grid-column: 1; }
  .phead__aside { flex-direction: column; align-items: flex-start; gap: 16px; }
  .rail { margin: 0 calc(-1 * var(--m)); }
  .rail__track { --cw: 70vw; padding: 0 30vw 0 var(--m); scroll-padding-left: var(--m); }
  .rail__foot { padding: 0 var(--m); }
  .event { grid-template-columns: 1fr; row-gap: .4em; }
  .event .what { grid-column: 1; }
  .event .act { justify-self: start; margin-top: .4em; }
  .credits, .span-3.credits, .span-4.credits { columns: 1; }
  .skip-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation: none !important; }
}

/* =====================================================================
   Home page grid (wide screens): 15 × 8 square modules of --u, centred,
   from the mockup (MOCK01). Positions below are in modules from the
   frame's top-left corner: pattern in columns 0–5, rows 1–7; headline and
   text from column 6; title and menu at column 11; links at column 13;
   the right-hand strip is column 14. Add ?grid to the address to see it.
   ===================================================================== */
@media (min-width: 821px) {
  :root {
    --u: min(calc(89vw / 15), calc(86.5dvh / 8));   /* one module */
    --pl: calc((100vw - 15 * var(--u)) / 2);          /* left margin */
    --ax2: var(--pl);                                 /* right margin */
    --mt: calc((100dvh - 8 * var(--u)) / 2);          /* top and bottom margin */
    --sl: var(--u);                                   /* the right-hand strip: one column */
    --mr: calc(var(--ax2) + var(--sl) + var(--g));    /* section pages stop short of the strip */
  }
  .frame > .stage {
    position: absolute !important;
    grid-area: auto;   /* placed against the whole frame, not a grid cell */
    left: var(--pl); top: calc(var(--mt) + var(--u));
    width: calc(6 * var(--u)); height: calc(7 * var(--u));
  }
  .sliver { top: calc(var(--mt) + 2 * var(--u)); bottom: var(--mt); right: var(--ax2); width: var(--u); }   /* rows 3–8 */
  .frame > .mark {                             /* the outline square at the top of column 15, beside the links */
    position: absolute !important; pointer-events: none; grid-area: auto;
    left: calc(var(--pl) + 14.085 * var(--u)); top: calc(var(--mt) + .065 * var(--u));
    width: calc(.71 * var(--u)); height: calc(.71 * var(--u));
  }
  .frame > .org {                              /* the university logo: bottom left of the pattern, kept clear of it */
    position: absolute !important; z-index: 3; margin: 0; grid-area: auto; line-height: 0;
    left: calc(var(--pl) + .5 * var(--u)); top: calc(var(--mt) + 6.92 * var(--u));
    width: calc(1.65 * var(--u));
    transition: opacity calc(.25s / var(--speed)) var(--ease);
  }
  .is-panel .org { opacity: 0; pointer-events: none; }

  .frame > .intro {
    position: absolute !important;
    grid-area: auto;   /* placed against the whole frame, not a grid cell */
    left: calc(var(--pl) + 6 * var(--u)); top: calc(var(--mt) + .97 * var(--u));
    width: calc(6 * var(--u)); height: calc(7 * var(--u));
    padding: 0; overflow: visible;
    font-family: var(--text); font-weight: 400;
    font-size: calc(.205 * var(--u)); line-height: 1.3;
  }
  .intro p { max-width: calc(4 * var(--u)); margin: 0 0 1.3em; text-align: justify; hyphens: manual; -webkit-hyphens: manual; }
  .intro p:first-of-type {                     /* the headline: columns 6–11 */
    font-family: var(--display); font-style: italic; font-weight: 700;
    font-size: calc(.298 * var(--u)); line-height: 1.2;
    text-align: justify; text-align-last: left; hyphens: manual; -webkit-hyphens: manual;
    max-width: none; margin: 0 0 calc(.55 * var(--u));
  }
  .intro .sc { font: inherit; color: inherit; letter-spacing: 0; font-variant: normal; }
  .intro a[data-go] { font-variant-caps: normal; letter-spacing: 0; color: inherit; font-weight: 650; white-space: normal; }

  .frame > .side {
    position: absolute !important;
    grid-area: auto;   /* placed against the whole frame, not a grid cell */
    left: calc(var(--pl) + 11 * var(--u)); top: var(--mt);
    width: calc(3 * var(--u)); height: calc(8 * var(--u));
    display: block;
  }
  .meta {                                      /* column 14, row 1: set against the outline square */
    position: absolute; left: auto; right: calc(.03 * var(--u)); top: calc(.32 * var(--u));
    font-family: var(--text); font-size: calc(.218 * var(--u)); line-height: 1.05;
    letter-spacing: 0; text-transform: lowercase; text-align: left; color: var(--ink);
  }
  .meta a { display: block; color: var(--ink); }
  .meta .sep, .meta .meta__place:empty { display: none; }
  .title {                                     /* baseline on the line under row 4 */
    position: absolute; left: 0; top: calc(5 * var(--u) - .86em); margin: 0;
    font-family: var(--display); font-style: normal; font-weight: 700;
    font-size: calc(.42 * var(--u)); line-height: 1; letter-spacing: 0; text-transform: none;
    color: var(--title-ink);
  }
  .title a::after { content: "."; }
  .nav {                                       /* first baseline on the line under row 5 */
    position: absolute; left: 0; top: calc(6 * var(--u) - .86em); margin: 0;
    font-size: calc(.42 * var(--u));
  }
  .nav__list { gap: 0; }
  /* hover: the pattern spreads through the letters (js/main.js §7). The menu is its own
     group on the page colour, so the "lighten" blend shows only inside the black letters. */
  .nav { isolation: isolate; background: var(--surface); padding: .1em .25em; margin: -.1em -.25em; }
  .hoverpat { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: lighten; }
  .nav .nav__item::before { display: none; }
  .nav .nav__item:hover .roll .ch, .nav .nav__item:focus-visible .roll .ch { transform: none; }
  .nav__item {
    font-family: var(--display); font-style: italic; font-weight: 700;
    font-size: 1em; line-height: 1; letter-spacing: 0; text-transform: none; color: var(--ink);
  }
  .nav__item::after { content: "."; }
  .nav__item .roll { line-height: 1; }
  .nav__num { display: none; }

  /* a section open: the column slides off to the right from where it stands */
  .is-panel .side {
    position: absolute !important;
    top: var(--mt); bottom: auto; right: auto;
    width: calc(3 * var(--u)); padding: 0; background: none;
    transform: translateX(calc(4 * var(--u) + var(--pl)));
  }
}

/* the university logo */
.org img { display: block; width: 100%; height: auto; }
/* the outline square and the hover pattern are for wide screens */
@media (max-width: 820px) { .mark, .hoverpat { display: none; } }
.js .org { clip-path: inset(0 0 100% 0); transform: translateY(.7em); transition: clip-path calc(.35s / var(--speed)) var(--ease), transform calc(.4s / var(--speed)) var(--snap), opacity calc(.25s / var(--speed)) var(--ease); }
.js .org.is-in { clip-path: inset(-.6em -1em -.6em -1em); transform: none; }

/* type on narrow screens too */
.title { font-family: var(--display); font-weight: 700; }
.intro { font-family: var(--text); }
.intro p:first-of-type { font-family: var(--display); font-style: italic; font-weight: 700; }

/* ?grid: the 15 × 8 module grid over the page, to check alignment against the mockup */
.show-grid body::after {
  content: ""; position: fixed; z-index: 999; pointer-events: none;
  left: var(--pl); top: var(--mt); width: calc(15 * var(--u)); height: calc(8 * var(--u));
  outline: 1px solid rgba(230, 0, 60, .7);
  background-image: linear-gradient(to right, rgba(230, 0, 60, .3) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(230, 0, 60, .3) 1px, transparent 1px);
  background-size: var(--u) var(--u);
}

/* =====================================================================
   Section pages: the same type and colours as the home page (all sizes)
   ===================================================================== */
.panel { font-family: var(--text); color: var(--ink); }
.phead { border-bottom: 0; }
.phead h2 { font-family: var(--display); font-weight: 700; font-style: normal; letter-spacing: 0; text-transform: none; line-height: 1; }
.phead h2::after { content: "."; }
.phead h2 .num { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 1em; color: var(--accent); margin-right: .22em; }
.phead .lede { color: var(--ink); font-size: 1em; }
.phead .back {
  font-family: var(--display); font-style: italic; font-weight: 700;
  letter-spacing: 0; text-transform: none; border: 0; padding: 0; gap: .35em; background: none;
}
.phead .back::after { content: "."; margin-left: -.35em; }
.phead .back .arrow { color: var(--accent); font-style: normal; }
.phead .back:hover, .phead .back:focus-visible { background: none; color: var(--accent); }
.box-text h3, .box-links h3 {
  font-family: var(--display); font-style: italic; font-weight: 700; font-size: 1.3em; line-height: 1.15;
  letter-spacing: 0; text-transform: none; color: var(--ink);
  border-top: 0; padding-top: 0; margin: 0 0 .55em;
}
.box-text p { text-align: justify; }
figcaption, .cz__foot { color: var(--ink); letter-spacing: 0; }
figcaption .fig, .cz__cap .fig, .card .num, .event .day {
  font-family: var(--display); font-style: italic; font-weight: 700; color: var(--accent);
}
.card h3, .event h3 { font-family: var(--display); font-style: italic; font-weight: 700; letter-spacing: 0; text-transform: none; }
.card p, .event p { color: var(--ink); }
.card .go, .event .act { font-family: var(--display); font-style: italic; font-weight: 700; letter-spacing: 0; text-transform: none; font-size: 1.05em; }
.event { border-top: 0; }
.event .mon, .event .place { letter-spacing: .04em; color: var(--ink); }
.credits { border-top: 0; }
.credits dt { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 1.15em; letter-spacing: 0; text-transform: none; color: var(--ink); margin-bottom: .25em; }
.box-links li { border-bottom: 0; }
.box-links a { font-family: var(--display); font-style: italic; font-weight: 700; padding: .2em 0; }
.box-links .arrow { color: var(--accent); }
.rail__foot, .hfoot { letter-spacing: .04em; color: var(--ink); }
.rail__bar, .hfoot .rail__bar { background: rgba(31, 28, 25, .14); }

/* =====================================================================
   Section pages on the home page's grid (wide screens): the section sits
   in columns 1–14 of the 15 × 8 grid, under the university line. Its title
   sits in row 2 (baseline on the line under it), the lede in columns 7–10
   like the home page's text, "← Back." at the end of column 14; from row 3
   the content: every image, text column and card is a whole number of
   modules wide (less a gap, --hg), so all of it starts on a module line.
   ===================================================================== */
@media (min-width: 821px) {
  :root { --hg: calc(.3 * var(--u)); }        /* the gap after each thing */
  .frame > .panel {
    position: absolute !important; grid-area: auto;
    left: var(--pl); top: calc(var(--mt) + var(--u));
    width: calc(14 * var(--u)); height: calc(7 * var(--u));
    grid-template-columns: repeat(14, minmax(0, 1fr));
    column-gap: 0; row-gap: 0;
    padding: 0 0 var(--u);
    font-size: calc(.19 * var(--u)); line-height: 1.32;
  }
  .frame > .panel.is-h { height: calc(7.55 * var(--u)); padding: 0; }   /* the scroll bar sits in the bottom margin */
  .panel > .span-1 { grid-column: span 4; }
  .panel > .span-2 { grid-column: span 7; }
  .panel > .span-3 { grid-column: span 10; }
  .panel > .span-4 { grid-column: 1 / -1; }
  .panel > .span-1, .panel > .span-2, .panel > .span-3 { padding-right: var(--hg); }
  .panel > .box:not(.phead) { margin-bottom: calc(.45 * var(--u)); }

  .phead {
    grid-column: 1 / -1;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    column-gap: 0;
    height: var(--u); align-items: end;
    padding: 0 0 calc(.16 * var(--u));
  }
  .panel.is-h > .phead { margin: 0; height: var(--u); }
  .phead h2 { grid-column: 1 / 7; font-size: calc(.44 * var(--u)); white-space: nowrap; }
  .phead__aside {
    grid-column: 7 / 15;
    display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); align-items: end; gap: 0;
  }
  .phead .lede { grid-column: 1 / 5; max-width: none; font-size: calc(.205 * var(--u)); line-height: 1.3; padding-right: var(--hg); }
  .phead .back { grid-column: 6 / 9; justify-self: end; font-size: calc(.32 * var(--u)); line-height: 1; }

  /* sideways sections: six rows high */
  .htrack {
    flex: none; height: calc(6 * var(--u));
    gap: var(--hg); padding-right: calc(8 * var(--u));
  }
  .htrack > figure {
    --cap: calc(.62 * var(--u));
    height: 100cqh;
    width: calc((100cqh - var(--cap)) * var(--ratio, 4/3));
    width: calc(round(nearest, (100cqh - var(--cap)) * var(--ratio, 4/3), var(--u)) - var(--hg));
  }
  .htrack > .cz { --cap: calc(.62 * var(--u)); }
  .htrack > figure .media { aspect-ratio: auto; height: calc(100cqh - var(--cap)); }
  .htrack > .box-text {
    width: calc(4 * var(--u) - var(--hg));
    column-width: calc(4 * var(--u) - var(--hg));
    column-gap: var(--hg);
  }
  .htrack > .box:not(figure):not(.box-text):not(.card) { width: calc(7 * var(--u) - var(--hg)); }
  .htrack > .card { width: calc(3 * var(--u) - var(--hg)); }
  .card .num { font-size: calc(.42 * var(--u)); margin: .3em 0 .1em; }
  .card h3 { font-size: calc(.3 * var(--u)); margin-bottom: .35em; }
  .card .go { font-size: calc(.22 * var(--u)); }
  figcaption, .cz__foot { font-size: calc(.17 * var(--u)); }
  .hfoot { height: calc(.55 * var(--u)); margin: 0; font-size: calc(.15 * var(--u)); }

  /* events: date in columns 1–3, the event in 4–10, the link at the end */
  .event { grid-template-columns: repeat(14, minmax(0, 1fr)); column-gap: 0; padding-top: 0; }
  .event .when { grid-column: 1 / 4; }
  .event .what { grid-column: 4 / 11; padding-right: var(--hg); }
  .event .act { grid-column: 11 / 15; font-size: calc(.24 * var(--u)); }
  .event .day { font-size: calc(.9 * var(--u)); }
  .event h3 { font-size: calc(.3 * var(--u)); }
  .event .mon, .event .place { font-size: calc(.16 * var(--u)); }

  /* credits: three columns, three modules each */
  .credits, .span-3.credits, .span-4.credits { columns: 3; column-gap: var(--hg); }
  .credits dt { font-size: calc(.24 * var(--u)); }
  .box-links a { font-size: calc(.3 * var(--u)); }
}

/* =====================================================================
   Phones: the university line on top, "Turning Point." in blue, the
   pattern under the text, and a bolder, larger menu at the bottom
   ===================================================================== */
@media (max-width: 820px) {
  .frame {
    grid-template-rows: auto auto auto auto 1fr auto;
    grid-template-areas:
      "title meta"
      "intro intro"
      "stage stage"
      "org   org"
      "panel panel"
      "nav   nav";
  }
  .org { grid-area: org; margin: 0; padding: 0 var(--m) calc(var(--m) * 1.4); width: calc(150px + 2 * var(--m)); line-height: 0; }
  .is-panel .org { display: none; }
  .title { font-size: clamp(24px, 7vw, 30px); letter-spacing: 0; text-transform: none; color: var(--title-ink); }
  .title a::after { content: "."; }
  .meta { font-family: var(--text); text-transform: lowercase; letter-spacing: 0; font-size: 14px; }
  .intro { padding-bottom: calc(var(--m) * 1.2); }
  .stage { margin-bottom: calc(var(--m) * 1.5); }
  .is-panel .stage { margin-bottom: 0; }
  .nav__list { padding: 12px var(--m) calc(12px + env(safe-area-inset-bottom)); }
  .nav__item {
    font-family: var(--display); font-style: italic; font-weight: 700;
    font-size: clamp(17px, 4.9vw, 22px); letter-spacing: 0; text-transform: none; color: var(--ink);
  }
  .nav__item::after { content: "."; }
  .nav__item.is-active { color: var(--accent); }
  .phead h2 { font-size: 30px; }
  .phead .back { font-size: 20px; }
  .card .num { font-size: 34px; }
  .card h3, .event h3 { font-size: 21px; }
}

/* =====================================================================
   Feature section (layout: "feature", wide screens) — Structure & Process
   (MOCK M1–M3). The whole frame: the image carousel in columns 1–9, full
   height, with the title over it; the text column at 9½–13½; "Back." at the
   end of column 14. Three states, switched in js/main.js (initFeature):
     rest  — the image ends at column 9, the text beside it (M2)
     look  — click the image: it widens to column 11 under a white veil and
             the text drops down out of the way (M3)
     read  — scroll: the text comes up and runs over the veiled image (M1)
   ===================================================================== */
@media (min-width: 821px) {
  .frame > .panel.is-feat {
    display: block; top: var(--mt); height: calc(8 * var(--u));
    padding: 0; overflow: hidden;
  }
  .is-panel .frame:has(> .panel.is-feat) > .org { opacity: 0; pointer-events: none; }
  .feat { --fd: calc(.2s / var(--speed)); position: relative; width: 100%; height: 100%; }
  .feat__imgbox { position: absolute; left: 0; top: 0; width: calc(11 * var(--u)); height: 100%; }
  .feat__img {
    position: absolute; inset: 0; overflow: hidden; outline: none;
    background: var(--media-bg); cursor: zoom-in; user-select: none; -webkit-user-select: none;
    clip-path: inset(0 calc(2 * var(--u)) 0 0);
    transition: clip-path var(--fd) var(--ease);
  }
  .feat.is-look .feat__img, .feat.is-read .feat__img { clip-path: inset(0); }
  .feat.is-look .feat__img { cursor: e-resize; }
  .feat.is-look .feat__title { opacity: 0; }   /* looking through the images: the title steps aside */
  .feat__track { display: flex; height: 100%; transition: transform calc(.4s / var(--speed)) var(--ease); }
  .feat__slide { flex: 0 0 100%; height: 100%; }
  .feat__slide img, .feat__slide video { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
  .feat__veil {                                /* columns 10–11: the image under a white veil */
    position: absolute; top: 0; bottom: 0; left: calc(9 * var(--u)); right: 0;
    background: rgba(255, 255, 255, .72); pointer-events: none;
    transition: top var(--fd) var(--ease);
  }
  .feat.is-look .feat__veil { top: calc(5.22 * var(--u)); }   /* looking: the veil drops with the text, only under it */
  .feat__title {
    position: absolute; z-index: 2; margin: 0; white-space: nowrap; pointer-events: none;
    transition: opacity var(--fd) var(--ease);
    left: calc(.5 * var(--u)); top: calc(.98 * var(--u) - .8em);
    font-family: var(--display); font-weight: 700; font-style: normal;
    font-size: calc(.44 * var(--u)); line-height: 1; letter-spacing: 0; color: #fff;
  }
  .feat__foot {                                /* count, arrows and caption: shown while looking, or on hover */
    position: absolute; z-index: 2; left: calc(.5 * var(--u)); bottom: calc(.3 * var(--u));
    max-width: calc(8 * var(--u));
    display: flex; align-items: baseline; gap: .8em;
    font-family: var(--text); font-size: calc(.17 * var(--u)); color: #fff;
    text-shadow: 0 0 10px rgba(0, 0, 0, .45);
    opacity: 0; transition: opacity var(--fd) var(--ease);
  }
  .feat:hover .feat__foot, .feat.is-look .feat__foot { opacity: 1; }
  .feat__btn { background: none; border: 0; padding: 0 .2em; color: #fff; cursor: pointer; font-size: 1.3em; text-shadow: inherit; }
  .feat__cap { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .feat__back {
    position: absolute; z-index: 3; right: 0; top: calc(1.23 * var(--u) - .8em);
    background: none; border: 0; padding: 0; cursor: pointer;
    font-family: var(--display); font-style: italic; font-weight: 700;
    font-size: calc(.3 * var(--u)); line-height: 1; color: var(--ink);
    transition: color calc(.15s / var(--speed)) var(--ease);
  }
  .feat__back::after { content: "."; }
  .feat__back:hover, .feat__back:focus-visible { color: var(--accent); }
  .feat__text {                                /* columns 9½–13½, from under "Back." to the bottom */
    position: absolute; z-index: 2; top: calc(1.5 * var(--u)); bottom: 0;   /* scrolls out of sight just under "Back." */
    left: calc(9.5 * var(--u)); width: calc(4 * var(--u));
    overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; outline: none;
  }
  .feat__text::-webkit-scrollbar { display: none; }
  /* looking: only the dropped-down part shows, nothing of the text before it */
  .feat__text.box.is-in { clip-path: inset(0 -1px 0 0); transition: clip-path var(--fd) var(--ease), transform calc(.42s / var(--speed)) var(--snap); }
  .feat.is-look .feat__text.box.is-in { clip-path: inset(calc(3.72 * var(--u)) -1px 0 0); }
  .feat__inner {
    padding: calc(.28 * var(--u)) 0 calc(2.5 * var(--u));
    font-family: var(--text); font-size: calc(.2 * var(--u)); line-height: 1.3; color: var(--ink);
    transition: transform var(--fd) var(--ease);
  }
  .feat.is-look .feat__inner { transform: translateY(calc(3.72 * var(--u))); }
  .feat__inner h3 { margin: 0 0 calc(.36 * var(--u)); font-family: var(--text); font-weight: 400; font-size: calc(.235 * var(--u)); line-height: 1.2; }
  .feat__inner p { margin: 0 0 1.3em; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
  .feat__part + .feat__part { margin-top: calc(.6 * var(--u)); }
}

/* =====================================================================
   Explorations (a sideways section of nothing but explorations, MOCK M5):
   just the thumbnails, each with its number and title, taking you to the
   exploration. The title sits where the university line is; the cards run
   from under it to the bottom of the frame and are cut at column 13.
   ===================================================================== */
.panel .card p, .panel .card .go { display: none !important; }   /* no description or status on the cards, anywhere */
@media (min-width: 821px) {
  .frame > .panel.is-cards { top: var(--mt); height: calc(8 * var(--u)); }
  .is-panel .frame:has(> .panel.is-cards) > .org { opacity: 0; pointer-events: none; }
  .panel.is-cards > .phead { display: block; position: relative; height: calc(1.39 * var(--u)); padding: 0; }
  .panel.is-cards .phead h2 { position: absolute; left: 0; top: calc(.95 * var(--u) - .8em); font-size: calc(.44 * var(--u)); }
  .panel.is-cards .phead .lede { display: none; }
  .panel.is-cards .phead .back { position: absolute; right: 0; top: calc(1.23 * var(--u) - .8em); font-size: calc(.3 * var(--u)); }
  .panel.is-cards .phead .back .arrow { display: none; }
  .panel.is-cards .htrack {
    width: calc(13 * var(--u)); height: calc(6.61 * var(--u));
    gap: calc(.41 * var(--u)); padding-right: calc(9 * var(--u));
  }
  .panel.is-cards .hfoot { display: none; }
  .panel.is-cards .htrack > .card { width: calc(3.72 * var(--u)); }
  .panel.is-cards .htrack > .card .media { flex: none; aspect-ratio: 5 / 7; }
  .panel.is-cards .card .num { height: auto; margin: calc(.2 * var(--u)) 0 calc(.05 * var(--u)); font-size: calc(.53 * var(--u)); line-height: 1; }
  .panel.is-cards .card h3 { margin: 0; font-size: calc(.42 * var(--u)); line-height: 1.1; white-space: nowrap; overflow: visible; }
}

/* "Coming soon." (comingSoon in content.js): in the display italic, on the line under row 3 */
.soon { margin: 0; font-family: var(--display); font-style: italic; font-weight: 700; line-height: 1; color: var(--ink); font-size: 34px; }
@media (min-width: 821px) {
  .panel > .soon { font-size: calc(.6 * var(--u)); padding-top: calc(.7 * var(--u)); }
}
