/* Musaed Engine website. Colors, fonts, radii and spacing come from tokens.css only (the same tokens as the app). */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: var(--fs-base); line-height: var(--lh-body);
}
html[lang="ar"] body { line-height: var(--lh-ar); }
html[lang="ar"] body * { letter-spacing: normal !important; }
img, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: var(--lh-heading); text-wrap: balance; margin: 0 0 var(--sp-3); }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--sp-3); }
code, kbd { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xs); padding: 1px var(--sp-2); direction: ltr; unicode-bidi: isolate; }
pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-4); overflow-x: auto; direction: ltr; text-align: left; font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.6; }
pre code { background: none; border: 0; padding: 0; }

/* One language at a time. Arabic is the default; site.js switches it. */
html[lang="ar"] [data-l="en"], html[lang="en"] [data-l="ar"] { display: none !important; }

.skip { position: absolute; inset-inline-start: var(--sp-3); top: -60px; background: var(--accent); color: var(--on-accent); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-xs); z-index: 50; }
.skip:focus { top: var(--sp-3); }
.wrap { width: min(1120px, 100% - 2 * var(--sp-4)); margin-inline: auto; }

/* ---- top bar */
.nav { position: sticky; top: 0; z-index: 20; background: var(--float); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav__in { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); min-height: 64px; padding-block: var(--sp-2); }
.nav__brand { white-space: nowrap; display: flex; align-items: center; gap: var(--sp-2); font-family: var(--display); font-weight: 800; color: var(--text); }
.nav__brand img { width: 34px; height: 34px; }
.nav__links { display: flex; gap: var(--sp-4); margin-inline-start: auto; align-items: center; flex-wrap: wrap; }
.nav__links a { color: var(--text-dim); font-size: var(--fs-md); font-weight: 500; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--text); }
.nav__links a.btn--primary, .nav__links a.btn--primary:hover { color: var(--on-accent); }
@media (max-width: 640px) { .nav__links { gap: var(--sp-3); } .nav__links a.btn { display: none; } }
.lang { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-3); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.lang:hover { background: var(--surface-hover); }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); border-radius: var(--r-pill); padding: var(--sp-3) var(--sp-5); font: inherit; font-weight: 600; border: 1px solid var(--line-strong); color: var(--text); background: var(--surface); cursor: pointer; }
.btn:hover { background: var(--surface-hover); color: var(--text); }
.btn--primary { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: var(--glow); }
.btn--primary:hover { background: var(--accent-hi); color: var(--on-accent); box-shadow: var(--glow-hover); }
.btn--sm { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-md); }

/* ---- hero */
.hero { padding: clamp(40px, 8vw, 96px) 0 var(--sp-6); text-align: center; }
.badge { display: inline-block; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--sp-4); }
.hero p.lead { color: var(--text-dim); font-size: var(--fs-lg); max-width: 46rem; margin-inline: auto; }
.hero__cta { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; margin: var(--sp-5) 0 var(--sp-3); }
.hero__note { color: var(--text-mute); font-size: var(--fs-sm); }
.frame { border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; background: var(--bg-2); box-shadow: var(--glow); }
.frame img, .frame video { width: 100%; height: auto; }
.hero .frame { margin-top: var(--sp-6); }

/* ---- sections */
section.block { padding: clamp(40px, 7vw, 84px) 0; border-top: 1px solid var(--line); }
.eyebrow { display: flex; align-items: center; gap: var(--sp-2); font-family: var(--mono); font-weight: 500; font-size: var(--fs-xs); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--accent); margin-bottom: var(--sp-3); }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--accent); }
.sub { color: var(--text-dim); max-width: 44rem; }

.steps { list-style: none; margin: var(--sp-5) 0 0; padding: 0; display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-5); }
.steps .n { font-family: var(--mono); font-size: var(--fs-xl); color: var(--accent-deep); font-weight: 500; display: block; margin-bottom: var(--sp-2); }
.steps h3 { margin-bottom: var(--sp-2); }
.steps p { color: var(--text-dim); margin: 0; }

.grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: var(--sp-5); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-5); }
.card:hover { background: var(--surface-hover); border-color: var(--line-strong); }
.card h3 { display: flex; align-items: center; gap: var(--sp-2); }
.card p { color: var(--text-dim); margin: 0; }
.card .tag { font-family: var(--mono); font-size: var(--fs-xs); color: var(--accent); background: var(--accent-soft); border-radius: var(--r-pill); padding: 2px var(--sp-2); }

.split { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; align-items: center; margin-top: var(--sp-5); }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1.25fr; } .split--flip > :first-child { order: 2; } }
.split h3 { font-size: var(--fs-xl); }
.split p { color: var(--text-dim); }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); color: var(--text-dim); }
.ticks li { padding-inline-start: var(--sp-5); position: relative; }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.7em; width: 10px; height: 10px; border-radius: var(--r-pill); background: var(--accent); }

.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-2); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] summary { margin-bottom: var(--sp-2); }
.faq p { color: var(--text-dim); margin: 0; }

.cta { text-align: center; background: var(--surface); border: 1px solid var(--accent-line); border-radius: var(--r-lg); padding: clamp(28px, 6vw, 64px); }

footer.foot { border-top: 1px solid var(--line); padding: var(--sp-6) 0; color: var(--text-mute); font-size: var(--fs-sm); }
.foot__in { display: flex; gap: var(--sp-4); flex-wrap: wrap; align-items: center; justify-content: space-between; }
.foot a { color: var(--text-dim); }

/* ---- documentation */
.docs { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; padding: var(--sp-6) 0 var(--sp-6); }
@media (min-width: 900px) { .docs { grid-template-columns: 250px 1fr; } }
.toc { position: sticky; top: 84px; align-self: start; background: var(--side-bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3); }
@media (max-width: 899px) { .toc { position: static; } }
.toc a { display: block; padding: var(--sp-1) var(--sp-3); color: var(--text-dim); font-size: var(--fs-md); border-radius: var(--r-xs); }
.toc a:hover { background: var(--accent-soft); color: var(--text); }
.doc section { padding-bottom: var(--sp-5); margin-bottom: var(--sp-5); border-bottom: 1px solid var(--line); scroll-margin-top: 84px; }
.doc section:last-child { border-bottom: 0; }
.doc p, .doc li { color: var(--text-dim); }
.doc strong { color: var(--text); }
.doc ul, .doc ol { padding-inline-start: var(--sp-5); }
table { border-collapse: collapse; width: 100%; margin: var(--sp-3) 0; font-size: var(--fs-md); }
th, td { text-align: start; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--text); font-weight: 600; }
td { color: var(--text-dim); }
.table-wrap { overflow-x: auto; }
kbd { background: var(--bg-3); border: 1px solid var(--line-strong); border-radius: var(--r-2xs); padding: 1px var(--sp-2); white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.note { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); color: var(--text); }
.warn { background: var(--warning-soft); border: 1px solid var(--warning); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); color: var(--text); }

/* a value only the owner can fill in (name, email, hosting country) */
.ph { background: var(--warning-soft); border: 1px dashed var(--warning); border-radius: var(--r-2xs); padding: 0 var(--sp-1); color: var(--text); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
