:root {
  --surface-primary: #0f1117;
  --surface-secondary: #171a22;
  --surface-elevated: #20242e;
  --surface-soft: #2b303c;
  --text-primary: #f8fafc;
  --text-secondary: #b9c0cf;
  --text-tertiary: #818a9d;
  --border-subtle: #2d3340;
  --accent-primary: #42d77d;
  --accent-hover: #6ee89e;
  --accent-warm: #f0b35a;
  --status-error: #ff7a8a;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-emphasis: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface-primary);
  color: var(--text-primary);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 6%, rgba(66, 215, 125, 0.16), transparent 34rem),
    radial-gradient(circle at 82% 12%, rgba(240, 179, 90, 0.12), transparent 30rem),
    linear-gradient(180deg, #10131b 0%, var(--surface-primary) 42%, #0b0d12 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black, transparent 78%);
}

a {
  color: inherit;
}

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

button,
input,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(66, 215, 125, 0.75);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 20;
  transform: translateY(-140%);
  border-radius: 999px;
  background: var(--accent-primary);
  color: #07110b;
  padding: var(--space-3) var(--space-4);
  font-weight: 800;
  transition: transform 180ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(4px);
  opacity: 0.6;
}

.ambient-one {
  width: 260px;
  height: 260px;
  left: -80px;
  top: 180px;
  background: rgba(66, 215, 125, 0.08);
}

.ambient-two {
  width: 340px;
  height: 340px;
  right: -120px;
  top: 40px;
  background: rgba(240, 179, 90, 0.08);
}

.site-header,
.content-shell,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  padding: var(--space-6) 0 var(--space-12);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 56px;
  padding: var(--space-2);
  border-radius: 999px;
  background: rgba(23, 26, 34, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 60px rgba(0, 0, 0, 0.24);
}

.brand,
.nav-meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.brand {
  min-height: 40px;
  padding: 0 var(--space-4);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, #ffffff 0 8%, transparent 9%),
    var(--accent-primary);
  box-shadow: 0 0 24px rgba(66, 215, 125, 0.42);
}

.nav-meta {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-right: var(--space-4);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: var(--space-8);
  align-items: end;
  padding: var(--space-16) 0 var(--space-8);
}

.eyebrow {
  margin: 0 0 var(--space-3);
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.35;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text-primary);
}

h1 {
  max-width: 850px;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero-description {
  max-width: 740px;
  margin: var(--space-6) 0 0;
  color: var(--text-secondary);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.75;
}

.hero-panel,
.filter-card,
.movie-card,
.notice {
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(32, 36, 46, 0.94), rgba(23, 26, 34, 0.94));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 60px rgba(0, 0, 0, 0.28);
}

.hero-panel {
  display: grid;
  gap: var(--space-2);
  min-height: 240px;
  padding: var(--space-8);
  align-content: end;
}

