@font-face {
  font-family: "Amiri Quran";
  src: url("../fonts/AmiriQuran-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

/* A single phone, with content slots that remain independent of sample length. */
.glimpse::before,
.glimpse::after { content: none; }
.glimpse-inner--phone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  column-gap: clamp(3rem, 7vw, 7rem);
  max-width: 66rem;
}
.glimpse-inner--phone .glimpse-intro {
  align-self: center;
  margin: 0;
  max-width: 28rem;
  text-align: left;
}
.glimpse-inner--phone .glimpse-intro .section-title {
  font-size: clamp(2.25rem, 3.6vw, 3rem);
  text-align: left;
  margin-bottom: 1.5rem;
}
.glimpse-inner--phone .glimpse-intro .section-subtitle { text-align: left; }
.glimpse-inner--phone .glimpse-trust { grid-column: 1 / -1; margin-top: 3.5rem; }

.qalb-demo-guide { margin-top: 2.5rem; }
.qalb-demo-guide-caption {
  margin: 0 0 1rem;
  color: var(--muted);
  font: 400 var(--text-small)/1.5 var(--font-body);
}
.qalb-demo-tabs { display: flex; flex-direction: column; gap: 0.25rem; }
.qalb-demo-tab {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  width: 100%;
  padding: 1rem 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  font: 400 1.2rem/1.4 var(--font-body);
  transition: color 180ms ease, border-color 180ms ease;
}
.qalb-demo-tab[aria-selected="true"] {
  color: var(--accent-ink);
  border-bottom-color: var(--accent-ink);
}
.qalb-demo-tab:hover { color: var(--navy); }
.qalb-demo-tab:focus-visible,
.qalb-demo-next:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 5px;
}

