:root {
  --bg: #f6f8fb;
  --bg-accent: #eef2f7;
  --surface: #ffffff;
  --surface-muted: #f2f6fb;
  --border: #d7e0ea;
  --text: #0f172a;
  --text-muted: #556070;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --danger: #e11d48;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --code-bg: #0f172a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  line-height: 1.6;
  background: radial-gradient(circle at top, #ffffff 0%, #f8fafc 45%, #e2e8f0 100%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

/* Layout */

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, #fbbf24, #2563eb);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.logo-text {
  font-weight: 600;
  letter-spacing: 0.03em;
}

.nav {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav a:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

/* Hero */

.hero {
  padding: 4rem 0 3rem;
}

.hero-inner {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 4vw, 3.25rem);
  margin: 0 0 1rem;
}

.hero-text .accent {
  color: var(--accent);
}

.hero-subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  max-width: 40rem;
}

.hero-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.code-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.code-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  background: var(--surface-muted);
  border-radius: 0.7rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  line-height: 1.4;
  white-space: nowrap;
  gap: 0.35rem;
}

pre {
  margin: 0;
  background: var(--code-bg);
  color: #606975;
  border-radius: 18px;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(15, 23, 42, 0.35);
  box-shadow: var(--shadow-soft);
  overflow: auto;
}

pre code {
  display: block;
  background: transparent;
  border: none;
  padding: 0;
  white-space: pre;
  color: inherit;
  font-size: 0.85rem;
  line-height: 1.55;
  min-width: 100%;
}

.hero-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.65rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent-strong);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.btn.secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--accent-strong);
}

.btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero panel */

.hero-panel {
  background: var(--surface);
  border-radius: 22px;
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.hero-panel h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.hero-note {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Sections */

.section {
  padding: 3rem 0;
}

.section-alt {
  background: var(--bg-accent);
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.section h2 {
  margin-top: 0;
  font-size: 1.8rem;
}

.section-lead {
  margin: 0.4rem 0 1.6rem;
  color: var(--text-muted);
}

/* Cards */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.card h3 {
  margin: 0 0 0.75rem;
}

.card ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Usage */

.usage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.5rem;
}

.code-small pre {
  max-height: 260px;
}

/* Try it */

.try-form {
  margin-bottom: 1rem;
}

.try-form label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.try-input-row {
  display: flex;
  gap: 0.6rem;
}

.try-input-row input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.try-input-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.try-status {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

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

.try-results {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.try-results.is-empty .try-details,
.try-results.is-empty .try-grid {
  display: none;
}

.try-results:not(.is-empty) .empty-state {
  display: none;
}

.empty-state {
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.try-details {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.poster-shell {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  overflow: hidden;
  position: relative;
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.poster-placeholder {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0 1rem;
  text-align: center;
}

.details-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0;
}

.details-body h3 {
  margin: 0;
  font-size: 1.6rem;
}

.details-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meta-item {
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.genre-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.chip-muted {
  background: var(--surface-muted);
  color: var(--text-muted);
}

.details-overview {
  margin: 0;
  color: var(--text-muted);
}

.try-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.try-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.try-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}

.person-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--surface-muted);
}

.person-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 600;
}

.person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-name {
  margin: 0;
  font-weight: 600;
}

.person-role {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rec-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.rec-card {
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.rec-card:hover,
.rec-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.18);
  outline: none;
  transform: translateY(-2px);
}

.rec-card .person-photo {
  aspect-ratio: 2 / 3;
}

.rec-card .person-role {
  color: var(--accent-strong);
  font-weight: 500;
}

.cast-card[role="button"],
.rec-card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.cast-card[role="button"] {
  cursor: pointer;
}

.cast-card[role="button"]:hover,
.cast-card[role="button"]:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.12);
  outline: none;
  transform: translateY(-2px);
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.modal[aria-hidden="false"] {
  pointer-events: auto;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  background: var(--surface);
  border-radius: 28px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.25);
  padding: 2rem;
  width: min(680px, calc(100% - 2rem));
  max-height: min(90vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modal-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--accent-strong);
}

.modal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-avatar-fallback {
  font-size: 0.9rem;
}

.filmography-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.filmography-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.film-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0.75rem;
  background: var(--surface-muted);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.1s ease;
}

.film-card:focus-visible,
.film-card:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.18);
  outline: none;
  transform: translateY(-2px);
}

.film-card .film-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 600;
}

.film-logo {
  margin-top: 0.6rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
}

.film-logo img {
  max-width: 100%;
  max-height: 50px;
  object-fit: contain;
}
 
.film-card .film-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film-card h4 {
  margin: 0;
  font-size: 1rem;
}

.film-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.film-card[data-movie-id] {
  cursor: pointer;
}

 .empty-blurb {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.try-output {
  margin: 0;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

/* FAQ */

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.faq-item h3 {
  margin: 0 0 0.5rem;
}

.faq-item p {
  margin: 0;
  color: var(--text-muted);
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  padding: 1.25rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-meta {
  text-align: right;
}

/* Responsive */

@media (max-width: 900px) {
  .hero-inner,
  .usage-grid,
  .cards,
  .faq-grid,
  .try-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .try-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .poster-shell {
    max-width: 260px;
    margin: 0 auto;
  }

  .modal-panel {
    width: calc(100% - 1.5rem);
    padding: 1.5rem;
  }

  .filmography-grid {
    grid-template-columns: minmax(0, 1fr);
  }
 
   .hero {
    padding-top: 3rem;
  }

  .nav {
    display: none;
  }
}
