/* Marketing / site layout — AniU brand tokens from styles.css */

.site-header {
  position: fixed;
  z-index: 240;
}

.nav-links a.is-active {
  color: var(--text);
  font-weight: 700;
}

/* Hero */
.mkt-hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 5rem) 0;
}

.mkt-hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.mkt-hero-copy {
  max-width: 620px;
}

.mkt-hero-tag {
  display: inline-flex;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary-start) 55%, transparent);
  background: color-mix(in srgb, var(--primary-start) 14%, transparent);
  color: var(--primary-start);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 1.15rem;
}

.mkt-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 1rem;
}

.mkt-hero-desc {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: var(--leading-body);
  max-width: 48ch;
}

.mkt-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.mkt-hero-trust {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mkt-hero-device {
  justify-self: end;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  max-width: 560px;
  width: 100%;
}

.mkt-hero-device img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

/* Sections */
.mkt-section {
  padding: var(--section-y) 0;
}

.mkt-section-head {
  margin-bottom: 2rem;
  max-width: 720px;
}

.mkt-section-kicker {
  margin: 0 0 0.35rem;
  color: var(--primary-start);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mkt-section-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  line-height: 1.2;
}

.mkt-section-desc {
  margin: 0;
  color: var(--text-muted);
  line-height: var(--leading-body);
}

.mkt-section-cta {
  margin-top: 2rem;
  text-align: center;
}

/* Discovery posters */
.mkt-poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

@media (min-width: 900px) {
  .mkt-poster-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.mkt-poster-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform 0.25s var(--ease);
}

.mkt-poster-card:hover {
  transform: translateY(-4px);
}

.mkt-poster-visual {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-variant);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  border: 1px solid var(--glass-border);
}

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

.mkt-poster-rating {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(10, 10, 15, 0.78);
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
}

.mkt-poster-status {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
}

.mkt-poster-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mkt-poster-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Features */
.mkt-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.mkt-feature {
  padding: 1.35rem;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.mkt-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary-start) 16%, transparent);
  color: var(--primary-start);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

.mkt-feature h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.mkt-feature p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Devices */
.mkt-devices {
  display: grid;
  grid-template-columns: minmax(160px, 280px) minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  align-items: start;
}

.mkt-device {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mkt-device figcaption {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.mkt-device-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: #0a0a0f;
}

.mkt-device-frame.is-phone {
  max-width: 280px;
  margin-inline: auto;
}

.mkt-device-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.mkt-device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Taste flow */
.mkt-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.mkt-flow-step {
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 120px;
  text-align: center;
}

.mkt-flow-step.is-highlight {
  border-color: color-mix(in srgb, var(--primary-start) 50%, var(--glass-border));
  color: var(--text);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary-end) 30%, transparent);
}

.mkt-flow-arrow {
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* Plans */
.mkt-plans {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  align-items: stretch;
}

.mkt-plan {
  flex: 1 1 220px;
  max-width: 280px;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100%;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.mkt-plan:hover {
  transform: translateY(-3px);
}

.mkt-plan.is-premium {
  border-color: color-mix(in srgb, var(--primary-start) 55%, var(--glass-border));
  box-shadow: 0 0 40px color-mix(in srgb, var(--primary-end) 18%, transparent);
}

.mkt-plan-badge {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: #fff;
}

.mkt-plan-price {
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 800;
  margin: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
}

.mkt-plan-price-original {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: line-through;
}

.mkt-plan-price-final {
  display: block;
}

.mkt-plan-price-unit {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.mkt-plan-off {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 0.45rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-start) 18%, transparent);
  color: var(--primary-start);
  font-size: 0.75rem;
  font-weight: 700;
}

.mkt-pay-dialog {
  width: min(460px, calc(100vw - 2rem));
  max-width: min(460px, calc(100vw - 2rem));
}

.mkt-pay-duration {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-weight: 600;
}

.mkt-pay-rows {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}

.mkt-pay-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
}

.mkt-pay-row span:last-child {
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.mkt-pay-row .is-struck {
  color: var(--text-muted);
  text-decoration: line-through;
}

.mkt-pay-row .is-final {
  font-weight: 800;
  font-size: 1.05rem;
}

.mkt-pay-coupon {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.mkt-pay-coupon-row {
  display: flex;
  gap: 0.5rem;
}

.mkt-pay-coupon-row input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text);
  padding: 0 0.85rem;
  font: inherit;
  letter-spacing: 0.04em;
}

.mkt-pay-coupon-row .btn {
  width: auto;
  flex: 0 0 auto;
}

.mkt-pay-coupon-row .btn[hidden] {
  display: none;
}

.mkt-pay-note {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  line-height: 1.45;
}

.mkt-pay-note.is-error {
  color: #ff8aa8;
}

.mkt-pay-note.is-ok {
  color: var(--primary-start);
}

.mkt-pay-dialog .btn-primary {
  width: 100%;
  justify-content: center;
}

.mkt-plan-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mkt-plan-duration {
  color: var(--text);
  font-weight: 600;
}

.mkt-plan .btn {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}

/* Catalog / Search */
.mkt-catalog-hero {
  padding: calc(var(--header-h) + 1.25rem) 0 1.5rem;
}

.search-shell {
  padding-bottom: 3rem;
}

.search-hero {
  padding: calc(var(--header-h) + 1.5rem) 0 0.75rem;
  max-width: 40rem;
}

.search-hero-title {
  margin: 0;
  font-family: var(--font-display, "Gotham", sans-serif);
  font-size: clamp(1.85rem, 3.2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--secondary, var(--primary-start));
}

html[dir="rtl"] .search-hero-title {
  font-family: var(--font-fa, "Vazir", Tahoma, sans-serif);
  letter-spacing: 0;
}

.search-hero-desc {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 42ch;
}

.search-field-bar {
  position: sticky;
  /* Prefer measured app-bar height (--search-sticky-top); fall back to --header-h. */
  top: var(--search-sticky-top, var(--header-h, 64px));
  z-index: 30;
  padding: 0.55rem 0 0.65rem;
  /* Field size stays the same; chrome only appears when stuck. */
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  isolation: isolate;
}

.search-page .search-field-bar {
  width: 100%;
}

/* Full-bleed opaque backdrop only — does not resize the form or input. */
.search-field-bar.is-stuck::before {
  content: "";
  position: absolute;
  inset-block: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: 0;
  background: var(--bg);
  box-shadow: 0 10px 18px color-mix(in srgb, var(--bg) 92%, transparent);
  pointer-events: none;
}

.search-field {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0.3rem 0.4rem 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--surface-variant, var(--glass-border)) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 92%, var(--surface));
  color: var(--text-muted);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html[dir="rtl"] .search-field {
  padding: 0.3rem 0.85rem 0.3rem 0.4rem;
}

.search-field:focus-within {
  border-color: color-mix(in srgb, var(--secondary, var(--primary-start)) 70%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary, var(--primary-start)) 18%, transparent);
}

.search-field-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-field input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
  text-align: start;
}

.search-field input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.search-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, opacity 0.15s ease, visibility 0.15s ease;
}

/* Keep clear slot width so the field does not jump when text appears. */
.search-icon-btn.search-field-clear[hidden] {
  display: inline-flex !important;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.search-icon-btn:hover,
.search-icon-btn:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-variant) 55%, transparent);
  outline: none;
}

.search-filter-btn.has-filters {
  color: var(--text);
}

.search-filter-badge {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e11d48;
  color: #fff;
  font-size: 0.7rem;
  line-height: 14px;
  text-align: center;
  font-weight: 700;
}

.search-section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.search-section-title svg {
  color: var(--secondary, var(--primary-start));
}

.search-trending {
  margin-top: 0.85rem;
}

.search-trending-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr));
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
}

.search-trending-card {
  min-width: 0;
  max-width: 100%;
}

/* Full-bleed artwork + fade; text/action float over the dark side. */
.search-trending-item {
  --trending-scrim: #0a0a0f;
  position: relative;
  isolation: isolate;
  direction: ltr;
  text-decoration: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  height: 56px;
  min-height: 56px;
  padding: 0 0.5rem 0 36%;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--surface-variant, var(--glass-border)) 65%, transparent);
  background: var(--trending-scrim);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

html[dir="ltr"] .search-trending-item {
  flex-direction: row-reverse;
  padding: 0 36% 0 0.5rem;
}

.search-trending-item:hover,
.search-trending-item:focus-visible {
  border-color: color-mix(in srgb, var(--secondary, var(--primary-start)) 45%, transparent);
  outline: none;
}

.search-trending-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  pointer-events: none;
}

html[dir="ltr"] .search-trending-image {
  object-position: right center;
}

.search-trending-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(10, 10, 15, 0) 0%,
    rgba(10, 10, 15, 0.04) 28%,
    rgba(10, 10, 15, 0.55) 46%,
    rgba(10, 10, 15, 0.92) 64%,
    rgba(10, 10, 15, 0.99) 100%
  );
}

html[dir="ltr"] .search-trending-item::after {
  background: linear-gradient(
    to left,
    rgba(10, 10, 15, 0) 0%,
    rgba(10, 10, 15, 0.04) 28%,
    rgba(10, 10, 15, 0.55) 46%,
    rgba(10, 10, 15, 0.92) 64%,
    rgba(10, 10, 15, 0.99) 100%
  );
}

.search-trending-item.is-empty::after {
  background: color-mix(in srgb, var(--trending-scrim) 92%, var(--surface));
}

.search-trending-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.08rem;
}

/*
 * Persian: pack the title block against the search icon (far right).
 * margin-left:auto eats free space on the left of the content row.
 */
