/* tastemaker · macrostructure: Long-Scroll Narrative (one day, Fajr to Isha) · nav: N-logo-single-action · hero: H-split-screen · footer: F-single-row · mood: elegant (existing Noor brand, not generated) · contrast: pass (scrimmed sky, worst text pair 5.4:1) · arc: hook/problem/how-it-works/solution/proof/close · critique: ShowTell 4 · Phil 5 · Hier 4 · Spec 5 · Restr 4 · Var 4 · ColorHarm 5 · MoodTone 5 · Type 4 · Spatial 4 · Pref 4 */

@font-face { font-family: "Jost"; src: url("/assets/fonts/Jost-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Jost"; src: url("/assets/fonts/Jost-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jost"; src: url("/assets/fonts/Jost-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Marcellus"; src: url("/assets/fonts/Marcellus-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Amiri"; src: url("/assets/fonts/Amiri-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --night: #070b1d;
  --sheet: #111836;
  --ink: #f6f3ea;
  --ink-muted: #d9d6ce;
  --gold: #e8c77a;
  --gold-deep: #d9a954;
  --gold-light: #f1d68f;
  --on-gold: #2a1e08;
  --line: rgba(246, 243, 234, 0.16);
  --scrim: rgba(7, 11, 29, 0.55);

  --font-display: "Marcellus", Georgia, serif;
  --font-ui: "Jost", system-ui, sans-serif;
  --font-arabic: "Amiri", "Noto Naskh Arabic", serif;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;
  --space-24: 96px; --space-32: 128px; --space-40: 160px;

  --radius-screen: 28px;
  --radius-card: 20px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --measure: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-light); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px;
  background: var(--gold); color: var(--on-gold); padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill); font-weight: 500; z-index: 20;
}
.skip-link:focus { top: var(--space-4); }

/* ---------- Sky: the app's time-of-day gradients, scrimmed for text ---------- */
.sky { position: fixed; inset: 0; z-index: -1; background: var(--night); }
.sky-layer { position: absolute; inset: 0; opacity: 0; }
.sky-layer.is-active { opacity: 1; }
.sky-layer[data-sky="predawn"] { background: linear-gradient(180deg, #1a1d4d 0%, #74406f 100%); }
.sky-layer[data-sky="dawn"]    { background: linear-gradient(180deg, #33508f 0%, #c88a6c 100%); }
.sky-layer[data-sky="day"]     { background: linear-gradient(180deg, #1f5a8c 0%, #4f97bd 100%); }
.sky-layer[data-sky="asr"]     { background: linear-gradient(180deg, #2a5272 0%, #b8864e 100%); }
.sky-layer[data-sky="maghrib"] { background: linear-gradient(180deg, #3a2a66 0%, #c9603f 100%); }
.sky-layer[data-sky="isha"]    { background: linear-gradient(180deg, #0f1336 0%, #2a2260 100%); }
.sky::after { content: ""; position: absolute; inset: 0; background: var(--scrim); }
.stars {
  position: absolute; inset: 0; z-index: 1; opacity: 0.9; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(246, 243, 234, 0.8), transparent 60%),
    radial-gradient(1px 1px at 78% 9%, rgba(246, 243, 234, 0.7), transparent 60%),
    radial-gradient(1px 1px at 44% 31%, rgba(246, 243, 234, 0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 88% 42%, rgba(246, 243, 234, 0.6), transparent 60%),
    radial-gradient(1px 1px at 23% 63%, rgba(246, 243, 234, 0.5), transparent 60%),
    radial-gradient(1px 1px at 63% 74%, rgba(246, 243, 234, 0.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 6% 88%, rgba(246, 243, 234, 0.5), transparent 60%);
}

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 5; }
.nav {
  max-width: var(--measure); margin: 0 auto;
  padding: var(--space-6) var(--space-6);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
}
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { width: 132px; height: auto; }
.nav-links { display: flex; align-items: center; gap: var(--space-6); font-weight: 400; font-size: 1rem; }
.nav-links a { color: var(--ink-muted); text-decoration: none; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--gold); }

/* ---------- Buttons ---------- */
.btn-play {
  display: inline-flex; align-items: center; gap: var(--space-3);
  min-height: 56px; padding: 0 var(--space-8);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
  color: var(--on-gold); text-decoration: none;
  font-weight: 500; font-size: 1.0625rem; letter-spacing: 0.02em; white-space: nowrap;
  box-shadow: 0 10px 40px rgba(217, 169, 84, 0.25);
  transition: transform 160ms var(--ease-out);
}
.btn-play img { width: 20px; height: 20px; }
.btn-play:hover { color: var(--on-gold); }
@media (hover: hover) and (pointer: fine) {
  .btn-play:hover { transform: translateY(-2px); }
}
.btn-play:active { transform: translateY(0); }
.link-quiet { color: var(--ink-muted); white-space: nowrap; }

/* ---------- Sections and prayer markers ---------- */
.hour {
  display: flex; align-items: baseline; gap: var(--space-3);
  margin: 0 0 var(--space-6); color: var(--gold);
  font-weight: 400; font-size: 0.9375rem; letter-spacing: 0.04em;
}
.hour .ar { font-family: var(--font-arabic); font-size: 1.5rem; line-height: 1; }
.hour time { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.hour::after { content: ""; flex: 0 0 48px; height: 1px; background: var(--gold); opacity: 0.5; align-self: center; }

.chapter { position: relative; padding: var(--space-32) var(--space-6); }
.chapter-inner { max-width: var(--measure); margin: 0 auto; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; font-style: normal; margin: 0; overflow-wrap: anywhere; min-width: 0; }
h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); line-height: 1.06; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 3.6vw, 2.75rem); line-height: 1.12; max-width: 18ch; }
h3 { font-size: 1.5rem; line-height: 1.25; }
.lead { color: var(--ink-muted); font-size: 1.25rem; max-width: 34ch; margin: var(--space-6) 0 0; }
p { margin: 0; }

.screen {
  border-radius: var(--radius-screen);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(3, 5, 15, 0.55);
  background: var(--sheet);
}

/* ---------- Fajr: hero ---------- */
.hero { padding-top: var(--space-16); padding-bottom: 0; }
.hero .chapter-inner {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--space-16); align-items: start;
}
.hero-copy { padding-top: var(--space-16); }
.hero-copy h1 { max-width: 13ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6); margin-top: var(--space-12); }
/* The intentional break: the Today screen runs past the hero into the next hour. */
.hero-visual { position: relative; justify-self: end; width: min(100%, 400px); margin-bottom: calc(var(--space-32) * -1); z-index: 2; }
.hero-visual::before {
  content: ""; position: absolute; inset: 10% -20% 30% -20%; z-index: -1;
  background: radial-gradient(closest-side, rgba(241, 214, 143, 0.28), transparent);
}

/* ---------- Shuruq: the day strip ---------- */
.problem { padding-top: var(--space-40); }
.problem .chapter-inner { max-width: 1000px; }
.problem p.lead { max-width: 46ch; }
.daystrip { margin: var(--space-16) 0 0; }
.daystrip ol {
  list-style: none; margin: 0; padding: 0;
  position: relative; height: 150px;
  border-bottom: 1px solid var(--line);
}
.daystrip li {
  position: absolute; left: var(--at); bottom: 0;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-1);
  padding-bottom: var(--space-4);
}
.daystrip li::after {
  content: ""; position: absolute; bottom: -5px; left: 50%; width: 9px; height: 9px;
  margin-left: -4.5px; border-radius: 50%; background: var(--night); border: 1.5px solid var(--gold);
}
.daystrip .ar { font-family: var(--font-arabic); font-size: 1.375rem; color: var(--gold); line-height: 1.2; }
.daystrip .en { font-size: 0.875rem; color: var(--ink-muted); }
.daystrip time { font-size: 0.875rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.daystrip .session {
  position: absolute; left: var(--from); width: max(14px, var(--span)); bottom: -7px; height: 14px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--gold-light), var(--gold-deep));
  box-shadow: 0 0 24px rgba(241, 214, 143, 0.5);
  transform: none; padding: 0; display: block;
}
.daystrip .session::after { display: none; }
.daystrip .session span {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 0.875rem; font-weight: 500; color: var(--gold);
}
.daystrip figcaption { margin-top: var(--space-16); font-size: 0.9375rem; color: var(--ink-muted); max-width: 60ch; }

/* ---------- Dhuhr: how a session runs ---------- */
.how { padding-top: var(--space-40); }
.how .chapter-inner > h2 { max-width: 16ch; }
.steps {
  list-style: none; margin: var(--space-16) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12) var(--space-16);
}
.step { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: var(--space-8); align-items: end; }
.step:nth-child(2) { margin-top: var(--space-32); }
.step-num { font-family: var(--font-display); color: var(--gold); font-size: 3rem; line-height: 1; display: block; margin-bottom: var(--space-4); }
.step p { color: var(--ink-muted); margin-top: var(--space-3); max-width: 28ch; }

/* ---------- Asr: prayer tools ---------- */
.tools .chapter-inner {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--space-16); align-items: center;
}
.facts { list-style: none; margin: var(--space-12) 0 0; padding: 0; display: grid; gap: var(--space-6); }
.facts li { display: grid; gap: var(--space-1); padding-left: var(--space-6); border-left: 1px solid var(--gold); }
.facts strong { font-weight: 500; color: var(--ink); }
.facts span { color: var(--ink-muted); font-size: 1rem; }
.tools-screens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); align-items: start; }
.tools-screens figure:last-child { margin-top: var(--space-24); }
figure { margin: 0; }
.tools-screens figcaption, .proof figcaption { margin-top: var(--space-4); font-size: 0.9375rem; color: var(--ink-muted); }

/* ---------- Maghrib: proof ---------- */
.proof .chapter-inner {
  display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: var(--space-16); align-items: center;
}
.proof-copy .lead { max-width: 40ch; }
.proof-list { list-style: none; padding: 0; margin: var(--space-8) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-3); }
.proof-list li {
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-4); font-size: 0.9375rem; color: var(--ink);
}

/* ---------- Isha: close ---------- */
.close { padding-top: var(--space-40); padding-bottom: var(--space-32); text-align: center; }
.close .chapter-inner { display: flex; flex-direction: column; align-items: center; }
.close .hour { justify-content: center; }
.close .hour::after { display: none; }
.close-mark { width: 120px; height: 80px; margin-bottom: var(--space-12); }
.close h2 { max-width: 20ch; margin: 0 auto; }
.close .lead { margin: var(--space-6) auto 0; max-width: 40ch; }
.close .btn-play { margin-top: var(--space-12); }

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--measure); margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-12);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: 0.9375rem; color: var(--ink-muted);
}
.site-footer nav { display: flex; gap: var(--space-6); flex-wrap: wrap; }
.site-footer a { color: var(--ink-muted); white-space: nowrap; }
.site-footer a:hover { color: var(--ink); }

