/* Depends on: base.css, viewport.css. */

/* ============================================================
   SECTION 1
   ============================================================ */
#slide-s1 {
  background: var(--paper);
}

/* image-placeholder grid: full-strength from the very first frame — the
   section now loads straight into its "hero" look (see the file header
   comment in index.html) rather than starting faded/blurred and clearing
   on scroll. The slide-up motion is kept purely as a load-in flourish. */
.s1-grid-wrap {
  position: absolute;
  z-index: 3;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 72vh;
  pointer-events: none;
}
.s1-grid {
  /* Anchored to the wrapper's own bottom edge (not just left in normal
     flow) so it stays flush with the viewport bottom at any width —
     without this, once width:100% scales the image's rendered height
     below the 72vh wrapper height (narrower viewports), it sits at the
     wrapper's top instead and a gap opens up beneath it. */
  /* How far the image sits BELOW that bottom-flush resting place, as a
     share of its own height — it reads too tall/high on screen sitting
     fully in frame, so it hangs off the bottom edge and crops. The
     slide-in animation below is `forwards`, so its end state is what
     actually holds this offset; a plain `transform` here would just be
     overwritten by it. One knob, change it here. */
  --grid-drop: 40%;
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  animation: slideInUp 1.5s ease-out forwards;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(calc(var(--grid-drop) + 50px));
  }
  to {
    opacity: 1;
    transform: translateY(var(--grid-drop));
  }
}

.s1-grid .cell {
  border: 1px solid var(--burgundy);
}
.s1-grid .cell.fill-a {
  background: var(--burgundy);
}
.s1-grid .cell.fill-b {
  background: var(--gold);
  border-color: var(--gold);
}

.s1-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Fullscreen from the first frame — fixed px size measured by
   section-1.js (deliberately NOT 100vw/100vh) so a passing viewport
   shift, like iOS's toolbar showing/hiding, doesn't resize it. A real
   window resize DOES update those properties (see the same file), or
   the box would stay frozen at the size the page loaded at and leave
   the section's background showing around it. Keeps playing behind
   every later step (logo, panel drawer, panel fullscreen) until the
   panel is opaque enough to cover it. */
.s1-video {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: var(--s1-video-fixed-w, 100vw);
  height: var(--s1-video-fixed-h, 100vh);
  /* Stand-in for the video before it has a frame to show — the same
     flat --orange Section 2 is painted in, so the hand-off from this
     placeholder to the first video frame (and the eventual scroll into
     Section 2) reads as one colour rather than a gradient wash. */
  background: var(--orange);
}

/* event logo: visible over the video from the first frame, filling the
   section — just a margin below the header and above the bottom edge —
   and stays up until the panel below grows tall enough to cover it. A
   simple fade+rise on load, independent of scroll step. */
.s1-reveal {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 3vh) 4vw 4vh;
  animation: s1RevealIn 1s ease 0.2s both;
  /* Purely decorative (just the logo image, no interactive children) —
     without this, this full-slide box sat above .s1-tagline (z-index 3,
     lowered below .s1-panel on purpose) and silently ate its clicks
     and :hover, since it covers the same area even where it's visually
     empty. Same reasoning .s1-roof already has this. */
  pointer-events: none;
}
@keyframes s1RevealIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.s1-svg {
  /* Width is a fixed vh-based value (not `auto` off aspect-ratio) so it
     stays consistently large regardless of how much vertical space the
     header/bottom margins above leave for .s1-reveal's height — with
     `width:auto` + aspect-ratio instead, the added header clearance
     shrank the available height, and the width shrank right along with
     it, making the logo noticeably smaller than before. */
  height: 100%;
  width: 80vh;
  max-width: 90vw;
  /* Hover wobble (see js/section-1.js). The script sets ONLY these two
     custom properties, never `transform` itself — the transform below
     also carries the baseline lift, and an inline transform from the
     script would drop that lift on the floor the first time the cursor
     touched the logo. Kept short and ease-out because the script
     retargets it live as the cursor moves — a longer ease-in-out lags
     behind the cursor and never actually arrives. */
  --wobble-x: 0px;
  --wobble-y: 0px;
  /* The baseline lift. It buys clearance underneath for the badge row
     and, at step 3, for the toggle pill below it — the artwork is
     centred in a box that fills the section, so raising it is what
     moves its bottom edge up off them. */
  transform: translate(var(--wobble-x), var(--wobble-y)) translateY(-12%);
  transition: transform 0.25s ease-out;
}
/* Subsection closed (step 3): the toggle pill appears and the badge
   row lifts to clear it, so the logo gives up a tenth of its size to
   open that space up. Written out as a complete transform rather than
   folded into a custom property the base rule reads, because .s1-svg
   TRANSITIONS `transform`: Chrome starts a transition off a change in
   the declared value, and `transform: var(--x)` on both states is one
   unchanged declaration to it — the logo would jump, or stick at its
   old size, instead of easing between the two. Same reasoning as the
   badge row's `bottom` further up. */