html[dir="rtl"] .search-trending-copy {
  flex: 0 1 auto;
  max-width: calc(100% - 1.75rem);
  margin-left: auto;
  margin-right: 0;
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .search-trending-title--fa {
  order: 1;
}

html[dir="rtl"] .search-trending-title--en {
  order: 2;
}

/* English: keep titles on the left in the mirrored card (unchanged composition). */
html[dir="ltr"] .search-trending-copy {
  flex: 1 1 auto;
  margin-left: 0;
  margin-right: 0;
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .search-trending-title--en {
  order: 1;
}

html[dir="ltr"] .search-trending-title--fa {
  order: 2;
}

.search-trending-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

/* Primary title (first line for active language) */
html[dir="rtl"] .search-trending-title--fa,
html[dir="ltr"] .search-trending-title--en {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

[data-theme="light"] html[dir="rtl"] .search-trending-title--fa,
[data-theme="light"] html[dir="ltr"] .search-trending-title--en,
html[dir="rtl"][data-theme="light"] .search-trending-title--fa,
html[dir="ltr"][data-theme="light"] .search-trending-title--en {
  color: var(--text);
}

/* Secondary subtitle */
html[dir="rtl"] .search-trending-title--en,
html[dir="ltr"] .search-trending-title--fa {
  font-size: 0.7rem;
  font-weight: 500;
  color: color-mix(in srgb, #fff 58%, transparent);
}

/* Only one title available → treat it as primary */
.search-trending-copy .search-trending-title:only-child {
  order: 1;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

[data-theme="light"] .search-trending-copy .search-trending-title:only-child {
  color: var(--text);
}

.search-trending-action {
  position: relative;
  z-index: 2;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 999px;
  border: 0;
  outline: none;
  box-shadow: none;
  background: color-mix(in srgb, #0e0e14 88%, transparent);
  color: var(--secondary, var(--primary-start));
}

.search-trending-action svg {
  width: 14px;
  height: 14px;
}

.search-trending-item:hover .search-trending-action,
.search-trending-item:focus-visible .search-trending-action {
  background: color-mix(in srgb, var(--secondary, var(--primary-start)) 14%, #0e0e14);
}

@media (max-width: 899px) {
  .search-trending-list {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .search-trending-item {
    height: 56px;
    min-height: 56px;
    padding-inline-start: 34%;
  }

  html[dir="ltr"] .search-trending-item {
    padding-inline: 0.5rem 34%;
  }
}

.search-genres {
  margin-top: 1.75rem;
}

.search-genre-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
}

.search-genre-chip,
.search-filter-chip {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--surface-variant, var(--glass-border)) 90%, transparent);
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

/* `.search-filter-chip { display }` must not override the HTML hidden attribute. */
.search-genre-chip[hidden],
.search-filter-chip[hidden],
.search-genre-option[hidden] {
  display: none !important;
}

.search-genre-chip:hover,
.search-genre-chip:focus-visible,
.search-filter-chip:hover,
.search-filter-chip:focus-visible {
  border-color: color-mix(in srgb, var(--secondary, var(--primary-start)) 45%, transparent);
  background: color-mix(in srgb, var(--secondary, var(--primary-start)) 16%, var(--bg));
  outline: none;
}

.search-genre-chip.is-active,
.search-filter-chip.is-active {
  border-color: transparent;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
  color: #fff;
  gap: 0.35rem;
}

.search-filter-section--genres .search-filter-chip.is-active::before,
.search-genre-option.is-active::before {
  content: "";
  width: 0.72rem;
  height: 0.72rem;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.search-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.5rem;
  margin-top: 0.35rem;
}

.search-results-main {
  flex: 1 1 auto;
  min-width: 0;
}

.search-filters-desktop {
  display: none;
  flex: 0 0 17.5rem;
  order: -1;
  position: sticky;
  top: calc(var(--search-sticky-top, var(--header-h, 64px)) + 4.25rem);
  max-height: calc(100vh - var(--search-sticky-top, var(--header-h, 64px)) - 5rem);
  overflow: auto;
  padding: 1rem 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--surface-variant, var(--glass-border)) 85%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, var(--surface));
}

.search-filters-desktop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--surface-variant) 70%, transparent);
}

.search-filters-desktop-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}

.search-filters-reset {
  border: none;
  background: transparent;
  color: var(--secondary, var(--primary-start));
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0;
}

.search-filters-reset:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.search-filters-desktop-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* No nested genre scroll — whole sidebar scrolls as one unit. */
.search-chip-row--genres-preview {
  max-height: none;
  overflow: visible;
}

.search-filter-collapse {
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--surface-variant, var(--glass-border)) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
  overflow: clip;
}

.search-filter-collapse > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  user-select: none;
}

.search-filter-collapse > summary::-webkit-details-marker {
  display: none;
}

.search-filter-collapse-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: start;
}

.search-filter-see-all {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--secondary, var(--primary-start));
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0.15rem;
  white-space: nowrap;
  /* Keep above the summary hit-target so it can stop the toggle. */
  position: relative;
  z-index: 1;
}

.search-filter-see-all:hover,
.search-filter-see-all:focus-visible {
  outline: none;
  text-decoration: underline;
}

.search-filter-collapse-chevron {
  flex: 0 0 auto;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.search-filter-collapse[open] > summary .search-filter-collapse-chevron {
  transform: rotate(180deg);
}

.search-filter-collapse-body {
  padding: 0 0.75rem 0.85rem;
}

/* Explicit hide — some browsers keep slotted body layout when overflow/clip is set on details. */
.search-filter-collapse:not([open]) > .search-filter-collapse-body {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .search-filter-collapse-chevron {
    transition: none;
  }
}

.search-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.65rem;
  margin: 0 0 1rem;
}

.search-active-filters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
  flex: 1 1 auto;
}

.search-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 32px;
  padding: 0.25rem 0.55rem 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--secondary, var(--primary-start)) 35%, transparent);
  background: color-mix(in srgb, var(--secondary, var(--primary-start)) 14%, var(--bg));
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
}

html[dir="rtl"] .search-active-chip {
  padding: 0.25rem 0.7rem 0.25rem 0.55rem;
}

.search-active-chip:hover,
.search-active-chip:focus-visible {
  border-color: color-mix(in srgb, var(--secondary, var(--primary-start)) 55%, transparent);
  outline: none;
}

.search-active-chip svg {
  opacity: 0.75;
}

.search-active-filters-clear {
  border: none;
  background: transparent;
  color: var(--secondary, var(--primary-start));
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0;
  white-space: nowrap;
}

.search-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin: 0.15rem 0 1rem;
}

.search-results-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.search-results-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary, var(--primary-start));
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.search-results-count {
  font-weight: 800;
}

.search-results-query {
  font-weight: 650;
  color: var(--text);
}

.search-results-progress {
  height: 2px;
  border-radius: 999px;
  margin-top: 0.45rem;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
  transform-origin: inline-start;
  animation: search-progress 1.1s ease-in-out infinite;
}

.search-results-progress[hidden] {
  display: none !important;
}

.search-body.is-loading .search-results-progress {
  display: block;
}

@media (min-width: 900px) {
  .search-filters-desktop {
    display: block;
  }
}

.search-empty {
  margin: 1.25rem 0 0;
  color: var(--text-muted);
  text-align: center;
}

.search-load-more {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

.search-load-more-btn {
  min-height: 44px;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  border: 0.5px solid var(--surface-variant, var(--glass-border));
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.search-load-more-btn:hover,
.search-load-more-btn:focus-visible {
  border-color: color-mix(in srgb, var(--primary-start) 40%, var(--surface-variant));
  outline: none;
}

.search-load-more-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

@keyframes search-progress {
  0% { opacity: 0.35; transform: scaleX(0.25); }
  50% { opacity: 1; transform: scaleX(0.85); }
  100% { opacity: 0.35; transform: scaleX(0.25); }
}

.search-filters-dialog {
  width: min(100vw, 28rem);
  max-width: 100%;
  height: auto;
  max-height: min(88vh, 40rem);
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  z-index: 400;
}

.search-filters-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.search-filters-sheet {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 40rem);
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--surface-variant, var(--glass-border)) 90%, transparent);
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.search-filters-handle {
  display: none;
  width: 42px;
  height: 4px;
  margin: 0.65rem auto 0.1rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-variant, var(--glass-border)) 85%, transparent);
}

.search-filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 0 0 auto;
  padding: 0.85rem 0.85rem 0.75rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--surface-variant) 70%, transparent);
  background: var(--bg);
}

.search-filters-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 750;
}

.search-filters-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--bg);
}

.search-filter-section h3 {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: none;
}

.search-chip-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
}

.search-chip-row--wrap {
  flex-wrap: wrap;
  overflow: visible;
}

.search-select-field,
.search-year-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.search-select-field select,
.search-year-field input {
  width: 100%;
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--surface-variant, var(--glass-border)) 85%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, var(--bg));
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding-inline: 0.9rem 2.25rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  cursor: pointer;
}

.search-year-field input {
  padding-inline: 0.9rem;
  background-image: none;
  cursor: text;
}

html[dir="rtl"] .search-select-field select {
  background-position: left 0.85rem center;
  padding-inline: 2.25rem 0.9rem;
}

.search-filters-footer {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 0.65rem;
  flex: 0 0 auto;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid color-mix(in srgb, var(--surface-variant) 70%, transparent);
  background: var(--bg);
}

.search-filters-footer--stack {
  grid-template-columns: 1fr;
  gap: 0.45rem;
  text-align: center;
}

.search-filters-head--mobile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.search-filters-head--mobile h2 {
  text-align: center;
  justify-self: center;
}

.search-filters-head-clear {
  border: none;
  background: transparent;
  color: var(--secondary, var(--primary-start));
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0;
  white-space: nowrap;
}

.search-filters-head-clear:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.search-filters-clear,
.search-filters-apply {
  min-height: 48px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.search-filters-clear {
  border: 1px solid color-mix(in srgb, var(--surface-variant, var(--glass-border)) 85%, transparent);
  background: color-mix(in srgb, var(--surface) 55%, var(--bg));
  color: var(--text);
}

.search-filters-clear:disabled,
.search-filters-clear-link:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.search-filters-apply {
  border: none;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
  color: #fff;
  width: 100%;
}

.search-filters-clear-link {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  padding: 0.35rem 0.25rem;
}

.search-filters-clear-link:hover:not(:disabled),
.search-filters-clear-link:focus-visible:not(:disabled) {
  color: var(--secondary, var(--primary-start));
  outline: none;
}

body.search-filters-open,
body.search-genre-modal-open {
  overflow: hidden;
}

.search-genre-modal {
  width: min(100vw - 1.5rem, 40rem);
  max-width: 100%;
  height: auto;
  max-height: min(88vh, 36rem);
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  z-index: 420;
}

.search-genre-modal::backdrop {
  background: rgba(0, 0, 0, 0.66);
}

.search-genre-modal-sheet {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 36rem);
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--surface-variant, var(--glass-border)) 90%, transparent);
  background: color-mix(in srgb, var(--bg) 94%, #111);
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5);
}

.search-genre-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 0 0 auto;
  padding: 0.95rem 0.95rem 0.75rem 1.05rem;
}

.search-genre-modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
}

.search-genre-modal-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 1rem 0.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--surface-variant, var(--glass-border)) 85%, transparent);
  background: color-mix(in srgb, var(--surface) 45%, var(--bg));
  color: var(--text-muted);
}

.search-genre-modal-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
}

.search-genre-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.15rem 1rem 1rem;
}

.search-genre-modal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.search-genre-modal-grid .search-filter-chip {
  width: 100%;
  white-space: normal;
  text-align: center;
  min-height: 40px;
}

.search-genre-modal-empty {
  margin: 1.5rem 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-genre-modal-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid color-mix(in srgb, var(--surface-variant) 70%, transparent);
}

.search-genre-modal-clear {
  border: none;
  background: transparent;
  color: var(--secondary, var(--primary-start));
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0;
  white-space: nowrap;
}

.search-genre-modal-count {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 650;
}

.search-genre-modal-apply {
  min-height: 42px;
  min-width: 5.5rem;
  padding: 0.45rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

@media (max-width: 640px) {
  .search-genre-modal {
    width: 100vw;
    max-width: 100vw;
    max-height: min(92vh, 48rem);
    margin: auto 0 0;
  }

  .search-genre-modal-sheet {
    border-radius: 18px 18px 0 0;
    max-height: min(92vh, 48rem);
    height: min(92vh, 48rem);
  }

  .search-genre-modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-genre-modal-footer {
    grid-template-columns: 1fr;
    justify-items: stretch;
    text-align: center;
  }

  .search-genre-modal-apply {
    width: 100%;
    order: -1;
  }
}

@media (max-width: 899px) {
  .search-filters-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: min(92vh, 56rem);
    margin: auto 0 0;
    border-radius: 0;
  }

  .search-filters-handle {
    display: block;
  }

  .search-filters-sheet {
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    max-height: min(92vh, 56rem);
    height: min(92vh, 56rem);
  }

  .search-filters-footer {
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  }
}

