/* =====================================================================
   UNFOLD — Masters Degree Show 2026
   Horizontal paper-fold accordion.
   Layer model per student page (z-index, back to front):
     .page-media        z1  blurred scene photo (soft ambience only)
     .page-paper        z3  paper texture overlay + ghost silhouette (::after)
     .student-page::after z4  fold/spine shadow on the panel's left edge
     .subject-cutout    z5  SHARP full-body PNG, anchored from the right edge
     .page-copy         z6  quote + name typography
   ===================================================================== */

/* Utopia — used for the project-page body copy (artist statement, about
   the work, behind the work). Everything else keeps the Times New Roman
   stack. */
@font-face {
  font-family: "Utopia Std";
  src: url("Fonts/utopia-std/UtopiaStd-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Utopia Std";
  src: url("Fonts/utopia-std/UtopiaStd-Italic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Utopia Std";
  src: url("Fonts/utopia-std/UtopiaStd-Semibold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Utopia Std";
  src: url("Fonts/utopia-std/UtopiaStd-SemiboldIt.woff") format("woff");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #efebe2;
  --paper-deep: #ded8cc;
  --paper-warm: #f8f5ee;
  --gold: #b1863d;
  --gold-soft: #c2a05a;
  --ink: #38342d;
  --shadow: rgba(52, 50, 45, 0.28);
  --soft-shadow: rgba(52, 50, 45, 0.12);

  /* Slow, editorial motion */
  --duration: 1150ms;
  --duration-fast: 720ms;
  --ease: cubic-bezier(0.22, 0.61, 0.18, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background:
    linear-gradient(rgba(247, 244, 236, 0.7), rgba(238, 234, 225, 0.8)),
    url("Assets/Web texture.png") center / cover fixed,
    var(--paper);
  font-family: "Times New Roman", Georgia, serif;
  overflow: hidden;
}

button {
  font: inherit;
}

/* ---------------------------------------------------------------------
   Shiny polished-gold text — a high-contrast metallic gradient with
   bright highlight bands, clipped to the glyphs, plus a slow sweeping
   shimmer so the gold catches the light. Applied to the DEGREE-SHOW
   NAME (UNFOLD) only — the student names are flat var(--gold), the same
   as the rest of the gold type on the page. Falls back to solid gold.
   --------------------------------------------------------------------- */
.cover-title,
.menu-logo,
.holding-title {
  background-image:
    linear-gradient(
      110deg,
      #a8772a 0%,
      #b1863d 26%,
      #d9b760 40%,
      #f3e4ad 50%,
      #d9b760 60%,
      #b1863d 74%,
      #a8772a 100%
    );
  /* image is wider than the text (220%) and NEVER repeats off it, so the
     glyphs always stay filled — it only ever shows part of the gradient,
     so the text can't disappear at the end of a cycle. */
  background-size: 220% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* slow, subtle sheen that eases back and forth (no jump, no gap) */
  animation: goldShimmer 9s ease-in-out infinite alternate;
}

@keyframes goldShimmer {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}

.site-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 620px;
}

.accordion {
  /* cover width is a variable so default vs active can animate smoothly */
  --cover-width: clamp(250px, 21vw, 400px);
  display: flex;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 40%),
    var(--paper);
  isolation: isolate;
}

/* =====================================================================
   Shared panel shell
   ===================================================================== */
.cover-panel,
.student-page {
  position: relative;
  display: block;
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  appearance: none;
  contain: layout paint;
}

.cover-panel:focus-visible,
.student-page:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold), white 24%);
  outline-offset: -10px;
}

/* =====================================================================
   COVER PANEL
   ===================================================================== */
.cover-panel {
  flex: 0 0 var(--cover-width);
  z-index: 30;
  text-align: left;
  background:
    linear-gradient(rgba(248, 244, 236, 0.4), rgba(231, 226, 214, 0.5)),
    url("Assets/Web texture.png") center / cover;
  /* straight vertical right edge (no slant), squared off in both states */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  /* Drop shadow matched 1:1 to the Illustrator file:
     Multiply, black, 45% opacity, X 7px, Y 7px, Blur 5px.
     (drop-shadow follows the clipped silhouette; box-shadow would be
     clipped away by clip-path.) */
  filter: drop-shadow(7px 7px 5px rgba(0, 0, 0, 0.45));
  transition:
    flex-basis var(--duration) var(--ease),
    clip-path var(--duration) var(--ease),
    filter var(--duration) var(--ease);
  will-change: flex-basis, clip-path;
}

