:root {
  color-scheme: light;
  --ink: #17231f;
  --muted: #64736d;
  --paper: #fffaf0;
  --panel: #fffdf7;
  --line: #e6dac5;
  --green: #173f35;
  --green-2: #2d6b54;
  --gold: #b88938;
  --rose: #8f4b42;
  --blue: #29415f;
  --shadow: 0 22px 70px rgba(38, 31, 18, 0.15);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(184, 137, 56, 0.16), transparent 28rem),
    linear-gradient(180deg, #fff7e7 0%, #f8efe0 44%, #f4eadb 100%);
  font-family: Avenir, "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
}

.hero {
  min-height: 92vh;
  display: grid;
  grid-template-rows: auto 1fr;
  position: relative;
  overflow: hidden;
  color: #fffdf6;
  background-image:
    linear-gradient(90deg, rgba(12, 38, 31, 0.9), rgba(14, 48, 40, 0.58), rgba(18, 29, 45, 0.62)),
    url("assets/hero-manuscript.png");
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 10rem;
  background: linear-gradient(180deg, transparent, #fff7e7);
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.1rem 0;
}

.brand,
.nav-actions,
.source-strip,
.hero-actions,
.segmented,
.view-options,
.badges {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.7rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.65rem;
  font-family: Georgia, "Times New Roman", serif;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: rgba(255, 255, 255, 0.76);
}

.nav-actions {
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
}

.nav-actions a {
  padding: 0.65rem 0.85rem;
  color: rgba(255, 255, 255, 0.86);
}

.hero-content {
  position: relative;
  z-index: 1;
  align-self: center;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 8rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #e9c374;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 1rem;
  font-size: clamp(3rem, 8vw, 6.7rem);
  line-height: 0.94;
  letter-spacing: 0;
  font-family: Georgia, "Times New Roman", serif;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  letter-spacing: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.lead {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.18rem;
  line-height: 1.7;
}

.source-strip {
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  max-width: 720px;
  margin: 1.8rem 0;
  padding: 0.8rem 1rem;
  border-left: 3px solid #e9c374;
  background: rgba(8, 27, 22, 0.52);
  backdrop-filter: blur(16px);
  color: rgba(255, 255, 255, 0.84);
}

.source-strip strong {
  color: #fff;
}

.hero-actions {
  gap: 0.8rem;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.8rem;
  padding: 0.78rem 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 800;
}

.button.primary {
  background: #fff7e7;
  color: var(--green);
}

.button.ghost {
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: -3.4rem auto 5rem;
  position: relative;
  z-index: 3;
}

.time-band,
.toolbar,
.proofs-band,
.download-band,
.about-source {
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow);
}

.time-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.time-band > div {
  padding: 1.35rem;
}

.time-band > div + div {
  border-left: 1px solid var(--line);
}

.time-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.time-band strong {
  display: block;
  margin-bottom: 0.45rem;
}

.time-band p,
.proofs-band p,
.about-source p {
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(13rem, 0.8fr) 2fr;
  gap: 1.5rem;
  margin: 1rem 0;
  padding: 1.1rem;
}

.controls {
  display: grid;
  gap: 0.8rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.segmented button,
.complete-button,
.reset {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green);
  border-radius: 4px;
}

.segmented button {
  min-height: 2.75rem;
  padding: 0.48rem 0.8rem;
  cursor: pointer;
  font-weight: 800;
}

.segmented button.active,
.complete-button.done {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.count-note {
  margin: -0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.view-options {
  gap: 0.9rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.view-options label {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.reader-layout {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.progress-panel {
  position: sticky;
  top: 1rem;
  border: 1px solid var(--line);
  background: var(--green);
  color: #fffdf6;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.stat {
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.stat span {
  display: block;
  font-size: 2.2rem;
  font-weight: 900;
  font-family: Georgia, "Times New Roman", serif;
}

.stat p,
.mini-source p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
}

.reset {
  width: 100%;
  margin: 1rem 0;
}

.mini-source {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 1rem;
}

.adhkar-list {
  display: grid;
  gap: 1rem;
}

.dhikr-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(184, 137, 56, 0.08), transparent 18rem),
    var(--panel);
  padding: clamp(1rem, 3vw, 1.6rem);
  box-shadow: 0 12px 38px rgba(52, 40, 21, 0.08);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.entry-number {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: var(--rose);
  font-weight: 900;
}

.dhikr-card h3 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.badges {
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.badge {
  border: 1px solid rgba(45, 107, 84, 0.24);
  background: rgba(45, 107, 84, 0.08);
  color: var(--green);
  padding: 0.34rem 0.5rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.arabic {
  margin: 1.25rem 0;
  padding: 1.2rem;
  border-right: 4px solid var(--gold);
  background: #fff8ea;
  font-family: "Times New Roman", "Amiri", "Scheherazade New", serif;
  font-size: clamp(1.75rem, 4vw, 2.65rem);
  line-height: 2.05;
  text-align: right;
}

.transliteration {
  color: var(--blue);
  font-size: 1.05rem;
  line-height: 1.85;
  font-weight: 700;
}

.translation {
  color: #2d3835;
  line-height: 1.85;
}

.benefit {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--green-2);
  background: rgba(45, 107, 84, 0.08);
  color: #31443d;
  line-height: 1.65;
}

.proof {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.proof summary {
  cursor: pointer;
  color: var(--rose);
  font-weight: 900;
}

.proof p {
  color: var(--muted);
  line-height: 1.65;
}

.complete-button {
  margin-top: 1rem;
  min-height: 2.6rem;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  font-weight: 900;
}

.proofs-band,
.download-band,
.about-source {
  margin-top: 1rem;
  padding: clamp(1.2rem, 3vw, 2rem);
}

.download-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  background:
    linear-gradient(135deg, rgba(23, 63, 53, 0.96), rgba(41, 65, 95, 0.92)),
    var(--green);
  color: #fffdf6;
}

.download-band p {
  max-width: 720px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}

.button.download {
  flex: 0 0 auto;
  border-color: rgba(255, 255, 255, 0.44);
  background: #fff7e7;
  color: var(--green);
}

.about-source {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 850px) {
  .topbar,
  .toolbar,
  .reader-layout,
  .download-band,
  .about-source {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .nav-actions {
    justify-content: space-between;
  }

  .time-band {
    grid-template-columns: 1fr;
  }

  .time-band > div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .progress-panel {
    position: static;
  }

  .download-band {
    display: grid;
  }

  .button.download {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: 88vh;
  }

  .hero-content {
    padding-top: 1.5rem;
  }

  .toolbar {
    padding: 1rem;
  }

  .toolbar-heading h2 {
    font-size: 1.55rem;
  }

  .segmented {
    gap: 0.5rem;
  }

  .segmented button {
    min-height: 3rem;
    padding: 0.55rem 0.45rem;
    font-size: 0.95rem;
  }

  .view-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .card-top {
    display: grid;
  }

  .badges {
    justify-content: start;
  }

  .arabic {
    padding: 0.85rem;
  }
}