#slide-s1[data-step="3"] .s1-svg {
  transform: translate(var(--wobble-x), var(--wobble-y)) translateY(-12%)
    scale(0.9);
}
.s1-svg img {
  /* The SVG asset likely has no intrinsic width/height (only a
     viewBox), same as the header logo — without this it would fall
     back to a small default replaced-element size instead of actually
     filling (and growing with) .s1-svg. */
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Badge row: the tagline badge ("triword_khi") and the Facebook event
   CTA next to it, on screen from the first frame (independent of
   scroll step, like the event logo itself). Anchored to .slide-inner
   rather than living inside .s1-reveal/.s1-panel, same reasoning as
   the toggle pill further down — nesting them somewhere that gets
   clipped (like .s1-panel, overflow:hidden at height 0) would risk
   losing them the way the pill was lost before it was moved out here
   too.

   The WRAPPER is what's positioned, not the badges: only one element
   carries the offsets, so the two can never drift out of step, and
   row-vs-column is a single property in a single place.

   It sits lower by default (between the logo and the section's bottom
   edge) since nothing else is down there; once the toggle pill can
   appear (step 3, or step 2 reopened — same condition the pill itself
   uses) it shifts up to clear it, landing 5% lower than the pill's
   own clearance value would put it exactly flush.

   Desktop lays the two out SIDE BY SIDE. They were stacked at first,
   and that broke in exactly that lifted step-3 position: the upper
   badge rose far enough to reach the event logo, which sits at
   z-index 4 — above the badges' 3 — and simply painted over it. A row
   is one badge tall however high the group rides, so it never gets
   there. Mobile has no width for a row and keeps them stacked, the
   CTA above the tagline badge as the markup already orders them; the
   headroom for that second row comes from the event logo, which is
   scaled down at that breakpoint (see .s1-svg below). */
#slide-s1 {
  --s1-badge-fs: clamp(0.8rem, 2.6vw, 1.2rem);
}
.s1-badges {
  position: absolute;
  /* Below .s1-panel (z-index 5) on purpose: when the subsection opens
     fullscreen it should cover these badges, not sit behind them. */
  z-index: 3;
  left: 50%;
  bottom: 8vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Wider than the gap actually wanted: both badges are rotated, and a
     rotated box's corners hang past the edges the layout gave it,
     eating into the gap before any of it shows. */
  gap: 22px;
  max-width: 96vw;
  transform: translateX(-50%);
  transition: bottom 0.6s var(--ease);
}
#slide-s1[data-step="3"] .s1-badges,
#slide-s1.s1-reopened[data-step="2"] .s1-badges {
  bottom: calc((5vh + 100px) * 0.95);
}
/* Mobile only: stack, and sit 10% higher than the desktop version. */
@media (max-width: 760px) {
  .s1-badges {
    flex-direction: column;
    gap: 20px;
    bottom: calc(8vh * 1.1);
  }
  #slide-s1[data-step="3"] .s1-badges,
  #slide-s1.s1-reopened[data-step="2"] .s1-badges {
    bottom: calc((5vh + 100px) * 0.95 * 1.1);
  }
}
/* The mismatched border-radius values plus a slight rotation are what
   keep this from reading as a clean rectangle or pill. */
/* Nicknamed "triword_khi" (its 2nd hover state is the three-word
   KOSZULKI | HANDELEK | INTEGRACJA line — K/H/I) — use that name when
   talking about this element, it's faster to type than .s1-tagline. */
.s1-tagline {
  border: none;
  margin: 0;
  padding: 0.55em 1.2em;
  background: #0bbbef;
  color: var(--burgundy);
  font-family: var(--display); font-weight:800;
  letter-spacing: 0.04em;
  font-size: var(--s1-badge-fs);
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  cursor: pointer;
  transform-origin: bottom center;
  transform: rotate(-2deg);
}
/* Mobile only: read 15% bigger than the desktop version above,
   scaling out from the bottom-center point set via transform-origin
   so it grows upward and evenly to both sides rather than shifting
   off-center. */