/* active: cover narrows and squares off into a tidy folded front page */
.accordion.is-active .cover-panel {
  --cover-width: clamp(190px, 15vw, 250px);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  box-shadow: 12px 0 28px rgba(50, 48, 44, 0.18);
}

/* soft paper sheen */
.cover-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.32), transparent 36%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(188, 181, 168, 0.06));
  mix-blend-mode: screen;
}

/* ---------------------------------------------------------------------
   cover fold edge
   Clean angled paper cut: no interior highlight band — just a faint
   darkening right at the edge, with the soft external shadow handled by
   the cover's drop-shadow filter (above). Matches the reference edge.
   --------------------------------------------------------------------- */
.cover-fold {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  /* no interior shading — the clean cut + Illustrator drop shadow do the work */
  background: none;
  transition: width var(--duration) var(--ease), opacity var(--duration) var(--ease);
}

.accordion.is-active .cover-fold {
  width: 18px;
}

/* --- RSVP button (top-left, opens the RSVP form) --------------------- */
.rsvp-button {
  position: fixed;
  top: 3vh;
  left: clamp(18px, 1.7vw, 34px);
  z-index: 40; /* above the cover (30), below the menu overlay (50) */
  margin: 0;
  padding: 10px 16px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-size: clamp(10px, 0.72vw, 13px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}

.rsvp-button:hover {
  background: var(--gold);
  color: var(--paper);
}

.rsvp-button:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--gold), white 24%);
  outline-offset: 3px;
}

/* the title block is vertically centred inside the cover so it always
   sits elegantly — never clipped — whatever the cover width */
.cover-block {
  position: absolute;
  top: 23vh; /* upper-middle, like the reference */
  left: 0;
  right: 40px; /* keep clear of the fold strip */
  z-index: 6;
  display: block;
  padding-inline: clamp(14px, 2vw, 32px);
  transition: padding var(--duration) var(--ease), right var(--duration) var(--ease), top var(--duration) var(--ease);
}

.accordion.is-active .cover-block {
  right: 26px;
  padding-inline: clamp(16px, 2vw, 26px);
}

.cover-title {
  display: block;
  color: var(--gold);
  font-size: clamp(28px, 2.5vw, 50px);
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transition: font-size var(--duration) var(--ease), letter-spacing var(--duration) var(--ease);
}

/* shrink + tighten so UNFOLD always fits the narrow folded cover */
.accordion.is-active .cover-title {
  font-size: clamp(22px, 1.9vw, 34px);
  letter-spacing: 0.16em;
}

.cover-subtitle {
  display: block;
  margin-top: clamp(10px, 1.1vw, 18px);
  font-size: clamp(8px, 0.62vw, 11px);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #4a443a;
  transition: font-size var(--duration) var(--ease), letter-spacing var(--duration) var(--ease);
}

.accordion.is-active .cover-subtitle {
  font-size: clamp(7px, 0.5vw, 9px);
  letter-spacing: 0.3em;
}

.cover-rule {
  display: block;
  width: 44px;
  height: 1px;
  margin-top: clamp(14px, 1.4vw, 22px);
  background: var(--gold);
}

.cover-year {
  display: block;
  margin-top: clamp(10px, 1vw, 16px);
  font-size: clamp(9px, 0.66vw, 12px);
  letter-spacing: 0.4em;
  color: #4a443a;
}

/* lower-area gold arrow */
.cover-arrow {
  position: absolute;
  z-index: 6;
  left: clamp(20px, 4vw, 56px);
  bottom: 12vh;
  width: 54px;
  height: 12px;
  transition: left var(--duration) var(--ease);
}

.accordion.is-active .cover-arrow {
  left: clamp(16px, 2vw, 26px);
}

.cover-arrow::before,
.cover-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
}

.cover-arrow::before {
  left: 0;
  height: 1px;
  background: var(--gold);
}

.cover-arrow::after {
  width: 9px;
  height: 9px;
  border-top: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
  transform: translateY(-50%) rotate(45deg);
}

/* =====================================================================
   STUDENT STACK
   ===================================================================== */
.student-stack {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}

.student-page {
  /* default folded-page width share */
  --strip-width: clamp(30px, 1.4vw, 44px);

  /* ---- active subject anchoring (right-edge based = never cropped) ----
     --subject-right : gap from the page's RIGHT edge to the figure
     --subject-bottom: gap from the page's bottom to the figure's feet
     --subject-height: figure height (clamped responsively)
     --subject-max-width: safety cap so a figure never spans the page  */
  --subject-right: 7%;
  --subject-bottom: 0%;
  --subject-height: clamp(360px, 84vh, 940px);
  --subject-max-width: 30%;

  flex: 1 1 20%;
  z-index: 2;
  background: var(--paper);
  transition:
    flex-basis var(--duration) var(--ease),
    flex-grow var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
  will-change: flex-basis, flex-grow;
}