.hero-panel strong {
  display: block;
  font-size: clamp(46px, 7vw, 82px);
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.hero-panel span:last-child,
.panel-label {
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 750;
}

.content-shell {
  display: grid;
  gap: var(--space-10);
  padding-bottom: var(--space-16);
}

.filter-card {
  padding: var(--space-6);
}

.filter-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.filter-heading h2,
.result-heading h2,
.notice h2 {
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(140px, 180px) minmax(140px, 180px) minmax(140px, 180px) auto;
  gap: var(--space-3);
  align-items: end;
}

.field,
.mode-group {
  display: grid;
  gap: var(--space-2);
}

.field span,
.mode-group legend {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-group {
  grid-template-columns: repeat(3, max-content);
  border: 0;
  padding: 0;
  margin: 0;
}

.mode-group legend {
  grid-column: 1 / -1;
  margin-bottom: var(--space-2);
}

input[type="search"],
select {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-primary);
  padding: 0 var(--space-5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-tertiary) 50%), linear-gradient(135deg, var(--text-tertiary) 50%, transparent 50%);
  background-position: calc(100% - 18px) 22px, calc(100% - 12px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.mode-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-pill span,
.primary-button,
.pager {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 180ms var(--ease-out), background 180ms var(--ease-out), color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.mode-pill span {
  cursor: pointer;
  padding: 0 var(--space-5);
  background: var(--surface-soft);
  color: var(--text-secondary);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.mode-pill input:checked + span,
.mode-pill.is-active span {
  background: var(--accent-primary);
  color: #07110b;
  box-shadow: 0 0 40px rgba(66, 215, 125, 0.18);
}

.primary-button {
  gap: var(--space-3);
  border: 0;
  cursor: pointer;
  min-width: 164px;
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-5);
  background: var(--accent-primary);
  color: #07110b;
}

.button-orb {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(7, 17, 11, 0.1);
}

.button-orb svg {
  width: 20px;
  height: 20px;
}

.primary-button:hover,
.pager:hover,
.movie-card:hover {
  transform: translateY(-3px);
}

.primary-button:active,
.pager:active {
  transform: translateY(-1px) scale(0.98);
}

.result-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-6);
}

.result-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

.result-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 var(--space-4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--space-6);
}

.movie-card {
  overflow: hidden;
  transition: transform 240ms var(--ease-out), box-shadow 240ms var(--ease-out);
}

.movie-card:hover,
.movie-card:focus-within {
  box-shadow: inset 0 0 0 1px rgba(66, 215, 125, 0.26), 0 26px 80px rgba(0, 0, 0, 0.38);
}

.poster-shell {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface-soft), var(--surface-secondary));
}

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

.poster-shell::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(15, 17, 23, 0.82));
}

.poster-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--text-tertiary);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.release-pill {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-4);
  z-index: 1;
  border-radius: 999px;
  background: rgba(15, 17, 23, 0.82);
  color: var(--accent-warm);
  padding: var(--space-2) var(--space-3);
  font-size: 12px;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.movie-body {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
}

.movie-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.movie-body h3 {
  font-size: 19px;
  line-height: 1.32;
  letter-spacing: -0.02em;
}

.movie-body p,
.notice p,
.site-footer p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.68;
}

.movie-body p {
  display: -webkit-box;
  min-height: 5.05em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.text-link {
  width: fit-content;
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

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

.notice {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-8);
}

.notice-error {
  box-shadow: inset 0 0 0 1px rgba(255, 122, 138, 0.28), 0 20px 60px rgba(0, 0, 0, 0.28);
}

.notice-error .eyebrow {
  color: var(--status-error);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
}

.pager {
  padding: 0 var(--space-5);
  background: var(--surface-elevated);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.pager-primary {
  background: var(--accent-primary);
  color: #07110b;
}

.site-footer {
  padding: 0 0 var(--space-8);
  text-align: center;
}

.site-footer p {
  color: var(--text-tertiary);
  font-size: 13px;
}

.reveal,
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.motion-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 640ms var(--ease-emphasis), transform 640ms var(--ease-emphasis);
}

.motion-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero,
  .filter-form {
    grid-template-columns: 1fr;
  }

  .filter-heading,
  .result-heading {
    align-items: start;
    flex-direction: column;
  }

  .result-stats {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header,
  .content-shell,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .nav-shell {
    align-items: stretch;
    border-radius: 28px;
    flex-direction: column;
    padding: var(--space-3);
  }

  .nav-meta {
    justify-content: space-between;
    padding: 0 var(--space-3) var(--space-2);
  }

  .hero {
    padding-top: var(--space-12);
  }

  .filter-card,
  .notice {
    border-radius: 24px;
    padding: var(--space-5);
  }

  .mode-group {
    grid-template-columns: 1fr;
  }

  .mode-pill span,
  .primary-button {
    width: 100%;
  }

  .movie-grid {
    gap: var(--space-5);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