@media (max-width: 760px) {
  .s1-tagline {
    transform: rotate(-2deg) scale(1.15);
  }
}

/* Hover slide-swap, same mechanism as the ROZKŁAD JAZDY / ORGANIZATORZY
   buttons' .s1-panel-link-inner/-track/-item (see above): the 2nd copy
   stays in normal flow and gives the track its width (the longer of
   the two texts, so the box doesn't resize on hover), the 1st sits
   pinned to that exact size via inset:0, off to the left at rest. */
.s1-tagline-inner {
  position: relative;
  display: inline-flex;
  overflow: hidden;
}
.s1-tagline-track {
  position: relative;
  display: inline-flex;
}
.s1-tagline-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  white-space: nowrap;
}
.s1-tagline-item:nth-child(1) {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
}
.s1-tagline-item:nth-child(2) {
  transform: translateX(0%);
}
@media (min-width: 761px) {
  .s1-tagline-item {
    transition: transform 0.4s var(--ease);
  }
  .s1-tagline:hover .s1-tagline-item:nth-child(1) {
    transform: translateX(0%);
  }
  .s1-tagline:hover .s1-tagline-item:nth-child(2) {
    transform: translateX(100%);
  }
}

/* ------------------------------------------------------------------
   Facebook event CTA — the burgundy badge stacked directly above
   triword_khi, and repeated at the bottom of #s1TaglineModal.
   ------------------------------------------------------------------
   Built the same way that badge is (a tilted rectangle with uneven,
   hand-drawn-looking corners, wrapping the same two-copy slide-swap),
   but deliberately not a recolour of it: burgundy on paper-2 rather
   than blue on burgundy, a smaller tilt the opposite way, and four
   corner radii that share no value with the other badge's. The point
   is that the two read as a related pair, not as one shape stamped
   twice.

   Appearance (the tilt included) lives on .s1-fb-cta; where it sits is
   split out into the --hero and --modal modifiers, because the same
   markup is used twice — once as a flex item of Section 1's badge row,
   once at the end of the modal's body. */
.s1-fb-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  margin: 0;
  padding: 0.5em 1.05em;
  background: var(--burgundy);
  color: var(--paper-2);
  font-family: var(--display); font-weight:800;
  letter-spacing: 0.03em;
  /* Reads smaller than triword_khi on purpose: this line is roughly
     half again as long, and at the badge's own size it would run past
     the edge of a phone screen (both texts are nowrap, by the same
     no-resize-on-hover logic the swap needs). */
  font-size: clamp(0.58rem, 1.9vw, 0.95rem);
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  border-radius: 18px 240px 14px 255px / 230px 16px 245px 12px;
  cursor: pointer;
  transform: rotate(1.5deg);
  transform-origin: bottom center;
}
/* In Section 1 it is simply a flex item of .s1-badges (which does all
   the positioning — see that rule further up); the only thing left to
   say here is how wide it may get before the row has to give. */
.s1-fb-cta--hero {
  max-width: 92vw;
}
/* In the modal: normal flow, under the scrolling copy. `flex:none`
   keeps it at its natural height while .s1-tagline-copy above takes
   the leftover space (and does the scrolling); align-self centers it
   in the column, .modal-body being a flex column. */
.s1-fb-cta--modal {
  flex: none;
  align-self: center;
  max-width: 100%;
  margin-top: 20px;
}

/* Hover slide-swap, identical in construction to .s1-tagline-item's
   (and .s1-panel-link-item's before it): the 2nd copy stays in normal
   flow and gives the track its width — it is the longer of the two
   texts, so the box does not resize mid-hover — while the 1st is
   pinned to exactly that box via inset:0 and parked off to the left. */
.s1-fb-cta-inner {
  position: relative;
  display: inline-flex;
  overflow: hidden;
}
.s1-fb-cta-track {
  position: relative;
  display: inline-flex;
}
.s1-fb-cta-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  white-space: nowrap;
}
.s1-fb-cta-item:nth-child(1) {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
}
.s1-fb-cta-item:nth-child(2) {
  transform: translateX(0%);
}
@media (min-width: 761px) {
  .s1-fb-cta-item {
    transition: transform 0.4s var(--ease);
  }
  .s1-fb-cta:hover .s1-fb-cta-item:nth-child(1) {
    transform: translateX(0%);
  }
  .s1-fb-cta:hover .s1-fb-cta-item:nth-child(2) {
    transform: translateX(100%);
  }
}
.s1-fb-cta-mark {
  width: 1.2em;
  height: 1.2em;
  flex: none;
}
/* The literal "|" between the mark and the event name — knocked back
   so it separates the two without competing with either. */
