:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #EEF2F7;
  --text: #222222;
  --muted: #6B7280;
  --primary: #1E3A5F;
  --secondary: #5DADE2;
  --accent: #D6A84A;
  --accent-dark: #B8862F;
  --border: #E5E7EB;
  --shadow: 0 16px 40px rgba(30, 58, 95, 0.08);
  --radius: 18px;
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.section {
  padding: 5rem 0;
}

.section-soft {
  background: #F1F5F9;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(30, 58, 95, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--primary);
  font-size: 1.05rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--surface);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.95rem;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--secondary);
}

.nav-links a.active {
  color: var(--primary);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  width: 100%;
  height: 2px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  border: 0;
  background: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 1.5rem;
  height: 2px;
  background: var(--primary);
}

.hero {
  padding-top: 3.3rem;
  position: relative;
  background: url('quran reading.jpg') center/cover no-repeat fixed;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(248, 250, 252, 0.82);
  z-index: 0;
}

.hero-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(214, 168, 74, 0.16);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

h1,
h2,
h3,
h4 {
  font-family: "Playfair Display", serif;
  color: var(--primary);
  line-height: 1.2;
}

.hero h1 {
  font-size: clamp(2.15rem, 4vw, 3.3rem);
  margin-bottom: 0.8rem;
  max-width: 10ch;
}

.hero p {
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 1.3rem 0 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-primary {
  background: var(--primary);
  color: var(--surface);
}

.btn-primary:hover {
  background: var(--secondary);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--primary);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.hero-stats div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 0.95rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.hero-stats strong {
  color: var(--primary);
  font-size: 1.05rem;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1.2rem;
}

.hero-card-top h3 {
  font-size: 1.25rem;
  color: var(--primary);
}

.progress-ring {
  width: 170px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0deg 108deg, var(--surface-2) 108deg 360deg);
  display: grid;
  place-items: center;
}

.ring-inner {
  width: 118px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--border);
}

.ring-inner strong {
  display: block;
  font-size: 1.4rem;
  color: var(--primary);
}