.mkt-search-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.35rem;
  padding: 0.45rem;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
}

.mkt-search-field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-inline: 0.85rem;
  color: var(--text-muted);
}

.mkt-search-field input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}

.mkt-search-field input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.mkt-search-bar select {
  flex: 0 0 auto;
  height: 46px;
  max-width: 11rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background-color: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text);
  font: inherit;
  padding-inline: 0.85rem 2rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  cursor: pointer;
}

html[dir="rtl"] .mkt-search-bar select {
  background-position: left 0.7rem center;
}

.mkt-search-bar button {
  flex: 0 0 auto;
  height: 46px;
  border: none;
  border-radius: 12px;
  padding: 0 1.2rem;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.mkt-catalog-body {
  padding-bottom: 3rem;
}

.mkt-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 1.35rem 1rem;
  align-items: stretch;
}

.mkt-catalog-grid .home-shelf-card {
  width: 100%;
}

.mkt-catalog-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  background: transparent;
  border: none;
  overflow: hidden;
  transition: transform 0.18s var(--ease, ease);
}

.mkt-catalog-card:hover {
  transform: translateY(-2px);
}

.mkt-catalog-poster {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--surface-variant);
  overflow: hidden;
  border-radius: 8px;
}

.mkt-catalog-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mkt-catalog-type {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 1;
  max-width: calc(55% - 12px);
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mkt-catalog-rating {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.mkt-catalog-rating span {
  color: #f5c518;
  font-size: 0.85rem;
}

.mkt-catalog-countdown {
  position: absolute;
  inset-inline: 8px;
  bottom: 8px;
  z-index: 1;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.mkt-catalog-copy {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  padding: 0.65rem 0.1rem 0.15rem;
}

.mkt-catalog-title {
  margin: 0;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mkt-catalog-desc {
  margin: 0;
  min-width: 0;
  min-height: 2.6em;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
  text-align: start;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .search-genre-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

  .search-results-head {
    align-items: stretch;
  }

  .mkt-search-bar {
    flex-wrap: wrap;
  }

  .mkt-search-field {
    flex: 1 1 100%;
  }

  .mkt-search-bar select {
    flex: 1 1 calc(50% - 0.4rem);
    max-width: none;
    min-width: 0;
  }

  .mkt-search-bar button {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-results-progress,
  .mkt-catalog-card {
    animation: none;
    transition: none;
  }
}

/* Detail — cinematic series page */
.detail-page .ambient {
  display: none;
}

.detail-hero {
  position: relative;
  min-height: clamp(520px, 68vh, 640px);
  display: flex;
  align-items: flex-end;
  padding-top: var(--header-h);
  color: #fff;
  overflow: hidden;
  background: #0a0a0f;
}

.detail-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.detail-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 8%, transparent 21%),
    linear-gradient(to bottom, rgba(10, 10, 15, 0.55) 0%, transparent 22%),
    linear-gradient(to right, rgba(10, 10, 15, 0.94) 0%, rgba(10, 10, 15, 0.78) 24%, rgba(10, 10, 15, 0.28) 52%, rgba(10, 10, 15, 0) 74%);
}

html[dir="rtl"] .detail-hero-shade {
  background:
    linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 8%, transparent 21%),
    linear-gradient(to bottom, rgba(10, 10, 15, 0.55) 0%, transparent 22%),
    linear-gradient(to left, rgba(10, 10, 15, 0.94) 0%, rgba(10, 10, 15, 0.78) 24%, rgba(10, 10, 15, 0.28) 52%, rgba(10, 10, 15, 0) 74%);
}

.detail-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 1.75rem 2rem;
  padding-bottom: 6rem;
}

.detail-hero-inner.has-poster {
  justify-content: flex-start;
}

.detail-hero-copy {
  flex: 1 1 18rem;
  max-width: 40rem;
  min-width: 0;
}

.detail-hero-poster {
  flex: 0 0 auto;
  width: clamp(148px, 18vw, 220px);
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
}

.detail-hero-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.detail-kicker {
  margin: 0 0 0.65rem;
  color: #ff8ac4;
  font-size: 0.95rem;
  font-weight: 700;
}

.detail-countdown {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.85rem;
  margin: 0 0 0.85rem;
  color: #ff8ac4;
  font-variant-numeric: tabular-nums;
}

.detail-countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  min-width: 2.1rem;
}

.detail-countdown-unit[hidden] {
  display: none;
}

.detail-countdown-num {
  color: #ff8ac4;
  font-size: 1.15rem;
  font-weight: 800;
}

.detail-countdown.has-days .detail-countdown-num {
  font-size: 1.05rem;
}

.detail-countdown-label {
  color: rgba(255, 138, 196, 0.88);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
}

.detail-hero .detail-title {
  margin: 0;
  max-width: 18em;
  color: #fff;
  font-family: var(--font);
  font-size: clamp(2.35rem, 4.4vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}

.detail-alt {
  margin: 0.45rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.05rem;
  font-weight: 500;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0;
  margin: 1rem 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.95rem;
  font-weight: 500;
}

.detail-meta > .detail-sep:first-child {
  display: none;
}

.detail-sep {
  width: 3px;
  height: 3px;
  margin: 0 0.6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.detail-age {
  display: inline-grid;
  place-items: center;
  min-width: 1.85rem;
  height: 1.35rem;
  margin-inline-end: 0.15rem;
  padding: 0 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.detail-meta-genres {
  display: inline;
}

.detail-scoreline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.9rem 0 0;
  color: rgba(255, 255, 255, 0.92);
}

.detail-stars {
  width: 108px;
  height: 18px;
  display: block;
  color: rgba(255, 255, 255, 0.28);
  flex: 0 0 auto;
}

.detail-stars-fill {
  clip-path: inset(0 calc((10 - var(--score)) * 10%) 0 0);
}

.detail-score {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.detail-score-of {
  margin-inline-start: 0.1rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}

.detail-score-votes {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.detail-score-votes::before {
  content: "·";
  margin-inline: 0.45rem;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 400;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.detail-play {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 48px;
  padding: 0 1.25rem 0 1.05rem;
  border-radius: 8px;
  background: var(--primary-start);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.detail-play:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.detail-play svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.detail-play-ep {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.detail-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.15s ease;
}

.detail-icon:hover {
  background: rgba(255, 255, 255, 0.16);
}

.detail-icon svg {
  width: 20px;
  height: 20px;
  fill: rgba(255, 255, 255, 0.12);
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.detail-page-content {
  padding: 2.5rem 0 5rem;
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 4rem;
  align-items: start;
}

.detail-main {
  min-width: 0;
}

.detail-block-title {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

html[lang="fa"] .detail-block-title {
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
}

.detail-sheet {
  max-width: 46rem;
}

.detail-synopsis {
  margin: 0;
  color: color-mix(in srgb, var(--text) 90%, var(--text-muted));
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.8;
  white-space: pre-line;
}

.detail-sheet:not(.is-open) .detail-synopsis {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.7rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary-start);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  cursor: pointer;
}

.detail-more[hidden] {
  display: none;
}

.detail-more svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.detail-sheet.is-open .detail-more svg {
  transform: rotate(180deg);
}

.detail-aside {
  position: sticky;
  top: calc(var(--header-h) + 0.5rem);
}

.detail-facts {
  margin: 0;
}

.detail-facts div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--outline);
}

.detail-facts div:first-child {
  border-top: 1px solid var(--outline);
}

.detail-facts dt {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 450;
}

.detail-facts dd {
  margin: 0;
  text-align: end;
  font-size: 0.95rem;
  font-weight: 600;
}

.detail-episodes {
  margin-top: 3rem;
}

.detail-sheet + .detail-episodes {
  margin-top: 3rem;
}

.detail-page .season-row {
  display: flex;
  gap: 1.75rem;
  margin: 0 0 1.5rem;
  padding: 0;
  border-bottom: 1px solid var(--outline);
  overflow-x: auto;
  scrollbar-width: none;
}

.detail-page .season-chip {
  flex: 0 0 auto;
  padding: 0.5rem 0 0.9rem;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 0.15s ease;
}

.detail-page .season-chip:hover {
  color: var(--text);
}

.detail-page .season-chip.active {
  color: var(--text);
  background: none;
  border-bottom-color: var(--primary-start);
}

.detail-page .episode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-page .episode-grid a.episode-row {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text);
  text-align: start;
  text-decoration: none;
}

.episode-still {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(255, 61, 154, 0.28), transparent 60%),
    radial-gradient(80% 100% at 0% 100%, rgba(123, 97, 255, 0.22), transparent 60%),
    #17171f;
}

.episode-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.episode-still-poster {
  filter: brightness(0.58) saturate(0.9);
  transform: scale(1.08);
}

.detail-episode-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.detail-episode-summary .detail-sep {
  background: var(--text-muted);
}

.detail-page .episode-row:hover .episode-still img {
  transform: scale(1.04);
}

.episode-still-num {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.episode-still-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.episode-still-play svg {
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 50%;
  background: var(--primary-start);
  fill: #fff;
}

.detail-page .episode-row:hover .episode-still-play,
.detail-page .episode-row:focus-visible .episode-still-play {
  opacity: 1;
}

.detail-page .episode-row:focus-visible {
  outline: 2px solid var(--primary-start);
  outline-offset: 4px;
  border-radius: 8px;
}

.episode-still-time {
  position: absolute;
  inset-inline-end: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  z-index: 1;
}

.episode-still.has-progress .episode-still-time {
  bottom: 10px;
}

.episode-still-done {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--primary-start);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.episode-still-done svg {
  width: 0.95rem;
  height: 0.95rem;
}

.episode-still-progress {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
  z-index: 1;
}

.episode-still-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
}

.episode-copy {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.75rem;
}

.episode-watch-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.episode-watch-position,
.episode-watch-amount {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.episode-watch-meta .detail-sep {
  background: var(--text-muted);
}

.episode-row.is-watched .episode-name {
  color: var(--text-muted);
}

.episode-name {
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.episode-blurb {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-rate-dialog {
  width: min(420px, calc(100vw - 2rem));
  max-width: min(420px, calc(100vw - 2rem));
}

.detail-rate-scrub {
  margin: 1.15rem 0 1.25rem;
  user-select: none;
  -webkit-user-select: none;
}

.detail-rate-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  min-height: 3.5rem;
}

.detail-rate-react {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  font-size: 2.35rem;
  line-height: 1;
  transform-origin: center;
}

.detail-rate-react.is-pop {
  animation: detail-rate-pop 0.28s ease;
}

.detail-rate-value {
  color: var(--text);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.detail-rate-track {
  outline: none;
}

.detail-rate-track:focus-visible .detail-rate-rail {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-start) 55%, transparent);
}

.detail-rate-rail {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.15rem;
  min-height: 3rem;
  padding: 0.35rem 0.2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--glass-border);
  touch-action: none;
  cursor: grab;
}

.detail-rate-rail.is-dragging {
  cursor: grabbing;
}

.detail-rate-tick {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 1 1 0;
  min-width: 0;
  height: 2.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: inherit;
  transition: color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.detail-rate-tick.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  transform: scale(1.12);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary-start) 38%, transparent);
}

@keyframes detail-rate-pop {
  0% { transform: scale(0.82); }
  55% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .detail-rate-react.is-pop {
    animation: none;
  }

  .detail-rate-tick {
    transition: none;
  }
}

@media (max-width: 960px) {
  .detail-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .detail-aside {
    position: static;
  }
}

@media (max-width: 800px) {
  .detail-hero {
    min-height: 560px;
  }

  .detail-hero-shade,
  html[dir="rtl"] .detail-hero-shade {
    background:
      linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 10%, transparent 24%),
      linear-gradient(to bottom, rgba(10, 10, 15, 0.45), transparent 18%),
      linear-gradient(to top, rgba(10, 10, 15, 0.5), rgba(10, 10, 15, 0.1) 70%);
  }

  .detail-hero .detail-title {
    font-size: 2.15rem;
  }

  .detail-hero-inner {
    padding-bottom: 4.5rem;
  }

  .detail-hero-poster {
    width: clamp(120px, 34vw, 156px);
  }

  .detail-page-content {
    padding-top: 1.75rem;
  }
}

