:root {
  --bg: #14181c;
  --surface: #1c2228;
  --panel: #2c3440;
  --line: #456;
  --text: #9ab;
  --bright: #d8e0e8;
  --muted: #678;
  --green: #00e054;
  --action: #00ac1c;
  --blue: #40bcf4;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --hand: "Caveat", "Bradley Hand", cursive;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* Subset of Caveat (SIL Open Font License, see assets/fonts/OFL.txt) for the hero stamp. */
@font-face {
  font-family: "Caveat";
  src: url("assets/fonts/caveat.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font: 15px/1.6 var(--sans);
}

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

a:hover {
  color: var(--blue);
}

h1, h2, h3, h4, p, ul, ol {
  margin: 0;
}

.wrap {
  width: min(960px, 100% - 40px);
  margin-inline: auto;
}

.prose {
  font-family: var(--serif);
}

/* Navigation */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(20 24 28 / 92%);
  backdrop-filter: blur(8px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}

/* Logo loop: the dots pulse in turn, then the slash cuts through and retracts. */
.logo {
  width: 26px;
  height: 26px;
}

.logo .dots {
  isolation: isolate;
}

.logo circle {
  mix-blend-mode: screen;
  transform-box: fill-box;
  transform-origin: center;
  animation: logo-dot 4s ease-in-out infinite;
}

.logo circle:nth-of-type(2) {
  animation-delay: 0.12s;
}

.logo circle:nth-of-type(3) {
  animation-delay: 0.24s;
}

/* The gap is longer than the path, and offsets go past its ends, so no round cap lingers. */
.logo .slash {
  stroke-dasharray: 100 120;
  animation: logo-slash 4s ease-in-out infinite;
}

@keyframes logo-dot {
  0%, 16%, 100% { transform: scale(1); }
  8% { transform: scale(1.14); }
}

@keyframes logo-slash {
  0%, 18% { stroke-dashoffset: 110; }
  40%, 82% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -110; }
}

@media (prefers-reduced-motion: reduce) {
  .logo circle,
  .logo .slash {
    animation: none;
    stroke-dashoffset: 0;
  }
}

.nav-links {
  display: flex;
  gap: 22px;
}

.nav-links a {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-links a:hover {
  color: #fff;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 96px 0 72px;
}

/* Handwritten circular link to the author's Letterboxd profile. */
.stamp {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin-right: 24px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.stamp:hover,
.stamp:focus-visible {
  color: var(--green);
}

.stamp svg:first-child {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: stamp-spin 24s linear infinite;
}

.stamp:hover svg:first-child {
  animation-play-state: paused;
}

.stamp text {
  fill: currentColor;
  font: 500 20px var(--hand);
}

.stamp-arrow {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes stamp-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .stamp svg:first-child {
    animation: none;
  }
}

.hero h1 {
  color: #fff;
  font: 700 clamp(40px, 7vw, 64px)/1.05 var(--serif);
  letter-spacing: -0.01em;
}

.hero p {
  max-width: 520px;
  margin-top: 20px;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 32px;
}

.button {
  padding: 9px 16px;
  border-radius: 3px;
  background: var(--line);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-decoration: none;
  text-transform: uppercase;
}

.button:hover {
  color: #fff;
  background: #567;
}

.button.-action {
  background: var(--action);
}

.button.-action:hover {
  background: #009d1a;
}

.button.-coffee {
  background: #ff8000;
}

.button.-coffee:hover {
  background: #e67300;
}

/* Sections */

.section {
  padding-bottom: 72px;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 16px;
  margin-bottom: 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.section-heading span {
  color: var(--muted);
  letter-spacing: normal;
  text-transform: none;
}

/* Demo: fictional film page */

.demo {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  align-items: start;
}

.film {
  overflow: hidden;
  border: 1px solid #0b0d10;
  border-radius: 6px;
  background: var(--bg);
}

.backdrop {
  height: 160px;
  background: var(--bg);
}

.backdrop-art {
  height: 100%;
  background:
    radial-gradient(circle at 70% 40%, rgb(255 190 110 / 55%), transparent 30%),
    radial-gradient(circle at 25% 70%, rgb(64 188 244 / 35%), transparent 40%),
    linear-gradient(160deg, #3a2a4a, #1b2a3a 60%, var(--bg));
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.film-body {
  display: grid;
  grid-template-columns: 96px 1fr 180px;
  gap: 20px;
  margin-top: -48px;
  padding: 0 20px 24px;
}

.poster {
  display: grid;
  place-items: end start;
  aspect-ratio: 2 / 3;
  padding: 8px;
  border-radius: 4px;
  background: linear-gradient(170deg, #ffbe6e, #8a3a5a 55%, #1b2a3a);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 15%);
  color: #fff;
  font: 700 12px/1.1 var(--serif);
}

.film-main {
  min-width: 0;
  padding-top: 56px;
}

.film-title {
  color: #fff;
  font: 700 24px/1.2 var(--serif);
}

.film-title a {
  margin-left: 4px;
  font: 400 15px var(--sans);
}

.film-credits {
  margin-top: 2px;
  font-size: 13px;
}

.synopsis {
  margin-top: 16px;
}

.tagline {
  font-size: 11px;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.synopsis .prose {
  margin-top: 6px;
  font-size: 14px;
}

.cast {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 16px 0 24px;
  padding: 0;
  list-style: none;
}

.cast li {
  padding: 1px 6px;
  border-radius: 3px;
  background: #283038;
  font-size: 12px;
}

.film h4.section-heading {
  font-size: 11px;
}

.friends {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  padding: 0;
  list-style: none;
}

.friends li {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: hsl(var(--hue) 35% 38%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.stars {
  color: var(--green);
  font-size: 11px;
  letter-spacing: -0.05em;
}

.review {
  display: flex;
  gap: 12px;
  padding: 12px 0;
}

.review + .review {
  border-top: 1px solid var(--panel);
}

.review-by {
  font-size: 12px;
}

.review-by strong {
  color: var(--bright);
}

.review-text {
  margin-top: 4px;
  color: var(--bright);
  font-size: 14px;
  transition: filter 0.2s;
}

.film-sidebar {
  padding-top: 56px;
}

.actions-panel {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  padding: 10px 4px;
  border-radius: 4px;
  background: var(--line);
}

.action {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bright);
  font: 11px var(--sans);
}

.action svg {
  width: 22px;
  height: 22px;
  fill: #8899aa;
}

button.action {
  cursor: pointer;
}

button.action:hover svg,
.action.-on svg {
  fill: var(--green);
}

.histogram {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  flex: 1;
  height: 44px;
}

.bars i {
  flex: 1;
  height: calc(var(--h) * 1%);
  border-radius: 1px 1px 0 0;
  background: var(--line);
}

.average {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

/* Demo: hidden states, mirroring the extension. */

.synopsis::after,
.histogram::after {
  color: var(--muted);
  font-size: 12px;
}

.demo[data-hidden~="backdrop"] .backdrop-art {
  visibility: hidden;
}

.demo[data-hidden~="synopsis"] .synopsis > * {
  display: none;
}

.demo[data-hidden~="synopsis"] .synopsis::after {
  content: "Synopsis hidden until watched";
}

.demo[data-hidden~="ratings"] .histogram > * {
  display: none;
}

.demo[data-hidden~="ratings"] .histogram::after {
  content: "Ratings hidden until watched";
}

.demo[data-hidden~="friendRatings"] .friends .stars,
.demo[data-hidden~="reviewRatings"] .review .stars {
  visibility: hidden;
}

.demo[data-hidden~="reviews"] .review-text:not(.is-revealed) {
  filter: blur(5px);
  user-select: none;
}

.demo[data-hidden~="reviews"][data-reveal] .review-text:not(.is-revealed) {
  cursor: pointer;
}

/* Demo: popup replica */

.popup {
  position: sticky;
  top: 72px;
  overflow: hidden;
  border: 1px solid #0b0d10;
  border-radius: 6px;
  background: var(--grain), var(--bg);
  color: var(--bright);
  font-size: 13px;
  line-height: 1.4;
}

.popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgb(255 255 255 / 3%);
  color: #fff;
  font-weight: 700;
}

.popup-header span {
  flex: 1;
}

.popup-section {
  padding: 14px 16px 2px;
}

.popup-heading {
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.popup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  cursor: pointer;
}

.popup-row + .popup-row {
  border-top: 1px solid var(--surface);
}

.popup fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  transition: opacity 0.15s;
}

.popup fieldset:disabled {
  opacity: 0.35;
}

.popup fieldset:disabled .popup-row {
  cursor: default;
}

/* Switch: a transparent checkbox over a drawn track, as in the extension. */
.popup .switch {
  position: relative;
  flex: none;
  width: 26px;
  height: 14px;
}

.popup .switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.popup fieldset:disabled .switch input {
  cursor: default;
}

.popup .track {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background: var(--panel);
  transition: background 0.15s;
}

.popup .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bright);
  transition: transform 0.15s;
}

.popup input:checked + .track {
  background: #00c030;
}

.popup input:checked + .track::after {
  transform: translateX(12px);
  background: #fff;
}

.popup input:focus-visible + .track {
  outline: 1px solid var(--muted);
  outline-offset: 2px;
}

.popup-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding: 9px 16px;
  background: rgb(255 255 255 / 3%);
}

.popup-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 11px var(--sans);
  cursor: pointer;
}

.popup-link:hover {
  color: #fff;
}

/* Features, steps, install */

.features,
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 32px;
  padding: 0;
  list-style: none;
}

.features h3,
.steps h3,
.install h3 {
  margin-bottom: 4px;
  color: #fff;
  font-size: 15px;
}

.features em {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
}

.features p,
.steps p {
  font-size: 14px;
}

.note {
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
}

.steps {
  counter-reset: step;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font: 700 28px/1 var(--serif);
}

.install {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px;
}

.install ol {
  padding-left: 18px;
}

.install-next {
  margin-top: 20px;
}

.install li + li {
  margin-top: 4px;
}

code {
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--panel);
  color: var(--bright);
  font-size: 13px;
}

.privacy {
  max-width: 640px;
}

.privacy p + p {
  margin-top: 12px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--panel);
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  color: var(--text);
}

/* Small screens */

@media (max-width: 760px) {
  .nav-links a:not(.js-repo) {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 56px 0 48px;
  }

  .stamp {
    justify-self: end;
    width: 104px;
    height: 104px;
    margin-right: 0;
  }

  .demo {
    grid-template-columns: 1fr;
  }

  .popup {
    position: static;
    order: -1;
  }

  .film-body {
    grid-template-columns: 72px 1fr;
  }

  .poster {
    padding: 6px;
    font-size: 10px;
  }

  .film-sidebar {
    grid-column: 1 / -1;
    padding-top: 0;
  }

  .features,
  .steps,
  .install {
    grid-template-columns: 1fr;
  }
}
