:root {
  --netflix-red: #e50914;
  --netflix-red-hover: #f40612;
  --bg-primary: #141414;
  --bg-secondary: #181818;
  --bg-card: #2f2f2f;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #808080;
  --gradient-bottom: linear-gradient(180deg, transparent 0%, var(--bg-primary) 100%);
  --gradient-hero: linear-gradient(
    77deg,
    rgba(20, 20, 20, 0.95) 25%,
    rgba(20, 20, 20, 0.6) 50%,
    transparent 100%
  );
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --nav-height: 68px;
  --transition-fast: 0.2s ease;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  max-width: 100%;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Splash */
.splash {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
}

.splash__logo {
  font-family: var(--font-display);
  font-size: clamp(4rem, 15vw, 8rem);
  color: var(--netflix-red);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.splash__tagline {
  position: absolute;
  bottom: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Route loader */
.route-loader {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}

.route-loader__n {
  width: 48px;
  height: 48px;
  background: var(--netflix-red);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: white;
}

/* Profiles */
.profiles {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-primary);
}

.profiles__title {
  font-size: clamp(1.75rem, 5vw, 3.5rem);
  font-weight: 400;
  margin-bottom: 3rem;
  text-align: center;
}

.profiles__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  max-width: 900px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.profile-card:hover .profile-card__avatar,
.profile-card:focus-visible .profile-card__avatar {
  border-color: var(--text-primary);
  transform: scale(1.08);
}

.profile-card__avatar {
  width: clamp(100px, 20vw, 140px);
  height: clamp(100px, 20vw, 140px);
  border-radius: 8px;
  border: 3px solid transparent;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  background: linear-gradient(135deg, #e50914 0%, #831010 50%, #141414 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card__initials {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: white;
}

.profile-card__label {
  color: var(--text-secondary);
  font-size: 1rem;
}

.profile-card:hover .profile-card__label {
  color: var(--text-primary);
}

.profiles__manage {
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4%;
  height: var(--nav-height);
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.9) 0%, transparent 100%);
  transition: background var(--transition-fast);
}

.navbar--scrolled {
  background: var(--bg-primary);
}

.navbar__left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar__logo {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--netflix-red);
  letter-spacing: 0.02em;
}

.navbar__links {
  display: none;
  gap: 1.25rem;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .navbar__links {
    display: flex;
  }
}

.navbar__links a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.navbar__links a:hover {
  color: var(--text-primary);
}

.navbar__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar__countdown {
  display: none;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--bg-card);
  border-radius: 4px;
}

@media (min-width: 900px) {
  .navbar__countdown {
    display: block;
  }
}

