/* The curtain menu: a menu standing on a little stage in a gilded arch, behind a red velvet curtain, on a black page.
   The curtain is a cloth simulated in WebGL; pressed, it opens to the sides and is tied back, and the menu is there
   under a spot. */
:root {
  --house: #000000;         /* the page */
  --wall: #22121a;          /* the back of the stage */
  --velvet: #7a0f1c;        /* the velvet */
  --sheen: #e2697a;         /* the sheen of the velvet on the folds */
  --shade: #1c0307;         /* the velvet deep in the folds */
  --gold: #e0b96e;          /* the fringe, the braid and the frame */
  --gold-dark: #7c5622;
  --ivory: #f6ead3;         /* the words on the stage */
  --spot: #ffe2a8;          /* the light on the stage */
}

* {
  box-sizing: border-box;
}

/* a tap is a click at once: no wait for a double tap */
html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--house);
  color: var(--ivory);
  font-family: 'Hanken Grotesk Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 18px 16px 22px;
}

.theatre {
  width: min(980px, 100%);
  display: grid;
  gap: 16px;
}

/* ---------------------------------------------------------------- the button over the stage */
.bar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px 0 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--velvet) 26%, transparent);
  color: var(--ivory);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.25s cubic-bezier(0.34, 1.6, 0.5, 1);
}

@media (hover: hover) and (pointer: fine) {
  .toggle:hover {
    border-color: var(--gold);
    background: color-mix(in srgb, var(--velvet) 48%, transparent);
  }
}

.toggle:active {
  transform: scale(0.96);
}

.toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* the little curtain of the icon: its two drapes go to the sides when the menu is open */
.toggle__icon {
  width: 22px;
  height: 22px;
  overflow: visible;
}

.toggle__rail {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.toggle__drape {
  fill: var(--velvet);
  stroke: var(--gold);
  stroke-width: 1.2;
  stroke-linejoin: round;
  transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}

.toggle__drape--left {
  transform-origin: 3.5px 4px;
}

.toggle__drape--right {
  transform-origin: 20.5px 4px;
}

.toggle[aria-expanded='true'] .toggle__drape--left {
  transform: scaleX(0.42);
}

.toggle[aria-expanded='true'] .toggle__drape--right {
  transform: scaleX(0.42);
}

.toggle__words {
  display: inline-block;
  overflow: hidden;
  height: 1.3em;
  line-height: 1.3;
}

.toggle__word {
  display: inline-block;
}

/* ---------------------------------------------------------------- the stage, in its gilded arch */
/* (the theatre's stage is .scene: .stage is the page round the whole menu) */
.frame {
  padding: 7px;
  border-radius: 50% 50% 10px 10px / 92px 92px 10px 10px;
  background: linear-gradient(180deg, #3a2410, #1b0f08 60%, #2c1a0b);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--gold) 70%, transparent),
    0 0 0 1px color-mix(in srgb, var(--gold) 25%, transparent),
    0 40px 90px -30px rgba(0, 0, 0, 0.8),
    0 0 120px -20px color-mix(in srgb, var(--velvet) 45%, transparent);
}

.scene {
  position: relative;
  height: clamp(440px, calc(100svh - 196px), 640px);
  overflow: hidden;
  border-radius: 50% 50% 5px 5px / 86px 86px 5px 5px;
  background: var(--wall);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 60%, #000);
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

.scene.is-closed {
  cursor: pointer;
}

/* the back of the stage: a wall of dark panels, a wooden floor in perspective and the spot */
.set {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.set::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 64px),
    linear-gradient(180deg, #120609 0%, var(--wall) 46%, #2a1720 86%);
}

/* the boards: a flat trapezoid, its lines drawn by an SVG that fans them out towards the front */
.set__floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 13%;
  background: linear-gradient(180deg, #2c180e, #4a2a17 70%, #5a341c);
  clip-path: polygon(3% 0, 97% 0, 100% 100%, 0 100%);
}

.set__floor svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.set__floor path {
  fill: none;
  stroke: rgba(0, 0, 0, 0.38);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.set__spot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 380px;
  height: 100%;
  margin-left: -190px;
  opacity: 0.4;             /* behind the closed curtain the spot is already on: it leaks through the gap */
  background:
    radial-gradient(48% 9% at 50% 89%, color-mix(in srgb, var(--spot) 55%, transparent), transparent 70%),
    radial-gradient(40% 60% at 50% 46%, color-mix(in srgb, var(--spot) 16%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--spot) 10%, transparent), color-mix(in srgb, var(--spot) 18%, transparent));
  clip-path: polygon(41% 0, 59% 0, 96% 100%, 4% 100%);
}

/* ---------------------------------------------------------------- the menu on the stage */
.programme {
  position: absolute;
  inset: 13% 0 12%;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  padding: 0 24px;
  text-align: center;
}

.programme__list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.act {
  display: grid;
  justify-items: center;
  padding: 6px 18px 7px;
  border-radius: 14px;
  outline-offset: 2px;
}

.act__name {
  font-family: 'Bodoni Moda Variable', Didot, serif;
  font-size: clamp(27px, 4vw, 40px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
}

.act__note {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--gold) 70%, transparent);
  transition: color 0.3s ease;
}

.act[aria-current='page'] .act__name,
.act.is-lit .act__name {
  color: var(--gold);
}

.act.is-lit .act__note {
  color: var(--ivory);
}

.act:focus-visible {
  outline: 2px solid var(--gold);
}

.programme__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
}

.tickets {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--gold);
  color: #2a1606;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.6, 0.5, 1);
}

@media (hover: hover) and (pointer: fine) {
  .tickets:hover {
    background: var(--ivory);
    transform: translateY(-1px);
  }
}

.tickets:focus-visible {
  outline: 2px solid var(--ivory);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- the curtain */
/* the cloth, drawn in WebGL over the whole stage; the pointer goes through it */
.cloth {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* without WebGL: two plain velvet curtains that slide away */
.velvet {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  pointer-events: none;
}

.no-gl .velvet {
  display: block;
}

.no-gl .cloth {
  display: none;
}

.velvet span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 51%;
  background:
    repeating-linear-gradient(90deg, var(--shade) 0, var(--velvet) 18px, var(--sheen) 26px, var(--velvet) 34px, var(--shade) 48px);
  box-shadow: inset 0 -16px 0 -4px var(--gold);
}

.velvet span:first-child {
  left: 0;
}

.velvet span:last-child {
  right: 0;
}

/* the front edge of the stage, and the warm light of the footlights hidden in it */
.apron {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 4.5%;
  min-height: 18px;
  background: linear-gradient(180deg, #3b2412, #160b06);
  box-shadow: 0 -1px 0 color-mix(in srgb, var(--gold) 55%, transparent), 0 -18px 30px -12px color-mix(in srgb, var(--spot) 30%, transparent);
  pointer-events: none;
}

@media (max-width: 560px) {
  .toggle {
    height: 42px;
    padding: 0 15px 0 12px;
  }

  .frame {
    border-radius: 50% 50% 8px 8px / 54px 54px 8px 8px;
    padding: 5px;
  }

  .scene {
    border-radius: 50% 50% 4px 4px / 50px 50px 4px 4px;
  }

  .programme {
    gap: 16px;
    padding: 0 12px;
  }

  .programme__foot {
    flex-direction: column;
  }

  .act {
    padding: 4px 12px 5px;
  }

  .act__note {
    font-size: 11.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toggle,
  .toggle__drape,
  .tickets {
    transition: none;
  }
}
