/* ── Reset & Base ──────────────────────────────────────────── */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #000;
  --text: #f5f5f7;
  --text-muted: rgba(245, 245, 247, 0.5);
  --accent: #2C7BA7;
  --accent-glow: rgba(44, 123, 167, 0.4);
}

/* ── Font Faces ───────────────────────────────────────────── */

@font-face {
  font-family: 'Vazir';
  src: url('/assets/fonts/Vazir-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazir';
  src: url('/assets/fonts/Vazir.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazir';
  src: url('/assets/fonts/Vazir-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazir';
  src: url('/assets/fonts/Vazir-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Body ─────────────────────────────────────────────────── */

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  background-image: radial-gradient(ellipse at 50% 40%, rgba(44, 123, 167, 0.08) 0%, transparent 70%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Font switching ───────────────────────────────────────── */

[dir="rtl"] body {
  font-family: 'Vazir', Tahoma, sans-serif;
}

[dir="ltr"] body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ── Main container ───────────────────────────────────────── */

.container {
  text-align: center;
  padding: 2rem;
  max-width: 600px;
}

/* ── Logo ─────────────────────────────────────────────────── */

.logo-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
  animation: logo-enter 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
}

.logo-wrapper::after {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  opacity: 0;
  animation: glow-pulse 3s ease-in-out 400ms infinite;
  z-index: -1;
}

.logo {
  width: 160px;
  height: auto;
}

@keyframes logo-enter {
  from {
    opacity: 0;
    transform: scale(0.8);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* ── Title ────────────────────────────────────────────────── */

.title-line {
  opacity: 0;
  transform: translateY(20px);
  animation: slide-up 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.title-line-1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  animation-delay: 500ms;
}

.title-line-2 {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-top: 0.25rem;
  animation-delay: 650ms;
}

[dir="rtl"] .title-line-1 {
  font-weight: 700;
  letter-spacing: 0;
}

[dir="rtl"] .title-line-2 {
  font-weight: 400;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Divider ──────────────────────────────────────────────── */

.divider {
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin: 1.75rem auto;
  transform: scaleX(0);
  animation: scale-x 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 900ms forwards;
}

@keyframes scale-x {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ── Links ────────────────────────────────────────────────── */

.links {
  display: flex;
  justify-content: center;
  column-gap: 2rem;
  row-gap: 0.75rem;
  flex-wrap: wrap;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 400;
  opacity: 0;
  animation: slide-up 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  transition: color 300ms ease, transform 300ms ease;
}

.link:nth-child(1) { animation-delay: 1100ms; }
.link:nth-child(2) { animation-delay: 1200ms; }
.link:nth-child(3) { animation-delay: 1300ms; }
.link:nth-child(4) { animation-delay: 1400ms; }
.links-break {
  flex-basis: 100%;
  height: 0;
}

.link:nth-child(n+6) { animation-delay: 1500ms; }
.link:nth-child(n+7) { animation-delay: 1600ms; }

.link:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
  overflow: visible;
}

/* ── Language switcher ────────────────────────────────────── */

.lang-switch {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0;
  animation: fade-in 500ms ease 1900ms forwards;
  transition: color 300ms ease;
}

.lang-switch:hover {
  color: var(--text);
}

[dir="rtl"] .lang-switch {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[dir="ltr"] .lang-switch {
  font-family: 'Vazir', Tahoma, sans-serif;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Reduced motion ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
  .logo {
    width: 120px;
  }

  .title-line-1 {
    font-size: 1.4rem;
  }

  .title-line-2 {
    font-size: 0.95rem;
  }

  .links {
    column-gap: 1.5rem;
    row-gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .logo {
    width: 100px;
  }

  .title-line-1 {
    font-size: 1.2rem;
  }

  .title-line-2 {
    font-size: 0.85rem;
  }

  .links {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }

  .links-break {
    display: none;
  }

  .link {
    font-size: 0.9rem;
  }
}
