/* =========================================================
   Motaz & Walaa — Netflix-style wedding invitation
   Shared design system for every page
   ========================================================= */

:root {
  --nf-red: #e50914;
  --nf-red-dark: #b20710;
  --nf-bg: #141414;
  --nf-black: #000;
  --nf-white: #fff;
  --nf-gray: #b3b3b3;
  --nf-gray-dim: #808080;
  --nf-green: #46d369;
  --nf-card: #181818;
  --nf-font-ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --nf-font-display: "Anton", "Arial Narrow", sans-serif;
  --nf-font-number: "Bebas Neue", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--nf-bg);
  color: var(--nf-white);
  font-family: var(--nf-font-ui);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Top navigation ---------- */

.nf-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  height: 68px;
  padding: 0 4%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  transition: background-color 0.35s ease;
}

.nf-nav.scrolled { background: #141414; }

.nf-logo { display: block; line-height: 0; }
.nf-logo svg { height: 26px; width: auto; }

.nf-links {
  display: flex;
  gap: 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nf-links a {
  color: #e5e5e5;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nf-links a:hover,
.nf-links a.active { color: var(--nf-white); font-weight: 500; }

.nf-nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.nf-bell { font-size: 1.1rem; opacity: 0.9; }
.nf-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--nf-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* ---------- Billboard (hero) ---------- */

.billboard {
  position: relative;
  height: 56.25vw;
  min-height: 540px;
  max-height: 95vh;
}

.billboard { overflow: hidden; }

.billboard-slides { position: absolute; inset: 0; }

/* Each slide: a blurred, darkened copy fills the frame; the sharp portrait
   sits on the right with feathered edges, so tall phone photos never crop badly */
.bb-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s ease;
}

.bb-slide.active { opacity: 1; }

.bb-backdrop {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  filter: blur(38px) brightness(0.45) saturate(1.3);
}

.bb-poster {
  position: absolute;
  top: 0;
  right: 6%;
  height: 100%;
  width: 46%;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 80%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 80%, transparent 100%);
  transform: scale(1.04);
}

.bb-slide.active .bb-poster { animation: kenBurns 8s ease-out forwards; }
.billboard.paused .bb-slide.active .bb-poster { animation-play-state: paused; }

@keyframes kenBurns {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.14) translate3d(-1.5%, -1%, 0); }
}

.billboard-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 50%, rgba(0, 0, 0, 0) 78%),
    linear-gradient(to top, var(--nf-bg) 0%, rgba(20, 20, 20, 0) 55%);
}

.billboard-ribbon {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.9rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.top10-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 30px;
  background: var(--nf-red);
  border-radius: 2px;
  font-family: var(--nf-font-number);
  font-size: 0.62rem;
  line-height: 0.95;
  text-align: center;
  letter-spacing: 0.04em;
}

/* Compact "premieres in" countdown inside the billboard */
.bb-countdown {
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 1.4rem;
  padding: 0.7rem 1.1rem 0.6rem;
  border-left: 3px solid var(--nf-red);
  background: linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.15));
  border-radius: 0 6px 6px 0;
  color: var(--nf-white);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.bb-countdown:hover { color: var(--nf-white); background-color: rgba(229, 9, 20, 0.15); }

.bb-cd-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--nf-red);
}

.bb-cd-units { display: flex; align-items: flex-start; gap: 0.55rem; }

.bb-cd-unit { display: flex; flex-direction: column; align-items: center; min-width: 2.6rem; }

.bb-cd-unit strong {
  font-family: var(--nf-font-number);
  font-size: 2.3rem;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.bb-cd-unit em {
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--nf-gray);
}

.bb-cd-sep { font-family: var(--nf-font-number); font-size: 1.9rem; line-height: 1.1; color: rgba(255, 255, 255, 0.4); }

.billboard-controls {
  position: absolute;
  right: 0;
  bottom: 30%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.billboard-ticks { display: flex; gap: 0.35rem; }

.bb-tick {
  width: 26px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.bb-tick span {
  display: block;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.bb-tick.active span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--nf-white);
  transform-origin: left;
  animation: tickFill 6.5s linear forwards;
}

.billboard.paused .bb-tick.active span::after { animation: none; transform: none; }

@keyframes tickFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.billboard-pause {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.2);
  color: var(--nf-white);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.billboard-pause:hover { background: rgba(255, 255, 255, 0.15); }

.billboard-age {
  display: inline-block;
  background: rgba(51, 51, 51, 0.6);
  border-left: 3px solid #dcdcdc;
  padding: 0.45rem 2.6rem 0.45rem 0.8rem;
  font-size: 1rem;
}

.billboard-content {
  position: absolute;
  left: 4%;
  bottom: 26%;
  max-width: 580px;
  z-index: 2;
}

.series-tag {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: #d9d9d9;
  margin-bottom: 0.9rem;
}

.n-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--nf-red);
  font-family: var(--nf-font-display);
  font-size: 1.5rem;
  letter-spacing: 0;
  line-height: 1;
}

.show-title {
  font-family: var(--nf-font-display);
  font-size: clamp(2.9rem, 6.6vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: 0.02em;
  margin: 0 0 0.7rem;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.55);
}

.amp { color: var(--nf-red); }

.billboard-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: #d2d2d2;
  margin-bottom: 1rem;
}

