/* Deeniyat Online School — design system
   Idea: the page begins in night and ends in morning light (Qur'an 14:1). */
:root {
  --night: #0a2224;
  --night-2: #0f2f31;
  --teal: #14393b;
  --teal-2: #1e4d4f;
  --paper: #faf7f0;
  --paper-2: #f3ede0;
  --white: #fffdf9;
  --gold: #c2a063;
  --gold-soft: #dcc393;
  --gold-ink: #7a5f28;
  --ink: #1b1d1e;
  --ink-2: #45484a;
  --ink-3: #5c5f61;
  --line: rgba(27, 29, 30, .1);
  --line-light: rgba(250, 247, 240, .14);
  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --arabic: "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;
  --urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", serif;
  --max: 1120px;
  --prose: 680px;
  --gutter: clamp(20px, 5vw, 40px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 1.65; letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--white); padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }

[lang="ar"], .ar { font-family: var(--arabic); letter-spacing: 0; font-weight: 400; }
[lang="ur"], [lang="ks"] { font-family: var(--urdu); letter-spacing: 0; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.prose-wrap { max-width: calc(var(--prose) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: clamp(80px, 11vw, 144px) 0; }
.center { text-align: center; }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; line-height: 1.08; margin: 0 0 .45em; color: inherit; }
h1 { font-size: clamp(44px, 7vw, 88px); }
h2 { font-size: clamp(36px, 5vw, 60px); }
h3 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.18; }
.eyebrow { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink); margin: 0 0 20px; }
.lead { font-size: clamp(19px, 2vw, 22px); line-height: 1.6; color: var(--ink-2); max-width: 640px; }
.center .lead { margin-left: auto; margin-right: auto; }
.rule { width: 48px; height: 1px; background: var(--gold); border: 0; margin: 28px 0; }
.center .rule { margin-left: auto; margin-right: auto; }

/* ---------- Links & buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 26px; border-radius: 999px; border: 0; cursor: pointer;
  font: 500 16px/1 var(--sans); letter-spacing: .005em; text-decoration: none; white-space: nowrap;
  transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-dark { background: var(--teal); color: var(--paper); }
.btn-dark:hover { background: var(--night); }
.btn-light { background: var(--paper); color: var(--night); }
.btn-light:hover { background: var(--white); }
.btn-line { background: transparent; color: var(--teal); box-shadow: inset 0 0 0 1px rgba(20, 57, 59, .35); }
.btn-line:hover { box-shadow: inset 0 0 0 1px var(--teal); }
.on-night .btn-line { color: var(--paper); box-shadow: inset 0 0 0 1px rgba(250, 247, 240, .3); }
.on-night .btn-line:hover { box-shadow: inset 0 0 0 1px rgba(250, 247, 240, .6); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 36px; }
.center .actions { justify-content: center; }
.more { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 500; color: var(--teal-2); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s; }
.more::after { content: "→"; transition: transform .25s var(--ease); }
.more:hover { border-bottom-color: currentColor; }
.more:hover::after { transform: translateX(3px); }
.on-night .more { color: var(--gold-soft); }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(250, 247, 240, .84); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--night); }
.logo-mark { font-family: var(--serif); font-weight: 600; font-size: 26px; letter-spacing: .14em; line-height: 1; padding-left: .14em; }
.logo-name { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding-left: 14px; border-left: 1px solid var(--line); line-height: 1.4; white-space: nowrap; display: none; }
@media (min-width: 720px) { .logo-name { display: block; } }
.nav-links { display: none; margin-left: auto; gap: 26px; font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
.nav-contact { margin-left: auto; min-height: 38px; padding: 0 18px; font-size: 14px; }
@media (min-width: 960px) { .nav-links { display: flex; } .nav-contact { margin-left: 0; } }

/* ---------- Home hero (night) ---------- */
.on-night { background: var(--night); color: var(--paper); }
.on-night .eyebrow { color: var(--gold-soft); }
.on-night .lead { color: rgba(250, 247, 240, .76); }
.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(88px, 13vw, 160px) 0 clamp(72px, 9vw, 112px);
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(194, 160, 99, .16), transparent 70%),
    var(--night);
}
.hero .ayah { font-family: var(--arabic); direction: rtl; font-size: clamp(32px, 5.4vw, 62px); line-height: 2; color: var(--gold-soft); margin: 0; }
.hero .ayah-tr { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.2vw, 25px); color: rgba(250, 247, 240, .78); margin: 0; }
.hero .ayah-ref { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(220, 195, 147, .85); margin: 14px 0 0; }
.hero h1 { color: var(--paper); max-width: 17ch; margin: 0 auto .4em; }
.hero .lead { margin-left: auto; margin-right: auto; }
.hero .actions { justify-content: center; }
.hero .rule { margin: 56px auto 52px; background: rgba(194, 160, 99, .55); }