@media (max-width: 560px) {
  .detail-hero-inner.has-poster {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 1.25rem;
  }

  .detail-hero-poster {
    width: min(42vw, 148px);
    align-self: flex-start;
  }

  .detail-page .episode-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .detail-play,
  .episode-still img,
  .episode-still-play {
    transition: none;
  }
}

.detail-deviation {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--secondary) 35%, var(--outline));
  background: color-mix(in srgb, var(--secondary) 12%, var(--surface));
}

.detail-deviation-status {
  margin: 0;
  font-weight: 650;
}

.detail-deviation-note {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.detail-other-names {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-line;
}

.detail-facts-genres a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.detail-facts-genres a:hover,
.detail-facts-genres a:focus-visible {
  color: var(--primary-start);
  text-decoration: underline;
}

.detail-icon.is-active svg path {
  fill: var(--primary-start);
  stroke: none;
}

.detail-icon--rated {
  width: auto;
  min-width: 48px;
  padding-inline: 0.65rem;
  gap: 0.25rem;
}

.detail-icon-score {
  font-size: 0.82rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.detail-rate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.detail-share-url {
  margin: 0.75rem 0 1rem;
  word-break: break-all;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.detail-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.mkt-catalog-filter {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.mkt-catalog-filter-clear {
  margin-inline-start: 0.75rem;
  color: var(--primary-start);
  font-weight: 650;
  text-decoration: none;
}

.detail-watch-cta {
  margin-top: 1.25rem;
}

.detail-section-title {
  font-size: 1.35rem;
  margin-top: 2rem;
}

.detail-section-title--episodes {
  font-size: 1.25rem;
  margin-top: 1.5rem;
}

.episode-grid a.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: #fff;
}

@media (max-width: 900px) {
  .mkt-hero-inner {
    grid-template-columns: 1fr;
  }

  .mkt-hero-device {
    justify-self: center;
    max-width: min(100%, 640px);
  }

  .mkt-devices {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .mkt-poster-grid,
  .mkt-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phone header: brand + actions must fit inside the viewport (EN and FA) */
@media (max-width: 560px) {
  .appbar {
    gap: 0.5rem;
    padding-inline: 0.85rem;
  }

  .appbar-brand {
    padding-inline-end: 0;
  }

  .appbar-brand .brand-name {
    font-size: 1.3rem;
  }

  .appbar-actions {
    gap: 0.4rem;
  }

  .appbar-actions .btn-sm {
    padding-inline: 0.8rem;
    white-space: nowrap;
  }

  .lang-btn {
    padding: 0.35rem 0.55rem;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }
}

/* The closed mobile drawer sits off-screen; keep it from widening the page (RTL). */
@media (max-width: 899px) {
  .header {
    overflow: visible;
  }
}

/* ——— Home ——— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.home-page { background: var(--bg); }

.home-page .header:not(.scrolled) .appbar-brand .brand-name,
.home-page .header:not(.scrolled) .nav-links a,
.home-page .header:not(.scrolled) .nav-quiet,
.home-page .header:not(.scrolled) .theme-toggle,
.home-page .header:not(.scrolled) .appbar-icon,
.home-page .header:not(.scrolled) .appbar-subscribe,
.home-page .header:not(.scrolled) .appbar-login,
.home-page .header:not(.scrolled) .lang-btn,
.home-page .header:not(.scrolled) .nav-toggle span {
  color: #fff;
  -webkit-text-fill-color: #fff;
}

.home-page .header:not(.scrolled) .appbar-icon:hover,
.home-page .header:not(.scrolled) .appbar-icon:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.home-page .header:not(.scrolled) .appbar-login {
  background: rgba(255, 255, 255, 0.2);
}

.home-page .header:not(.scrolled) .nav-links a.is-active,
.home-page .header:not(.scrolled) .nav-links a:hover {
  color: #ff8ac4;
  -webkit-text-fill-color: #ff8ac4;
}

.home-page .header:not(.scrolled) .nav-toggle {
  background: transparent;
  border-color: transparent;
}

.home-page .header:not(.scrolled) .nav-toggle span {
  background: #fff;
}

/* Home dashboard shelves (after cinema reel) */
.home-dashboard {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem 0 1.5rem;
}

.home-shelf {
  --home-shelf-gutter: clamp(1rem, 4vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.home-shelf-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-inline: var(--home-shelf-gutter);
}

.home-shelf-head-copy {
  min-width: 0;
}

.home-shelf-heading {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.home-shelf-sub {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.home-shelf-viewall {
  flex-shrink: 0;
  color: var(--primary-start, #ff3d9a);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.home-shelf-viewall:hover {
  text-decoration: underline;
}

.home-shelf-track {
  display: flex;
  /* No gap: edge gutters + inter-item spacing use margins so overflow
     rows keep the same start inset as .home-shelf-head (LTR and RTL). */
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-inline: 0;
  padding-block: 0.15rem 0.35rem;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--home-shelf-gutter);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.home-shelf-track::-webkit-scrollbar {
  display: none;
}

.home-shelf-item {
  flex: 0 0 auto;
  width: min(168px, 44vw);
  scroll-snap-align: start;
  margin-inline-end: 0.85rem;
}

.home-shelf-item:first-child {
  margin-inline-start: var(--home-shelf-gutter);
}

.home-shelf-item:last-child {
  margin-inline-end: var(--home-shelf-gutter);
}

.home-shelf-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.home-shelf-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-variant, #1a1a22);
}

.home-shelf-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.22s ease;
}

.home-shelf-badge {
  position: absolute;
  top: 7px;
  z-index: 2;
  max-width: calc(52% - 8px);
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.home-shelf-badge-rating {
  inset-inline-start: 7px;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: #fff;
  background: rgba(10, 10, 16, 0.72);
  backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}

.home-shelf-badge-rating span {
  color: #f5c518;
}

.home-shelf-badge-stack {
  position: absolute;
  top: 7px;
  inset-inline-end: 7px;
  z-index: 2;
  display: flex;
  flex-flow: row wrap;
  justify-content: flex-end;
  align-items: center;
  column-gap: 0.2rem;
  row-gap: 0.22rem;
  /* Keep clear of the rating pill; still wide enough for type+status
     on one line at mobile shelf card widths (~148px). */
  max-width: calc(100% - 2.35rem);
  pointer-events: none;
}

.home-shelf-badge-stack .home-shelf-badge {
  position: static;
  top: auto;
  inset-inline: auto;
  flex: 0 0 auto;
  max-width: none;
  padding: 0.12rem 0.34rem;
  font-size: 0.56rem;
}

.home-shelf-badge-type {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
}

.home-shelf-badge-status {
  color: #fff;
  background: rgba(10, 10, 16, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.home-shelf-scrim {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.28) 55%, transparent 100%);
  transition: opacity 0.22s ease;
}

.home-shelf-card:not(.has-time) .home-shelf-scrim {
  height: 28%;
  opacity: 0.55;
}

/* Time block: hours/minutes/seconds; days column only when days > 0. */
.home-shelf-time {
  position: absolute;
  inset-inline: 0.35rem;
  bottom: 0.45rem;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.12rem;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.home-shelf-time-unit {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
  min-width: 0;
}

.home-shelf-time-unit[hidden] {
  display: none;
}

.home-shelf-time.has-days .home-shelf-time-num {
  font-size: 1.02rem;
}

.home-shelf-time-num,
.detail-countdown-num {
  display: inline-block;
  min-width: 1.25em;
  overflow: hidden;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  text-align: center;
  will-change: transform, opacity;
}

.home-shelf-time-num {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

[data-countdown-seconds] .is-count-up {
  animation: cd-count-up 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cd-count-up {
  from {
    transform: translateY(70%);
    opacity: 0.05;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-countdown-seconds] .is-count-up {
    animation: none;
  }
}

.home-shelf-time-label {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.home-shelf-hover-copy {
  position: absolute;
  inset: 0;
  z-index: 3;
  margin: 0;
  padding: 0.85rem 0.7rem;
  display: flex;
  align-items: flex-end;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.55;
  text-align: start;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  background: linear-gradient(
    to top,
    rgba(8, 6, 12, 0.94) 0%,
    rgba(8, 6, 12, 0.74) 52%,
    rgba(8, 6, 12, 0.16) 100%
  );
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.home-shelf-copy {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.home-shelf-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-shelf-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.home-shelf-meta-sep {
  opacity: 0.55;
}

.home-shelf-type-text {
  color: var(--text-muted);
}

.home-shelf-score {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.home-shelf-score span {
  color: #f5c518;
}

@media (hover: hover) {
  .home-shelf-card.has-details:hover .home-shelf-poster img,
  .home-shelf-card.has-details:focus-visible .home-shelf-poster img {
    transform: scale(1.04);
  }

  .home-shelf-card.has-details:hover .home-shelf-hover-copy,
  .home-shelf-card.has-details:focus-visible .home-shelf-hover-copy {
    opacity: 1;
    transform: translateY(0);
  }

  .home-shelf-card.has-details:hover .home-shelf-time,
  .home-shelf-card.has-details:focus-visible .home-shelf-time {
    opacity: 0;
    transform: translateY(6px);
  }

  .home-shelf-card.has-details:hover .home-shelf-scrim,
  .home-shelf-card.has-details:focus-visible .home-shelf-scrim,
  .home-shelf-card.has-details:hover .home-shelf-badge,
  .home-shelf-card.has-details:focus-visible .home-shelf-badge {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-shelf-poster img,
  .home-shelf-hover-copy,
  .home-shelf-time,
  .home-shelf-scrim,
  .home-shelf-badge {
    transition: none;
  }

  .home-shelf-hover-copy {
    transform: none;
  }

  .home-shelf-card.has-details:hover .home-shelf-poster img,
  .home-shelf-card.has-details:focus-visible .home-shelf-poster img {
    transform: none;
  }

  .home-shelf-card.has-details:hover .home-shelf-time,
  .home-shelf-card.has-details:focus-visible .home-shelf-time {
    transform: none;
  }
}

.home-shelf-item--more {
  align-self: stretch;
  display: flex;
}

.home-shelf-more-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 100%;
  padding: 1rem 0.75rem;
  border-radius: 8px;
  border: 1px dashed color-mix(in srgb, var(--outline) 70%, transparent);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.home-shelf-more-tile:hover,
.home-shelf-more-tile:focus-visible {
  color: var(--text);
  border-color: var(--primary-start, #ff3d9a);
}

.home-shelf-more-arrow {
  font-size: 1.1rem;
  line-height: 1;
}

html[dir="rtl"] .home-shelf-more-arrow {
  transform: scaleX(-1);
}

.home-shelf-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  padding-inline: var(--home-shelf-gutter);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.home-shelf-empty-link {
  color: var(--primary-start, #ff3d9a);
  font-weight: 600;
  text-decoration: none;
}

.home-shelf-empty-link:hover {
  text-decoration: underline;
}

@media (max-width: 899px) {
  .home-dashboard {
    gap: 1.65rem;
    padding-block: 1.5rem 1rem;
  }

  .home-shelf-item {
    width: min(148px, 40vw);
  }

  .home-shelf-time-num {
    font-size: 1.02rem;
  }
}

.airing-day-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0 0 1.25rem;
  margin-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.airing-day-chip {
  flex: 0 0 auto;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--outline) 70%, transparent);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.airing-day-chip:hover,
.airing-day-chip:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--primary-start) 50%, transparent);
}

.airing-day-chip.is-selected {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
}

.home-browse-empty {
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

.home-browse-more {
  display: flex;
  justify-content: center;
  padding: 1.75rem 0 0.5rem;
}

.home-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: calc(var(--header-h) + 3rem) 1.25rem 0;
  overflow: hidden;
}

.home-hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(42% 36% at 12% 18%, rgba(255, 61, 154, 0.28), transparent 70%),
    radial-gradient(38% 40% at 88% 8%, rgba(123, 97, 255, 0.32), transparent 72%);
}

.home-hero-copy {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-hero-tag {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.home-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 750;
  max-width: 12em;
}

html[lang="fa"] .home-hero-title {
  font-family: var(--font-fa);
  letter-spacing: 0;
  line-height: 1.25;
  font-weight: 700;
}

.home-hero-accent {
  background: linear-gradient(100deg, var(--primary-start), #9aa6ff 55%, var(--primary-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.home-hero-desc {
  margin: 1.25rem 0 0;
  max-width: 46ch;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.85rem 1.25rem;
  margin-top: 1.6rem;
}

.home-text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
}

.home-text-link:hover { color: var(--primary-start); }

html[dir="rtl"] .home-text-link span[aria-hidden="true"] {
  display: inline-block;
  transform: scaleX(-1);
}

.home-hero-platforms {
  display: flex;
  gap: 1.25rem;
  margin: 1.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.fan {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0.5rem 0 1.75rem;
  overflow-x: clip;
  overflow-y: visible;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--primary-start) 14%, transparent) 0%,
    transparent 68%
  );
}

.fan-stage {
  position: relative;
  width: min(1100px, 100%);
  margin: 0 auto;
  touch-action: pan-y;
  cursor: grab;
  outline: none;
}

.fan-stage.is-dragging { cursor: grabbing; }

.fan-card,
.fan-slot {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
}

.fan-slot {
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  background: #14141c;
}

.fan-slot img,
.fan-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.fan-slot-shade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0.45;
}

.fan-image,
.fan-ghost,
.fan-border,
.fan-shadow {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  pointer-events: none;
}

.fan-image {
  overflow: hidden;
  background: #14141c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.fan-overlay {
  position: absolute;
  inset: 0;
  background: #000;
}

.fan-ghost {
  border: 1px solid color-mix(in srgb, var(--text) 40%, transparent);
  opacity: 0;
}

.fan-border {
  border: 2.5px solid var(--primary-start);
  opacity: 0;
}

.fan-shadow {
  z-index: -1;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.fan-info {
  position: relative;
  z-index: 5;
  margin: 0.25rem auto 0;
  padding: 0 1.25rem 0.5rem;
  text-align: center;
}

.fan-count {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.fan-title {
  margin: 0.35rem auto 0;
  max-width: 22ch;
  min-height: 1.3em;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.fan.is-fa .fan-title {
  font-family: var(--font-fa);
  font-weight: 600;
  letter-spacing: 0;
}

.fan-meta {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.fan-watch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 0.35rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.fan-watch:hover { color: var(--primary-start); }

html[lang="fa"] .fan-count { letter-spacing: 0; }

.home-marquee {
  overflow: hidden;
  direction: ltr;
  border-block: 1px solid color-mix(in srgb, var(--outline) 70%, transparent);
  padding: 0.85rem 0;
}

.home-marquee-track {
  display: flex;
  direction: ltr;
  gap: 0.85rem;
  width: max-content;
  animation: home-marquee-left 36s linear infinite;
  color: var(--text);
  font-weight: 650;
  font-size: 0.95rem;
}

.home-marquee-track i {
  color: var(--primary-start);
  font-style: normal;
}

html[lang="fa"] .home-marquee-track { letter-spacing: 0; font-weight: 600; }

@keyframes home-marquee-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

html[dir="rtl"] .home-marquee-track {
  animation-name: home-marquee-right;
}

@keyframes home-marquee-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .home-marquee-track { animation: none; }
}

.home-scenes {
  width: min(1160px, calc(100% - 2.5rem));
  margin: 4.5rem auto 1rem;
}

.home-scenes-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 1.25rem;
  align-items: stretch;
}

.home-scene img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.home-scene-airing { object-position: center 78%; }
.home-scene-latest { object-position: center 70%; height: 320px; }

.home-scene-copy h2 {
  margin: 0.9rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

html[lang="fa"] .home-scene-copy h2,
html[lang="fa"] .home-app h3,
html[lang="fa"] .home-install h2,
html[lang="fa"] .home-faq h1,
html[lang="fa"] .home-faq h2,
html[lang="fa"] .home-platforms-head h2 {
  font-family: var(--font-fa);
  letter-spacing: 0;
}

.home-scene-copy p,
.home-bridge,
.home-install-lead,
.home-install-note,
.home-faq p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.home-bridge {
  margin: 2.5rem auto 0;
  max-width: 36ch;
  text-align: center;
  font-size: 1.15rem;
  color: var(--text);
}

.home-apps {
  width: min(1160px, calc(100% - 2.5rem));
  margin: 4rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.home-app {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.home-app img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.home-app-kicker {
  margin: 0 0 0.45rem;
  color: var(--primary-start);
  font-size: 0.82rem;
}

.home-app h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
}

.home-app ul {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
}

.home-app li { margin: 0.35rem 0; }

.home-app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.home-install {
  width: min(1100px, calc(100% - 2.5rem));
  margin: 4.5rem auto;
}

.home-install h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.home-install-lead { margin-top: 0.75rem; max-width: 46ch; }

.home-install-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.home-install h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.home-install-cols p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.home-install-cols a,
.home-app li a {
  color: var(--text);
  text-decoration: none;
}

.home-install-cols a:hover,
.home-app li a:hover {
  color: var(--primary-start);
}

html[lang="fa"] .home-install h3 {
  font-family: var(--font-fa);
  letter-spacing: 0;
}

.home-faq {
  position: relative;
  width: min(760px, calc(100% - 2rem));
  margin: 3.5rem auto 4rem;
  isolation: isolate;
  /* Decorative glow uses negative insets; clip so it cannot widen the page. */
  overflow-x: clip;
}

.home-faq-glow {
  position: absolute;
  inset: -12% -18% auto;
  height: 18rem;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 70% at 70% 40%, color-mix(in srgb, var(--primary-start) 18%, transparent), transparent 70%),
    radial-gradient(ellipse 50% 65% at 25% 55%, color-mix(in srgb, var(--primary-end) 16%, transparent), transparent 72%);
  opacity: 0.9;
}

.home-faq-inner {
  position: relative;
  z-index: 1;
}

.home-faq-head {
  text-align: center;
  margin: 0 auto 1.5rem;
  max-width: 36rem;
}

.home-faq-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  color: var(--primary-start);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-faq-label span {
  display: block;
  width: 2.25rem;
  height: 1px;
  background: color-mix(in srgb, var(--primary-start) 55%, transparent);
}

.home-faq-head h1,
.home-faq-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.2vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(180deg, #fff 18%, color-mix(in srgb, var(--primary-start) 72%, #fff) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[lang="fa"] .home-faq-head h1,
html[lang="fa"] .home-faq-head h2 {
  font-family: var(--font-fa);
  letter-spacing: 0;
}

.home-faq-sub {
  margin: 0.75rem auto 0;
  max-width: 34rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.home-faq-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 0 1.35rem;
  min-height: 52px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary-end) 28%, var(--outline));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary-start) 6%, transparent);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.home-faq-search:focus-within {
  border-color: color-mix(in srgb, var(--primary-start) 55%, var(--outline));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-start) 18%, transparent);
}

.home-faq-search-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.home-faq-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  margin: 0;
  padding: 0 0.25rem 0 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}

html[dir="rtl"] .home-faq-search-input {
  padding: 0 0 0 0.25rem;
}

.home-faq-search-input::placeholder {
  color: var(--text-muted);
}

.home-faq-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.home-faq-search-clear {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  margin-inline-end: 0.35rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.home-faq-search-clear:hover,
.home-faq-search-clear:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-variant) 55%, transparent);
  outline: none;
}

.home-faq-search-clear[hidden] {
  display: none;
}

.home-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-faq-item {
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--outline) 88%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.home-faq-item:hover {
  border-color: color-mix(in srgb, var(--primary-start) 28%, var(--outline));
}

.home-faq-item[open] {
  border-color: color-mix(in srgb, var(--primary-start) 55%, var(--outline));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary-start) 18%, transparent),
    0 10px 28px color-mix(in srgb, var(--primary-start) 10%, transparent);
}

.home-faq-item[hidden],
.home-faq-item.is-search-hidden {
  display: none;
}

.home-faq-item summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 3.5rem;
  padding: 0.95rem 1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 650;
  line-height: 1.45;
}

.home-faq-item summary::-webkit-details-marker {
  display: none;
}

.home-faq-item-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary-start) 12%, var(--surface));
  color: var(--primary-start);
}

.home-faq-item-icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.home-faq-item-q {
  flex: 1 1 auto;
  min-width: 0;
  text-align: start;
  color: var(--text);
  font-size: 0.98rem;
}

.home-faq-item-toggle {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--outline) 90%, transparent);
  background: color-mix(in srgb, var(--surface-variant) 40%, transparent);
  color: var(--text-muted);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.home-faq-item-toggle-plus,
