/* ==========================================================================
   Islamic Apps Center — site styles
   Clean, calm, trustworthy. Islamic/Quran identity, light touch.
   Pure CSS, mobile-first, no external fonts, no image dependency.
   ========================================================================== */

:root {
  /* Calm Islamic-inspired palette */
  --green-900: #06251c;
  --green-700: #0b5c46;
  --green-600: #0f6b52;
  --green-500: #178a68;
  --teal-100: #e7f2ee;
  --gold: #c8a45c;
  --gold-dark: #a9863f;

  --bg: #f6f8f7;
  --bg-soft: #eef3f1;
  --card: #ffffff;
  --ink: #14201b;
  --muted: #5b6b64;
  --line: #e2eae6;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(6, 37, 28, 0.05);
  --shadow: 0 6px 22px rgba(6, 37, 28, 0.07);
  --shadow-lg: 0 14px 40px rgba(6, 37, 28, 0.10);

  --maxw: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", sans-serif;
  --font-ar: "Segoe UI", "Noto Naskh Arabic", "Traditional Arabic", serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }

a { color: var(--green-600); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--green-700);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 1.08rem;
  color: var(--green-900);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--green-600), var(--green-700));
  color: #fff;
  border-radius: 10px;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background .18s ease, color .18s ease;
}
.nav-links a:hover { color: var(--green-700); background: var(--teal-100); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--green-700); background: var(--teal-100); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.96rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .06s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--gold); color: #241c07; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--gold-dark); color: #fff; }
.btn-solid { background: var(--green-600); color: #fff; }
.btn-solid:hover { background: var(--green-700); }
.btn-outline { background: transparent; color: var(--green-700); border-color: var(--line); }
.btn-outline:hover { border-color: var(--green-500); background: var(--teal-100); }
.btn-ghost-light { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.2); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 420px at 80% -10%, rgba(200,164,92,0.20), transparent 60%),
    linear-gradient(160deg, var(--green-600) 0%, var(--green-900) 100%);
  color: #fff;
  padding: 84px 0 92px;
  text-align: center;
}
/* subtle geometric pattern, pure CSS */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.06) 1px, transparent 0);
  background-size: 26px 26px;
  opacity: 0.6;
  pointer-events: none;
}
.hero > .container { position: relative; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.bismillah {
  font-family: var(--font-ar);
  font-size: 1.5rem;
  color: var(--gold);
  margin: 0 0 14px;
  direction: rtl;
}
.hero h1 { margin: 0 0 14px; font-size: clamp(2.1rem, 5vw, 3.1rem); font-weight: 800; }
.hero .sub {
  margin: 0 auto;
  max-width: 640px;
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
  color: rgba(255,255,255,0.9);
}
.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

/* ---------- Sections ---------- */
main { display: block; }
.section { padding: 66px 0; }
.section-tight { padding: 44px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 680px; margin: 0 auto 40px; text-align: center; }
.section-head.left { text-align: left; margin-left: 0; }
.section h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); margin: 0 0 12px; color: var(--green-900); }
.section .lead { color: var(--muted); font-size: 1.06rem; margin: 0; }

/* ---------- Feature grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d3e2db; }
.card .icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--teal-100);
  color: var(--green-700);
  font-size: 1.4rem;
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 8px; font-size: 1.14rem; color: var(--ink); }
.card p { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* ---------- Mission / two-column ---------- */
.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.split .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-500);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}
.split .panel h3 { margin: 0 0 8px; color: var(--green-800, var(--green-900)); }
.split ul.checks { list-style: none; padding: 0; margin: 8px 0 0; }
.split ul.checks li { position: relative; padding-left: 28px; margin-bottom: 10px; color: var(--ink); }
.split ul.checks li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: var(--green-500); font-weight: 800;
}

