/*
 * Navigation, 21+ entry and section transition
 *
 * The interactive surfaces follow the page's established art direction:
 * green fields, sand paper and a single, proportional torn edge at each
 * colour hand-off.  The supplied horizontal paper is never stretched to a
 * content height; a solid field supplies the middle instead.
 */

:root {
  --interactive-paper-edge: clamp(64px, 10vw, 136px);
  --gate-paper-edge: clamp(34px, 5.5vw, 64px);
}

.hero { z-index: 2; }

/* One high-contrast identity mark is used throughout the header and menu. */
.brand {
  position: relative;
  display: block;
  width: clamp(132px, 28vw, 196px);
  max-width: clamp(132px, 28vw, 196px);
  flex: 0 0 clamp(132px, 28vw, 196px);
}

.brand img {
  filter: brightness(0) saturate(100%) invert(90%) sepia(20%) saturate(429%) hue-rotate(344deg) brightness(98%) contrast(91%);
}

/* The contextual hero actions are required on full desktop as well. */
@media (min-width: 1101px) {
  .hero .button-row { display: flex !important; }

  /* Keep the compact logo anchored left while the navigation group uses the
     available header width on the right. */
  .site-header > .main-nav { margin-left: auto; }

  /* This mark belongs to the compact, opened navigation only. */
  .main-nav__brand { display: none !important; }

  .main-nav__meta,
  .main-nav__foot { display: none; }
}