.home-faq-item-toggle-minus {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  line-height: 0;
}

.home-faq-item-toggle-plus svg,
.home-faq-item-toggle-minus svg {
  display: block;
  width: 1rem;
  height: 1rem;
}

.home-faq-item-toggle-minus {
  opacity: 0;
}

.home-faq-item[open] .home-faq-item-toggle-plus {
  opacity: 0;
}

.home-faq-item[open] .home-faq-item-toggle-minus {
  opacity: 1;
}

[data-theme="light"] .home-faq-head h1,
[data-theme="light"] .home-faq-head h2 {
  background: linear-gradient(
    180deg,
    #16161f 12%,
    color-mix(in srgb, var(--primary-start) 65%, #16161f) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-faq-item[open] .home-faq-item-toggle {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: #fff;
}

.home-faq-item-body {
  padding: 0 1rem 1.05rem 1rem;
  padding-inline-start: calc(1rem + 2.35rem + 0.85rem);
}

.home-faq-item-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 450;
  line-height: 1.7;
}

.home-faq-item-body a {
  color: var(--primary-start);
  text-decoration: none;
}

.home-faq-item-body a:hover {
  text-decoration: underline;
}

.home-faq-empty {
  margin: 1.25rem 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.home-faq-empty[hidden] {
  display: none;
}

.home-faq-more {
  margin-top: 1.5rem;
  text-align: center;
}

.home-faq-show-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--text-muted) 35%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.home-faq-show-all:hover,
.home-faq-show-all:focus-visible {
  border-color: color-mix(in srgb, var(--primary-start) 55%, transparent);
  color: var(--primary-start);
  outline: none;
}

.home-faq-show-all:active {
  opacity: 0.88;
}

.faq-page-main {
  padding: calc(var(--header-h) + 1.5rem) 0 3rem;
}

.faq-page-block {
  margin-top: 0;
}

.home-faq .faq-en { display: none; }
html[lang="en"] .home-faq .faq-fa { display: none; }
html[lang="en"] .home-faq .faq-en { display: block; }
html[lang="en"] .home-faq summary .faq-en { display: inline; }
html[lang="en"] .home-faq-item:not([data-langs~="en"]) { display: none; }
html[lang="fa"] .home-faq-item:not([data-langs~="fa"]) { display: none; }
html[lang="en"] .home-faq-item:not([data-langs~="en"]).is-search-hidden,
html[lang="fa"] .home-faq-item:not([data-langs~="fa"]).is-search-hidden {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .home-faq-item,
  .home-faq-item-toggle,
  .home-faq-search {
    transition: none;
  }
}

@media (max-width: 640px) {
  .home-faq {
    width: min(100% - 1.5rem, 760px);
    margin-top: 2.75rem;
  }

  .home-faq-item summary {
    gap: 0.7rem;
    padding: 0.85rem 0.85rem;
  }

  .home-faq-item-body {
    padding-inline-start: 0.85rem;
    padding-inline-end: 0.85rem;
  }

  .home-faq-item-q {
    font-size: 0.92rem;
  }
}

.home-platforms {
  position: relative;
  width: min(1120px, calc(100% - 2rem));
  margin: 3rem auto 4rem;
  padding: 0.5rem 0 0;
  isolation: isolate;
  overflow-x: clip;
}

.home-platforms-glow {
  position: absolute;
  inset: -10% 5% auto;
  height: 55%;
  background:
    radial-gradient(ellipse 45% 55% at 20% 40%, color-mix(in srgb, var(--primary-start) 18%, transparent), transparent 70%),
    radial-gradient(ellipse 40% 50% at 80% 35%, color-mix(in srgb, var(--primary-end) 16%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.home-platforms-head {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 40rem;
  margin-inline: auto;
}

.home-platforms-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.6vw, 2.55rem);
  letter-spacing: -0.03em;
  line-height: 1.25;
  font-weight: 700;
}

.home-platforms-head .text-grad {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-platforms-sub {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

.home-platforms-perks {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
}

.home-platforms-perks li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  text-align: start;
  max-width: 15rem;
}

.home-platforms-perk-icon {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--primary-start);
  background: color-mix(in srgb, var(--primary-start) 14%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary-start) 28%, transparent);
}

.home-platforms-perks strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.home-platforms-perks li > span > span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.home-platforms-grid {
  --platform-media-h: 13.5rem;
  --platform-media-overlap: 0.85rem;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.35rem;
  padding-top: calc(var(--platform-media-h) - var(--platform-media-overlap));
  align-items: stretch;
}

.platform-card {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  isolation: isolate;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.platform-preview {
  position: absolute;
  z-index: 1;
  inset-inline: 0.75rem;
  top: calc(var(--platform-media-overlap) - var(--platform-media-h));
  height: var(--platform-media-h);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
  pointer-events: none;
}

.platform-preview--android {
  inset-inline: 0.85rem;
  gap: 0;
  max-width: 100%;
}

.platform-phone {
  height: 100%;
  width: min(44%, 128px);
  max-width: 46%;
  aspect-ratio: 9 / 19.5;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, #fff 22%, transparent);
  background: #0a0a0f;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  opacity: 1;
}

.platform-phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 1;
}

.platform-phone--back {
  position: relative;
  height: 92%;
  width: min(40%, 116px);
  max-width: 42%;
  transform: rotate(-5deg);
  transform-origin: bottom center;
  margin-inline-end: -1.15rem;
  z-index: 1;
}

.platform-phone--front {
  position: relative;
  z-index: 2;
  margin-inline-start: 0;
  width: min(46%, 132px);
  max-width: 48%;
}

.platform-laptop,
.platform-browser {
  width: min(100%, 310px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 1;
}

.platform-laptop-screen {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #fff 16%, transparent);
  border-bottom: 0;
  background: #0a0a0f;
  aspect-ratio: 16 / 10;
  max-height: calc(100% - 9px);
}

.platform-laptop-screen img,
.platform-browser-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 1;
}

.platform-laptop-base {
  flex: 0 0 auto;
  height: 8px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #2a2a32, #171721);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

.platform-laptop-base::after {
  content: "";
  display: block;
  width: 28%;
  height: 3px;
  margin: 2px auto 0;
  border-radius: 999px;
  background: color-mix(in srgb, #fff 12%, transparent);
}

.platform-browser {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #fff 16%, transparent);
  background: #0a0a0f;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.platform-browser-chrome {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem;
  background: #14141c;
  border-bottom: 1px solid color-mix(in srgb, #fff 8%, transparent);
}

.platform-browser-chrome > span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, #fff 18%, transparent);
}

.platform-browser-chrome > span:nth-child(1) { background: #ff5f57; }
.platform-browser-chrome > span:nth-child(2) { background: #febc2e; }
.platform-browser-chrome > span:nth-child(3) { background: #28c840; }

.platform-browser-url {
  flex: 1;
  min-width: 0;
  margin-inline-start: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, #fff 6%, transparent);
  color: color-mix(in srgb, #fff 55%, transparent);
  font-size: 0.65rem;
  line-height: 1.2;
  direction: ltr;
  text-align: start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-browser-screen {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: 16 / 10;
}

.platform-card-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  padding: 1rem 1.15rem 1.2rem;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--primary-end) 30%, transparent);
  background: linear-gradient(180deg, #171722 0%, #101018 100%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 6%, transparent),
    0 12px 28px rgba(0, 0, 0, 0.28);
}

.platform-card-icon {
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
}

.platform-card-body h3 {
  margin: 0;
  width: 100%;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-card-body p {
  margin: 0;
  width: 100%;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-height: calc(1.5em * 2);
}

.platform-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  align-self: stretch;
  min-height: 44px;
  margin-top: auto;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.platform-cta--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary-start) 28%, transparent);
}

.platform-cta--primary:hover,
.platform-cta--primary:focus-visible {
  opacity: 0.94;
  outline: none;
}

.platform-cta--ghost {
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--primary-start) 50%, transparent);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.platform-cta--ghost:hover,
.platform-cta--ghost:focus-visible {
  border-color: color-mix(in srgb, var(--primary-start) 70%, transparent);
  background: color-mix(in srgb, var(--primary-end) 14%, transparent);
  outline: none;
}

.platform-cta:active {
  transform: translateY(1px);
}

@media (max-width: 960px) {
  /* Desktop uses absolute previews above the body. Stacked cards need the
     mockups in normal flow, centered, with a light tuck into the card. */
  .home-platforms-grid {
    --platform-media-overlap: 1.1rem;
    grid-template-columns: 1fr;
    max-width: 380px;
    width: 100%;
    margin-inline: auto;
    padding-top: 0;
    gap: 2rem;
    justify-items: center;
  }

  .platform-card {
    width: 100%;
    max-width: 380px;
    align-items: center;
  }

  .platform-preview {
    position: relative;
    inset: auto;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    height: auto;
    margin: 0;
    margin-bottom: calc(-1 * var(--platform-media-overlap));
    padding-inline: 0.85rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }

  .platform-preview--android {
    inset-inline: auto;
    gap: 0.55rem;
    max-width: none;
    padding-inline: 0.75rem;
    /* Keep phone pair LTR so the front device stays visually centered. */
    direction: ltr;
  }

  .platform-phone {
    height: auto;
    width: min(44%, 122px);
    max-width: 46%;
    flex: 0 0 auto;
  }

  .platform-phone--back {
    height: auto;
    width: min(40%, 108px);
    max-width: 42%;
    margin-inline-end: 0;
    transform: rotate(-5deg) translateY(0.4rem);
  }

  .platform-phone--front {
    width: min(46%, 128px);
    max-width: 48%;
    margin-inline-start: 0;
    transform: rotate(2deg);
  }

  .platform-laptop,
  .platform-browser {
    width: 100%;
    max-width: 320px;
    max-height: none;
    height: auto;
    margin-inline: auto;
  }

  .platform-laptop-screen {
    max-height: none;
    width: 100%;
  }

  .platform-browser-screen {
    width: 100%;
  }

  .platform-card-body {
    width: 100%;
  }
}

@media (min-width: 700px) and (max-width: 960px) {
  .home-platforms-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
    gap: 2rem 1.25rem;
  }

  .home-platforms-grid .platform-card:last-child {
    grid-column: 1 / -1;
    max-width: 380px;
    justify-self: center;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .home-platforms {
    width: min(100% - 1.5rem, 1120px);
    margin-top: 2.5rem;
    margin-inline: auto;
  }

  .home-platforms-grid {
    --platform-media-overlap: 0.85rem;
    max-width: 340px;
    gap: 1.85rem;
  }

  .platform-card {
    max-width: 340px;
  }

  .platform-card-body {
    padding-top: 1.05rem;
  }

  .home-platforms-perks {
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
  }

  .home-platforms-perks li {
    max-width: 18rem;
  }

  .platform-preview {
    padding-inline: 0.5rem;
  }

  .platform-preview--android {
    padding-inline: 0.45rem;
    gap: 0.45rem;
  }

  .platform-phone {
    width: min(45%, 118px);
  }

  .platform-phone--back {
    width: min(41%, 102px);
    transform: rotate(-5deg) translateY(0.35rem);
  }

  .platform-phone--front {
    width: min(47%, 122px);
    transform: rotate(2deg);
  }

  .platform-card-body h3 {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .platform-cta {
    transition: none;
  }
}

/* Cinema reel — desktop cinematic hero; mobile card UI below */
.cinema-reel:not(.is-fa) {
  font-family: "Outfit", system-ui, sans-serif;
}

.cinema-reel {
  --cinema-hero-h: min(72dvh, 42rem);
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #0a0a0f;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  padding-block-end: 1.25rem;
}

.cinema-reel *,
.cinema-reel *::before,
.cinema-reel *::after {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.cinema-viewport {
  position: relative;
  width: 100%;
  height: var(--cinema-hero-h);
  overflow: hidden;
  background: #0a0a0f;
}

.cinema-track {
  position: absolute;
  inset: 0;
}

.cinema-slot {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.55s ease;
}

.cinema-slot.is-leaving {
  opacity: 0;
  z-index: 1;
}

.cinema-slot.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.cinema-frame {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.cinema-image {
  position: absolute;
  inset: 0;
}

.cinema-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  display: block;
}

.cinema-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(10, 10, 15, 0.92) 0%,
      rgba(10, 10, 15, 0.72) 28%,
      rgba(10, 10, 15, 0.28) 52%,
      rgba(10, 10, 15, 0.08) 72%,
      transparent 100%
    ),
    linear-gradient(
      180deg,
      rgba(10, 10, 15, 0.55) 0%,
      transparent 22%,
      transparent 58%,
      rgba(10, 10, 15, 0.72) 82%,
      #0a0a0f 100%
    );
}

html[dir="rtl"] .cinema-vignette {
  background:
    linear-gradient(
      270deg,
      rgba(10, 10, 15, 0.92) 0%,
      rgba(10, 10, 15, 0.72) 28%,
      rgba(10, 10, 15, 0.28) 52%,
      rgba(10, 10, 15, 0.08) 72%,
      transparent 100%
    ),
    linear-gradient(
      180deg,
      rgba(10, 10, 15, 0.55) 0%,
      transparent 22%,
      transparent 58%,
      rgba(10, 10, 15, 0.72) 82%,
      #0a0a0f 100%
    );
}

.cinema-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding:
    calc(var(--header-h, 72px) + 1.5rem)
    clamp(1.25rem, 4vw, 3.5rem)
    clamp(1.5rem, 4vh, 2.75rem);
  pointer-events: none;
}

.cinema-slot.is-active .cinema-content {
  pointer-events: auto;
}

.cinema-main {
  position: relative;
  max-width: min(42rem, 58vw);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.cinema-badge {
  margin: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

.cinema-title {
  margin: 0;
  font-family: "Playfair Display", "Outfit", serif;
  font-weight: 600;
  font-size: clamp(2.1rem, 4.8vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.cinema-title-sub {
  margin: -0.15rem 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.cinema-meta {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
}

.cinema-meta > li {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.84rem;
}

.cinema-meta-score {
  color: #ffd56a;
}

.cinema-meta-score svg {
  flex: 0 0 auto;
}

.cinema-meta-year {
  opacity: 0.85;
}

.cinema-meta-genres {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cinema-genre-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 12, 18, 0.45);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  line-height: 1.2;
}

.cinema-blurb {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0.15rem 0 0;
  max-width: min(58ch, 100%);
  font-size: clamp(0.86rem, 1.15vw, 0.98rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.cinema-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.cinema-explore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 10, 15, 0.42);
  color: #fff;
}

.cinema-explore:hover,
.cinema-explore:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.cinema-explore-arrow {
  display: none;
}

.cinema-explore-label-mobile {
  display: none;
}

.cinema-explore-label-desktop {
  display: inline;
}

.cinema-reel.is-fa .cinema-badge,
.cinema-reel.is-fa .cinema-title,
.cinema-reel.is-fa .cinema-blurb,
.cinema-reel.is-fa .cinema-explore,
.cinema-reel.is-fa .cinema-genre-chip,
.cinema-reel.is-fa .cinema-thumb-title,
.cinema-reel.is-fa .cinema-thumb-status {
  font-family: var(--font-fa);
  letter-spacing: 0;
  text-transform: none;
}

.cinema-reel.is-fa .cinema-title {
  font-weight: 700;
}

.cinema-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 10, 15, 0.48);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.cinema-nav:hover,
.cinema-nav:focus-visible {
  background: rgba(10, 10, 15, 0.72);
  border-color: rgba(255, 255, 255, 0.4);
  outline: none;
}

.cinema-nav-prev { inset-inline-start: clamp(0.6rem, 1.5vw, 1.25rem); }
.cinema-nav-next { inset-inline-end: clamp(0.6rem, 1.5vw, 1.25rem); }

/* Chevron paths are drawn for RTL; mirror them in LTR so prev/next face the right way. */
html[dir="ltr"] .cinema-nav svg {
  transform: scaleX(-1);
}

.cinema-desktop-chrome {
  width: min(100% - 2.5rem, 72rem);
  margin-inline: auto;
  margin-top: 0.85rem;
  display: grid;
  gap: 0.75rem;
}

.cinema-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 16rem;
}

.cinema-progress-count {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.62);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cinema-progress-sep {
  margin-inline: 0.2rem;
  opacity: 0.55;
}

.cinema-progress-track {
  flex: 1;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.cinema-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
  transition: width 280ms ease;
}

.cinema-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.cinema-thumb {
  position: relative;
  /* Grow to fill a row when many slides; never wider than 11rem (1-item full-bleed bug). */
  flex: 1 1 7.5rem;
  max-width: 11rem;
  min-width: 0;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  background: #14141c;
  cursor: pointer;
  color: #fff;
  transition: border-color 160ms ease, transform 160ms ease, opacity 160ms ease;
  opacity: 0.72;
}

.cinema-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cinema-thumb-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 100%);
}

.cinema-thumb-status {
  position: absolute;
  top: 0.4rem;
  inset-inline-start: 0.4rem;
  z-index: 1;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(10, 10, 15, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.58rem;
  line-height: 1.2;
  max-width: calc(100% - 0.8rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cinema-thumb-title {
  position: absolute;
  inset-inline: 0.45rem;
  bottom: 0.4rem;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: start;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cinema-thumb-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  opacity: 0;
  color: #fff;
  background: color-mix(in srgb, var(--primary-start) 18%, transparent);
  transition: opacity 160ms ease;
}

.cinema-thumb.is-active {
  opacity: 1;
  border-color: color-mix(in srgb, var(--primary-start) 85%, #fff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary-start) 45%, transparent);
}

.cinema-thumb.is-active .cinema-thumb-play {
  opacity: 1;
}

.cinema-thumb:hover,
.cinema-thumb:focus-visible {
  opacity: 1;
  outline: none;
  transform: translateY(-1px);
}

.cinema-indicator {
  display: none;
}

.cinema-pips {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
}

.cinema-pip {
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0.35rem 0;
}

.cinema-pip span {
  width: 1.15rem;
  height: 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: all 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cinema-pip.is-active span {
  width: 1.85rem;
  height: 0.22rem;
  background: #fff;
}

@media (max-width: 1100px) {
  .cinema-reel {
    --cinema-hero-h: min(64dvh, 34rem);
  }

  .cinema-main {
    max-width: min(38rem, 64vw);
  }

  .cinema-title {
    font-size: clamp(1.8rem, 4.2vw, 2.8rem);
  }

  .cinema-thumb-status {
    display: none;
  }
}

@media (max-width: 800px) {
  .home-scenes-grid,
  .home-app,
  .home-install-cols { grid-template-columns: 1fr; }
  .home-hero-title { font-weight: 700; }
}
/* Mobile Namava-style inset card slider — preserve existing experience */
@media (max-width: 899px) {
  .cinema-reel.is-card {
    --cinema-card-h: min(52dvh, 22.5rem);
    --cinema-card-gap: 0.85rem;
    height: auto;
    min-height: 0;
    padding:
      calc(var(--header-h, 72px) + 0.75rem)
      var(--cinema-card-gap)
      0.85rem;
    padding-block-end: 0.85rem;
    display: flex;
    flex-direction: column;
    background: #0c0c10;
    touch-action: none;
    /* Keep carousel math physical-left; text direction is restored on content. */
    direction: ltr;
    overflow: hidden;
  }

  .cinema-reel.is-card .cinema-viewport {
    display: block;
    position: relative;
    width: 100%;
    height: var(--cinema-card-h);
    overflow: hidden;
    border-radius: 22px;
    flex: 0 0 auto;
  }

  .cinema-reel.is-card .cinema-nav,
  .cinema-reel.is-card .cinema-desktop-chrome,
  .cinema-reel.is-card .cinema-badge,
  .cinema-reel.is-card .cinema-title-sub,
  .cinema-reel.is-card .cinema-meta,
  .cinema-reel.is-card .cinema-explore-icon,
  .cinema-reel.is-card .cinema-explore-arrow,
  .cinema-reel.is-card .cinema-explore-label-desktop {
    display: none !important;
  }

  .cinema-reel.is-card .cinema-explore-label-mobile {
    display: inline !important;
  }

  .cinema-reel.is-card .cinema-track {
    position: relative;
    top: auto;
    bottom: auto;
    left: 0 !important;
    right: auto !important;
    inset-inline-start: auto !important;
    inset-inline-end: auto !important;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    direction: ltr;
    transform: none !important;
    will-change: auto;
  }

  /* Stacked cards — one visible at a time, crossfade on change */
  .cinema-reel.is-card .cinema-slot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    perspective: none;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.48s ease;
  }

  .cinema-reel.is-card .cinema-slot.is-leaving {
    opacity: 0;
    z-index: 1;
  }

  .cinema-reel.is-card .cinema-slot.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
  }

  .cinema-reel.is-card .cinema-frame {
    height: 100%;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
    background: #1a1a22;
    box-shadow: none;
    transform: none !important;
  }

  .cinema-reel.is-card .cinema-image {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    max-width: none !important;
    transform: none !important;
    will-change: auto;
    z-index: 0;
  }

  .cinema-reel.is-card .cinema-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    opacity: 1;
    -webkit-user-drag: none;
    user-select: none;
  }

  .cinema-reel.is-card .cinema-vignette {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, transparent 28%, transparent 48%, rgba(22, 22, 28, 0.55) 72%, #16161c 100%);
  }

  .cinema-reel.is-card .cinema-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    padding: 1rem 1rem 1.1rem;
    text-align: center;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    pointer-events: none;
    background: linear-gradient(
      180deg,
      transparent 0%,
      transparent 42%,
      rgba(22, 22, 28, 0.55) 68%,
      rgba(22, 22, 28, 0.92) 100%
    );
  }

  .cinema-reel.is-card .cinema-slot.is-active .cinema-content {
    pointer-events: auto;
  }

  .cinema-reel.is-card.is-fa .cinema-content,
  .cinema-reel.is-card.is-fa .cinema-main,
  .cinema-reel.is-card.is-fa .cinema-title,
  .cinema-reel.is-card.is-fa .cinema-blurb {
    direction: rtl;
  }

  .cinema-reel.is-card .cinema-main {
    position: static;
    inset: auto;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
  }

  .cinema-reel.is-card .cinema-title {
    font-family: var(--font-fa), var(--font);
    font-size: clamp(1.15rem, 4.6vw, 1.45rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    color: #fff;
    text-shadow: none;
  }

  .cinema-reel.is-card .cinema-blurb {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    max-width: 30ch;
    font-family: var(--font-fa), var(--font);
    font-size: 0.78rem;
    line-height: 1.5;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.72);
  }

  .cinema-reel.is-card .cinema-actions {
    margin-top: 0;
    justify-content: center;
  }

  .cinema-reel.is-card .cinema-explore {
    position: static;
    inset: auto;
    margin-top: 0.1rem;
    min-height: 40px;
    padding: 0.55rem 1.3rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--primary-start) 75%, #fff);
    background: transparent;
    color: color-mix(in srgb, var(--primary-start) 70%, #fff);
    letter-spacing: 0;
    text-transform: none;
    font-family: var(--font-fa), var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: none;
  }

  .cinema-reel.is-card .cinema-explore:hover,
  .cinema-reel.is-card .cinema-explore:focus-visible {
    background: color-mix(in srgb, var(--primary-start) 16%, transparent);
    outline: none;
    transform: none;
  }

  .cinema-reel.is-card .cinema-indicator {
    display: flex;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    top: auto;
    transform: none;
    z-index: 5;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin: 0.7rem 0 0;
    pointer-events: auto;
  }

  .cinema-reel.is-card .cinema-pips {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
  }

  .cinema-reel.is-card .cinema-pip {
    width: auto;
    height: auto;
    padding: 0.35rem 0;
  }

  .cinema-reel.is-card .cinema-pip span {
    width: 1.15rem;
    height: 0.2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
  }

  .cinema-reel.is-card .cinema-pip.is-active span {
    width: 1.85rem;
    height: 0.22rem;
    background: #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cinema-slot,
  .cinema-pip span,
  .cinema-progress-fill,
  .cinema-thumb {
    transition: none;
  }
}

/* —— Subscribe page (cinematic premium) —— */
.sub-page {
  background: #07070c;
}

.sub-main {
  position: relative;
  z-index: 1;
}

.sub-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(22rem, 52vh, 34rem);
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h, 64px) + 2.5rem) 0 2.75rem;
  overflow: hidden;
}

.sub-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: 70% 35%;
  background-repeat: no-repeat;
  transform: scale(1.02);
}

