/* ============================================================
   1. DESIGN TOKENS
   Custom properties ("CSS variables"). Define a value once here,
   reuse it everywhere below. Change the brand red in one place
   and the whole site updates.
   ============================================================ */
:root {
  --red:        #c1391a;
  --ink:        #111111;
  --grey-hero:  #d6d6d6;
  --grey-bar-1: #f2f2f2;
  --grey-bar-2: #cfcfcf;
  --sand:       #e9d8c3;
  --green:      #414e3a;
  --cream:      #f1f0e8;

  /* Sampled from the live site's other pages: the Teaching blue
     and the Performing green. */
  --blue:       #35529c;
  --forest:     #344734;
  --night:      #0e0e0e;
  --red-bright: #e8613f;   /* the brand red, lifted so it stays
                              readable on black */
  --red-deep:   #a12f14;   /* ...and deepened for small text on sand
                              or cream (5:1 contrast instead of 3.9:1) */

  /* --- Type ---
     Young Serif (headings) has ONE weight and no italic, so it is
     only ever used at 400, upright. Libre Franklin (text) is a
     variable font: any weight from 400 to 700, with true italics.
     Both include the Hawaiian okina and macrons (Hawaiʻi, Mānoa). */
  --font-display: 'Young Serif', Georgia, 'Times New Roman', serif;
  --font-body:    'Libre Franklin', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  /* One type scale for the whole site. Each clamp() grows smoothly
     from its phone size to its desktop size. */
  --text-label: 0.8125rem;                                /* 13px  capitals labels   */
  --text-small: 0.9375rem;                                /* 15px  captions, meta    */
  --text-body:  1.0625rem;                                /* 17px  running text      */
  --text-lede:  clamp(1.15rem, 1rem + 0.6vw, 1.4rem);     /* 18-22 intros            */
  --text-h3:    clamp(1.45rem, 1.2rem + 0.9vw, 1.9rem);   /* 23-30 card titles       */
  --text-h2:    clamp(1.9rem, 1.4rem + 1.9vw, 2.9rem);    /* 30-46 section titles    */
  --text-h1:    clamp(2.6rem, 1.6rem + 4vw, 4.75rem);     /* 42-76 page titles       */

  --pad-x: clamp(1.25rem, 4vw, 3rem);   /* page side padding, fluid */
}

/* ============================================================
   2. RESET
   Browsers ship their own default margins/padding that differ
   slightly. We flatten them so we start from a known state.
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }   /* padding+border count INSIDE width */

body, h1, h2, h3, p, figure, dl, dd { margin: 0; }

img {
  display: block;      /* kills the mystery gap under inline images */
  max-width: 100%;     /* never overflow its container */
  height: auto;        /* keep the aspect ratio */
}

html {
  /* Never let the browser fake a bold or italic it doesn't have -
     a faked "italic" is just the upright letters slanted. */
  font-synthesis: none;

  /* iPhones enlarge text when turned sideways unless told not to;
     the type scale already adapts to the screen by itself. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}

/* Even out ragged lines: headings split into balanced lines,
   paragraphs avoid a lonely last word. */
h1, h2, h3 { text-wrap: balance; }
p, dd, li, figcaption { text-wrap: pretty; }

a { color: inherit; }

/* ============================================================
   3. SITE HEADER
   Flexbox: brand and nav on one row, pushed to opposite ends.
   ============================================================ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;   /* max space BETWEEN the two children */
  gap: 1rem;
  padding: 1.1rem var(--pad-x);
  background: linear-gradient(to bottom, var(--grey-bar-1), var(--grey-bar-2));
  color: var(--ink);   /* stay dark even on pages with light text */
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem);
  letter-spacing: -0.005em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
  font-size: 1rem;
  font-weight: 500;
}

.site-nav a {
  position: relative;            /* anchor for the ::after underline */
  text-decoration: none;
  /* 9px above and below make each link a comfortable 44px tall for
     a fingertip; the negative margins hand the space back, so the
     header itself is no taller than before. */
  padding: 9px 0;
  margin: -9px 0 -6px;
  transition: color 0.25s ease;
}

/* The underline is a pseudo-element rather than a border, because a
   border can only appear or disappear - this one can be ANIMATED. */
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;                   /* 3px under the text */
  height: 1px;
  background: currentColor;      /* follows the link's colour to red */
  transform: scaleX(0);
  transform-origin: right;       /* on the way OUT it retracts rightward */
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;        /* on the way IN it sweeps from the left */
}

.site-nav a:hover,
.site-nav a:focus-visible { color: var(--red); }

/* the current page keeps its underline drawn at all times */
.site-nav .is-current::after { transform: scaleX(1); }

.site-nav .nav-icon {         /* (".site-nav" so it outranks the link padding above) */
  display: flex;               /* centres the SVG on the text baseline */
  padding: 14px;               /* a 44px target round a 16px icon... */
  margin: -14px;               /* ...taking up no more room than before */
}

.nav-icon::after { content: none; }   /* the icon tilts instead of underlining */

