:root {
  --ink: #111418;
  --olive: #3d6b4a;
  --olive-light: #7fa98a;
  --red: #c8102e;
  --cream: #f6f2e9;
  --paper: #eae4d8;
  --white: #ffffff;
  --text: #111418;
  --text-muted: #6b6455;
  --border: rgba(17, 20, 24, 0.10);
  --card: rgba(255, 255, 255, 0.72);
  --bg: #f7f4ee;
  --shadow: 0 18px 40px -24px rgba(17, 20, 24, 0.35);
  --radius: 20px;
  --font-head: "Noto Naskh Arabic", "Amiri", serif;
  --font-body: "Noto Sans Arabic", system-ui, sans-serif;
}

[data-theme="dark"] {
  --ink: #f4f1ea;
  --paper: #16191d;
  --cream: #1c2026;
  --text: #f2efe8;
  --text-muted: #a49c8d;
  --border: rgba(246, 242, 233, 0.14);
  --card: rgba(255, 255, 255, 0.05);
  --bg: #0e1114;
  --olive-light: #9cc0a6;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(127, 169, 138, 0.22), transparent 60%),
    radial-gradient(900px 500px at 10% 5%, rgba(200, 16, 46, 0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  transition: background-color 320ms ease, color 320ms ease;
}

.wrap { width: min(1180px, 92vw); margin-inline: auto; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.35; margin: 0; }

h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }

a { color: inherit; text-decoration: none; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 0.86em;
  direction: ltr;
  display: inline-block;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}

.topbar__inner { display: flex; align-items: center; gap: 18px; padding: 12px 0; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-family: var(--font-head); font-size: 1.1rem; }
.brand img { border-radius: 9px; }

.nav { display: flex; gap: 22px; margin-inline-start: auto; font-size: 0.94rem; color: var(--text-muted); }
.nav a { transition: color 180ms ease; }
.nav a:hover { color: var(--olive); }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--olive-light); }

.glass {
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(38px, 7vw, 84px) 0;
}

.hero__art { padding: 26px; display: grid; place-items: center; }
.hero__art img { width: 100%; height: auto; max-width: 420px; }

.eyebrow { margin: 0 0 10px; letter-spacing: 3px; font-size: 0.74rem; color: var(--olive); font-weight: 600; }
.hero__copy h1 span { color: var(--olive); }
.lede { font-size: clamp(1rem, 1.6vw, 1.12rem); color: var(--text-muted); max-width: 60ch; }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px;
  border-radius: 14px;
  font-size: 0.96rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { border-color: var(--border); background: var(--card); color: var(--text); }
.btn--ghost:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 30px; }
.facts li { display: flex; flex-direction: column; }
.facts strong { font-family: var(--font-head); font-size: 1.5rem; color: var(--olive); }
.facts span { font-size: 0.84rem; color: var(--text-muted); }

.section { padding: clamp(34px, 6vw, 72px) 0 0; }
.section__lede { color: var(--text-muted); max-width: 74ch; margin-top: 12px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 22px;
  margin-top: 30px;
}

.card {
  padding: 26px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 240ms ease, box-shadow 240ms ease;
}
.card:hover { transform: translateY(-4px); }
.card__art { display: grid; place-items: center; min-height: 190px; }
.card__art img { max-width: 100%; max-height: 210px; height: auto; }
.card__meta { border-top: 1px solid var(--border); padding-top: 14px; }
.card__meta h3 { font-family: var(--font-body); font-weight: 500; font-size: 1rem; }
.card__meta p { margin: 4px 0 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.swatch {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  text-align: start;
  padding: 0;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.swatch:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.swatch__chip { height: 96px; }
.swatch__body { padding: 12px 14px 16px; }
.swatch__body b { display: block; font-size: 0.92rem; font-weight: 600; }
.swatch__body span { font-size: 0.8rem; color: var(--text-muted); direction: ltr; display: inline-block; }

.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 26px; }
.rule { padding: 24px 26px; }
.rule h3 { font-family: var(--font-body); font-size: 0.8rem; letter-spacing: 2.4px; text-transform: uppercase; color: var(--olive); }
.rule--dont h3 { color: var(--red); }
.rule ul { margin: 14px 0 0; padding-inline-start: 20px; color: var(--text-muted); font-size: 0.94rem; }
.rule li { margin-bottom: 8px; }

.files { display: grid; gap: 12px; margin-top: 26px; }
.file {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  transition: transform 200ms ease, border-color 200ms ease;
}
.file:hover { transform: translateY(-2px); border-color: var(--olive-light); }
.file__ext {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(61, 107, 74, 0.12);
  color: var(--olive);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1px;
}
.file__name { font-size: 0.95rem; direction: ltr; text-align: start; }
.file__desc { font-size: 0.82rem; color: var(--text-muted); }
.file__hint { margin-inline-start: auto; font-size: 0.8rem; color: var(--olive); }

.footer { margin-top: clamp(46px, 8vw, 90px); border-top: 1px solid var(--border); background: var(--card); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 34px 0; }
.footer p { margin: 0; font-size: 0.86rem; color: var(--text-muted); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

.file__name { display: block; }
.file__desc { display: block; }

#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 18px);
  background: #111418;
  color: #f6f2e9;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease;
  z-index: 90;
}

#toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