.sub-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, #07070c 55%, transparent) 0%,
      color-mix(in srgb, #07070c 28%, transparent) 42%,
      #07070c 100%
    ),
    linear-gradient(
      90deg,
      color-mix(in srgb, #07070c 72%, transparent) 0%,
      color-mix(in srgb, #07070c 35%, transparent) 48%,
      transparent 78%
    ),
    radial-gradient(
      60% 55% at 85% 20%,
      color-mix(in srgb, var(--primary-start) 28%, transparent),
      transparent 70%
    );
}

.sub-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 44rem;
}

.sub-hero-brand {
  margin: 0 0 0.65rem;
  font-family: Outfit, Vazirmatn, system-ui, sans-serif;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #fff 20%, var(--primary-start) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub-hero-title {
  margin: 0;
  font-size: clamp(1.85rem, 4.2vw, 2.85rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: var(--tracking-tight, -0.02em);
  color: #fff;
}

.sub-hero-desc {
  margin: 0.85rem 0 0;
  max-width: 38ch;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  line-height: 1.7;
  color: color-mix(in srgb, #f2f2f7 72%, transparent);
}

.sub-hero-feats {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.sub-hero-feats li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--primary-start) 28%, transparent);
  background: color-mix(in srgb, #0c0b14 78%, transparent);
  color: color-mix(in srgb, #fff 88%, transparent);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
}

.sub-hero-feat-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--primary-start);
  line-height: 0;
}