/* Night → morning */
.dawn { height: clamp(140px, 22vw, 280px); background: linear-gradient(180deg, var(--night) 0%, #16393a 26%, #56675b 52%, #c9b891 79%, var(--paper) 100%); }

/* ---------- Quote (hadith) ---------- */
.quote { padding-top: clamp(40px, 6vw, 72px); }
.quote blockquote { margin: 0; }
.quote .ar { display: block; font-size: clamp(32px, 4.6vw, 52px); line-height: 1.9; color: var(--teal); direction: rtl; }
.quote .tr { font-family: var(--serif); font-size: clamp(27px, 3.4vw, 40px); line-height: 1.3; font-style: italic; color: var(--ink); max-width: 20ch; margin: 6px auto 0; }
.quote cite { display: block; font-style: normal; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-ink); margin-top: 22px; }
.intention { max-width: 640px; margin: 72px auto 0; text-align: left; font-size: 20px; line-height: 1.8; color: var(--ink-2); }

/* ---------- Paths (three courses) ---------- */
.paths { display: grid; grid-template-columns: 1fr; margin-top: 72px; border-top: 1px solid var(--line); text-align: left; }
@media (min-width: 880px) { .paths { grid-template-columns: repeat(3, 1fr); } }
.path { padding: 40px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; text-decoration: none; color: inherit; }
@media (min-width: 880px) {
  .path { padding: 48px 36px 44px; border-bottom: 0; border-right: 1px solid var(--line); }
  .path:first-child { padding-left: 0; }
  .path:last-child { border-right: 0; padding-right: 0; }
}
.path .top { display: flex; justify-content: space-between; align-items: baseline; }
.path .numeral { font-family: var(--serif); font-size: 17px; color: var(--gold-ink); letter-spacing: .14em; }
.path .verb { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.path .glyph { font-family: var(--arabic); font-size: 64px; line-height: 1.8; color: var(--teal); margin: 4px 0 0; direction: rtl; text-align: left; }
.path h3 { margin-bottom: 12px; }
.path p { color: var(--ink-2); font-size: 17px; }
.path .more { margin-top: auto; padding-top: 12px; align-self: flex-start; }

/* ---------- Teacher ---------- */
.on-white { background: var(--white); }
.teacher { display: grid; gap: clamp(40px, 6vw, 96px); align-items: start; grid-template-columns: 1fr; }
@media (min-width: 880px) { .teacher { grid-template-columns: 5fr 7fr; } }
.portrait { aspect-ratio: 4 / 5; border-radius: 20px; overflow: hidden; background: linear-gradient(170deg, var(--teal-2), var(--night)); display: grid; place-items: center; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait span { font-family: var(--serif); font-weight: 600; font-size: 64px; letter-spacing: .14em; color: var(--gold-soft); padding-left: .14em; }
.facts { margin: 40px 0 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 9em 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; color: var(--ink); }
@media (max-width: 480px) { .facts div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Rows (how classes are taught) ---------- */
.on-paper-2 { background: var(--paper-2); }
.rows { margin-top: 56px; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 28px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .row { grid-template-columns: 5fr 7fr; gap: 48px; align-items: baseline; } }
.row b { font-family: var(--serif); font-weight: 500; font-size: 27px; line-height: 1.25; }
.row span { color: var(--ink-2); }

/* ---------- Notes (articles) ---------- */
.notes { display: grid; grid-template-columns: 1fr; gap: 0 40px; margin-top: 48px; }
@media (min-width: 760px) { .notes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .notes-3 { grid-template-columns: repeat(3, 1fr); } }
.note { display: block; padding: 28px 0 36px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.note .tag { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink); }
.note h3 { font-size: 28px; margin: 10px 0 10px; transition: color .2s; }
.note p { color: var(--ink-2); font-size: 16px; margin: 0; }
.note:hover h3 { color: var(--teal-2); }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; }
.head-row h2 { margin: 0; }

/* ---------- Page head (inner pages) ---------- */
.page-head { padding: clamp(48px, 7vw, 96px) 0 clamp(40px, 5vw, 64px); }
.page-head h1 { font-size: clamp(42px, 6vw, 72px); max-width: 15ch; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 40px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.head-grid { display: grid; gap: 24px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 880px) { .head-grid { grid-template-columns: 8fr 4fr; } }
.head-glyph { font-family: var(--arabic); font-size: clamp(80px, 11vw, 140px); line-height: 1.7; color: var(--teal); text-align: center; direction: rtl; }
@media (max-width: 879px) { .head-glyph { display: none; } }
.byline { font-size: 14px; color: var(--ink-3); margin-top: 20px; }

/* ---------- Prose ---------- */
.prose { font-size: 19px; line-height: 1.75; color: var(--ink-2); }
.prose h2 { font-size: clamp(32px, 3.6vw, 42px); color: var(--ink); margin: 1.7em 0 .5em; }
.prose h3 { font-size: 27px; color: var(--ink); margin: 1.5em 0 .4em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .55em; padding-left: .2em; }
.prose li::marker { color: var(--gold); }
.prose ol li::marker { font-family: var(--serif); font-weight: 600; color: var(--gold-ink); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--teal-2); text-decoration: underline; text-decoration-color: rgba(30, 77, 79, .35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose .ar { font-size: 1.3em; color: var(--teal); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0 1.6em; font-size: 16px; }
.prose th, .prose td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink); font-weight: 600; font-size: 14px; }
.prose td.ar, .prose th.ar { font-size: 26px; text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.summary { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 29px); line-height: 1.45; color: var(--ink); margin: 0 0 1.2em; }
.outcome { border-left: 2px solid var(--gold); padding: 4px 0 4px 24px; margin: 1.4em 0 1.6em; font-family: var(--serif); font-size: 27px; line-height: 1.35; color: var(--ink); font-style: italic; }
.aside { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); font-size: 17px; color: var(--ink-2); }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); margin-top: 32px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 24px 44px 24px 0; font-size: 19px; font-weight: 500; color: var(--ink); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 31px; width: 9px; height: 9px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(-135deg); top: 35px; }
.faq .a { padding: 0 0 26px; color: var(--ink-2); font-size: 17px; max-width: 62ch; }
.faq .a p:last-child { margin: 0; }
.faq .a a { color: var(--teal-2); }

