/* The talk night row that stretches into its page: the list of nights of a made-up series of evening talks on a warm
   white page. Each row has a filled date tile in its own colour; the tile is drawn again, bigger, by the SVG shape
   that covers the screen and becomes the header of the night's page. The page of the night sits on top. */
:root {
  --page: #f5f3ee;          /* the page */
  --ink: #16140f;           /* the words */
  --muted: #7b766c;         /* the small words */
  --rule: rgba(22, 20, 15, 0.09); /* the hairlines between rows */
  --plate: #ffffff;         /* the plate under a row on hover */
  --on: #ffffff;            /* the words on the coloured header */
  --button: #16140f;        /* the Get tickets button */
  --button-ink: #f5f3ee;    /* its words */
  --col: 680px;             /* the width of the column */
  --pad: clamp(16px, 3.6vh, 44px);
  --tile: clamp(40px, min(6vw, 7.4vh), 60px);
  --c: #e2401f;             /* the colour of the night in use (set by the script) */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
}

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

.stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 70%),
    var(--page);
}

/* a fine grain over everything */
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.48 0 0 0 0 0.44 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- the list */
.list {
  position: absolute;
  inset: 0;
  width: min(var(--col), 100% - 2 * var(--pad));
  margin: 0 auto;
  padding-top: var(--pad);
  display: flex;
  flex-direction: column;
  transform-origin: 50% 30%;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 640;
  font-variation-settings: 'wdth' 108;
  letter-spacing: -0.01em;
}

.brand__mark {
  width: 18px;
  height: 18px;
  fill: var(--ink);
}

.bar__season {
  color: var(--muted);
  font-weight: 480;
}

.list__head {
  margin: clamp(14px, 4.4vh, 46px) 0 clamp(8px, 2vh, 20px);
}

.list__title {
  margin: 0;
  font-size: clamp(22px, min(4.4vw, 5.6vh), 44px);
  line-height: 1;
  font-weight: 620;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -0.03em;
}

.list__count {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(12px, 1.8vh, 14px);
}

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.rows li {
  border-bottom: 1px solid var(--rule);
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: var(--tile) 1fr auto;
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
  width: 100%;
  padding: clamp(6px, 1.1vh, 11px) 6px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.row:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 14px;
}

/* the plate under the row on hover, a soft white card that lifts */
.row__plate {
  position: absolute;
  inset: 2px -6px;
  border-radius: 16px;
  background: var(--plate);
  box-shadow: 0 1px 0 rgba(22, 20, 15, 0.04), 0 10px 24px -14px rgba(22, 20, 15, 0.28);
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.28s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.row.is-over .row__plate {
  opacity: 1;
  transform: scale(1);
}

.row__tile {
  position: relative;
  width: var(--tile);
  height: var(--tile);
  border-radius: 12px;
  background:
    radial-gradient(130% 110% at 0% 0%, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.05) 55%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.16)),
    var(--rc);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 6px 14px -8px var(--rc);
  color: var(--on);
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1;
}

.row__day {
  display: block;
  font-size: calc(var(--tile) * 0.36);
  font-weight: 660;
  font-variation-settings: 'wdth' 90;
  letter-spacing: -0.02em;
}

.row__month {
  display: block;
  margin-top: 2px;
  font-size: calc(var(--tile) * 0.19);
  font-weight: 560;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.86;
}

.row__text {
  position: relative;
  min-width: 0;
}

