/* App phone: give every story the space needed by the longest one, so the
   actions do not move when the image and text change. */
@media (max-width:680px){
 html.jejak-app-phone body:has(.hero-banner) .hero.hero-banner{padding-top:6px}
 html.jejak-app-phone body:has(.hero-banner) .hero-rotator{grid-template-rows:auto auto;transition:none}
 html.jejak-app-phone body:has(.hero-banner) .hero-slide:not(.is-active){position:static}
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-copy>.row{margin-top:12px}
}
/* Short phone screens retain both actions above the bottom navigation. */
@media (max-width:680px) and (max-height:650px) and (orientation:portrait){
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-backdrop{height:clamp(110px,min(67vw,calc(100dvh - 410px)),240px)}
}
/* Keep the phone mockup clear of the Android status area without moving
   the shared hero container, copy, carousel dots or action buttons. */
@media (max-width:680px){
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .journey-slide[data-scene="app"] .hero-storybook-image{transform:translate(-50%,12%) scale(1.06)}
 html.jejak-app-phone body[dir="rtl"]:has(.hero-banner) .hero-banner .journey-slide[data-scene="app"] .hero-storybook-image{transform:translate(-50%,12%) scaleX(-1) scale(1.06)}
}
/* A short screen uses a shallower hero; contain keeps both phones visible. */
@media (max-width:680px) and (max-height:650px) and (orientation:portrait){
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .journey-slide[data-scene="app"] .hero-storybook-image{object-fit:contain}
}

/* One fixed story in the Android phone app. */
html.jejak-app-phone .hero-dots{display:none!important}
html.jejak-app-phone .hero-slide:not([data-slide="1"]){display:none!important}
html.jejak-app-phone .hero-slide[data-slide="1"]{position:static!important;display:block!important;visibility:visible!important;opacity:1!important;transition:none!important}
html.jejak-app-phone .journey-slide{animation:none!important;opacity:0!important;visibility:hidden!important}
html.jejak-app-phone .journey-slide[data-scene="game"]{opacity:1!important;visibility:visible!important}

