@font-face {
  font-family: 'KFGQPC Hafs';
  src: url('./assets/UthmanicHafs_V22.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
:root {
  color-scheme: light;
  --paper: #faf9f6;
  --ink: #2c302a;
  --secondary: #575b50;
  --line: #cdcac0;
  --accent: #81734c;
  --ease: cubic-bezier(.22, 1, .36, 1);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 7px; }
button:disabled { cursor: default; }
::selection { background: #dedac8; color: var(--ink); }
.stage, .page { min-height: 100svh; }
.page { display: flex; flex-direction: column; padding: 4.5rem 2.5rem 2.5rem; }
.landing, .closing { justify-content: center; align-items: center; text-align: center; padding-bottom: 6rem; }
.landing-content { width: 100%; }
h1 { font-weight: 400; font-size: clamp(2.65rem, 6vw, 5.25rem); line-height: 1.13; letter-spacing: -.052em; margin: 0; }
h1 span, h1 em { display: block; }
h1 em { font-weight: 400; font-size: .9em; letter-spacing: -.047em; margin-top: .18em; }
.begin { margin-top: 3.5rem; padding: 1rem 2.35rem; min-height: 3.3rem; border: 1px solid #9b9d92; background: transparent; font-family: Arial, sans-serif; font-size: .875rem; letter-spacing: .055em; transition: color 260ms, background 260ms, border-color 260ms; }
.begin:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.reading { width: 100%; max-width: 45rem; margin: auto; padding: 2rem 0 3rem; }
.reading:focus, .closing-message:focus { outline: none; }
.arabic { font-family: 'KFGQPC Hafs', serif; font-size: clamp(2.05rem, 3.4vw, 2.65rem); font-weight: 400; line-height: 1.85; text-align: center; margin: 0; padding: .2em 0; direction: rtl; overflow-wrap: break-word; }
.divider { width: 2.25rem; height: 1px; background: var(--accent); opacity: .55; margin: 2.1rem auto 2.15rem; }
.english { font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.7; text-align: center; color: var(--secondary); margin: 0 auto; max-width: 40rem; overflow-wrap: break-word; text-wrap: pretty; }
.note { max-width: 35rem; padding: 1.5rem 0 3rem; }
.note p { font-size: clamp(1.15rem, 1.7vw, 1.32rem); line-height: 1.7; margin: 0 0 1.4em; text-wrap: pretty; }
.note p:first-child { font-size: clamp(1.55rem, 2.4vw, 1.9rem); line-height: 1.45; letter-spacing: -.028em; margin-bottom: 1.35em; }
.note p:last-child { margin-bottom: 0; }
.navigation { width: 100%; max-width: 45rem; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex: 0 0 auto; gap: 1.5rem; padding-bottom: env(safe-area-inset-bottom); }
.nav-button { border: 0; background: transparent; min-width: 3rem; min-height: 3rem; padding: .7rem 0; display: inline-flex; gap: .9rem; align-items: center; justify-content: center; font-family: Arial, sans-serif; font-size: .875rem; letter-spacing: .025em; }
.nav-button svg { width: 2.3rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1; overflow: visible; transition: transform 320ms var(--ease); }
.nav-button.next:hover svg { transform: translateX(.35rem); }
.nav-button.back { color: #707465; margin-left: -.2rem; }
.nav-button.back svg { width: 1.6rem; }
.nav-button.back:hover svg { transform: translateX(-.25rem); }
.closing-message { max-width: 43rem; font-size: clamp(2rem, 4.1vw, 3.5rem); font-weight: 400; letter-spacing: -.035em; line-height: 1.35; margin: 0; text-wrap: balance; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  .page { padding: 2.25rem 1.6rem 1.3rem; }
  .landing, .closing { padding-bottom: 4.5rem; }
  h1 { font-size: clamp(2.35rem, 10.5vw, 3.6rem); }
  .begin { margin-top: 2.8rem; padding: .95rem 1.9rem; }
  .reading { padding: 1.8rem 0 2.4rem; }
  .arabic { font-size: 2.1rem; line-height: 1.9; }
  .english { font-size: 1.15rem; line-height: 1.68; }
  .divider { margin: 1.7rem auto 1.6rem; }
  .note { padding-top: 1.4rem; }
  .note p { font-size: 1.1rem; }
  .note p:first-child { font-size: 1.6rem; }
  .navigation { padding-top: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .divider { background: CanvasText; }
  .begin { border-color: ButtonText; }
}
/* A stable reading viewport keeps both controls still as passages change. */
html, body { height: 100%; overflow: hidden; }
.stage { height: var(--viewport-height, 100dvh); min-height: 0; }
.page { height: 100%; min-height: 0; padding: 0; overflow: hidden; }
.landing, .closing { padding: 2.5rem 2rem 6rem; }
.scroll-area {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 3rem 2.5rem 1.5rem;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom;
}
.reading { flex: 0 0 auto; margin-block: auto; }
.navigation {
  height: calc(5.8rem + env(safe-area-inset-bottom));
  min-height: calc(5.8rem + env(safe-area-inset-bottom));
  width: calc(100% - 5rem);
  padding: 0 0 env(safe-area-inset-bottom);
  background: var(--paper);
}
@media (max-width: 600px) {
  .landing, .closing { padding: 2rem 1.6rem 4.5rem; }
  .scroll-area { padding: 1.2rem 1.6rem .5rem; scrollbar-gutter: auto; }
  .navigation { width: calc(100% - 3.2rem); height: calc(4.9rem + env(safe-area-inset-bottom)); min-height: calc(4.9rem + env(safe-area-inset-bottom)); padding-top: 0; }
  .begin { padding-inline: 1.35rem; max-width: 100%; line-height: 1.5; }
}
/* Both sections share the same paper, type and fixed reading controls. */
[hidden] { display: none !important; }
.quran-shell { height: var(--viewport-height, 100dvh); display: flex; flex-direction: column; }
.section-tabs { display: flex; justify-content: center; flex: 0 0 auto; gap: 2rem; padding: max(.6rem, env(safe-area-inset-top)) 1rem 0; border-bottom: 1px solid #e7e4dc; }
.section-tabs button { border: 0; border-bottom: 1px solid transparent; background: none; padding: .85rem .15rem; font: .875rem/1.4 Arial, sans-serif; color: var(--secondary); }
.section-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
.section-panel { flex: 1 1 auto; min-height: 0; }
.section-panel .stage { height: 100%; }
.arabic { font-synthesis: none; font-style: normal; letter-spacing: normal; }
.landing, .closing { overflow-y: auto; }
a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.promise-browse { overflow-y: auto; padding: 2.3rem 2rem 4rem; scrollbar-gutter: stable; }
.promise-library { width: 100%; max-width: 52rem; margin: 0 auto; }
.library-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.library-heading h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 400; letter-spacing: -.035em; margin: 0; }
.quiet-button { border: 0; background: none; padding: .6rem .2rem; min-height: 44px; font: .875rem/1.4 Arial, sans-serif; color: var(--secondary); text-decoration: underline; text-underline-offset: .3em; }
.library-intro { max-width: 42rem; font-size: 1.0625rem; line-height: 1.65; color: var(--secondary); margin: 0 0 1.65rem; }
.promise-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: .9rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.promise-filters label { display: flex; flex-direction: column; gap: .45rem; font: .875rem/1.4 Arial, sans-serif; }
.promise-filters .search-field { grid-column: auto; }
.promise-filters input, .promise-filters select { width: 100%; min-width: 0; border: 1px solid #c6c5b9; border-radius: 0; background: transparent; color: var(--ink); font: 1rem/1.45 Arial, sans-serif; padding: .75rem; min-height: 46px; }
.result-summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font: .875rem/1.5 Arial, sans-serif; color: var(--secondary); margin: .65rem 0; }
.promise-results { list-style: none; margin: 0; padding: 0; }
.promise-result { display: block; width: 100%; text-align: left; padding: 1.4rem 0 1.45rem; border: 0; border-bottom: 1px solid #dedbd2; background: none; }
.promise-result:hover .result-title { text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
.result-meta, .promise-kicker { font: .8125rem/1.65 Arial, sans-serif; color: var(--accent); letter-spacing: .035em; }
.result-title { display: block; font-size: 1.25rem; line-height: 1.5; margin: .35rem 0; }
.result-condition { display: block; font-size: 1rem; line-height: 1.6; color: var(--secondary); }
.show-more { display: block; margin: 1.5rem auto 0; }
.promise-reading { max-width: 45rem; padding-top: .5rem; margin-block: 0 auto; }
.promise-kicker { margin: 0 0 1.8rem; text-align: center; }
.verse { margin: 0 0 1.6rem; }
.verse-ref { font: .8125rem/1.5 Arial, sans-serif; text-align: center; color: var(--accent); margin: 0 0 .4rem; }
.verse .arabic { line-height: 2; }
.verse-translation { max-width: 40rem; margin: 1.15rem auto 0; font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.75; text-align: center; color: var(--secondary); overflow-wrap: break-word; text-wrap: pretty; }
.translation-credit { margin: 2rem 0 0; font: .75rem/1.6 Arial, sans-serif; color: var(--secondary); text-align: center; }
.promise-explanation { max-width: 37rem; margin: 0 auto; }
.explanation-label { font: .8125rem/1.6 Arial, sans-serif; color: var(--accent); letter-spacing: .025em; margin: 0 0 1.6rem; }
.promise-explanation h3 { font: .875rem/1.5 Arial, sans-serif; color: var(--secondary); font-weight: 400; margin: 1.6rem 0 .45rem; }
.promise-explanation p:not(.explanation-label) { font-size: 1.15rem; line-height: 1.75; margin: 0; }
.promise-source { display: inline-block; font: .875rem/1.5 Arial, sans-serif; color: var(--accent); margin-top: 1.8rem; text-underline-offset: .3em; }
.promise-navigation { gap: .7rem; }
.promise-navigation .nav-button { font-size: .875rem; }
.promise-navigation .browse-button { text-decoration: underline; text-underline-offset: .25em; color: var(--secondary); font-size: .8125rem; }
.empty-results { font-size: 1.1rem; line-height: 1.6; padding: 2rem 0; color: var(--secondary); }
#promise-info { width: min(43rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
#promise-info::backdrop { background: rgb(44 48 42 / 35%); }
.info-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.2rem 1.8rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 1; }
.info-heading h2 { font-weight: 400; font-size: 1.65rem; letter-spacing: -.03em; margin: 0; }
.info-content { padding: .3rem 1.8rem 2rem; font-size: 1rem; line-height: 1.7; }
.info-content h3 { font-size: 1.2rem; font-weight: 400; margin: 1.7rem 0 .6rem; }
.info-content p { margin: .9rem 0; }
.info-content dt { margin-top: 1rem; font-weight: 400; color: var(--accent); }
.info-content dd { margin: .3rem 0 1rem; }
.info-content a { color: var(--accent); overflow-wrap: anywhere; }
.info-content summary { cursor: pointer; padding: .65rem 0; }
.info-content details { border-bottom: 1px solid var(--line); }
.info-content pre { white-space: pre-wrap; overflow-wrap: anywhere; font: .875rem/1.7 Arial, sans-serif; }
@media (max-width: 600px) {
  .section-tabs { gap: 1.6rem; }
  .section-tabs button { font-size: .8125rem; }
  .promise-browse { padding: 1.6rem 1.4rem 3rem; }
  .promise-filters { gap: .75rem; grid-template-columns: 1fr; }
  .promise-filters .search-field { grid-column: auto; }
  .promise-reading { padding-top: .7rem; }
    .verse .arabic { font-size: 2rem; line-height: 2.05; }
  .promise-navigation { width: calc(100% - 2.4rem); }
  .info-heading { padding: .9rem 1.2rem; }
  .info-content { padding-inline: 1.2rem; }
}

@font-face {
  font-family: 'KFGQPC Hafs Tanzil';
  src: url('./assets/Hafs-Tanzil.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
#promises-app .arabic { font-family: 'KFGQPC Hafs Tanzil', serif; }
.result-condition { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.library-heading .quiet-button { flex: 0 0 auto; max-width: 8.5rem; text-align: right; }

.promise-references { display: flex; flex-wrap: wrap; gap: 0 1.4rem; }

/* The entrance gives both readings equal space. */
.home-page { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; padding: max(3rem, env(safe-area-inset-top)) 2rem max(3rem, env(safe-area-inset-bottom)); }
.home-content { width: 100%; max-width: 61rem; margin: auto; padding: 2rem 0 4rem; }
.home-content h1 { text-align: center; font-size: clamp(2.5rem, 5vw, 4.25rem); margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.home-content h1:focus { outline: none; }
.home-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.home-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-height: 17rem; padding: 2.6rem; border: 1px solid var(--line); background: transparent; transition: background 200ms, border-color 200ms; }
.home-card:hover { background: #f3f1ea; border-color: var(--accent); }
.home-card-title { font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1.2; letter-spacing: -.035em; }
.home-card-description { font-size: 1.075rem; line-height: 1.65; color: var(--secondary); margin: 1rem 0 2.3rem; }
.home-card-action { width: 100%; margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font: .875rem/1.5 Arial, sans-serif; color: var(--secondary); }
.home-card-action span { font: 1.5rem/1 Georgia, serif; color: var(--accent); }
.reading-header { flex: 0 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: max(.6rem, env(safe-area-inset-top)) 1.5rem 0; border-bottom: 1px solid #e7e4dc; }
.reading-header .section-tabs { grid-column: 2; border: 0; padding: 0; }
.home-button { grid-column: 1; justify-self: start; border: 0; background: transparent; min-height: 44px; padding: .75rem .25rem; font: .875rem/1.4 Arial, sans-serif; color: var(--secondary); }
.home-button:hover { text-decoration: underline; text-underline-offset: .3em; }
@media (max-width: 600px) {
  .home-page { padding: max(2rem, env(safe-area-inset-top)) 1.4rem max(2rem, env(safe-area-inset-bottom)); }
  .home-content { padding: 1rem 0; }
  .home-content h1 { font-size: clamp(2.3rem, 9vw, 3rem); margin-bottom: 2.2rem; }
  .home-choices { grid-template-columns: 1fr; gap: 1rem; }
  .home-card { min-height: 12rem; padding: 1.65rem; }
  .home-card-title { font-size: 2rem; }
  .home-card-description { font-size: 1rem; margin: .7rem 0 1.6rem; }
  .reading-header { grid-template-columns: auto 1fr; column-gap: 1rem; padding-inline: .9rem; }
  .reading-header .section-tabs { gap: 1rem; justify-content: flex-end; }
  .home-button { font-size: .8125rem; }
}
