/* ==========================================================================
   ToBee WebSite - Dark Theme Design System
   Full local, no external dependency. RTL, Persian, Vazirmatn.
   ========================================================================== */

:root {
  /* پالت تیره پلتفرم ToBee */
  --tb-bg:          #0b1120;
  --tb-bg-2:        #0e1526;
  --tb-card:        #151d2e;
  --tb-card-2:      #1b2436;
  --tb-elevated:    #202c44;
  --tb-line:        #2a3548;
  --tb-line-soft:   #1f2937;

  --tb-ink:         #f1f5f9;
  --tb-body:        #e2e8f0;
  --tb-muted:       #94a3b8;
  --tb-faint:       #64748b;

  --tb-purple:      #70409c;
  --tb-purple-2:    #8955b5;
  --tb-purple-dark: #422455;
  --tb-purple-deep: #2f1b52;
  --tb-purple-soft: rgba(112, 64, 156, .18);
  --tb-purple-line: rgba(137, 85, 181, .38);

  --tb-gold:        #b78a43;
  --tb-gold-2:      #e6c98f;
  --tb-gold-soft:   #f1dfb8;

  --tb-green:       #5d8066;
  --tb-red:         #a15f4d;
  --tb-info:        #5f8a80;

  --tb-gradient-brand: linear-gradient(135deg, #70409c 0%, #422455 55%, #241640 100%);
  --tb-gradient-gold: linear-gradient(135deg, #e6c98f 0%, #b78a43 100%);
  --tb-gradient-glow: radial-gradient(60% 60% at 50% 0%, rgba(112, 64, 156, .35), transparent 70%);

  --tb-radius:      1.15rem;
  --tb-radius-sm:   .8rem;
  --tb-radius-lg:   1.6rem;

  --tb-shadow:      0 1px 3px rgba(0, 0, 0, .4);
  --tb-shadow-lg:   0 18px 50px rgba(3, 7, 18, .6);
  --tb-shadow-glow: 0 0 0 1px rgba(112, 64, 156, .35), 0 18px 60px rgba(112, 64, 156, .25);

  --tb-header-h:    72px;
  --tb-maxw:        1200px;
  --tb-ease:        cubic-bezier(.22, .61, .36, 1);
}

/* ---------- ریست ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--tb-header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Vazirmatn, "Segoe UI", Tahoma, sans-serif;
  background: var(--tb-bg);
  color: var(--tb-body);
  font-size: 16px;
  line-height: 1.85;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg, video, canvas { max-width: 100%; display: block; }
a { color: var(--tb-gold-2); text-decoration: none; transition: color .2s var(--tb-ease); }
a:hover { color: var(--tb-gold-soft); }

h1, h2, h3, h4, h5 { color: var(--tb-ink); line-height: 1.5; margin: 0 0 .6rem; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
p  { margin: 0 0 1rem; }

ul, ol { margin: 0 0 1rem; padding-inline-start: 1.35rem; }
li { margin-bottom: .4rem; }

::selection { background: rgba(112, 64, 156, .55); color: #fff; }

:focus-visible {
  outline: 2px solid var(--tb-gold-2);
  outline-offset: 3px;
  border-radius: 6px;
}

/* اسکرولبار */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--tb-bg-2); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--tb-purple), var(--tb-purple-dark));
  border-radius: 8px;
  border: 2px solid var(--tb-bg-2);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--tb-purple-2), var(--tb-purple)); }

/* ---------- ابزارها ---------- */
.tb-wrap { width: min(100% - 2.5rem, var(--tb-maxw)); margin-inline: auto; }
.tb-num { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.tb-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.tb-skip {
  position: absolute; inset-inline-start: 50%; top: -60px; transform: translateX(50%);
  z-index: 200; background: var(--tb-purple); color: #fff; padding: .6rem 1.2rem;
  border-radius: 0 0 .8rem .8rem; transition: top .25s var(--tb-ease);
}
.tb-skip:focus { top: 0; color: #fff; }

.tb-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .82rem; font-weight: 600; letter-spacing: .02em;
  color: var(--tb-gold-2); background: rgba(183, 138, 67, .12);
  border: 1px solid rgba(183, 138, 67, .32);
  padding: .35rem .9rem; border-radius: 999px; margin-bottom: 1rem;
}
.tb-eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--tb-gold-2); box-shadow: 0 0 12px var(--tb-gold-2);
}