/* ---------- Highlight / callout band ---------- */
.callout {
  background: linear-gradient(150deg, var(--green-700), var(--green-900));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.callout h2 { color: #fff; margin: 0 0 10px; }
.callout p { color: rgba(255,255,255,0.9); margin: 0 auto; max-width: 620px; }
.callout .actions { margin-top: 24px; }

/* ---------- App portfolio cards ---------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.app-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.app-card .app-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.app-card .app-logo {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--green-500), var(--green-700));
  color: #fff; font-size: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.app-card h3 { margin: 0; font-size: 1.12rem; color: var(--green-900); }
.app-card .tag {
  display: inline-block; margin-top: 4px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--green-600);
}
.app-card p.desc { margin: 0 0 14px; color: var(--muted); font-size: 0.97rem; flex-grow: 1; }
.app-card .pkg {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;
  font-size: 0.76rem;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  margin: 0 0 18px;
  overflow-x: auto;
  white-space: nowrap;
}
.app-card .store {
  align-self: flex-start;
  background: var(--green-600);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background .18s ease, transform .06s ease;
}
.app-card .store:hover { background: var(--green-700); text-decoration: none; transform: translateY(-1px); }
.app-card.more { border-style: dashed; background: var(--bg-soft); }
.app-card.more .app-logo { background: var(--teal-100); color: var(--green-700); }

/* Arabic app titles render right-to-left inside the LTR card */
.app-card h3[dir="rtl"] { direction: rtl; text-align: right; font-family: var(--font-ar); font-weight: 700; }
.app-card .app-top.rtl { direction: rtl; }

/* Category sections on the portfolio page */
.cat { margin-top: 12px; }
.cat + .cat { margin-top: 52px; }
.cat-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.cat-head h2 { margin: 0; font-size: 1.35rem; color: var(--green-900); }
.cat-head .count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green-700);
  background: var(--teal-100);
  border-radius: 999px;
  padding: 3px 12px;
}
.cat-note { color: var(--muted); font-size: 0.98rem; margin: -8px 0 20px; }

/* ---------- Quran Radio page ---------- */
.radio-card {
  max-width: 620px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.radio-card .radio-logo {
  width: 68px; height: 68px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 20px;
  background: linear-gradient(150deg, var(--green-500), var(--green-700));
  color: #fff; font-size: 2rem;
  box-shadow: var(--shadow-sm);
}
.radio-card h2 { margin: 0 0 6px; color: var(--green-900); }
.radio-card .radio-sub { color: var(--muted); margin: 0 0 20px; }
.radio-card audio {
  width: 100%;
  margin: 6px 0 4px;
  border-radius: 999px;
}
.status-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  margin-top: 6px;
}
.status-box .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,164,92,0.2);
}
.radio-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 40px;
}
.radio-info .info-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.radio-info .info-card h3 { margin: 0 0 8px; color: var(--green-900); font-size: 1.08rem; }
.radio-info .info-card p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* Attribution + disclaimer boxes */
.attribution-box {
  max-width: 760px;
  margin: 28px auto 0;
  background: var(--teal-100);
  border: 1px solid #cfe3db;
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--green-900);
  font-size: 0.94rem;
}
.attribution-box strong { display: block; margin-bottom: 4px; }
.disclaimer-box {
  max-width: 760px;
  margin: 16px auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 18px 22px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.disclaimer-box h3 { margin: 0 0 6px; color: var(--ink); font-size: 0.98rem; }

/* Fallback external links */
.fallback {
  max-width: 760px;
  margin: 40px auto 0;
}
.fallback h2 { font-size: 1.25rem; color: var(--green-900); margin: 0 0 6px; }
.fallback .lead { color: var(--muted); margin: 0 0 18px; font-size: 0.98rem; }
.fallback-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.fallback-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.fallback-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #d3e2db;
}
.fallback-card strong { display: block; color: var(--green-900); margin-bottom: 3px; }
.fallback-card span { color: var(--muted); font-size: 0.86rem; word-break: break-word; }
.fallback-card .ext { color: var(--green-600); font-size: 0.82rem; font-weight: 700; }

/* ---------- Prose (privacy / support) ---------- */
.page-hero {
  background: linear-gradient(160deg, var(--green-600), var(--green-900));
  color: #fff;
  padding: 56px 0;
}
.page-hero h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.4rem); }
.page-hero p { margin: 0; color: rgba(255,255,255,0.85); }
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { color: var(--green-900); font-size: 1.3rem; margin: 34px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose .muted-note { color: var(--muted); font-size: 0.92rem; }

.contact-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-500);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.contact-box .label { color: var(--muted); font-size: 0.9rem; margin: 0 0 4px; }
.contact-box a { font-weight: 700; font-size: 1.1rem; }

.notice {
  background: var(--teal-100);
  border: 1px solid #cfe3db;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 22px 0;
  color: var(--green-900);
  font-size: 0.96rem;
}

/* Support topic + checklist grids */
.topics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 20px 0 6px;
}
.topic {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.topic strong { display: block; color: var(--green-900); margin-bottom: 2px; }
.topic span { color: var(--muted); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 46px 0 30px;
  margin-top: 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
}
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p { color: var(--muted); font-size: 0.94rem; margin: 6px 0; }
.footer-col h4 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 4px 0 12px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: var(--ink); font-size: 0.95rem; font-weight: 500; }
.footer-col a:hover { color: var(--green-700); }
.footer-bottom {
  border-top: 1px solid var(--line);
  margin-top: 34px;
  padding-top: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; gap: 26px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .section { padding: 48px 0; }
  .hero { padding: 60px 0 66px; }
  .nav { justify-content: center; }
  .nav-links { justify-content: center; }
  .callout { padding: 34px 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
}

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