/* MovieClub Club: a night at the pictures. Auditorium blue, ticket stock, red ink. */

:root {
  --auditorium: #1d2742;
  --auditorium-low: #141b30;
  --film: #29231d;
  --screen-light: #ece6d6;
  --muted: #a9b1c6;
  --ticket: #efd99a;
  --ticket-stub: #e5cb84;
  --ink: #8c1c24;
  --ink-dark: #6a131a;
  --ink-brown: #5a4320;
  --bulb: #f5b942;

  --display: "Limelight", Georgia, serif;
  --text: "Archivo", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--auditorium); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--auditorium);
  color: var(--screen-light);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.5;
}

a { color: var(--bulb); }

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

/* --- Header: a strip of film, sprocket holes punched along both edges -------------
   Text sits in dark, unexposed frames; the frames between hold film stills. */

body { display: flex; flex-direction: column; }
main { flex: 1; }

.filmstrip {
  --frame-h: 5.5rem;
  --frame-w: 8.75rem;
  --frame-gap: 6px;
  position: relative;
  display: flex;
  gap: var(--frame-gap);
  padding: 23px var(--frame-gap);
  background: var(--film);
}

.filmstrip::before,
.filmstrip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='9'%3E%3Crect x='6' width='10' height='9' rx='2' fill='%231d2742'/%3E%3C/svg%3E") repeat-x;
}

.filmstrip::before { top: 7px; }
.filmstrip::after { bottom: 7px; }

.frame {
  flex: none;
  width: var(--frame-w);
  height: var(--frame-h);
  overflow: hidden;
  border-radius: 4px;
  background: #15110d;
}

/* As many whole frames as fit; the extras wrap onto rows that are clipped away. */
.frame-stills {
  flex: 1;
  min-width: 0;
  height: var(--frame-h);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--frame-w), 1fr));
  grid-auto-rows: var(--frame-h);
  gap: var(--frame-gap);
  overflow: hidden;
}

.frame-still { width: auto; background: linear-gradient(140deg, #3b3128, #1c1814); }

.frame-still img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.8) brightness(.85);
}

.frame-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .3rem;
  padding: 0 .75rem;
  color: var(--ticket);
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.02;
  text-decoration: none;
}

.frame-brand .camera { width: 1.75rem; }

.frame-account {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  color: var(--muted);
  font-size: .9rem;
}

.frame-account button {
  font: inherit;
  color: var(--screen-light);
  background: none;
  border: 1px solid #615749;
  border-radius: 999px;
  padding: .15rem .8rem;
  white-space: nowrap;
  cursor: pointer;
}

.frame-account button:hover { color: var(--ticket); border-color: var(--ticket); }

@media (max-width: 30rem) {
  .filmstrip { --frame-h: 4.75rem; --frame-w: 7rem; }
  .frame-brand { font-size: 1.02rem; padding: 0 .55rem; }
  .frame-brand .camera { width: 1.4rem; }
  .frame-account { width: 5.5rem; }
  .account-name { display: none; }
}

/* --- Site navigation, under the film strip --------------------------------------- */

.site-nav { border-bottom: 1px solid rgb(255 255 255 / .1); }

.site-nav-links {
  display: flex;
  gap: 1.75rem;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-nav a {
  margin-bottom: -1px;
  padding: .75rem 0 .65rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: var(--screen-light); }
.site-nav a[aria-current] { color: var(--ticket); border-bottom-color: var(--ticket); }

/* --- Ordinary pages ------------------------------------------------------------- */

.page {
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
}

.page h1 {
  margin: 0 0 .75rem;
  color: var(--ticket);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 3.25rem);
  line-height: 1.1;
}

.page p { max-width: 36rem; margin: 0 0 1rem; }
.page .lede { color: var(--muted); font-size: 1.15rem; }

.site-footer {
  padding: 1rem 1.25rem;
  font-size: .9rem;
  text-align: right;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ticket); }

.film-list {
  columns: 2 14rem;
  column-gap: 2rem;
  max-width: 36rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.film-list li { break-inside: avoid; }

.page h2 {
  margin: 2.25rem 0 .5rem;
  color: var(--ticket);
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
}

.fine-print { color: var(--muted); font-size: .9rem; }

/* --- Avatars: uploaded photo, or a coloured monogram ------------------------------- */

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  color: var(--ticket);
  font-family: var(--display);
  line-height: 1;
}

.avatar-sm { width: 1.6rem; height: 1.6rem; font-size: .85rem; }
.avatar-md { width: 2.25rem; height: 2.25rem; font-size: 1.1rem; }
.avatar-lg { width: 3.5rem; height: 3.5rem; font-size: 1.6rem; }

/* --- Schedule (home) ------------------------------------------------------------- */