.tb-lead { font-size: 1.07rem; color: var(--tb-body); max-width: 68ch; }
.tb-muted { color: var(--tb-muted); }
.tb-center { text-align: center; }
.tb-center .tb-lead { margin-inline: auto; }

.tb-grad-text {
  background: linear-gradient(100deg, #f1dfb8, #e6c98f 30%, #c9a7e6 70%, #8955b5);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- دکمهها ---------- */
.tb-btn {
  --btn-bg: var(--tb-gradient-brand);
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: inherit; font-size: .95rem; font-weight: 600; line-height: 1;
  padding: .85rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-align: center; white-space: nowrap;
  transition: transform .18s var(--tb-ease), box-shadow .25s var(--tb-ease),
              background-color .2s var(--tb-ease), color .2s var(--tb-ease);
}
.tb-btn:hover { transform: translateY(-2px); }
.tb-btn:active { transform: translateY(0); }

.tb-btn-primary {
  background: var(--btn-bg); color: #fff;
  box-shadow: 0 10px 30px rgba(66, 36, 85, .55), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.tb-btn-primary:hover { color: #fff; box-shadow: 0 16px 40px rgba(112, 64, 156, .55); }

.tb-btn-gold {
  background: var(--tb-gradient-gold); color: #241640;
  box-shadow: 0 10px 30px rgba(183, 138, 67, .35);
}
.tb-btn-gold:hover { color: #241640; }

.tb-btn-ghost {
  background: rgba(255, 255, 255, .04); color: var(--tb-ink);
  border-color: var(--tb-line);
}
.tb-btn-ghost:hover { color: var(--tb-ink); border-color: var(--tb-purple-line); background: rgba(112, 64, 156, .16); }

.tb-btn-sm { padding: .6rem 1.1rem; font-size: .88rem; }
.tb-btn-block { width: 100%; }

/* ---------- سربرگ ---------- */
.tb-header {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 100;
  height: var(--tb-header-h);
  display: flex; align-items: center;
  background: rgba(11, 17, 32, .72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-block-end: 1px solid transparent;
  transition: background-color .3s var(--tb-ease), border-color .3s var(--tb-ease);
}
.tb-header.is-stuck {
  background: rgba(11, 17, 32, .92);
  border-block-end-color: var(--tb-line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.tb-header .tb-wrap {
  display: flex; align-items: center; gap: 1.25rem; width: min(100% - 2.5rem, var(--tb-maxw));
}

.tb-brand { display: inline-flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.tb-brand img { width: 38px; height: 38px; border-radius: 11px; }
.tb-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.tb-brand-name { font-weight: 800; font-size: 1.12rem; color: var(--tb-ink); }
.tb-brand-sub { font-size: .68rem; color: var(--tb-muted); letter-spacing: .01em; }

.tb-nav { display: flex; align-items: center; gap: .3rem; margin-inline-start: auto; }
.tb-nav a {
  position: relative; padding: .5rem .85rem; border-radius: 999px;
  font-size: .93rem; font-weight: 600; color: var(--tb-body);
}
.tb-nav a::after {
  content: ""; position: absolute; inset-block-end: 3px; inset-inline: 50%;
  width: 0; height: 2px; border-radius: 2px;
  background: var(--tb-gradient-gold); transition: width .25s var(--tb-ease), inset-inline .25s var(--tb-ease);
}
.tb-nav a:hover { color: var(--tb-ink); background: rgba(255, 255, 255, .05); }
.tb-nav a:hover::after, .tb-nav a[aria-current="page"]::after { width: 55%; inset-inline-start: 22%; }
.tb-nav a[aria-current="page"] { color: var(--tb-gold-2); }

.tb-header-cta { display: flex; align-items: center; gap: .6rem; }

.tb-burger {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--tb-line);
  color: var(--tb-ink); font-size: 1.25rem; cursor: pointer;
  align-items: center; justify-content: center;
}

.tb-mobile-nav {
  position: fixed; inset: var(--tb-header-h) 0 auto 0; z-index: 99;
  background: rgba(11, 17, 32, .97); border-block-end: 1px solid var(--tb-line);
  padding: 1rem 1.25rem 1.5rem; display: none;
  backdrop-filter: blur(14px);
}
.tb-mobile-nav.is-open { display: block; animation: tbSlide .25s var(--tb-ease); }
.tb-mobile-nav a {
  display: block; padding: .75rem .5rem; color: var(--tb-body);
  font-weight: 600; border-block-end: 1px solid var(--tb-line-soft);
}
.tb-mobile-nav a:last-of-type { border-block-end: 0; }
@keyframes tbSlide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- هیرو ---------- */
.tb-hero {
  position: relative; padding: calc(var(--tb-header-h) + 24px) 0 52px;
  overflow: hidden; isolation: isolate;
  background: var(--tb-bg);
}
.tb-hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
}
.tb-hero-copy { max-width: 40rem; }
.tb-hero-media {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 52%; min-width: 0; z-index: -1; pointer-events: none;
}
.tb-hero-media video {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  /* محو شدن لبه رو به متن و لبه پایین تا هیچ مرزی دیده نشود */
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 32%), linear-gradient(to top, transparent 0, #000 18%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to left, transparent 0, #000 32%), linear-gradient(to top, transparent 0, #000 18%);
  mask-composite: intersect;
}
.tb-orb {
  position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px);
  pointer-events: none; opacity: .55;
}
.tb-orb-1 { width: 460px; height: 460px; inset-inline-start: -120px; inset-block-start: -80px;
  background: radial-gradient(circle, rgba(112, 64, 156, .85), transparent 65%); animation: tbFloat 16s ease-in-out infinite; }
.tb-orb-2 { width: 380px; height: 380px; inset-inline-end: -100px; inset-block-start: 120px;
  background: radial-gradient(circle, rgba(183, 138, 67, .55), transparent 65%); animation: tbFloat 20s ease-in-out infinite reverse; }
.tb-orb-3 { width: 320px; height: 320px; inset-block-end: -120px; inset-inline-start: 38%;
  background: radial-gradient(circle, rgba(95, 138, 128, .45), transparent 65%); animation: tbFloat 24s ease-in-out infinite; }
@keyframes tbFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(24px, -32px, 0) scale(1.08); }
}

.tb-hero h1 { margin-bottom: .9rem; }
.tb-hero .tb-hero-actions { margin-top: 1.3rem; }
.tb-hero .tb-hero-stats { margin-top: 1.4rem; padding-top: 1.1rem; }
.tb-hero .tb-tag-row { margin-top: 1.1rem; margin-right: 45px; }
.tb-hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

.tb-hero-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem; margin-top: 2.4rem; padding-top: 1.6rem;
  border-block-start: 1px solid var(--tb-line);
}
.tb-stat-v {
  font-size: 2rem; font-weight: 800; color: var(--tb-gold-2);
  text-shadow: 0 0 16px rgba(230, 201, 143, .55), 0 0 44px rgba(183, 138, 67, .35);
}
.tb-stat-l { font-size: .82rem; color: var(--tb-muted); }

.tb-stage {
  position: relative; aspect-ratio: 1 / 1; min-height: 340px; max-height: 560px;
  border-radius: var(--tb-radius-lg);
  background:
    radial-gradient(80% 80% at 50% 10%, rgba(112, 64, 156, .28), transparent 70%),
    linear-gradient(160deg, rgba(21, 29, 46, .9), rgba(11, 17, 32, .6));
  border: 1px solid var(--tb-line);
  box-shadow: var(--tb-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .05);
  overflow: hidden;
}
.tb-stage canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.tb-stage-hint {
  position: absolute; inset-block-end: 14px; inset-inline: 0; text-align: center;
  font-size: .78rem; color: var(--tb-faint); pointer-events: none;
}
.tb-stage-fallback { display: none; }
.tb-stage.is-fallback .tb-stage-fallback { display: grid; place-items: center; height: 100%; }
.tb-stage.is-fallback canvas { display: none; }

.tb-tag-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.6rem; }
.tb-tag {
  font-size: .8rem; color: var(--tb-muted); background: rgba(255, 255, 255, .04);
  border: 1px solid var(--tb-line); border-radius: 999px; padding: .3rem .8rem;
}

/* ---------- بخشها ---------- */
.tb-section { padding: clamp(3.5rem, 7vw, 6rem) 0; position: relative; }
.tb-section-alt { background: linear-gradient(180deg, var(--tb-bg-2), var(--tb-bg)); }
.tb-section-head { max-width: 60rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.tb-section-head.tb-center { margin-inline: auto; }

.tb-rule {
  height: 1px; border: 0; margin: 0;
  background: linear-gradient(90deg, transparent, var(--tb-purple-line), transparent);
}

/* ---------- کارتها ---------- */
.tb-card {
  position: relative; background: linear-gradient(165deg, var(--tb-card), var(--tb-card-2));
  border: 1px solid var(--tb-line); border-radius: var(--tb-radius);
  padding: 1.6rem; overflow: hidden;
  transition: transform .3s var(--tb-ease), border-color .3s var(--tb-ease), box-shadow .3s var(--tb-ease);
  transform-style: preserve-3d;
}
.tb-card::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 2px;
  background: var(--tb-gradient-gold); opacity: 0; transition: opacity .3s var(--tb-ease);
}
.tb-card:hover {
  border-color: var(--tb-purple-line);
  box-shadow: var(--tb-shadow-lg);
}
.tb-card:hover::before { opacity: 1; }
.tb-card h3 { margin-bottom: .5rem; }
.tb-card p { color: var(--tb-muted); margin-bottom: .75rem; font-size: .95rem; }

.tb-icon {
  width: 52px; height: 52px; border-radius: 15px; margin-bottom: 1.1rem;
  display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(140deg, rgba(112, 64, 156, .45), rgba(66, 36, 85, .35));
  border: 1px solid var(--tb-purple-line); color: var(--tb-gold-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.tb-icon svg { width: 26px; height: 26px; }

.tb-grid { display: grid; gap: 1.15rem; }
.tb-grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.tb-grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.tb-grid-4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.tb-link-more {
  display: inline-flex; align-items: center; gap: .35rem;
  font-weight: 600; font-size: .9rem; color: var(--tb-gold-2);
}
.tb-link-more::after { content: "\2190"; transition: transform .2s var(--tb-ease); }
.tb-link-more:hover::after { transform: translateX(-4px); }

.tb-chip-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.tb-chip {
  font-size: .74rem; font-weight: 600; padding: .22rem .7rem; border-radius: 999px;
  background: var(--tb-purple-soft); color: #d9c2f0; border: 1px solid var(--tb-purple-line);
}
.tb-chip-gold { background: rgba(183, 138, 67, .14); color: var(--tb-gold-2); border-color: rgba(183, 138, 67, .35); }
.tb-chip-green { background: rgba(93, 128, 102, .18); color: #a7d6b4; border-color: rgba(93, 128, 102, .4); }
.tb-chip-info { background: rgba(95, 138, 128, .18); color: #9ed2c8; border-color: rgba(95, 138, 128, .4); }

/* ---------- مسیر بردکرامب ---------- */
.tb-crumbs { font-size: .84rem; color: var(--tb-faint); margin-bottom: 1rem; }
.tb-crumbs a { color: var(--tb-muted); }
.tb-crumbs a:hover { color: var(--tb-gold-2); }

/* ---------- هدر صفحههای داخلی ---------- */
.tb-page-hero { padding: calc(var(--tb-header-h) + 56px) 0 44px; position: relative; overflow: hidden; }
.tb-page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--tb-gradient-glow);
}
.tb-page-hero h1 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); }

/* ---------- ویدیوها ---------- */
.tb-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: .85rem; margin-bottom: 1.6rem;
  background: var(--tb-card); border: 1px solid var(--tb-line); border-radius: var(--tb-radius);
}
.tb-filter-btn {
  font-family: inherit; font-size: .87rem; font-weight: 600; cursor: pointer;
  padding: .5rem 1rem; border-radius: 999px; color: var(--tb-muted);
  background: transparent; border: 1px solid transparent;
  transition: all .2s var(--tb-ease);
}
.tb-filter-btn:hover { color: var(--tb-ink); background: rgba(255, 255, 255, .05); }
.tb-filter-btn[aria-pressed="true"] {
  color: #fff; background: var(--tb-gradient-brand);
  box-shadow: 0 8px 22px rgba(112, 64, 156, .4);
}
.tb-search {
  margin-inline-start: auto; display: flex; align-items: center; gap: .5rem;
  background: var(--tb-bg); border: 1px solid var(--tb-line);
  border-radius: 999px; padding: .4rem .9rem; min-width: 220px;
}
.tb-search input {
  background: none; border: 0; color: var(--tb-ink); font-family: inherit;
  font-size: .9rem; width: 100%; outline: none;
}
.tb-search input::placeholder { color: var(--tb-faint); }
.tb-search svg { width: 18px; height: 18px; color: var(--tb-faint); flex-shrink: 0; }

.tb-video-grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tb-video-card {
  display: flex; flex-direction: column; text-align: start; cursor: pointer;
  background: linear-gradient(170deg, var(--tb-card), var(--tb-card-2));
  border: 1px solid var(--tb-line); border-radius: var(--tb-radius);
  overflow: hidden; padding: 0; font-family: inherit; color: inherit;
  transition: transform .3s var(--tb-ease), box-shadow .3s var(--tb-ease), border-color .3s var(--tb-ease);
}
.tb-video-card:hover {
  transform: translateY(-6px); border-color: var(--tb-purple-line);
  box-shadow: 0 20px 50px rgba(3, 7, 18, .65);
}
.tb-video-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--tb-elevated); }
.tb-video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--tb-ease); }
.tb-video-card:hover .tb-video-thumb img { transform: scale(1.06); }
.tb-video-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(11, 17, 32, .85));
}
.tb-play {
  position: absolute; inset-block-start: 50%; inset-inline-start: 50%;
  transform: translate(-50%, -50%); width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; z-index: 2;
  background: rgba(11, 17, 32, .72); border: 1px solid rgba(230, 201, 143, .55);
  color: var(--tb-gold-2); backdrop-filter: blur(6px);
  transition: transform .25s var(--tb-ease), background-color .25s var(--tb-ease);
}
.tb-video-card:hover .tb-play {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(112, 64, 156, .85);
}
.tb-play svg { width: 24px; height: 24px; margin-inline-start: 3px; }
.tb-dur {
  position: absolute; inset-block-end: 10px; inset-inline-end: 10px; z-index: 2;
  font-size: .76rem; font-weight: 600; color: #fff;
  background: rgba(11, 17, 32, .82); border: 1px solid rgba(255, 255, 255, .14);
  padding: .15rem .55rem; border-radius: 6px;
}
.tb-video-body { padding: 1.15rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.tb-video-body h3 { font-size: 1.03rem; margin: 0; }
.tb-video-body p { font-size: .9rem; color: var(--tb-muted); margin: 0; }
.tb-video-meta {
  display: flex; align-items: center; gap: .8rem; margin-block-start: auto;
  padding-block-start: .7rem; border-block-start: 1px dashed var(--tb-line);
  font-size: .79rem; color: var(--tb-faint);
}
.tb-video-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.tb-video-meta svg { width: 15px; height: 15px; }
.tb-num-badge {
  position: absolute; inset-block-start: 12px; inset-inline-start: 12px; z-index: 2;
  font-weight: 800; font-size: .8rem; color: #241640;
  background: var(--tb-gradient-gold); padding: .2rem .6rem; border-radius: 8px;
}

/* ---------- مودال ---------- */
.tb-modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 1.25rem;
  background: rgba(4, 8, 16, .82); backdrop-filter: blur(6px);
}
.tb-modal.is-open { display: flex; animation: tbFade .2s var(--tb-ease); }
@keyframes tbFade { from { opacity: 0; } to { opacity: 1; } }
.tb-modal-box {
  width: min(100%, 900px); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(170deg, var(--tb-card), var(--tb-bg-2));
  border: 1px solid var(--tb-line); border-radius: var(--tb-radius-lg);
  box-shadow: var(--tb-shadow-lg);
  animation: tbPop .28s var(--tb-ease);
}
@keyframes tbPop { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.tb-modal-head {
  position: sticky; inset-block-start: 0; z-index: 3;
  display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem 1.5rem;
  background: rgba(21, 29, 46, .96); border-block-end: 1px solid var(--tb-line);
  backdrop-filter: blur(8px);
}
.tb-modal-head h2 { font-size: 1.2rem; margin: 0; }
.tb-modal-head .tb-chip-row { margin: 0 0 .5rem; }
.tb-modal-close {
  margin-inline-start: auto; width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 11px; border: 1px solid var(--tb-line); cursor: pointer;
  background: rgba(255, 255, 255, .05); color: var(--tb-ink); font-size: 1.05rem;
}
.tb-modal-close:hover { background: rgba(161, 95, 77, .35); border-color: var(--tb-red); }
.tb-modal-body { padding: 1.5rem; }
.tb-player {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--tb-radius);
  overflow: hidden; background: #060b16; border: 1px solid var(--tb-line);
}
.tb-player video { width: 100%; height: 100%; background: #060b16; display: block; }
.tb-player-note {
  position: absolute; inset: 0; display: grid; place-content: center; gap: .5rem;
  text-align: center; padding: 1.5rem; font-size: .88rem; color: var(--tb-muted);
  background: linear-gradient(160deg, rgba(21, 29, 46, .96), rgba(11, 17, 32, .96));
}
.tb-player-note strong { color: var(--tb-gold-2); }
.tb-player-note code {
  direction: ltr; display: inline-block; font-size: .8rem; color: #d9c2f0;
  background: rgba(112, 64, 156, .2); padding: .2rem .55rem; border-radius: 6px;
}

.tb-chapters { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.tb-chapters li {
  display: flex; gap: .9rem; align-items: flex-start;
  padding: .7rem 0; border-block-end: 1px dashed var(--tb-line-soft);
}
.tb-chapters li:last-child { border-block-end: 0; }
.tb-chapters time {
  flex-shrink: 0; font-weight: 700; font-size: .85rem; color: var(--tb-gold-2);
  background: rgba(183, 138, 67, .12); border: 1px solid rgba(183, 138, 67, .3);
  border-radius: 8px; padding: .1rem .5rem; min-width: 62px; text-align: center;
}

/* ---------- جدول ---------- */
.tb-table-wrap { overflow-x: auto; border: 1px solid var(--tb-line); border-radius: var(--tb-radius); }
.tb-table { width: 100%; border-collapse: collapse; background: var(--tb-card); font-size: .92rem; }
.tb-table th, .tb-table td { padding: .8rem 1rem; text-align: start; border-block-end: 1px solid var(--tb-line-soft); }
.tb-table th { color: var(--tb-gold-2); font-weight: 700; white-space: nowrap; background: rgba(183, 138, 67, .07); }
.tb-table tbody tr:last-child td { border-block-end: 0; }
.tb-table tbody tr:hover { background: rgba(112, 64, 156, .12); }

/* ---------- آکاردئون ---------- */
.tb-faq { display: grid; gap: .8rem; }
.tb-faq details {
  background: var(--tb-card); border: 1px solid var(--tb-line);
  border-radius: var(--tb-radius-sm); overflow: hidden;
}
.tb-faq details[open] { border-color: var(--tb-purple-line); }
.tb-faq summary {
  cursor: pointer; list-style: none;
  /* عنوان سوال از راست چیده می‌شود؛ سمت چپ برای علامت + خالی می‌ماند */
  padding: 1rem 1.2rem; padding-inline-end: 3.4rem;
  font-weight: 700; color: var(--tb-ink);
  display: flex; align-items: flex-start; gap: .75rem;
  position: relative;
  text-align: start;
}
.tb-faq summary::-webkit-details-marker { display: none; }
.tb-faq summary::before {
  content: "+"; position: absolute; inset-inline-end: 1.15rem; inset-block-start: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem; line-height: 1; color: var(--tb-gold-2); flex-shrink: 0;
  transition: transform .25s var(--tb-ease);
}
.tb-faq details[open] summary::before { transform: translateY(-50%) rotate(45deg); }
.tb-faq p { margin: 0; padding: 0 1.2rem 1.1rem; text-align: start; color: var(--tb-muted); font-size: .94rem; }

/* ---------- تایمライン ---------- */
.tb-steps { counter-reset: tbstep; list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.tb-steps li {
  counter-increment: tbstep; position: relative;
  /* جای عدد: سمت راست در حالت راست‌به‌چپ؛ حداقل ۴۵ پیکسل فضای خالی تا زیر عدد نرود */
  padding: 1.2rem 1.3rem;
  padding-inline-start: 4.8rem;
  background: var(--tb-card); border: 1px solid var(--tb-line); border-radius: var(--tb-radius-sm);
}
.tb-steps li::before {
  content: counter(tbstep, persian); position: absolute; inset-inline-start: 1.1rem;
  inset-block-start: 1.15rem; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 800; color: #241640;
  background: var(--tb-gradient-gold);
}
.tb-steps h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.tb-steps p { margin: 0; color: var(--tb-muted); font-size: .93rem; }

/* ---------- CTA ---------- */
.tb-cta {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(2.5rem, 5vw, 4rem) 1.5rem;
  border-radius: var(--tb-radius-lg);
  background: var(--tb-gradient-brand);
  border: 1px solid var(--tb-purple-line);
  box-shadow: 0 24px 70px rgba(66, 36, 85, .45);
}
.tb-cta::after {
  content: ""; position: absolute; inset-block-start: -40%; inset-inline-start: 20%;
  width: 60%; height: 180%; border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 201, 143, .22), transparent 60%);
  pointer-events: none;
}
.tb-cta h2 { position: relative; }
.tb-cta p { position: relative; color: #e6dcf3; max-width: 60ch; margin-inline: auto; }
.tb-cta .tb-hero-actions { justify-content: center; position: relative; }

/* ---------- فوتر ---------- */
.tb-footer {
  margin-block-start: 2rem; padding: 3rem 0 1.5rem;
  background: linear-gradient(180deg, var(--tb-bg-2), #070c17);
  border-block-start: 1px solid var(--tb-line);
}
.tb-footer-grid {
  display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
}
.tb-footer h3 { font-size: .95rem; margin-bottom: .9rem; color: var(--tb-gold-2); }
.tb-footer ul { list-style: none; padding: 0; margin: 0; }
.tb-footer li { margin-bottom: .5rem; }
.tb-footer a { color: var(--tb-muted); font-size: .9rem; }
.tb-footer a:hover { color: var(--tb-gold-2); }
.tb-footer-bottom {
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between;
  align-items: center; margin-block-start: 2.5rem; padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--tb-line-soft); font-size: .83rem; color: var(--tb-faint);
}
.tb-social { display: flex; gap: .5rem; }
.tb-social a {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--tb-line); color: var(--tb-muted);
}
.tb-social a:hover { color: var(--tb-gold-2); border-color: var(--tb-purple-line); }
.tb-social svg { width: 18px; height: 18px; }

/* ---------- انیمیشن ورود ---------- */
.tb-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--tb-ease), transform .7s var(--tb-ease); }
.tb-reveal.is-in { opacity: 1; transform: none; }
.tb-reveal[data-delay="1"] { transition-delay: .09s; }
.tb-reveal[data-delay="2"] { transition-delay: .18s; }
.tb-reveal[data-delay="3"] { transition-delay: .27s; }
.tb-reveal[data-delay="4"] { transition-delay: .36s; }