/* ---------------------------------------------------------------------
   PER-STUDENT SUBJECT POSITIONING  (manual tuning lives here)
   Increase --subject-right to move a student further LEFT (inward).
   Increase --subject-height to make them taller.
   --------------------------------------------------------------------- */

/* Aga subject positioning */
.student-page[data-index="0"] {
  --sil-h: 95%; /* matched to Mister Dude's apparent height */
  --subject-right: 8%;
  --subject-bottom: 0%;
  --subject-height: clamp(360px, 86vh, 960px);
  --subject-max-width: 30%;
}

/* Karol subject positioning */
.student-page[data-index="1"] {
  --sil-h: 88%; /* matched to Mister Dude's apparent height */
  --subject-right: 8%;
  --subject-bottom: 0%;
  --subject-height: clamp(360px, 85vh, 940px);
  --subject-max-width: 30%;
}

/* Diana subject positioning */
.student-page[data-index="2"] {
  --sil-h: 110%; /* PNG has big headroom — matched to Mister Dude */
  --subject-right: 9%;
  --subject-bottom: 0%;
  --subject-height: clamp(360px, 86vh, 960px);
  --subject-max-width: 30%;
}

/* Mister subject positioning — pulled inward so he is never cut off */
.student-page[data-index="3"] {
  --sil-h: 109%; /* moderate headroom in PNG */
  --subject-right: 11%;
  --subject-bottom: 0%;
  --subject-height: clamp(360px, 85vh, 940px);
  --subject-max-width: 30%;
}

/* Laura subject positioning — pulled inward so she is never cut off */
.student-page[data-index="4"] {
  --sil-h: 106%; /* matched to Mister Dude's apparent height */
  --subject-right: 11%;
  --subject-bottom: 0%;
  --subject-height: clamp(360px, 85vh, 940px);
  --subject-max-width: 30%;
}

/* layer 1 — soft blurred scene photo (used as a backdrop in the ACTIVE
   open page only; hidden in the default accordion). */
.page-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  background: var(--portrait) var(--focus-x, 50%) var(--focus-y, 45%) / cover no-repeat;
  filter: blur(22px) saturate(0.7) contrast(0.9) brightness(1.08);
  opacity: 0; /* default: no room scene — the accordion shows people + paper */
  transform: scale(1.12);
  transition:
    filter var(--duration) var(--ease),
    opacity var(--duration) var(--ease),
    transform var(--duration) var(--ease),
    background-position var(--duration) var(--ease);
}

/* layer 2 — the blurred PERSON (cutout from /Students/PNGS).
   Bottom-aligned; per-student --sil-h equalises body heights so the
   figures line up nicely across panels. */
.page-person {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: var(--cutout) center center / auto var(--sil-h, 100%) no-repeat;
  filter: blur(8px) saturate(0.88) contrast(1.02) brightness(1.01);
  opacity: 0.95;
  transition:
    opacity var(--duration) var(--ease),
    filter var(--duration) var(--ease);
}

/* layer 3 — WHITE tracing-paper overlay: a milky white veil + faint
   2nd-texture grain, so the figures read as if seen through white
   opaque tracing paper (soft, white, blurry). */
.page-paper {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.46)),
    url("Assets/2nd texture.png") center / cover;
  opacity: 0.8;
  transition: opacity var(--duration) var(--ease);
}

/* layer 4 — fold/spine shadow on each page's left edge (paper, not bars) */
.student-page::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 4;
  width: 32px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(40, 36, 30, 0.34), rgba(40, 36, 30, 0.12) 55%, transparent);
  opacity: 0.85;
  transition: opacity var(--duration) var(--ease);
}

/* thin bright paper edge highlight to the right of each fold */
.student-page::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 1px;
  z-index: 4;
  width: 2px;
  pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75) 45%, rgba(255, 255, 255, 0));
  opacity: 0.8;
}

/* layer 5 — sharp active subject */
/* The sharp foreground PNG is no longer used on the open page — the
   unblurred background scene already contains the person, so showing
   this too would double the figure. Kept in markup but disabled. */