/* ---------- Document pages: privacy, delete account, 404 ---------- */
.content {
  max-width: 760px; margin: 0 auto;
  padding: var(--space-16) var(--space-6) var(--space-24);
  font-size: 1.0625rem;
}
.content .eyebrow { color: var(--gold); font-weight: 400; letter-spacing: 0.04em; margin-bottom: var(--space-4); }
.content h1 { font-size: clamp(2.2rem, 5vw, 3.25rem); line-height: 1.1; }
.content h2 { font-size: 1.625rem; max-width: none; margin: var(--space-12) 0 var(--space-4); }
.content h3 { font-size: 1.25rem; margin: var(--space-8) 0 var(--space-3); }
.content p, .content li { color: var(--ink-muted); }
.content p + p { margin-top: var(--space-4); }
.content strong { color: var(--ink); font-weight: 500; }
.content ul, .content ol { padding-left: var(--space-6); }
.content li + li { margin-top: var(--space-2); }
.content .lead { max-width: none; }
.content .updated { color: var(--ink-muted); font-size: 0.9375rem; margin-top: var(--space-4); }
.content table { width: 100%; border-collapse: collapse; margin: var(--space-6) 0; font-size: 0.9375rem; display: block; overflow-x: auto; }
.content th, .content td { text-align: left; padding: var(--space-3); border-bottom: 1px solid var(--line); vertical-align: top; }
.content th { color: var(--ink); font-weight: 500; }
.data-note {
  margin: var(--space-8) 0; padding: var(--space-6);
  background: rgba(17, 24, 54, 0.8); border: 1px solid var(--line); border-radius: var(--radius-card);
}
.doc-page .sky-layer[data-sky="isha"] { opacity: 1; }