.nav-icon svg {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-icon:hover svg,
.nav-icon:focus-visible svg { transform: rotate(-10deg) scale(1.18); }

/* ============================================================
   4. HERO
   position: relative makes this the anchor that the absolutely
   positioned eyes measure themselves against.
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;            /* crops the eyes at the section edge */
  background-color: var(--grey-hero);
  /* Decorative spirals, drawn as an inline SVG data URI: no extra
     HTTP request, and it tiles forever at any screen size. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='460' height='460' viewBox='0 0 460 460'%3E%3Cg fill='none' stroke='%23c4c4c4' stroke-width='9' stroke-linecap='round'%3E%3Cg transform='translate(110,120) rotate(25) scale(1)'%3E%3Cpath d='M0 0 a12 12 0 0 1 24 0 a18 18 0 0 1 -36 0 a24 24 0 0 1 48 0 a30 30 0 0 1 -60 0 a36 36 0 0 1 72 0 a42 42 0 0 1 -84 0'/%3E%3C/g%3E%3Cg transform='translate(350,60) rotate(165) scale(0.75)'%3E%3Cpath d='M0 0 a12 12 0 0 1 24 0 a18 18 0 0 1 -36 0 a24 24 0 0 1 48 0 a30 30 0 0 1 -60 0 a36 36 0 0 1 72 0 a42 42 0 0 1 -84 0'/%3E%3C/g%3E%3Cg transform='translate(300,330) rotate(95) scale(1.1)'%3E%3Cpath d='M0 0 a12 12 0 0 1 24 0 a18 18 0 0 1 -36 0 a24 24 0 0 1 48 0 a30 30 0 0 1 -60 0 a36 36 0 0 1 72 0 a42 42 0 0 1 -84 0'/%3E%3C/g%3E%3Cg transform='translate(60,380) rotate(250) scale(0.65)'%3E%3Cpath d='M0 0 a12 12 0 0 1 24 0 a18 18 0 0 1 -36 0 a24 24 0 0 1 48 0 a30 30 0 0 1 -60 0 a36 36 0 0 1 72 0 a42 42 0 0 1 -84 0'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-size: 460px 460px;
  padding: clamp(3rem, 8vw, 6rem) var(--pad-x);
  min-height: 46vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- decorative googly eyes --- */
.hero-eyes {
  position: absolute;
  inset: 0;                    /* shorthand for top/right/bottom/left: 0 */
  pointer-events: none;        /* never blocks clicks on real content */
}

.eye {
  position: absolute;
  border-radius: 50%;
  border: 0.9rem solid var(--ink);
  background: transparent;
}

.eye::after {                  /* the pupil */
  content: "";
  position: absolute;
  width: 55%;
  height: 55%;
  border-radius: 50%;
  background: var(--ink);
  top: 12%;
  right: 8%;
}

.eye--lg {
  width: clamp(9rem, 15vw, 14.5rem);
  aspect-ratio: 1;             /* height always equals width */
  right: 3%;
  bottom: -8%;
}

.eye--sm {
  width: clamp(5rem, 9vw, 8.5rem);
  aspect-ratio: 1;
  right: 17%;
  bottom: -14%;
  border-width: 0.7rem;
}

/* --- hero content --- */
.hero-content {
  position: relative;          /* sits ABOVE the eyes in stacking order */
  z-index: 1;
  text-align: center;
  width: min(56rem, 100%);
}

.wordmark {
  background: #fff;
  padding: clamp(1rem, 3vw, 2rem) clamp(1.5rem, 4vw, 3rem);
}

.tagline {
  margin-top: 1.1rem;
  font-size: clamp(1.05rem, 0.9rem + 0.8vw, 1.35rem);
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
}

.tagline a {
  text-underline-offset: 4px;
  padding: 0.5rem 0;           /* taller tap target, same layout */
  margin: -0.5rem 0;
}
.tagline a:hover { color: var(--red); }
.tagline span { opacity: 0.55; }

/* ============================================================
   5. BIO BAND
   CSS Grid: two columns on wide screens, stacked on narrow.
   ============================================================ */
.bio {
  background: var(--red);
  color: #fff;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad-x);
}

.bio-inner {
  max-width: 78rem;
  margin-inline: auto;          /* centres the block horizontally */

  display: grid;
  /* Text column is flexible, photo column is fixed-ish.
     minmax() = "never smaller than 0, never bigger than 22rem" */
  grid-template-columns: 1fr minmax(0, 22rem);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;          /* vertically centre the two columns
                                   against each other */
}

.bio-text {
  font-style: italic;
  font-size: var(--text-lede);
  line-height: 1.6;
  max-width: 54ch;              /* ch = width of a "0". 45-75ch is the
                                   readable line-length sweet spot. */
}

.bio-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;            /* fill the square, crop the overflow,
                                   never squash the face */
}

/* ============================================================
   6. RESPONSIVE
   A media query: "from 860px and DOWN, apply these overrides."
   Everything above was written mobile-friendly first; this only
   handles what genuinely can't work in one column.
   ============================================================ */
@media (max-width: 860px) {
  .bio-inner {
    grid-template-columns: 1fr;   /* collapse to a single column */
    justify-items: center;        /* centres the photo; the text stays
                                     left-aligned - a long centred
                                     paragraph is hard to read */
  }

  .bio-photo { max-width: 18rem; }

  .bio-text { max-width: 100%; }
}

/* ============================================================
   7. WORK GRID
   Four images, two columns, edge to edge. No gap - the images
   butt against each other exactly as in the reference.
   ============================================================ */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* "2 columns, equal share" */
}

.tile {
  position: relative;      /* anchor for the label and the shade */
  display: block;
  overflow: hidden;        /* required: crops the image as it zooms */
  background: var(--ink);  /* colour behind the image while it loads */
}

.tile img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.tile:hover img,
.tile:focus-visible img { transform: scale(1.04); }

/* ============================================================
   8. FOOTER
   ============================================================ */
.site-footer {
  background: var(--sand);
  color: var(--ink);
  padding: clamp(1.5rem, 3vw, 2.25rem) var(--pad-x);

  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* the two 1fr rails are equal,
                                            so the middle cell lands dead
                                            centre on the PAGE, not just
                                            between its neighbours */
  align-items: start;
  gap: 1rem;
}

.footer-name {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem);
}

.footer-links {
  margin-top: 1.4rem;
  font-size: var(--text-small);
  color: var(--red-deep);
}

.footer-links a {
  text-underline-offset: 3px;
  display: inline-block;       /* so the padding below counts for taps */
  padding: 0.8rem 0;           /* a fingertip-sized target... */
  margin: -0.8rem 0;           /* ...without spreading the lines apart */
}
.footer-links a:hover { color: var(--ink); }

.footer-copy {
  font-size: var(--text-small);
  padding-top: 0.35rem;
}

@media (max-width: 640px) {
  .work-grid    { grid-template-columns: 1fr; }   /* one image per row */
  .site-footer  { grid-template-columns: 1fr; text-align: center; }
  .footer-spacer { display: none; }
}

/* ============================================================
   9. PHONE HEADER + HERO
   Below 640px there isn't room for brand and nav side by side.
   Stack them, and pull the decorative eyes down out of the way
   of the tagline.
   ============================================================ */
@media (max-width: 640px) {
  .site-header {
    flex-direction: column;   /* the SAME flex container, turned
                                 90 degrees - one property */
    gap: 0.75rem;
  }

  .site-nav { gap: 1.1rem; font-size: 0.95rem; }

  /* the tagline wraps here, so drop the | dividers rather than
     leave one dangling at the end of a line */
  .tagline { gap: 0.35rem 1.25rem; }
  .tagline span { display: none; }

  .eye--lg { width: 7rem;   right: 4%;  bottom: -14%; }
  .eye--sm { width: 4.2rem; right: 30%; bottom: -18%; }
}

/* ============================================================
   10. ABOUT PAGE
   ============================================================ */
.about {
  background: var(--green);
  color: var(--cream);
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 3vw, 2.5rem)
           clamp(4rem, 9vw, 8rem);
}

.about-grid {
  max-width: 82rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 38%);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-h1);
  line-height: 1.02;
  letter-spacing: -0.015em;     /* big type looks better a touch tighter */
  margin-bottom: 1.6rem;
}