/* ---------- Invitation (closing) ---------- */
.invite { text-align: center; }
.invite .actions { justify-content: center; }
.invite .lead { margin-left: auto; margin-right: auto; }
.invite h2 { max-width: 16ch; margin-left: auto; margin-right: auto; }
.invite .small { font-size: 15px; color: var(--ink-3); margin: 28px 0 0; }
.invite .small a { color: var(--ink-2); }
.invite-card { background: var(--white); border: 1px solid var(--line); border-radius: 24px; padding: clamp(56px, 7vw, 96px) clamp(24px, 5vw, 72px); }

/* ---------- Contact ---------- */
.contact-lines { margin-top: 40px; border-top: 1px solid var(--line); }
.contact-lines > div { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 28px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .contact-lines > div { grid-template-columns: 3fr 5fr 3fr; align-items: center; gap: 24px; } }
.contact-lines .k { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.contact-lines .v { font-family: var(--serif); font-size: 30px; color: var(--ink); }
.contact-lines .btn { justify-self: start; }
.topic-links { list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
.topic-links li { border-bottom: 1px solid var(--line); }
.topic-links a { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; text-decoration: none; color: var(--ink); font-size: 18px; }
.topic-links a::after { content: "→"; color: var(--ink-3); }
.topic-links a:hover::after { color: var(--ink); }

/* ---------- Footer ---------- */
footer { background: var(--paper-2); border-top: 1px solid var(--line); padding: 72px 0 40px; font-size: 14px; color: var(--ink-3); }
.foot { display: grid; gap: 40px; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .foot { grid-template-columns: 5fr 3fr 3fr 3fr; } }
.foot .about { grid-column: 1 / -1; max-width: 360px; }
@media (min-width: 900px) { .foot .about { grid-column: auto; } }
.foot .logo-mark { font-size: 30px; color: var(--night); display: inline-block; margin-bottom: 14px; }
.foot .ft { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); margin: 0 0 16px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot-base { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; }
.foot-base .ar { font-size: 22px; color: var(--teal); }

/* ---------- Floating WhatsApp (mobile) ---------- */
.fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 60; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: var(--paper); box-shadow: 0 10px 28px rgba(10, 34, 36, .28); transition: transform .25s var(--ease); }
.fab svg { width: 26px; height: 26px; }
.fab:hover { transform: scale(1.05); }
@media (min-width: 960px) {
  .fab { right: 28px; bottom: 28px; width: auto; height: 52px; padding: 0 22px 0 18px; border-radius: 999px; display: flex; gap: 10px; font: 500 15px/1 var(--sans); text-decoration: none; }
  .fab svg { width: 22px; height: 22px; }
  .fab::after { content: attr(data-label); }
}

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Urdu page ---------- */
.rtl-page main { text-align: right; }
.rtl-page main h1, .rtl-page main h2, .rtl-page main h3, .rtl-page .row b { font-family: var(--urdu); font-weight: 700; line-height: 2.1; letter-spacing: 0; }
.rtl-page main h1 { font-size: clamp(30px, 4.6vw, 52px); }
.rtl-page main h2 { font-size: clamp(26px, 3.4vw, 38px); }
.rtl-page main h3 { font-size: 23px; }
.rtl-page .row b { font-size: 21px; }
.rtl-page main p, .rtl-page main .lead, .rtl-page main span, .rtl-page main summary { font-family: var(--urdu); line-height: 2.3; letter-spacing: 0; }
.rtl-page main .eyebrow { letter-spacing: 0; font-size: 15px; text-transform: none; }
.rtl-page main .center, .rtl-page .hero, .rtl-page .invite { text-align: center; }
.rtl-page .intention { text-align: right; }
.rtl-page .paths { text-align: right; }
.rtl-page .path .glyph { text-align: right; }
.rtl-page .path .more { align-self: flex-end; }
.rtl-page .more::after { content: "←"; }
@media (min-width: 880px) {
  .rtl-page .path { border-right: 0; border-left: 1px solid var(--line); }
  .rtl-page .path:first-child { padding-left: 36px; padding-right: 0; }
  .rtl-page .path:last-child { border-left: 0; padding-right: 36px; padding-left: 0; }
}
.rtl-page .faq summary { padding: 24px 0 24px 44px; }
.rtl-page .faq summary::after { right: auto; left: 6px; }

/* ---------- Poster (print) ---------- */
.poster { background: var(--night); color: var(--paper); border-radius: 24px; padding: 64px 40px; text-align: center; max-width: 680px; margin: 0 auto; }
.poster .ar { font-size: 40px; line-height: 2; color: var(--gold-soft); }
.poster .qr { background: #fff; padding: 14px; border-radius: 14px; width: 220px; margin: 32px auto; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .nav, footer, .fab, .no-print { display: none !important; }
  section { padding: 0; }
  .poster { border-radius: 0; max-width: none; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