/* ---------- نوار پیشرفت خواندن ---------- */
.tb-progress {
  position: fixed; inset-block-start: 0; inset-inline: 0; height: 3px; z-index: 150;
  background: var(--tb-gradient-gold); transform-origin: 100% 50%;
  transform: scaleX(0); transition: transform .1s linear;
}

/* ---------- تصویر پرسپکتیو در مقالات ---------- */
.tb-feat-media {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(1.5rem, 4vw, 3rem); align-items: center; margin-bottom: 1.5rem;
}
.tb-persp { margin: 0; perspective: 1100px; }
.tb-persp img {
  display: block; width: 100%; height: auto; aspect-ratio: auto;
  border-radius: var(--tb-radius); border: 1px solid var(--tb-line);
  transform: rotateY(-16deg) rotateX(3deg);
  transform-origin: center;
  box-shadow: -28px 30px 60px rgba(3, 7, 18, .65), 0 0 0 1px rgba(137, 85, 181, .18);
  transition: transform .45s var(--tb-ease);
  background: #fff;
}
.tb-persp:hover img { transform: rotateY(-6deg) rotateX(1deg); }
.tb-persp figcaption {
  margin-top: .8rem; font-size: .84rem; color: var(--tb-faint); text-align: center;
}
@media (max-width: 860px) {
  .tb-feat-media { grid-template-columns: 1fr; }
  .tb-persp img { transform: rotateY(-8deg); max-width: 420px; margin-inline: auto; }
}