.sub-plans-section,
.sub-why {
  padding: 2.75rem 0 3.25rem;
}

.sub-section-head {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 1.75rem;
}

.sub-section-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
  color: var(--primary-start);
  font-size: 0.85rem;
  font-weight: 700;
}

.sub-section-kicker-icon {
  display: grid;
  place-items: center;
  line-height: 0;
}

.sub-section-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.sub-accent {
  color: var(--primary-start);
}

.sub-section-desc {
  margin: 0.65rem 0 0;
  color: color-mix(in srgb, #f2f2f7 62%, transparent);
  font-size: 0.95rem;
  line-height: 1.6;
}

.sub-plans.mkt-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.15rem 1rem;
  align-items: stretch;
  justify-content: center;
  max-width: 1120px;
  margin-inline: auto;
  /* Room for the floating recommended badge above the card border. */
  padding-block-start: 0.85rem;
  overflow: visible;
}

.sub-plans-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
}

.sub-plan.mkt-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: none;
  max-width: none;
  min-height: 100%;
  padding: 1rem 1.15rem 1.2rem;
  border-radius: 14px;
  background: color-mix(in srgb, #12101c 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary-start) 32%, transparent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  gap: 0.45rem;
  overflow: visible;
}

.sub-plan.mkt-plan:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary-start) 55%, transparent);
}

