/* Language selector page (index.html) */
:root {
  --index-bg-start: #0a0a0a;
  --index-bg-end: #141414;
  --index-accent: #e53935;
  --index-accent-soft: #ff6b6b;
  --index-card-bg: rgba(255, 255, 255, 0.04);
  --index-card-border: rgba(255, 255, 255, 0.08);
  --index-card-hover-border: rgba(229, 57, 53, 0.45);
  --index-text: #f5f5f5;
  --index-text-muted: #999;
  --index-text-dim: #666;
}

body {
  font-family: 'Inter', 'Vazirmatn', sans-serif;
  background: var(--index-bg-start);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(229, 57, 53, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(255, 107, 107, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(229, 57, 53, 0.05), transparent),
    linear-gradient(180deg, var(--index-bg-start) 0%, var(--index-bg-end) 100%);
  color: var(--index-text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
  padding-top: max(1.5rem, env(safe-area-inset-top));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.bg-glow {
  position: fixed;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 80%;
  background: radial-gradient(ellipse at center, rgba(229, 57, 53, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.language-selector {
  text-align: center;
  max-width: 100%;
  width: min(92vw, 36rem);
  position: relative;
  z-index: 1;
  animation: fadeIn 0.7s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  margin-bottom: 2.5rem;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--index-accent);
  background: rgba(229, 57, 53, 0.12);
  border: 1px solid rgba(229, 57, 53, 0.25);
  border-radius: 14px;
  animation: fadeIn 0.6s ease-out 0.1s both;
}

.title {
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--index-accent) 0%, var(--index-accent-soft) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeIn 0.6s ease-out 0.15s both;
}

.subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--index-text-muted);
  margin: 0;
  font-weight: 400;
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.language-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .language-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.language-card {
  background: var(--index-card-bg);
  border: 1px solid var(--index-card-border);
  border-radius: 18px;
  padding: 0;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  text-align: left;
  outline: none;
}

.language-card:focus-visible {
  border-color: var(--index-card-hover-border);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
}

.language-card:nth-child(1) { animation: cardIn 0.5s ease-out 0.25s both; }
.language-card:nth-child(2) { animation: cardIn 0.5s ease-out 0.35s both; }
.language-card:nth-child(3) { animation: cardIn 0.5s ease-out 0.45s both; }

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-accent {
  display: block;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--index-accent), var(--index-accent-soft));
  opacity: 0.7;
  transition: opacity 0.25s ease;
}

.language-card:hover {
  transform: translateY(-5px);
  border-color: var(--index-card-hover-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(229, 57, 53, 0.1);
}

.language-card:hover .card-accent {
  opacity: 1;
}

.language-card:active {
  transform: translateY(-2px);
}

.card-inner {
  padding: 1.5rem 1.35rem 1.6rem;
  position: relative;
}

.lang-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--index-accent-soft);
  background: rgba(229, 57, 53, 0.12);
  border-radius: 10px;
}

.language-card[data-lang="fa"] .lang-icon {
  font-family: 'Vazirmatn', sans-serif;
}

.language-name {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--index-text);
  letter-spacing: -0.01em;
}

.language-native {
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: #aaa;
  margin-bottom: 0;
}

.language-card[data-lang="fa"] .language-native {
  font-family: 'Vazirmatn', sans-serif;
  direction: rtl;
}

.about-app {
  font-size: 0.78rem;
  color: var(--index-text-dim);
  margin: 0.85rem 0 0;
  line-height: 1.45;
}

.language-card[data-lang="fa"] .about-app {
  font-family: 'Vazirmatn', sans-serif;
  direction: rtl;
}

.footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  animation: fadeIn 0.6s ease-out 0.5s both;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer-about {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--index-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-about:hover {
  color: var(--index-accent-soft);
}

.footer-hint {
  font-size: 0.85rem;
  color: var(--index-text-dim);
}