.subject-cutout {
  display: none;
  position: absolute;
  right: var(--subject-right);
  bottom: var(--subject-bottom);
  z-index: 5;
  width: auto;
  height: var(--subject-height);
  max-width: var(--subject-max-width);
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.99);
  transform-origin: center bottom;
  filter: drop-shadow(0 22px 24px rgba(45, 43, 39, 0.14));
  transition:
    opacity var(--duration-fast) var(--ease),
    transform var(--duration) var(--ease),
    height var(--duration) var(--ease),
    right var(--duration) var(--ease);
}

/* layer 6 — typography */
.page-copy {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: block;
  pointer-events: none;
}

/* QUOTE — top-left of the active page, editorial muted gold */
.page-quote {
  position: absolute;
  left: clamp(34px, 7%, 132px);
  top: clamp(70px, 21%, 220px);
  right: auto;
  color: var(--gold);
  font-size: clamp(26px, 2.3vw, 46px);
  line-height: 1.28;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--duration-fast) var(--ease),
    transform var(--duration) var(--ease);
}

/* NAME — default state: muted gold, bottom of each folded page */
.student-name {
  position: absolute;
  left: 50%;
  bottom: 3vh;
  color: var(--gold);
  font-size: clamp(9px, 0.66vw, 13px);
  letter-spacing: 0.24em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
  transition:
    top var(--duration) var(--ease),
    left var(--duration) var(--ease),
    bottom var(--duration) var(--ease),
    font-size var(--duration) var(--ease),
    letter-spacing var(--duration) var(--ease),
    transform var(--duration) var(--ease),
    opacity var(--duration) var(--ease);
}

/* =====================================================================
   ACTIVE STATE — fold the stack, open one page
   ===================================================================== */
.accordion.is-active .student-page {
  flex: 0 0 var(--strip-width);
}

/* folded strips read as stacked paper pages (soft edges, light texture) */
.accordion.is-active .student-page:not(.is-open) {
  box-shadow:
    inset 2px 0 3px rgba(255, 255, 255, 0.5),
    inset -10px 0 16px rgba(58, 54, 46, 0.1);
}

/* folded strips keep the frosted person + paper look (no room scene) */
.accordion.is-active .student-page:not(.is-open) .page-media {
  opacity: 0;
}

.accordion.is-active .student-page:not(.is-open) .page-person {
  opacity: 0.8;
  filter: blur(9px) saturate(0.8) contrast(1);
}

.accordion.is-active .student-page:not(.is-open) .page-paper {
  opacity: 0.75;
}

.accordion.is-active .student-page:not(.is-open) .student-name {
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
}

/* the open page */
.accordion.is-active .student-page.is-open {
  flex: 1 1 auto;
  box-shadow:
    inset 6px 0 12px rgba(255, 255, 255, 0.18),
    -16px 0 34px rgba(48, 46, 42, 0.16);
}

/* open page: the background scene shows SHARP and full (no blur), it
   already contains the student — this is the main image. */
.accordion.is-active .student-page.is-open .page-media {
  background-position: var(--active-x, 50%) var(--active-y, 50%);
  filter: none;
  opacity: 1;
  transform: scale(1);
}

/* open page: remove the frosted white overlay so the image is clean */
.accordion.is-active .student-page.is-open .page-paper {
  opacity: 0;
}

.accordion.is-active .student-page.is-open .page-person {
  opacity: 0;
}

.accordion.is-active .student-page.is-open::after,
.accordion.is-active .student-page.is-open::before {
  opacity: 0.3;
}

/* reveal sharp subject */
.accordion.is-active .student-page.is-open .subject-cutout {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 160ms;
}

/* reveal quote */
.accordion.is-active .student-page.is-open .page-quote {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 260ms;
}

/* ACTIVE NAME — top-left page heading (larger, intentional) */
.accordion.is-active .student-page.is-open .student-name {
  top: clamp(40px, 9vh, 96px);
  left: clamp(34px, 7%, 132px);
  right: auto;
  bottom: auto;
  font-size: clamp(16px, 1.5vw, 28px);
  letter-spacing: 0.24em;
  text-align: left;
  opacity: 1;
  transform: none;
}

/* =====================================================================
   RESPONSIVE — tablet refinements (≤1180px)
   ===================================================================== */
@media (min-width: 900px) and (max-width: 1180px) {
  /* [data-index] keeps specificity equal to the per-student rules above,
     so these responsive sizes win by source order */
  .student-page[data-index] {
    --subject-right: 8%;
    --subject-height: clamp(320px, 72vh, 720px);
    --subject-max-width: 40%;
  }

  .student-page[data-index="3"],
  .student-page[data-index="4"] {
    --subject-right: 10%;
    --subject-height: clamp(300px, 70vh, 680px);
  }

  .page-quote {
    font-size: clamp(24px, 3vw, 34px);
    top: clamp(64px, 18%, 160px);
  }
}

