/* QurSaan Apps
   Layout: a lunar index. Wordmark + tonight's moon up top, then every app as a row in one ledger.
   Moon gold is the only loud color; everything else is cool silver neutrals. */
:root {
  --bg: #f1f3f6;
  --bg-2: #e7ebf0;
  --surface: #ffffff;
  --ink: #0f1722;
  --ink-2: #2b3644;
  --muted: #5d6876;
  --line: rgba(15, 23, 34, 0.12);
  --line-2: rgba(15, 23, 34, 0.22);
  --gold: #9a6510;          /* gold for text on light */
  --gold-fill: #f2c46d;     /* gold for surfaces */
  --on-gold: #2a1c03;
  --teal: #0f766e;
  --live: #15803d;
  --dev: #1d4ed8;
  --shadow: 0 24px 60px -30px rgba(15, 23, 34, 0.35);
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --arabic: "Noto Kufi Arabic", "Geeza Pro", sans-serif;
  --max: 1180px;
  --gutter: 28px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e13; --bg-2: #0f141b; --surface: #121922;
    --ink: #e9edf2; --ink-2: #c3cbd5; --muted: #8b96a3;
    --line: rgba(233, 237, 242, 0.1); --line-2: rgba(233, 237, 242, 0.2);
    --gold: #f2c46d; --gold-fill: #f2c46d; --on-gold: #2a1c03;
    --teal: #2dd4bf; --live: #4ade80; --dev: #93c5fd;
    --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0e13; --bg-2: #0f141b; --surface: #121922;
  --ink: #e9edf2; --ink-2: #c3cbd5; --muted: #8b96a3;
  --line: rgba(233, 237, 242, 0.1); --line-2: rgba(233, 237, 242, 0.2);
  --gold: #f2c46d; --gold-fill: #f2c46d; --on-gold: #2a1c03;
  --teal: #2dd4bf; --live: #4ade80; --dev: #93c5fd;
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 60; background: var(--bg);
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
::selection { background: color-mix(in srgb, var(--gold-fill) 45%, transparent); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.wrap {
  max-width: var(--max); margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
@media (max-width: 560px) { :root { --gutter: 18px; } }

h1, h2, h3, h4 { font-family: var(--display); margin: 0; text-wrap: balance; letter-spacing: -0.02em; }
.label {
  font: 500 11.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.label.gold { color: var(--gold); }

/* ---------- Top bar ---------- */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.bar .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 16px rgba(242, 196, 109, 0.45); }
.brand span { font: 700 19px/1 var(--display); letter-spacing: -0.02em; }
.brand b { color: var(--gold); font-weight: 700; }
.bar nav { display: flex; gap: 4px; }
.bar nav a {
  text-decoration: none; font-size: 14.5px; color: var(--ink-2);
  padding: 8px 12px; border-radius: 8px;
}
.bar nav a:hover { background: var(--bg-2); color: var(--ink); }
.theme-btn {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.theme-btn:hover { border-color: var(--line-2); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon-i { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon-i { display: none; }
}
@media (max-width: 560px) { .bar nav { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer;
  font: 600 15px/1 var(--body); padding: 14px 20px; border-radius: 12px; border: 1px solid transparent;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-line { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn-line:hover { border-color: var(--ink); }
.btn-gold { background: var(--gold-fill); color: var(--on-gold); }

/* ---------- Hero ---------- */
.hero { padding-block: 72px 64px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; align-items: end; }
.wordmark {
  font-size: clamp(64px, 11.5vw, 156px); font-weight: 700; line-height: 0.86;
  letter-spacing: -0.045em; margin-top: 22px;
}
.wordmark .gold { color: var(--gold); display: block; }
.hero p.lede {
  font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 46ch; margin: 30px 0 0; text-wrap: pretty;
}
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* Tonight's moon */
.tonight {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: 26px; box-shadow: var(--shadow);
}
.tonight-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tonight .disc { position: relative; width: min(100%, 250px); aspect-ratio: 1; margin: 22px auto 10px; }
.tonight .disc svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tonight .glow { position: absolute; inset: 8%; border-radius: 50%; box-shadow: 0 0 80px rgba(242, 196, 109, 0.35); }
.tonight dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px 0 0; border-top: 1px solid var(--line); }
.tonight dl div { padding: 14px 0 0; }
.tonight dl div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.tonight dd { margin: 6px 0 0; font: 600 16px/1.25 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.tonight .hijri { font: 500 14px/1.4 var(--body); color: var(--ink-2); text-align: center; }

@media (max-width: 880px) {
  .hero { padding-block: 44px 44px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- Section head ---------- */
.section { padding-block: 80px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(34px, 4.4vw, 54px); line-height: 1; margin-top: 12px; }
.section-head p { color: var(--muted); margin: 12px 0 0; max-width: 52ch; }

/* ---------- Index controls ---------- */
.controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 32px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button {
  font: 500 14px/1 var(--body); color: var(--ink-2); background: transparent; border: 0; cursor: pointer;
  padding: 9px 13px; border-radius: 9px; display: inline-flex; gap: 8px; align-items: center;
}
.seg button span { font: 500 11.5px/1 var(--mono); color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 34, 0.12); }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); min-width: 0;
}
.search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search input { border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 15px var(--body); width: 200px; max-width: 100%; }
.search:focus-within { border-color: var(--gold); }
@media (max-width: 640px) { .search { margin-left: 0; width: 100%; } .search input { width: 100%; } }

/* ---------- Index rows ---------- */
.index { margin-top: 22px; border-top: 1px solid var(--line-2); }
.index-head, .row {
  display: grid; align-items: center; gap: 20px;
  grid-template-columns: 44px minmax(0, 2.6fr) minmax(0, 1fr) minmax(0, 1fr) 150px 24px;
}
.index-head { padding: 12px 8px; border-bottom: 1px solid var(--line); }
.row {
  position: relative; padding: 20px 8px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit; transition: background 0.2s;
}
a.row:hover { background: var(--surface); }
.row .no { font: 500 13px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.row .app { display: flex; align-items: center; gap: 16px; min-width: 0; }
.row .app img {
  width: 56px; height: 56px; border-radius: 23%; flex: none;
  box-shadow: 0 8px 20px -10px rgba(15, 23, 34, 0.5), 0 0 0 1px var(--line);
  transition: transform 0.3s;
}
a.row:hover .app img { transform: rotate(-4deg) scale(1.05); }
.row h3 { font-size: 22px; line-height: 1.15; }
.row .tag { color: var(--muted); font-size: 14.5px; margin: 3px 0 0; }
.row .cell { font-size: 14.5px; color: var(--ink-2); }
.pill {
  display: inline-flex; align-items: center; gap: 7px; font: 500 12px/1 var(--mono);
  padding: 6px 10px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--live); }
.pill.soon { color: var(--gold); }
.pill.dev { color: var(--dev); }
.row .go { width: 22px; height: 22px; color: var(--muted); transition: transform 0.25s, color 0.25s; }
a.row:hover .go { transform: translateX(4px); color: var(--ink); }
.row.next { color: var(--muted); }
.row.next .ph {
  width: 56px; height: 56px; border-radius: 23%; flex: none; display: grid; place-items: center;
  border: 1.5px dashed var(--line-2); color: var(--muted);
}
.row.next .ph svg { width: 22px; height: 22px; }
.row.next h3 { color: var(--ink-2); }
.empty { padding: 40px 8px; color: var(--muted); border-bottom: 1px solid var(--line); }

@media (max-width: 820px) {
  .index-head { display: none; }
  .row { grid-template-columns: 32px minmax(0, 1fr) 22px; row-gap: 12px; }
  .row .cell-platform, .row .cell-category { display: none; }
  .row .cell-status { grid-column: 2; }
  .row .go { grid-column: 3; grid-row: 1; }
}

/* ---------- Promises ---------- */
.promises { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.promises li { padding: 26px 24px 6px 0; }
.promises li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.promises svg { width: 24px; height: 24px; color: var(--gold); }
.promises h3 { font-size: 20px; margin-top: 16px; }
.promises p { color: var(--muted); font-size: 15px; margin: 8px 0 0; }
@media (max-width: 900px) {
  .promises { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .promises li:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 540px) {
  .promises { grid-template-columns: 1fr; }
  .promises li, .promises li + li { padding: 22px 0 4px; border-left: 0; }
  .promises li + li { border-top: 1px solid var(--line); }
}

/* ---------- Footer ---------- */
.foot { margin-top: 110px; border-top: 1px solid var(--line); padding-block: 36px 44px; }
.foot .wrap { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.foot small { color: var(--muted); font-size: 13.5px; display: inline-flex; align-items: center; gap: 10px; }
.foot small img { width: 20px; height: 20px; border-radius: 50%; }
.foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.foot nav a { color: var(--muted); font-size: 13.5px; text-decoration: none; }
.foot nav a:hover { color: var(--ink); }

/* ---------- App page ---------- */
.crumbs { font: 500 12.5px/1 var(--mono); color: var(--muted); }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.app-hero { padding-block: 40px 72px; border-bottom: 1px solid var(--line); }
.app-hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 56px; align-items: center; margin-top: 40px; }
.app-hero .icon { width: 112px; height: 112px; border-radius: 23%; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.app-hero h1 { font-size: clamp(48px, 7vw, 92px); line-height: 0.92; letter-spacing: -0.045em; margin-top: 28px; }
.app-hero .ar { font-family: var(--arabic); color: var(--gold); font-size: 20px; margin-top: 12px; }
.app-hero p.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 48ch; margin: 22px 0 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.meta-row span { font: 500 12px/1 var(--mono); padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); }
.app-hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.app-hero .note { color: var(--muted); font-size: 13.5px; margin-top: 12px; }
.stage { position: relative; display: grid; place-items: center; padding-block: 10px; }
.stage::before {
  content: ""; position: absolute; width: 88%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold-fill) 38%, transparent), transparent 65%);
}
.stage::after { content: ""; position: absolute; width: 104%; max-width: 480px; aspect-ratio: 1; border-radius: 50%; border: 1px dashed var(--line-2); }
@media (max-width: 880px) { .app-hero-grid { grid-template-columns: 1fr; } }

.feature-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 36px; border-top: 1px solid var(--line-2); }
.feature-list > div { padding: 26px 26px 26px 0; border-bottom: 1px solid var(--line); }
.feature-list > div:not(:nth-child(3n+1)) { padding-left: 26px; border-left: 1px solid var(--line); }
.feature-list h3 { font-size: 19px; }
.feature-list p { color: var(--muted); font-size: 15px; margin: 8px 0 0; }
@media (max-width: 860px) {
  .feature-list { grid-template-columns: 1fr; }
  .feature-list > div, .feature-list > div:not(:nth-child(3n+1)) { padding: 22px 0; border-left: 0; }
}

.counter { margin-top: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; }
.counter .bar-split { display: flex; gap: 4px; height: 16px; margin-top: 14px; }
.counter .bar-split i { display: block; border-radius: 5px; }
.kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin-top: 24px; }
.kinds h4 { font-size: 18px; display: flex; align-items: center; gap: 9px; }
.kinds h4::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.kinds .ar { font-family: var(--arabic); color: var(--muted); font-size: 13px; margin-top: 2px; }
.kinds p { color: var(--muted); font-size: 14.5px; margin: 8px 0 0; }
@media (max-width: 860px) { .kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .kinds { grid-template-columns: 1fr; } }

.steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 18px; }
.steps li::before { content: "Step " counter(step); font: 500 11.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.steps h3 { font-size: 21px; margin-top: 12px; }
.steps p { color: var(--muted); margin: 8px 0 0; font-size: 15px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.spec { margin: 36px 0 0; border-top: 1px solid var(--line-2); }
.spec div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.spec dt { color: var(--muted); font-size: 14.5px; }
.spec dd { margin: 0; }
@media (max-width: 560px) { .spec div { grid-template-columns: 1fr; gap: 2px; } }

.dedication { margin-top: 80px; text-align: center; padding-block: 48px; border-block: 1px solid var(--line); }
.dedication .ar { font-family: var(--arabic); font-size: clamp(20px, 2.6vw, 26px); line-height: 1.9; color: var(--gold); direction: rtl; }
.dedication p { color: var(--muted); margin: 6px 0 0; }

/* ---------- Phone mockup (app UI is always light) ---------- */
.phone {
  position: relative; width: min(100%, 290px); aspect-ratio: 9 / 19.2; border-radius: 46px; padding: 11px;
  background: linear-gradient(145deg, #2a3338, #0d1316);
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, 0.55), inset 0 0 0 1.5px rgba(255, 255, 255, 0.12);
}
.screen {
  position: relative; height: 100%; border-radius: 36px; overflow: hidden;
  background: linear-gradient(180deg, #e9f3f1, #f5f7f6 40%); color: #0d2a2b;
  font: 400 11px/1.4 var(--body); padding: 44px 14px 14px; display: flex; flex-direction: column; gap: 10px;
}
.screen .island { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 84px; height: 24px; background: #000; border-radius: 20px; }
.screen .sbar { position: absolute; top: 14px; left: 26px; right: 24px; display: flex; justify-content: space-between; font-weight: 700; font-size: 11px; }
.scr-title { font: 700 21px/1.1 var(--display); letter-spacing: -0.02em; }
.scr-hero { border-radius: 20px; padding: 16px; color: #fff; background: linear-gradient(150deg, #14897f, #0b2e3f); display: flex; align-items: center; gap: 14px; }
.ring { width: 84px; height: 84px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1; }
.ring .num b { font: 700 24px/1 var(--display); display: block; }
.ring .num span { font-size: 8.5px; opacity: 0.8; }
.scr-hero .meta { font-size: 10.5px; opacity: 0.92; display: grid; gap: 4px; }
.scr-hero .meta strong { font-size: 13px; }
.scr-card { background: #fff; border-radius: 16px; padding: 11px 12px; box-shadow: 0 2px 10px rgba(13, 42, 43, 0.06); }
.scr-card .lbl { font-size: 9.5px; color: #5c7072; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.scr-btn { margin-top: 8px; background: #0f766e; color: #fff; border-radius: 11px; text-align: center; padding: 8px; font-weight: 700; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 8px; text-align: center; font-size: 9px; }
.cal span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; color: #3a4d4f; }
.cal .h { color: #94a3a5; font-weight: 600; }
.cal .done { background: #0f766e; color: #fff; }
.cal .plan { box-shadow: inset 0 0 0 1.4px #52525b; }
.cal .miss { background: #fde2e2; color: #b91c1c; }
.cal .vow { background: #f2c46d; color: #3b2a05; }

/* ---------- Prose (privacy) ---------- */
.prose { max-width: 720px; padding-block: 40px 0; }
.prose h1 { font-size: clamp(40px, 5.4vw, 64px); line-height: 0.98; letter-spacing: -0.04em; margin-top: 30px; }
.prose .updated { font: 500 12.5px/1 var(--mono); color: var(--muted); margin-top: 16px; }
.prose h2 { font-size: 24px; margin-top: 44px; }
.prose p, .prose li { color: var(--ink-2); font-size: 16.5px; line-height: 1.75; }
.prose a { color: var(--gold); }
.prose .callout { margin-top: 30px; padding: 20px 22px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--teal); }
.prose .callout p { margin: 0; color: var(--ink); }

/* ---------- Motion ---------- */
.rise { animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.rise.d1 { animation-delay: 0.08s; } .rise.d2 { animation-delay: 0.16s; } .rise.d3 { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0.001; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