.sub-plan.is-premium {
  /* Extra top padding so the floating badge never covers the title. */
  padding-block-start: 1.55rem;
  border-color: color-mix(in srgb, var(--primary-start) 70%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--primary-end) 35%, transparent),
    0 0 36px color-mix(in srgb, var(--primary-start) 28%, transparent),
    0 14px 32px rgba(0, 0, 0, 0.35);
  background:
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--primary-start) 14%, #14101f) 0%,
      #12101c 48%,
      #12101c 100%
    );
}

/* Shared intro: equal min-height so pricing lines up. */
.sub-plan-intro {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
  min-height: 4.25rem;
}

/* Title at inline-start, discount at inline-end (RTL: title right / badge left; LTR: reverse). */
.sub-plan-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.sub-plan-off {
  position: static;
  z-index: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  order: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, #12b5a0 88%, #0a3);
  color: #041512;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

/* Recommended: floats on the top border center; only on .is-premium. */
.sub-plan-badge.mkt-plan-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  align-self: auto;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.7rem;
  white-space: nowrap;
  pointer-events: none;
}

.sub-plan-badge-icon {
  display: grid;
  place-items: center;
  line-height: 0;
}

.sub-plan-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  text-align: start;
  line-height: 1.3;
}

.sub-plan-duration {
  margin: 0;
  text-align: start;
  font-size: 0.82rem;
  font-weight: 600;
  color: color-mix(in srgb, #f2f2f7 55%, transparent);
}

.sub-plan-pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.2rem;
  min-height: 4.6rem;
  margin-block-start: 0.15rem;
}

.sub-plan-price.mkt-plan-price {
  text-align: start;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
}

.sub-plan-price .mkt-plan-price-original {
  margin: 0;
  min-height: 1.15rem;
}

.sub-plan-price .mkt-plan-price-original.is-placeholder,
.sub-plan-monthly.is-placeholder {
  visibility: hidden;
}

.sub-plan-price-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.35rem;
}

.sub-plan-price .mkt-plan-price-final {
  display: inline;
  font-size: clamp(1.45rem, 2.5vw, 1.7rem);
  font-weight: 800;
  color: var(--primary-start);
  letter-spacing: var(--tracking-tight, -0.02em);
}

.sub-plan-price .mkt-plan-price-unit {
  display: inline;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: color-mix(in srgb, #f2f2f7 58%, transparent);
}

.sub-plan-monthly {
  margin: 0;
  text-align: start;
  font-size: 0.8rem;
  color: color-mix(in srgb, #f2f2f7 55%, transparent);
  min-height: 1.15rem;
  width: 100%;
}

.sub-plan-perks {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.65rem 0 0;
  border-top: 1px solid color-mix(in srgb, #fff 8%, transparent);
  display: grid;
  gap: 0.45rem;
  flex: 1 1 auto;
}

.sub-plan-perks li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: color-mix(in srgb, #f2f2f7 78%, transparent);
}

.sub-plan-perks li > span:first-child {
  color: var(--primary-start);
  line-height: 0;
  margin-top: 0.1rem;
}

.sub-plan-desc.mkt-plan-desc {
  flex: 0;
  text-align: start;
  font-size: 0.8rem;
}

.sub-plan .btn,
.sub-plan .sub-plan-cta {
  margin-top: auto;
  width: 100%;
  justify-content: center;
  min-height: 44px;
  border-radius: 10px;
}

.sub-plan-cta.btn-ghost {
  border: 1px solid color-mix(in srgb, var(--primary-start) 55%, transparent);
  color: #fff;
  background: transparent;
}

.sub-plan-cta.btn-ghost:hover,
.sub-plan-cta.btn-ghost:focus-visible {
  background: color-mix(in srgb, var(--primary-start) 16%, transparent);
  border-color: var(--primary-start);
}

.sub-plan.is-premium .btn-primary {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  border: 0;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary-start) 35%, transparent);
}

.sub-why {
  padding-top: 1rem;
  padding-bottom: 4rem;
}

.sub-benefits-wrap {
  max-width: 36rem;
  margin-inline: auto;
  padding: 1.25rem 1.35rem 1.35rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--primary-start) 24%, transparent);
  background: color-mix(in srgb, #10101a 90%, transparent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.sub-benefits.premium-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  text-align: start;
}

.sub-benefits.premium-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: color-mix(in srgb, #f2f2f7 88%, transparent);
}

.sub-benefits .premium-benefits__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  margin-top: 0.05rem;
  border-radius: 999px;
  color: #fff;
}

.sub-benefits .premium-benefits__icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}

.sub-benefits .premium-benefits__icon--wifi { background: #22c55e; }
.sub-benefits .premium-benefits__icon--quality { background: #3b82f6; }
.sub-benefits .premium-benefits__icon--download { background: #8b5cf6; }
.sub-benefits .premium-benefits__icon--archive { background: #f97316; }
.sub-benefits .premium-benefits__icon--server { background: #eab308; }
.sub-benefits .premium-benefits__icon--ads { background: #ef4444; }
.sub-benefits .premium-benefits__icon--support { background: #ec4899; }

@media (max-width: 899px) {
  .sub-hero {
    min-height: 0;
    padding: calc(var(--header-h, 64px) + 1.5rem) 0 1.75rem;
    align-items: flex-end;
  }

  .sub-hero-bg {
    background-position: 80% 30%;
  }

  .sub-hero-feats {
    flex-direction: column;
  }

  .sub-hero-feats li {
    width: 100%;
  }

  .sub-plans.mkt-plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .sub-plan.mkt-plan {
    padding: 1.1rem 0.85rem 1rem;
  }

  .sub-plan-title {
    font-size: 1.05rem;
  }

  .sub-plans-section,
  .sub-why {
    padding: 2rem 0 2.5rem;
  }
}

@media (max-width: 520px) {
  .sub-plans.mkt-plans {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sub-plan.mkt-plan:hover {
    transform: none;
  }
}
