:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-soft: #111820;
  --surface: #172029;
  --surface-2: #202b35;
  --surface-3: #2a3641;
  --line: rgba(229, 238, 241, 0.16);
  --line-strong: rgba(229, 238, 241, 0.28);
  --text: #f5efe4;
  --text-cool: #e9f4f2;
  --muted: #a8b4b8;
  --green: #00d66f;
  --orange: #ff8a2a;
  --blue: #48b8ff;
  --rose: #ff6f7d;
  --gold: #ffd166;
  --danger: #ff7d7d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(140deg, rgba(255, 138, 42, 0.12) 0%, rgba(255, 138, 42, 0) 34%),
    linear-gradient(228deg, rgba(72, 184, 255, 0.1) 0%, rgba(72, 184, 255, 0) 42%),
    linear-gradient(180deg, #0f151c 0%, #0b0f14 55%, #0f1419 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 92px);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.08));
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button {
  white-space: nowrap;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 0 34px;
  background: rgba(11, 15, 20, 0.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  min-height: 44px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, var(--green) 0 32%, var(--orange) 32% 66%, var(--blue) 66% 100%);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.layout {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0 86px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(370px, 520px);
  gap: clamp(36px, 6vw, 78px);
  align-content: center;
  align-items: center;
  min-height: calc(100vh - 166px);
}

.intro-copy {
  grid-column: 1;
  min-width: 0;
}

.intake-panel {
  grid-column: 2;
}

.intro-copy h1,
.results-header h1 {
  margin: 0;
  max-width: 760px;
  color: var(--text);
  font-size: clamp(46px, 7vw, 86px);
  line-height: 0.98;
  letter-spacing: 0;
}

.lede,
.result-note {
  max-width: 660px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.58;
}

.lede {
  margin: 22px 0 0;
}

.result-note {
  margin: 16px 0 0;
}

.persona-callout {
  display: grid;
  gap: 6px;
  max-width: 680px;
  margin-top: 18px;
  padding: 16px;
  background: rgba(255, 209, 102, 0.1);
  border: 1px solid rgba(255, 209, 102, 0.34);
  border-radius: 8px;
}

.persona-callout span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.persona-callout strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
}

.persona-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 18px;
  padding: 0 10px;
  color: #08120d;
  background: var(--green);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.poster-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(84px, 1fr));
  gap: 14px;
  width: min(640px, 100%);
  margin-top: 34px;
  padding-right: 8px;
}

.poster-rail figure {
  position: relative;
  min-width: 0;
  margin: 0;
  transform: rotate(var(--tilt));
}

.poster-rail img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.poster-rail figcaption {
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intake-panel,
.insight-panel,
.metric,
.movie-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 32, 41, 0.9);
  box-shadow: var(--shadow);
}

.intake-panel {
  display: grid;
  gap: 12px;
  padding: 26px;
}

.intake-heading {
  display: grid;
  gap: 6px;
  padding: 0 2px 8px;
}

.intake-heading span,
.option-kicker,
.intake-section > label,
.metric span,
.card-topline,
.section-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.intake-heading strong {
  color: var(--text);
  font-size: 25px;
  line-height: 1.15;
}

.intake-section {
  min-width: 0;
}

.intake-section > label {
  display: block;
  margin: 14px 0 8px;
}

.option-card {
  display: grid;
  min-width: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.option-copy {
  display: grid;
  gap: 5px;
}

.option-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  line-height: 1.2;
}