.match { color: var(--nf-green); font-weight: 700; }

.rating-badge {
  border: 1px solid rgba(255, 255, 255, 0.55);
  padding: 0 0.42em;
  font-size: 0.78rem;
  line-height: 1.5;
}

.hd { border: 1px solid rgba(255, 255, 255, 0.45); padding: 0 0.35em; font-size: 0.72rem; }

.billboard-desc {
  font-size: 1.06rem;
  line-height: 1.6;
  color: #e8e8e8;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  max-width: 33rem;
  margin-bottom: 1.4rem;
}

.billboard-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ---------- Buttons ---------- */

.btn-nf {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 0;
  border-radius: 4px;
  padding: 0.68rem 1.7rem;
  font-size: 1.08rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-nf.play { background: var(--nf-white); color: #000; }
.btn-nf.play:hover { background: rgba(255, 255, 255, 0.78); }

.btn-nf.info { background: rgba(109, 109, 110, 0.7); color: var(--nf-white); }
.btn-nf.info:hover { background: rgba(109, 109, 110, 0.42); }

/* ---------- Content rows ---------- */

.nf-rows {
  position: relative;
  z-index: 3;
  padding: 0 4%;
  margin-top: -7vw;
}

.row-block { margin-bottom: 3.2rem; }

.row-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
}

.row-slider { position: relative; }

.row-track {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 2.6rem 0 2.2rem;
  scrollbar-width: none;
}

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

.slider-arrow {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 6;
  width: 3.2%;
  min-width: 42px;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: var(--nf-white);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.slider-arrow.left { left: 0; }
.slider-arrow.right { right: 0; }

.row-slider:hover .slider-arrow { display: block; }
.slider-arrow:hover { background: rgba(0, 0, 0, 0.75); }

.ep-card { flex: 0 0 258px; }

.ep-card a { display: block; text-decoration: none; color: inherit; }

.ep-card {
  transition: transform 0.3s ease;
  transform-origin: center;
}

.ep-card:hover { transform: scale(1.12); z-index: 5; position: relative; }

.ep-thumb { position: relative; border-radius: 4px; overflow: hidden; }
.ep-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.ep-dur {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.75);
  font-size: 0.7rem;
  padding: 0.15em 0.5em;
  border-radius: 2px;
}

.ep-info { padding: 0.55rem 0.15rem 0; }
.ep-code { font-size: 0.72rem; color: var(--nf-gray-dim); letter-spacing: 0.08em; }
.ep-info h3 { font-size: 0.98rem; font-weight: 700; margin: 0.15rem 0 0.2rem; }
.ep-info p { font-size: 0.8rem; color: var(--nf-gray); margin: 0; }

/* Top 10 row */

.top10-item {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  transition: transform 0.3s ease;
}

.top10-item:hover { transform: scale(1.06); }

.top10-num {
  font-family: var(--nf-font-number);
  font-size: 12.5rem;
  line-height: 0.78;
  letter-spacing: -0.06em;
  color: var(--nf-bg);
  -webkit-text-stroke: 4px #595959;
  margin-right: -14px;
  user-select: none;
}

.top10-link { position: relative; display: block; }

.top10-cover {
  width: 134px;
  height: 238px;
  object-fit: cover;
  border-radius: 4px;
}

.top10-name {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 118px;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 2px 6px #000;
}

/* Coming soon card */

.coming-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  max-width: 1020px;
  min-height: 290px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}

.coming-card > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.coming-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.1) 100%);
}

.coming-content {
  position: relative;
  z-index: 2;
  padding: 2.2rem 2.4rem;
  max-width: 560px;
}