/* =====================================================================
   RESPONSIVE — mobile / stacked tap-to-open (≤899px)
   No hover accordion: cover on top, students stacked below.
   ===================================================================== */
@media (max-width: 899px) {
  body {
    overflow: auto;
  }

  .site-shell {
    width: 100%;
    height: auto;
    min-height: 100vh;
  }

  .accordion,
  .accordion.is-active {
    --cover-width: auto;
    display: block;
    min-height: 100vh;
    padding-bottom: 16px;
  }

  /* cover at the top, full width, no slant */
  .cover-panel,
  .accordion.is-active .cover-panel {
    width: 100%;
    height: 40vh;
    min-height: 320px;
    clip-path: none;
    box-shadow: 0 16px 30px rgba(52, 50, 45, 0.14);
  }

  .accordion.is-active .cover-title,
  .cover-title {
    font-size: clamp(34px, 12vw, 60px);
    letter-spacing: 0.2em;
  }

  .accordion.is-active .cover-subtitle,
  .cover-subtitle {
    font-size: 10px;
    letter-spacing: 0.34em;
  }

  /* cover fold becomes a horizontal seam at the bottom */
  .cover-fold,
  .accordion.is-active .cover-fold {
    top: auto;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 26px;
    background: linear-gradient(rgba(58, 52, 44, 0.18), transparent);
  }

  .cover-fold::after {
    display: none;
  }

  .student-stack {
    display: grid;
    gap: 10px;
    height: auto;
    padding: 12px;
  }

  /* each card a comfortable tap target; full body visible when open.
     [data-index] matches the per-student specificity so it wins here */
  .student-page[data-index] {
    --subject-right: 6%;
    --subject-bottom: 0%;
    --subject-height: min(52vh, 520px);
    --subject-max-width: 46%;
  }

  .student-page,
  .accordion.is-active .student-page,
  .accordion.is-active .student-page:not(.is-open) {
    width: 100%;
    height: 120px;
    min-height: 120px;
    flex: none;
    border: 1px solid rgba(176, 132, 51, 0.16);
    box-shadow:
      inset 8px 0 16px rgba(255, 255, 255, 0.22),
      0 10px 22px rgba(52, 50, 45, 0.1);
    transition:
      height 760ms var(--ease),
      min-height 760ms var(--ease),
      box-shadow 760ms var(--ease);
  }

  .accordion.is-active .student-page.is-open {
    height: min(78vh, 660px);
    min-height: 480px;
  }

  /* fold shadow becomes a top seam on cards */
  .student-page::after {
    inset: 0 0 auto 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(rgba(40, 38, 34, 0.14), transparent);
  }

  .student-page::before {
    display: none;
  }

  /* names: bottom-right on mobile cards (compact), always visible */
  .student-name,
  .accordion.is-active .student-page:not(.is-open) .student-name,
  .accordion.is-active .student-page.is-open .student-name {
    left: auto;
    right: 20px;
    top: auto;
    bottom: 18px;
    font-size: 12px;
    letter-spacing: 0.28em;
    text-align: right;
    white-space: normal;
    opacity: 1;
    transform: none;
  }

  /* the open page reads as a page, not a card: the name heads the
     left-hand corner with the quote beneath it, as on desktop */
  .accordion.is-active .student-page.is-open .student-name {
    top: 22px;
    bottom: auto;
    left: 24px;
    right: auto;
    font-size: 17px;
    text-align: left;
  }

  .page-quote {
    /* clears the name that now heads the corner above it */
    top: 64px;
    left: 24px;
    right: 24px;
    font-size: clamp(26px, 7vw, 42px);
  }

  .accordion.is-active .student-page.is-open .page-media {
    opacity: 0.3;
  }
}

/* tighten further on small phones */
@media (max-width: 600px) {
  .page-quote {
    font-size: clamp(22px, 7.5vw, 34px);
  }

  .student-page[data-index] {
    --subject-height: min(48vh, 440px);
    --subject-max-width: 60%;
  }
}

