/* ساعِد — الأساس المشترك لكل الصفحات. الألوان من tokens.css فقط. */

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("/assets/fonts/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EEFF;
}

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("/assets/fonts/cairo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Cairo", system-ui, sans-serif;
  font-weight: 400;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--ink);
}

a:hover {
  color: var(--link-hover);
}

button {
  font-family: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.is-light {
  color: var(--ink);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
  color: var(--on-accent);
}

[hidden] {
  display: none !important;
}

/* ===== التخطيط ===== */

.wrap {
  /* مثل التصميم: العرض الأقصى 1280 للمحتوى، والحواف خارجه */
  max-width: calc(1280px + 2 * clamp(20px, 5vw, 80px));
  margin: 0 auto;
  padding-inline: clamp(20px, 5vw, 80px);
}

.eyebrow {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
}

/* ===== الترويسة ===== */

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand__sep {
  width: 1px;
  height: 28px;
  background: var(--ink);
}

.brand__name {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: .02em;
}

.logo-ink {
  fill: var(--ink);
  stroke: var(--ink);
}

.logo-arc {
  fill: none;
  stroke: var(--ink);
}

.logo-dot {
  fill: var(--blue);
}

.logo-dash {
  stroke: var(--blue);
}

.logo-bar {
  fill: var(--ink);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  font-size: 15px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* ===== الأزرار ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, opacity .15s ease;
}

.btn:hover {
  opacity: .88;
}

.btn:active {
  transform: scale(.97);
}

.btn--primary,
.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn--outline,
.btn--outline:hover {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--lg {
  min-height: 52px;
  padding: 0 26px;
  font-size: 16px;
}

/* زر الاشتراك قبل وصول الرابط أو حين لا يوجد رابط */
[data-salla]:not([href]) {
  cursor: default;
}

[data-salla]:not([href]):hover {
  opacity: 1;
}

[data-salla]:not([href]):active {
  transform: none;
}

[data-salla].is-soon {
  color: var(--muted);
}

.btn[data-salla].is-soon {
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--muted);
}

/* ===== زر الوضع الليلي ===== */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--bg-alt);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

/* ===== الحركة ===== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ===== الجوال ===== */

@media (max-width: 720px) {
  .site-header__inner {
    gap: 14px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    gap: 22px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    white-space: nowrap;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-header__actions .btn {
    padding: 0 14px;
  }
}
