:root {
  color-scheme: dark;
  --bg: #101113;
  --panel: #181a1f;
  --panel-2: #20242b;
  --line: #343944;
  --text: #f2f3f5;
  --muted: #a6adb8;
  --soft: #d6dae1;
  --accent: #e7c66a;
  --accent-2: #58c4a7;
  --danger: #f08274;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 84px;
  padding: 12px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 22, 26, 0.96);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 320px;
  flex: 0 0 auto;
}

.brand-logo {
  width: 312px;
  height: auto;
  display: block;
}

.brand strong,
.brand small {
  display: none;
}

.brand small,
.header-stat small,
.eyebrow,
.meta,
.result-subtitle,
.quote-time,
.fact-source,
.movie-kicker,
.detail-label {
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.site-nav a {
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--soft);
  white-space: nowrap;
}

.site-nav a.active,
.site-nav a:hover {
  background: var(--panel-2);
  color: var(--text);
}

.header-stat {
  padding-left: 20px;
  border-left: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.header-stat span {
  display: block;
  font-size: 22px;
  font-weight: 800;
}

.workspace {
  padding: 28px 32px 36px;
  flex: 1;
}

.view {
  max-width: 1320px;
  margin: 0 auto;
}

.hidden {
  display: none;
}

.search-panel {
  min-height: 330px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(16, 17, 19, 0.96), rgba(16, 17, 19, 0.56)),
    url("https://image.tmdb.org/t/p/original/8ZTVqvKDQ8emSGUEMjsS4yHAwrp.jpg") center / cover;
  display: grid;
  align-content: end;
  gap: 22px;
  padding: 34px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(42px, 6vw, 84px);
  line-height: 0.95;
  max-width: 800px;
}

.search-box {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  max-width: 980px;
  min-height: 68px;
  background: rgba(20, 22, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  overflow: hidden;
}

.search-icon {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 26px;
}

.search-box input {
  width: 100%;
  height: 68px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 22px;
  min-width: 0;
}

.search-box button,
.back-link,
.pill-button {
  border: 0;
  background: var(--accent);
  color: #15120b;
  font-weight: 800;
  cursor: pointer;
}

.search-box button {
  align-self: stretch;
  padding: 0 24px;
}

.quick-queries {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--soft);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 24px 0 18px;
}

.summary-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

select {
  min-height: 42px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.result-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
  min-height: 100%;
  display: grid;
  grid-template-rows: 170px auto;
}

.result-poster {
  background: #0a0b0d center / cover;
  position: relative;
}

.result-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.74), transparent 70%);
}

.score-badge {
  position: absolute;
  z-index: 1;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 9px;
  border-radius: 999px;
  font-weight: 800;
}

.result-body {
  padding: 16px;
}

.result-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.result-title h2 {
  font-size: 22px;
  margin-bottom: 4px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.matched-quote {
  margin: 14px 0;
  padding: 12px;
  background: #111317;
  border-left: 3px solid var(--accent-2);
  color: var(--soft);
}

.matched-quote mark {
  background: rgba(231, 198, 106, 0.25);
  color: var(--text);
  padding: 0 2px;
}

.cast-strip,
.tag-list,
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.cast-chip {
  border: 1px solid var(--line);
  color: var(--soft);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
}

.open-movie {
  display: inline-flex;
  margin-top: 14px;
  color: var(--accent);
  font-weight: 800;
}

.movie-hero {
  min-height: 480px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: end;
  padding: 34px;
  border-bottom: 1px solid var(--line);
  background-position: center;
  background-size: cover;
  position: relative;
  box-shadow: var(--shadow);
}

.entity-hero {
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: end;
  padding: 34px;
  border-bottom: 1px solid var(--line);
  background-position: center;
  background-size: cover;
  position: relative;
  box-shadow: var(--shadow);
}

.entity-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 17, 19, 0.96), rgba(16, 17, 19, 0.56)),
    linear-gradient(0deg, rgba(16, 17, 19, 0.9), transparent 54%);
}