.ring-inner span {
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-list {
  display: grid;
  gap: 0.8rem;
}

.mini-list div {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.mini-list strong {
  color: var(--primary);
  text-align: right;
}

.section-heading {
  text-align: center;
  margin-bottom: 2rem;
}

.section-heading.left {
  text-align: left;
  margin-bottom: 1.2rem;
}

.section-sub {
  color: var(--muted);
  max-width: 56ch;
  margin: 0.6rem auto 0;
}

/* Salah tracker */
.salah-shell {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 1.2rem;
  align-items: start;
}

.salah-summary {
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
}

.salah-ring {
  width: 150px;
}

.salah-text {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.05rem;
}

.salah-streak {
  color: var(--muted);
}

.salah-streak strong {
  color: var(--accent-dark);
}

.missed-card {
  width: 100%;
  margin-top: 0.4rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.missed-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.missed-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.missed-btn {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease;
}

.missed-btn:hover {
  background: rgba(93, 173, 226, 0.18);
  transform: translateY(-1px);
}

.missed-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 2ch;
}

.missed-hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

.salah-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.prayer-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.prayer-card:hover {
  transform: translateY(-2px);
}

.prayer-card.is-complete {
  background: rgba(30, 58, 95, 0.05);
  border-color: rgba(30, 58, 95, 0.14);
}

.prayer-card.is-complete .check-btn {
  background: var(--accent);
  color: var(--primary);
}

.prayer-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.prayer-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Qur'an tracker */
.quran-shell {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.2rem;
  align-items: start;
  margin-bottom: 1.4rem;
}

.quran-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 0.9rem;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.field input {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.quran-submit {
  height: fit-content;
  white-space: nowrap;
}

.quran-stats {
  display: grid;
  gap: 0.8rem;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.stat-chip strong {
  color: var(--primary);
  font-size: 1.5rem;
  font-family: "Playfair Display", serif;
}

.stat-chip span {
  color: var(--muted);
  font-size: 0.88rem;
}

.quran-log {
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.quran-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.quran-entry .entry-main {
  display: flex;
  flex-direction: column;
}

.quran-entry .entry-surah {
  color: var(--primary);
  font-weight: 600;
}

.quran-entry .entry-date {
  color: var(--muted);
  font-size: 0.85rem;
}

.quran-entry .entry-pages {
  color: var(--accent-dark);
  font-weight: 700;
  white-space: nowrap;
}

.quran-empty {
  text-align: center;
  color: var(--muted);
  padding: 1.2rem;
}

/* Dua & Dhikr */
.dua-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.dua-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.dua-card.is-fav {
  background: rgba(30, 58, 95, 0.05);
  border-color: rgba(30, 58, 95, 0.14);
}

.dua-card h3 {
  font-size: 1.02rem;
  margin-bottom: 0.2rem;
}

.dua-card p {
  color: var(--muted);
  font-size: 0.92rem;
}

.fav-btn {
  width: 2.7rem;
  height: 2.7rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  transition: color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.fav-btn:hover {
  transform: scale(1.06);
}

.dua-card.is-fav .fav-btn {
  background: var(--accent);
  color: var(--primary);
  border-color: transparent;
}

.dua-journal {
  display: grid;
  gap: 0.5rem;
  max-width: 720px;
  margin: 0 auto;
}

.dua-journal label {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
}

.dua-journal textarea {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
  resize: vertical;
}

.dua-journal textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.dua-saved {
  color: var(--secondary);
  font-size: 0.85rem;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.section-heading h2 {
  font-size: clamp(1.62rem, 2.4vw, 2.2rem);
}

.habit-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.habit-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.habit-card:hover {
  transform: translateY(-2px);
}

.habit-card.is-complete {
  background: rgba(30, 58, 95, 0.05);
  border-color: rgba(30, 58, 95, 0.14);
}

.habit-copy {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.habit-icon {
  display: inline-grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 14px;
  background: rgba(30, 58, 95, 0.09);
  color: var(--primary);
  font-family: "Playfair Display", serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.habit-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.habit-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.check-btn {
  width: 2.7rem;
  height: 2.7rem;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--surface);
  cursor: pointer;
  font-size: 1rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  transition: background 0.2s ease;
}

.check-btn:hover {
  background: var(--secondary);
}

.habit-card.is-complete .check-btn {
  background: var(--accent);
  color: var(--primary);
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.2rem;
}

.panel-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.week-bar {
  padding: 0.8rem 0.4rem;
  text-align: center;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--primary);
  font-weight: 600;
}

.week-bar.active {
  background: var(--primary);
  color: var(--surface);
}

.panel-card h3 {
  font-size: 1.3rem;
  line-height: 1.45;
  margin-bottom: 0.6rem;
}

.reflection-copy {
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  background: rgba(214, 168, 74, 0.16);
  color: var(--accent-dark);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.site-footer {
  padding: 2.4rem 0 1.5rem;
  background: var(--primary);
  color: rgba(255, 255, 255, 0.92);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 1.2rem;
}

.site-footer h3,
.site-footer h4 {
  color: var(--surface);
  margin-bottom: 0.6rem;
}

.site-footer ul {
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1rem;
  margin-top: 1.4rem;
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero-shell,
  .panel-grid,
  .salah-shell,
  .quran-shell {
    grid-template-columns: 1fr;
  }

  .habit-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: relative;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 220px;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 4rem 0;
  }

  .hero {
    padding-top: 2.7rem;
  }

  .week-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quran-form {
    grid-template-columns: 1fr 1fr;
  }

  .salah-grid,
  .dua-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .habit-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .check-btn {
    align-self: flex-end;
  }

  .week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quran-form {
    grid-template-columns: 1fr;
  }
}

/* Qur'an player */
.quran-player {
  margin-bottom: 2.4rem;
}

.quran-nowplaying {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
  background: rgba(30, 58, 95, 0.05);
  border: 1px solid rgba(30, 58, 95, 0.14);
  border-radius: 16px;
}

.np-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.np-label {
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 700;
}

.np-title {
  color: var(--primary);
  font-size: 1.1rem;
}

.np-progress {
  color: var(--muted);
  font-size: 0.88rem;
}

.np-stop {
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--surface);
  cursor: pointer;
  font-size: 1rem;
}

.quran-search {
  margin-bottom: 1rem;
}

.quran-search input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
}

.quran-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.quran-status {
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}

.surah-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.surah-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.surah-row:hover {
  border-color: rgba(30, 58, 95, 0.25);
}

.surah-row.is-playing {
  background: rgba(30, 58, 95, 0.05);
  border-color: rgba(30, 58, 95, 0.16);
}

.surah-num {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(30, 58, 95, 0.1);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
}

.surah-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.surah-arabic {
  font-size: 1.05rem;
  color: var(--primary);
  line-height: 1.3;
}

.surah-name {
  color: var(--muted);
  font-size: 0.88rem;
}

.surah-play {
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--surface);
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.surah-play:hover {
  background: var(--secondary);
  transform: scale(1.06);
}

.surah-row.is-playing .surah-play {
  background: var(--accent);
  color: var(--primary);
}

.quran-log-wrap {
  margin-top: 0.5rem;
}

.quran-log-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--primary);
}
