/* QIWAM public site. Palette and type stack follow the existing qiwam.jthr.sa page. */
:root {
  color-scheme: light dark;
  --surface: #F6F5F3;
  --surface-raised: #FFFFFF;
  --surface-sunken: #ECEAE6;
  --text: #1C2126;
  --text-muted: #525C66;
  --border: #CFCCC7;
  --action: #2F4858;
  --action-text: #FFFFFF;
  --action-soft: #E3EAEE;
  --focus: #1A5FD0;
  --soon-bg: #F3ECDD;
  --soon-text: #6B4F12;
  --ok: #2E6B4F;
  --font: system-ui, "Segoe UI", "Noto Naskh Arabic", "Geeza Pro", Tahoma, sans-serif;
  --radius: 14px;
  --wrap: 72rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #121517;
    --surface-raised: #1C2024;
    --surface-sunken: #171A1D;
    --text: #ECEDEE;
    --text-muted: #A9B1B9;
    --border: #3A4148;
    --action: #9FB9C9;
    --action-text: #121517;
    --action-soft: #22303A;
    --focus: #8AB4F8;
    --soon-bg: #2B2416;
    --soon-text: #E6C77E;
    --ok: #7FC9A4;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 7rem; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 1.0625rem/1.8 var(--font);
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--action); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.3; margin: 0; text-wrap: balance; }
p { margin: 0; }
[lang="en"] { direction: ltr; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }

.skip {
  position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 50;
  background: var(--action); color: var(--action-text);
  padding: .5rem 1rem; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .5rem 1.5rem;
  min-height: 4.25rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.brand .mark { width: 2rem; height: 2rem; }
.brand-name { font-size: 1.45rem; font-weight: 700; color: var(--action); }
.brand-latin { font-size: .72rem; letter-spacing: .2em; color: var(--text-muted); direction: ltr; padding-top: .3rem; }
.site-nav { display: flex; gap: .25rem; justify-content: center; }
.site-nav a {
  color: var(--text-muted); text-decoration: none; font-size: .95rem;
  padding: .4rem .7rem; border-radius: 999px; white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--surface-sunken); }
.site-nav a[aria-current="page"] { color: var(--action); background: var(--action-soft); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: .75rem; }
.lang { font-size: .9rem; color: var(--text-muted); text-decoration: none; }
.lang:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 64rem) {
  .header-row { grid-template-columns: 1fr auto; padding-block: .6rem .2rem; }
  .site-nav {
    grid-column: 1 / -1; grid-row: 2;
    justify-content: flex-start; overflow-x: auto; scrollbar-width: none;
    margin-inline: -1.25rem; padding-inline: 1.25rem; padding-bottom: .4rem;
  }
  .site-nav::-webkit-scrollbar { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.9rem; padding: .55rem 1.35rem;
  border-radius: 999px; border: 1px solid var(--action);
  background: var(--action); color: var(--action-text);
  font-weight: 600; font-size: 1rem; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--action); }
.btn-ghost:hover { background: var(--action-soft); filter: none; }
.btn-small { min-height: 2.4rem; padding: .35rem 1rem; font-size: .92rem; }

/* Sections */
main { display: block; }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-alt { background: var(--surface-raised); border-block: 1px solid var(--border); }
.eyebrow { color: var(--action); font-weight: 600; font-size: .95rem; margin-bottom: .75rem; }
.section-head { max-width: 46rem; margin-bottom: 2.25rem; }
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.section-head p { margin-top: .9rem; color: var(--text-muted); font-size: 1.1rem; }

/* Hero */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.5rem); line-height: 1.25; }
.hero .lead { margin-top: 1.4rem; font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--text-muted); max-width: 40rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.status-note {
  display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.5rem;
  font-size: .92rem; color: var(--text-muted);
}
.status-note .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--ok); flex: none; }
@media (max-width: 56rem) { .hero-grid { grid-template-columns: 1fr; } }

.page-hero { padding-block: clamp(2.75rem, 7vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem); }
.page-hero h1 { font-size: clamp(2rem, 4.6vw, 3rem); }
.page-hero + .section { padding-top: 1rem; }
.page-hero .lead { margin-top: 1rem; font-size: clamp(1.08rem, 2vw, 1.25rem); color: var(--text-muted); max-width: 46rem; }

/* Illustrative matter card */
.mock {
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 20px;
  padding: 1.4rem; box-shadow: 0 18px 50px -24px rgb(28 33 38 / .35);
}
.mock-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .85rem; color: var(--text-muted); }
.mock-tag { background: var(--action-soft); color: var(--action); border-radius: 999px; padding: .1rem .65rem; font-weight: 600; }
.mock-title { margin-top: .9rem; font-size: 1.2rem; font-weight: 700; }
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1.1rem 0 0; }
.mock-grid div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .7rem .85rem; }
.mock-grid dt { font-size: .8rem; color: var(--text-muted); }
.mock-grid dd { margin: .15rem 0 0; font-weight: 600; }
.mock-flow { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; gap: .45rem; font-size: .92rem; }
.mock-flow li { display: flex; align-items: center; gap: .5rem; }
.mock-flow .icon { width: 1.1rem; height: 1.1rem; color: var(--ok); }
.mock-note { margin-top: 1rem; font-size: .78rem; color: var(--text-muted); }