.option-copy p {
  max-width: 42rem;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.option-kicker {
  color: var(--gold);
}

.sample-option {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.input-row,
.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.input-row button,
.upload-row button {
  min-height: 50px;
}

input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  color: var(--text-cool);
  background: rgba(5, 9, 13, 0.7);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(72, 184, 255, 0.18);
}

.file-picker {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(5, 9, 13, 0.7);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.file-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 11px;
  color: #130d05;
  background: var(--gold);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 950;
}

.file-picker b {
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.profile-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.primary-button {
  color: #08120d;
  background: var(--green);
  border: 1px solid var(--green);
}

.secondary-button,
.ghost-button,
.profile-link {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.compact {
  min-height: 40px;
  padding: 0 15px;
  font-size: 14px;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.profile-link:hover {
  transform: translateY(-1px);
}

.secondary-button:hover,
.ghost-button:hover,
.profile-link:hover {
  border-color: var(--blue);
  background: rgba(72, 184, 255, 0.1);
}

.panel-note,
.message,
.year {
  color: var(--muted);
}

.panel-note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.source-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.source-divider::before,
.source-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.intake-actions {
  display: flex;
  justify-content: flex-start;
}

.sample-option .intake-actions {
  justify-content: flex-end;
}

.message {
  min-height: 24px;
  font-size: 14px;
  line-height: 1.4;
}

.message.error {
  color: var(--danger);
}

.message.warning {
  margin: 0 0 22px;
  padding: 13px 15px;
  color: #ffe0b7;
  background: rgba(255, 138, 42, 0.12);
  border: 1px solid rgba(255, 138, 42, 0.38);
  border-radius: 8px;
}

.results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.results-header h1 {
  max-width: 820px;
  font-size: clamp(34px, 5vw, 60px);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.metric {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    rgba(23, 32, 41, 0.9);
  box-shadow: none;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 17px;
}

.section-heading h2,
.insight-panel h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.15;
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.movie-card {
  overflow: hidden;
  min-height: 238px;
  background: rgba(23, 32, 41, 0.94);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.movie-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.38);
}

.movie-card.wildcard {
  border-color: rgba(255, 138, 42, 0.78);
}

.movie-card-body {
  padding: 17px;
}

.movie-card h3 {
  margin: 16px 0 5px;
  color: var(--text);
  font-size: 21px;
  line-height: 1.12;
}

.movie-card p {
  line-height: 1.5;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--blue);
}

.card-topline span:last-child {
  color: var(--gold);
  text-align: right;
}

.movie-poster {
  display: grid;
  place-items: center;
  aspect-ratio: 2 / 3;
  width: 100%;
  min-height: 220px;
  color: var(--muted);
  background:
    linear-gradient(145deg, rgba(0, 214, 111, 0.14), rgba(72, 184, 255, 0.12) 48%, rgba(255, 138, 42, 0.14)),
    #0d1318;
}

.movie-poster img,
.recent-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-poster span {
  font-size: 42px;
  font-weight: 950;
}

.movie-card.skeleton {
  padding: 18px;
}

.skeleton div {
  height: 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: var(--surface-3);
  animation: pulse 1.1s infinite ease-in-out;
}

.skeleton div:nth-child(1) {
  width: 45%;
}

.skeleton div:nth-child(2) {
  width: 80%;
  height: 28px;
}

.skeleton div:nth-child(3) {
  width: 100%;
  height: 80px;
}

.insights {
  margin-top: 30px;
}

.insight-panel {
  padding: 22px;
  box-shadow: none;
}

.recent-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.recent-list li {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  min-width: 0;
}

.recent-list span {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
}

.recent-list b {
  color: var(--green);
  font-size: 12px;
  white-space: nowrap;
}

.recent-poster {
  display: grid;
  place-items: center;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  color: var(--muted);
  background: #0d1318;
  border: 1px solid var(--line);
  border-radius: 8px;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .topbar {
    padding: 0 18px;
  }

  .layout {
    width: min(100% - 28px, 760px);
    padding-top: 34px;
  }

  .intro,
  .results-header {
    display: block;
  }

  .intro {
    min-height: auto;
  }

  .intro-copy {
    max-width: 700px;
    margin: 0 auto;
  }

  .intake-panel {
    max-width: 540px;
    margin: 30px auto 0;
  }

  .poster-rail {
    width: min(580px, 100%);
  }

  .message {
    margin-top: 8px;
  }

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

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

  .profile-link {
    margin-top: 20px;
  }
}

@media (max-width: 600px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions button {
    flex: 1;
  }

  .intro-copy h1,
  .results-header h1 {
    font-size: 40px;
  }

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

  .poster-rail figure:nth-child(n + 3) {
    display: none;
  }

  .input-row,
  .upload-row,
  .metrics,
  .recommendation-grid {
    grid-template-columns: 1fr;
  }

  .intake-panel {
    padding: 20px;
  }

  .option-card,
  .sample-option {
    grid-template-columns: 1fr;
  }

  .sample-option .intake-actions {
    justify-content: stretch;
  }

  .sample-option .intake-actions button {
    width: 100%;
  }

  .section-heading {
    display: block;
  }

  .section-heading span {
    display: block;
    margin-top: 7px;
  }

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