/* .prose styles the CHILDREN of one wrapper, so every paragraph
   inside picks up the same rhythm without its own class. */
.prose p {
  font-size: var(--text-body);
  line-height: 1.75;
  margin-bottom: 1.5rem;
  max-width: 66ch;
}

.prose p:last-child { margin-bottom: 0; }

/* The opening paragraph is set larger, like a lede, so a long
   page of text has a clear way in. */
.prose p:first-child {
  font-size: var(--text-lede);
  line-height: 1.6;
  max-width: 52ch;
}

cite { font-style: italic; }   /* <cite> = the title of a work.
                                  Semantic, and italic by default
                                  in most browsers - we just make
                                  it explicit. */

.upcoming-title { margin-top: clamp(5rem, 13vw, 12rem); }

.upcoming-text {
  font-size: var(--text-lede);
  line-height: 1.65;
  max-width: 42ch;
  margin-top: 3rem;
}

/* --- the image column --- */
.about-media {
  display: grid;
  gap: 0;                        /* the two photos touch, as in the design */
}

.about-media img { width: 100%; object-fit: cover; }

.media-tall     { aspect-ratio: 47 / 109; }
.media-portrait { aspect-ratio: 47 / 56; object-position: top; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }

  /* Put the photos ABOVE the text on narrow screens. Grid can
     reorder content visually without touching the HTML - the
     reading order for screen readers stays unchanged. */
  .about-media { order: -1; }

  /* the two photos side by side, so the words start sooner - and so
     neither photo is taller than a phone held sideways */
  .about-media { grid-template-columns: 1fr 1fr; }
  .media-tall,
  .media-portrait { aspect-ratio: 4 / 5; }
  .about-media img { max-height: 85vh; max-height: 85svh; }

  .upcoming-title { margin-top: 4rem; }
}

/* ============================================================
   11. SELF-HOSTED FONTS
   Both faces are served from our own /fonts directory. No Google,
   no third-party request, and the site works offline.

   Each face is split in two files by unicode-range: "latin" holds
   English plus the okina, "latin-ext" holds the macrons (ā, ō...).
   The browser only downloads latin-ext on a page that needs it.
   Libre Franklin is a VARIABLE font: one file covers every weight
   from 400 to 700.

   The old Adonis and Pontano Sans files are still in /fonts but
   nothing uses them any more: both had a single weight and no
   italic, so every italic on the site was a faked slant.
   ============================================================ */