/* =====================================================================
   FULL-SCREEN MENU PAGE  (slides in from the left when MENU is clicked)
   Left: the cohort names. Right: UNFOLD identity + back arrow, divided
   by a vertical gold rule. The back arrow slides it away (home).
   ===================================================================== */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  background:
    linear-gradient(rgba(248, 244, 236, 0.4), rgba(231, 226, 214, 0.5)),
    url("Assets/Web texture.png") center / cover;
  transform: translateX(-100%);
  pointer-events: none;
  transition: transform 900ms var(--ease);
  will-change: transform;
}

body.menu-open .menu-overlay {
  transform: translateX(0);
  pointer-events: auto;
}

/* cohort names, centred in the main area */
.menu-names {
  flex: 1 1 auto;
  margin: 0;
  padding: clamp(40px, 8vh, 96px);
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.8vh, 26px);
  text-align: center;
}

.menu-names li {
  color: var(--gold);
  font-size: clamp(22px, 3vw, 46px);
  letter-spacing: 0.16em;
  line-height: 1.1;
  text-transform: uppercase;
}

/* right identity panel with the vertical gold divider */
.menu-side {
  position: relative;
  flex: 0 0 clamp(240px, 30vw, 430px);
  border-left: 1px solid var(--gold);
  padding: clamp(44px, 8vh, 100px) clamp(28px, 3vw, 56px);
}

.menu-logo {
  display: block;
  color: var(--gold);
  font-size: clamp(24px, 2vw, 40px);
  letter-spacing: 0.2em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.menu-logo-sub {
  display: block;
  margin-top: clamp(8px, 1vw, 14px);
  font-size: clamp(7px, 0.6vw, 11px);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #4a443a;
}

.menu-logo-year {
  display: block;
  margin-top: clamp(8px, 1vw, 14px);
  font-size: clamp(8px, 0.62vw, 11px);
  letter-spacing: 0.26em;
  color: #4a443a;
}

/* back arrow — points left, returns to the home screen */
.menu-back {
  position: absolute;
  bottom: clamp(40px, 9vh, 96px);
  left: clamp(28px, 3vw, 56px);
  margin: 0;
  padding: 8px 4px;
  border: 0;
  background: none;
  cursor: pointer;
}

.menu-back:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--gold), white 24%);
  outline-offset: 4px;
}

.menu-back-arrow {
  display: block;
  position: relative;
  width: 54px;
  height: 12px;
}

.menu-back-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--gold);
}

.menu-back-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 9px;
  height: 9px;
  border-left: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  background: transparent;
  transform: translateY(-50%) rotate(45deg);
}

/* menu page stacks on smaller screens */
@media (max-width: 760px) {
  .menu-overlay {
    flex-direction: column;
  }

  .menu-names {
    flex: 1 1 auto;
    gap: 14px;
  }

  .menu-side {
    flex: 0 0 auto;
    border-left: 0;
    border-top: 1px solid var(--gold);
    padding: 28px clamp(24px, 6vw, 40px) 36px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .menu-back {
    position: static;
    margin-top: 22px;
  }
}

/* =====================================================================
   PER-STUDENT SCROLLABLE PROJECT PAGE
   Reachable ONLY while a student is open (body.student-open). The down
   cue scrolls to it; the up cue scrolls back to the accordion.
   ===================================================================== */

/* scrolling is locked unless a student page is open */
body.student-open {
  overflow-y: auto;
  overflow-x: hidden;
}

/* arrow cues (down on the spread, up at the foot of the project page) */
.scroll-cue {
  display: none;
  margin: 0;
  padding: 10px;
  border: 0;
  background: none;
  cursor: pointer;
}

.scroll-cue:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--gold), white 24%);
  outline-offset: 4px;
}

.cue-arrow {
  display: block;
  position: relative;
  width: 1px;
  height: 46px;
  margin: 0 auto;
  background: var(--gold);
}

.cue-arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 11px;
  height: 11px;
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
}

/* down cue: arrowhead at the bottom of the stem */
.scroll-cue--down .cue-arrow::after {
  bottom: 0;
  transform: translateX(-50%) rotate(45deg);
}

/* up cue: arrowhead at the top of the stem */
.scroll-cue--up .cue-arrow::after {
  top: 0;
  transform: translateX(-50%) rotate(-135deg);
}

/* the down cue sits at the bottom-centre of the open spread */
.scroll-cue--down {
  position: absolute;
  bottom: 2.4vh;
  left: 50%;
  z-index: 25;
  transform: translateX(-50%);
}

/* shown only while a student is open */
body.student-open .scroll-cue--down {
  display: block;
}

