/* Qatra website.
   Colours are the app's palette tokens verbatim (app/lib/theme.dart) so the site
   and the app read as one product. Light and dark are both first-class: a large
   share of our users browse in dark mode on cheap Android phones. */

:root {
  --accent: #D21E3C;
  --accent-deep: #A0152C;
  --accent-soft: #FBE7EB;
  --ink: #1C1416;
  --muted: #7C6B6D;
  --faint: #A5979A;
  --ground: #FAF5F4;
  --surface: #FFFFFF;
  --surface-2: #F5ECEA;
  --hairline: #ECE0DE;
  --success: #1B9C68;
  --success-soft: #E4F4EC;
  --warn: #DE8618;
  --warn-soft: #FBEFD9;

  --wrap: 1080px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 20, 22, .04), 0 8px 28px rgba(28, 20, 22, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #F5455F;
    --accent-deep: #C82940;
    --accent-soft: #3A1C22;
    --ink: #F6ECEB;
    --muted: #A99799;
    --faint: #7C6A6C;
    --ground: #171112;
    --surface: #221A1B;
    --surface-2: #2B2122;
    --hairline: #342829;
    --success: #3CBE86;
    --success-soft: #17352A;
    --warn: #EDA23F;
    --warn-soft: #3A2A15;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", "Noto Nastaliq Urdu", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-deep); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  display: flex; align-items: center; gap: 16px;
  min-height: 62px; flex-wrap: wrap;
}

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none;
  letter-spacing: -.02em; margin-right: auto;
}

/* The mark: a blood drop, drawn in CSS so there is no image to load or lose. */
.drop {
  width: 15px; height: 19px; flex: none;
  background: linear-gradient(160deg, var(--accent), var(--accent-deep));
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  transform: rotate(45deg) scale(.94);
  border-top-left-radius: 2px;
}

.brand-ur { color: var(--muted); font-weight: 500; font-size: 15px; }

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }

.site-nav a {
  color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500;
  padding: 7px 11px; border-radius: 8px; white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a.active { color: var(--accent); background: var(--accent-soft); }

.navtoggle, .navburger { display: none; }

@media (max-width: 760px) {
  .navburger {
    display: block; width: 38px; height: 38px; border-radius: 9px;
    border: 1px solid var(--hairline); cursor: pointer; position: relative;
    background: var(--surface);
  }
  .navburger span,
  .navburger span::before,
  .navburger span::after {
    position: absolute; left: 10px; width: 18px; height: 2px;
    background: var(--ink); border-radius: 2px; content: "";
  }
  .navburger span { top: 18px; }
  .navburger span::before { top: -6px; left: 0; }
  .navburger span::after { top: 6px; left: 0; }
  .site-nav { display: none; width: 100%; padding-bottom: 10px; }
  .navtoggle:checked ~ .site-nav { display: flex; flex-direction: column; }
}

/* ---------- layout ---------- */

.layout {
  display: grid; grid-template-columns: 216px minmax(0, 1fr);
  gap: 44px; align-items: start; padding-top: 40px; padding-bottom: 72px;
}
.layout:has(> .doc:only-child) { grid-template-columns: minmax(0, 1fr); }

.toc { position: sticky; top: 86px; font-size: 13.5px; }
.toc-title {
  margin: 0 0 10px; text-transform: uppercase; letter-spacing: .07em;
  font-size: 11px; font-weight: 700; color: var(--faint);
}
.toc a {
  display: block; padding: 5px 10px; color: var(--muted); text-decoration: none;
  border-left: 2px solid var(--hairline); border-radius: 0 6px 6px 0; line-height: 1.4;
}
.toc a:hover { color: var(--accent); border-left-color: var(--accent); background: var(--surface-2); }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
}

/* ---------- document ---------- */

.doc { min-width: 0; }
.doc > h1:first-child { margin-top: 0; }

.doc h1 {
  font-size: clamp(30px, 5vw, 40px); line-height: 1.15; letter-spacing: -.025em;
  margin: 0 0 8px;
}
.doc h2 {
  font-size: 22px; letter-spacing: -.015em; margin: 44px 0 12px;
  padding-top: 26px; border-top: 1px solid var(--hairline);
}
.doc h3 { font-size: 17px; margin: 28px 0 8px; }
.doc h1 + p, .doc h1 + p + p { color: var(--muted); }

.doc p, .doc li { overflow-wrap: break-word; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--accent); }

.doc hr { display: none; }   /* h2 borders already separate sections */

.doc code {
  background: var(--surface-2); border: 1px solid var(--hairline);
  padding: .12em .38em; border-radius: 5px; font-size: .88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

blockquote {
  margin: 22px 0; padding: 15px 18px; border-radius: var(--radius);
  border: 1px solid var(--hairline); background: var(--surface); font-size: 15px;
}
blockquote.warning { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
blockquote.note    { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
blockquote > :first-child { margin-top: 0; }
blockquote > :last-child { margin-bottom: 0; }

/* Wide tables scroll inside their own box — the page itself must never scroll
   sideways on a phone. */
.table-wrap {
  overflow-x: auto; margin: 20px 0; border: 1px solid var(--hairline);
  border-radius: var(--radius); background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hairline); }
th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- home ---------- */

.hero { padding: 76px 0 56px; text-align: center; }
.hero h1 {
  font-size: clamp(36px, 7vw, 60px); line-height: 1.05; letter-spacing: -.035em;
  margin: 0 0 18px; font-weight: 800;
}
.hero .lede {
  font-size: clamp(17px, 2.4vw, 20px); color: var(--muted);
  max-width: 620px; margin: 0 auto 12px; line-height: 1.55;
}
.eyebrow {
  display: inline-block; margin-bottom: 20px; padding: 6px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600;
  letter-spacing: .01em;
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin: 40px 0; }
.card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 16.5px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.stat { font-size: 30px; font-weight: 800; color: var(--accent); letter-spacing: -.02em; line-height: 1.1; }

.btn {
  display: inline-block; padding: 12px 22px; border-radius: 11px; font-weight: 600;
  text-decoration: none; background: var(--accent); color: #fff; border: 1px solid transparent;
}
.btn:hover { background: var(--accent-deep); color: #fff; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--hairline); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }

.panel {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); margin: 26px 0;
}
.panel h2 { margin-top: 0; border: 0; padding-top: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 22px 0; }
.steps li {
  counter-increment: step; position: relative; padding-left: 46px; margin: 0 0 20px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -1px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.steps strong { display: block; margin-bottom: 2px; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--hairline); background: var(--surface);
  padding: 34px 0 44px; margin-top: auto; font-size: 14px;
}
.footer-tag { color: var(--muted); margin: 0 0 16px; max-width: 560px; }
.footer-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.footer-nav a {
  color: var(--muted); text-decoration: none; padding: 5px 10px 5px 0; font-size: 14px;
}
.footer-nav a:hover { color: var(--accent); }
.footer-meta { color: var(--faint); margin: 0; font-size: 13px; }

@media print {
  .site-header, .site-footer, .toc, .skip { display: none; }
  body { background: #fff; color: #000; }
  .layout { grid-template-columns: 1fr; padding-top: 0; }
}