/* --------------------------------------------------------------------------
   Compact navigation
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  html.is-menu-open,
  body.is-menu-open { overflow: hidden; }

  /* The header animation creates its own stacking context, so it must sit
     above the page while its fixed navigation is open. */
  .site-header { position: relative; z-index: 1202; }

  .menu-toggle {
    position: relative;
    top: 0;
    z-index: 1203;
    display: flex;
    flex: 0 0 56px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    min-width: 56px;
    min-height: 56px;
    gap: 5px;
    padding: 9px;
    cursor: pointer;
    color: var(--paper);
    border: 1px solid var(--paper);
    background: var(--green);
    box-shadow: 4px 4px 0 var(--orange);
    transition: transform .18s ease, color .18s ease, background-color .18s ease, box-shadow .18s ease;
  }

  .menu-toggle::before {
    content: none;
  }

  .menu-toggle span:not(.sr-only) {
    display: block;
    width: 32px;
    height: 3px;
    margin: 0;
    background: currentColor;
    transform-origin: center;
    transition: transform .2s ease, opacity .16s ease;
  }

  .menu-toggle:hover { transform: translate(1px, 1px); box-shadow: 3px 3px 0 var(--orange); }

  .menu-toggle:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: 4px;
  }

  .menu-toggle[aria-expanded="true"] {
    color: var(--green);
    background: var(--sand);
    box-shadow: 2px 2px 0 var(--orange);
    transform: translate(2px, 2px);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(.55); }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .main-nav,
  .main-nav.is-open {
    position: fixed !important;
    z-index: 1200 !important;
    inset: 0 auto 0 calc(-1 * var(--side)) !important;
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    width: 100vw !important;
    max-width: none !important;
    min-height: 100dvh;
    margin: 0 !important;
    padding: calc(var(--interactive-paper-edge) + clamp(34px, 5vh, 58px)) max(var(--side), 24px) calc(var(--interactive-paper-edge) + clamp(32px, 5vh, 54px)) !important;
    overflow: hidden auto;
    color: var(--paper);
    background: var(--green) !important;
    border: 0 !important;
    box-shadow: none !important;
    counter-reset: bm-club-register;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity .2s ease, transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s;
  }

  .main-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity .2s ease, transform .28s cubic-bezier(.2, .8, .2, 1);
  }

  /* Both edges are shallow proportional crops of the source sheet.  The
     lower edge uses a mirrored, differently cropped pass, so it belongs to
     the same paper but never looks mechanically duplicated. */
  .main-nav::before,
  .main-nav::after {
    content: "" !important;
    position: absolute;
    z-index: 0;
    right: 0;
    left: 0;
    height: var(--interactive-paper-edge);
    pointer-events: none;
    background-color: var(--sand);
    background-image: url("../images/backgrounds/green-paper-cut.webp");
    background-repeat: no-repeat;
  }

  .main-nav::before {
    /* The compact menu is a clean green index: its header paper edge is
       intentionally removed, leaving only the navigation and close control. */
    content: none !important;
  }

  .main-nav::after {
    bottom: 0;
    background-position: 42% top;
    background-size: 112% auto;
    transform: scaleY(-1);
  }

  .main-nav > * {
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .26s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
  }

  .main-nav.is-open > * { opacity: 1; transform: translateY(0); }
  .main-nav.is-open > *:nth-child(1) { transition-delay: .04s; }
  .main-nav.is-open > *:nth-child(2) { transition-delay: .08s; }
  .main-nav.is-open > *:nth-child(3) { transition-delay: .12s; }
  .main-nav.is-open > *:nth-child(4) { transition-delay: .16s; }
  .main-nav.is-open > *:nth-child(5) { transition-delay: .20s; }
  .main-nav.is-open > *:nth-child(6) { transition-delay: .24s; }
  .main-nav.is-open > *:nth-child(7) { transition-delay: .28s; }

  .main-nav__meta {
    /* The register caption and its ruler read like a digital interface,
       rather than the hand-printed paper language used throughout the site. */
    display: none;
  }

  .main-nav__brand {
    position: absolute;
    /* Keep the identity mark in its own top-left header area, clear of the
       first navigation item on shorter phone viewports. */
    top: max(-14px, calc(env(safe-area-inset-top, 0px) - 14px));
    left: max(var(--side), 16px);
    display: block !important;
    width: clamp(132px, 28vw, 196px);
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .main-nav__brand::before { content: none !important; }

  .main-nav__brand img {
    display: block;
    width: 100%;
    height: auto;
    filter: brightness(0) saturate(100%) invert(90%) sepia(20%) saturate(429%) hue-rotate(344deg) brightness(98%) contrast(91%);
  }

  .main-nav a {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    min-height: clamp(68px, 9vh, 88px);
    padding: clamp(11px, 1.9vh, 18px) 0;
    color: var(--paper);
    border: 0 !important;
    background: transparent;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: clamp(48px, 7.3vw, 82px) !important;
    letter-spacing: .025em;
    line-height: .92 !important;
    text-shadow: none;
    transition: color .16s ease, transform .16s ease;
  }

  .main-nav a::before {
    counter-increment: bm-club-register;
    content: "0" counter(bm-club-register);
    color: rgb(239 228 210 / .62);
    font-family: "Iosevka Charon Mono", ui-monospace, monospace;
    font-size: 9px;
    letter-spacing: .08em;
    line-height: 1;
  }

  .main-nav a::after {
    /* No UI-arrow: the link itself is the familiar, printed navigation cue. */
    content: none !important;
  }

  .main-nav a:hover,
  .main-nav a:focus-visible {
    color: var(--orange);
    outline: 0;
    transform: translateX(3px);
  }

  .main-nav a:focus-visible { text-decoration: underline 2px var(--orange); text-underline-offset: 7px; }

  .main-nav__foot {
    margin: clamp(22px, 4vh, 34px) 0 0;
    color: rgb(239 228 210 / .6);
    font-family: "Iosevka Charon Mono", ui-monospace, monospace;
    font-size: 8px;
    letter-spacing: .11em;
    line-height: 1.3;
  }
}

@media (max-width: 620px) {
  :root { --interactive-paper-edge: clamp(56px, 17vw, 80px); }

  .menu-toggle { top: 0; flex-basis: 52px; width: 52px; min-width: 52px; min-height: 52px; }
  .menu-toggle span:not(.sr-only) { width: 30px; }

  .main-nav,
  .main-nav.is-open {
    padding-inline: max(var(--side), 18px) !important;
    padding-block: calc(var(--interactive-paper-edge) + 34px) calc(var(--interactive-paper-edge) + 30px) !important;
  }

  .main-nav a { grid-template-columns: 30px minmax(0, 1fr) 14px; column-gap: 10px; }
  .main-nav a { grid-template-columns: 22px minmax(0, 1fr); column-gap: 9px; }
}

