/* Depends on: base.css, viewport.css, section-1.css (the profile
   button reuses .s1-panel-link's look/hover wholesale — see the note
   above .s5-profile-btn below). */

/* ============================================================
   SECTION 5 — WYSTAWCY
   ============================================================ */
#slide-s5 {
  background: var(--paper);
  /* Vertical margin reserved above/below the giant step-0 title (see
     .s5-title's font-size below, which is computed FROM this rather
     than the old flat 90vh guess). Matches .s5-title-col's own
     horizontal padding (5vw) EXACTLY — same value, same unit — rather
     than an independently-tuned vh number: two values in different
     units can only coincide at one specific aspect ratio, so a vh
     figure "close to" 5vw at one viewport would drift unequal at
     another. Expressing both in vw is what makes top/bottom and
     left/right the same margin at every viewport, not just this one. */
  --s5-title-pad-y: 5vw;
  /* Gap between the 3 stacked "WYSTAWCY" repeats, once they're all
     showing (step 1 — see .s5-title-col below). */
  --s5-title-gap: 1vh;
  /* The 3 repeats' own size at step 1 (deliberately NOT derived from
     available height the way the giant single word is — .s5-title-col
     is auto-height at that point, sized to whatever its children need,
     so a formula dividing "available height" by 3 would be circular).
     3x the original 6vw. */
  --s5-title-small: 18vw;
}
.s5-stage {
  position: absolute;
  inset: 0;
  padding-top: var(--header-h);
  display: flex;
}
.s5-title-col {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--s5-title-gap);
  position: relative;
  overflow: hidden;
  padding: var(--s5-title-pad-y) 5vw;
  /* position itself can't be smoothly animated (relative -> absolute
     below is a hard jump, same limitation the old single-title version
     had switching its OWN position the same way) — but padding and
     opacity still ease rather than snapping, which is what actually
     reads as motion here. */
  transition:
    padding 1s var(--ease),
    opacity 1s ease;
}
/* The only scroll-step this section has any more: the title(s) shrink
   into a small top-left corner group and the carousel (below) reveals
   its first photo, centered — that one step is the whole of the
   "scroll interaction" here. Everything else (arrows, drag, the
   pager) is live from that point on, not gated behind further steps.

   .s5-title-col itself is what switches between the two moments —
   full-stage and giant at step 0, a small absolutely-positioned strip
   at step 1 — rather than each title individually. That's what lets
   the 3 repeats stay ordinary flex children the whole time (stacked
   by the flex-column + gap above) instead of each one needing its own
   position:absolute math to reproduce that same stacking by hand. */
#slide-s5[data-step="1"] .s5-title-col {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: auto;
  justify-content: flex-start;
  padding: 2vh 5vw;
  opacity: 0.75;
}
.s5-title {
  font-family: var(--display); font-weight:800;
  color: var(--burgundy);
  /* Step 0 (default, this rule): the ONE main title fills the
     column's entire available height by itself.
     "Available height" is .s5-stage's content box (100vh minus the
     header) minus the padding above, top and bottom. */
  font-size: calc(100vh - var(--header-h) - 2 * var(--s5-title-pad-y));
  line-height: 1;
  transform-origin: left center;
  /* A ratio, not an absolute width — so it keeps compressing the
     glyph by the same proportion regardless of what the font-size
     above resolves to, with no retuning needed here. */
  transform: scaleX(0.34);
  transition:
    transform 1s var(--ease),
    font-size 1s var(--ease),
    opacity 1s ease,
    color 0.6s ease,
    left 1s var(--ease);
  white-space: nowrap;
}
#slide-s5[data-step="1"] .s5-title {
  transform: scale(1);
  font-size: var(--s5-title-small);
}
/* At step 1 the giant word gives way to the pattern below: it fades
   out as it shrinks, and the pattern fades in in its place. */
#slide-s5[data-step="1"] .s5-title-col {
  opacity: 0;
}

/* ---- the Wystawcy wallpaper (step 1) ----------------------------
   Rows of the word, alternating MonteCarlo and Rubik bold along each
   row; alternate rows start on the other face, so the two make a
   checkerboard. Built by s5BuildPattern() in section-5.js with enough
   rows and words to overflow the screen whatever its size — the
   overflow is clipped here. Sized off the larger of width and height,
   so a tall phone gets as few, as large, rows as a wide monitor. */
