/* ==========================================================================
   سُمو — Site design system
   Navy + paper + one gold accent, taken from the app's own identity.

   Shape rule:  interactive = pill · tiles = 28px · inputs = 14px
   Type rule:   Thmanyah Serif Display for display, Thmanyah Sans for text.
                Arabic is never letter-spaced.
   ========================================================================== */

/* ---- Thmanyah typeface (local) ---- */
@font-face {
    font-family: 'Thmanyah Sans';
    src: url('fonts/ThmanyahSans-Light.woff2') format('woff2');
    font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Sans';
    src: url('fonts/ThmanyahSans-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Sans';
    src: url('fonts/ThmanyahSans-Medium.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Sans';
    src: url('fonts/ThmanyahSans-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Sans';
    src: url('fonts/ThmanyahSans-Black.woff2') format('woff2');
    font-weight: 800 900; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Serif Display';
    src: url('fonts/ThmanyahSerifDisplay-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Serif Display';
    src: url('fonts/ThmanyahSerifDisplay-Black.woff2') format('woff2');
    font-weight: 800 900; font-style: normal; font-display: swap;
}

:root {
    color-scheme: light;

    /* Brand navy (the app bar and the app icon) */
    --navy-950: #0a1a2c;
    --navy-900: #0f2439;
    --navy-800: #15304d;
    --navy-700: #1b3a5c;
    --navy-600: #2b4b70;
    --navy-500: #46648a;
    --navy-100: #dbe3ec;
    --navy-50: #edf1f5;

    /* Surfaces (the app's own paper tone) */
    --paper: #f7f6f1;
    --sand: #efece2;
    --sand-2: #e6e1d3;
    --surface: #ffffff;
    --cream: #f6f2e9;

    /* The single accent */
    --gold: #c39a3e;
    --gold-ink: #87621a;   /* text-safe on paper */
    --gold-soft: #dcbf7a;  /* on navy */

    /* Text */
    --ink: #10253c;
    --body: #435267;
    --muted: #5f6c7f;
    --on-navy: #f6f2e9;
    --on-navy-2: rgba(246, 242, 233, 0.74);

    /* Lines */
    --line: rgba(16, 37, 60, 0.1);
    --line-strong: rgba(16, 37, 60, 0.2);
    --line-navy: rgba(246, 242, 233, 0.16);

    --danger: #b3392d;
    --danger-bg: #fbefed;

    --font-body: 'Thmanyah Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Thmanyah Serif Display', 'Thmanyah Sans', Georgia, serif;
    --display-features: "ss01"; /* الأحرف المرسلة */
    --lh-display: 1.68;        /* room for the long tails and the marks above the next line */

    /* Shadows carry the navy hue, one light source from above */
    --shadow-sm: 0 1px 2px rgba(16, 37, 60, 0.06), 0 2px 8px rgba(16, 37, 60, 0.04);
    --shadow-md: 0 2px 4px rgba(16, 37, 60, 0.04), 0 18px 40px -18px rgba(16, 37, 60, 0.22);
    --shadow-device: 0 30px 44px -14px rgba(16, 37, 60, 0.3), 0 8px 16px -8px rgba(16, 37, 60, 0.14);

    --r-tile: 28px;
    --r-input: 14px;
    --r-pill: 999px;

    --container: 1200px;
    --gutter: clamp(20px, 4vw, 40px);
    --section: clamp(88px, 11vw, 160px);
    --nav-h: 68px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--body);
    background: var(--paper);
    min-height: 100dvh;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul, ol { list-style: none; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-feature-settings: var(--display-features);
    color: var(--ink);
    font-weight: 900;
    line-height: var(--lh-display);
    text-wrap: balance;
}
p { text-wrap: pretty; }

::selection { background: var(--navy-700); color: var(--cream); }

:focus-visible {
    outline: 2px solid var(--navy-700);
    outline-offset: 3px;
    border-radius: 6px;
}

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: absolute;
    inset-inline-start: 16px;
    top: -60px;
    z-index: 200;
    background: var(--navy-700);
    color: var(--cream);
    padding: 10px 18px;
    border-radius: var(--r-pill);
    font-weight: 700;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* The brand's one flourish: a gold full stop closing a display line */
.dot { color: var(--gold); }

.latin { font-family: var(--font-body); direction: ltr; unicode-bidi: isolate; }

/* ============================ Buttons ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 28px;
    border-radius: var(--r-pill);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease,
                transform 0.25s var(--ease), box-shadow 0.25s ease;
}
.btn i { font-size: 1.15em; }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--navy-700); color: var(--cream); }
.btn-primary:hover { background: var(--navy-900); box-shadow: var(--shadow-md); }

.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface); border-color: var(--ink); }

.btn-light { background: var(--cream); color: var(--navy-900); }
.btn-light:hover { background: #ffffff; }

.btn-outline-light { background: transparent; color: var(--on-navy); border-color: rgba(246, 242, 233, 0.4); }
.btn-outline-light:hover { background: rgba(246, 242, 233, 0.1); border-color: var(--on-navy); }

.btn-sm { min-height: 42px; padding: 0 20px; font-size: 0.94rem; }
.btn-block { width: 100%; }

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--ink);
    background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 100% 1px;
    padding-bottom: 2px;
    transition: color 0.25s ease, gap 0.25s var(--ease);
}
.text-link:hover { color: var(--gold-ink); gap: 12px; }
.text-link i { font-size: 0.8em; }

/* ============================ Navbar ============================ */
.nav-sentinel { position: absolute; top: 0; height: 24px; width: 1px; pointer-events: none; }

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.navbar.scrolled {
    background: rgba(247, 246, 241, 0.86);
    -webkit-backdrop-filter: saturate(1.4) blur(16px);
    backdrop-filter: saturate(1.4) blur(16px);
    border-bottom-color: var(--line);
}
.nav-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand { position: relative; z-index: 102; display: inline-flex; align-items: center; }
.brand .name {
    font-family: var(--font-display);
    font-feature-settings: var(--display-features);
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1.2;
    color: var(--navy-700);
    padding-bottom: 4px; /* optical: the wordmark's diacritics sit high */
}

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a:not(.btn) {
    padding: 8px 14px;
    border-radius: var(--r-pill);
    font-size: 0.97rem;
    font-weight: 500;
    color: var(--body);
    transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-links a:not(.btn):hover { color: var(--ink); background: rgba(16, 37, 60, 0.06); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav-cta { margin-inline-start: 12px; }

.nav-toggle {
    display: none;
    position: relative;
    z-index: 102;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}
.nav-toggle span {
    position: absolute;
    inset-inline: 11px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 25px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

/* ============================ Section primitives ============================ */
section { position: relative; }
.section { padding-block: var(--section); }

.section-head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-title { font-size: clamp(1.85rem, 3.9vw, 2.9rem); }
.section-sub {
    margin-top: 10px;
    font-size: clamp(1.08rem, 1.5vw, 1.25rem);
    line-height: 1.8;
    max-width: 56ch;
}
.section-head.center .section-sub { margin-inline: auto; }

/* ============================ Hero ============================ */
.hero {
    margin-top: calc(var(--nav-h) * -1);
    padding-top: calc(var(--nav-h) + clamp(44px, 7vw, 88px));
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(70% 46% at 50% 100%, rgba(220, 191, 122, 0.3), transparent 70%),
        linear-gradient(180deg, #e9eff5 0%, var(--paper) 58%);
}
.hero-copy { max-width: 820px; margin-inline: auto; text-align: center; }
.hero-kicker {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-ink);
}
.hero h1 {
    font-size: clamp(2.5rem, 6.8vw, 5rem);
    line-height: 1.62;
}
.hero h1 > span { display: block; }
.hero-desc {
    max-width: 47ch;
    margin: 14px auto 0;
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    line-height: 1.9;
}
.hero-desc strong { color: var(--ink); font-weight: 700; }
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 34px;
}

/* Three devices rising over a horizon line */
.hero-devices {
    --main: clamp(210px, 25vw, 330px);
    position: relative;
    height: calc(var(--main) * 1.5);
    margin-top: clamp(40px, 6vw, 72px);
    margin-inline: calc(var(--gutter) * -1);
    overflow: hidden;
}
.hero-arc {
    position: absolute;
    top: calc(var(--main) * 0.22);
    left: 50%;
    width: calc(var(--main) * 4.4);
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    border: 1px solid rgba(195, 154, 62, 0.55);
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 100%);
}
.device {
    border-radius: 11% / 5.2%;
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--main);
    box-shadow: var(--shadow-device);
    animation: rise 1.1s var(--ease) both;
}
.device-main { z-index: 2; transform: translateX(-50%); animation-delay: 0.1s; }
.device-start, .device-end { width: calc(var(--main) * 0.86); top: calc(var(--main) * 0.24); }
.device-start { transform: translateX(calc(-50% + var(--main) * 0.8)) rotate(5deg); animation-name: rise-start; animation-delay: 0.25s; }
.device-end { transform: translateX(calc(-50% - var(--main) * 0.8)) rotate(-5deg); animation-name: rise-end; animation-delay: 0.35s; }

@keyframes rise {
    from { opacity: 0; transform: translateX(-50%) translateY(70px); }
    to { opacity: 1; transform: translateX(-50%); }
}
@keyframes rise-start {
    from { opacity: 0; transform: translateX(calc(-50% + var(--main) * 0.8)) translateY(90px) rotate(5deg); }
    to { opacity: 1; transform: translateX(calc(-50% + var(--main) * 0.8)) rotate(5deg); }
}
@keyframes rise-end {
    from { opacity: 0; transform: translateX(calc(-50% - var(--main) * 0.8)) translateY(90px) rotate(-5deg); }
    to { opacity: 1; transform: translateX(calc(-50% - var(--main) * 0.8)) rotate(-5deg); }
}

/* ============================ Story: a day with Sumu ============================ */
.story { padding-top: var(--section); padding-bottom: calc(var(--section) * 0.5); }
.story-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
}
.story-steps { counter-reset: none; }
.story-step {
    min-height: 74vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0.32;
    transition: opacity 0.5s ease;
}
.story-step.is-active { opacity: 1; }
.story-time {
    align-self: flex-start;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--gold-ink);
}
.story-step h3 { font-size: clamp(1.6rem, 2.9vw, 2.3rem); }
.story-step p { margin-top: 8px; font-size: 1.15rem; max-width: 42ch; }
.story-inline { display: none; }

.story-stage {
    position: sticky;
    top: calc(var(--nav-h) + (100vh - var(--nav-h) - min(76vh, 680px)) / 2);
    height: min(76vh, 680px);
    border-radius: var(--r-tile);
    overflow: hidden;
    isolation: isolate;
}
/* One sky per moment, cross-faded as the day moves on */
.sky { position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s ease; }
.sky-0 { background: linear-gradient(180deg, #d5e0ec 0%, #ecdfd0 100%); }
.sky-1 { background: linear-gradient(180deg, #f6e9c9 0%, #fbf5e6 100%); }
.sky-2 { background: linear-gradient(180deg, #dfe9f1 0%, #f3f5f2 100%); }
.sky-3 { background: linear-gradient(180deg, #e2d3d6 0%, #f1dcc5 100%); }
.sky-4 { background: linear-gradient(180deg, #10253c 0%, #1e3f63 100%); }
.story-stage[data-phase="0"] .sky-0,
.story-stage[data-phase="1"] .sky-1,
.story-stage[data-phase="2"] .sky-2,
.story-stage[data-phase="3"] .sky-3,
.story-stage[data-phase="4"] .sky-4 { opacity: 1; }

.story-orbit {
    position: absolute;
    left: 50%;
    top: 14%;
    width: 150%;
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    border: 1px solid rgba(135, 98, 26, 0.28);
    transition: border-color 0.9s ease;
}
.story-stage[data-phase="4"] .story-orbit { border-color: rgba(246, 242, 233, 0.22); }
/* The sun travels east to west across the stage, then becomes the moon */
.story-sun {
    position: absolute;
    width: 56px;
    height: 56px;
    margin: -28px;
    border-radius: 50%;
    background: var(--gold-soft);
    box-shadow: 0 0 0 10px rgba(220, 191, 122, 0.22);
    transition: left 1.1s var(--ease), top 1.1s var(--ease), background-color 0.9s ease,
                box-shadow 0.9s ease, transform 0.9s var(--ease);
}
.story-stage[data-phase="0"] .story-sun { left: 90%; top: 42%; }
.story-stage[data-phase="1"] .story-sun { left: 78%; top: 22%; }
.story-stage[data-phase="2"] .story-sun { left: 50%; top: 9%; }
.story-stage[data-phase="3"] .story-sun { left: 14%; top: 34%; background: #e0a970; box-shadow: 0 0 0 10px rgba(224, 169, 112, 0.22); }
.story-stage[data-phase="4"] .story-sun {
    left: 16%; top: 16%;
    transform: scale(0.72);
    background: var(--cream);
    box-shadow: inset -14px -6px 0 0 #1b3a5c, 0 0 0 0 transparent;
}
.story-shot {
    border-radius: 11% / 5.2%;
    position: absolute;
    left: 50%;
    top: 9%;
    height: 112%;
    width: auto;
    max-width: none;
    transform: translateX(-50%) translateY(28px);
    opacity: 0;
    box-shadow: var(--shadow-device);
    transition: opacity 0.6s ease, transform 0.9s var(--ease);
}
.story-shot.is-active { opacity: 1; transform: translateX(-50%); }

/* ============================ Treasures: bento ============================ */
.bento {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
}
.tile {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: var(--r-tile);
    padding: clamp(26px, 3vw, 40px);
    background: var(--surface);
    display: flex;
    flex-direction: column;
}
.tile h3 { font-size: clamp(1.35rem, 1.9vw, 1.65rem); }
.tile p { margin-top: 6px; max-width: 40ch; }
.tile-note { margin-top: 14px; font-size: 0.92rem; color: var(--muted); }

.tile-library { grid-column: span 7; grid-row: span 2; background: var(--sand); padding-bottom: 0; }
.tile-library .riwayat { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tile-library .riwayat li {
    padding: 5px 14px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink);
}
.tile-library .tile-shot {
    width: min(330px, 78%);
    margin: 34px auto 0;
    aspect-ratio: 720 / 1000;
    border-radius: 11% 11% 0 0 / 7.9% 7.9% 0 0;
    object-fit: cover;
    object-position: top;
    box-shadow: var(--shadow-device);
}

.tile-names { grid-column: span 5; background: var(--navy-700); justify-content: flex-end; min-height: 300px; }
.tile-names h3 { color: var(--on-navy); }
.tile-names p { color: var(--on-navy-2); }
.tile-names .big-num {
    font-family: var(--font-display);
    font-feature-settings: var(--display-features);
    font-weight: 900;
    font-size: clamp(6rem, 11vw, 9.5rem);
    line-height: 1;
    color: var(--gold-soft);
    margin-bottom: auto;
    padding-bottom: 20px;
}
.tile-names::before,
.tile-names::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset-inline-end: -90px;
    top: -90px;
    width: 320px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid var(--line-navy);
}
.tile-names::after { width: 460px; inset-inline-end: -160px; top: -160px; }

.tile-tasbih { grid-column: span 5; flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
.tasbih {
    flex: none;
    position: relative;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    border: 0;
    background: var(--navy-50);
    cursor: pointer;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    transition: transform 0.2s var(--ease), background-color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.tasbih:hover { background: var(--navy-100); }
.tasbih:active { transform: scale(0.95); }
.tasbih svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.tasbih circle { fill: none; stroke-width: 3; }
.tasbih .ring-track { stroke: rgba(16, 37, 60, 0.1); }
.tasbih .ring-fill {
    stroke: var(--gold);
    stroke-linecap: round;
    stroke-dasharray: 389.56;
    stroke-dashoffset: 389.56;
    transition: stroke-dashoffset 0.35s var(--ease);
}
.tasbih-count {
    font-family: var(--font-display);
    font-feature-settings: var(--display-features);
    font-weight: 900;
    font-size: 2.5rem;
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.tasbih-phrase { font-size: 0.82rem; font-weight: 700; color: var(--gold-ink); line-height: 1.4; }

.tile-dua { grid-column: span 6; background: #f3ead6; }
.tile-dua blockquote {
    font-family: var(--font-display);
    font-feature-settings: var(--display-features);
    font-weight: 700;
    font-size: clamp(1.35rem, 2.1vw, 1.75rem);
    line-height: 1.9;
    color: var(--ink);
    text-wrap: balance;
}
.tile-dua cite { display: block; margin-top: 8px; font-style: normal; font-size: 0.92rem; color: var(--gold-ink); font-weight: 700; }
.tile-dua .tile-foot { margin-top: auto; padding-top: 28px; }

.tile-qibla { grid-column: span 3; align-items: flex-start; }
.compass {
    position: relative;
    width: 96px;
    height: 96px;
    margin-bottom: auto;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
}
.compass::before {
    content: '';
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    border: 1px dashed var(--line-strong);
}
.compass-needle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 64px;
    margin: -32px -5px;
    background: linear-gradient(180deg, var(--gold) 0 50%, var(--navy-100) 50% 100%);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    animation: seek 7s ease-in-out infinite;
}
@keyframes seek {
    0%, 100% { transform: rotate(38deg); }
    30% { transform: rotate(52deg); }
    60% { transform: rotate(31deg); }
    80% { transform: rotate(46deg); }
}
.tile-qibla h3, .tile-hijri h3 { margin-top: 28px; font-size: 1.25rem; }

.tile-hijri { grid-column: span 3; background: var(--navy-50); align-items: flex-start; }
.hijri-today { margin-bottom: auto; }
.hijri-today[hidden] { display: none; }
.hijri-today small { display: block; font-size: 0.9rem; font-weight: 700; color: var(--gold-ink); }
.hijri-day {
    display: block;
    font-family: var(--font-display);
    font-feature-settings: var(--display-features);
    font-weight: 900;
    font-size: 4rem;
    line-height: 1.05;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.hijri-month { font-weight: 700; color: var(--ink); line-height: 1.5; }

/* ============================ Scanner spotlight ============================ */
.scanner { padding-top: calc(var(--section) * 0.5); }
.scanner-card {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: clamp(24px, 5vw, 72px);
    padding: clamp(28px, 5vw, 72px);
    padding-bottom: 0;
    border-radius: var(--r-tile);
    background: var(--sand);
    overflow: hidden;
}
.scanner-text { padding-bottom: clamp(28px, 5vw, 72px); }
.badge {
    display: inline-block;
    margin-bottom: 18px;
    padding: 3px 12px;
    border-radius: 8px;
    background: var(--navy-700);
    color: var(--cream);
    font-size: 0.85rem;
    font-weight: 700;
}
.scanner-text h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
.scanner-text > p { margin-top: 10px; font-size: 1.15rem; max-width: 44ch; }
.scanner-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--line-strong);
    font-weight: 700;
    color: var(--ink);
}
.scanner-steps li { display: inline-flex; align-items: center; gap: 28px; }
.scanner-steps li + li::before { content: ''; width: 20px; height: 1px; background: var(--gold); }
.scanner-note { margin-top: 18px; font-size: 0.92rem; color: var(--muted); max-width: 46ch; }
.scanner-shot {
    align-self: end;
    justify-self: center;
    width: min(340px, 100%);
    aspect-ratio: 720 / 1180;
    border-radius: 11% 11% 0 0 / 6.7% 6.7% 0 0;
    object-fit: cover;
    object-position: top;
    box-shadow: var(--shadow-device);
}

/* ============================ Why: the promise ============================ */
.why-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
}
.why-lead { position: sticky; top: calc(var(--nav-h) + 40px); }
.why-lead h2 { font-size: clamp(2rem, 4.2vw, 3.3rem); }
.why-lead p { margin-top: 10px; font-size: 1.15rem; max-width: 34ch; }
.promises { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 56px); }
.promises li { padding-block: 26px 30px; border-top: 1px solid var(--line-strong); }
.promises h3 { font-size: 1.28rem; }
.promises p { margin-top: 4px; font-size: 1.06rem; }
.promises .text-link { margin-top: 12px; font-size: 0.95rem; }

/* ============================ Closing: hadith + download + footer ============================ */
.closing {
    position: relative;
    background: var(--navy-700);
    color: var(--on-navy-2);
    overflow: hidden;
    isolation: isolate;
}
.closing::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background: url('topo.webp') center / cover;
    opacity: 0.5;
}
.closing :focus-visible { outline-color: var(--cream); }

.hadith {
    padding-block: var(--section) clamp(56px, 7vw, 96px);
    text-align: center;
}
.hadith blockquote {
    max-width: 18ch;
    margin-inline: auto;
    font-family: var(--font-display);
    font-feature-settings: var(--display-features);
    font-weight: 700;
    font-size: clamp(1.9rem, 4.7vw, 3.7rem);
    line-height: 1.9;
    color: var(--on-navy);
    text-wrap: balance;
}
.hadith figcaption { margin-top: 12px; font-weight: 700; color: var(--gold-soft); }

.download {
    padding-block: clamp(48px, 6vw, 80px) var(--section);
    text-align: center;
}
.download-inner {
    max-width: 680px;
    margin-inline: auto;
    padding-top: clamp(48px, 6vw, 80px);
    border-top: 1px solid var(--line-navy);
}
.download h2 { color: var(--on-navy); font-size: clamp(1.8rem, 3.7vw, 2.7rem); }
.download p { margin-top: 8px; font-size: 1.15rem; }
.download-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

.footer {
    background: var(--navy-900);
    color: var(--on-navy-2);
    padding-block: 64px 32px;
}
.footer :focus-visible { outline-color: var(--cream); }
.footer-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px 64px;
    padding-bottom: 44px;
    border-bottom: 1px solid var(--line-navy);
}
.footer-brand { max-width: 340px; }
.footer-brand .brand .name { color: var(--on-navy); font-size: 2.3rem; }
.footer-brand p { margin-top: 10px; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 32px 72px; }
.footer-col h4 {
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--gold-soft);
    margin-bottom: 12px;
}
.footer-col a { display: block; padding: 5px 0; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--on-navy); }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    padding-top: 28px;
    font-size: 0.92rem;
}
.footer-min .footer-bottom { padding-top: 0; }
.footer-min { padding-block: 28px; }

/* Developer credit (owwwais) */
.dev-credit {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 16px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line-navy);
    font-size: 0.86rem;
    font-weight: 500;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}
.dev-credit:hover { background: rgba(246, 242, 233, 0.08); border-color: rgba(246, 242, 233, 0.4); }
.dev-credit .dev-logo { display: inline-flex; align-items: center; height: 20px; }
/* Force the logo to render pure white on the dark footer, whatever its own colors are. */
.dev-credit .dev-logo img { height: 20px; width: auto; filter: brightness(0) invert(1); }
.dev-credit .dev-name { color: var(--on-navy); font-weight: 700; }

/* ============================ Scroll reveal ============================ */
.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js .reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* ============================ Forms (shared) ============================ */
.field { margin-bottom: 22px; }
.field > label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--ink);
}
.field > label small { font-weight: 400; font-size: 0.86rem; color: var(--muted); }
.field .req { color: var(--gold-ink); }

.input-wrap { position: relative; }
.input-wrap input,
.input-wrap textarea {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-input);
    padding: 14px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-wrap textarea { min-height: 140px; resize: vertical; line-height: 1.8; }
.input-wrap input::placeholder,
.input-wrap textarea::placeholder { color: #7b8797; }
.input-wrap input:hover,
.input-wrap textarea:hover { border-color: var(--navy-500); }
.input-wrap input:focus,
.input-wrap textarea:focus {
    outline: none;
    border-color: var(--navy-700);
    box-shadow: 0 0 0 4px rgba(27, 58, 92, 0.14);
}
input[dir="ltr"] { text-align: left; }

.hint { display: block; margin-top: 8px; font-size: 0.88rem; color: var(--muted); }
.err { display: none; margin-top: 8px; font-size: 0.88rem; font-weight: 500; color: var(--danger); }
.field.invalid .err { display: block; }
.field.invalid .input-wrap input,
.field.invalid .input-wrap textarea { border-color: var(--danger); background: var(--danger-bg); }

/* Choice chips (device, feedback category) */
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-grid input { position: absolute; opacity: 0; pointer-events: none; }
.choice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 10px 14px;
    border-radius: var(--r-input);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    font-weight: 700;
    color: var(--body);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.choice i { font-size: 1.15rem; }
.choice:hover { border-color: var(--navy-500); }
.choice-grid input:checked + .choice {
    border-color: var(--navy-700);
    background: var(--navy-700);
    color: var(--cream);
}
.choice-grid input:focus-visible + .choice { box-shadow: 0 0 0 4px rgba(27, 58, 92, 0.2); }

/* Submit button states (class names shared with the form scripts) */
.submit-btn { width: 100%; margin-top: 4px; }
.submit-btn .btn-label { display: inline-flex; align-items: center; gap: 10px; }
.submit-btn .btn-spinner { display: none; }
.submit-btn.loading { pointer-events: none; opacity: 0.8; }
.submit-btn.loading .btn-label { display: none; }
.submit-btn.loading .btn-spinner { display: inline-flex; align-items: center; gap: 10px; }

.form-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--muted);
}
.form-error {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 13px 16px;
    border-radius: var(--r-input);
    background: var(--danger-bg);
    border: 1px solid rgba(179, 57, 45, 0.3);
    color: var(--danger);
    font-size: 0.94rem;
    font-weight: 500;
}
.form-error.show { display: flex; }

.form-card {
    background: var(--surface);
    border-radius: var(--r-tile);
    padding: clamp(24px, 4vw, 44px);
    box-shadow: var(--shadow-md);
}
.form-success { text-align: center; padding: 20px 4px; animation: success-in 0.5s var(--ease) both; }
.form-success[hidden] { display: none; }
.success-mark {
    width: 64px;
    height: 64px;
    margin: 0 auto 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--navy-700);
    color: var(--cream);
    font-size: 1.5rem;
}
.form-success h2 { font-size: 1.55rem; }
.form-success p { max-width: 40ch; margin: 10px auto 26px; }
.form-success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
@keyframes success-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* ============================ Inner pages ============================ */
.page-hero { padding-block: clamp(48px, 7vw, 96px) clamp(32px, 4vw, 56px); }
.page-hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.9rem); }
.page-hero .lead { margin-top: 10px; font-size: clamp(1.1rem, 1.6vw, 1.3rem); max-width: 52ch; }
.page-hero .updated { margin-top: 8px; font-size: 0.95rem; color: var(--muted); }
.page-kicker { display: inline-block; margin-bottom: 6px; font-weight: 700; color: var(--gold-ink); }