.s1-fb-cta-sep {
  opacity: 0.55;
  font-weight: 400;
}
/* Both texts are split across two lines on a phone and joined back
   into one on desktop — the same trick .s1-panel-date uses for the
   date/venue line (.s1-date-sep / .s1-date-break further down), and
   mobile-first the same way: the <br> is live by default and the dash
   that replaces it is hidden, then they swap over at the breakpoint.

   The <br> has to sit inside .s1-fb-cta-text rather than directly in
   .s1-fb-cta-item, because that item is a flex container — a <br>
   there would become a flex item of its own and break nothing. Both
   copies of the text carry a break, not just the event name: the
   hover copy is the LONGER of the two on one line, and .s1-fb-cta-track
   is sized by the item in normal flow (the event name), so leaving it
   at full width would push it past the box and straight into
   .s1-fb-cta-inner's overflow clip. */
.s1-fb-cta-text {
  text-align: center;
}
.s1-fb-cta-dash {
  display: none;
}
@media (min-width: 761px) {
  .s1-fb-cta-dash {
    display: inline;
  }
  .s1-fb-cta-break {
    display: none;
  }
}
/* Mobile: two lines of type make the badge roughly twice as tall,
   which is the point — at one line it read as a thin strip next to
   triword_khi below it. The size can go up at the same time, since
   the longest line is now less than half what it was, and the mark
   grows with it so it still balances a two-line block. */
@media (max-width: 760px) {
  .s1-fb-cta {
    font-size: clamp(0.72rem, 2.4vw, 1rem);
    padding: 0.6em 1em;
  }
  .s1-fb-cta-mark {
    width: 1.5em;
    height: 1.5em;
  }
}


/* ---- the arrows' idle run ----
   Both badges' trailing arrows loop this: out to the right until they
   are gone, back in from the left, then a beat parked at exactly the
   spot a static arrow would sit at — which is what keeps it reading as
   one arrow being nudged along rather than a marquee of them. The
   travel is faded AND clipped (each badge's -inner box is
   overflow:hidden), so the arrow leaves the badge rather than the text.

   Hovering a badge pauses only ITS arrow, the :hover being on the badge
   itself — the other one carries on. That hover already belongs to the
   text slide-swap, and an arrow still sprinting across the box competes
   with the swap for the same glance. animation-play-state freezes the
   arrow wherever it happens to be and it carries on from there on
   mouse-out, rather than snapping back to the start. */
@keyframes s1ArrowRun {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  30% {
    transform: translateX(180%);
    opacity: 0;
  }
  /* The jump back to the left happens in the blink between these two
     stops, while the arrow is fully transparent — hence the hundredth
     of a percent rather than a shared keyframe. */
  30.01% {
    transform: translateX(-180%);
    opacity: 0;
  }
  60% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}
.s1-arrow-run {
  animation: s1ArrowRun 2.6s var(--ease) infinite;
}
.s1-tagline:hover .s1-arrow-run,
.s1-fb-cta:hover .s1-arrow-run {
  animation-play-state: paused;
}

/* Two rows: the logo pinned as a header, the copy scrolling beneath
   it. The scroll lives on .s1-tagline-copy rather than on .modal-body
   as a whole, so the text is clipped by that box's own top edge —
   which sits exactly at the logo's bottom edge — and simply vanishes
   as it scrolls up past it. (The previous position:sticky version
   depended on the logo's background painting over text sharing the
   same scroll, which is far more fragile.)

   Long-form paragraphs also read badly centered, which is
   .modal-body's default — fine for the short single-line schedule
   entries it was written for, not for these. */
.s1-tagline-modal .modal-body {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  text-align: left;
}
.s1-tagline-copy {
  flex: 1 1 auto;
  /* Without this a flex item refuses to shrink below its content's
     height (min-height defaults to auto), so the box would just grow
     to fit every paragraph and never scroll at all. */
  min-height: 0;
  overflow-y: auto;

}
/* ---- the scrollbar, in brand colours ----
   Chrome and Safari are styled through the ::-webkit-scrollbar
   pseudo-elements below: the track and both end buttons are painted to
   nothing — `display:none` on ::-webkit-scrollbar-button is the part
   that actually removes the top and bottom arrows — leaving a burgundy
   thumb floating on the copy.

   The standard scrollbar-width/scrollbar-color properties do the same
   job in Firefox, but they CANNOT simply be set alongside: Chrome
   supports them too, and the moment it sees them it switches to the
   standard scrollbar and ignores every ::-webkit-scrollbar rule here —
   which brought the arrows back, since there is no standard property
   that turns them off. So they are scoped to browsers that have no
   ::-webkit-scrollbar to begin with, which is exactly Firefox. Its
   `thin` bar has no stepper arrows of its own, so the result matches. */
