:root {
  --red: #ef0000;
  --red-2: #ff2525;
  --red-3: #ff5757;
  --red-dark: #b40000;

  --bg: #06090e;
  --bg-soft: #090d14;
  --surface: #101620;
  --surface-2: #151c28;
  --surface-3: #1b2331;

  --text: #f5f7fb;
  --heading: #ffffff;
  --muted: #a8b0bf;
  --muted-2: #747f91;

  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  --soft-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);

  --container: 1440px;
  --radius: 22px;
  --radius-sm: 14px;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --surface-3: #eef0f5;

  --text: #161922;
  --heading: #07090d;
  --muted: #5f6878;
  --muted-2: #7b8493;

  --border: rgba(10, 15, 28, 0.09);
  --border-strong: rgba(10, 15, 28, 0.14);

  --shadow: 0 24px 70px rgba(10, 15, 28, 0.12);
  --soft-shadow: 0 16px 38px rgba(10, 15, 28, 0.1);

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 92% 15%, rgba(239, 0, 0, 0.13), transparent 31%),
    radial-gradient(circle at 4% 18%, rgba(239, 0, 0, 0.055), transparent 25%),
    linear-gradient(180deg, #06070b 0%, #070b11 56%, #070a0f 100%);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.28;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(239, 0, 0, 0.42) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-position:
    0 0,
    14px 14px;
  background-size:
    28px 28px,
    28px 28px;
  mask-image:
    radial-gradient(circle at 0% 18%, #000 0%, transparent 26%),
    radial-gradient(circle at 100% 15%, #000 0%, transparent 24%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.18),
      transparent 26%,
      transparent 74%,
      rgba(239, 0, 0, 0.07)
    ),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 92% 15%, rgba(239, 0, 0, 0.07), transparent 31%),
    radial-gradient(circle at 4% 18%, rgba(239, 0, 0, 0.04), transparent 25%),
    linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%);
}

:root[data-theme="light"] body::before {
  opacity: 0.18;
}

[dir="rtl"] body {
  font-family: Vazirmatn, Inter, ui-sans-serif, system-ui, sans-serif;
}

[dir="rtl"] body::before {
  mask-image:
    radial-gradient(circle at 100% 18%, #000 0%, transparent 26%),
    radial-gradient(circle at 0% 15%, #000 0%, transparent 24%);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
iframe {
  max-width: 100%;
}

svg {
  width: 1em;
  height: 1em;
  display: block;
  fill: currentColor;
}

button,
input {
  font: inherit;
}

.container {
  width: min(var(--container), calc(100% - 96px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 999;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
}

.skip-link:focus {
  top: 16px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.nav {
  height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.04em;
  color: var(--heading);
}

.logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  border-radius: 0;
  background: linear-gradient(180deg, var(--red-2), var(--red));
  color: #fff;
  font-weight: 950;
  font-style: italic;
  font-size: 26px;
  letter-spacing: -0.08em;
  box-shadow: none;
}

.logo-word {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  color: var(--heading);
  font-family: "Inter Tight", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
}

.logo-word span {
  color: var(--red-2);
}

.logo-word-fa {
  font-family: Vazirmatn, Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.01em;
  direction: rtl;
}

.logo span:last-child span {
  color: var(--red-2);
}

[dir="rtl"] .logo {
  flex-direction: row;
}

[dir="rtl"] .logo-word-fa {
  direction: rtl;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.nav-links a,
.nav-dropdown-trigger {
  position: relative;
  transition: color 180ms ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"],
.nav-dropdown:hover .nav-dropdown-trigger {
  color: var(--heading);
}

.nav-dropdown.is-open .nav-submenu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

[dir="rtl"] .nav-dropdown.is-open .nav-submenu {
  transform: translate(50%, 0);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -28px;
  height: 3px;
  border-radius: 999px;
  background: var(--red);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.nav-dropdown-trigger svg {
  width: 12px;
  height: 12px;
  opacity: 0.8;
}

.nav-submenu {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  min-width: 230px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
  transform: translate(-50%, 8px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms ease;
}

[dir="rtl"] .nav-submenu {
  left: auto;
  right: 50%;
  transform: translate(50%, 8px);
}

.nav-dropdown:hover .nav-submenu,
.nav-dropdown:focus-within .nav-submenu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

[dir="rtl"] .nav-dropdown:hover .nav-submenu,
[dir="rtl"] .nav-dropdown:focus-within .nav-submenu {
  transform: translate(50%, 0);
}

.nav-submenu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  color: var(--muted);
}

.nav-submenu a:hover {
  background: rgba(239, 0, 0, 0.08);
  color: var(--heading);
}

.nav-submenu-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(239, 0, 0, 0.12);
  color: var(--red-2);
  font-size: 17px;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 12px;
}

.theme-toggle {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--heading);
  cursor: pointer;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.36),
    0 0 0 1px var(--border);
}

.floating-theme-toggle {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 999;
}

[dir="rtl"] .floating-theme-toggle {
  right: max(18px, env(safe-area-inset-right));
  left: auto;
}

.theme-toggle-icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: block;
  border-radius: 999px;
  background: #ffb020;
  box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.12);
}

:root[data-theme="light"] .theme-toggle-icon {
  background: #111827;
  box-shadow:
    inset -5px -2px 0 0 #ffffff,
    0 0 0 4px rgba(17, 24, 39, 0.08);
}

.nav-cta-short {
  display: none;
}

/* Buttons */

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(180deg, var(--red-2), var(--red));
  color: #fff;
  box-shadow: 0 16px 36px rgba(239, 0, 0, 0.25);
}

.btn-secondary {
  border-color: rgba(239, 0, 0, 0.42);
  background: rgba(239, 0, 0, 0.06);
  color: var(--heading);
}

.btn-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
}

/* Shared Search */

.hero-search {
  position: relative;
  display: flex;
  max-width: 590px;
  min-height: 54px;
  margin-top: 28px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  box-shadow: var(--soft-shadow);
}

.search-input-icon {
  width: 22px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 18px;
}

.hero-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0 14px;
}

