@font-face {
  font-family: "Scheherazade New";
  src: url("assets/fonts/ScheherazadeNew-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --ivory: #f5efdf;
  --paper: #fffaf0;
  --olive: #263c31;
  --olive-soft: #52685a;
  --gold: #9b7a3d;
  --gold-pale: #d9c9a6;
  --rule: #ded2b8;
  --dua-size: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ivory);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.72), transparent 26rem),
    var(--ivory);
  color: var(--olive);
  font-family: Tahoma, Arial, "Segoe UI", sans-serif;
  line-height: 1.65;
}

button {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
.dua-list:focus-visible {
  outline: 3px solid #b5842d;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 20;
  padding: 0.65rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--olive);
  color: #fff;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(100%, 46rem);
  margin-inline: auto;
  padding: calc(1.25rem + env(safe-area-inset-top, 0px)) clamp(0.7rem, 3.5vw, 1.25rem) calc(2.5rem + var(--safe-bottom));
}

.site-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--rule);
  border-radius: 0.9rem;
  background: rgba(255, 250, 240, 0.76);
}

.site-navigation a {
  display: grid;
  min-height: 3rem;
  place-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  color: var(--olive);
  font-size: 0.94rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.site-navigation a.is-current {
  background: #eee3ca;
  box-shadow: inset 0 0 0 1px var(--gold-pale);
}

.masthead {
  padding: 1.7rem 0 1.45rem;
  text-align: center;
}

.identity,
.eyebrow,
.masthead h1,
.dedication,
.intro {
  margin: 0;
}

.identity {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ornament {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: min(13rem, 58vw);
  margin: 0.7rem auto 1rem;
  color: var(--gold);
}

.ornament::before,
.ornament::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--gold-pale);
}

.ornament span {
  font-size: 0.7rem;
  transform: rotate(45deg);
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.07em;
}

.masthead h1 {
  margin-top: 0.2rem;
  font-family: "Scheherazade New", Tahoma, serif;
  font-size: clamp(2.55rem, 12vw, 4.1rem);
  font-weight: 400;
  line-height: 1.2;
}

.dedication {
  color: var(--gold);
  font-size: clamp(1.05rem, 4.7vw, 1.25rem);
  font-weight: 700;
}

.intro {
  max-width: 34rem;
  margin: 0.8rem auto 0;
  color: var(--olive-soft);
  font-size: 0.94rem;
  line-height: 1.8;
}

.dua-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 0 0.45rem 1.4rem rgba(38, 60, 49, 0.06);
}

.dua-controls h2,
.dua-controls p {
  margin: 0;
}

.dua-controls h2 {
  font-size: 1.05rem;
  line-height: 1.45;
}

.dua-controls p {
  margin-top: 0.1rem;
  color: var(--olive-soft);
  font-size: 0.8rem;
}

.size-control {
  display: grid;
  grid-template-columns: 3.1rem 2.7rem 3.1rem;
  align-items: center;
  flex: none;
  direction: ltr;
  overflow: hidden;
  border: 1px solid var(--gold-pale);
  border-radius: 0.75rem;
  background: var(--paper);
}

.size-control button {
  min-width: 3.1rem;
  min-height: 3.1rem;
  border: 0;
  background: transparent;
  color: var(--olive);
  font-size: 1rem;
  font-weight: 750;
  cursor: pointer;
}

.size-control button:not(:disabled):active {
  background: #eee3ca;
}

.size-control button:disabled {
  color: #9a9a8e;
  cursor: not-allowed;
}

.size-control output {
  display: grid;
  min-height: 3.1rem;
  place-items: center;
  border-inline: 1px solid var(--gold-pale);
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 700;
}

.dua-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.dua-card {
  min-width: 0;
  padding: clamp(1.2rem, 5vw, 1.8rem);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 1.15rem;
  background: rgba(255, 250, 240, 0.88);
  box-shadow: 0 0.5rem 1.7rem rgba(38, 60, 49, 0.05);
}

.dua-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dua-kind,
.dua-number {
  margin: 0;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 750;
}

.dua-kind {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--gold-pale);
  border-radius: 999px;
  background: #f6edd9;
}

.dua-text {
  margin: 1rem 0;
  color: var(--olive);
  font-size: var(--dua-size);
  font-weight: 400;
  line-height: 2;
  overflow-wrap: break-word;
  word-break: normal;
}

.dua-card[data-kind="quran"] .dua-text {
  font-family: "Scheherazade New", serif;
  line-height: 2.05;
}

.dua-source {
  margin: 0;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(222, 210, 184, 0.8);
  color: var(--olive-soft);
  font-size: 0.8rem;
  line-height: 1.7;
}

.dua-source a {
  color: var(--olive);
  font-weight: 700;
  text-underline-offset: 0.2em;
}

.source-note {
  display: block;
  margin-top: 0.2rem;
}

.load-status {
  margin: 0;
  padding: 2rem 1rem;
  color: var(--olive-soft);
  text-align: center;
}

.editorial-note {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  border-inline-start: 3px solid var(--gold);
  border-radius: 0.3rem 0.8rem 0.8rem 0.3rem;
  background: rgba(228, 215, 184, 0.42);
}

.editorial-note span {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  flex: none;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, serif;
  font-weight: 700;
}

.editorial-note p {
  margin: 0;
  color: var(--olive-soft);
  font-size: 0.88rem;
}

footer {
  padding: 2.2rem 0 0.7rem;
  color: var(--olive-soft);
  font-size: 0.8rem;
  text-align: center;
}

footer p {
  margin: 0.2rem 0;
}

.prototype-label {
  margin-top: 0.6rem;
  color: var(--gold);
}

noscript {
  display: block;
  padding: 1rem;
  background: #fff1c8;
  color: #442f16;
  text-align: center;
}

@media (max-width: 370px) {
  .dua-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .size-control {
    width: 100%;
    grid-template-columns: 1fr 3.4rem 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