/* Privacy */
.policy { padding-bottom: var(--section); }
.policy-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
}
.policy-summary {
    position: sticky;
    top: calc(var(--nav-h) + 32px);
    padding: clamp(26px, 3vw, 36px);
    border-radius: var(--r-tile);
    background: var(--navy-700);
    color: var(--on-navy-2);
}
.policy-summary h2 { font-size: 1.35rem; color: var(--on-navy); }
.policy-summary ul { margin-top: 18px; }
.policy-summary li {
    display: flex;
    gap: 12px;
    padding-block: 12px;
    border-top: 1px solid var(--line-navy);
    color: var(--on-navy);
    font-weight: 500;
}
.policy-summary li i { margin-top: 7px; font-size: 0.85rem; color: var(--gold-soft); }
.policy-lead {
    font-family: var(--font-display);
    font-feature-settings: var(--display-features);
    font-weight: 700;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    line-height: 1.9;
    color: var(--ink);
    padding-bottom: 36px;
}
.policy-section { padding-block: 30px 34px; border-top: 1px solid var(--line-strong); }
.policy-section h2 { font-size: 1.4rem; margin-bottom: 8px; }
.policy-section p { max-width: 62ch; }
.policy-section ul { display: grid; gap: 8px; max-width: 62ch; }
.policy-section ul li { position: relative; padding-inline-start: 22px; }
.policy-section ul li::before {
    content: '';
    position: absolute;
    inset-inline-start: 2px;
    top: 0.85em;
    width: 7px;
    height: 7px;
    background: var(--gold);
    transform: rotate(45deg);
}
.policy-outro { padding-top: 30px; border-top: 1px solid var(--line-strong); color: var(--ink); font-weight: 500; max-width: 62ch; }