.s1-tagline-copy::-webkit-scrollbar {
  width: 8px;
}
.s1-tagline-copy::-webkit-scrollbar-track {
  background: transparent;
}
.s1-tagline-copy::-webkit-scrollbar-button {
  display: none;
  height: 0;
  width: 0;
}
.s1-tagline-copy::-webkit-scrollbar-thumb {
  background: var(--burgundy);
  border-radius: 4px;
}
.s1-tagline-copy::-webkit-scrollbar-thumb:hover {
  background: var(--burgundy-dark);
}
@supports not selector(::-webkit-scrollbar) {
  .s1-tagline-copy {
    scrollbar-width: thin;
    scrollbar-color: var(--burgundy) transparent;
  }
}
/* Logo above the text: the combined logotype (mark + brand type), used
   as a burgundy stencil — see the note on the markup in index.html.
   `aspect-ratio` off the SVG's own viewBox gives the empty <span> a
   height to fill; a mask has no intrinsic size to supply one. */
.s1-tagline-logo {
  flex: none;
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 775.2 / 238.42;
  margin: 0 auto 24px;
  background-color: var(--burgundy);
  -webkit-mask-image: url("../assets/images/logo/brand_logo-logotype.svg");
  mask-image: url("../assets/images/logo/brand_logo-logotype.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
/* Desktop: 60% of the text column, not the 25% the old square mark sat
   at. This lockup is 3.25:1 where that one was 1.46:1, so matching its
   WIDTH would have left a strip a third the height — 60% is what puts
   the two at roughly the same height above the copy. */
@media (min-width: 761px) {
  .s1-tagline-logo {
    width: 60%;
  }
}
/* Mobile: stretch the body over the full height (instead of the
   modal's default vertical centering) and start it clear of the close
   button, so the logo sits just under that button with the copy
   filling — and scrolling through — everything below it. */
@media (max-width: 760px) {
  .s1-tagline-modal {
    align-items: stretch;
  }
  .s1-tagline-modal .modal-body {
    max-height: none;
    height: 100%;
    padding-top: 76px;
    padding-bottom: 24px;
  }
}

/* Subsection panel: a burgundy drawer that slides up from the bottom at
   step 1 (title/date line + the two modal-opening "buttons", revealed one
   line at a time), then grows to cover the whole section at step 2 — at
   which point its content sits padded clear of the fixed header at the
   top and the section's bottom edge. Step 3 (reached by scrolling past
   the fully-open panel, OR by clicking the pill below while it's open —
   see .s1-panel-pill) just closes it back to height 0, same as step 0.
   `left:50% + translateX(-50%)` (rather than `left:0` + `width:100%`
   only) keeps the panel horizontally centered at every width. */
.s1-panel {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: 0;
  transform: translateX(-50%);
  overflow: hidden;
  background: var(--burgundy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height 0.9s var(--ease);
}
#slide-s1[data-step="1"] .s1-panel {
  height: 46vh;
}
#slide-s1[data-step="2"] .s1-panel {
  height: 100%;
}

/* Toggle pill: opens the panel (→ step 2) while collapsed, closes it
   (→ step 3) while open — the same button both ways, parked below the
   event logo. It's positioned with `bottom: 5vh` relative to
   .s1-panel's own box rather than the section itself: since that box
   is pinned with `bottom: 0` and only ever grows upward (its height
   animates, its bottom edge never moves), the pill sits in the exact
   same spot at every step — 0, 46vh or fully open — instead of
   jumping around as the panel behind it resizes. */
.s1-panel-pill {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: 5vh;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--paper-2);
  border-radius: 999px;
  padding: 16px 30px;
  background-color: rgba(124, 17, 40, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--paper-2);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  /* Eased and stretched to sit with the panel's own 0.9s collapse
     rather than snapping in ahead of it — the pill arriving is the
     tail of that one "subsection minimises into a button" move, so it
     shares the same easing curve. */
  transition:
    opacity 0.55s var(--ease),
    color 0.2s ease,
    background-color 0.2s ease;
}
/* At step 2 the pill (and its "×") only shows up once .s1-reopened has
   been added — i.e. once this particular step-2 was reached by
   clicking the pill while collapsed (see section-1.js), not by
   scrolling there normally. Step 3 always shows it, regardless. */