.s5-pattern {
  --s5-pattern-size: max(6.5vw, 8.5vh);
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.05em;
  font-size: var(--s5-pattern-size);
  line-height: 1.1;
  color: var(--burgundy);
  opacity: 0;
  transition: opacity 1s ease;
}
#slide-s5[data-step="1"] .s5-pattern {
  opacity: 0.75;
}
.s5-pattern-row {
  display: flex;
  align-items: baseline;
  gap: 0.45em;
  white-space: nowrap;
  /* Centred on the screen, overflowing both edges equally. */
  justify-content: center;
}
.s5-pattern-word--rubik {
  font-family: var(--display);
  font-weight: 800;
}
/* MonteCarlo draws much smaller than Rubik at the same size, so it is
   set up a step to hold its own beside it. */
.s5-pattern-word--script {
  font-family: "MonteCarlo", cursive;
  font-weight: 400;
  font-size: 1.3em;
  line-height: 0.85;
}
/* ------------------------------------------------------------
   Carousel — a STACK, not a sliding filmstrip (that's what Section 3
   is; deliberately different here). All 5 photos sit centered in
   exactly the same spot; only the "front" one (s5SetFront() in
   section-5.js) is fully visible, the rest sit just behind it. It's
   finite (not the earlier infinite-wraparound version) — cycling past
   either end just stops and hides that end's arrow (see .s5-arrow
   below) instead of looping back around.
   ------------------------------------------------------------ */
/* The event blue, and the numbers pager's own measurements, in one
   place. The pager's width is worth naming because something else has
   to match it exactly: in the narrow layout further down, the
   SPRAWDŹ PROFIL button drops below the photo and is sized to the
   same width as the row of five circles under it, so the two read as
   one stacked block rather than two unrelated widths. Derived from the
   circle size and gap rather than typed as a number, so changing
   either keeps the button in step on its own. */
#slide-s5,
.s5-modal {
  --s5-blue: #0bbbef;
  --s5-pager-size: 2.2rem;
  --s5-pager-gap: 0.6rem;
  --s5-pager-w: calc(5 * var(--s5-pager-size) + 4 * var(--s5-pager-gap));
}
.s5-carousel {
  position: absolute;
  inset: 0;
}
.s5-item {
  position: absolute;
  top: 50%;
  /* Read by .s5-profile-btn's translate and by the ::before connecting
     line below — one number, shared by both, so they can never drift
     out of sync with each other (the line's own length/angle is
     derived FROM this, not independently tuned to match it). Same
     variable name/value on .s5-modal-frame further down, since that
     element plays the exact same "positioned box the size of the
     photo" role there. */
  --s5-profile-gap: 24px;
  /* Uniform downward shift applied to BOTH the button and the line
     below (never to just one) — the header was overlapping the top of
     the button at its original, un-dropped position. Shifting both by
     the same amount keeps their geometry identical to before (same
     gap, same angle, same length), just moved down as one unit,
     rather than only lowering the button and leaving the line's own
     anchor pointing at where the button USED to be.

     150px, not the 50px this started at: the button is meant to sit
     alongside the photo rather than up level with its top edge. The
     modal's own copy of this variable (see .s5-modal-frame further
     down) is deliberately left at 50px — the popup has no header over
     it to clear and much less room below the corner. */
  --s5-profile-drop: 150px;
  /* The stack is visible from the very start (no separate "corner
     preview" card any more) — sitting over on the right, partially
     clipped off-screen by .slide's own overflow:hidden (viewport.css),
     rather than hidden via opacity — and heading in toward the centre
     of the section once the section's one scroll-step fires (see the
     attribute-selector rule below). */
  left: 90%;
  height: min(79.2vh, 693px); /* +33% then -10% over the original min(66vh,580px) */
  width: auto;
  aspect-ratio: 1080 / 1350;
  transform: translate(-50%, -50%);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
  transition:
    left 0.8s var(--ease),
    transform 0.8s var(--ease),
    opacity 0.3s ease;
}
#slide-s5[data-step="1"] .s5-item {
  left: 50%;
}
/* The line from the photo's top-right corner out to .s5-profile-btn's
   own near corner — both elements read directly off --s5-profile-gap,
   so this always lands exactly on the button regardless of what that
   value is set to. Un-rotated, a horizontal segment pinned by its LEFT
   end (transform-origin) to the photo's corner (top:0; left:100%) would
   run straight out to the right; rotating that -45° is what sends it
   up-and-right instead, and length × cos(45°) is what has to equal
   --s5-profile-gap on both axes for the diagonal to land exactly where
   the button's translate() puts it — which is why the length is
   var(--s5-profile-gap) multiplied by √2 (1.41421), not the gap value
   itself. */