.coming-tag {
  color: var(--nf-red);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.coming-title {
  font-family: var(--nf-font-display);
  font-size: 2.6rem;
  line-height: 1.05;
  margin: 0 0 0.5rem;
}

.coming-meta { color: #d8d8d8; font-size: 0.95rem; margin-bottom: 1.2rem; }

.coming-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* ---------- Footer ---------- */

.nf-footer {
  padding: 3.5rem 4% 3rem;
  color: var(--nf-gray-dim);
  font-size: 0.88rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nf-footer-question { color: var(--nf-gray); margin-bottom: 1.1rem; }

.nf-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
}

.nf-footer-links a { color: var(--nf-gray-dim); text-decoration: none; }
.nf-footer-links a:hover { color: var(--nf-white); text-decoration: underline; }

.nf-footer-note { margin: 0; }

/* ---------- Profiles page ("Who's watching?") ---------- */

.page-profiles { background: var(--nf-black); min-height: 100vh; }

.profiles-topbar { padding: 1.6rem 3%; }
.profiles-topbar .nf-logo svg { height: 30px; }

.profiles-wrap {
  min-height: 76vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.6rem;
  padding: 0 4% 7vh;
  text-align: center;
}

.profiles-title {
  font-size: clamp(1.9rem, 3.6vw, 3.4rem);
  font-weight: 500;
  margin: 0;
}

.profile-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.2vw;
  list-style: none;
  margin: 0;
  padding: 0;
}

.profile {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}

.profile-avatar {
  position: relative;
  width: clamp(96px, 10vw, 150px);
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2.6rem, 4.6vw, 4.4rem);
  transition: box-shadow 0.2s ease, transform 0.25s ease;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.av-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.av-collage img { min-height: 0; }

.profile-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--nf-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.profile-list li {
  opacity: 0;
  transform: translateY(18px);
  animation: profileIn 0.6s ease forwards;
  animation-delay: calc(0.15s + var(--i, 0) * 0.12s);
}

@keyframes profileIn { to { opacity: 1; transform: none; } }

.profiles-title { animation: introFade 0.8s ease both; }

.profile:hover .profile-avatar { transform: translateY(-4px); }

/* fade the buttons, not the animated <li>s, so the entrance fill doesn't win */
.profile { transition: opacity 0.4s ease; }
.profile-chosen .profile:not(.chosen),
.profile-chosen .manage-profiles { opacity: 0; transition: opacity 0.4s ease; }
.profiles-title { transition: color 0.4s ease; }
.profile-chosen .profiles-title { color: transparent; }
.profile-chosen .profile.chosen .profile-name { color: var(--nf-white); }

.profile.chosen .profile-avatar {
  transform: scale(1.35);
  box-shadow: 0 0 0 3px var(--nf-white), 0 0 60px rgba(229, 9, 20, 0.55);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
}

.av-motaz { background: #1466b8; }
.av-walaa { background: #b81466; }
.av-couple { background: var(--nf-red); }
.av-guests { background: #6a2fa0; }

.profile:hover .profile-avatar,
.profile:focus-visible .profile-avatar { box-shadow: 0 0 0 3px var(--nf-white); }

.profile-name {
  display: block;
  margin-top: 0.8rem;
  color: var(--nf-gray-dim);
  font-size: clamp(0.95rem, 1.35vw, 1.35rem);
  transition: color 0.2s ease;
}

.profile:hover .profile-name,
.profile:focus-visible .profile-name { color: var(--nf-white); }

.manage-profiles {
  background: transparent;
  border: 1px solid var(--nf-gray-dim);
  color: var(--nf-gray-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.82rem;
  padding: 0.75em 2.2em;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.manage-profiles:hover { color: var(--nf-white); border-color: var(--nf-white); }

.shake { animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ---------- Intro page ---------- */

.page-intro { background: var(--nf-black); }

.intro-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nf-black);
  overflow: hidden;
}

.intro-n { line-height: 0; position: relative; z-index: 3; }

/* Memory montage: eight photos strobe past right after the N ident */
.intro-montage { position: absolute; inset: 0; z-index: 1; }

.intro-montage img {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 78vmin;
  width: auto;
  max-width: none;
  border-radius: 6px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: montageFlash 0.36s ease-out forwards;
  animation-delay: calc(2.5s + var(--i) * 0.22s);
}

.intro-montage img:nth-child(odd) { margin-left: -14vmin; }
.intro-montage img:nth-child(even) { margin-left: 14vmin; }

@keyframes montageFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.18); filter: brightness(1.8); }
  25% { opacity: 1; filter: brightness(1.1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.intro-final {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  animation: introFinal 2.8s ease 4.2s forwards;
}

.intro-final img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  filter: brightness(0.42) saturate(1.1);
  transform: scale(1.15);
  animation: kenBurns 6s ease-out 4.2s forwards;
}

@keyframes introFinal { to { opacity: 1; } }

.intro-title {
  position: absolute;
  z-index: 4;
  text-align: center;
  padding: 0 5%;
}

.intro-sub {
  margin: 1rem 0 0;
  font-family: var(--nf-font-number);
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.5em;
  color: var(--nf-red);
  opacity: 0;
  animation: introFade 1.2s ease 5s forwards;
}
.intro-n svg {
  height: 24vmin;
  opacity: 0;
  animation: nZoom 2.8s ease forwards;
}

@keyframes nZoom {
  0% { transform: scale(0.15); opacity: 0; filter: brightness(2.2); }
  35% { opacity: 1; }
  70% { transform: scale(1.12); filter: brightness(1); }
  100% { transform: scale(1.5); opacity: 0; }
}

.intro-text {
  margin: 0;
  font-size: clamp(0.95rem, 2.3vw, 1.5rem);
  font-weight: 700;
  letter-spacing: 0.4em;
  color: #e5e5e5;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
  opacity: 0;
  animation: introFade 1.6s ease 4.4s forwards;
}

@keyframes introFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.skip-btn {
  position: absolute;
  z-index: 5;
  right: 3.5%;
  bottom: 6%;
  background: rgba(42, 42, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--nf-white);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.65em 1.8em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.skip-btn:hover { background: var(--nf-white); color: #000; }

/* ---------- Story page ---------- */

.story-hero {
  position: relative;
  overflow: hidden;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
}

/* Shared "portrait photo in a wide frame" treatment for heroes and episodes */
.story-hero-media,
.invite-hero-media,
.story-ep-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.story-hero-backdrop,
.invite-hero-backdrop,
.story-ep-backdrop {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  max-width: none;
  object-fit: cover;
  filter: blur(36px) brightness(0.45) saturate(1.25);
}

.story-hero-bg,
.invite-hero-bg,
.story-ep-bg {
  position: absolute;
  top: 0;
  right: 4%;
  width: 52%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 24%, #000 78%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 24%, #000 78%, transparent 100%);
}

.story-hero-bg,
.invite-hero-bg { animation: kenBurns 14s ease-out forwards; }

.story-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.15)),
    linear-gradient(to top, var(--nf-bg) 2%, rgba(20, 20, 20, 0) 55%);
}

.story-hero-content {
  position: relative;
  z-index: 2;
  padding: 0 6% 11vh;
  max-width: 640px;
}

.story-title {
  font-family: var(--nf-font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.03;
  margin: 0.4rem 0 0.7rem;
}

.story-sub { color: var(--nf-gray); margin-bottom: 1.6rem; }

.story-ep {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  scroll-margin-top: 0;
}

.story-ep::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.25) 60%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(to top, rgba(20, 20, 20, 0.98) 4%, rgba(0, 0, 0, 0.1) 55%);
}

.story-ep-bg { will-change: transform; transform: scale(1.12); }

/* alternate sides so the scroll feels like a sequence of scenes */
.story-ep:nth-of-type(even) .story-ep-bg { right: auto; left: 4%; }
.story-ep:nth-of-type(even)::before {
  background:
    linear-gradient(to left, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.25) 60%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(to top, rgba(20, 20, 20, 0.98) 4%, rgba(0, 0, 0, 0.1) 55%);
}
.story-ep:nth-of-type(even) .story-ep-content { margin-left: auto; }

.story-ep-content {
  position: relative;
  z-index: 2;
  padding: 0 6% 11vh;
  max-width: 720px;
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.ep-strip {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.6rem;
  overflow-x: auto;
  padding: 0.6rem 0.2rem 0.8rem;
  scrollbar-width: none;
}

.ep-strip::-webkit-scrollbar { display: none; }

.story-ep.visible .strip-photo { animation: stripIn 0.6s ease both; }
.story-ep.visible .strip-photo:nth-child(2) { animation-delay: 0.08s; }
.story-ep.visible .strip-photo:nth-child(3) { animation-delay: 0.16s; }
.story-ep.visible .strip-photo:nth-child(4) { animation-delay: 0.24s; }
.story-ep.visible .strip-photo:nth-child(5) { animation-delay: 0.32s; }
.story-ep.visible .strip-photo:nth-child(6) { animation-delay: 0.4s; }

@keyframes stripIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Episode list under the story hero */
.ep-list-wrap {
  position: relative;
  z-index: 3;
  max-width: 980px;
  margin: -4rem auto 3rem;
  padding: 0 4%;
}

.ep-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.8rem;
  margin-bottom: 0.4rem;
}

.ep-list-head h2 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.ep-list-head span { color: var(--nf-gray); font-weight: 500; }

.ep-list { list-style: none; margin: 0; padding: 0; }

.ep-list a {
  display: grid;
  grid-template-columns: 2.6rem 150px 1fr;
  gap: 1.2rem;
  align-items: center;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.ep-list a:hover { background: #2a2a2a; }

.ep-list-num { font-size: 1.6rem; color: var(--nf-gray); text-align: center; }

.ep-list-thumb { position: relative; border-radius: 4px; overflow: hidden; }
.ep-list-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.ep-list-body { display: flex; flex-direction: column; gap: 0.35rem; color: var(--nf-gray); font-size: 0.88rem; line-height: 1.5; }
.ep-list-title { display: flex; justify-content: space-between; gap: 1rem; color: var(--nf-white); }
.ep-list-title strong { font-size: 1rem; }
.ep-list-title em { font-style: normal; color: #d2d2d2; white-space: nowrap; }

.story-ep.visible .story-ep-content { opacity: 1; transform: none; }

.ep-tag {
  color: var(--nf-red);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.story-ep h2 {
  font-family: var(--nf-font-display);
  font-size: clamp(2.2rem, 4.6vw, 3.8rem);
  margin: 0 0 0.8rem;
}

.story-ep p {
  color: #dcdcdc;
  font-size: 1.08rem;
  line-height: 1.7;
  margin: 0;
}

.story-finale { padding: 4rem 4% 5rem; }

/* ---------- Invite page ---------- */

.invite-hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
}

.invite-hero { overflow: hidden; }

.invite-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0.05) 100%),
    linear-gradient(to top, var(--nf-bg) 3%, rgba(20, 20, 20, 0) 58%);
}

.invite-hero-content {
  position: relative;
  z-index: 2;
  padding: 0 6% 10vh;
  max-width: 660px;
}

.invite-title {
  font-family: var(--nf-font-display);
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 1.02;
  margin: 0.4rem 0 0.7rem;
}

.invite-hero .billboard-desc { margin-bottom: 1.6rem; }

.invite-body {
  padding: 3.5rem 4% 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.countdown { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }

.cd-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  min-width: 92px;
  padding: 1.1rem 1.2rem 0.9rem;
  text-align: center;
}

.cd-num {
  display: block;
  font-family: var(--nf-font-number);
  font-size: 2.8rem;
  line-height: 1;
  color: var(--nf-white);
}

.cd-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--nf-gray);
}