/* --------------------------------------------------------------------------
   21+ entry
   -------------------------------------------------------------------------- */
.age-gate {
  position: fixed;
  z-index: 1300;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: clamp(22px, 3vw, 34px);
  padding: clamp(24px, 4vw, 48px) 18px;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--paper);
  background: var(--green);
}

.age-gate__masthead {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 820px);
  gap: 18px;
  color: var(--paper);
}

.age-gate__masthead .age-gate__logo {
  width: min(226px, 58vw);
  height: auto;
  /* The source logo is dark green for the photographic hero.  On this dark
     entry field it becomes a warm paper mark, retaining contrast without
     introducing a new brand colour. */
  filter: brightness(0) saturate(100%) invert(90%) sepia(20%) saturate(429%) hue-rotate(344deg) brightness(98%) contrast(91%);
}

.age-gate__masthead > span {
  max-width: 19ch;
  color: var(--orange);
  font-family: "Iosevka Charon Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: .12em;
  line-height: 1.35;
  text-align: right;
}

/* The wrapper owns the two edge crops; the readable panel stays a normal,
   flexible surface in the middle and can never deform either torn edge. */
.age-gate__paper {
  --gate-lower-paper-scale: 116%;
  position: relative;
  z-index: 0;
  width: min(100%, 820px);
  margin-block: var(--gate-paper-edge);
  background: var(--sand);
}

.age-gate__paper::before,
.age-gate__paper::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 0;
  left: 0;
  height: var(--gate-paper-edge);
  pointer-events: none;
  background-color: var(--green);
  background-image: url("../images/backgrounds/green-paper-banner.webp");
  background-repeat: no-repeat;
}

.age-gate__paper::before {
  top: calc(-1 * var(--gate-paper-edge));
  background-position: center top;
  background-size: 100% auto;
}

.age-gate__paper::after {
  bottom: calc(-1 * var(--gate-paper-edge));
  background-position: 38% top;
  background-size: var(--gate-lower-paper-scale) auto;
  transform: scaleY(-1);
}

.age-gate__panel {
  display: grid;
  grid-template-columns: minmax(0, .76fr) minmax(0, 1.24fr);
  align-items: start;
  gap: clamp(28px, 5vw, 64px);
  width: 100%;
  aspect-ratio: auto;
  box-sizing: border-box;
  padding: clamp(38px, 6.2vw, 74px) clamp(28px, 6vw, 72px);
  color: var(--green);
  background: transparent;
  border: 0;
  box-shadow: none;
  filter: none;
  animation: bm-gate-paper-in .32s cubic-bezier(.2, .8, .2, 1) both;
}

.age-gate__panel::before { content: none; }

.age-gate__ticket-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 7px;
  padding: 0;
  border: 0;
}

.age-gate__ticket-meta span {
  color: var(--green);
  font-family: "Iosevka Charon Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: .1em;
  line-height: 1.3;
}

.age-gate__ticket-meta b {
  display: block;
  min-width: 0;
  margin-top: clamp(18px, 3vw, 30px);
  color: var(--orange);
  border: 0;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(82px, 12vw, 132px);
  line-height: .72;
}

.age-gate__question { display: block; margin: 0; }
.age-gate__stamp { display: none; }

.age-gate__eyebrow {
  margin: 0 0 12px;
  color: var(--orange);
  font-family: "Iosevka Charon Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: .13em;
  line-height: 1.2;
}

.age-gate h1 {
  margin: 0;
  color: var(--green);
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(50px, 7.4vw, 82px);
  line-height: .87;
}

.age-gate__copy > p:not(.age-gate__eyebrow),
.age-gate__denied > p:not(.age-gate__eyebrow) {
  max-width: 40ch;
  margin-top: 18px;
  color: var(--green);
  font-size: clamp(13px, 1.45vw, 16px);
  line-height: 1.45;
}

