/* ==========================================================================
   XO — Landing / لینک‌دونی
   Design tokens are copied verbatim from xoaii-v2 (app/globals.css +
   tailwind.config.ts) so this page and the main site are visually identical.
   ========================================================================== */

@font-face {
  font-family: 'Vazirmatn';
  src: url('assets/fonts/Vazirmatn-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink-0: 7 6 4;
  --ink-1: 14 12 8;
  --ink-2: 21 18 11;
  --ink-3: 29 25 16;
  --fg: 244 236 216;
  --fg-muted: 155 143 114;
  --fg-dim: 94 85 63;
  --accent-gold: 212 175 55;
  --accent-gold-bright: 245 215 110;
  --accent-gold-deep: 169 130 30;
  --line: 255 255 255;

  --gold-gradient: linear-gradient(135deg, #f5d76e 0%, #d4af37 50%, #a9821e 100%);
  --maxw: 1280px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  margin: 0;
  padding: 0;
  background: rgb(var(--ink-0));
  color: rgb(var(--fg));
  font-family: 'Vazirmatn', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7; /* Persian script needs more breathing room than Latin */
  overflow-x: hidden;
}

::selection { background: rgba(212, 175, 55, 0.4); color: #070604; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgb(var(--ink-0)); }
::-webkit-scrollbar-thumb { background: rgb(var(--ink-3)); border-radius: 8px; border: 2px solid rgb(var(--ink-0)); }
::-webkit-scrollbar-thumb:hover { background: rgb(var(--fg-dim)); }

/* ── Layout primitives (mirrors .container-x / .section) ── */
.container-x {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}
.section { padding-block: clamp(64px, 10vw, 128px); position: relative; }

/* ── Glass ── */
.glass {
  background: linear-gradient(180deg, rgba(212,175,55,0.05) 0%, rgba(212,175,55,0.01) 100%);
  border: 1px solid rgba(212,175,55,0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.glass-strong {
  background: rgba(14, 12, 8, 0.92);
  border: 1px solid rgba(212,175,55,0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ── Type ── */
.text-accent-gradient {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: 0; } /* negative tracking breaks joined Persian script */
h1 { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.3; font-weight: 800; }
h2 { font-size: clamp(1.625rem, 3vw, 2rem); line-height: 1.35; font-weight: 700; }
h3 { font-size: 1.375rem; line-height: 1.45; font-weight: 700; }
p { margin: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.25);
  color: #f5d76e;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.muted { color: rgb(var(--fg-muted)); }
.dim   { color: rgb(var(--fg-dim)); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease-out, box-shadow 0.2s ease-out, background 0.2s;
  white-space: nowrap;
  border: none;
  outline: none;
  font-family: inherit;
}
.btn:focus-visible { box-shadow: 0 0 0 2px rgb(var(--ink-0)), 0 0 0 4px #d4af37; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--gold-gradient); color: #070604; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px -12px rgba(212,175,55,0.55); }
.btn-ghost {
  background: rgb(var(--line) / 0.04);
  color: rgb(var(--fg));
  border: 1px solid rgb(var(--line) / 0.08);
}
.btn-ghost:hover { background: rgb(var(--line) / 0.08); border-color: rgb(var(--line) / 0.16); transform: translateY(-2px); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; border-radius: 10px; }

/* ==========================================================================
   Atmosphere — the founder photo as an ambient backdrop, not a wallpaper.
   Three stacked layers: a blurred colour bloom from the photo, the gold
   radial the main site uses, and a dot grid. All fixed, all behind content.
   ========================================================================== */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
/* The photo is mostly black, so a plain blur averages to nothing. `screen`
   drops the blacks entirely and lets only the neon ring bloom through —
   the portrait lights the page instead of sitting behind it as wallpaper. */
.atmosphere__photo {
  position: absolute;
  top: -22vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(1150px, 175vw);
  aspect-ratio: 1;
  background: url('assets/course/founder.jpeg') center / cover no-repeat;
  filter: blur(58px) saturate(2.6) brightness(2.1);
  mix-blend-mode: screen;
  opacity: 1;
  /* Feather the square edges away so it reads as light, not as an image. */
  -webkit-mask-image: radial-gradient(circle at 50% 44%, #000 0%, #000 34%, transparent 72%);
          mask-image: radial-gradient(circle at 50% 44%, #000 0%, #000 34%, transparent 72%);
}
/* A second, sharper pass keeps a hint of the actual silhouette readable. */
.atmosphere__ghost {
  position: absolute;
  top: -6vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, 96vw);
  aspect-ratio: 1;
  background: url('assets/course/founder.jpeg') center / cover no-repeat;
  filter: blur(12px) saturate(1.5);
  opacity: 0.34;
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 0%, #000 30%, transparent 64%);
          mask-image: radial-gradient(circle at 50% 46%, #000 0%, #000 30%, transparent 64%);
}
.atmosphere__gold {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(212,175,55,0.18), transparent 60%);
}
.atmosphere__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(212,175,55,0.10) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
/* Bottom vignette — content always lands on solid ink, never on noise. */
.atmosphere__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7,6,4,0.12) 0%, rgba(7,6,4,0.55) 42%, rgba(7,6,4,0.92) 72%, rgb(7,6,4) 100%);
}

/* ==========================================================================
   Hero portrait — the same photo again, this time sharp, in a gold ring.
   ========================================================================== */
.portrait {
  position: relative;
  width: clamp(150px, 42vw, 208px);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 50%;
  padding: 5px;
  background: var(--gold-gradient);
  box-shadow: 0 24px 70px -20px rgba(212,175,55,0.55);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgb(var(--ink-0));
}
/* Slow halo pulse behind the ring. */
.portrait::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px solid rgba(212,175,55,0.28);
  animation: halo 4.5s ease-in-out infinite;
}
@keyframes halo {
  0%, 100% { transform: scale(1);    opacity: 0.75; }
  50%      { transform: scale(1.06); opacity: 0.25; }
}

.hero { text-align: center; padding-block: clamp(48px, 9vh, 88px) clamp(32px, 6vh, 56px); }
.hero__logo { width: 54px; height: 54px; margin: 0 auto 22px; filter: drop-shadow(0 10px 30px rgba(212,175,55,0.45)); }
.hero__name { margin-top: 22px; font-size: clamp(1.75rem, 6vw, 2.5rem); font-weight: 800; }
.hero__role { margin-top: 10px; font-size: 15px; color: rgb(var(--fg-muted)); }
.hero__tagline { margin-top: 14px; font-size: 15px; color: rgb(var(--fg-muted)); max-width: 30rem; margin-inline: auto; line-height: 1.9; }

/* Proof strip */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 30rem; margin: 26px auto 0; }
.stats > div { border-radius: 14px; padding: 14px 8px; text-align: center; }
.stats b { display: block; font-size: clamp(0.95rem, 3.4vw, 1.25rem); font-weight: 800; }
.stats span { display: block; margin-top: 3px; font-size: 11px; color: rgb(var(--fg-muted)); line-height: 1.5; }

/* ==========================================================================
   Link rows
   ========================================================================== */
.links { display: grid; gap: 12px; max-width: 34rem; margin-inline: auto; }

.link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  transition: transform 0.16s ease-out, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.link:hover { transform: translateY(-3px); border-color: rgba(212,175,55,0.4); }

.link__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgb(var(--line) / 0.05);
  border: 1px solid rgb(var(--line) / 0.07);
}
.link__icon img, .link__icon svg { width: 24px; height: 24px; }

.link__text { flex: 1; min-width: 0; }
.link__title { display: block; font-weight: 600; font-size: 15px; line-height: 1.45; }
.link__sub { display: block; font-size: 12px; color: rgb(var(--fg-muted)); margin-top: 2px; line-height: 1.5; }

.link__arrow { flex-shrink: 0; color: rgb(var(--fg-dim)); transition: transform 0.2s, color 0.2s; }
.link:hover .link__arrow { color: rgb(var(--accent-gold)); transform: translateX(-4px); } /* RTL: forward is left */

/* The one gold row — the course. */
.link--primary {
  background: var(--gold-gradient);
  border: 1px solid rgba(245,215,110,0.5);
  color: #070604;
  box-shadow: 0 14px 46px -14px rgba(212,175,55,0.6);
}
.link--primary .link__icon { background: rgba(7,6,4,0.14); border-color: rgba(7,6,4,0.16); }
.link--primary .link__sub { color: rgba(7,6,4,0.72); }
.link--primary .link__arrow { color: rgba(7,6,4,0.6); }
.link--primary:hover { box-shadow: 0 20px 60px -14px rgba(212,175,55,0.75); }
.link--primary:hover .link__arrow { color: #070604; }

/* Disabled row (YouTube — not live yet). */
.link--off { opacity: 0.4; cursor: not-allowed; filter: grayscale(1); }
.link--off:hover { transform: none; border-color: rgba(212,175,55,0.12); }

.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(212,175,55,0.12);
  border: 1px solid rgba(212,175,55,0.3);
  color: #f5d76e;
  white-space: nowrap;
}
.link--primary .badge { background: rgba(7,6,4,0.16); border-color: rgba(7,6,4,0.2); color: #070604; }
.link--off .badge { background: rgb(var(--line) / 0.06); border-color: rgb(var(--line) / 0.1); color: rgb(var(--fg-muted)); }

/* Section label between link groups */
.links__label {
  max-width: 34rem;
  margin: 30px auto 12px;
  font-size: 11px;
  font-weight: 600;
  color: rgb(var(--fg-dim));
  padding-inline-start: 4px;
}

/* Phones: the course row carries the longest label — give it the full width
   by dropping the badge, which the gold fill already makes redundant. */
@media (max-width: 430px) {
  .link--primary .badge { display: none; }
  .link__title { font-size: 14.5px; }
  .link__sub { font-size: 11.5px; }
}

/* ── Footer ── */
.footer {
  border-top: 1px solid rgb(var(--line) / 0.04);
  margin-top: clamp(48px, 8vh, 88px);
  padding-block: 32px;
  text-align: center;
  font-size: 13px;
  color: rgb(var(--fg-muted));
}
.footer a:hover { color: rgb(var(--fg)); }

/* ── Reveal-on-scroll (mirrors components/ui/Reveal.tsx) ──
   Gated on .js so the content is never hidden if the script fails to run. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