/* ---------- Motion hooks (set by site.js only when motion is allowed) ---------- */
.js-motion [data-reveal] { opacity: 0; transform: translateY(24px); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .chapter-inner, .tools .chapter-inner, .proof .chapter-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding-top: var(--space-8); }
  .hero-visual { justify-self: center; width: min(86%, 360px); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step:nth-child(2) { margin-top: 0; }
  .proof .screen { max-width: 360px; }
}
@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .chapter { padding: var(--space-24) var(--space-4); }
  .hero { padding-top: var(--space-6); padding-bottom: 0; }
  .problem, .how, .close { padding-top: var(--space-32); }
  .nav { padding: var(--space-4); }
  .nav-links { gap: var(--space-4); }
  .nav-links .hide-sm { display: none; }
  .brand img { width: 112px; }
  .lead { font-size: 1.125rem; }
  .hero-actions { gap: var(--space-4); }
  .btn-play { width: 100%; justify-content: center; }
  .step { grid-template-columns: minmax(0, 1fr); }
  .step .screen { max-width: 300px; }
  .tools-screens { gap: var(--space-4); }
  .tools-screens figure:last-child { margin-top: var(--space-12); }
  .site-footer { flex-direction: column; }
}
/* Day strip turns into a vertical timeline before Maghrib and Isha can collide. */
@media (max-width: 860px) {
  .daystrip ol { height: auto; border-bottom: 0; border-left: 1px solid var(--line); margin-left: var(--space-2); padding: var(--space-2) 0; }
  .daystrip li {
    position: relative; left: auto; transform: none; bottom: auto;
    flex-direction: row; align-items: baseline; gap: var(--space-3);
    padding: var(--space-3) 0 var(--space-3) var(--space-6);
  }
  .daystrip li::after { bottom: auto; top: 50%; left: -5px; margin: -4.5px 0 0; }
  .daystrip time { margin-left: auto; }
  .daystrip .session {
    position: relative; left: auto; width: auto; bottom: auto; height: auto;
    display: block; margin: var(--space-1) 0 var(--space-1) var(--space-6);
    padding: var(--space-2) var(--space-4);
  }
  .daystrip .session span { position: static; transform: none; color: var(--on-gold); }
}