.cd-banner {
  width: 100%;
  text-align: center;
  font-family: var(--nf-font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  color: var(--nf-red);
}

.detail-card {
  background: var(--nf-card);
  border-radius: 8px;
  padding: clamp(1.6rem, 3.4vw, 2.8rem);
  max-width: 880px;
  width: 100%;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.5);
}

.detail-card h2 {
  font-family: var(--nf-font-display);
  font-size: 2rem;
  margin: 0 0 1.2rem;
}

.detail-list {
  list-style: none;
  margin: 0 0 1.8rem;
  padding: 0;
}

.detail-list li {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-list li:last-child { border-bottom: 0; }

.detail-icon { font-size: 1.4rem; line-height: 1.4; }

.detail-list strong { display: block; font-size: 1.06rem; }
.detail-list span { color: var(--nf-gray); font-size: 0.9rem; }

/* ---------- Nav extras: avatar, notifications, phone tab bar ---------- */

.nf-avatar-mini { overflow: hidden; }
.nf-avatar-mini img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }

.nf-notify { position: relative; }

.nf-bell { position: relative; cursor: pointer; }

.nf-bell-dot {
  position: absolute;
  top: -6px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--nf-red);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  animation: pulse 1.8s ease infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(229, 9, 20, 0); }
}

.nf-notify-panel {
  position: absolute;
  top: calc(100% + 18px);
  right: -60px;
  width: 300px;
  background: rgba(0, 0, 0, 0.92);
  border-top: 2px solid var(--nf-white);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.nf-notify.open .nf-notify-panel { opacity: 1; visibility: visible; transform: none; }

.nf-notify-panel a {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 0.9rem;
  color: var(--nf-white);
  text-decoration: none;
}

.nf-notify-panel img { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; object-position: center 38%; border-radius: 3px; }
.nf-notify-panel strong { display: block; font-size: 0.9rem; }
.nf-notify-panel em { display: block; font-style: normal; font-size: 0.76rem; color: var(--nf-gray); margin-top: 0.2rem; }

.nf-tabbar { display: none; }

/* ---------- Photo cards (rows, filmstrips, teaser) ---------- */

.photo-card {
  position: relative;
  flex: 0 0 auto;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #222;
  cursor: zoom-in;
  color: inherit;
  font-family: inherit;
  text-align: left;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
}

.photo-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }

.photo-card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 2.2rem 0.7rem 0.7rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.photo-card-play {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--nf-white);
  color: #000;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px;
}

.photo-card-title { font-size: 0.85rem; font-weight: 700; line-height: 1.2; }

.photo-card:hover,
.photo-card:focus-visible {
  transform: scale(1.08);
  z-index: 5;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.75);
}

.photo-card:hover img { transform: scale(1.04); }
.photo-card:hover .photo-card-info,
.photo-card:focus-visible .photo-card-info { opacity: 1; transform: none; }

.row-photo { width: 200px; height: 300px; }
.strip-photo { width: 104px; height: 150px; }
.teaser-photo { width: 150px; height: 220px; }

.row-explore {
  margin-left: 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #54b9c5;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.row-block:hover .row-explore,
.teaser .row-explore { opacity: 1; }

/* Continue watching */

.ep-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  border: 2px solid var(--nf-white);
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 3px;
  font-size: 1rem;
  color: var(--nf-white);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ep-card:hover .ep-play,
.ep-list a:hover .ep-play { opacity: 1; }

.ep-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(128, 128, 128, 0.6);
}

.ep-progress span { display: block; height: 100%; background: var(--nf-red); }

.ep-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--nf-red);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2em 0.6em;
  border-radius: 2px;
}

button.top10-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: zoom-in;
}

/* ---------- Scroll reveal ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--d, 0ms);
}

[data-reveal].revealed { opacity: 1; transform: none; }

/* ---------- Gallery page ---------- */

.gallery-hero {
  position: relative;
  min-height: 74vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.gallery-hero-mosaic {
  position: absolute;
  inset: -10% -5%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  transform: rotate(-6deg) scale(1.1);
  opacity: 0.55;
  animation: mosaicDrift 40s linear infinite alternate;
}

.gallery-hero-mosaic img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

@keyframes mosaicDrift {
  from { transform: rotate(-6deg) scale(1.1) translateY(0); }
  to { transform: rotate(-6deg) scale(1.1) translateY(-6%); }
}

.gallery-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.3) 70%),
    linear-gradient(to top, var(--nf-bg) 4%, rgba(20, 20, 20, 0) 60%);
}

.gallery-hero-content { position: relative; z-index: 2; padding: 0 6% 9vh; max-width: 640px; }

.gallery-title {
  font-family: var(--nf-font-display);
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 1.02;
  margin: 0 0 0.6rem;
}

.gallery-body { padding: 1rem 4% 4rem; }

.genre-chips {
  position: sticky;
  top: 68px;
  z-index: 50;
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0.9rem 0;
  margin-bottom: 1.4rem;
  background: linear-gradient(to bottom, var(--nf-bg) 75%, rgba(20, 20, 20, 0));
  scrollbar-width: none;
}

.genre-chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
  color: var(--nf-white);
  border-radius: 999px;
  padding: 0.45em 1.1em;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.chip span { color: var(--nf-gray); margin-left: 0.2em; font-size: 0.8em; }