/* Keep both children visible and softly blend the scene into the home copy. */
@media (max-width:680px){
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-storybook-image.hero-children-artwork{height:auto;top:auto;bottom:0;object-fit:contain;object-position:center bottom;transform:translateX(-50%);-webkit-mask-image:linear-gradient(to bottom,transparent 0%,#000 16%);mask-image:linear-gradient(to bottom,transparent 0%,#000 16%)}
 html.jejak-app-phone body[dir="rtl"]:has(.hero-banner) .hero-banner .hero-storybook-image.hero-children-artwork{transform:translateX(-50%) scaleX(-1)}
}
@media (min-width:681px) and (orientation:landscape){
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-storybook-image.hero-children-artwork{transform:scaleX(-1);-webkit-mask-image:linear-gradient(90deg,#000 15%,transparent 50%);mask-image:linear-gradient(90deg,#000 15%,transparent 50%)}
}

/* Al-Fath phone home: the QPC font uses page-specific glyphs; show readable
   Unicode instead until the page font has actually loaded. */
@font-face{font-family:QPCFath511;src:url('fonts/qpc-v2-p511.woff2') format('woff2');font-style:normal;font-weight:400;font-display:block}
/* Reserve space for both messages so the journey buttons do not jump. */
html.jejak-app-phone .hero-phone-copy{display:grid;text-align:center}
html.jejak-app-phone .hero-phone-copy>section{grid-area:1/1;visibility:hidden;opacity:0;transition:opacity 1100ms ease-in-out}
html.jejak-app-phone .hero-phone-copy>section.is-active{visibility:visible;opacity:1}
html.jejak-app-phone .hero-phone-copy>section.is-leaving{visibility:visible;opacity:0}
@media(prefers-reduced-motion:reduce){html.jejak-app-phone .hero-phone-copy>section{transition:none}}
/* Browser hero: fade the old copy out before the next copy fades in, so
   neighbouring headlines remain readable instead of crossing over. */
html:not(.jejak-app-phone) .hero-rotator .hero-slide{transition:opacity 1100ms ease-in-out,visibility 0s linear 1100ms}
html:not(.jejak-app-phone) .hero-rotator .hero-slide.is-active{transition:opacity 1100ms ease-in-out 1100ms,visibility 0s}
@media(prefers-reduced-motion:reduce){html:not(.jejak-app-phone) .hero-rotator .hero-slide{transition:none}}
@media(max-width:680px){
 /* Reserve the tallest browser slide too; the buttons should not travel
    vertically while a longer headline is fading in. */
 html:not(.jejak-app-phone) body:has(.hero-banner) .hero-rotator{grid-template-rows:auto auto;transition:none}
 html:not(.jejak-app-phone) body:has(.hero-banner) .hero-slide:not(.is-active){position:static}
}
html.jejak-app-phone .hero-journey-copy .hero-title{margin:0 0 14px;color:#123e39;font-size:clamp(24px,7.2vw,36px);line-height:1.15;letter-spacing:-.6px}
html.jejak-app-phone .hero-journey-copy .hero-prophet-name{color:#a76c18}
html.jejak-app-phone .hero-journey-copy .hero-journey-description{margin:0 auto;max-width:340px;color:#536b60;font:400 15px/1.5 Nunito,system-ui,sans-serif}
html.jejak-app-phone .hero-quran{text-align:center}
html.jejak-app-phone .hero-quran .hero-quran-reference{margin:0;color:#a76c18;font:800 15px/1.35 Nunito,system-ui,sans-serif;letter-spacing:0}
html.jejak-app-phone .hero-quran-verse{margin:8px 0 3px;direction:rtl;color:#12463b;line-height:1.9;white-space:nowrap}
html.jejak-app-phone .hero-quran-glyph{display:none;font:400 clamp(25px,7.8vw,31px)/1.9 QPCFath511,serif;user-select:none}
html.jejak-app-phone .hero-quran-fallback{font:400 clamp(25px,7.8vw,31px)/1.9 "Amiri Quran",serif}
html.jejak-app-phone .hero-quran.qpc-ready .hero-quran-glyph{display:inline}
html.jejak-app-phone .hero-quran.qpc-ready .hero-quran-fallback{display:none}
html.jejak-app-phone .hero-quran .hero-quran-meaning{margin:6px auto 0;max-width:340px;color:#536b60;font:400 15px/1.5 Nunito,system-ui,sans-serif}
@media(max-width:680px){
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-copy>.eyebrow{display:block;margin:14px 0;color:#278875;font-size:13px;letter-spacing:.17em}
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-backdrop{height:clamp(180px,67vw,296px)}
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-storybook-image.hero-fath-artwork{left:50%;right:auto;top:0;bottom:auto;width:100%;height:100%;object-fit:cover;object-position:center 10%;transform:translateX(-50%);-webkit-mask-image:none;mask-image:none}
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-copy>.pill{margin-top:0;padding:8px 15px;font-size:clamp(10px,2.8vw,11px);line-height:1.2}
}
@media(max-width:680px) and (max-height:740px){
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-backdrop{height:clamp(135px,min(60vw,calc(100dvh - 430px)),245px)}
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-copy>.eyebrow{margin:9px 0;font-size:12px}
 html.jejak-app-phone .hero-quran .hero-quran-reference{font-size:13px}
 html.jejak-app-phone .hero-quran-verse{margin:4px 0 0;line-height:1.8}
 html.jejak-app-phone .hero-quran-glyph,html.jejak-app-phone .hero-quran-fallback{font-size:clamp(23px,7.5vw,27px);line-height:1.8}
 html.jejak-app-phone .hero-quran .hero-quran-meaning{font-size:14px;line-height:1.4;margin-top:4px}
 html.jejak-app-phone .hero-journey-copy .hero-title{margin-bottom:9px;font-size:clamp(23px,7vw,32px)}
 html.jejak-app-phone .hero-journey-copy .hero-journey-description{font-size:14px;line-height:1.4}
}
@media(max-width:680px) and (max-height:740px) and (orientation:portrait){
 /* Older WebViews can report a zero inset; reserve room for Android icons. */
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-backdrop{margin-top:max(24px,var(--jejak-app-inset-top,0px))}
}
/* In landscape keep the artwork above the verse, never behind the Arabic. */
@media(min-width:681px) and (orientation:landscape){
 html.jejak-app-phone body:has(.hero-banner) .hero.hero-banner{display:flex;flex-direction:column;align-items:center;padding:0 0 20px;overflow:visible}
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-backdrop{position:relative;order:-1;inset:auto;width:100%;height:190px;min-height:0;overflow:hidden;background:#dcefe5;-webkit-mask-image:linear-gradient(to bottom,#000 60%,transparent);mask-image:linear-gradient(to bottom,#000 60%,transparent)}
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-storybook-image.hero-fath-artwork{position:absolute;inset:0 auto 0 50%;width:auto;max-width:100%;height:100%;object-fit:contain;object-position:center;transform:translateX(-50%);-webkit-mask-image:linear-gradient(to right,transparent,#000 12%,#000 88%,transparent);mask-image:linear-gradient(to right,transparent,#000 12%,#000 88%,transparent)}
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-copy{width:min(100%,550px);max-width:550px;margin:-14px auto 0;text-align:center}
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-copy>.eyebrow{display:block;margin:9px 0;color:#278875}
 html.jejak-app-phone body:has(.hero-banner) .hero-banner .hero-copy>.row{justify-content:center}
}
