:root {
  --bg: #141414;
  --surface: #1d1d1d;
  --text: #f5f5f5;
  --muted: #b3b3b3;
  --accent: #e50914;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

html {
  scroll-behavior: smooth;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 17.9rem;
  padding: 1rem 3rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
  transition: background-color 0.28s ease, backdrop-filter 0.28s ease;
}

.topbar.scrolled {
  background: rgba(15, 15, 15, 0.94);
  backdrop-filter: blur(4px);
}

.brand {
  color: var(--accent);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.menu {
  display: flex;
  gap: 1.6rem;
}

.menu a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.9;
  padding: 0.2rem 0;
}

.menu a:hover {
  opacity: 1;
}

.profile-btn {
  margin-left: auto;
  border: none;
  border-radius: 4px;
  background: #333;
  color: var(--text);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}

.hero {
  position: relative;
  min-height: 80vh;
  padding: 7.5rem 3rem 2rem;
  background-image: url("./imatges/background.png");
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(20, 20, 20, 1) 0%,
    rgba(20, 20, 20, 0.5) 45%,
    rgba(20, 20, 20, 0.25) 100%
  );
}

.hero-content {
  position: relative;
  max-width: 650px;
}

.hero-tag {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin: 0 0 1rem;
}

.hero p {
  line-height: 1.5;
  color: #e3e3e3;
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.8rem;
}

.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 4px;
  padding: 0.7rem 1.3rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-primary {
  background: var(--text);
  color: #000;
}

.btn-secondary {
  background: rgba(109, 109, 110, 0.7);
  color: var(--text);
}

.info-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
  z-index: 999;
}

.info-modal.is-open {
  display: flex;
}

.info-modal-content {
  position: relative;
  max-width: 760px;
  width: 100%;
  background: #1b1b1b;
  border: 1px solid #343434;
  border-radius: 10px;
  padding: 1.2rem 1.1rem 1rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
}

.info-modal-content h3 {
  margin: 0 1.8rem 0.7rem 0;
}

.info-modal-content p {
  margin: 0;
  color: #d9d9d9;
  line-height: 1.55;
}

.info-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  border: none;
  background: transparent;
  color: #d9d9d9;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.profile-modal-content {
  max-width: 520px;
}

.profile-dl {
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.profile-dl > div {
  display: grid;
  gap: 0.2rem;
}

.profile-dl dt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a9a9a;
}

.profile-dl dd {
  margin: 0;
  color: #e8e8e8;
  line-height: 1.45;
}

/* Visor d’imatges (Name.com, Azure, galeria Airtable) — per sobre de les files del carrusel */
.image-view-modal {
  z-index: 1000;
}

.image-view-modal .image-view-modal-inner {
  position: relative;
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.image-view-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  max-width: 100%;
}

.image-view-layout:not(.is-gallery) .image-gallery-btn,
.image-view-layout:not(.is-gallery) .image-gallery-counter {
  display: none;
}

.image-view-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.image-view-modal-inner img {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
}

.image-gallery-btn {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.85rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.image-gallery-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.image-gallery-counter {
  font-size: 0.875rem;
  font-weight: 500;
  color: #d0d0d0;
  letter-spacing: 0.02em;
}

.image-view-modal-inner .info-modal-close {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9));
}

@media (max-width: 520px) {
  .image-gallery-btn {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.5rem;
  }
}

main {
  padding-bottom: 2rem;
}

.row-section {
  position: relative;
  z-index: 1;
  overflow: visible;
  padding: 0 3rem;
  margin-top: 1.8rem;
  scroll-margin-top: 88px;
}

.row-section:hover {
  z-index: 80;
}

.row-section h2 {
  position: relative;
  z-index: 5;
  margin: 0 0 0.45rem;
  font-size: 1.4rem;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.carousel {
  position: relative;
  z-index: 1;
  overflow: visible;
}

.carousel:hover {
  z-index: 90;
}

.card-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  overflow-x: auto;
  overflow: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  padding: 0.35rem 0 2.2rem;
}

.card-row::-webkit-scrollbar {
  display: none;
}

.carousel-btn {
  position: absolute;
  top: 0.75rem;
  bottom: 2.4rem;
  width: 42px;
  border: none;
  cursor: pointer;
  z-index: 30;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  background: rgba(20, 20, 20, 0.62);
  transition: background 0.2s ease, opacity 0.2s ease;
}

.carousel-btn:hover {
  background: rgba(20, 20, 20, 0.86);
}

.carousel-btn-left {
  left: 0;
  border-radius: 0 6px 6px 0;
}

.carousel-btn-right {
  right: 0;
  border-radius: 6px 0 0 6px;
}

.carousel-btn.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.movie-card {
  position: relative;
  flex: 0 0 235px;
  min-height: 132px;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: none;
  transform-origin: top center;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  z-index: 1;
}

.movie-card:hover {
  transform: scale(1.28);
  box-shadow: 0 24px 45px rgba(0, 0, 0, 0.75);
  border-color: #4a4a4a;
  z-index: 20;
}

.movie-card.edge-left {
  transform-origin: top left;
}

.movie-card.edge-right {
  transform-origin: top right;
}

.movie-media {
  height: 132px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #2a2a2a;
  background: var(--surface);
}

.movie-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-card.fit-contain .movie-media {
  background: #ffffff;
}

.movie-card.fit-contain img {
  object-fit: contain;
  padding: 4px 8px;
}

.movie-details {
  position: relative;
  background: #181818;
  border-radius: 0 0 8px 8px;

  padding: 0.9rem 0.9rem 0.8rem;   

  height: 120px;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;    

  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;

  overflow: hidden;
  pointer-events: none;
}

.card-actions {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.movie-card:hover .movie-details {
  max-height: 160px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.movie-card:hover .movie-media {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.movie-card .label {
  position: static;
}

.card-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(20, 20, 20, 0.78);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.card-action-btn.play {
  background: var(--text);
  color: #111;
  border-color: var(--text);
}

.movie-card h3 {
  margin: 0;
  font-size: 1rem;
}

.movie-card p {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: #d0d0d0;
}

@media (max-width: 850px) {
  .topbar {
    padding: 0.9rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }

  .menu {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .hero,
  .row-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .movie-card {
    flex-basis: 190px;
    height: 108px;
  }

  .movie-media {
    height: 108px;
  }

  .carousel-btn {
    width: 34px;
    font-size: 2rem;
  }
}