.chip:hover { background: rgba(255, 255, 255, 0.12); }
.chip[aria-selected="true"] { background: var(--nf-white); color: #000; border-color: var(--nf-white); }
.chip[aria-selected="true"] span { color: #555; }

.masonry { columns: 4 240px; column-gap: 12px; }

.masonry-item { break-inside: avoid; margin: 0 0 12px; }

.masonry-item button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #222;
  cursor: zoom-in;
  color: inherit;
  font-family: inherit;
  text-align: left;
}

.masonry-item img { width: 100%; height: auto; transition: transform 0.6s ease, filter 0.4s ease; }

.masonry-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.4rem 0.9rem 0.8rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.masonry-item figcaption span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--nf-red);
}

.masonry-item figcaption strong { font-size: 0.98rem; }

.masonry-item button:hover img { transform: scale(1.06); filter: brightness(1.08); }
.masonry-item button:hover figcaption,
.masonry-item button:focus-visible figcaption { opacity: 1; transform: none; }

/* ---------- Lightbox ---------- */

.lb-open, .lb-open body { overflow: hidden; }

.lb {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lb.show { opacity: 1; }

.lb-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.94); }

.lb-stage {
  position: relative;
  margin: 0;
  max-width: 92vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.lb-img {
  max-width: 92vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: scale(0.97);
  pointer-events: auto;
}

.lb-img.in { animation: lbIn 0.45s ease forwards; }

@keyframes lbIn { to { opacity: 1; transform: none; } }

.lb-caption { margin-top: 1rem; text-align: center; }
.lb-chapter {
  display: block;
  color: var(--nf-red);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.lb-title { font-size: 1.1rem; }

.lb-top {
  position: absolute;
  top: 1rem;
  right: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  z-index: 2;
}

.lb-counter { margin-right: auto; color: var(--nf-gray); font-family: var(--nf-font-number); font-size: 1.2rem; letter-spacing: 0.1em; }

.lb-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(30, 30, 30, 0.7);
  color: var(--nf-white);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.lb-btn:hover { background: rgba(255, 255, 255, 0.18); }

.lb-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 56px;
  height: 96px;
  margin-top: -48px;
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  color: var(--nf-white);
  font-size: 2.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.lb-nav:hover { background: rgba(0, 0, 0, 0.7); }
.lb-prev { left: 0; border-radius: 0 6px 6px 0; }
.lb-next { right: 0; border-radius: 6px 0 0 6px; }

.lb-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 2; }
.lb-progress span { display: block; height: 100%; width: 100%; background: var(--nf-red); transform: scaleX(0); transform-origin: left; }
.lb.playing .lb-progress span { animation: tickFill 3.8s linear forwards; }

/* ---------- Invite page extras ---------- */

.btn-nf.rsvp { background: #25d366; color: #052e16; }
.btn-nf.rsvp:hover { background: #1fb457; }

.cd-num.flip { animation: flip 0.5s ease; }

@keyframes flip {
  0% { transform: rotateX(90deg); opacity: 0.2; }
  60% { transform: rotateX(-12deg); opacity: 1; }
  100% { transform: none; }
}

.cd-box { perspective: 300px; position: relative; overflow: hidden; }
.cd-box::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, 0.5);
}

.cast { text-align: center; }

.cast-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--nf-gray);
  margin: 0 0 1.2rem;
}

.cast-list { display: flex; align-items: center; justify-content: center; gap: clamp(1rem, 4vw, 3rem); }

.cast-member { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }

.cast-member img {
  width: clamp(110px, 16vw, 170px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  margin-bottom: 0.4rem;
}

.cast-member strong { font-family: var(--nf-font-display); font-size: 1.6rem; letter-spacing: 0.04em; }
.cast-member span { color: var(--nf-gray); font-size: 0.85rem; }

.cast-amp { font-family: var(--nf-font-display); font-size: clamp(2.4rem, 6vw, 4rem); color: var(--nf-red); }

.rsvp-card {
  position: relative;
  max-width: 880px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.5);
}

.rsvp-bg {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  max-width: none;
  object-fit: cover;
  filter: blur(14px) brightness(0.35);
}

.rsvp-content { position: relative; padding: clamp(2rem, 5vw, 3.4rem) 1.4rem; }