@font-face {
  font-family: 'Young Serif';
  src: url('../fonts/young-serif-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;   /* show fallback text immediately, swap the real
                           font in when it arrives - never a blank page */
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Young Serif';
  src: url('../fonts/young-serif-latin-ext.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Libre Franklin';
  src: url('../fonts/libre-franklin-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Libre Franklin';
  src: url('../fonts/libre-franklin-latin-ext.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Libre Franklin';
  src: url('../fonts/libre-franklin-italic-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Libre Franklin';
  src: url('../fonts/libre-franklin-italic-latin-ext.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ============================================================
   12. THE LIVING EYE
   The pupil was erased from the wordmark image and is redrawn
   here as a real element, so it can move and change size.
   Every number below is a percentage of the IMAGE, measured
   from the original artwork - so it stays locked to the O at
   any screen size.
   ============================================================ */
.wordmark-inner {
  position: relative;
  display: block;
}

/* The pupil's size, as a fraction of the artwork's own pupil.
   Registering it as a number lets the browser animate it. */
@property --pupil-scale {
  syntax: '<number>';
  inherits: false;
  initial-value: 0.55;
}

.logo-pupil {
  position: absolute;

  /* centre of the O, as a fraction of the image box */
  left: 52.012%;
  top:  48.148%;

  /* pupil diameter, as a fraction of image WIDTH (54px of 1019px) */
  width: 5.299%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);

  /* At rest the pupil is small, about half the artwork's size, like
     an eye in bright light. It dilates when a link is highlighted. */
  --pupil-scale: 0.55;

  /* First translate centres the pupil on its own anchor point.
     Second one is the offset JS drives - defaulting to the exact
     resting position of the original artwork, so the logo looks
     untouched before the mouse ever moves. scale() comes LAST, so it
     resizes the pupil around its own centre without disturbing
     where the two translates put it. */
  transform:
    translate(-50%, -50%)
    translate(var(--pupil-x, -8.33%), var(--pupil-y, 16.67%))
    scale(var(--pupil-scale));

  /* Only the size is animated here. Position is moved frame by frame
     by eye.js, so it needs no transition of its own.
     Narrowing back down is calm... */
  transition: --pupil-scale 1.2s ease;
  will-change: transform;
}

/* :has() lets a PARENT react to a child's state. Hovering any link in
   the tagline OR the top-right menu dilates the pupil, as if the eye
   is interested. The menu lives in <header>, a SIBLING of the hero, so
   the match is made from <body> - the nearest ancestor with both.
   At 1.05 the pupil is just past the artwork's own size: wide open,
   but still clear of the O's edge when it looks around. */
.hero-content:has(.tagline a:hover) .logo-pupil,
.hero-content:has(.tagline a:focus-visible) .logo-pupil,
body:has(.site-nav a:hover) .logo-pupil,
body:has(.site-nav a:focus-visible) .logo-pupil {
  --pupil-scale: 1.05;
  /* ...and opening is slower still, easing in and out, the way a
     real pupil widens */
  transition: --pupil-scale 2.2s ease-in-out;
}

/* Anyone who has asked their OS to reduce motion gets no tracking:
   the pupil stays where the artwork has it. It still widens and
   narrows slowly - a gentle change of size, not movement across
   the screen. (Windows turns this setting on whenever "Animation
   effects" is switched off.) */
@media (prefers-reduced-motion: reduce) {
  .site-nav a::after,
  .nav-icon svg { transition: none; }

  .logo-pupil {
    transform: translate(-50%, -50%) translate(-8.33%, 16.67%) scale(var(--pupil-scale)) !important;
  }
}

/* ============================================================
   13. SHARED PIECES FOR THE NEW PAGES
   ============================================================ */

/* A "skip" link: invisible until a keyboard user tabs onto it,
   then it lets them jump straight past the menu. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus { top: 1rem; }

/* On wider screens the header follows you down the page.
   position: sticky behaves like normal flow until it reaches
   top: 0, then it pins itself there. Not on short screens, though:
   on a phone held sideways it would cover a fifth of the view. */
@media (min-width: 641px) and (min-height: 500px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  }
}

/* --- page themes ---
   Each page sets ONE class on <body>. Everything inside reads
   these variables, so a component looks right on any colour. */
.theme-night  { --page-bg: var(--night);  --page-fg: var(--cream); --accent: var(--red-bright); --rule: rgba(241, 240, 232, 0.18); }
.theme-blue   { --page-bg: var(--blue);   --page-fg: #fff;         --accent: var(--sand);       --rule: rgba(255, 255, 255, 0.28); }
.theme-forest { --page-bg: var(--forest); --page-fg: var(--cream); --accent: var(--sand);       --rule: rgba(241, 240, 232, 0.22); }
.theme-sand   { --page-bg: var(--sand);   --page-fg: var(--ink);   --accent: var(--red-deep);   --rule: rgba(17, 17, 17, 0.2); }
.theme-cream  { --page-bg: var(--cream);  --page-fg: var(--ink);   --accent: var(--red-deep);   --rule: rgba(17, 17, 17, 0.15); }

[class*="theme-"] {
  background: var(--page-bg);
  color: var(--page-fg);
}

/* centred content column + vertical rhythm for page sections */
.wrap {
  max-width: 82rem;
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.band { padding-block: clamp(3rem, 7vw, 6rem); }
.band--flush { padding-top: 0; }                     /* follows on from the section above */
.page-end { padding-bottom: clamp(4rem, 8vw, 7rem); } /* breathing room before the footer */

.page-head {
  padding-top: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

/* Small capitals labels - eyebrows, credits, years, form labels -
   all share one style, set like the role names in a printed
   programme: small, semibold, generously spaced. */
.eyebrow,
.card-year,
.project-facts dt,
.credits dt,
.pager-link small,
.discipline-num,
.lightbox-count,
.field label {
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow {
  opacity: 0.8;
  margin-bottom: 1rem;
}

.eyebrow a {
  text-decoration: none;
  display: inline-block;
  padding: 0.8rem 0;           /* the small "Projects" link, made tappable */
  margin: -0.8rem 0;
}
.eyebrow a:hover { color: var(--accent); }

.lede {
  font-size: var(--text-lede);
  font-style: italic;
  line-height: 1.55;
  max-width: 46ch;
}

.head-actions { margin-top: 2rem; }

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-h2);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* title on the left, a button on the right, wrapping when tight */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

/* --- pill buttons --- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.4rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font: inherit;
  font-size: var(--text-small);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* invert on hover: the button borrows the page's own colours */
.button:hover,
.button:focus-visible {
  background: var(--page-fg, var(--ink));
  color: var(--page-bg, #fff);
}

.button svg { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.button:hover svg { transform: translateX(3px); }
.button[href^="http"]:hover svg { transform: translate(2px, -2px); }

.button--solid {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.button--solid:hover,
.button--solid:focus-visible {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.button:disabled { opacity: 0.6; cursor: progress; }

/* ============================================================
   14. WORK TABS
   The real site keeps Projects, Teaching, Performing and Design
   in a "Work" folder. This strip lets you hop between them.
   ============================================================ */
.work-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.1rem var(--pad-x) 0;
}

.work-tabs a {
  padding: 0.45rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: var(--text-small);
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.work-tabs a:hover,
.work-tabs a:focus-visible { border-color: currentColor; }

.work-tabs .is-current {
  background: var(--page-fg);
  color: var(--page-bg);
}

/* ============================================================
   15. PROJECT CARDS
   A 12-column grid. The first two cards span 6 columns (half
   the row), every other card spans 3 (a quarter). On narrower
   screens they all fall back to halves, then full width.
   ============================================================ */
.project-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.75rem, 3vw, 2.75rem) clamp(1rem, 2vw, 1.75rem);
}

.project-grid > li            { grid-column: span 3; }
.project-grid > li.is-feature { grid-column: span 6; }

/* the home page shows three cards, a third each */
.project-grid--three > li { grid-column: span 4; }

@media (max-width: 1024px) {
  .project-grid > li,
  .project-grid > li.is-feature { grid-column: span 6; }
}

@media (max-width: 640px) {
  .project-grid > li,
  .project-grid > li.is-feature { grid-column: 1 / -1; }
}

.card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #222;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .card-media img,
.card:focus-visible .card-media img { transform: scale(1.05); }

.card-body {
  display: block;
  padding-top: 0.95rem;
}

.card-year {
  display: block;
  opacity: 0.75;
}

.card-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-h3);
  line-height: 1.1;
  margin: 0.35rem 0 0.4rem;
  transition: color 0.25s ease;
}

.is-feature .card-title { font-size: var(--text-h2); }

.card:hover .card-title,
.card:focus-visible .card-title { color: var(--accent); }

.card-meta {
  display: block;
  font-size: var(--text-small);
  line-height: 1.5;
  opacity: 0.8;
}

/* ============================================================
   16. A SINGLE PROJECT PAGE
   ============================================================ */
.project-hero { background: #000; }

.project-hero img {
  width: 100%;
  max-height: 78vh;
  max-height: 78svh;   /* "small" viewport: stays put as phone toolbars slide */
  object-fit: cover;
}

.project-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.project-byline {
  font-size: var(--text-lede);
  font-style: italic;
  line-height: 1.4;
  margin-top: -0.6rem;
}

.project-facts {
  margin-top: 1.75rem;
  display: grid;
  gap: 0.2rem;
}

.project-facts dt { opacity: 0.75; }

.project-note {
  margin-top: 2rem;
  line-height: 1.75;
  max-width: 58ch;
}

.project-note + .button { margin-top: 2rem; }

/* The credits, styled like a theatre programme: a cream card
   with a thin inner border, as if printed. */
.programme {
  position: relative;
  background: var(--cream);
  color: var(--ink);
  padding: 2.25rem 2rem 2rem;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
}

.programme::before {        /* the printed inner rule */
  content: "";
  position: absolute;
  inset: 0.55rem;
  border: 1px solid rgba(17, 17, 17, 0.28);
  pointer-events: none;
}

.programme-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 1.4rem;
}

.programme-title::after {   /* a small red flourish under the title */
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin: 0.8rem auto 0;
  background: var(--red);
}

.credits {
  display: grid;
  gap: 1rem;
}

.credits dt { color: var(--red-deep); margin-bottom: 0.15rem; }
.credits dd { font-size: var(--text-small); line-height: 1.55; }

/* --- previous / all / next --- */
.project-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding-block: 2.25rem 3.5rem;
  border-top: 1px solid var(--rule);
}

.pager-link {
  text-decoration: none;
  display: grid;
  gap: 0.2rem;
}

.pager-link small { opacity: 0.75; }

.pager-link span {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  line-height: 1.15;
  transition: color 0.25s ease;
}

.pager-link:hover span { color: var(--accent); }
.pager-link--next { text-align: right; }

@media (max-width: 860px) {
  .project-body { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .project-pager { grid-template-columns: 1fr 1fr; }
  .project-pager .button { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
}

/* ============================================================
   17. VIDEOS
   Each video starts as a thumbnail linking to YouTube. JS swaps
   in the real player only when clicked, so the page doesn't load
   seven YouTube players up front.
   ============================================================ */
.video-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* "as many 19rem columns as fit" - no media query needed */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 2rem 1.5rem;
}

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

/* never wider than 60rem, nor so wide that the player is taller than
   the screen (a phone held sideways) */
.video--wide { max-width: min(60rem, 80vh * 16 / 9); }
@supports (height: 1svh) {
  .video--wide { max-width: min(60rem, 80svh * 16 / 9); }
}

.video-link,
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-link { display: block; }

.video-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
  transition: opacity 0.3s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-link:hover img,
.video-link:focus-visible img { opacity: 1; transform: scale(1.03); }

.video-play {                 /* the round red play button */
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4.25rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-link:hover .video-play { transform: translate(-50%, -50%) scale(1.1); }

.video-title {
  margin-top: 0.75rem;
  font-weight: 500;
}

/* ============================================================
   18. PHOTO GALLERIES + LIGHTBOX
   CSS columns give a "masonry" layout: photos keep their own
   shapes and stack like bricks, no cropping.
   ============================================================ */
.gallery {
  columns: 3 16rem;           /* up to 3 columns, each at least 16rem */
  column-gap: 1rem;
}

.gallery--two { columns: 2 18rem; }

.gallery-item {
  break-inside: avoid;        /* never split one photo across columns */
  margin-bottom: 1rem;
}

.gallery-item a {
  display: block;
  overflow: hidden;
  cursor: zoom-in;
  background: rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item a:hover img,
.gallery-item a:focus-visible img { transform: scale(1.03); }

.gallery-item figcaption {
  font-size: var(--text-small);
  line-height: 1.5;
  padding-top: 0.55rem;
  opacity: 0.85;
}

/* The lightbox is a native <dialog>. showModal() gives us the
   dark ::backdrop, Esc-to-close and focus trapping for free. */
.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;   /* on phones: only the part not hidden behind the
                       browser's own address bar */
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.lightbox::backdrop { background: rgba(8, 8, 8, 0.94); }

.lightbox-figure {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: center;
  padding: 4rem clamp(1rem, 6vw, 5.5rem) 1.5rem;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-caption {
  max-width: 60ch;
  padding-top: 1rem;
  text-align: center;
  line-height: 1.5;
}

.lightbox-count {
  position: absolute;
  top: 1.4rem;
  left: 1.5rem;
  opacity: 0.75;
}

.lightbox-btn {
  position: absolute;
  width: 3rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lightbox-btn:hover,
.lightbox-btn:focus-visible { background: var(--red); border-color: var(--red); }

.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev  { left: 1rem;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox[data-single] .lightbox-prev,
.lightbox[data-single] .lightbox-next { display: none; }

@media (max-width: 640px) {
  .lightbox-prev,
  .lightbox-next { top: auto; bottom: 1rem; transform: none; }
}

/* ============================================================
   19. TEACHING
   ============================================================ */
.teaching-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
}

.teaching-copy p {
  line-height: 1.7;
  max-width: 56ch;
}

.teaching-copy p + p { margin-top: 1.25rem; }

/* four big numbers in a row, separated by hairlines */
.stats {
  list-style: none;
  margin: clamp(2.5rem, 5vw, 4rem) 0 0;
  padding: 0;
  display: grid;
  /* --cols is set by the page: as many columns as figures, up to 4 */
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.stats li { padding: 1.5rem 1.25rem; border-left: 1px solid var(--rule); }
.stats li.row-start { border-left: 0; }                 /* first in each row */
.stats li[data-row] { border-top: 1px solid var(--rule); }   /* second row onwards */

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.3rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}

.stat-label { font-size: var(--text-small); line-height: 1.45; opacity: 0.9; }

/* --- sample courses: native <details> accordions --- */
.course-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 5vw, 4.5rem);
}

.course-group h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-h3);
  line-height: 1.15;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid currentColor;
}

.course { border-bottom: 1px solid var(--rule); }

.course summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  font-weight: 500;
  cursor: pointer;
  list-style: none;            /* hide the default triangle... */
}

.course summary::-webkit-details-marker { display: none; }  /* ...in Safari too */

.course summary:hover .course-name { color: var(--accent); }

.course-name {
  flex: 1;                     /* pushes the chip and the + to the right */
  transition: color 0.2s ease;
}

.course-ages {
  font-size: var(--text-label);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
}

.course summary::after {       /* a + that turns into a x when open */
  content: "+";
  font-size: 1.5rem;
  line-height: 1;
  width: 1.2rem;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.course[open] summary::after { transform: rotate(45deg); }

.course p {
  line-height: 1.7;
  max-width: 62ch;
  padding-bottom: 1.25rem;
}

@media (max-width: 860px) {
  .teaching-intro,
  .course-groups { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li { border-left: 1px solid var(--rule); border-top: 0; }
  .stats li:nth-child(odd) { border-left: 0; }
  .stats li:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}

/* On phones the age chip can be longer than the course name, so
   let it wrap onto two lines instead of squeezing the title. */
@media (max-width: 480px) {
  .course-ages { white-space: normal; max-width: 9rem; text-align: center; }
}

/* ============================================================
   20. PERFORMING
   ============================================================ */
.perform-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.perform-hero img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.disciplines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem);
}

.discipline img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.discipline-num {
  display: block;
  margin-top: 1.25rem;
  color: var(--accent);
}

.discipline h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.5rem);
  line-height: 1.1;
  margin: 0.3rem 0 0.6rem;
}

.discipline p { line-height: 1.7; max-width: 50ch; }

.also-see { margin-top: 2rem; }

.also-see a { text-underline-offset: 4px; }
.also-see a:hover { color: var(--accent); }

@media (max-width: 860px) {
  .perform-hero { grid-template-columns: 1fr; }
  .perform-hero img { order: -1; }
}

@media (max-width: 640px) {
  .disciplines { grid-template-columns: 1fr; }
}

/* ============================================================
   21. CONTACT
   ============================================================ */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 6rem);
  max-width: 74rem;
}

.contact-photo {
  position: relative;
  margin: 0 1.25rem 1.25rem 0;   /* room for the offset block */
}

.contact-photo::before {         /* a red block peeking out behind */
  content: "";
  position: absolute;
  inset: 1.25rem -1.25rem -1.25rem 1.25rem;
  background: var(--red);
}

.contact-photo img {
  position: relative;            /* sits above the ::before block */
  width: 100%;
}

.contact-form {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.25rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.45rem;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: var(--text-body);
  color: var(--ink);
  padding: 0.85rem 1rem;
  border: 1.5px solid rgba(17, 17, 17, 0.3);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.5);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea { min-height: 10rem; resize: vertical; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(193, 57, 26, 0.3);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.form-status { font-size: var(--text-small); }
.form-status a { text-underline-offset: 3px; }

.botcheck { display: none; }   /* the spam trap: never shown to people */

.contact-alt {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.contact-alt a { text-underline-offset: 4px; }
.contact-alt a:hover { color: var(--red-deep); }

@media (max-width: 860px) {
  .contact { grid-template-columns: 1fr; }
  .contact-photo { max-width: 24rem; }
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ============================================================
   22. HOME PAGE ADDITIONS
   ============================================================ */

/* A label on each of the four big tiles, over a soft shade so
   white text stays readable on any photo. */
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 55%);
}

.tile-label {
  position: absolute;
  left: clamp(1rem, 2.5vw, 1.75rem);
  bottom: clamp(0.9rem, 2vw, 1.5rem);
  z-index: 1;                   /* above the ::after shade */
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.4rem);
  line-height: 1.1;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.tile-label svg {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.tile:hover .tile-label svg,
.tile:focus-visible .tile-label svg { opacity: 1; transform: none; }

/* ============================================================
   23. SCROLL REVEAL
   Cards drift up into place as they scroll into view. Pure CSS:
   browsers without scroll-driven animations (or visitors who
   asked for reduced motion) simply see everything in place.
   ============================================================ */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card-media img,
  .gallery-item img,
  .video-link img,
  .tile img { transition: none; }
}

/* ============================================================
   24. THE HERO, IN MOTION
   Everything here sits inside "no-preference", so visitors who
   asked their device for reduced motion get the still hero from
   section 4, exactly as before.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {

  /* --- the spirals ---
     The same tile as section 4, with one addition: each spiral
     carries an <animateTransform> that turns it slowly around its
     own centre (9,0 in its drawing). Four different speeds and
     directions, so the field never moves in lockstep.
     The tile moves onto a ::before layer that is a little bigger
     than the hero, so it can drift without its edges showing. */
  .hero { background-image: none; }

  .hero::before {
    content: "";
    position: absolute;
    inset: -48px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='460' height='460' viewBox='0 0 460 460'%3E%3Cg fill='none' stroke='%23c4c4c4' stroke-width='9' stroke-linecap='round'%3E%3Cg transform='translate(110,120) rotate(25) scale(1)'%3E%3Cpath d='M0 0 a12 12 0 0 1 24 0 a18 18 0 0 1 -36 0 a24 24 0 0 1 48 0 a30 30 0 0 1 -60 0 a36 36 0 0 1 72 0 a42 42 0 0 1 -84 0'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 9 0' to='360 9 0' dur='64s' repeatCount='indefinite'/%3E%3C/path%3E%3C/g%3E%3Cg transform='translate(350,60) rotate(165) scale(0.75)'%3E%3Cpath d='M0 0 a12 12 0 0 1 24 0 a18 18 0 0 1 -36 0 a24 24 0 0 1 48 0 a30 30 0 0 1 -60 0 a36 36 0 0 1 72 0 a42 42 0 0 1 -84 0'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 9 0' to='-360 9 0' dur='50s' repeatCount='indefinite'/%3E%3C/path%3E%3C/g%3E%3Cg transform='translate(300,330) rotate(95) scale(1.1)'%3E%3Cpath d='M0 0 a12 12 0 0 1 24 0 a18 18 0 0 1 -36 0 a24 24 0 0 1 48 0 a30 30 0 0 1 -60 0 a36 36 0 0 1 72 0 a42 42 0 0 1 -84 0'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 9 0' to='360 9 0' dur='80s' repeatCount='indefinite'/%3E%3C/path%3E%3C/g%3E%3Cg transform='translate(60,380) rotate(250) scale(0.65)'%3E%3Cpath d='M0 0 a12 12 0 0 1 24 0 a18 18 0 0 1 -36 0 a24 24 0 0 1 48 0 a30 30 0 0 1 -60 0 a36 36 0 0 1 72 0 a42 42 0 0 1 -84 0'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 9 0' to='-360 9 0' dur='56s' repeatCount='indefinite'/%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-size: 460px 460px;
    /* "alternate" plays forwards then backwards, so the drift
       breathes out and back instead of jumping to the start */
    animation: spirals-drift 22s ease-in-out infinite alternate;
  }

  /* --- the googly eyes ---
     Each eye bobs a little, out of step with the other. */
  .eye {
    animation: eye-bob 6s ease-in-out infinite alternate;
  }

  .eye--sm {
    animation-duration: 4.6s;
    animation-delay: -2s;          /* negative delay = start mid-bob */
  }

  /* The pupils glance around the room and settle. The small eye
     follows a fraction of a second behind, the way loose googly
     pupils do. */
  .eye::after {
    animation: eye-look 15s ease-in-out infinite;
  }

  .eye--sm::after { animation-delay: 0.2s; }

  /* When eye.js is running it steers the pupils itself - wherever it
     decides to glance - through --look-x and --look-y, so the CSS loop
     above steps aside. */
  .eye::after { translate: var(--look-x, 0px) var(--look-y, 0px); }
  .hero-eyes.is-live .eye::after { animation: none; }
}

@keyframes spirals-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(32px, -20px); }
}

@keyframes eye-bob {
  from { transform: translateY(0); }
  to   { transform: translateY(-7px); }
}

/* (eye-look is the fallback for when JavaScript is off.)
   Translate percentages are of the pupil's own size. Every stop
   keeps the pupil inside the ring; each glance takes about half a
   second, then holds for two. */
@keyframes eye-look {
  0%, 14%   { transform: translate(0, 0); }         /* up and right, as drawn */
  18%, 32%  { transform: translate(-59%, 10%); }    /* glance left */
  36%, 50%  { transform: translate(-48%, 46%); }    /* down and left */
  54%, 68%  { transform: translate(1%, 41%); }      /* down and right */
  72%, 86%  { transform: translate(-26%, -15%); }   /* straight up */
  90%, 100% { transform: translate(0, 0); }         /* back home */
}

/* ============================================================
   25. FOLLOW-SPOT
   On the black pages a soft pool of warm light follows the mouse,
   like a follow-spot operator tracking a performer. site.js adds
   the .spotlight layer and feeds it the cursor position.
   z-index: -1 puts it BEHIND the page content but in front of the
   page's black background, so it lights the stage, not the photos.
   ============================================================ */

/* Registering the two variables as lengths lets the browser animate
   them, so the light glides after the cursor with a little lag
   instead of snapping to it. */
@property --spot-x {
  syntax: '<length-percentage>';
  inherits: false;
  initial-value: 50%;
}

@property --spot-y {
  syntax: '<length-percentage>';
  inherits: false;
  initial-value: 0%;      /* before the mouse moves: light from above */
}

.spotlight {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle 34rem at var(--spot-x) var(--spot-y),
                              rgba(255, 226, 180, 0.09), transparent 70%);
  transition: --spot-x 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              --spot-y 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   26. BETWEEN PAGES
   Moving from page to page, the old page fades and the new one
   rises gently into place, like stage lights coming up. This is
   the browser's own View Transitions feature: pure CSS, and any
   browser without it simply changes page as normal.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  ::view-transition-old(root) {
    animation: 0.2s ease-in both page-out;
  }

  ::view-transition-new(root) {
    animation: 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both page-in;
  }
}