.navbar__profile {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: linear-gradient(135deg, #e50914, #831010);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Hero */
.hero {
  position: relative;
  height: 85vh;
  min-height: 500px;
  max-height: 900px;
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__video,
.hero__slideshow {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__slideshow {
  position: relative;
}

.hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
}

.hero__bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: var(--gradient-bottom);
}

.hero__content {
  position: absolute;
  bottom: 25%;
  left: 4%;
  max-width: 600px;
  z-index: 2;
}

.hero__match {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #46d369;
  margin-bottom: 0.5rem;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1;
  margin-bottom: 0.75rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.hero__meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.hero__desc {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn:hover {
  transform: scale(1.02);
}

.btn--primary {
  background: white;
  color: black;
}

.btn--primary:hover {
  background: rgba(255, 255, 255, 0.85);
}

.btn--secondary {
  background: rgba(109, 109, 110, 0.7);
  color: white;
}

.btn--secondary:hover {
  background: rgba(109, 109, 110, 0.5);
}

.btn--icon {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn--icon.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
}

/* Content rows */
.home-content {
  position: relative;
  margin-top: -8rem;
  z-index: 3;
  padding-bottom: 4rem;
}

.content-row {
  margin-bottom: 2.5rem;
  padding-left: 4%;
}

.content-row__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.content-row__scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.content-row__scroll::-webkit-scrollbar {
  display: none;
}

/* Memory card */
.memory-card {
  flex: 0 0 auto;
  width: clamp(140px, 22vw, 240px);
  scroll-snap-align: start;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s ease;
}

.memory-card:hover {
  transform: scale(1.08);
  z-index: 5;
}

.memory-card__thumb {
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
}

.memory-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, #2f2f2f, #1a1a1a);
}

.memory-card__rank {
  position: absolute;
  left: -0.15em;
  bottom: -0.2em;
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px #595959;
  z-index: 1;
  pointer-events: none;
}

.memory-card--ranked .memory-card__thumb {
  margin-left: 1.5rem;
}

.memory-card__episode {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.memory-card__title {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memory-card__mylist {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
  font-size: 0.85rem;
}

.memory-card:hover .memory-card__mylist {
  opacity: 1;
}

.memory-card__mylist.active {
  opacity: 1;
  background: white;
  color: black;
}

/* Search */
.search-wrapper {
  position: relative;
}

.search-toggle {
  color: white;
  padding: 0.5rem;
  font-size: 1.1rem;
}

.search-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  width: min(90vw, 400px);
  background: rgba(20, 20, 20, 0.98);
  border: 1px solid var(--bg-card);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.search-panel__input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--bg-card);
  color: white;
  font-size: 1rem;
  outline: none;
}

.search-panel__results {
  max-height: 300px;
  overflow-y: auto;
}

.search-panel__item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--transition-fast);
}

.search-panel__item:hover,
.search-panel__item:focus {
  background: var(--bg-card);
}

.search-panel__item-type {
  font-size: 0.7rem;
  color: var(--netflix-red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-panel__empty {
  padding: 1.5rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.9rem;
}

/* Music toggle */
.music-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  transition: background var(--transition-fast);
}

.music-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.music-toggle.playing {
  color: var(--netflix-red);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--bg-secondary);
  border-radius: 8px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.modal__image-wrap {
  position: relative;
  background: #000;
  min-height: 200px;
  max-height: min(65vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__media {
  width: 100%;
  height: 100%;
  min-height: 200px;
  max-height: min(65vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__image {
  max-width: 100%;
  max-height: min(65vh, 720px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.modal__placeholder {
  width: 100%;
  min-height: 200px;
  max-height: min(65vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2f2f2f, #141414);
  font-family: var(--font-display);
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.2);
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.modal__nav--prev {
  left: 1rem;
}

.modal__nav--next {
  right: 1rem;
}

.modal__body {
  padding: 1.5rem;
}

.modal__episode {
  color: var(--netflix-red);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.modal__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal__date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.modal__caption-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--netflix-red);
  margin-bottom: 0.35rem;
}

.modal__caption {
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  padding: 0.75rem 0 0.75rem 1rem;
  border-left: 3px solid var(--netflix-red);
}

.modal__rate {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background var(--transition-fast);
}

.modal__rate:hover {
  background: #404040;
}

.modal__rate.rated {
  background: #46d369;
  color: black;
}

.modal__match-badge {
  display: inline-block;
  margin-left: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: rgba(70, 211, 105, 0.2);
  color: #46d369;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 2px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: black;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  z-index: 300;
  box-shadow: var(--shadow-card);
}

/* Letter */
.letter-section {
  padding: 4rem 4%;
  background: linear-gradient(180deg, var(--bg-primary) 0%, #1a0a0c 50%, var(--bg-primary) 100%);
  border-top: 4px solid var(--netflix-red);
}

.letter-section__badge {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--netflix-red);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

.letter-section__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin-bottom: 2rem;
}

.letter-section__content {
  max-width: 680px;
  margin: 0 auto;
}

.letter-section__paragraph {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.letter-section__signature {
  margin-top: 2rem;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-primary);
}

.letter-section__date {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.letter-section__skip {
  display: block;
  margin: 2rem auto 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: underline;
}

.letter-section__skip:hover {
  color: var(--text-primary);
}

/* Countdown hero chip */
.hero__countdown {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.hero__countdown strong {
  color: #46d369;
}

/* Special feature row */
.special-row {
  padding: 2rem 4%;
  text-align: center;
}

.special-row__card {
  display: inline-block;
  padding: 2rem 3rem;
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.3), rgba(20, 20, 20, 0.9));
  border: 1px solid rgba(229, 9, 20, 0.5);
  border-radius: 8px;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.special-row__card:hover {
  transform: scale(1.02);
  box-shadow: 0 0 40px rgba(229, 9, 20, 0.3);
}

.special-row__label {
  font-size: 0.8rem;
  color: var(--netflix-red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.special-row__title {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-top: 0.5rem;
}

/* Utilities */
.hidden {
  display: none !important;
}

.splash__logo--animate {
  animation: splashZoom 1.2s cubic-bezier(0.43, 0.13, 0.23, 0.96) forwards;
}

@keyframes splashZoom {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.search-panel.hidden {
  display: none;
}

.modal-overlay.hidden {
  display: none;
}

.toast.hidden {
  display: none;
}

.hero__video.hidden,
.hero__slideshow.hidden {
  display: none;
}

/* Video cards */
.video-card {
  flex: 0 0 auto;
  width: clamp(200px, 28vw, 320px);
  scroll-snap-align: start;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s ease;
}

.video-card:hover {
  transform: scale(1.06);
  z-index: 5;
}

.video-card__thumb {
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
}

.video-card__thumb img,
.video-card__thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, #3a1010, #1a1a1a);
}

.video-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  font-size: 3rem;
  transition: background var(--transition-fast);
}

.video-card:hover .video-card__play {
  background: rgba(0, 0, 0, 0.15);
}

.video-card__sound-badge {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.75);
  padding: 0.2rem 0.45rem;
  border-radius: 2px;
  color: #46d369;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.video-card__episode {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.video-card__title {
  font-size: 0.875rem;
  font-weight: 500;
}

.content-row--videos .content-row__title::after {
  content: ' 🔊';
  font-size: 0.85em;
}

/* Video modal */
.modal--video {
  max-width: 960px;
}

.modal__video-wrap {
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: min(75vh, 900px);
}

.modal__video {
  display: block;
  background: #000;
  max-width: 100%;
  max-height: min(75vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.video-modal__hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