.rsvp-content h2 {
  font-family: var(--nf-font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 0.6rem;
}

.rsvp-content p:not(.ep-tag) { color: #ddd; margin: 0 auto 1.5rem; max-width: 30rem; }
.rsvp-content .btn-nf { margin: 0 auto; }

.teaser { width: 100%; }
.teaser-strip { display: flex; gap: 0.6rem; overflow-x: auto; padding: 1.2rem 0.3rem 1.4rem; scrollbar-width: none; }
.teaser-strip::-webkit-scrollbar { display: none; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal], .story-ep-content, .profile-list li { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  /* phone tab bar */
  .nf-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    justify-content: space-around;
    padding: 0.45rem 0 calc(0.45rem + env(safe-area-inset-bottom));
    background: rgba(18, 18, 18, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .nf-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    color: var(--nf-gray-dim);
    font-size: 0.66rem;
    text-decoration: none;
  }

  .nf-tabbar svg { width: 22px; height: 22px; }
  .nf-tabbar a.active { color: var(--nf-white); }

  body.has-tabbar { padding-bottom: 64px; }

  .nf-notify-panel { right: -50px; width: 270px; }

  /* portrait photos fill the frame on phones */
  .bb-poster,
  .story-hero-bg,
  .invite-hero-bg,
  .story-ep-bg,
  .story-ep:nth-of-type(even) .story-ep-bg {
    left: 0;
    right: 0;
    width: 100%;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .billboard-controls { bottom: auto; top: 72px; right: 4%; gap: 0.6rem; }
  .billboard-age { display: none; }
  .billboard-ribbon { font-size: 0.95rem; }
  .bb-countdown { margin-bottom: 1rem; padding: 0.55rem 0.8rem 0.5rem; }
  .bb-cd-unit strong { font-size: 1.8rem; }
  .bb-cd-sep { font-size: 1.5rem; }
  .bb-cd-units { gap: 0.35rem; }
  .bb-tick { width: 18px; }
  .billboard-pause { width: 34px; height: 34px; }

  .row-photo { width: 140px; height: 210px; }
  .photo-card-info { opacity: 1; transform: none; padding: 1.6rem 0.5rem 0.5rem; }
  .photo-card-play { display: none; }
  .photo-card-title { font-size: 0.72rem; }
  .row-explore { opacity: 1; }

  .story-ep:nth-of-type(even) .story-ep-content { margin-left: 0; }
  .story-ep::before,
  .story-ep:nth-of-type(even)::before {
    background: linear-gradient(to top, rgba(20, 20, 20, 0.98) 18%, rgba(0, 0, 0, 0.15) 70%);
  }
  .strip-photo { width: 86px; height: 124px; }

  .ep-list-wrap { margin-top: -2rem; }
  .ep-list a { grid-template-columns: 112px 1fr; gap: 0.9rem; padding: 0.9rem 0.2rem; }
  .ep-list-num { display: none; }
  .ep-list-body > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  .genre-chips { top: 58px; }
  .masonry { columns: 2 140px; column-gap: 8px; }
  .masonry-item { margin-bottom: 8px; }
  .masonry-item figcaption { opacity: 1; transform: none; padding: 1.6rem 0.6rem 0.5rem; }
  .masonry-item figcaption strong { font-size: 0.8rem; }

  .lb-nav { display: none; }
  .lb-img { max-height: 72vh; }

  .intro-montage img { height: 62vmin; }
  .intro-montage img:nth-child(odd) { margin-left: -8vmin; }
  .intro-montage img:nth-child(even) { margin-left: 8vmin; }

  .teaser-photo { width: 120px; height: 176px; }
  .cast-member strong { font-size: 1.3rem; }

  .nf-nav { height: 58px; gap: 1rem; }
  .nf-logo svg { height: 21px; }

  .billboard { height: 92vh; height: 92svh; min-height: 600px; max-height: none; }
  .billboard-content { bottom: 5%; right: 4%; max-width: none; }
  .billboard-vignette { background: linear-gradient(to top, var(--nf-bg) 8%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.1) 75%); }
  .billboard-desc { font-size: 0.95rem; }
  .btn-nf { padding: 0.55rem 1.15rem; font-size: 0.95rem; }

  .nf-rows { margin-top: 0; }

  .ep-card { flex-basis: 200px; }

  .top10-num { font-size: 6.6rem; -webkit-text-stroke: 2px #595959; margin-right: -8px; }
  .top10-cover { width: 88px; height: 158px; }
  .top10-name { font-size: 0.68rem; width: 78px; left: 5px; bottom: 5px; }

  .coming-card { min-height: 0; }
  .coming-card > img { position: relative; height: 170px; }
  .coming-overlay { background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.92) 65%); }
  .coming-content { padding: 1.4rem 1.3rem 1.6rem; max-width: none; }
  .coming-title { font-size: 2rem; }

  .story-hero { min-height: 72vh; }
  .story-ep-content { padding-bottom: 15vh; }

  .cd-box { min-width: 72px; padding: 0.8rem 0.7rem 0.7rem; }
  .cd-num { font-size: 2.1rem; }
}

/* ---------- Background music toggle ---------- */

.music-toggle {
  position: fixed;
  left: 1.2rem;
  bottom: 1.2rem;
  z-index: 300;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--nf-white);
  font-family: var(--nf-font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.music-toggle svg { width: 20px; height: 20px; }
.music-toggle:hover { background: rgba(255, 255, 255, 0.15); border-color: var(--nf-white); }

/* not yet playing: gently pulse so guests notice there's a song */
.music-toggle:not(.is-playing) { animation: pulse 1.8s ease infinite; border-color: var(--nf-red); }

.lb-open .music-toggle { display: none; }

@media (max-width: 768px) {
  .music-toggle { left: 0.8rem; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 0.5rem; }
  .music-toggle span { display: none; }
  .page-intro .music-toggle,
  .page-profiles .music-toggle { bottom: 1rem; }
}

/* ---------- Home: varied chapter row layouts ---------- */

/* wide: landscape cards with numbered captions */
.wide-item { flex: 0 0 auto; width: 300px; }
.wide-photo { width: 100%; height: 170px; }
.wide-photo .photo-card-info { display: none; }
.wide-caption {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  font-weight: 700;
}
.wide-caption span {
  font-family: var(--nf-font-number);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--nf-red);
}

/* feature: bento grid, one big tile and smaller ones */
.bento {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 220px 220px;
  grid-auto-flow: dense;
  gap: 10px;
  padding: 0.8rem 0 1rem;
}
.bento-reverse { grid-template-columns: 1fr 1fr 2fr; }
.bento-tile { width: 100%; height: 100%; }
.bento-main { grid-row: span 2; }
.bento-reverse .bento-main { grid-column: 3; }
.bento-4 .bento-tile:nth-child(2) { grid-row: span 2; }
.bento .photo-card:hover,
.bento .photo-card:focus-visible { transform: scale(1.025); }
.bento-main .photo-card-title { font-size: 1.2rem; }
.bento-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  font-family: var(--nf-font-display);
  font-size: 2.6rem;
}

