:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: rgba(16, 16, 16, 0.92);
  --panel-strong: rgba(26, 26, 26, 0.98);
  --surface: #171717;
  --surface-alt: #202020;
  --text: #f5f5f1;
  --muted: #a8a8a8;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #e50914;
  --accent-soft: rgba(229, 9, 20, 0.2);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(229, 9, 20, 0.28), transparent 24%),
    radial-gradient(circle at left center, rgba(255, 255, 255, 0.08), transparent 20%),
    linear-gradient(180deg, #080808 0%, #050505 48%, #090909 100%);
  color: var(--text);
  font-family: "Archivo", sans-serif;
}

body {
  min-height: 100vh;
}

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

button,
input,
textarea {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
}

.page-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.25rem 0 1.5rem;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, #ff2c37, var(--accent));
  color: white;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.06em;
}

.brand-word,
.eyebrow,
.section-label {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.12em;
}

.brand-word {
  font-size: 1.65rem;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(120deg, rgba(8, 8, 8, 0.96) 0%, rgba(8, 8, 8, 0.76) 45%, rgba(8, 8, 8, 0.55) 100%),
    url("https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?auto=format&fit=crop&w=1400&q=80")
      center/cover;
  box-shadow: var(--shadow);
}

.hero-backdrop {
  position: absolute;
  inset: auto -4rem -5rem auto;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 9, 20, 0.45), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 52rem;
}

.eyebrow,
.section-label {
  margin: 0 0 0.75rem;
  color: #ff6b72;
  font-size: 1rem;
}

.hero h1 {
  margin: 0;
  max-width: 9ch;
  font-size: clamp(3rem, 6vw, 5.7rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.hero-copy {
  margin: 1.25rem 0 0;
  max-width: 42rem;
  color: #d1d1d1;
  font-size: 1.05rem;
  line-height: 1.7;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(16px);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.field span {
  color: #bcbcbc;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 3.4rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition: border-color 140ms ease, background-color 140ms ease;
}

.field textarea {
  min-height: 7.2rem;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #797979;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(229, 9, 20, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

.action-stack {
  display: grid;
  align-content: end;
  gap: 0.8rem;
  min-width: 10rem;
}

.search-button,
.secondary-button {
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background-color 140ms ease;
}

.search-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.search-button {
  min-height: 3.4rem;
  padding: 0 1.35rem;
  background: linear-gradient(180deg, #ff2c37, var(--accent));
  color: white;
  font-weight: 700;
}

.search-button:disabled,
.secondary-button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.secondary-button {
  min-height: 3rem;
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  font-weight: 600;
}

.voice-button {
  background: rgba(255, 255, 255, 0.12);
}

.stop-button {
  background: rgba(229, 9, 20, 0.16);
  color: #ffd8da;
}

.conversation-clear {
  padding-inline: 1.1rem;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

#status-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.status-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: 0 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #d7d7d7;
  font-size: 0.92rem;
  white-space: nowrap;
}

.status-chip[data-tone="live"] {
  border-color: rgba(229, 9, 20, 0.28);
  background: rgba(229, 9, 20, 0.18);
  color: #ffe0e2;
}

.status-chip[data-tone="ready"] {
  border-color: rgba(255, 255, 255, 0.15);
  color: #f3f3f3;
}

.status-chip[data-tone="error"] {
  border-color: rgba(255, 107, 114, 0.35);
  background: rgba(255, 107, 114, 0.14);
  color: #ffd9dc;
}

.results-section {
  margin-top: 2rem;
}

.conversation-card,
.movie-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.92), rgba(14, 14, 14, 0.96));
  box-shadow: var(--shadow);
}

.conversation-card {
  margin-bottom: 1.5rem;
  padding: 1.2rem;
}

.conversation-header,
.results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.conversation-header h2,
.results-header h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.results-header {
  margin-bottom: 1.25rem;
}

.results-summary {
  max-width: 44rem;
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.results-count {
  margin: 0;
  color: var(--muted);
}

.transcript {
  display: grid;
  gap: 0.9rem;
  max-height: 28rem;
  margin-top: 1rem;
  overflow: auto;
}

.transcript .empty-state {
  min-height: 13rem;
}

.message {
  display: grid;
  gap: 0.5rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.message[data-role="assistant"] {
  border-color: rgba(229, 9, 20, 0.16);
  background: rgba(229, 9, 20, 0.07);
}

.message.is-live {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 114, 0.25);
}

.message-role {
  color: #ff6b72;
  font-family: "Bebas Neue", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.message-text {
  margin: 0;
  color: #ececec;
  line-height: 1.7;
  white-space: pre-wrap;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.movie-card,
.empty-state {
  min-height: 100%;
}

.movie-card {
  overflow: hidden;
}

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  background:
    linear-gradient(180deg, rgba(229, 9, 20, 0.12), transparent),
    linear-gradient(135deg, #2a2a2a, #121212);
}

.movie-poster {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #0c0c0c;
}

.rating-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.movie-content {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.15rem 1.15rem 1.35rem;
}

.movie-heading {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.movie-title {
  margin: 0;
  font-size: 1.2rem;
}

.movie-meta,
.movie-match,
.movie-plot {
  margin: 0;
}

.movie-meta {
  color: #c2c2c2;
  font-size: 0.92rem;
}

.movie-match {
  color: #ffd0d3;
  font-size: 0.92rem;
  line-height: 1.5;
}

.movie-plot {
  color: var(--muted);
  line-height: 1.6;
}

.empty-state {
  display: grid;
  place-items: center;
  padding: 2.5rem;
  text-align: center;
}

.empty-state h3 {
  margin: 0.2rem 0 0.75rem;
  font-size: 1.7rem;
}

.empty-state p {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.empty-kicker {
  color: #ff6b72;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.is-hidden {
  display: none;
}

@media (max-width: 920px) {
  .hero {
    padding: 3rem 1.4rem 1.5rem;
    background-position: center;
  }

  .control-panel {
    grid-template-columns: 1fr;
  }

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

  .hero-meta,
  .conversation-header,
  .results-header {
    flex-direction: column;
    align-items: stretch;
  }

  .status-chips {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--max-width));
    padding-top: 0.75rem;
  }

  .topbar {
    padding-bottom: 1rem;
  }

  .brand-word {
    font-size: 1.45rem;
  }

  .hero h1 {
    max-width: none;
  }

  .hero-copy {
    font-size: 0.98rem;
  }

  .action-stack {
    grid-template-columns: 1fr;
  }

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