/* The header is the same on every page, so it gets its own name and
   stays put while the page beneath it changes. Only where it sticks
   to the top - on phones it scrolls away, and would slide in. */
@media (min-width: 641px) and (min-height: 500px) {
  .site-header { view-transition-name: site-header; }
}

@keyframes page-out {
  to { opacity: 0; }
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(14px); }
}

/* ============================================================
   27. TEACHING GALLERY: THE CONTACT SHEET
   The photos sit on a warm cream sheet of paper laid on the blue,
   like a page from a director's rehearsal notebook: faint paper
   grain, a red margin rule, a fine printed border, and a second
   page peeking out underneath. The details stay quiet so the
   photographs do the talking.
   ============================================================ */

/* Gives the sheet its own layer, so the page tucked underneath
   (.sheet::before) can sit behind the sheet but above the blue. */
.sheet-section { isolation: isolate; }

.sheet {
  /* paper: the site's cream, warmed with a little of its sand */
  --paper:  color-mix(in oklab, var(--cream) 78%, var(--sand));
  --margin: clamp(1.1rem, 2.6vw, 2.25rem);       /* where the red rule runs */
  --row-h:  clamp(5rem, 3.5rem + 8vw, 10.5rem);   /* height of each row of prints:
                                                    low enough on phones that
                                                    two or three share a row */
  --gap:    clamp(0.5rem, 1.2vw, 0.9rem);
  --mat:    4px;                                 /* white border round each print */
  --pad-y:  clamp(1.25rem, 3vw, 2.25rem);        /* paper above the first row - and
                                                    the same again either side of
                                                    the button, so it sits balanced */

  /* buttons on the sheet invert to ink-on-paper, not the page's blue */
  --page-fg: var(--ink);
  --page-bg: var(--paper);

  position: relative;
  color: var(--ink);
  padding: var(--pad-y)
           clamp(1rem, 3vw, 2.5rem)
           var(--pad-y)
           calc(var(--margin) + clamp(0.9rem, 2vw, 1.5rem));
  background-color: var(--paper);
  background-image:
    /* the notebook's red margin rule: a 1px stripe with hard edges */
    linear-gradient(to right,
      transparent var(--margin),
      rgba(193, 57, 26, 0.38) var(--margin),
      rgba(193, 57, 26, 0.38) calc(var(--margin) + 1px),
      transparent calc(var(--margin) + 1px)),
    /* paper grain: SVG noise, tinted warm and very faint */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.36 0 0 0 0 0.29 0 0 0 0 0.2 0 0 0 0.12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    /* edges a shade warmer than the middle, as paper ages */
    radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(110, 80, 40, 0.07));
  box-shadow: 0 28px 60px -30px rgba(8, 18, 48, 0.65);
}