/* ---------- فرم ---------- */
.tb-form { display: grid; gap: 1.1rem; }
.tb-form-2col { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tb-field label { display: block; font-weight: 700; font-size: .92rem; color: var(--tb-ink); margin-bottom: .45rem; }
.tb-field label .tb-req { color: var(--tb-gold-2); }
.tb-field input, .tb-field textarea {
  width: 100%; font-family: inherit; font-size: .95rem; color: var(--tb-ink);
  background: var(--tb-bg); border: 1px solid var(--tb-line); border-radius: .8rem;
  padding: .7rem .95rem; transition: border-color .2s var(--tb-ease), box-shadow .2s var(--tb-ease);
}
.tb-field textarea { min-height: 120px; resize: vertical; }
.tb-field input:focus, .tb-field textarea:focus {
  outline: none; border-color: var(--tb-purple-2);
  box-shadow: 0 0 0 3px rgba(112, 64, 156, .28);
}
.tb-field input::placeholder, .tb-field textarea::placeholder { color: var(--tb-faint); }
.tb-form-err { color: #f0a49a; font-size: .88rem; min-height: 1.6em; margin: 0; }
.tb-form-ok {
  background: rgba(93, 128, 102, .14); border: 1px solid rgba(93, 128, 102, .45);
  border-radius: var(--tb-radius); padding: 2rem; text-align: center;
}
.tb-form-ok strong { color: #a7d6b4; }

/* ---------- داستان اسکرول (ویدیو اسکرول‌درایو سمت راست) ---------- */
.tb-scroll-story {
  position: relative;
  padding: calc(var(--tb-header-h) + 40px) 0 80px;
  background: linear-gradient(180deg, var(--tb-bg) 0%, var(--tb-bg-2) 50%, var(--tb-bg) 100%);
}
.tb-story-text {
  display: flex; flex-direction: column;
  gap: clamp(70vh, 90vh, 110vh);
  max-width: 34rem;
  /* فاصله از ویدیوی ثابت سمت راست */
  margin-inline-end: clamp(200px, 32vw, 460px);
}
.tb-story-block {
  opacity: .35; transform: translateY(14px);
  transition: opacity .5s var(--tb-ease), transform .5s var(--tb-ease);
}
.tb-story-block.is-active { opacity: 1; transform: none; }
.tb-story-block h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
.tb-story-block p { color: var(--tb-muted); font-size: 1.05rem; }

/* ویدیوی ثابت سمت راست — بدون کادر، محو در پس‌زمینه */
.tb-scroll-video {
  position: fixed;
  top: 50%;
  inset-inline-end: clamp(-40px, 2vw, 2rem);
  transform: translateY(-50%);
  width: clamp(280px, 34vw, 480px);
  aspect-ratio: 9 / 16;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s var(--tb-ease);
}
.tb-scroll-video.is-visible { opacity: 1; }
.tb-scroll-video video {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  /* مرز کاملاً محو — ویدیو در پس‌زمینه ادغام می‌شود */
  -webkit-mask-image:
    linear-gradient(to right, #000 30%, transparent 95%),
    linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, #000 30%, transparent 95%),
    linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
  mask-composite: intersect;
}
.tb-scroll-hint {
  position: absolute; inset-inline-end: 10px; bottom: 10px;
  font-size: .72rem; color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
  padding: .2rem .6rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap: .35rem;
}
.tb-scroll-hint::before {
  content: ""; width: 14px; height: 2px;
  background: linear-gradient(90deg, transparent, #fff);
  animation: tbScrollNudge 1.6s ease-in-out infinite;
}
@keyframes tbScrollNudge {
  0%, 100% { transform: translateX(0); opacity: .5; }
  50% { transform: translateX(-4px); opacity: 1; }
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 1024px) {
  .tb-hero-grid { grid-template-columns: 1fr; }
  .tb-hero-media { position: static; width: 100%; z-index: auto; }
  .tb-hero-media video {
    aspect-ratio: 16 / 10;
    -webkit-mask-image: linear-gradient(to top, transparent 0, #000 22%);
    mask-image: linear-gradient(to top, transparent 0, #000 22%);
  }
  .tb-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .tb-nav, .tb-header-cta .tb-btn { display: none; }
  .tb-burger { display: inline-flex; }
  .tb-header .tb-wrap { justify-content: space-between; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .tb-hero-stats { grid-template-columns: 1fr 1fr; gap: .5rem 1rem; }
  .tb-footer-grid { grid-template-columns: 1fr; }
  .tb-search { min-width: 100%; }
  .tb-modal-body { padding: 1rem; }
  .tb-scroll-video { display: none; }
  .tb-story-text { margin-inline-end: 0; }
  .tb-story-block { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .tb-reveal { opacity: 1; transform: none; }
}

@media print {
  .tb-header, .tb-footer, .tb-modal, .tb-progress, .tb-stage { display: none !important; }
  body { background: #fff; color: #000; }
}