.entity-hero > * {
  position: relative;
  z-index: 1;
}

.entity-hero h1 {
  margin: 8px 0 18px;
}

.entity-lead {
  max-width: 820px;
  color: var(--soft);
  font-size: 20px;
  line-height: 1.6;
}

.cred-panel {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(17, 19, 23, 0.82);
  backdrop-filter: blur(14px);
  border-radius: 8px;
  padding: 22px;
  display: grid;
  gap: 9px;
}

.cred-panel span {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
}

.cred-panel strong {
  font-size: 24px;
  line-height: 1.1;
}

.cred-panel small {
  color: var(--muted);
  line-height: 1.5;
}

.entity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 22px;
  margin-top: 24px;
}

.wide-section {
  grid-column: 1 / -1;
}

.large-copy {
  color: var(--soft);
  font-size: 18px;
  line-height: 1.7;
  max-width: 980px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.metric-grid div {
  background: #111317;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric-grid strong {
  display: block;
  font-size: 34px;
  color: var(--accent);
}

.metric-grid span {
  color: var(--muted);
  font-size: 13px;
}

.standard-list,
.process-lane,
.faq-list {
  display: grid;
  gap: 12px;
}

.standard-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.standard-item:last-child {
  border-bottom: 0;
}

.standard-item p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.process-step {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #111317;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.process-step span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(231, 198, 106, 0.16);
  color: var(--accent);
  font-weight: 900;
}

.faq-item {
  background: #111317;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 18px 20px;
  font-size: 18px;
  font-weight: 800;
}

.faq-item p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--muted);
  line-height: 1.7;
}

.contact-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.contact-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(231, 198, 106, 0.13), transparent 40%),
    var(--panel);
  border-radius: 8px;
  padding: 20px;
}

.contact-card:hover {
  border-color: rgba(231, 198, 106, 0.55);
  transform: translateY(-2px);
  transition: transform 160ms ease, border-color 160ms ease;
}

.contact-card span {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
}

.contact-card p {
  color: var(--soft);
  line-height: 1.55;
}

.contact-card strong {
  color: var(--text);
}

.movie-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 17, 19, 0.94), rgba(16, 17, 19, 0.52));
}

.movie-hero > * {
  position: relative;
  z-index: 1;
}

.back-link {
  display: inline-flex;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 26px;
}

.movie-kicker {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
}

.movie-hero h1 {
  margin: 8px 0 14px;
}

.movie-overview {
  max-width: 760px;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.6;
}

.poster-frame {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #0a0b0d center / cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  margin-top: 24px;
}

.section {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 20px;
}

.section h2 {
  margin-bottom: 14px;
  font-size: 20px;
}

.cast-table {
  display: grid;
  gap: 8px;
}

.cast-row,
.detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cast-row:last-child,
.detail-row:last-child {
  border-bottom: 0;
}

.quote-list {
  display: grid;
  gap: 10px;
}

.fact {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 12px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  color: var(--muted);
  border-radius: 8px;
}

@media (max-width: 920px) {
  .site-header {
    position: static;
    flex-wrap: wrap;
    gap: 12px 18px;
    padding: 12px 18px;
  }

  .brand {
    min-width: 0;
  }

  .brand-logo {
    width: min(312px, 72vw);
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }

  .header-stat {
    margin-left: auto;
    padding-left: 16px;
    border-left: 1px solid var(--line);
  }

  .movie-hero,
  .entity-hero,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .entity-layout,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .poster-frame {
    max-width: 260px;
  }

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

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

  .brand-logo {
    width: min(312px, 92vw);
  }

  .header-stat {
    display: none;
  }

  .workspace,
  .search-panel,
  .movie-hero,
  .entity-hero {
    padding: 18px;
  }

  .summary-row,
  .result-title {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .search-box button {
    grid-column: 1 / -1;
    min-height: 46px;
  }

  .cast-row,
  .detail-row {
    grid-template-columns: 1fr;
  }
}