/* the scrollable project page itself */
.student-detail {
  display: none;
  min-height: 100vh;
  padding: clamp(48px, 8vh, 110px) clamp(20px, 5vw, 80px) clamp(40px, 7vh, 90px);
  background:
    linear-gradient(rgba(247, 244, 236, 0.82), rgba(239, 235, 226, 0.9)),
    url("Assets/Web texture.png") center / cover fixed,
    var(--paper);
  color: var(--ink);
}

body.student-open .student-detail {
  display: block;
}

.detail-inner {
  max-width: 1040px;
  margin: 0 auto;
}

.detail-head {
  margin-bottom: clamp(28px, 4vh, 56px);
}

.detail-name {
  margin: 0;
  color: var(--gold);
  font-size: clamp(24px, 2.6vw, 40px);
  font-weight: normal;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.detail-course {
  margin: 10px 0 0;
  color: var(--gold);
  font-size: clamp(9px, 0.8vw, 12px);
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.detail-row {
  display: flex;
  gap: clamp(24px, 4vw, 64px);
  align-items: flex-start;
  margin-bottom: clamp(28px, 5vh, 64px);
}

/* second row already orders placeholder-first in markup, so it reads
   image-left / text-right without reversing */

.detail-copy {
  flex: 1 1 0;
}

.detail-copy p {
  margin: 0 0 1.1em;
  color: #50493d;
  font-family: "Utopia Std", "Times New Roman", Georgia, serif;
  font-size: clamp(13px, 1vw, 15px);
  line-height: 1.85;
}

/* image placeholders */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(176, 132, 51, 0.4);
  background: rgba(255, 255, 255, 0.32);
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: clamp(11px, 0.95vw, 14px);
  text-align: center;
}

.ph--project {
  flex: 1 1 0;
  align-self: stretch;
  min-height: clamp(220px, 32vh, 360px);
}

.ph--gallery {
  position: relative;
  width: 100%;
  min-height: clamp(200px, 30vh, 320px);
  margin-bottom: clamp(24px, 4vh, 48px);
}

/* faint internal grid to suggest a gallery of frames */
.ph--gallery::before,
.ph--gallery::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(176, 132, 51, 0.22);
}

.ph--gallery::before { left: 33.33%; }
.ph--gallery::after { left: 66.66%; }

.detail-foot {
  display: flex;
  justify-content: center;
  padding-top: clamp(12px, 3vh, 32px);
}

.detail-foot .scroll-cue--up {
  display: block;
}

@media (max-width: 760px) {
  .detail-row,
  .detail-row--reverse {
    flex-direction: column;
  }
}

/* =====================================================================
   MOBILE: horizontal "swipe for the work"
   On desktop the project page is BELOW (scroll down). On mobile, when a
   student is open, it sits to the RIGHT instead — the user drags
   right-to-left (swipes) to reach the work. Implemented as a 2-panel
   horizontal scroll-snap pager driven by the same open/close logic.
   ===================================================================== */
