/*
 * Time2Pray — the site, in the app's own palette.
 *
 * The app's colour follows the prayer day: indigo at Fajr, blue at Dhuhr, amber through Asr,
 * clay at Maghrib and deep navy at Isha. A web page cannot move with somebody's local prayer
 * times, so it takes Dhuhr — the state the app treats as canonical, the one the icon and the
 * store screenshots are made in — and Isha for anyone whose device asks for a dark page.
 *
 * These are the same hex values as constants/colors.ts. If the app's palette moves, this is
 * the other place it has to move.
 */

:root {
  /* Dhuhr */
  --bg: #f2f7fa;
  --card: #ffffff;
  --surface: #e7eff5;
  --primary: #1a6491;
  --primary-dim: #ddeaf3;
  --accent: #0e7c86;
  --text: #10202b;
  --text-secondary: #37505f;
  --text-muted: #5a7182;
  --border: #dce7ee;
  --on-fill: #ffffff;
  --danger: #b3261e;

  /* The five states, for the one place the whole day is drawn at once. */
  --fajr: #3b3a78;
  --dhuhr: #1a6491;
  --asr: #8f551b;
  --maghrib: #a8402f;
  --isha: #101423;

  --radius: 16px;
  --radius-lg: 24px;
  --measure: 68ch;
  --shadow: 0 1px 2px rgb(16 32 43 / 6%), 0 8px 24px rgb(16 32 43 / 6%);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Isha */
    --bg: #101423;
    --card: #1a2033;
    --surface: #161b2b;
    --primary: #8fa4cc;
    --primary-dim: #1e2439;
    --accent: #c9ac72;
    --text: #e7eaf5;
    --text-secondary: #afb6ce;
    --text-muted: #8892ae;
    --border: #252c44;
    --on-fill: #101423;
    --danger: #ff8a80;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 800px; }

/* ── Type ──────────────────────────────────────────────────────────────── */

h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.6rem); margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
p { margin: 0 0 1rem; max-width: var(--measure); }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
strong { color: var(--text); font-weight: 600; }
ul, ol { max-width: var(--measure); padding-left: 1.25rem; }
li { margin-bottom: 0.5rem; }
.lede { font-size: 1.125rem; color: var(--text-secondary); }
.muted { color: var(--text-muted); }
.overline {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem;
}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

/* ── Chrome ────────────────────────────────────────────────────────────── */

header.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow); }
.brand span b { color: var(--primary); font-weight: 600; }
.nav-links { display: flex; gap: 20px; font-size: 0.9rem; flex-wrap: wrap; }
.nav-links a { color: var(--text-secondary); text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--primary); }

main { flex: 1 0 auto; padding-bottom: 72px; }

footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  background: var(--surface);
}
.foot { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.9rem; }
.foot a { color: var(--text-secondary); text-decoration: none; }
.foot a:hover { color: var(--primary); }
.foot p { margin: 0; font-size: 0.875rem; color: var(--text-muted); }

/* ── The arch, filled with the day ─────────────────────────────────────── */

.hero { padding: 72px 0 40px; text-align: center; }
.hero .arch { width: 132px; height: auto; margin: 0 auto 28px; display: block; }
.hero h1 { margin-bottom: 16px; }
.hero .lede { margin: 0 auto 32px; max-width: 46ch; }

.badges { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: center; }
.badges a { display: inline-flex; transition: transform 0.15s ease; }
.badges a:hover { transform: translateY(-2px); }
.badges img { height: 52px; width: auto; }

/* ── Blocks ────────────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 44px);
  box-shadow: var(--shadow);
}

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.feature .ico {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--primary-dim); color: var(--primary);
  display: grid; place-items: center; margin-bottom: 14px;
}
.feature .ico svg { width: 21px; height: 21px; }
.feature h3 { margin-bottom: 6px; }
.feature p { font-size: 0.9rem; color: var(--text-secondary); margin: 0; }

.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
}
.note.warn { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.note p:last-child, .note ol:last-child, .note ul:last-child { margin-bottom: 0; }

.page-head { padding: 56px 0 8px; }
.page-head h1 { margin-bottom: 10px; }

section.doc { margin-bottom: 8px; }
section.doc h2:first-child { margin-top: 2rem; }

.rule { height: 1px; background: var(--border); border: 0; margin: 40px 0; }

/* The day, as a bar. Same five colours the app moves through. */
.daybar {
  height: 6px; border-radius: 999px; margin: 0 auto 32px; max-width: 260px;
  background: linear-gradient(90deg, var(--fajr), var(--dhuhr) 32%, var(--asr) 58%, var(--maghrib) 78%, var(--isha));
}

.contact-row {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px 0; border-bottom: 1px solid var(--border);
}
.contact-row:last-child { border-bottom: 0; }
.contact-row .ico {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  background: var(--primary-dim); color: var(--primary);
  display: grid; place-items: center;
}
.contact-row .ico svg { width: 20px; height: 20px; }
.contact-row div p { margin: 0; font-size: 0.925rem; color: var(--text-secondary); }
.contact-row div p.who { color: var(--text); font-weight: 500; }

@media (max-width: 620px) {
  .nav-inner { height: auto; padding: 12px 0; flex-direction: column; align-items: flex-start; }
  .hero { padding: 48px 0 32px; }
}

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