.age-gate__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: clamp(24px, 4vw, 34px);
}

.age-gate__button {
  min-height: 48px;
  padding: 9px 16px 8px;
  color: var(--paper);
  border: 2px solid var(--green);
  background: var(--orange);
  box-shadow: 4px 4px 0 var(--green);
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(20px, 2.35vw, 25px);
  line-height: 1;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.age-gate__button:hover,
.age-gate__button:focus-visible {
  color: var(--paper);
  border-color: var(--green);
  background: var(--orange);
  box-shadow: 2px 2px 0 var(--green);
  transform: translate(2px, 2px);
}

.age-gate__button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.age-gate__button--deny {
  color: var(--green);
  border: 1px solid var(--green);
  background: transparent;
  box-shadow: none;
}

.age-gate__button--deny:hover,
.age-gate__button--deny:focus-visible {
  color: var(--paper);
  background: var(--green);
  box-shadow: 2px 2px 0 var(--orange);
}

.age-gate__denied {
  grid-column: 2;
  max-width: 40ch;
}

@keyframes bm-gate-paper-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   In-page transition
   -------------------------------------------------------------------------- */
.page-paper-transition {
  position: fixed;
  z-index: 1250;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  background: var(--green);
  transform-origin: center;
}

.page-paper-transition::before,
.page-paper-transition::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  height: var(--interactive-paper-edge);
  background-color: var(--sand);
  background-image: url("../images/backgrounds/green-paper-cut.webp");
  background-repeat: no-repeat;
}

.page-paper-transition::before {
  top: 0;
  background-position: center top;
  background-size: 100% auto;
}

.page-paper-transition::after {
  bottom: 0;
  background-position: 42% top;
  background-size: 112% auto;
  transform: scaleY(-1);
}

html.is-section-transition .page-paper-transition {
  visibility: visible;
  animation: bm-paper-sweep .62s cubic-bezier(.22, .7, .24, 1) both;
}

/* A single torn sheet passes over the page.  Unlike the former geometric
   compression, it preserves its natural paper silhouette throughout. */
@keyframes bm-paper-sweep {
  0% {
    opacity: 0;
    transform: translateY(-108%) rotate(-.18deg);
  }
  14% { opacity: 1; }
  46% {
    opacity: 1;
    transform: translateY(0) rotate(.1deg);
  }
  70% { opacity: 1; transform: translateY(0) rotate(0); }
  100% {
    opacity: 0;
    transform: translateY(108%) rotate(-.12deg);
  }
}

html.is-instant-scroll { scroll-behavior: auto; }

@media (max-width: 620px) {
  :root { --gate-paper-edge: clamp(26px, 8vw, 38px); }

  .age-gate { align-content: start; gap: 18px; padding: 18px 14px; }
  .age-gate__masthead { gap: 12px; }
  .age-gate__masthead .age-gate__logo { width: min(184px, 57vw); }
  .age-gate__masthead > span { font-size: 8px; }
  .age-gate__paper { margin-block: var(--gate-paper-edge); }
  .age-gate__panel { grid-template-columns: 1fr; gap: 24px; padding: 34px 30px 42px; }
  .age-gate__ticket-meta { grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: end; }
  .age-gate__ticket-meta b { grid-column: 2; grid-row: 1 / span 2; margin: 0; font-size: 66px; }
  .age-gate h1 { font-size: clamp(42px, 12vw, 54px); }
  .age-gate__copy > p:not(.age-gate__eyebrow),
  .age-gate__denied > p:not(.age-gate__eyebrow) { margin-top: 15px; font-size: 12px; }
  .age-gate__actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 22px; }
  .age-gate__button { min-height: 44px; font-size: 20px; }
  .age-gate__denied { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .main-nav,
  .main-nav.is-open,
  .main-nav > *,
  .menu-toggle,
  .menu-toggle span:not(.sr-only),
  .age-gate__panel,
  .age-gate__button,
  .page-paper-transition { animation: none !important; transition: none !important; }
}