/* spotlight: blurred banner with a title panel */
.spotlight {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.6rem 0 1.6rem 2rem;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.5);
}
.spotlight-bg {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  max-width: none;
  object-fit: cover;
  filter: blur(30px) brightness(0.4) saturate(1.3);
}
.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.1));
}
.spotlight > :not(.spotlight-bg) { position: relative; z-index: 1; }
.spotlight-text p:not(.ep-tag) { color: #ddd; font-size: 0.92rem; margin: 0 0 1.2rem; }
.spotlight-title {
  font-family: var(--nf-font-display);
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.02;
  margin: 0 0 0.5rem;
}
.spotlight .row-slider { min-width: 0; }
.spotlight-track { padding: 1.4rem 0.5rem; }
.spotlight-photo { width: 190px; height: 280px; }

/* stories: round bubbles with a gradient ring */
.stories {
  display: flex;
  gap: 1.6rem;
  overflow-x: auto;
  padding: 1rem 0.3rem 1.2rem;
  scrollbar-width: none;
}
.stories::-webkit-scrollbar { display: none; }
.story-bubble {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 150px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  cursor: zoom-in;
}
.story-ring {
  display: block;
  width: 140px;
  height: 140px;
  padding: 4px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--nf-red), #ff8a3d, #ffd36e, #e85fa8, var(--nf-red));
  transition: transform 0.3s ease;
}
.story-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--nf-bg);
}
.story-bubble:hover .story-ring,
.story-bubble:focus-visible .story-ring { transform: scale(1.07) rotate(-3deg); }
.story-name { font-size: 0.85rem; font-weight: 700; text-align: center; }

/* polaroid: tilted instant prints */
.polaroids {
  display: flex;
  gap: 1.4rem;
  overflow-x: auto;
  padding: 1.6rem 0.8rem 2rem;
  scrollbar-width: none;
}
.polaroids::-webkit-scrollbar { display: none; }
.polaroid {
  flex: 0 0 auto;
  width: 210px;
  padding: 10px 10px 0;
  border: 0;
  background: #f4f1ea;
  color: #222;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
  transform: rotate(var(--tilt, 0deg));
  font-family: inherit;
  cursor: zoom-in;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.polaroid img { width: 100%; height: 230px; object-fit: cover; }
.polaroid span {
  display: block;
  padding: 0.75rem 0.2rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-style: italic;
  text-align: center;
}
.polaroid:hover,
.polaroid:focus-visible { transform: rotate(0deg) scale(1.06); z-index: 2; }

@media (max-width: 768px) {
  .wide-item { width: 230px; }
  .wide-photo { height: 130px; }

  .bento,
  .bento-reverse { grid-template-columns: 1fr 1fr; grid-template-rows: 240px; grid-auto-rows: 150px; }
  .bento-main,
  .bento-reverse .bento-main { grid-column: 1 / -1; grid-row: auto; }
  .bento-4 .bento-tile:nth-child(2) { grid-row: auto; }
  .bento-4 .bento-tile:last-child { grid-column: 1 / -1; }

  .spotlight { grid-template-columns: 1fr; padding: 1.4rem 0 0.4rem 1.2rem; }
  .spotlight-photo { width: 140px; height: 210px; }

  .stories { gap: 1rem; }
  .story-bubble { width: 100px; }
  .story-ring { width: 92px; height: 92px; padding: 3px; }
  .story-ring img { border-width: 3px; }
  .story-name { font-size: 0.72rem; }

  .polaroid { width: 160px; }
  .polaroid img { height: 180px; }
}

/* ---------- Tap-to-begin gate (unlocks the music) ---------- */

.music-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, rgba(229, 9, 20, 0.22), rgba(0, 0, 0, 0) 60%),
    rgba(0, 0, 0, 0.94);
  cursor: pointer;
  transition: opacity 0.6s ease;
  animation: introFade 0.6s ease both;
}

.music-gate.hide { opacity: 0; pointer-events: none; }

.music-gate-inner { text-align: center; padding: 0 1.5rem; }

.music-gate-n { height: 74px; width: auto; margin: 0 auto 1.4rem; display: block; filter: drop-shadow(0 0 24px rgba(229, 9, 20, 0.6)); }

.music-gate-title {
  font-family: var(--nf-font-display);
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}

.music-gate-title span { color: var(--nf-red); }

.music-gate-sub { color: var(--nf-gray); font-size: 1rem; letter-spacing: 0.08em; margin: 0 0 2rem; }

.music-gate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.9rem;
  border-radius: 4px;
  background: var(--nf-white);
  color: #000;
  font-weight: 700;
  font-size: 1.05rem;
  animation: pulse 1.8s ease infinite;
}

.music-gate-btn svg { width: 22px; height: 22px; }
