:root {
  --bg: #08080b;
  --surface: #15151c;
  --surface-strong: #181824;
  --text: #f4f1ea;
  --muted: #a7a3a0;
  --accent: #d6a85a;
  --violet: #7c3aed;
  --line: rgba(244, 241, 234, 0.14);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(124, 58, 237, 0.16), transparent 34%),
    radial-gradient(circle at 72% 8%, rgba(214, 168, 90, 0.18), transparent 28%),
    var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 3px;
  z-index: 5;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(from 45deg, var(--accent), var(--violet), var(--accent));
  box-shadow: 0 0 28px rgba(214, 168, 90, 0.38);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 46px;
}

.hero {
  min-height: min(72vh, 680px);
  display: flex;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background:
    linear-gradient(90deg, rgba(8, 8, 11, 0.92) 0%, rgba(8, 8, 11, 0.74) 42%, rgba(8, 8, 11, 0.22) 100%),
    var(--hero-poster) right center / min(46vw, 480px) auto no-repeat,
    linear-gradient(135deg, #15151c, #08080b);
}

.hero-content {
  max-width: 680px;
  padding: clamp(28px, 7vw, 72px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1,
h2 {
  font-family: "Playfair Display", Georgia, serif;
}

.hero h1,
.pending-hero h1,
.selected-state h1 {
  max-width: 760px;
  font-size: clamp(3.2rem, 10vw, 7.6rem);
  line-height: 0.88;
}

.hero-summary,
.pending-copy > p,
.selected-state p {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions,
.card-actions,
.stars-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-button,
.ghost-button,
.primary-link,
.star-button,
.icon-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 16px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-button,
.primary-link,
.star-button {
  color: #111;
  background: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
}

.ghost-button,
.icon-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.small {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.primary-button:hover,
.ghost-button:hover,
.primary-link:hover,
.star-button:hover,
.icon-button:hover {
  transform: translateY(-2px);
  border-color: rgba(244, 241, 234, 0.32);
}

.star-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.ghost-button:disabled,
.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.saving-note,
.loading-note {
  margin-top: 16px;
  color: var(--accent);
  font-weight: 700;
}

.refresh-form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.refresh-form .loading-note {
  max-width: 220px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  text-align: right;
}

.moods {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 22px 0 12px;
}

.moods span {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.section-heading {
  padding: 32px 0 18px;
}

.section-heading h2,
.rate-modal h2 {
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.95;
}

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

.movie-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  transition: transform 180ms ease, border-color 180ms ease;
}

.movie-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(214, 168, 90, 0.42);
}

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  background: #101015;
}

.poster-wrap img,
.pending-poster,
.selected-state img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.language-pill {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(8, 8, 11, 0.72);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 800;
}

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

.movie-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
}

.movie-card h3 {
  margin-top: 9px;
  font-size: 1.08rem;
  line-height: 1.15;
}

.movie-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.movie-card .reason {
  color: var(--text);
}

.pending-hero,
.selected-state {
  display: grid;
  grid-template-columns: 1.1fr minmax(220px, 340px);
  gap: clamp(22px, 6vw, 64px);
  align-items: center;
  min-height: 76vh;
  padding: clamp(24px, 6vw, 68px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(24, 24, 36, 0.96), rgba(8, 8, 11, 0.98));
  box-shadow: var(--shadow);
}

.pending-hero h1 span {
  color: var(--accent);
}

.pending-poster,
.selected-state img {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
  z-index: 10;
}

.rate-modal {
  position: relative;
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.close-button {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.4rem;
}

@media (max-width: 1040px) {
  .movie-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .hero {
    min-height: 620px;
    background:
      linear-gradient(180deg, rgba(8, 8, 11, 0.3), rgba(8, 8, 11, 0.96) 58%),
      var(--hero-poster) center top / 100% auto no-repeat,
      linear-gradient(135deg, #15151c, #08080b);
  }

  .hero-content {
    padding: 26px;
  }

  .movie-grid,
  .pending-hero,
  .selected-state {
    grid-template-columns: 1fr;
  }

  .pending-poster,
  .selected-state img {
    max-width: 260px;
    justify-self: center;
  }
}
