/* دهب ودولار — design system per ai-design-skills landing-page rules */

:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --s-0: 0; --s-25: 2px; --s-50: 4px; --s-75: 8px; --s-100: 12px;
  --s-200: 16px; --s-300: 24px; --s-400: 32px; --s-500: 40px;
  --s-600: 48px; --s-700: 64px; --s-800: 80px; --s-900: 96px;
}

html[data-theme="dark"] {
  --bg: #000000;
  --surface: #181818;
  --raised: #1F1F1F;
  --hover: #272727;
  --border: #313131;
  --text: #ffffff;
  --muted: #9B9B9B;
  --accent: #e3b94e;
  --accent-ink: #131209;
  --grad-from: #ffffff;
  --grad-to: #9B9B9B;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #fafafa;
  --surface: #ffffff;
  --raised: #f4f4f3;
  --hover: #ececea;
  --border: #e4e4e1;
  --text: #0a0a0a;
  --muted: #666666;
  --accent: #b78a1e;
  --accent-ink: #ffffff;
  --grad-from: #000000;
  --grad-to: #666666;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, "Segoe UI", Tahoma, sans-serif;
  transition: background-color 300ms var(--ease), color 300ms var(--ease);
}

/* ---- text styles (named, from the B1 table) ---- */
.heading-1 { font-size: 60px; line-height: 60px; font-weight: 600; }
.heading-3 { font-size: 36px; line-height: 40px; font-weight: 600; }
.heading-4 { font-size: 30px; line-height: 36px; font-weight: 600; }
.title-2 { font-size: 18px; line-height: 28px; font-weight: 500; }
.title-3 { font-size: 16px; line-height: 24px; font-weight: 500; }
.body-3 { font-size: 16px; line-height: 24px; font-weight: 400; }
.body-4 { font-size: 14px; line-height: 20px; font-weight: 600; }
.body-5 { font-size: 14px; line-height: 20px; font-weight: 400; }
.caption-2 { font-size: 14px; line-height: 20px; font-weight: 400; }
.caption-3 { font-size: 12px; line-height: 16px; font-weight: 600; }
.caption-4 { font-size: 12px; line-height: 16px; font-weight: 500; }

@media (max-width: 720px) {
  .heading-1 { font-size: 36px; line-height: 40px; }
  .heading-3 { font-size: 24px; line-height: 32px; }
  .heading-4 { font-size: 24px; line-height: 32px; }
}

.skip-link {
  position: absolute; inset-inline-start: var(--s-200); top: -48px;
  background: var(--accent); color: var(--accent-ink);
  padding: var(--s-75) var(--s-100); border-radius: 8px; z-index: 60;
  text-decoration: none; transition: top 300ms var(--ease);
}
.skip-link:focus { top: var(--s-100); }

a { color: inherit; }

/* ---- nav ---- */
.nav {
  position: fixed; top: var(--s-200); inset-inline: 0; z-index: 50;
  margin-inline: auto; width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: var(--s-300);
  padding: var(--s-75) var(--s-200);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 999px;
}
.nav-brand {
  display: flex; align-items: center; gap: var(--s-75);
  text-decoration: none; font-weight: 600; font-size: 16px; line-height: 24px;
  white-space: nowrap;
}
.nav-coin { width: 22px; height: 22px; color: var(--accent); }
.nav-links { display: flex; gap: var(--s-300); }
.nav-links a {
  text-decoration: none; font-size: 14px; line-height: 20px; font-weight: 500;
  color: var(--muted); transition: color 300ms var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: var(--s-75); }
.theme-toggle, .menu-toggle {
  display: grid; place-items: center; cursor: pointer;
  width: 36px; height: 36px; border-radius: 999px;
  background: transparent; color: var(--text); border: 1px solid var(--border);
  transition: background-color 300ms var(--ease), transform 300ms var(--ease);
}
.theme-toggle:hover, .menu-toggle:hover { background: var(--hover); }
.theme-toggle:active, .menu-toggle:active { transform: scale(0.98); }
.theme-toggle:focus-visible, .menu-toggle:focus-visible,
.nav-links a:focus-visible, .mobile-menu a:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.theme-toggle svg { width: 18px; height: 18px; grid-area: 1 / 1; transition: opacity 300ms var(--ease), transform 500ms var(--ease); }
html[data-theme="dark"] .icon-moon { opacity: 0; transform: rotate(-40deg) scale(0.6); }
html[data-theme="light"] .icon-sun { opacity: 0; transform: rotate(40deg) scale(0.6); }

