/* Columns going opposite ways: a film club's programme. Three columns of posters; as the wall crosses the window
   the outer columns rise and the middle one sinks. Pointing at a poster pops a ticket with its time. */
:root {
  --night: #15131c;         /* the page */
  --cream: #f3ead8;         /* text */
  --muted: rgba(243, 234, 216, 0.6);
  --edge: clamp(18px, 3.2vw, 48px);
  --gap: clamp(12px, 1.8vw, 26px);
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--night);
  color: var(--cream);
  font-family: 'Outfit Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px var(--edge);
  font-size: 14px;
  background: linear-gradient(to bottom, rgba(21, 19, 28, 0.9), rgba(21, 19, 28, 0));
}

.brand {
  font-family: 'Gloock', Georgia, serif;
  font-size: 20px;
}

.bar__nav {
  display: flex;
  gap: clamp(16px, 2.4vw, 34px);
}

.bar__nav a {
  transition: opacity 0.2s;
}

@media (hover: hover) {
  .bar__nav a:hover {
    opacity: 0.55;
  }
}

.bar a:focus-visible,
.outro__link:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.intro,
.outro {
  min-height: 80svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 110px var(--edge);
  text-align: center;
}

.intro__kicker {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.intro__title,
.outro__title {
  max-width: 12em;
  margin: 0;
  font-family: 'Gloock', Georgia, serif;
  font-size: clamp(42px, 6.4vw, 100px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.intro__hint {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.outro {
  min-height: 70svh;
}

.outro__link {
  margin-top: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--night);
  font-size: 15px;
  font-weight: 600;
}

/* ---------------------------------------------------------------- the wall of posters */
.wall {
  position: relative;
  padding: 0 var(--edge);
  overflow: clip;
  /* the posters fade in and out at the top and the bottom of the wall instead of being cut */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 90px, #000 calc(100% - 90px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 90px, #000 calc(100% - 90px), transparent 100%);
}

.columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  max-width: 1180px;
  margin: 0 auto;
}

.column {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  will-change: transform;
}

/* the middle column starts higher, so while it sinks the wall stays full */
.column[data-column="down"] {
  margin-top: -600px;
}

.poster {
  position: relative;
  margin: 0;
}

.poster svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  overflow: hidden;
}

/* the ticket that pops out on a poster: the script makes it grow, tilt and settle */
.ticket {
  position: absolute;
  top: 12%;
  right: -6%;
  z-index: 2;
  padding: 10px 16px 10px 14px;
  border-radius: 8px;
  background: var(--cream);
  color: var(--night);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6);
  transform: scale(0);
  pointer-events: none;
}

.ticket small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}

@media (max-width: 760px) {
  .bar__nav {
    display: none;
  }

  .columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* on a narrow screen two columns: the third is not shown */
  .column:nth-child(3) {
    display: none;
  }

  .column[data-column="down"] {
    margin-top: -300px;
  }

  .ticket {
    right: 4%;
    font-size: 12px;
  }
}
