/* Legendaries TCG — Cursor.com-style layout, white background, Cairo, RTL */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #ffffff;
  --text: #0a0a0a;
  --text-muted: #404040;
  --border: #e5e5e5;
  --hover-bg: #f5f5f5;
  /* فئات الندرة */
  --rarity-common: #6b7280;
  --rarity-uncommon: #16a34a;
  --rarity-rare: #2563eb;
  --rarity-epic: #dc2626;
  --rarity-legendary: #7c3aed;
}

html {
  direction: rtl;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* —— Header (Cursor-style: minimal, full-width) —— */
.site-header {
  background: var(--bg);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-block {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  width: min-content;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: block;
  min-width: 0;
  width: 100%;
}

.logo-img {
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  object-fit: contain;
}

.logo-en {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.slogan {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text);
  border-radius: 6px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav-menu a:hover {
  color: var(--text);
  background: var(--hover-bg);
}

.nav-menu a.active {
  color: var(--text);
}

/* —— Main (full-width sections like Cursor) —— */
main {
  flex: 1;
  width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: 1200px;
}

/* —— Hero (Cursor-style: one big headline + sub + 2 CTAs) —— */
.hero {
  text-align: center;
  padding: 4rem 1.5rem 5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero .hero-tagline {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary:hover {
  background: #333;
  border-color: #333;
  color: var(--bg);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--hover-bg);
  border-color: #d4d4d4;
}

/* —— Section block (Cursor-style: heading + text + link) —— */
.section {
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--border);
}

.section:first-of-type {
  border-top: none;
}

.section-head {
  text-align: center;
  margin-bottom: 3rem;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.section-head p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
}

/* Feature grid (2 cols on desktop) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

@media (max-width: 700px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  border-color: #d4d4d4;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.link-arrow {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.link-arrow:hover {
  text-decoration: underline;
}

/* —— Page content (inner pages) —— */
.page-main {
  padding: 3rem 1.5rem 4rem;
}

.page-main .container {
  max-width: 720px;
}

.page-main h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.page-main h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}

.page-main p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.page-main a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-main a:hover {
  color: var(--text-muted);
}

/* —— Cards grid (characters page) —— */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card-item:hover {
  border-color: #d4d4d4;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.card-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--hover-bg);
}

.card-item .card-info {
  padding: 1.25rem;
}

.card-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.card-item p {
  font-size: 0.9rem;
  margin: 0;
  color: var(--text-muted);
}

/* شارات الندرة */
.rarity-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  color: #fff;
  margin-left: 0.25rem;
}
.rarity-common { background: var(--rarity-common); }
.rarity-uncommon { background: var(--rarity-uncommon); }
.rarity-rare { background: var(--rarity-rare); }
.rarity-epic { background: var(--rarity-epic); }
.rarity-legendary { background: var(--rarity-legendary); }

.rarity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  background: var(--hover-bg);
  border-radius: 8px;
}
.rarity-legend span {
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.rarity-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.card-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.card-stats span { margin-left: 0.5rem; }
.card-level {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* —— Contact form —— */
.contact-form {
  max-width: 480px;
  margin-top: 1.5rem;
}

.contact-form label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form button {
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.contact-form button:hover {
  background: #333;
}

.contact-info {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.contact-info h2 {
  margin-bottom: 0.75rem;
}

.contact-info p {
  margin-bottom: 0.5rem;
}

/* —— Footer (Cursor-style: tagline + links + CTA) —— */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem;
  margin-top: auto;
  background: var(--bg);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-slogan {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.footer-tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin-bottom: 2rem;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-cta {
  margin-bottom: 1.5rem;
}

.footer-cta .btn {
  margin: 0 0.25rem;
}

.footer-domain {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* —— Responsive: mobile menu —— */
@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: 0.5rem;
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu a {
    display: block;
    padding: 0.6rem;
  }

  .hero {
    padding: 3rem 1rem 4rem;
  }

  .section {
    padding: 3rem 1rem;
  }
}

@media (min-width: 641px) {
  .nav-menu {
    display: flex !important;
  }
}