.qalb-demo {
  container-type: inline-size;
  --phone-rose: #9c6168;
  --phone-green: #20533d;
  position: relative;
  isolation: isolate;
  overflow: visible;
  width: min(100%, 21.5rem);
  justify-self: center;
  padding: 4.5%;
  border: 0;
  background: transparent;
  color: var(--navy);
  /* Phone hardware has a viewport. The text inside it never has fixed heights. */
  display: flex;
  flex-direction: column;
}
.qalb-demo::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  background: url("../images/iphone-17-frame.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 14px 18px rgba(23,40,58,0.16));
  pointer-events: none;
}
.qalb-demo-status {
  position: relative;
  display: flex;
  flex: 0 0 3.25rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 1.65rem 0;
  border-radius: 2.45rem 2.45rem 0 0;
  background: #fff;
  color: #242a29;
  font: 700 0.8rem/1 var(--font-body);
}
.qalb-demo-island { display: none; }
.qalb-demo-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 1rem 0.75rem;
  background: #fff;
  color: #090909;
}
.qalb-demo-entry-date { display: flex; align-items: center; gap: 0.55rem; font: 700 0.9375rem/1.4 var(--font-body); }
.qalb-demo-entry-date svg { color: #85858a; }
.qalb-demo-hidayah-title { font: 700 1rem/1.4 var(--font-body); margin: auto; }
.qalb-demo-reset { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; background: transparent; color: #77777c; cursor: pointer; }
.qalb-demo [hidden] { display: none !important; }
.qalb-demo-accessible { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.qalb-demo-prompt { margin: -0.65rem 0 1.6rem; color: #737379; font: 400 0.9375rem/1.5 var(--font-body); }
.qalb-demo-entry-echo { margin-bottom: 1.1rem; font: 400 0.9375rem/1.75 var(--font-body); color: #484846; }
.qalb-demo-entry-echo p { margin: 0; }
.qalb-demo-processing { display: flex; align-items: center; gap: 0.6rem; font: 400 0.8125rem/1.5 var(--font-body); color: #484846; padding: 0.5rem 0; }
.qalb-demo-loader { display: grid; flex: 0 0 auto; grid-template-columns: repeat(3, 4px); gap: 1.5px; }
.qalb-demo-loader span { width: 4px; height: 4px; background: #484846; border-radius: 1px; opacity: 0.15; animation: qalb-pixel-on 650ms ease-in-out var(--pixel-delay) infinite; }
@keyframes qalb-pixel-on { 0%, 100% { opacity: 0.15; } 40% { opacity: 1; } }
.qalb-demo-processing-label { color: #61615f; background: linear-gradient(90deg, #61615f 35%, #171717 50%, #61615f 65%); background-size: 200% 100%; background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: qalb-label-shimmer 1.4s linear infinite; }
@keyframes qalb-label-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.qalb-demo-elapsed { flex-shrink: 0; color: #61615f; font: 400 0.6875rem/1.5 ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.qalb-demo-related { margin: 0 0 1rem; text-align: center; color: #61615f; font: 400 0.8125rem/1.5 var(--font-body); }
.qalb-demo[data-stage="verse"] .qalb-demo-header,
.qalb-demo[data-stage="verse"] .qalb-demo-status,
.qalb-demo[data-stage="verse"] .qalb-demo-flow { background: #e6e5e3; }
.qalb-demo[data-stage="verse"] .qalb-demo-flow { padding: 0.4rem 0.65rem 1.5rem; }
.qalb-demo-flow {
  margin: 0;
  padding: 1rem 1rem 1.1rem;
  list-style: none;
  background: #fff;
}
.qalb-demo-step { min-width: 0; }
.qalb-demo-step + .qalb-demo-step { margin-top: 2.5rem; }
.qalb-demo-step[hidden] { display: none; }
.qalb-demo-label {
  margin: 0 0 1.1rem;
  font: 700 1rem/1.35 var(--font-body);
  color: #080808;
}
.qalb-demo-content { min-width: 0; overflow-wrap: anywhere; }
.qalb-demo-content p { margin: 0; }
.qalb-demo-content p + p { margin-top: 1.1em; }
.qalb-demo-content--journal,
.qalb-demo-content--reflection {
  font: 400 0.9375rem/1.75 var(--font-body);
  color: #484846;
}
.qalb-demo-content--journal { padding: 0; }
.qalb-demo-content--reflection { padding: 0.45rem 0.75rem; background: #f9f9f4; border-left: 2px solid #b1b1b2; border-radius: 0 0.5rem 0.5rem 0; }
.qalb-demo-content--verse { margin: 0; padding: 0.65rem 0.75rem 0.7rem; border: 1px solid #cececa; border-radius: 0.65rem; background: #f8f8f3; text-align: center; }
.qalb-demo-divider { display: flex; align-items: center; gap: 0.5rem; height: 5px; margin: 0.55rem 0 0; background: radial-gradient(circle, #888985 2px, transparent 2.5px) center/5px 5px no-repeat; }
.qalb-demo-divider::before, .qalb-demo-divider::after { content: ''; flex: 1; height: 1px; background: #c2c4bf; }
.qalb-demo-divider::before { margin-right: 0.5rem; }
.qalb-demo-divider::after { margin-left: 0.5rem; }
.qalb-demo-content .qalb-demo-arabic {
  margin: 0;
  padding: 0.35em 0;
  font-family: "Amiri Quran";
  font-size: 1.5rem;
  font-weight: 400;
  font-style: normal;
  font-synthesis: none;
  line-height: 1.95;
  letter-spacing: normal;
  word-spacing: normal;
  direction: rtl;
  unicode-bidi: isolate;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
  font-feature-settings: normal;
  color: var(--phone-green);
}
.qalb-demo-translation {
  margin: 0;
  padding: 0.45rem 0 0;
  border: 0;
  color: #40596a;
  font: 400 0.9375rem/1.65 var(--font-body);
}
.qalb-demo-citation {
  margin: 0;
  font: 400 0.9375rem/1.5 var(--font-body);
  color: var(--phone-rose);
  overflow-wrap: anywhere;
}
.qalb-demo-footer { display: flex; gap: 0.65rem; padding: 0.55rem 1.25rem; background: #fafaf6; border-top: 1px solid #d5d5d0; }
.qalb-demo-footer[hidden] { display: none; }
.qalb-demo-next,
.qalb-demo-save {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 36px;
  padding: 0.35rem 0.4rem;
  border: 1px solid #090909;
  border-radius: 0.5rem;
  background: #050505;
  color: #fffefa;
  font: 700 0.8125rem/1.4 var(--font-body);
  text-align: center;
  cursor: pointer;
}
.qalb-demo-next:hover { background: #292929; }
.qalb-demo-save { background: #fafaf6; color: #090909; }
.qalb-demo-save:hover { background: #eeeee8; }
.qalb-demo-footer button:disabled { background: #fafaf6; color: #82827e; border-color: #b1b1ad; cursor: default; }
.qalb-demo-footer button svg { flex-shrink: 0; }
.qalb-demo button:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -4px; }
.qalb-demo-next:focus-visible { outline-offset: -4px; outline-color: #fffefa; }
.qalb-demo-home {
  flex: 0 0 1.1rem;
  position: relative;
  background: #fff;
  border-radius: 0 0 2.45rem 2.45rem;
}
.qalb-demo-home::after {
  content: "";
  position: absolute;
  width: 6rem;
  height: 4px;
  bottom: 0.45rem;
  left: calc(50% - 3rem);
  background: #303c39;
  border-radius: 4px;
}
/* Enhancement only: no-JS visitors receive all three complete stages. */
.qalb-demo.is-interactive {
  aspect-ratio: 999 / 2043;
  padding: 0;
  min-height: 0;
  height: auto;
}
.qalb-demo.is-interactive .qalb-demo-flow {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #b4bcb4 transparent;
  scroll-padding-block: 1rem;
}
.qalb-demo.is-interactive .qalb-demo-step { margin: 0; }
.qalb-demo.is-interactive .qalb-demo-flow:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -3px; }

@media (max-width: 899px) {
  .glimpse-inner--phone { grid-template-columns: minmax(0, 1fr); row-gap: 2rem; }
  .glimpse-inner--phone .glimpse-intro { max-width: 34rem; margin: 0 auto; text-align: center; width: 100%; }
  .glimpse-inner--phone .glimpse-intro .section-title { font-size: clamp(2.25rem, 3.6vw, 3rem); text-align: center; }
  .glimpse-inner--phone .glimpse-intro .section-subtitle { text-align: center; }
  .qalb-demo-guide { margin-top: 1.75rem; }
  .qalb-demo-tabs { flex-direction: row; gap: 0.75rem; }
  .qalb-demo-tab { justify-content: center; text-align: center; font-size: 1rem; padding: 0.75rem 0; }
  .qalb-demo-guide-caption { font-size: 0.875rem; }
  .qalb-demo { width: min(100%, 20.5rem); }
  .glimpse-inner--phone .glimpse-trust { margin-top: 0.5rem; }
}
@media (max-width: 399px) {
  .qalb-demo-header { padding-inline: 1rem; }
  .qalb-demo-flow { padding-inline: 1rem; }
  
  
  .qalb-demo-tab { font-size: 0.9375rem; }
}
@media (prefers-reduced-motion: reduce) {
  .qalb-demo-tab { transition: none; }
  .qalb-demo-loader span, .qalb-demo-processing-label { animation: none; }
  .qalb-demo-processing-label { background: none; -webkit-text-fill-color: currentColor; }
}

/* Related explanation sits beneath the ayah, as in the app. */
.qalb-demo-why { margin: 0 0.4rem; padding: 0.4rem 0.7rem 0.6rem; background: #f2f2ec; border-radius: 0 0 0.65rem 0.65rem; color: #555653; font: 400 0.875rem/1.6 var(--font-body); text-align: center; }
.qalb-demo-why summary { display: flex; align-items: center; justify-content: center; gap: 0.55rem; cursor: pointer; list-style: none; font-weight: 700; }
.qalb-demo-why summary::-webkit-details-marker { display: none; }
.qalb-demo-why[open] summary svg { transform: rotate(180deg); }
.qalb-demo-why summary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 4px; }
.qalb-demo-why p { margin: 0.35rem 0 0; }

.qalb-demo[data-stage="verse"] .qalb-demo-header { padding-block: 0.65rem; }
.qalb-demo[data-stage="verse"] .qalb-demo-related { margin-bottom: 0.65rem; line-height: 1.4; }

/* A reading cue anchored above the app toolbar, never outside the phone. */
.qalb-demo-footer { position: relative; }
.qalb-demo-scroll-next {
  position: absolute;
  right: 0.95rem;
  top: -0.65rem;
  transform: translateY(-100%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #c6c6c0;
  border-radius: 50%;
  background: #fffefa;
  color: #252b29;
  box-shadow: 0 4px 12px rgba(23,40,58,0.12);
  cursor: pointer;
}
.qalb-demo-scroll-next:hover { background: #eeeee8; }

.qalb-demo-tab { flex-direction: column; gap: 0.55rem; }
.qalb-demo-tab-description { color: var(--muted); font: 400 1rem/1.5 var(--font-body); max-width: 26rem; animation: qalb-note-in 220ms ease-out; }
.qalb-demo-tab-description[hidden] { display: none; }
.qalb-demo-stage-note { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
@keyframes qalb-note-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 899px) {
  .qalb-demo-tab { align-items: center; }
  .qalb-demo-tab-description { display: none; }
  .qalb-demo-stage-note { position: static; width: auto; height: auto; margin: 1rem 0 0; overflow: visible; clip-path: none; color: var(--muted); font: 400 1rem/1.5 var(--font-body); min-height: 4.5em; }
}
@media (prefers-reduced-motion: reduce) { .qalb-demo-tab-description { animation: none; } }

/* Live screen sits behind the supplied frame and its camera cutout. */
.qalb-demo-screen { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: #fff; border-radius: 15% / 7.5%; }
.qalb-demo.is-interactive .qalb-demo-screen { position: absolute; inset: 1.7% 4.5%; }
.qalb-demo-status {
  flex: 0 0 15cqw;
  border-radius: 0;
  padding: 2cqw 9cqw 0;
  color: #111;
  font: 600 0.71875rem/1 -apple-system, BlinkMacSystemFont, sans-serif;
  font-variant-numeric: tabular-nums;
}
.qalb-demo-status > svg { width: 38px; height: 14px; }
.qalb-demo-footer > button:not(.qalb-demo-scroll-next) svg { width: 15px; height: 15px; }
.qalb-demo-home { border-radius: 0; }

/* Three quiet assurances, integrated into the cream section ground. */
.glimpse-inner--phone .glimpse-trust--band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 0;
  width: 100%;
  max-width: 62rem;
  margin: 4rem auto 0;
  padding: 0.75rem 0;
  text-align: left;
  letter-spacing: normal;
}
.glimpse-trust--band li { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 0.8rem; row-gap: 0.4rem; padding: 0 1.75rem; }
.glimpse-trust--band li + li { border-left: 1px solid rgba(61, 93, 85, 0.18); }
.glimpse-trust--band .glimpse-trust-icon { grid-column: 1; grid-row: 1 / 3; color: #607b72; margin-top: 0.1rem; }
.glimpse-trust--band h3 { grid-column: 2; margin: 0; color: #29473f; font: 700 1.0625rem/1.35 var(--font-body); letter-spacing: normal; }
.glimpse-trust--band p { grid-column: 2; margin: 0; color: #53665f; font: 400 1rem/1.5 var(--font-body); }
@media (max-width: 899px) {
  .glimpse-inner--phone .glimpse-trust--band { grid-template-columns: minmax(0, 1fr); max-width: 30rem; margin-top: 1.25rem; padding: 0; }
  .glimpse-trust--band li { width: 100%; padding: 1.35rem 0.35rem; column-gap: 1rem; }
  .glimpse-trust--band li + li { border-left: 0; border-top: 1px solid rgba(61, 93, 85, 0.18); }
}

/* A compact, staged preview of the app's guidance workflow. */
.qalb-demo[data-guidance-loading] .qalb-demo-flow,
.qalb-demo[data-guidance-loading] .qalb-demo-header,
.qalb-demo[data-guidance-loading] .qalb-demo-status { background: #f8f8f3; }
.qalb-demo-guidance { padding: 0.35rem 0.45rem 0; color: #263e39; }
.qalb-demo-guidance h3 { margin: 0 -0.45rem 0.65rem; font: 700 1.125rem/1.25 var(--font-body); }
.qalb-demo-guidance-intro { margin: 0 -0.45rem 1rem; font: 400 0.8125rem/1.4 var(--font-body); color: #53655f; }
.qalb-demo-guidance ol { list-style: none; padding: 0; margin: 0; }
.qalb-demo-guidance li { display: grid; grid-template-columns: 18px 1fr; gap: 0.65rem; position: relative; padding: 0 0 0.85rem; }
.qalb-demo-guidance li[data-state="complete"]::before { content: ''; position: absolute; left: 8px; top: 14px; bottom: -4px; width: 1px; background: #dcd3bb; }
.qalb-demo-guidance h4 { margin: 0 0 0.15rem; font: 700 0.875rem/1.25 var(--font-body); }
.qalb-demo-guidance li p { margin: 0; font: 400 0.8125rem/1.35 var(--font-body); }
.qalb-demo-guidance li[data-state="pending"] { color: #7a8580; }
.qalb-demo-guidance li[data-state="complete"] { color: #62726b; }
.qalb-demo-guidance-marker { position: relative; display: grid; place-items: start center; padding-top: 4px; }
.qalb-demo-guidance-marker::before { content: ''; width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: #d5c7a4; }
.qalb-demo-guidance li[data-state="complete"] .qalb-demo-guidance-marker::before { background: #788b7d; }
.qalb-demo-guidance-marker .qalb-demo-loader { display: none; }
.qalb-demo-guidance li[data-state="active"] .qalb-demo-guidance-marker::before { display: none; }
.qalb-demo-guidance li[data-state="active"] .qalb-demo-loader { display: grid; }
.qalb-demo-guidance-source { margin: 0.3rem 0 0; color: #727e77; font: 400 0.75rem/1.35 var(--font-body); }

@media (prefers-reduced-motion: no-preference) {
  .qalb-demo-guidance li[data-state="active"] { animation: qalb-guidance-reveal 280ms ease-out both; }
  .qalb-demo-guidance li[data-state="complete"]::before { transform-origin: top; animation: qalb-guidance-connect 280ms ease-out both; }
}
@keyframes qalb-guidance-reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes qalb-guidance-connect { from { transform: scaleY(0); } to { transform: scaleY(1); } }
