:root {
  color-scheme: light;
  --bg: #f7f3e8;
  --surface: #fffdf7;
  --surface-soft: #eee7d5;
  --ink: #183a32;
  --muted: #6b746d;
  --green: #1f5a4a;
  --green-dark: #173f36;
  --gold: #b9904b;
  --border: rgba(31, 90, 74, 0.16);
  --shadow: 0 24px 70px rgba(35, 58, 48, 0.11);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Tahoma, Arial, "Noto Sans Arabic", sans-serif;
  line-height: 1.8;
  transition: background-color 0.25s, color 0.25s;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.container { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.narrow { max-width: 700px; }
.centered { text-align: center; }
.section { padding: 100px 0; }

.skip-link {
  position: fixed; top: 12px; right: 12px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: white;
  border-radius: 8px; transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: absolute; inset: 0 0 auto; z-index: 10;
  border-bottom: 1px solid rgba(31, 90, 74, 0.1);
}
.nav-wrap { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 800; }
.brand-mark {
  display: grid; place-items: center; width: 36px; aspect-ratio: 1;
  color: var(--surface); background: var(--green); border-radius: 50% 50% 45% 45%;
  font-family: Georgia, serif;
}
.nav-links { display: flex; align-items: center; gap: 32px; font-size: 0.92rem; color: var(--muted); }
.nav-links a { position: relative; }
.nav-links a::after { content: ""; position: absolute; right: 0; bottom: -7px; width: 0; height: 2px; background: var(--gold); transition: width .2s; }
.nav-links a:hover::after { width: 100%; }
.theme-toggle {
  display: grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid var(--border); border-radius: 50%; background: transparent;
  color: var(--ink); cursor: pointer; font-size: 1.25rem;
}

.hero { position: relative; overflow: hidden; min-height: 720px; padding: 170px 0 110px; }
.hero::before {
  content: ""; position: absolute; width: 540px; height: 540px; top: -180px; left: -180px;
  border: 1px solid var(--border); border-radius: 50%; box-shadow: 0 0 0 80px rgba(31,90,74,.025), 0 0 0 160px rgba(31,90,74,.018);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 90px; }
.eyebrow, .section-kicker { margin: 0 0 12px; color: var(--gold); font-size: .85rem; font-weight: 800; letter-spacing: .08em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 24px; font-size: clamp(3rem, 6vw, 5.6rem); line-height: 1.18; letter-spacing: -.05em; }
h1 span { color: var(--green); }
.hero-description { max-width: 560px; color: var(--muted); font-size: 1.08rem; }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 34px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 25px; border-radius: 14px; font-weight: 700; }
.primary-button { background: var(--green); color: #fff; box-shadow: 0 14px 28px rgba(31,90,74,.2); }
.primary-button:hover { background: var(--green-dark); transform: translateY(-2px); }
.text-link { font-weight: 700; }
.text-link span { display: inline-block; margin-right: 6px; transition: transform .2s; }
.text-link:hover span { transform: translateX(-5px); }

.verse-card {
  position: relative; padding: 70px 44px; text-align: center; background: var(--green);
  color: #fff; border-radius: 48% 48% 22px 22px; box-shadow: var(--shadow);
}
.verse-card::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(255,255,255,.19); border-radius: inherit; pointer-events: none; }
.ornament { position: relative; z-index: 1; color: #d4b372; font-size: 1.3rem; }
.ornament.bottom { display: block; margin-top: 26px; }
.basmala { margin: 22px 0 28px; color: #d9e5de; font-size: .85rem; }
blockquote { margin: 0; font-family: Georgia, "Traditional Arabic", serif; font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 2; }
.verse-reference { margin: 22px 0 0; color: #d4b372; font-size: .84rem; }

.intro { background: var(--surface); }
h2 { margin-bottom: 18px; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.35; letter-spacing: -.035em; }
.intro .narrow > p:last-child { color: var(--muted); font-size: 1.08rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 44px; }
.section-heading h2 { margin-bottom: 0; }
.date { margin-bottom: 8px; color: var(--muted); font-size: .9rem; }
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dhikr-card {
  display: flex; flex-direction: column; min-height: 390px; padding: 30px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .2s, box-shadow .2s;
}
.dhikr-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.dhikr-card.featured { background: var(--green); color: white; }
.card-topline { display: flex; align-items: center; justify-content: space-between; }
.card-icon { color: var(--gold); font: 1.1rem Georgia, serif; }
.card-category { color: var(--muted); font-size: .8rem; }
.featured .card-category, .featured .dhikr-note { color: #c7d7d0; }
.dhikr-text { margin: auto 0 12px; font-family: Georgia, "Traditional Arabic", serif; font-size: 1.55rem; line-height: 1.9; }
.dhikr-note { margin-bottom: 32px; color: var(--muted); font-size: .85rem; }
.counter-button {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 13px 17px; color: var(--green); background: var(--surface-soft);
  border: 0; border-radius: 12px; cursor: pointer; font-weight: 700;
}
.counter-button:hover { filter: brightness(.97); }
.counter-button:active { transform: scale(.98); }
.counter-button.complete { background: #d7eadc; color: #23583a; }
.count { direction: ltr; font-variant-numeric: tabular-nums; }

.habit { padding-top: 20px; }
.habit-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center;
  padding: 60px; background: var(--surface-soft); border-radius: 30px;
}
.habit-panel > div:first-child p:last-child { color: var(--muted); }
.habit-steps { display: grid; gap: 12px; }
.habit-steps div { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: rgba(255,255,255,.45); border-radius: 14px; }
.habit-steps span { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 50%; background: var(--green); color: white; }
.habit-steps p { margin: 0; font-weight: 700; }

footer { padding: 40px 0; border-top: 1px solid var(--border); }
.footer-wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; color: var(--muted); font-size: .85rem; }
.footer-wrap p { margin: 0; }
.footer-wrap .brand { color: var(--ink); }

body.dark {
  color-scheme: dark;
  --bg: #10251f; --surface: #163029; --surface-soft: #1b3931;
  --ink: #f4f0e5; --muted: #aebdb6; --green: #c3a15e; --green-dark: #d4b777;
  --gold: #d1ad68; --border: rgba(225,217,196,.14); --shadow: 0 24px 70px rgba(0,0,0,.24);
}
body.dark .brand-mark, body.dark .verse-card, body.dark .habit-steps span { background: #285849; }
body.dark .primary-button { background: #d1ad68; color: #17372e; }
body.dark .featured { background: #285849; }
body.dark .habit-steps div { background: rgba(255,255,255,.04); }

@media (max-width: 850px) {
  .nav-links { display: none; }
  .hero { min-height: auto; padding-top: 135px; }
  .hero-grid { grid-template-columns: 1fr; gap: 60px; }
  .hero-copy { text-align: center; }
  .hero-description { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .verse-card { max-width: 580px; margin-inline: auto; }
  .cards-grid { grid-template-columns: 1fr; }
  .dhikr-card { min-height: 320px; }
  .habit-panel { grid-template-columns: 1fr; gap: 35px; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 28px, 1120px); }
  .section { padding: 72px 0; }
  .site-header .brand span:last-child { display: none; }
  h1 { font-size: 2.85rem; }
  .hero-actions { flex-direction: column; gap: 18px; }
  .primary-button { width: 100%; }
  .verse-card { padding: 58px 25px; border-radius: 110px 110px 22px 22px; }
  .section-heading { display: block; }
  .date { margin-top: 12px; }
  .habit-panel { padding: 35px 22px; }
  .footer-wrap { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