/* Cards */
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr)); }
.card {
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; display: flex; flex-direction: column; gap: .6rem;
}
.section-alt .card { background: var(--surface); }
.card h3 { font-size: 1.15rem; }
.card p { color: var(--text-muted); font-size: 1rem; }
.card .more { margin-top: auto; padding-top: .5rem; font-weight: 600; text-decoration: none; }
.card .more:hover { text-decoration: underline; }
.icon-tile {
  width: 2.75rem; height: 2.75rem; border-radius: 12px; display: grid; place-items: center;
  background: var(--action-soft); color: var(--action);
}
.icon { width: 1.5rem; height: 1.5rem; }
.pillar { padding: 1.75rem; }
.pillar h3 { font-size: 1.35rem; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); counter-reset: step; }
.steps li {
  counter-increment: step; position: relative;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem 1.3rem 1.2rem;
}
.section-alt .steps li { background: var(--surface); }
.steps li::before {
  content: counter(step); display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%; margin-bottom: .7rem;
  background: var(--action); color: var(--action-text); font-weight: 700;
}
.steps strong { display: block; font-size: 1.08rem; margin-bottom: .25rem; }
.steps span { color: var(--text-muted); }

/* Feature detail blocks */
.features { display: grid; gap: 1.1rem; }
.feature {
  display: grid; grid-template-columns: 17rem 1fr; gap: 1.5rem;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem;
}
.feature-head { display: flex; flex-direction: column; gap: .8rem; }
.feature-head h2 { font-size: 1.3rem; }
.feature-head p { color: var(--text-muted); font-size: .98rem; }
@media (max-width: 52rem) { .feature { grid-template-columns: 1fr; gap: 1rem; } }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.checks { align-content: start; }
.checks li { position: relative; padding-inline-start: 1.9rem; }
.checks li::before {
  content: ""; position: absolute; inset-inline-start: .35rem; top: .45em;
  width: .42rem; height: .78rem; border-right: 2px solid var(--ok); border-bottom: 2px solid var(--ok);
  transform: rotate(45deg);
}
.checks li.soon::before {
  width: .8rem; height: .8rem; top: .5em; border: 2px solid var(--soon-text); border-radius: 50%; transform: none;
}

.badge-soon {
  display: inline-block; margin-inline-start: .4rem; padding: 0 .55rem;
  border-radius: 999px; background: var(--soon-bg); color: var(--soon-text);
  font-size: .78rem; font-weight: 700; line-height: 1.7; vertical-align: .1em; white-space: nowrap;
}
.badge-ok {
  display: inline-block; padding: 0 .55rem; border-radius: 999px;
  background: var(--action-soft); color: var(--ok); font-size: .78rem; font-weight: 700; line-height: 1.7; white-space: nowrap;
}

/* Integrations table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-raised); }
table { width: 100%; border-collapse: collapse; min-width: 34rem; }
th, td { text-align: start; padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .9rem; color: var(--text-muted); font-weight: 600; background: var(--surface-sunken); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; white-space: nowrap; }

/* FAQ */
.faq { display: grid; gap: .75rem; max-width: 52rem; }
.faq details { background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 1.25rem; }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.05rem 0; font-weight: 600; font-size: 1.08rem;
  display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--action); font-weight: 700; font-size: 1.3rem; line-height: 1.3; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 1.15rem; color: var(--text-muted); }

/* Callouts */
.callout {
  display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center;
  background: var(--action); color: var(--action-text);
  border-radius: 22px; padding: clamp(1.75rem, 4vw, 2.75rem);
}
.callout h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.callout p { margin-top: .6rem; opacity: .9; }
.callout .btn { background: var(--action-text); color: var(--action); border-color: var(--action-text); }
@media (max-width: 44rem) { .callout { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 52rem) { .split { grid-template-columns: 1fr; } }

.prose { max-width: 46rem; }
.prose p + p { margin-top: 1rem; }
.muted { color: var(--text-muted); }
.small { font-size: .92rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding-block: 3rem 2rem; background: var(--surface-raised); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-grid h2 { font-size: .95rem; color: var(--text-muted); font-weight: 600; margin-bottom: .75rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.footer-grid a { color: var(--text); text-decoration: none; }
.footer-grid a:hover { color: var(--action); text-decoration: underline; }
.footer-about p { color: var(--text-muted); margin-top: .75rem; max-width: 24rem; }
.footer-base { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .9rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
@media (max-width: 48rem) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media print {
  .site-header, .site-footer, .callout, .hero-actions { display: none; }
  body { background: #fff; color: #000; }
}