#slide-s1.s1-reopened[data-step="2"] .s1-panel-pill,
#slide-s1[data-step="3"] .s1-panel-pill {
  opacity: 1;
  pointer-events: auto;
}
.s1-panel-pill:hover {
  color: var(--paper);
  background-color: rgba(124, 17, 40, 0.75);
}

/* The two stacked labels — "SZCZEGÓŁY" + chevron (closed) and "×"
   (open) — swap the same way Section 1's ROZKŁAD JAZDY / ORGANIZATORZY
   buttons swap their hover copies (see .s1-panel-link-item just above),
   just vertically instead of horizontally: those slide sideways because
   their icon is an arrow pointing right, this one slides up/down
   because its icon is a chevron pointing down. Whichever label is
   leaving always slides further down (the direction the chevron
   points); the one replacing it always arrives from directly above. */
.s1-panel-pill-viewport {
  position: relative;
  display: inline-flex;
  overflow: hidden;
}
.s1-panel-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  white-space: nowrap;
  transition: transform 0.4s var(--ease);
}
.s1-panel-pill-closed {
  transform: translateY(0);
}
.s1-panel-pill-open {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-100%);
}
#slide-s1.s1-reopened[data-step="2"] .s1-panel-pill-closed {
  transform: translateY(100%);
}
#slide-s1.s1-reopened[data-step="2"] .s1-panel-pill-open {
  transform: translateY(0);
}
/* Text made bigger on its own (rather than via the button's overall
   font-size) so the pill's fixed padding keeps its footprint from
   growing along with it. */
.s1-panel-pill-closed span {
  font-family: var(--display); font-weight:800;
  letter-spacing: 0.08em;
  font-size: 1.2rem;
}
.s1-panel-pill .s1-panel-arrow {
  width: 0.6em;
  height: 0.6em;
  flex: none;
  stroke: currentColor;
}
.s1-panel-pill-open svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  flex: none;
}

/* Roof art: a decorative scalloped awning strip pinned along the very
   top edge, above everything else in the section (including the panel
   once it grows fullscreen) — desktop/mobile swap via the same 760px
   breakpoint used elsewhere in this file. */
.s1-roof {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}
/* The desktop strip is a row of 14 tab <img>s, the mobile one is a
   single <img> — so sizing is set per-case below rather than on a
   blanket ".s1-roof img", which would hit both and fight the flex
   sizing the tabs need. */
.s1-roof .s1-roof-desktop {
  display: flex;
  /* Without this the tabs stretch to the row's height and lose their
     aspect ratio; flex-start lets each keep its natural height. */
  align-items: flex-start;
  width: 100%;
  /* The tab art carries 100 units of extra straight edge above the
     roofline — the SVGs are 272.7 tall for what reads as a 172.7-tall
     strip. That overhang exists to be hidden: lifting the row by
     exactly its share of the height parks it above the section's top
     edge, where .slide's overflow:hidden crops it. It's also what
     keeps the roofline solid while a tab swings, since the pivot sits
     inside that hidden band and there's always material above the
     visible edge to cover the turn. A % here resolves against the
     element's own height, so it tracks the tabs at any width. */
  transform: translateY(calc(-100% * 100 / 272.7));
}
/* Each tab is a <span> wrapping its <img>, and the two carry one
   rotation each: the span sways on its own forever, the img leans away
   from the cursor. Splitting them across two elements is what lets the
   two run on their own clocks — a keyframe animation and a transition
   fighting over one `transform` would stutter, and the lean could only
   ever interrupt the sway rather than add to it. The two are sized
   very differently on purpose: the idle sway is only meant to keep the
   awning alive, so it stays small, and the cursor lean (MAX_DEG in
   js/section-1.js) is the one that actually reads as a swing.

   `flex:1 1 0` (basis 0, not auto) is what splits the viewport into 14
   equal tabs regardless of the SVGs' intrinsic width. */
