:root {
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 8% -10%, rgba(224, 163, 106, 0.16), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(70, 92, 160, 0.2), transparent 46%),
    #09090b;
  color: #f3efe6;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0.09;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>");
}

::selection {
  background: #e0a36a;
  color: #1a120c;
}

:focus-visible {
  outline: 2px solid #e0a36a;
  outline-offset: 3px;
}

.poster-art {
  background:
    radial-gradient(85% 58% at 18% 12%, hsl(var(--h), 78%, 62%), transparent 58%),
    radial-gradient(70% 48% at 100% 0%, hsl(calc(var(--h) + 32), 68%, 46%), transparent 52%),
    radial-gradient(90% 70% at 70% 115%, hsl(calc(var(--h) - 8), 48%, 24%), transparent 55%),
    linear-gradient(165deg, #1c1a16, #0c0c0f 72%);
  transition: transform 0.45s ease, box-shadow 0.45s ease;
}

.poster h3 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.poster-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.28) 42%, rgba(0, 0, 0, 0.08) 100%);
}

.poster-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.16) 48%, transparent 62%);
  mix-blend-mode: screen;
  opacity: 0.35;
  pointer-events: none;
}

.poster:hover .poster-art {
  transform: translateY(-6px);
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.45);
}

.rail-wrap {
  position: relative;
}

.rail {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0.85rem 0.15rem 1.1rem;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
}

.rail-btn {
  position: absolute;
  top: 38%;
  z-index: 2;
  display: grid;
  height: 2.4rem;
  width: 2.4rem;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(243, 239, 230, 0.18);
  background: rgba(9, 9, 11, 0.78);
  color: #f3efe6;
  backdrop-filter: blur(10px);
}

.rail-btn.prev { left: -0.4rem; }
.rail-btn.next { right: -0.4rem; }

.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.field {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid rgba(243, 239, 230, 0.14);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 0.9rem;
  color: #f3efe6;
}

.field:focus {
  border-color: rgba(224, 163, 106, 0.8);
  outline: none;
}

@media (max-width: 767px) {
  .rail-btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .poster-art { transition: none; }
  .poster:hover .poster-art { transform: none; }
}