.sheet::before {               /* the page underneath, slightly askew */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in oklab, var(--sand) 88%, var(--ink));
  transform: translate(7px, 9px) rotate(0.6deg);
  box-shadow: 0 20px 40px -24px rgba(8, 18, 48, 0.6);
}

.sheet::after {                /* a fine printed border, like the programme cards */
  content: "";
  position: absolute;
  inset: 0.55rem;
  border: 1px solid rgba(17, 17, 17, 0.12);
  pointer-events: none;
}

/* --- the rows ---
   Each photo asks for (its ratio x the row height) of width, and
   grows in proportion to its ratio. So every photo in a row ends up
   the same height, each keeps its own shape, and the row fills the
   sheet edge to edge. Nothing is cropped. */
.contact-sheet {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}

.contact-sheet::after {        /* soaks up the last row so it isn't stretched */
  content: "";
  flex-grow: 999;
}

.sheet-item {
  position: relative;
  margin: 0;
  flex: var(--ar) 1 calc(var(--ar) * var(--row-h) + 2 * var(--mat));
}

/* each photo is a small print: white border, hairline edge */
.sheet-item a {
  position: relative;          /* sits above the offset frame below */
  display: block;
  padding: var(--mat);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.1),
              0 1px 2px rgba(17, 17, 17, 0.12);
  cursor: zoom-in;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s ease;
}