.contact { padding-bottom: var(--section); }
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
}
.contact-grid h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.contact-grid .contact-intro p { margin-top: 12px; max-width: 34ch; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-status {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 13px 16px;
    border-radius: var(--r-input);
    font-size: 0.94rem;
    font-weight: 500;
}
.form-status.ok { display: flex; background: var(--navy-50); color: var(--ink); border: 1px solid var(--navy-100); }
.form-status.fail { display: flex; background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(179, 57, 45, 0.3); }

/* 404 */
.lost {
    min-height: calc(100dvh - var(--nav-h) - 90px);
    display: grid;
    place-items: center;
    text-align: center;
    padding-block: 64px;
}
.lost-code {
    font-family: var(--font-display);
    font-feature-settings: var(--display-features);
    font-weight: 900;
    font-size: clamp(6rem, 22vw, 13rem);
    line-height: 1;
    color: var(--navy-100);
}
.lost h1 { font-size: clamp(1.8rem, 4.2vw, 2.7rem); margin-top: 8px; }
.lost p { margin: 14px auto 30px; max-width: 40ch; font-size: 1.12rem; }

.page-shell { display: flex; flex-direction: column; min-height: 100dvh; }
.page-shell main { flex: 1; }

/* ============================ Responsive ============================ */
@media (max-width: 1020px) {
    .tile-library { grid-column: span 12; grid-row: auto; }
    .tile-names, .tile-tasbih { grid-column: span 6; }
    .tile-dua { grid-column: span 12; }
    .tile-qibla, .tile-hijri { grid-column: span 6; }
    .tile-tasbih { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .nav-links {
        position: fixed;
        inset: 0;
        z-index: 101;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: calc(var(--nav-h) + 24px) var(--gutter) 32px;
        background: var(--paper);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px);
        transition: opacity 0.3s ease, transform 0.4s var(--ease), visibility 0.3s;
        overflow-y: auto;
    }
    .nav-links.open { opacity: 1; visibility: visible; transform: none; }
    .nav-links a:not(.btn) {
        padding: 18px 4px;
        border-radius: 0;
        border-bottom: 1px solid var(--line);
        font-family: var(--font-display);
        font-feature-settings: var(--display-features);
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--ink);
    }
    .nav-links a:not(.btn):hover { background: none; }
    .nav-cta { margin: 28px 0 0; min-height: 54px; font-size: 1rem; }
    body.menu-open { overflow: hidden; }
    .navbar:has(.nav-links.open) { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--paper); }

    /* Story: each moment becomes its own tile with its own sky */
    .story-grid { grid-template-columns: 1fr; }
    .story-stage { display: none; }
    .story-steps { display: grid; gap: 20px; }
    .story-step {
        min-height: 0;
        opacity: 1;
        padding: 30px 26px 0;
        border-radius: var(--r-tile);
        overflow: hidden;
    }
    .story-step:nth-child(1) { background: linear-gradient(180deg, #d5e0ec 0%, #ecdfd0 100%); }
    .story-step:nth-child(2) { background: linear-gradient(180deg, #f6e9c9 0%, #fbf5e6 100%); }
    .story-step:nth-child(3) { background: linear-gradient(180deg, #dfe9f1 0%, #f3f5f2 100%); }
    .story-step:nth-child(4) { background: linear-gradient(180deg, #e2d3d6 0%, #f1dcc5 100%); }
    .story-step:nth-child(5) { background: linear-gradient(180deg, #10253c 0%, #1e3f63 100%); }
    .story-step:nth-child(5) h3 { color: var(--on-navy); }
    .story-step:nth-child(5) p { color: var(--on-navy-2); }
    .story-step:nth-child(5) .story-time { color: var(--gold-soft); }
    .story-inline {
        display: block;
        width: min(270px, 78%);
        margin: 30px auto 0;
        aspect-ratio: 720 / 980;
        border-radius: 11% 11% 0 0 / 8.1% 8.1% 0 0;
        object-fit: cover;
        object-position: top;
        box-shadow: var(--shadow-device);
    }

    .scanner-card { grid-template-columns: 1fr; }
    .scanner-text { padding-bottom: 0; }
    .scanner-shot { width: min(280px, 80%); aspect-ratio: 720 / 1000; border-radius: 11% 11% 0 0 / 7.9% 7.9% 0 0; }

    .why-grid { grid-template-columns: 1fr; }
    .why-lead { position: static; }

    .policy-grid, .contact-grid { grid-template-columns: 1fr; }
    .policy-summary { position: static; }
}

@media (max-width: 620px) {
    body { font-size: 1rem; }
    .hero-actions .btn, .download-actions .btn { width: 100%; }
    .hero-devices { --main: 58vw; height: calc(var(--main) * 1.35); }
    .bento { gap: 14px; }
    .tile-names, .tile-tasbih { grid-column: span 12; }
    .tile-qibla, .tile-hijri { grid-column: span 6; padding: 22px; }
    .hijri-day { font-size: 3.2rem; }
    .tile-names { min-height: 260px; }
    .tile-tasbih { flex-direction: row; align-items: center; }
    .promises { grid-template-columns: 1fr; }
    .scanner-steps li + li::before { display: none; }
    .scanner-steps { flex-direction: column; gap: 6px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .js .reveal { opacity: 1; transform: none; }
}
