/* Apps by Syed Shehzad Gillani: one stylesheet for every page.
   Colours come from the Nidaly brand (docs/brand.md): lapis, turquoise, sand, brass.
   The page header is a "prayer sky", the same gradients the app uses on its main screen. */

:root {
  color-scheme: light dark;
  --bg: #FAF6EF;          /* sand50 */
  --surface: #F3ECDF;
  --line: #EADFCB;        /* sand200 */
  --text: #1A1D24;        /* ink, 15.7:1 on sand50 */
  --muted: #4A4F5C;       /* 7.7:1 on sand50 */
  --heading: #22356B;     /* lapis700, 10.9:1 */
  --link: #0F6E66;        /* turquoise700, 5.7:1 */
  --mark: #8A6A1F;        /* brass700, 4.7:1 */
  --focus: #0F6E66;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 66ch;
  --gutter: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14203F;        /* lapis900 */
    --surface: #1A2850;
    --line: #2C3D70;
    --text: #E8ECF4;      /* mist, 13.6:1 */
    --muted: #B7C0D3;     /* 8.6:1 */
    --heading: #F4F6FA;
    --link: #3CC4B5;      /* turquoise400, 7.5:1 */
    --mark: #D9B25A;      /* brass400, 8.0:1 */
    --focus: #D9B25A;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 var(--font-body);
  overflow-wrap: break-word;
}

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

.skip {
  position: absolute; left: 0.75rem; top: -4rem; z-index: 10;
  padding: 0.6rem 1rem; border-radius: 0.6rem;
  background: #FAF6EF; color: #14203F; font-weight: 600;
}
.skip:focus { top: 0.75rem; }

.wrap { width: 100%; max-width: 46rem; margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 40rem) { :root { --gutter: 2rem; } }

/* ---------- Header: the prayer sky ---------- */

.sky {
  --sky: linear-gradient(180deg, #1B2450 0%, #3A3A6E 45%, #5B4A86 78%, #D98C78 100%); /* Fajr */
  --sky-text: #FFFFFF;
  --sky-muted: #E3E1F2;
  --sky-arch: #3CC4B5;
  --sky-sun: #D9B25A;
  position: relative;
  overflow: hidden;
  background: #1B2450 var(--sky);
  color: var(--sky-text);
  padding-block: 1rem 3.25rem;
}
.sky--isha {
  --sky: linear-gradient(180deg, #0E1530 0%, #14203F 55%, #22356B 100%);
  --sky-muted: #D3D9E8;
}
.sky--dhuhr {
  --sky: linear-gradient(180deg, #3F8FD0 0%, #6FB6E3 55%, #CDE7F5 100%);
  --sky-text: #1A1D24;
  --sky-muted: #1A1D24;
  --sky-arch: #14203F;
  --sky-sun: #FAF6EF;
  background-color: #3F8FD0;
}

/* The mihrab arch from the app icon, large and quiet, standing on the horizon. */
.sky__arch {
  position: absolute; right: -1rem; bottom: 0;
  width: 5.5rem; height: auto;
  opacity: 0.4; pointer-events: none;
}
@media (min-width: 40rem) { .sky__arch { right: -1.5rem; width: 12rem; opacity: 0.55; } }
.sky__arch path { fill: none; stroke: var(--sky-arch); stroke-width: 3; }
.sky__arch circle { fill: var(--sky-sun); }
.sky .wrap { position: relative; }

.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.25rem; }
.topnav a { color: var(--sky-text); text-decoration: none; }
.topnav a:hover, .topnav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.3em; }
.topnav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin: 0; padding: 0; list-style: none; font-size: 0.95rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; margin-right: auto; font: 600 1.05rem/1 var(--font-display); }
.brand svg { width: 1.35rem; height: 1.6rem; }
.brand path { fill: none; stroke: var(--sky-arch); stroke-width: 3.5; }
.brand circle { fill: var(--sky-sun); }
.sky :focus-visible { outline-color: currentColor; }

.eyebrow {
  margin: 2.75rem 0 0.4rem;
  font: 600 0.8rem/1.3 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--sky-muted);
}
.sky h1 {
  margin: 0; max-width: 18ch;
  font: 700 clamp(2rem, 1.4rem + 3vw, 3rem)/1.08 var(--font-display);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.lede { margin: 0.9rem 0 0; max-width: 34rem; font-size: 1.125rem; color: var(--sky-muted); text-wrap: pretty; }

/* ---------- Main content ---------- */

main { padding-block: 2.25rem 3rem; }
main > * { max-width: var(--measure); }

h2, h3 { color: var(--heading); font-family: var(--font-display); line-height: 1.2; text-wrap: balance; }
h2 { margin: 2.6rem 0 0.6rem; font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { margin: 1.8rem 0 0.4rem; font-size: 1.12rem; font-weight: 650; }
main > h2:first-child { margin-top: 0; }
p, ul, ol, dl { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--mark); }
strong { font-weight: 650; }

.meta { font-size: 0.95rem; color: var(--muted); }
.meta time { font-family: var(--font-mono); font-size: 0.9em; }

/* "At a glance" box */
.glance {
  margin: 0 0 2rem; padding: 1.1rem 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--mark);
  border-radius: 0.9rem;
}
.glance h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.glance ul { margin: 0; }
.glance li:last-child { margin-bottom: 0; }

.path { font-weight: 600; white-space: normal; }

/* FAQ */
.faq { margin: 0 0 1rem; padding: 0; list-style: none; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary {
  display: flex; gap: 0.75rem; align-items: baseline; justify-content: space-between;
  padding: 0.95rem 0; cursor: pointer; list-style: none;
  font: 650 1.06rem/1.35 var(--font-display); color: var(--heading);
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; flex: none; font: 400 1.4rem/1 var(--font-body); color: var(--mark); }
details[open] summary::after { content: "\2212"; }
details > :not(summary) { margin-top: 0; }
details > :last-child { margin-bottom: 1.1rem; }

/* Contact card */
.contact {
  display: grid; gap: 0.25rem; margin: 0 0 2rem; padding: 1.1rem 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 0.9rem;
}
.contact p { margin: 0; }
.contact .email { font: 650 1.2rem/1.4 var(--font-display); }

/* App list on the portfolio index */
.apps { margin: 0; padding: 0; list-style: none; }
.app {
  display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; align-items: start;
  padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.1rem;
}
.app__icon {
  grid-row: span 3; width: 3.5rem; height: 3.5rem; border-radius: 0.95rem;
  background: linear-gradient(180deg, #1B2450, #5B4A86 70%, #D98C78);
  display: grid; place-items: center;
}
.app__icon svg { width: 1.7rem; height: 2rem; }
.app__icon path { fill: none; stroke: #3CC4B5; stroke-width: 3.5; }
.app__icon circle { fill: #D9B25A; }
.app h2 { margin: 0; font-size: 1.3rem; }
.app h2 a { color: inherit; text-decoration: none; }
.app h2 a:hover { text-decoration: underline; }
.app p { margin: 0; }
.app__links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.4rem !important; font-size: 0.95rem; }

/* Feature list on the app page */
.features h3 { margin-top: 1.6rem; }

/* ---------- Footer ---------- */

.foot { padding-block: 1.5rem 2.5rem; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--muted); }
.foot p { margin: 0 0 0.35rem; }
.foot a { color: var(--link); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .sky { background: none; color: #000; padding-bottom: 1rem; }
  .sky__arch, .topnav ul, .skip { display: none; }
  a { color: #000; }
}