.menu-toggle { display: none; flex-direction: column; gap: 5px; }
.menu-toggle span {
  display: block; width: 16px; height: 1.8px; background: var(--text);
  border-radius: 2px; transition: transform 500ms var(--ease);
}
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.4px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: var(--s-400);
}
.mobile-menu a {
  text-decoration: none; font-size: 30px; line-height: 36px; font-weight: 600;
  opacity: 0; transform: translateY(24px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.mobile-menu.open a { opacity: 1; transform: translateY(0); }
.mobile-menu.open a:nth-child(1) { transition-delay: 60ms; }
.mobile-menu.open a:nth-child(2) { transition-delay: 120ms; }
.mobile-menu.open a:nth-child(3) { transition-delay: 180ms; }
.mobile-menu.open a:nth-child(4) { transition-delay: 240ms; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .menu-toggle { display: grid; }
}

/* ---- hero ---- */
.hero {
  padding: calc(var(--s-900) + var(--s-700)) var(--s-300) var(--s-700);
  max-width: 960px; margin-inline: auto; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-300);
}
.hero-eyebrow {
  color: var(--accent); border: 1px solid var(--border);
  background: var(--surface); padding: var(--s-50) var(--s-100); border-radius: 999px;
}
.hero-title {
  max-width: 680px; text-wrap: balance;
  background: linear-gradient(to left, var(--grad-from), var(--grad-to));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { max-width: 680px; color: var(--muted); text-wrap: pretty; }
.hero-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-200);
  width: 100%; max-width: 680px; margin-top: var(--s-200);
}
@media (max-width: 720px) { .hero-cards { grid-template-columns: 1fr; } }
.hero-updated { color: var(--muted); }

/* ---- cards ---- */
.stat-card, .price-card, .step-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: var(--s-300);
  text-align: start;
  transition: transform 500ms var(--ease), border-color 300ms var(--ease), background-color 300ms var(--ease);
}
.stat-card:hover, .price-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.stat-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-100); }
.stat-code { color: var(--muted); }
.stat-value, .price-value {
  font-size: 30px; line-height: 36px; font-weight: 600;
  font-variant-numeric: tabular-nums; margin-top: var(--s-100); min-height: 36px;
}
.price-value { font-size: 24px; line-height: 32px; min-height: 32px; }
.stat-value .unit, .price-value .unit { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); }
.stat-note, .card-note { color: var(--muted); margin-top: var(--s-50); }
.card-unit { color: var(--muted); margin-top: var(--s-25); }

.value-flash { animation: flash 600ms var(--ease); }
@keyframes flash { 0% { opacity: 0.35; } 100% { opacity: 1; } }

.skeleton {
  display: inline-block; width: 110px; height: 0.9em; border-radius: 8px;
  background: var(--hover); vertical-align: middle;
  animation: pulse 1400ms var(--ease) infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.load-error {
  display: none; color: var(--muted); text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: var(--s-200); margin-top: var(--s-200);
}
.load-error.show { display: block; }

/* ---- sections ---- */
.section { max-width: 960px; margin-inline: auto; padding: var(--s-700) var(--s-300); }
.section-title { text-wrap: balance; }
.section-sub { color: var(--muted); margin-top: var(--s-100); max-width: 680px; text-wrap: pretty; font-weight: 400; }

.grid { display: grid; gap: var(--s-200); margin-top: var(--s-300); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4, .grid-3 { grid-template-columns: 1fr; } }

/* ---- tagline ---- */
.tagline { max-width: 760px; margin-inline: auto; padding: var(--s-800) var(--s-300); text-align: center; }
.tagline-text { text-wrap: balance; }
.tagline-text .w {
  opacity: 0.3; transition: opacity 500ms var(--ease);
}
.tagline-text .w.on { opacity: 1; }

/* ---- steps ---- */
.step-card { display: flex; flex-direction: column; gap: var(--s-100); }
.step-num {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); border-radius: 999px;
}

/* ---- faq ---- */
.faq-list { margin-top: var(--s-300); display: flex; flex-direction: column; gap: var(--s-100); }
.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: var(--s-200) var(--s-300);
}
.faq-item summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s-100);
  transition: color 300ms var(--ease);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 18px; color: var(--muted); flex-shrink: 0;
  transition: transform 500ms var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--accent); }
.faq-item p { color: var(--muted); margin-top: var(--s-100); }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--border); margin-top: var(--s-700); }
.footer-inner {
  max-width: 960px; margin-inline: auto; padding: var(--s-600) var(--s-300);
  display: flex; flex-direction: column; gap: var(--s-200); align-items: flex-start;
}
.footer-note { color: var(--muted); max-width: 680px; text-wrap: pretty; }
.footer-links { display: flex; gap: var(--s-300); }
.footer-links a { text-decoration: none; color: var(--muted); font-size: 14px; line-height: 20px; transition: color 300ms var(--ease); }
.footer-links a:hover { color: var(--text); }

/* ---- reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tagline-text .w { opacity: 1; transition: none; }
  .mobile-menu a { opacity: 1; transform: none; transition: none; }
  .skeleton { animation: none; }
  .value-flash { animation: none; }
}

/* the hidden attribute must win over display:flex */
.mobile-menu[hidden] { display: none; }