.s1-roof-unit {
  flex: 1 1 0;
  min-width: 0;
  display: block;
  /* Same ratio as the units' own viewBox. Stated outright rather than
     left to the SVGs' intrinsic size: a flexed replaced element taking
     its height from a basis-0 width is exactly the case browsers are
     fussiest about, and any disagreement here shows up as a ragged
     bottom edge across the strip. */
  aspect-ratio: 192 / 272.7;
  /* The pivot both rotations swing on: centred on width, a third of
     the way down. That lands just inside the hidden overhang above the
     roofline (a third of 272.7 is 90.9, the roofline is at 100), so
     the swing pivots from just out of frame and the visible top edge
     barely travels while the tab's body sweeps a long arc below it. */
  transform-origin: center 33.333%;
  --sway: 4deg;
  animation: roofSway var(--sway-dur, 6s) ease-in-out infinite;
  /* Negative delay starts each tab partway into the cycle rather than
     making it wait, so the sway ripples along the awning instead of
     the whole roof tilting in lockstep. js/section-1.js numbers the
     tabs; unset, they simply all sway together. */
  animation-delay: calc(var(--i, 0) * -0.43s);
}
.s1-roof-unit img {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: center 33.333%;
  /* --unit-rot is set by the script on the SPAN, and inherits down to
     here — custom properties inherit, so the script never has to know
     about this inner element. */
  transform: rotate(var(--unit-rot, 0deg));
  transition: transform 0.45s ease-out;
}
@keyframes roofSway {
  0%,
  100% {
    transform: rotate(calc(var(--sway) * -1));
  }
  50% {
    transform: rotate(var(--sway));
  }
}
/* Needs to be at least as specific as ".s1-roof .s1-roof-desktop"
   above — a bare ".s1-roof-mobile { display: none }" would lose on
   specificity regardless of source order. */
.s1-roof img.s1-roof-mobile {
  display: none;
  width: 100%;
  height: auto;
}
@media (max-width: 760px) {
  /* Narrowed here, and only here: on a phone the two badges below
     stack instead of sitting side by side, and that second row has to
     come out of somewhere. The logo is what pays for it — it is the
     one element in the section with height to spare, and it still
     reads as the hero at four fifths the width. */
  .s1-svg {
    width: 62vh;
    max-width: 72vw;
  }
  .s1-roof .s1-roof-desktop {
    display: none;
  }
  .s1-roof img.s1-roof-mobile {
    display: block;
    width: 150%;
    margin-left: -25%;
  }
}

.s1-panel-inner {
  /* Grid with a single auto-sized column, rather than a flex column:
     with `justify-items: stretch` (grid's default), every item —
     the date paragraph AND both buttons — stretches to the width of
     whichever of them is intrinsically widest, so the date text ends
     up exactly as wide as the buttons below it instead of the two
     being sized independently. */
  width: 100%;
  max-width: 1200px;
  padding: calc(var(--header-h) + 3vh) 6vw 4vh;
  display: grid;
  grid-template-columns: max-content;
  justify-content: center;
  gap: 2.4vh;
  text-align: center;
  transition: padding-bottom 0.3s ease;
}
/* Makes room for the toggle pill's "×" (close) label — which only
   shows up once the panel has been reopened manually, see
   section-1.js/.s1-reopened — so the buttons row doesn't sit right
   underneath it. Not needed on an ordinary scroll-revealed open panel,
   since the pill/× isn't shown then at all. */
#slide-s1.s1-reopened[data-step="2"] .s1-panel-inner {
  padding-bottom: calc(4vh + 90px);
}

.s1-panel-line {
  opacity: 0;
  transform: translateY(28px);
}
#slide-s1[data-step="1"] .s1-panel-line,
#slide-s1[data-step="2"] .s1-panel-line {
  animation: s1PanelLineIn 0.7s var(--ease) forwards;
}
.s1-panel-line:nth-child(1) {
  animation-delay: 0.15s;
}
.s1-panel-line:nth-child(2) {
  animation-delay: 0.35s;
}
@keyframes s1PanelLineIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.s1-panel-date {
  font-family: var(--display); font-weight:800;
  color: var(--paper-2);
  /* 10% down from the sizes this line first carried (1.95rem / 4.8vw
     / 3.6rem here, 2.8rem / 4.2vw / 4rem on desktop, in the min-width
     block further down) — it read too large for the panel. Every term
     of the clamp is scaled, not just the cap, so the whole ramp
     shifts instead of flattening out at the top. */
  font-size: clamp(1.755rem, 4.32vw, 3.24rem);
  letter-spacing: 0.01em;
  line-height: 1.3;
}
/* Mobile-first: the date/venue read as 3 stacked lines, so the pipe
   and comma that join them on desktop (see the min-width block below)
   stay hidden and the <br>s between them do the line-breaking. */