.row__title {
  display: block;
  font-size: clamp(15px, min(2.2vw, 2.7vh), 21px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.015em;
  --w: 100;
  font-variation-settings: 'wdth' var(--w);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform-origin: 0 0;
}

.row__where {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: clamp(11px, 1.7vh, 13px);
  white-space: nowrap;
}

.row__go {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: color 0.25s ease, background-color 0.25s ease;
}

.row__go svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.row.is-over .row__go {
  color: var(--ink);
  background: rgba(22, 20, 15, 0.05);
}

.row.is-over .row__go svg {
  transform: translateX(2px);
}

.row.is-down .row__tile {
  transform: scale(0.96);
}

.row__tile {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------------------------------------------------------------- the shape */
.shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  visibility: hidden;
  overflow: visible;
}

.shape__fill {
  fill: var(--c);
}

.shape__light {
  mix-blend-mode: soft-light;
}

.shape__shadow {
  fill: rgba(22, 20, 15, 0.32);
  filter: url(#morbida);
  opacity: 0;
}

/* ---------------------------------------------------------------- the night's page */
.night {
  position: absolute;
  inset: 0;
  z-index: 3;
  visibility: hidden;
  pointer-events: none;
}

.night.is-open {
  pointer-events: auto;
}

.night__head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--head, 56%);
  padding: var(--pad) max(var(--pad), calc((100% - var(--col)) / 2)) clamp(14px, 3.4vh, 40px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--on);
}

.night__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 13px 0 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 6px 14px -10px rgba(0, 0, 0, 0.5);
  color: var(--on);
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color 0.25s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.back svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.back.is-over {
  background: rgba(255, 255, 255, 0.26);
}

.back.is-over svg {
  transform: translateX(-2px);
}

.back.is-down {
  transform: scale(0.95);
}

.night__brand {
  font-size: 13px;
  font-weight: 600;
  font-variation-settings: 'wdth' 108;
  opacity: 0.85;
}

.night__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 clamp(6px, 1.4vh, 14px);
  font-size: clamp(12px, 1.9vh, 15px);
  font-weight: 540;
  opacity: 0.92;
}

.night__sep {
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.night__title {
  margin: 0;
  width: max-content;
  font-size: 64px;
  line-height: 1.1;
  font-weight: 640;
  letter-spacing: -0.025em;
  --w: 125;
  font-variation-settings: 'wdth' var(--w);
  white-space: nowrap;
  transform-origin: 0 0;
}

.night__body {
  position: absolute;
  top: var(--head, 56%);
  left: 0;
  right: 0;
  bottom: 0;
  width: min(var(--col), 100% - 2 * var(--pad));
  margin: 0 auto;
  padding-top: clamp(12px, 3.2vh, 34px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vh, 18px);
}

.night__times {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(11px, 1.7vh, 13px);
  font-weight: 520;
}

.night__line {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(13px, 2.1vh, 17px);
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.night__people {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(11px, 1.7vh, 13px);
  color: var(--muted);
}

.faces {
  display: inline-flex;
}

.face {
  width: clamp(24px, 3.8vh, 32px);
  height: clamp(24px, 3.8vh, 32px);
  border-radius: 50%;
  margin-right: -7px;
  box-shadow: 0 0 0 2px var(--page), 0 4px 10px -6px rgba(22, 20, 15, 0.5);
  overflow: hidden;
  background: #e9e5dc;
}

.face svg {
  display: block;
  width: 100%;
  height: 100%;
}

.night__names {
  margin-left: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.night__seats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(11px, 1.7vh, 13px);
  color: var(--muted);
}

.seats__track {
  position: relative;
  width: min(180px, 40%);
  height: 3px;
  border-radius: 3px;
  background: rgba(22, 20, 15, 0.08);
  overflow: hidden;
}

.seats__fill {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: var(--c);
  transform-origin: 0 50%;
}

.night__actions {
  display: flex;
}

/* Get tickets: the elastic pill, the words widen on the wdth axis */
.ticket {
  position: relative;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ticket__face {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: clamp(38px, 6vh, 46px);
  padding: 0 16px 0 20px;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 12px 24px -14px rgba(22, 20, 15, 0.7);
}

.ticket__words {
  --w: 100;
  font-variation-settings: 'wdth' var(--w);
  font-size: clamp(13px, 2vh, 15px);
  font-weight: 600;
  white-space: nowrap;
}

.ticket__price {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(245, 243, 238, 0.12);
  font-size: 12px;
  font-weight: 560;
}

.ticket__icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.ticket__check {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

/* the drawn pointer of the autopilot */
.ghost {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 8;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  fill: #16140f;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.28));
}

@media (hover: hover) {
  .row:hover .row__go {
    color: var(--ink);
  }
}