@media (max-width: 899px) {
  /* lock the page so <body> (not the viewport) becomes the horizontal
     scroller — otherwise body's overflow propagates to the viewport */
  html.paging {
    overflow: hidden;
    height: 100%;
  }

  body.student-open {
    display: flex;
    flex-wrap: nowrap;
    width: 100vw;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  /* PANEL 1 — only the open student, full screen */
  body.student-open .site-shell {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    scroll-snap-align: start;
  }

  body.student-open .accordion {
    display: block;
    height: 100vh;
    min-height: 100vh;
    padding-bottom: 0;
  }

  /* hide the cover and the other cards while focused on one student */
  body.student-open .cover-panel,
  body.student-open .student-page:not(.is-open) {
    display: none;
  }

  body.student-open .student-stack {
    display: block;
    height: 100vh;
    padding: 0;
    gap: 0;
  }

  body.student-open .student-page.is-open,
  body.student-open .accordion.is-active .student-page.is-open {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border: 0;
  }

  /* PANEL 2 — the project page, to the RIGHT (swipe left to reach it) */
  body.student-open .student-detail {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-align: start;
  }

  /* arrow cues point sideways: → to the work, ← back to the student */
  body.student-open .scroll-cue .cue-arrow {
    transform: rotate(-90deg);
  }

  body.student-open .scroll-cue--down {
    top: 50%;
    bottom: auto;
    left: auto;
    right: 14px;
    transform: translateY(-50%);
  }
}

/* =====================================================================
   RSVP Form (within menu overlay)
   ===================================================================== */
.menu-overlay {
  display: flex !important;
  flex-direction: row;
}

.menu-names,
.menu-side {
  display: none;
}

.menu-left {
  display: none;
  flex: 1 1 auto;
  padding: clamp(40px, 6vh, 80px) clamp(28px, 5vw, 90px);
  border-right: 1px solid rgba(176, 132, 51, 0.3);
  position: relative;
  flex-direction: column;
  align-items: center;
  /* flex-start + auto block margins on the child: the programme sits centred
     when it fits and scrolls without clipping its head when it doesn't */
  justify-content: flex-start;
  overflow-y: auto;
  text-align: center;
}

.menu-left-inner {
  width: 100%;
  max-width: 620px;
  margin: auto 0;
}

.menu-right {
  flex: 0 0 clamp(280px, 27vw, 420px);
  padding: clamp(40px, 6vh, 80px) clamp(28px, 3vw, 56px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  position: relative;
}

.menu-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 40px;
  text-align: left;
}

.menu-header-title {
  display: block;
  color: var(--gold);
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.menu-header-subtitle {
  display: block;
  color: var(--gold-soft);
  font-size: clamp(10px, 0.9vw, 12px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.menu-header-year {
  display: block;
  color: var(--gold-soft);
  font-size: clamp(12px, 1.2vw, 16px);
  letter-spacing: 0.08em;
  margin-top: 10px;
}

.rsvp-form {
  width: 100%;
}

.rsvp-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.rsvp-label {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.rsvp-input,
.rsvp-select {
  padding: 12px 14px;
  border: 1px solid rgba(176, 132, 51, 0.55);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease);
}

.rsvp-input:focus,
.rsvp-select:focus {
  border-color: var(--gold);
}

.rsvp-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b1863d' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 36px;
}

.rsvp-submit {
  width: 100%;
  padding: 12px 20px;
  margin-top: 28px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}

.rsvp-submit:hover {
  background: var(--gold);
  color: var(--paper);
}

.rsvp-message {
  text-align: center;
  color: var(--gold);
  font-size: 14px;
  margin-top: 20px;
}

.menu-left-title {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: normal;
}

.menu-left-subtitle {
  margin: 0 0 32px;
  color: var(--gold-soft);
  font-size: 13px;
  line-height: 1.6;
}

.menu-left-heading {
  margin: 0 0 16px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: normal;
}

.menu-students-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-students-list li {
  margin-bottom: 24px;
  color: var(--gold);
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.5;
}

/* --- Private View programme (left side of the RSVP page) -------------- */
.programme {
  list-style: none;
  margin: 0 0 clamp(28px, 4vh, 48px);
  padding: 0;
  text-align: left;
}

.programme-item {
  display: flex;
  gap: clamp(16px, 2vw, 32px);
  padding: clamp(16px, 2vh, 24px) 0;
  border-top: 1px solid rgba(176, 132, 51, 0.22);
}

.programme-item:first-child {
  border-top: 0;
}

.programme-time {
  flex: 0 0 clamp(64px, 7vw, 92px);
  padding-top: 2px;
  color: var(--gold);
  font-size: clamp(13px, 1.05vw, 16px);
  letter-spacing: 0.08em;
}

.programme-body {
  flex: 1 1 auto;
  min-width: 0;
}

.programme-name {
  margin: 0;
  color: var(--gold);
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: normal;
  line-height: 1.3;
}

.programme-venue {
  margin: 6px 0 0;
  color: var(--gold-soft);
  font-size: clamp(11px, 0.85vw, 13px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.programme-note {
  margin: 10px 0 0;
  color: #5a5348;
  font-family: "Utopia Std", "Times New Roman", Georgia, serif;
  font-size: clamp(12px, 0.95vw, 14px);
  line-height: 1.75;
}

.programme-artists {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.programme-artists li {
  color: var(--gold);
  font-size: clamp(14px, 1.15vw, 18px);
  line-height: 1.9;
}

.menu-dates {
  text-align: left;
}

.menu-dates p {
  margin: 0 0 16px;
  color: #5a5348;
  font-family: "Utopia Std", "Times New Roman", Georgia, serif;
  font-size: clamp(12px, 0.95vw, 14px);
  line-height: 1.75;
}

.menu-dates-venue {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-family: "Times New Roman", Georgia, serif;
  font-size: clamp(11px, 0.85vw, 13px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (min-width: 768px) {
  .menu-left {
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 767px) {
  .menu-overlay {
    flex-direction: column;
  }

  .menu-left {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 1px solid rgba(176, 132, 51, 0.2);
    min-height: auto;
  }

  .menu-right {
    flex: 1 1 auto;
  }
}

/* =====================================================================
   Reduced motion
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}