.sheet-item img {
  width: 100%;
  transition: filter 0.35s ease;
}

/* hover: the print lifts a little off the page */
.sheet-item a:hover,
.sheet-item a:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.14),
              0 14px 24px -12px rgba(17, 17, 17, 0.5);
}

.sheet-item a:hover img { filter: brightness(1.05) contrast(1.03); }

.sheet-item a:focus-visible {
  outline: 2px solid var(--red-deep);
  outline-offset: 3px;
}

/* Now and then a print has a second, offset frame behind it, as if
   laid on top of another. Only an L of fine line shows. */
.sheet-item:nth-child(6n + 2)::before,
.sheet-item:nth-child(9n + 5)::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(17, 17, 17, 0.3);
  transform: translate(5px, 5px);
}

/* --- the first few rows, then the rest on request ---
   site.js marks every photo after the chosen row as .is-extra. While
   collapsed, the end-of-sheet spacer is switched off too, so the last
   row showing stretches edge to edge like every other row. */
.sheet.is-collapsed .sheet-item.is-extra,
.sheet.is-collapsed .contact-sheet::after { display: none; }

.sheet-more {
  margin-top: var(--pad-y);
  display: flex;               /* centres the button with no stray line-height */
  justify-content: center;
}

.sheet-more[hidden] { display: none; }   /* "display: flex" would otherwise win over hidden */

/* --- the lightbox, as used by every gallery --- */
.lightbox { touch-action: pan-y pinch-zoom; }   /* sideways swipes are ours */

