@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/assets/fonts/manrope.a30ddcd349.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap; src: url(/assets/fonts/dm-sans.9fea608a94.woff2) format('woff2'); }

/* Colors come from the admin palette (see lib/theme.ts). Everything else lives here. */
:root {
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-heading: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
  --radius-lg: 22px;
  --gutter: 16px;
  --max: 1200px;
  --header-h: 64px;
  --shadow: 0 18px 50px color-mix(in srgb, var(--text) 8%, transparent);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 70%, transparent);
}
@media (min-width: 720px) { :root { --gutter: 32px; --header-h: 72px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-heading); letter-spacing: -0.035em; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.lede { color: var(--muted); font-size: 1.075rem; line-height: 1.7; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.7rem 1.25rem; border-radius: 999px;
  font-weight: 650; font-size: 0.95rem; line-height: 1.1; text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 86%, var(--text)); }
.btn-secondary { border-color: color-mix(in srgb, var(--text) 28%, transparent); color: var(--text); background: transparent; }
.btn-secondary:hover { border-color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.btn-link { color: var(--text); padding-inline: 0.6rem; background: transparent; }
.btn-link:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.btn-lg { min-height: 52px; padding: 0.9rem 1.6rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Header (sticky on every screen size) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header[data-scrolled] { border-bottom-color: var(--border); box-shadow: 0 6px 24px color-mix(in srgb, var(--text) 6%, transparent); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-text { line-height: 1.15; min-width: 0; }
.brand-short { display: block; font-family: var(--font-heading); font-weight: 800; letter-spacing: 0.06em; font-size: 1rem; }
.brand-name { display: block; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.nav-desktop { display: none; align-items: center; gap: 6px; }
.nav-mobile-actions { display: flex; align-items: center; gap: 6px; }
.nav-mobile-actions .btn { min-height: 40px; padding: 0.55rem 1rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  border: 0; background: transparent; cursor: pointer; color: var(--text);
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-panel { display: none; border-top: 1px solid var(--border); background: var(--bg); }
.menu-panel[data-open] { display: block; }
.menu-panel ul { list-style: none; margin: 0; padding: 8px 0 16px; }
.menu-panel a { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; font-weight: 600; font-size: 1.05rem; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.menu-panel li:last-child a { border-bottom: 0; }
@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .nav-mobile-actions, .menu-panel, .menu-panel[data-open] { display: none; }
  .brand-name { max-width: none; }
}
.theme-toggle [data-icon] { display: none; }
.theme-toggle[data-mode=auto] [data-icon=auto], .theme-toggle[data-mode=light] [data-icon=light], .theme-toggle[data-mode=dark] [data-icon=dark] { display: block; }

/* ---------- Hero ---------- */
.hero { padding: 36px 0 56px; }
.hero-grid { display: grid; gap: 36px; align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 9vw, 4.6rem); font-weight: 800; margin-top: 16px; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.hero .lede { margin-top: 18px; max-width: 34rem; }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; }
.next-chip { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--surface-alt); text-decoration: none; font-size: 0.9rem; color: var(--muted); }
.next-chip strong { color: var(--text); font-weight: 650; }
.next-chip .dot { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--surface); color: var(--accent); }
.next-chip .dot svg { width: 15px; height: 15px; }
.hero-media { position: relative; max-width: 520px; width: 100%; margin: 0 auto; }
.hero-media .frame { position: relative; overflow: hidden; border-radius: var(--radius-lg); aspect-ratio: 5 / 4; background: var(--surface-alt); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media .frame::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgb(12 30 25 / .72), transparent 55%); }
.hero-media .caption { position: absolute; left: 0; bottom: 0; z-index: 1; padding: 22px; color: #fffaf0; font-family: var(--font-heading); font-weight: 650; font-size: 1.25rem; line-height: 1.25; max-width: 20rem; letter-spacing: -0.02em; }
.hero-media .outline { position: absolute; left: -14px; bottom: -14px; width: 66%; height: 66%; border: 1px solid var(--accent); border-radius: var(--radius-lg); opacity: .6; }
.hero-media .badge { position: absolute; right: -6px; top: 22px; z-index: 2; background: var(--accent); color: #1f362e; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 8px 14px; border-radius: 999px; }
@media (min-width: 960px) {
  .hero { padding: 64px 0 88px; }
  .hero-grid { grid-template-columns: 1.08fr .92fr; gap: 56px; }
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--surface-alt); }
.section-head h2 { font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 800; margin-top: 10px; }
.section-head .lede { margin-top: 14px; max-width: 32rem; }
.split { display: grid; gap: 32px; }
@media (min-width: 900px) { .section { padding: 96px 0; } .split { grid-template-columns: .85fr 1.15fr; gap: 56px; align-items: start; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .card { padding: 28px; } }

/* ---------- Donate ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-alt); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: 10px 12px; border-radius: 999px; font-weight: 650; font-size: .95rem; color: var(--muted); transition: background-color .15s, color .15s; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px color-mix(in srgb, var(--text) 14%, transparent); }
.seg input:focus-visible + span { box-shadow: var(--ring); }
.field-label { display: block; font-size: .85rem; font-weight: 650; margin: 20px 0 8px; }
.amounts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 380px) { .amounts { grid-template-columns: repeat(var(--cols, 4), 1fr); } }
.chip { position: relative; }
.chip input[type=radio] { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip > span { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); font-weight: 700; font-size: 1.05rem; transition: border-color .15s, background-color .15s; }
.chip input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--bg)); }
.chip input:focus-visible + span { box-shadow: var(--ring); }
.other-amount { display: flex; align-items: center; gap: 6px; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); padding: 0 12px; }
.other-amount:focus-within { border-color: var(--primary); }
.other-amount input { width: 100%; border: 0; background: transparent; font-weight: 700; font-size: 1.05rem; outline: none; padding: 0; -moz-appearance: textfield; }
.other-amount input::-webkit-outer-spin-button, .other-amount input::-webkit-inner-spin-button { -webkit-appearance: none; }
.select { width: 100%; min-height: 48px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); padding: 0 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: .92rem; color: var(--muted); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.donate-submit { margin-top: 20px; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: .8rem; color: var(--muted); }
.secure-note svg { width: 14px; height: 14px; }
.form-error { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, #b3473a 12%, var(--surface)); color: var(--text); font-size: .92rem; }
.trust { display: grid; gap: 12px; margin-top: 24px; }
.trust li { display: flex; gap: 10px; color: var(--muted); font-size: .95rem; }
.trust svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 3px; }
ul.plain { list-style: none; margin: 0; padding: 0; }

/* ---------- Membership ---------- */
.benefits { display: grid; gap: 10px; margin-top: 24px; }
.benefit { padding: 14px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.benefit strong { display: block; font-weight: 700; }
.benefit span { color: var(--muted); font-size: .93rem; }
.plans { display: grid; gap: 12px; }
@media (min-width: 640px) { .plans { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.plan { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: var(--radius-lg); border: 1.5px solid var(--border); background: var(--surface); }
.plan[data-featured] { border-color: var(--primary); }
.plan h3 { font-size: 1.2rem; }
.plan .price { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.plan .price small { font-family: var(--font-body); font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan p { color: var(--muted); font-size: .93rem; flex: 1; }
.plan .tag { align-self: flex-start; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); }
.plan-note { margin-top: 14px; font-size: .85rem; color: var(--muted); }

/* ---------- Prayer times ---------- */
.prayer-card { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--feature); color: var(--on-feature); padding: 20px; }
@media (min-width: 720px) { .prayer-card { padding: 28px; } }
.prayer-card .rings { position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); box-shadow: 0 0 0 36px transparent, inset 0 0 0 36px transparent; pointer-events: none; }
.prayer-card .rings::after { content: ''; position: absolute; inset: 40px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.prayer-top { position: relative; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.prayer-top .eyebrow { color: var(--accent); }
.prayer-date { margin-top: 4px; font-size: .92rem; opacity: .85; }
.countdown { margin-top: 18px; font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.countdown span { color: var(--accent); }
.ptable { position: relative; width: 100%; margin-top: 18px; border-collapse: separate; border-spacing: 0 6px; font-variant-numeric: tabular-nums; }
.ptable th { text-align: left; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; opacity: .7; padding: 0 14px; }
.ptable th:not(:first-child), .ptable td:not(:first-child) { text-align: right; }
.ptable td { padding: 12px 14px; background: color-mix(in srgb, var(--on-feature) 7%, transparent); font-size: 1.02rem; }
.ptable td:first-child { border-radius: 12px 0 0 12px; font-weight: 650; }
.ptable td:last-child { border-radius: 0 12px 12px 0; font-weight: 700; }
.ptable tr[data-next] td { background: var(--accent); color: #1c3129; }
.ptable .sub { font-size: .78rem; opacity: .75; font-weight: 500; }
.jumuah { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 10px; padding: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--on-feature) 18%, transparent); font-size: .95rem; }
.prayer-foot { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: .82rem; opacity: .85; }
.prayer-foot a { color: var(--on-feature); }
.prayer-empty { position: relative; margin-top: 18px; padding: 16px; border-radius: 12px; background: color-mix(in srgb, var(--on-feature) 8%, transparent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 calc(40px + env(safe-area-inset-bottom)); font-size: .92rem; color: var(--muted); }
.footer-grid { display: grid; gap: 24px; }
.footer-grid a { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; } }

/* ---------- Simple pages (thank-you, welcome, account, sign-in) ---------- */
.page { padding-top: 40px; padding-bottom: 72px; }
.page-narrow { max-width: 720px; }
.page h1 { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 800; margin-top: 10px; }
.page .lede { margin-top: 12px; }
.stack { display: grid; gap: 16px; }
.input, .textarea { width: 100%; min-height: 48px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); padding: 10px 12px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); outline: none; }
.grid-2 { display: grid; gap: 12px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.label { display: block; font-size: .88rem; font-weight: 600; }
.label > .input, .label > .select, .label > .textarea, .label > .color-field, .label > div, .label > .field-error { display: block; margin-top: 6px; }
.label > .color-field { display: flex; }
.label .hint { font-weight: 400; color: var(--muted); }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--surface-alt); font-size: .95rem; }
.notice-ok { background: color-mix(in srgb, #2f7a55 14%, var(--surface)); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-alt); }
.pill-ok { background: color-mix(in srgb, #2f7a55 18%, var(--surface)); }
.pill-warn { background: color-mix(in srgb, #b8862e 22%, var(--surface)); }

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .5s ease both; }
  .rise-2 { animation-delay: .08s; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 479px) { .brand-name { display: none; } }

/* ---------- Prayer widget states (computed server-side, see internal/prayer) ---------- */
.prayer-skeleton { position: relative; margin-top: 18px; display: grid; gap: 6px; }
.prayer-skeleton span { display: block; height: 46px; border-radius: 12px; background: color-mix(in srgb, var(--on-feature) 8%, transparent); }
.prayer-day { position: relative; margin-top: 4px; font-size: .92rem; opacity: .85; }
.countdown[data-state=soon] { color: var(--accent); }
.countdown[data-state=soon] span { text-decoration: underline; text-underline-offset: 4px; }
.ptable tr[data-next][data-state=soon] td { box-shadow: inset 0 0 0 2px color-mix(in srgb, #1c3129 35%, transparent); }
.ptable tr[data-next][data-state=in_progress] td { background: color-mix(in srgb, var(--accent) 75%, var(--feature)); }
.ptable .adhan-inline { display: block; font-size: .78rem; opacity: .8; font-weight: 500; }
.prayer-note { position: relative; margin-top: 10px; font-size: .9rem; opacity: .9; }
.next-chip[data-state=soon] { background: color-mix(in srgb, var(--accent) 22%, var(--surface-alt)); }
.next-chip[data-state=soon] strong { color: var(--text); }
.next-chip[hidden] { display: none; }
.hero-friday { display: inline-block; margin-left: 8px; color: var(--muted); font-weight: 600; letter-spacing: .08em; }
.form-message[hidden] { display: none; }