.s5-item::before,
.s5-modal-frame::before {
  content: "";
  position: absolute;
  /* -1px is half the line's own 2px thickness, centering it on the
     corner rather than sitting flush below it; --s5-profile-drop then
     shifts that same anchor point down, in step with the button. */
  top: calc(-1px + var(--s5-profile-drop));
  left: 100%;
  width: calc(var(--s5-profile-gap) * 1.41421);
  height: 2px;
  background: var(--s5-blue);
  transform-origin: left center;
  transform: rotate(-45deg);
  pointer-events: none;
}
/* The front card sits exactly centered; every other one is nudged a
   few px down-right so the stack itself reads as a stack rather than
   a single photo with no depth. */
.s5-item.back {
  transform: translate(calc(-50% + 16px), calc(-50% + 16px));
  opacity: 0.88;
}
/* The button + line are drawn per .s5-item (all 5 stacked cards), but
   should only ever read as belonging to whichever one is actually on
   top — showing all 5 at once looked like clutter pointing at nothing
   in particular. .front/.back are set together in section-5.js's
   s5SetFront(), so this always matches whichever card the glow/z-index
   already marks as current. */
.s5-item.back .s5-profile-btn,
.s5-item.back::before {
  display: none;
}
/* Briefly toggled on the whole stack right after the initial reveal
   settles (see section-5.js's updateS4()) — fans the 4 back cards out
   so their count is actually visible for a moment, before they
   collapse back into the tight .back position above. Only ever
   used immediately after the reveal, when front is always item 1
   (nth-child(1)), so plain nth-child selectors are enough — no need
   to compute this relative to whichever card happens to be front
   later on. */
.s5-carousel.fanning .s5-item:nth-child(2) {
  transform: translate(calc(-50% + 46px), calc(-50% + 16px));
}
.s5-carousel.fanning .s5-item:nth-child(3) {
  transform: translate(calc(-50% + 92px), calc(-50% + 32px));
}
.s5-carousel.fanning .s5-item:nth-child(4) {
  transform: translate(calc(-50% + 138px), calc(-50% + 48px));
}
.s5-carousel.fanning .s5-item:nth-child(5) {
  transform: translate(calc(-50% + 184px), calc(-50% + 64px));
}
.s5-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  -webkit-user-drag: none;
  user-select: none;
}
/* Reuses section 1's ROZKŁAD JAZDY/ORGANIZATORZY button as-is
   (.s1-panel-link, including its slide-swap text hover — see
   section-1.css), positioned OUTSIDE the photo's top-right corner
   rather than overlaid on it, with a thin line (see .s5-item::before
   and .s5-modal-frame::before below) drawn from that corner out to
   the button's own near corner so the connection still reads clearly
   even though the two no longer touch.

   Anchored via bottom:100%/left:100% (the image's own top-right
   corner, since .s5-item/.s5-modal-frame are the positioned ancestor
   that box is measured against) plus a FIXED-px translate, rather
   than a percentage transform — a percentage translate is relative to
   the button's OWN size, which is intrinsic/auto here (font-size +
   padding, not a fixed value), so it can't be resolved into an exact
   point. A fixed-px offset can, which is what lets the connecting
   line below be computed exactly instead of eyeballed. */
