:root {
  --bg: #0f0f14;
  --surface: #1a1a22;
  --line: #2a2a35;
  --text: #f2f2f5;
  --muted: #a3a3b2;
  --accent: #d9303d;
  --accent-soft: rgba(217, 48, 61, 0.14);
  --radius: 16px;
  --max: 1040px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf9f7;
    --surface: #ffffff;
    --line: #e7e5e0;
    --text: #17171c;
    --muted: #5d5d6b;
    --accent-soft: rgba(217, 48, 61, 0.09);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
header.site {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
nav.links { display: flex; align-items: center; gap: 22px; font-size: 15px; }
nav.links a { color: var(--muted); }
nav.links a:hover, nav.links a[aria-current] { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 80px 0 64px; text-align: center; }
.hero .icon { width: 116px; height: 116px; border-radius: 26px; margin: 0 auto 28px; box-shadow: 0 18px 50px rgba(217, 48, 61, 0.28); }
.hero h1 { font-size: clamp(36px, 7vw, 60px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 18px; }
.hero h1 span { color: var(--accent); }
.hero p.lede { font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); max-width: 620px; margin: 0 auto 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--text); color: var(--bg);
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 16px;
}
.btn:hover { text-decoration: none; opacity: 0.88; }
.btn svg { width: 18px; height: 18px; }
.note { color: var(--muted); font-size: 14px; margin-top: 14px; }

/* Features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; padding-bottom: 72px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card .glyph { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.card .glyph svg { width: 22px; height: 22px; }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

section.band { border-top: 1px solid var(--line); padding: 64px 0; }
section.band h2 { font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.01em; margin: 0 0 12px; }
section.band p { color: var(--muted); max-width: 680px; }
.plus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 28px; }
.plus-grid ul { margin: 8px 0 0; padding-inline-start: 20px; color: var(--muted); font-size: 15px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; }

/* Long-form documents */
article.doc { max-width: 720px; margin: 0 auto; padding: 56px 20px 80px; }
article.doc h1 { font-size: clamp(32px, 5vw, 42px); letter-spacing: -0.02em; margin: 0 0 6px; line-height: 1.15; }
article.doc .meta { color: var(--muted); font-size: 15px; margin: 0 0 32px; }
article.doc h2 { font-size: 22px; margin: 40px 0 10px; }
article.doc h3 { font-size: 18px; margin: 24px 0 6px; }
article.doc p, article.doc li { color: var(--text); }
article.doc ul { padding-inline-start: 22px; }
article.doc li { margin: 6px 0; }
.summary { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 8px; }
.summary p { margin: 0; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin: 10px 0; }
details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 8px; }
details p { margin: 6px 0; color: var(--muted); }

/* Language menu */
details.lang { position: relative; background: none; border: 0; padding: 0; margin: 0; }
details.lang summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-weight: 500; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
}
details.lang summary::-webkit-details-marker { display: none; }
details.lang summary:hover, details.lang[open] summary { color: var(--text); }
details.lang summary svg { width: 16px; height: 16px; }
details.lang[open] summary { margin-bottom: 0; }
details.lang .menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 160px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column;
}
details.lang .menu a { color: var(--text); padding: 8px 12px; border-radius: 8px; }
details.lang .menu a:hover { background: var(--accent-soft); text-decoration: none; }
details.lang .menu a[aria-current] { color: var(--accent); font-weight: 600; }

/* Right-to-left */
[dir="rtl"] body, body[dir="rtl"] {
  font-family: -apple-system, BlinkMacSystemFont, "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}
:lang(ar) h1, :lang(ar) h2, :lang(ar) .tag { letter-spacing: 0; }
:lang(ar) .hero h1 { line-height: 1.3; }

/* Footer */
footer.site { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
footer.site nav { display: flex; gap: 20px; }
footer.site a { color: var(--muted); }

@media (max-width: 560px) {
  nav.links { gap: 14px; font-size: 14px; }
  details.lang summary { padding: 5px 8px; }
  .hero { padding: 56px 0 48px; }
}