.lightbox-figure img { transition: opacity 0.25s ease; }
.lightbox-figure img.is-loading { opacity: 0; }  /* fades in once loaded */

@media (prefers-reduced-motion: reduce) {
  .sheet-item a,
  .sheet-item img,
  .lightbox-figure img { transition: none; }
  .sheet-item a:hover,
  .sheet-item a:focus-visible { transform: none; }
}

/* ============================================================
   28. DESIGN GALLERY: JUSTIFIED ROWS
   Photos only, straight on the black. Each row is one height, each
   photo keeps its own shape, and every row - the last one too -
   runs edge to edge, with the same narrow gap all round.
   ============================================================ */
.justified {
  --gap:   clamp(6px, 0.8vw, 10px);
  --row-h: clamp(9rem, 6rem + 12vw, 15rem);   /* only used without JavaScript */
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}

/* Without JavaScript: the same flowing rows as the Teaching sheet,
   with a spacer so the last row isn't blown up to full width. */
.justified::after {
  content: "";
  flex-grow: 999;
}

.j-item {
  margin: 0;
  flex: var(--ar) 1 calc(var(--ar) * var(--row-h));
}

/* With JavaScript: site.js deals the photos into .j-row rows, chosen
   so every row comes out close to the same height. Inside a row each
   photo takes a share of the width in proportion to its shape, so
   heights match exactly and the row fills the width exactly. */
.justified.is-justified { display: block; }
.justified.is-justified::after { content: none; }

.j-row {
  display: flex;
  gap: var(--gap);
}

.j-row + .j-row { margin-top: var(--gap); }

.j-row .j-item {
  flex: var(--ar) 1 0;
  min-width: 0;                /* lets the shares come out exact */
}

.j-item a {
  display: block;
  overflow: hidden;            /* crops the slight zoom on hover */
  background: #1a1a1a;         /* placeholder tone while a photo loads */
  cursor: zoom-in;
}

.j-item img {
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.4s ease;
}

.j-item a:hover img,
.j-item a:focus-visible img {
  transform: scale(1.025);
  filter: brightness(1.06);
}

.j-item a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .j-item img { transition: none; }
  .j-item a:hover img,
  .j-item a:focus-visible img { transform: none; }
}

/* ============================================================
   29. PHONES, UPRIGHT AND SIDEWAYS
   Small adjustments so every page works on a phone held either
   way. (Most of the site already adapts through its fluid sizes.)
   ============================================================ */

/* Upright phones: the four Work tabs on one line instead of two,
   still each a comfortable 42px tall for a fingertip. */
@media (max-width: 480px) {
  .work-tabs {
    gap: 0.25rem;
    padding-inline: 0.75rem;
  }

  .work-tabs a {
    padding: 0.6rem;
    font-size: 0.875rem;
  }
}

/* the narrowest phones (360px): a touch smaller again */
@media (max-width: 380px) {
  .work-tabs a {
    padding: 0.6rem 0.5rem;
    font-size: 0.8125rem;
  }
}

/* Short screens (a phone held sideways): the photo viewer gives the
   photo almost all the height, with its buttons tucked in close. */
@media (max-height: 500px) {
  .lightbox-figure { padding: 0.75rem 4.5rem; }
  .lightbox-count  { top: 0.9rem; left: 0.9rem; }
  .lightbox-close  { top: 0.5rem; right: 0.75rem; }
  .lightbox-prev   { left: 0.75rem; }
  .lightbox-next   { right: 0.75rem; }
}

/* Phones held sideways: there's width to spare and little height, so
   two pages that stack their photo above the words go back to
   sitting side by side, keeping each photo within the screen. */
@media (orientation: landscape) and (max-height: 500px) {
  .perform-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .perform-hero img { order: 0; }

  .contact {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: start;        /* photo at the top, not halfway down the form */
  }
  .contact-photo { max-width: none; }

  /* Home: the wordmark sized to the screen's height, so the whole
     hero - logo and Maker | Educator | Performer | Designer - fits */
  .hero { padding-block: 1.25rem 1.75rem; min-height: 0; }
  .hero-content { width: min(56rem, 100%, 140vh); width: min(56rem, 100%, 140svh); }

  /* About's tall stage photo: no taller than the screen */
  .about-media img { max-height: 85vh; max-height: 85svh; }
}

/* ============================================================
   30. CONTENT FROM THE EDITOR
   The pages are now built from the content editor, so any project
   may have several facts, paragraphs, links or videos, and any
   gallery may hold one photo or fifty. These rules cover that.
   ============================================================ */

/* several facts on a project ("World premiere", "Produced"...) */
.project-facts > div + div { margin-top: 0.9rem; }
.project-facts dd { margin-top: 0.15rem; }

/* formatted text: paragraphs and lists */
.rich > * + *,
.upcoming-text > * + *,
.teaching-copy > * + * { margin-top: 1em; }
.rich ul, .rich ol,
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1.5rem; }
.rich li + li, .prose li + li { margin-top: 0.35em; }
.rich a, .prose a { text-underline-offset: 3px; }
.rich a:hover, .prose a:hover { color: var(--accent); }

.project-description { margin-top: 2rem; font-size: var(--text-lede); line-height: 1.6; max-width: 54ch; }

/* one or more link buttons on a project (e.g. SHEDDING's portfolio) */
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* several videos on one project */
.watch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}

/* uploaded (not YouTube/Vimeo) video files */
.video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

/* a project gallery with a single photo: one column, not half a page */
.gallery--two:has(> .gallery-item:only-child) { columns: 1; max-width: 60rem; }

/* the Projects page before anything is published */
.empty-note {
  font-size: var(--text-lede);
  font-style: italic;
  opacity: 0.8;
  padding-bottom: 3rem;
}

/* long galleries open with the first few, then a button for the rest
   (site.js adds .is-collapsed and the button) */
[data-expand].is-collapsed > .is-extra { display: none; }
.gallery-more {
  display: flex;
  justify-content: center;
  margin-top: clamp(1.25rem, 3vw, 2rem);
}

/* Design rows: a last row with only a photo or two keeps a natural
   height instead of being blown up to the full width */
.j-row.is-loose .j-item {
  flex: 0 0 auto;
  width: calc(var(--ar) * var(--row-height));
}

/* ============================================================
   31. "EDIT THIS PAGE"
   A small button that only appears for whoever can use the
   editor (see js/edit-link.js). Visitors never see it.
   ============================================================ */
.edit-page {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.05rem 0.65rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  transition: background-color 0.2s ease;
}
.edit-page:hover { background: var(--red); }
.edit-page:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 3px; }
.edit-page svg { width: 1rem; height: 1rem; flex: none; }
@media print { .edit-page { display: none; } }