.s5-profile-btn {
  position: absolute;
  bottom: 100%;
  left: 100%;
  transform: translate(
    var(--s5-profile-gap),
    calc(var(--s5-profile-gap) * -1 + var(--s5-profile-drop))
  );
  z-index: 2;
  font-size: clamp(0.8rem, 1.4vw, 1.05rem);
  /* Text + icon stroke (via currentColor) + the button's own border —
     event blue, same #0bbbef used for the Section 4/5 arrows. Also
     covers the border, not just "type and stroke" literally: the
     button now sits on plain paper background instead of over a
     photo, where .s1-panel-link's own default paper-2 border would
     have very little contrast left to read by. */
  color: var(--s5-blue);
  border-color: var(--s5-blue);
  /* A second, thinner ring outside the first — 1px against the
     border's 2px. Deliberately `outline`, not a second border or a
     box-shadow ring: outline paints as part of the element's OWN box,
     on top of/after the ::before below rather than being sampled by
     its backdrop-filter, so unlike the border it stays crisp rather
     than picking up the same glass distortion. offset:4px keeps it a
     visibly separate ring rather than merging into one thicker line. */
  outline: 1px solid var(--s5-blue);
  outline-offset: 4px;
}
/* Same liquid-glass backdrop as .s5-pager-row above, sized to straddle
   the button's own border rather than sit fully inside or outside it —
   inset:-10px extends the effect 10px past the OUTSIDE of the pill,
   and since it's a ::before (painted first, so BEHIND the button's
   real border/text/icon — the actual visible border-color/type stay
   sharp, unaffected), it also runs 10px past the INSIDE of that same
   border underneath the button's own transparent fill. z-index:-1 is
   what keeps it behind despite being position:absolute: a negative
   z-index paints behind the stacking context's own auto/static
   children (the button's text/icon spans here) without needing to
   also raise THEIR z-index to compensate. */
.s5-profile-btn::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  background: rgba(255, 255, 255, 0);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  filter: url(#header-liquid-glass);
}
.s5-profile-btn:hover {
  transform: translate(
    var(--s5-profile-gap),
    calc(var(--s5-profile-gap) * -1 + var(--s5-profile-drop) - 4px)
  );
}

/* Arrows flank the numbered pager (.s5-pager-row below) rather than
   the photo stack now, so they're ordinary in-flow flex children —
   nothing here needs position:absolute or a translateY centering hack
   any more; .s5-pager-row's own flex layout does the centering. */
.s5-pager-row {
  position: absolute;
  left: 50%;
  bottom: 3vh;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1em;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
/* Same "liquid glass" backdrop as the header (see header.css and the
   #header-liquid-glass filter defined once in index.html — an SVG
   filter referenced by id works anywhere in the document, so this
   just points at that same one rather than duplicating it). A ::before
   rather than putting the effect directly on .s5-pager-row so it can
   sit strictly BEHIND the arrows/numbers (z-index:-1, painting behind
   any static/auto-z-index sibling in the same stacking context — see
   the note on .s5-profile-btn's identical setup below for why that
   works without needing z-index on the siblings too) while extending
   past the row's own edges — inset:-12px makes the backdrop slightly
   BIGGER than the content it's legibility for, rather than clipped
   exactly to it. */
.s5-pager-row::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  background: rgba(255, 255, 255, 0);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  filter: url(#header-liquid-glass);
}
#slide-s5[data-step="1"] .s5-pager-row {
  opacity: 1;
  pointer-events: auto;
}

/* Same construction as Section 4's arrows (.s4-arrow): a bare
   hand-drawn stroke, no circle, no fill, no button chrome — coloured
   via currentColor rather than an icon font or a filled shape. */
.s5-arrow {
  flex: none;
  border: none;
  background: none;
  padding: 0;
  /* Blue for the same reason the pager circles below are: burgundy on
     the burgundy WYSTAWCY lettering behind this row was barely there. */
  color: var(--s5-blue);
  display: flex;
  align-items: center;
  cursor: pointer;
  transition:
    color 0.2s ease,
    transform 0.2s var(--ease);
}
.s5-arrow:hover {
  color: var(--burgundy);
  transform: scale(1.1);
}
.s5-arrow-icon {
  /* Same 2:1, 56x28, as Section 4's arrows. */
  width: 56px;
  height: 28px;
  stroke: currentColor;
}
/* The right-pointing SVG mirrored, rather than a second hand-authored
   path — keeps the two arrows' geometry identical by construction. */
.s5-arrow.left .s5-arrow-icon {
  transform: scaleX(-1);
}
/* At either end of the (now finite, non-looping) stack, the arrow
   that would go further that way is removed entirely rather than
   just greyed out — section-5.js's s5UpdateArrows() sets the native
   `disabled` attribute on it. The .s5-modal-scoped selector is
   restated defensively (not currently overridden by anything) since
   the modal's arrows drive the exact same s5Front and should always
   hide the same way. */