.s1-date-sep {
  display: none;
}

/* The two modal-opening buttons stack as their own "line" on mobile
   (see the min-width block below for the desktop side-by-side row) —
   same 2.4vh gap the grid above already uses between its own rows, so
   spacing reads the same whether it's grid gap or flex gap doing it. */
.s1-panel-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.4vh;
}

.s1-panel-link {
  font-family: var(--display); font-weight:800;
  letter-spacing: 0.02em;
  color: var(--paper-2);
  background: none;
  border: 2px solid var(--paper-2);
  border-radius: 999px;
  font-size: clamp(1.3rem, 3.5vw, 2.9rem);
  padding: 0.45em 1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.2s var(--ease);
}
.s1-panel-link:hover {
  background: var(--paper-2);
  color: var(--burgundy);
  transform: translateY(-4px);
}
/* Same slide-swap hover as the bento CTA button (section-3.css's
   .cta-label-track). The 2nd copy stays in normal flow and is what
   actually gives .s1-panel-link-track its size (well-defined, no
   auto-sizing ambiguity). The 1st copy is absolutely positioned with
   inset:0, which pins its box to EXACTLY the same size as the 2nd copy
   — so a translateX(±100%) on either one always lands flush against
   the other, edge to edge, with no gap and no overlap. At rest the 1st
   copy sits one label-width to the left (hidden by overflow:hidden)
   while the 2nd sits visible in place; on hover they swap — the 2nd
   exits right, the 1st enters from the left. */
.s1-panel-link-inner {
  position: relative;
  display: inline-flex;
  overflow: hidden;
}
.s1-panel-link-track {
  position: relative;
  display: inline-flex;
}
.s1-panel-link-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  white-space: nowrap;
  transition: transform 0.4s var(--ease);
}
.s1-panel-link-item:nth-child(1) {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
}
.s1-panel-link-item:nth-child(2) {
  transform: translateX(0%);
}
.s1-panel-link:hover .s1-panel-link-item:nth-child(1) {
  transform: translateX(0%);
}
.s1-panel-link:hover .s1-panel-link-item:nth-child(2) {
  transform: translateX(100%);
}
.s1-panel-arrow {
  width: 0.65em;
  height: 0.65em;
  flex: none;
  stroke: currentColor;
}

/* Desktop only: there's plenty of horizontal room, so the date/venue
   collapses from 3 lines to 2 (the 2nd <br> — .s1-date-break — hides
   and its comma separator — .s1-date-sep — shows, merging "BEER
   STATION PRAGA" and "ZĄBKOWSKA 5" onto one line; the 1st <br>, plain
   and unclassed in the markup, always stays so "3 PAŹDZIERNIKA 2026"
   keeps its own line at every width) and the two buttons sit side by
   side in a row instead of stacked. Reverts to the stacked mobile
   layout again below 1200px, same breakpoint the merge itself needs. */
@media (min-width: 1200px) {
  .s1-date-sep {
    display: inline;
  }
  .s1-date-break {
    display: none;
  }
  .s1-panel-date {
    font-size: clamp(2.52rem, 3.78vw, 3.6rem);
  }
  .s1-panel-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 24px;
  }
}

.btn-cta {
  font-family: var(--display); font-weight:800;
  letter-spacing: 0.02em;
  font-size: 1rem;
  color: var(--paper);
  background: var(--burgundy);
  border: none;
  padding: 0.95em 2.1em;
  border-radius: 999px;
  /* border: 5px solid var(--burgundy); */
  /* box-shadow: 0 16px var(--burgundy); */
  transition:
    transform 0.2s var(--ease),
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.btn-cta:hover {
  transform: translateY(-12px);
  background: var(--burgundy);
  box-shadow: 0 12px 0 0 var(--burgundy-dark);
}

.btn-cta-outline {
  background: var(--paper-2);
  color: var(--burgundy);
  /* border: 5px solid var(--burgundy); */
}
.btn-cta-outline:hover {
  background: var(--paper);
  color: var(--burgundy);
}

@media (max-width: 760px) {
  .s1-grid {
    position: absolute;
    width: 100%;
    /* height: 100%; */
    /* display: grid; */
    /* grid-template-rows: repeat(5, 1fr); */
    /* grid-template-columns: repeat(16, 1fr); */

    bottom: 0;
    animation: slideInUp 1.5s ease-out forwards;
  }
}