.schedule {
  max-width: 36rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.night { padding: .9rem 0; border-top: 1px solid rgb(255 255 255 / .1); }

.schedule .night-date { margin: 0; color: var(--ticket); font-weight: 650; }
.schedule .night-movies { margin: .15rem 0 0; font-size: 1.2rem; }

.schedule .night-picker {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .4rem 0 0;
  color: var(--muted);
}

/* --- Ranked lists: movies and members -------------------------------------------- */

.ranked {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.ranked > li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  padding: .9rem 0;
  border-top: 1px solid rgb(255 255 255 / .1);
}

.movie-still {
  width: 8.75rem;
  aspect-ratio: 140 / 88;
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(140deg, #3b3128, #1c1814);
}

.movie-still img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ranked .movie-title,
.ranked .member-name {
  margin: 0;
  color: var(--screen-light);
  line-height: 1.25;
}

.ranked .movie-title {
  font-family: var(--text);
  font-weight: 650;
  font-size: 1.2rem;
}

.movie-year { color: var(--muted); font-weight: 400; }

.ranked .member-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
}

.ranked .movie-meta,
.ranked .member-picks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem 1rem;
  margin: .3rem 0 0;
  color: var(--muted);
  font-size: .95rem;
}

.picker {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--screen-light);
  text-decoration: none;
}

.picker:hover { color: var(--ticket); }

.rating { min-width: 4.5rem; text-align: right; }

.score {
  display: block;
  color: var(--ticket);
  font-family: var(--display);
  font-size: 2.1rem;
  line-height: 1;
}

.score-none { color: #59627d; }

.rating-note {
  display: block;
  margin-top: .25rem;
  color: var(--muted);
  font-size: .8rem;
}

@media (max-width: 30rem) {
  .ranked > li { gap: .85rem; }
  .movie-still { width: 5.5rem; }
  .ranked .movie-title { font-size: 1.05rem; }
  .score { font-size: 1.65rem; }
  .rating { min-width: 3.25rem; }
}

/* --- Login: an admit-one ticket under the projector beam ------------------------- */

.lobby {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 30rem);
  place-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse 120% 60% at 50% 105%, var(--auditorium-low), transparent 70%);
  overflow: hidden;
}

/* The projector beam, blurred so it reads as light rather than a shape. */
.lobby::before {
  content: "";
  position: absolute;
  inset: -10% 0 0;
  z-index: -1;
  background: conic-gradient(from 160deg at 50% 0, rgb(255 236 190 / .09) 0deg 40deg, transparent 40deg);
  filter: blur(28px);
}

.ticket-shadow { filter: drop-shadow(0 22px 34px rgb(0 0 0 / .4)); }

.ticket {
  --stub: 4.25rem;
  --notch: .8rem;
  display: grid;
  grid-template-columns: var(--stub) 1fr;
  background: var(--ticket);
  color: var(--ink);
  border-radius: 6px;
  /* Half-moon bites out of the top and bottom edges where the stub tears off. */
  --bite-top: radial-gradient(circle at var(--stub) 0, transparent var(--notch), #000 calc(var(--notch) + .5px)) top / 100% 51% no-repeat;
  --bite-bottom: radial-gradient(circle at var(--stub) 100%, transparent var(--notch), #000 calc(var(--notch) + .5px)) bottom / 100% 51% no-repeat;
  -webkit-mask: var(--bite-top), var(--bite-bottom);
  mask: var(--bite-top), var(--bite-bottom);
}

.ticket-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 0;
  background: var(--ticket-stub);
  border-right: 2px dashed rgb(140 28 36 / .45);
}

.ticket-stub span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.admit {
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: .06em;
}

.serial {
  font-stretch: 75%;
  font-size: .8rem;
  letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
}

.ticket-body { padding: 1.9rem 1.75rem 1.5rem; }

.ticket-body .camera { width: 3.1rem; display: block; }

.ticket-body h1 {
  margin: .6rem 0 .15rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  line-height: 1.05;
}

.ticket-note {
  margin: 0 0 1.5rem;
  color: var(--ink-brown);
}

.field { margin-bottom: 1.15rem; }

.field label {
  display: block;
  color: var(--ink);
  font-weight: 650;
  font-stretch: 80%;
  font-size: .9rem;
  letter-spacing: .03em;
}

/* Inputs are the write-in lines on the ticket. */
.field input {
  width: 100%;
  padding: .35rem .15rem;
  font: inherit;
  font-size: 1.1rem;
  color: #2b1b10;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
}

.field input:focus-visible {
  outline: none;
  background: rgb(255 255 255 / .4);
  box-shadow: 0 2px 0 var(--ink-dark);
}

.ticket-body button {
  width: 100%;
  margin-top: .4rem;
  padding: .75rem 1rem;
  font: inherit;
  font-weight: 700;
  font-stretch: 90%;
  font-size: 1.05rem;
  color: var(--ticket);
  background: var(--ink);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.ticket-body button:hover { background: var(--ink-dark); }
.ticket-body button:focus-visible { outline: 3px solid var(--ink-dark); outline-offset: 3px; }

.ticket-help {
  margin: 1rem 0 0;
  color: var(--ink-brown);
  font-size: .9rem;
}

.errorlist {
  list-style: none;
  margin: 0 0 1rem;
  padding: .55rem .75rem;
  color: var(--ink-dark);
  background: rgb(140 28 36 / .1);
  border-left: 3px solid var(--ink);
  font-size: .95rem;
}

.field .errorlist { margin: .4rem 0 0; }

@media (max-width: 22rem) {
  .ticket { --stub: 3.25rem; }
  .ticket-body { padding-inline: 1.25rem; }
}