.hero-search input::placeholder {
  color: var(--muted-2);
}

/* Shared Sections */

.section {
  padding: 32px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-title {
  margin: 0;
  color: var(--heading);
  font-family: "Inter Tight", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.055em;
}

[dir="rtl"] .section-title {
  font-family: Vazirmatn, Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
  word-spacing: 0.03em;
}

.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.section-title-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--red-2);
  font-size: 24px;
  flex: 0 0 auto;
}

.section-title-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

[dir="rtl"] .section-title-icon svg {
  transform: scaleX(-1);
  transform-origin: center;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--red-2);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

/* Shared Video Cards */

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.video-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: var(--soft-shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
  animation: fade-up 460ms ease both;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: rgba(239, 0, 0, 0.38);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
}

.video-thumb-link {
  display: block;
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(239, 0, 0, 0.34), transparent 65%),
    var(--thumb, linear-gradient(135deg, #151b27, #2a1010));
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
}

.video-card:hover .video-thumb img {
  transform: scale(1.045);
}

.video-thumb.no-image {
  display: flex;
  align-items: flex-end;
  padding: 18px;
}

.video-thumb.no-image strong {
  position: relative;
  z-index: 2;
  max-width: 92%;
  color: #fff;
  font-family: Anton, "Inter Tight", Impact, sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.video-thumb.no-image::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -42px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(239, 0, 0, 0.28);
}

.video-duration {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.video-card .video-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
}

[dir="rtl"] .video-card .video-duration {
  right: auto;
  left: 10px;
}

.video-body {
  padding: 14px;
}

.video-title {
  margin: 0;
  color: var(--heading);
  font-family: "Inter Tight", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.28;
  letter-spacing: -0.012em;
  word-spacing: 0.02em;
}

[dir="rtl"] .video-title {
  font-family: Vazirmatn, Inter, sans-serif;
  letter-spacing: 0;
}

.video-title a:hover {
  color: var(--red-2);
}

.video-desc {
  display: -webkit-box;
  min-height: 38px;
  margin: 9px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.video-tag {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

/* Shared Feature Cards */

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  min-height: 132px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: var(--soft-shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(239, 0, 0, 0.34);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
}

.feature-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(239, 0, 0, 0.12);
  color: var(--red-2);
  font-size: 27px;
}

.feature-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.feature-card h2,
.feature-card h3 {
  margin: 0;
  color: var(--heading);
  font-family: "Inter Tight", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
}

[dir="rtl"] .feature-card h2,
[dir="rtl"] .feature-card h3 {
  font-family: Vazirmatn, Inter, sans-serif;
}

.feature-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Footer */

.site-footer {
  margin-top: 36px;
  padding: 42px 0 26px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 58%, transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.8fr 0.8fr 0.8fr;
  gap: 32px;
}

.footer-brand p,
.footer-col a {
  color: var(--muted);
}

.footer-brand p {
  max-width: 330px;
  margin: 14px 0 0;
}

.footer-col h3 {
  margin: 0 0 12px;
  color: var(--heading);
  font-size: 15px;
}

.footer-col a {
  display: block;
  margin-top: 8px;
  font-size: 14px;
}

.footer-col a:hover {
  color: var(--red-2);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.social-links a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  color: var(--heading);
  font-size: 17px;
  transition:
    transform 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.social-links a:hover {
  transform: translateY(-1px);
  border-color: rgba(239, 0, 0, 0.44);
  color: var(--red-2);
}

.footer-bottom {
  margin-top: 34px;
  color: var(--muted-2);
  font-size: 13px;
  text-align: center;
}

.site-footer .logo-mark {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 0;
  font-size: 23px;
}

/* Animation */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Large Desktop */

@media (min-width: 1600px) {
  :root {
    --container: 1520px;
  }
}

/* Desktop */

@media (min-width: 1181px) {
  .section .video-grid:not(.home-video-grid) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Medium */

@media (max-width: 1180px) {
  .container {
    width: min(var(--container), calc(100% - 56px));
  }

  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .features-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tablet */

@media (max-width: 820px) {
  .container {
    width: min(var(--container), calc(100% - 36px));
  }

  .nav {
    height: 70px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .logo {
    gap: 8px;
  }

  .logo-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 0;
    font-size: 21px;
  }

  .logo-word {
    display: none;
  }

  .nav-links {
    justify-content: flex-start;
    gap: 16px;
    white-space: nowrap;
    font-size: 12px;
  }

  .nav-dropdown {
    position: static;
  }

  .nav-submenu {
    position: fixed;
    top: 72px;
    left: 18px;
    right: 18px;
    z-index: 100;
    min-width: 0;
    max-height: calc(100vh - 92px);
    overflow-y: auto;
    transform: translateY(8px);
  }

  [dir="rtl"] .nav-submenu {
    left: 18px;
    right: 18px;
    transform: translateY(8px);
  }

  .nav-dropdown.is-open .nav-submenu,
  [dir="rtl"] .nav-dropdown.is-open .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links a[aria-current="page"]::after {
    display: none;
  }

  .nav-actions {
    justify-content: flex-end;
    gap: 8px;
  }

  .nav-youtube-link {
    display: none;
  }

  .nav-cta {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
  }

  .nav-cta-full {
    display: none;
  }

  .nav-cta-short {
    display: inline;
  }

  .video-grid,
  .section .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */

@media (max-width: 620px) {
  .container {
    width: min(var(--container), calc(100% - 28px));
  }

  .logo {
    gap: 10px;
  }

  .logo-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 0;
    font-size: 22px;
  }

  .logo-word {
    font-size: 22px;
  }

  .logo-word-fa {
    font-size: 22px;
  }

  .hero-search {
    min-height: 50px;
    padding: 7px 12px;
  }

  .video-grid,
  .section .video-grid,
  .features-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    align-items: center;
  }
}

@media (max-width: 820px) {
  .nav-dropdown:hover .nav-submenu,
  .nav-dropdown:focus-within .nav-submenu,
  [dir="rtl"] .nav-dropdown:hover .nav-submenu,
  [dir="rtl"] .nav-dropdown:focus-within .nav-submenu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
  }

  .nav-dropdown.is-open .nav-submenu,
  [dir="rtl"] .nav-dropdown.is-open .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}