.s5-arrow:disabled,
.s5-modal .s5-arrow:disabled {
  display: none !important;
}

/* Numbered pager — one button per photo, lit up to whichever one is
   currently front. Clicking a number jumps straight to it. Shared
   between the main section (#s5Pager) and the modal (#s5ModalPager,
   see below) — the two stay in sync since both are driven from the
   same s5Front index in section-5.js. Positioning/reveal now live on
   the shared .s5-pager-row wrapper above (arrows need the exact same
   centered-row placement and reveal timing this pager already had),
   so this is just the row of number buttons itself. */
.s5-pager {
  display: flex;
  gap: var(--s5-pager-gap);
}
.s5-pager-btn {
  width: var(--s5-pager-size);
  height: var(--s5-pager-size);
  border-radius: 50%;
  /* Blue, and 2px rather than 1: this row sits over the giant burgundy
     WYSTAWCY lettering behind it, where the burgundy it used to be
     drawn in all but disappeared. The modal keeps its own paper
     version further down — that one sits on a dark backdrop, where
     blue would be the hard-to-read choice. */
  border: 2px solid var(--s5-blue);
  background: none;
  color: var(--s5-blue);
  font-family: var(--display); font-weight:800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.s5-pager-btn:hover {
  background: rgba(11, 187, 239, 0.14);
}
/* The selected one inverts: blue fill, burgundy number. */
.s5-pager-btn.active {
  background: var(--s5-blue);
  color: var(--burgundy);
}

/* ============================================================
   Modal — opened by clicking any exhibitor photo
   ============================================================
   A blurred, semi-transparent ink backdrop (not the usual solid one)
   rather than a full picker grid — the photo just shows large, with
   its own arrows/pager to switch between exhibitors without closing
   it. .s5-modal-body is a normal centered flex child (not a
   full-bleed absolutely-positioned layer, unlike Section 3's
   lightbox), so the shared "click the dark backdrop to close"
   behaviour in modals.js's setupModal() already works here with no
   extra JS needed. */
.modal.s5-modal {
  background-color: rgba(22, 17, 14, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.s5-modal-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.s5-modal-body img {
  height: 88vh;
  width: auto;
  max-width: 82vw;
  aspect-ratio: 1080 / 1350;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
/* Same role .s5-item plays in the main carousel: a positioned box
   sized exactly to the photo, so .s5-profile-btn and the ::before
   connecting line (both shared, defined once up near .s5-item) have
   something to anchor to. display:inline-flex shrink-wraps it to the
   img's own rendered size rather than stretching to fill
   .s5-modal-body's much larger flex-centered space. */
.s5-modal-frame {
  position: relative;
  display: inline-flex;
  --s5-profile-gap: 24px;
  --s5-profile-drop: 50px;
}
/* Bare like the main arrows, but paper (light) rather than burgundy —
   this sits on the modal's own dark, blurred backdrop (see .modal.s5-modal
   above), where a dark burgundy stroke would have poor contrast. No
   position:absolute needed — like the main section's, these are
   in-flow flex children of .s5-pager-row now, not positioned relative
   to the big image. */
.s5-modal .s5-arrow {
  color: var(--paper);
}
.s5-modal .s5-arrow:hover {
  color: var(--gold-light);
}
/* The row is gated behind data-step="1" by default (see the base
   .s5-pager-row rule) — the modal has no steps of its own and should
   always show its arrows/pager the instant it's open. */
.s5-modal .s5-pager-row {
  opacity: 1;
  pointer-events: auto;
}
.s5-modal .s5-pager-btn {
  border-color: var(--paper);
  color: var(--paper);
}
.s5-modal .s5-pager-btn:hover {
  background: rgba(242, 235, 220, 0.15);
}
.s5-modal .s5-pager-btn.active {
  background: var(--paper);
  color: var(--ink);
}
@media (max-width: 760px) {
  /* Scaled down for mobile, keeping the same 2:1 ratio. The old
     display:flex!important and left/right offset overrides that used
     to live here are gone along with them — both were only needed
     while the arrows were absolutely positioned against the big image
     (and, for display, while a general mobile .s5-arrow{display:none}
     rule existed to override — that rule no longer exists either, see
     the note on it further up this file). */
  .s5-modal .s5-arrow-icon {
    width: 40px;
    height: 20px;
  }
}

/* ------------------------------------------------------------
   Exhibitors not announced yet
   ------------------------------------------------------------
   Marked .s5-item--soon in the markup (and mirrored onto
   .s5-modal-frame by s5SyncModal() when one of them is opened full
   screen). Their card is still in the stack and still counted by the
   pager — only who it is stays hidden until the reveal. Undoing one
   means deleting that class, swapping its button back to the <a>, and
   restoring the real alt text.

   The veil is a sibling of the photo with a backdrop-filter, NOT a
   filter on the <img> itself: a blurred image has blurred EDGES, and
   .s5-item can't simply clip them away — the profile button and the
   connecting line are positioned outside its box, so overflow:hidden
   there would take those with it. A backdrop-filter blurs what is
   painted behind the veil while the veil's own box stays crisp, so
   the card keeps its exact rounded rectangle. */
.s5-item-veil {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 14px;
  pointer-events: none;
  backdrop-filter: blur(26px) saturate(0.55);
  -webkit-backdrop-filter: blur(26px) saturate(0.55);
  background: rgba(124, 17, 40, 0.22);
}
.s5-item--soon > .s5-item-veil {
  display: block;
}
/* The WKRÓTCE twin of the profile button. Same pill, same colours —
   it is the same element in a state that isn't ready — but it is a
   <span>, not an <a>, so there is nothing to click, and it says so
   with the cursor as well as the word. Its arrow is dropped in the
   markup for the same reason: there is nowhere for it to point. */
.s5-profile-btn--soon {
  cursor: default;
}
/* .s1-panel-link, which both of these borrow their look from, sets
   display:flex — which beats the UA stylesheet's own [hidden] rule, so
   without this the modal's two buttons would both stay on screen
   stacked over each other instead of swapping. Scoped to the pair the
   modal actually toggles. */
.s5-profile-btn[hidden] {
  display: none;
}

/* ------------------------------------------------------------
   Narrow layout — phones, and a desktop window squeezed down
   ------------------------------------------------------------
   Wide enough, the profile button floats off the photo's top-right
   corner on the end of a little diagonal line. That only works while
   there is room to the RIGHT of a full-height photo for it; once
   there isn't, the button either overlaps the photo or runs off the
   screen. Below this width the whole arrangement goes vertical
   instead: a smaller photo with real margins either side, the button
   directly beneath it, then the numbers — one centred column.

   1000px rather than the 760px the rest of the site calls "mobile":
   what matters here is horizontal room for that float, and it runs
   out well before a viewport gets phone-sized. */
@media (max-width: 1000px) {
  /* The three pieces of the stacked layout, and the gaps between them,
     as numbers the rules below can all read. The pager row is the
     reason they exist: pinned to the bottom of the section as it is on
     desktop, it left a gap of well over a hundred px under the button
     and the column read as three unrelated things rather than one. It
     is positioned from the photo instead now, which means knowing how
     tall the photo and the button actually are.

     --s5-card-h comes from the width, not the other way round: the
     photo is sized by the margin wanted either side of it (that being
     the point of this layout), and 1.25 is its 1080:1350 ratio turned
     upside down. --s5-btn-h is the button's measured height in its own
     type size, so it tracks the same clamp the button's font-size
     uses. */
  #slide-s5 {
    --s5-card-w: min(78vw, 420px);
    --s5-card-h: calc(var(--s5-card-w) * 1.25);
    --s5-btn-h: calc(2.34 * clamp(0.8rem, 1.4vw, 1.05rem));
    /* Puts the photo/button/numbers column at the middle of what is
       left below the header — checked at both 390x844 and 360x640,
       where the ideal value works out at 48% either way. */
    --s5-card-top: 48%;
    --s5-stack-gap: 18px;
    /* Named for the stack, not the pager: --s5-pager-gap already
       exists further up as the horizontal space BETWEEN the circles,
       and reusing it here quietly widened the whole row. */
    --s5-stack-pager-gap: 26px;
  }
  /* Width-driven rather than height-driven now, so the photo is sized
     by the margin either side of it — which is the point — instead of
     by whatever vertical space is left over. aspect-ratio (already on
     .s5-item) turns that width back into a height. */
  .s5-item {
    width: var(--s5-card-w);
    height: auto;
    top: var(--s5-card-top);
  }
  /* Straight under the button rather than pinned to the section's
     bottom edge. Scoped to #slide-s5 on purpose: the modal has its own
     .s5-pager-row, in a layout that has no photo above it to measure
     from, and it keeps the bottom-pinned placement. */
  #slide-s5 .s5-pager-row {
    top: calc(
      var(--s5-card-top) + var(--s5-card-h) / 2 + var(--s5-stack-gap) +
        var(--s5-btn-h) + var(--s5-stack-pager-gap)
    );
    bottom: auto;
  }
  /* The diagonal from the photo's corner to the button pointed at
     where the button used to be — there is nothing out there now. */
  .s5-item::before,
  .s5-modal-frame::before {
    display: none;
  }
  /* Out of the corner, under the photo, centred — and exactly as wide
     as the five pager circles below it, so photo, button and numbers
     line up as one stacked block. */
  .s5-item .s5-profile-btn,
  .s5-modal-frame .s5-profile-btn {
    bottom: auto;
    top: 100%;
    left: 50%;
    width: var(--s5-pager-w);
    justify-content: center;
    transform: translate(-50%, var(--s5-stack-gap, 18px));
  }
  .s5-item .s5-profile-btn:hover,
  .s5-modal-frame .s5-profile-btn:hover {
    transform: translate(-50%, calc(var(--s5-stack-gap, 18px) - 4px));
  }
  /* The liquid-glass backdrop belongs to the desktop arrangement,
     where the button floats clear of everything on plain paper. Sat
     directly under the photo it samples the card's own edge and drop
     shadow, and the displacement filter smears that straight across
     the button's type. The border and outline carry it here. */
  .s5-profile-btn::before {
    display: none;
  }
  /* Filled rather than outlined, and for a plain reason: blue type on
     the section's paper background is about 1.9:1, which is unreadable
     at any size and hopeless at the ~13px this button's type comes out
     at on a phone. Desktop gets away with it on a much larger button;
     this does not. The fill is exactly the selected pager circle
     below it — same blue, same burgundy numeral — so the column reads
     as one control stack rather than a button in a colour of its own. */
  .s5-item .s5-profile-btn,
  .s5-modal-frame .s5-profile-btn {
    background: var(--s5-blue);
    color: var(--burgundy);
    border-color: var(--s5-blue);
  }
  /* The stack's fan-out beat (section-5.js) is tuned to the desktop
     photo's size; at this width those offsets push the back cards off
     the side of a phone. Scaled down to match the smaller card. */
  .s5-carousel.fanning .s5-item:nth-child(2) {
    transform: translate(calc(-50% + 22px), calc(-50% + 10px));
  }
  .s5-carousel.fanning .s5-item:nth-child(3) {
    transform: translate(calc(-50% + 44px), calc(-50% + 20px));
  }
  .s5-carousel.fanning .s5-item:nth-child(4) {
    transform: translate(calc(-50% + 66px), calc(-50% + 30px));
  }
  .s5-carousel.fanning .s5-item:nth-child(5) {
    transform: translate(calc(-50% + 88px), calc(-50% + 40px));
  }
}

/* ------------------------------------------------------------
   Mobile: numbers only, and a plain full-screen photo popup
   ------------------------------------------------------------
   Same 1000px line as the stacked layout above. The stack is moved by
   the numbers or by swiping (section-5.js), so the arrows come off.
   The popup drops everything but the photo itself — shown whole, at
   its own ratio, as large as the screen allows — and is swiped
   through the same way. The veil on not-yet-announced exhibitors
   stays, so opening one full screen still reveals nothing. */
@media (max-width: 1000px) {
  #slide-s5 .s5-arrow {
    display: none;
  }
  .s5-modal .s5-pager-row,
  .s5-modal-frame .s5-profile-btn {
    display: none;
  }
  .s5-modal-body img {
    width: 100vw;
    height: auto;
    max-width: 100vw;
    max-height: 100dvh;
    aspect-ratio: auto;
    object-fit: contain;
    border-radius: 0;
  }
  /* The photo spans the full width, so the close button now sits over
     it: lifted above the photo, on a dark disc so it stays visible
     whatever the photo is showing behind it. */
  .s5-modal .modal-close {
    z-index: 5;
    top: max(12px, env(safe-area-inset-top, 0px));
    right: 12px;
    padding: 8px;
    border-radius: 50%;
    background: rgba(22, 17, 14, 0.6);
  }
}
