:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #657084;
  --line: #d8dee9;
  --brand: #e11d48;
  --brand-dark: #be123c;
  --accent: #2563eb;
  --shadow: 0 18px 50px rgba(20, 31, 51, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(216, 222, 233, 0.85);
  backdrop-filter: blur(18px);
}

.brand {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 2vw, 20px);
  min-width: 0;
}

.header-actions a {
  color: #334155;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.header-actions a:hover,
.header-actions a:focus-visible {
  color: var(--brand);
}

.header-actions select {
  width: 96px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
}

.hero {
  position: relative;
  display: grid;
  min-height: clamp(520px, 72vh, 720px);
  place-items: center;
  overflow: hidden;
  padding: 88px 18px 72px;
  background-image: url("https://assets.nflxext.com/ffe/siteui/vlv3/04ef06cc-5f81-4a8e-8db0-6430ba4af286/web/US-en-20250224-TRIFECTA-perspective_ebbccc78-aa40-42c9-bcf2-986dc9885540_large.jpg");
  background-position: center;
  background-size: cover;
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 36%;
  content: "";
  background: linear-gradient(180deg, rgba(248, 250, 252, 0), var(--bg));
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.76);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.45rem, 7vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 650px;
  margin: 22px auto 0;
  color: #3b4658;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 680px;
  margin: 32px auto 0;
  padding: 8px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(216, 222, 233, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  outline: 0;
  padding: 0 16px;
}

.search-form input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.search-form button {
  min-width: 128px;
  min-height: 52px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 850;
  transition: background 160ms ease, transform 160ms ease;
}

.search-form button:hover,
.search-form button:focus-visible {
  background: var(--brand-dark);
}

.search-form button:active {
  transform: translateY(1px);
}

.search-status {
  min-height: 24px;
  margin: 16px 0 0;
  color: #334155;
  font-weight: 700;
}

.movie-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 18px 0 54px;
}

.movie-row {
  margin-top: 34px;
}

.row-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(18px, 4vw, 56px);
}

.row-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.15;
}

.row-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
}

.movie-track {
  display: grid;
  grid-auto-columns: clamp(148px, 18vw, 210px);
  grid-auto-flow: column;
  gap: 16px;
  margin-top: 18px;
  overflow-x: auto;
  padding: 8px clamp(18px, 4vw, 56px) 22px;
  scrollbar-color: #a9b3c3 transparent;
  scrollbar-width: thin;
}

.movie-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  aspect-ratio: 2 / 3;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(216, 222, 233, 0.72);
  border-radius: 8px;
  background: #e6ebf3;
  box-shadow: 0 12px 32px rgba(20, 31, 51, 0.12);
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.movie-card:hover,
.movie-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(20, 31, 51, 0.2);
}

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

.movie-card.is-coming img {
  filter: grayscale(0.95) blur(3px) brightness(0.78);
  transform: scale(1.02);
}

.poster-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #e6ebf3, #cbd5e1);
  color: #475569;
  font-weight: 850;
  text-align: center;
}

.card-label {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  min-height: 54px;
  display: flex;
  align-items: end;
  padding: 28px 12px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.94) 46%);
}

.card-label h3 {
  display: -webkit-box;
  width: 100%;
  margin: 0;
  overflow: hidden;
  color: #111827;
  font-size: 0.93rem;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.availability {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.7);
  color: #111827;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 850;
  text-align: center;
}

.skeleton {
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: linear-gradient(90deg, #e2e8f0, #f8fafc, #e2e8f0);
  background-size: 260% 100%;
  animation: shimmer 1.4s infinite linear;
}

.empty-row {
  margin: 16px clamp(18px, 4vw, 56px) 0;
  color: var(--muted);
  font-weight: 700;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 4vw, 56px);
  background: #e8edf5;
  border-top: 1px solid var(--line);
  color: #526071;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.54);
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  position: relative;
  width: min(860px, 100%);
  max-height: min(760px, 88vh);
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.38);
}

.modal-panel h2 {
  margin: 0;
  padding: 22px 58px 18px 24px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 1rem;
  font-weight: 900;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: #dbe3ee;
}

.results-list {
  max-height: min(642px, calc(88vh - 82px));
  overflow-y: auto;
  padding: 16px;
}

.result-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 108px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.result-item:hover,
.result-item:focus-visible {
  border-color: rgba(37, 99, 235, 0.28);
  background: #f1f5fb;
}

.result-item img {
  width: 78px;
  height: 96px;
  border-radius: 6px;
  object-fit: cover;
}

.result-title {
  margin: 0;
  color: #111827;
  font-weight: 850;
  line-height: 1.3;
}

.result-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.notice {
  margin: 0;
  padding: 22px;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

@keyframes shimmer {
  to {
    background-position: -260% 0;
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: 620px;
    padding-top: 64px;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .search-form button {
    width: 100%;
  }

  .row-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .movie-track {
    grid-auto-columns: minmax(142px, 42vw);
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .header-actions {
    flex-wrap: wrap;
  }

  .header-actions select {
    width: 100%;
  }

  .modal {
    padding: 12px;
  }

  .result-item {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .result-item img {
    width: 68px;
    height: 86px;
  }
}
