/* MyDeen site. Kinetic: type that moves with the scroll, a sky that turns through the day, a page
   that slides sideways, a compass that settles. The app icon's navy and gold, the mushaf's cream, serif
   headlines with one word in gold italic. Flat: no glows, no shadows, no borders around containers. */

@font-face {
  font-family: 'Fraunces';
  src: url('./fonts/fraunces-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('./fonts/fraunces-600-italic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --navy: #1d1d35;
  --deep: #15152a;
  --night: #0f0f22;
  --card: #26264a;
  --page: #f4ecdc;
  --page-2: #ebe0c9;
  --hair: rgba(244, 238, 226, 0.12);
  --text: #f4eee2;
  --text-2: #b4b0c8;
  --text-3: #8f8ba6;
  --gold: #e0b157;
  --gold-hi: #ebc274;
  --ink: #2a2433;
  --ink-2: #6b6170;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --arabic: 'Geeza Pro', 'Noto Naskh Arabic', 'Segoe UI', serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--deep);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
main { overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
em { font-style: italic; color: var(--gold); }
.eyebrow { margin: 0 0 18px; font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.big { font-size: clamp(44px, 6.4vw, 96px); line-height: 0.98; }
.huge { font-size: clamp(52px, 9vw, 140px); line-height: 0.95; }
.body { max-width: 34em; margin: 24px 0 0; font-size: 19px; color: var(--text-2); text-wrap: pretty; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 40; padding: 10px 16px; background: var(--gold); color: var(--navy); border-radius: 10px; }
.skip:focus { left: 16px; }

/* Nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 30; transition: background 0.3s, transform 0.4s var(--ease); }
.nav.scrolled { background: var(--deep); box-shadow: 0 1px 0 var(--hair); }
.nav.away { transform: translateY(-100%); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-weight: 600; font-size: 21px; text-decoration: none; }
.brand img { border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-text { color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; padding: 12px 0; }
.nav-text:hover { color: var(--text); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 22px; border-radius: 999px;
  background: var(--gold); color: var(--deep); font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.btn:hover { background: var(--gold-hi); transform: translateY(-2px); }
.btn:active { transform: scale(0.98); }
.btn-store { min-height: 58px; padding: 0 30px; font-size: 17px; }
.btn-store svg { width: 18px; height: 18px; }

/* A phone: the screenshot in a dark body with a thin rim. */
.phone { position: relative; padding: 2.6%; border-radius: 15% / 7%; background: #0b0b14; box-shadow: 0 0 0 2px #34324f; }
.phone img { width: 100%; height: auto; border-radius: 12.5% / 5.8%; }

/* Stars, drawn by script into any .stars box */
.stars, .day-stars { position: absolute; inset: 0; pointer-events: none; }
.stars i, .day-stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: var(--text); animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: 0.25; } }

/* Hero */
.hero { position: relative; min-height: 100svh; padding: 96px 0 0; background: linear-gradient(var(--night), var(--navy)); display: flex; flex-direction: column; }
.hero-grid { flex: 1; display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 48px; align-items: center; }
.hero-title { font-size: clamp(56px, min(8.6vw, 14vh), 136px); line-height: 0.92; letter-spacing: -0.04em; }
/* Room inside each masked line for descenders and the italic's overhang, so the mask never clips them. */
.hero-title .line { display: block; overflow: hidden; padding: 0 0.12em 0.16em 0; margin-bottom: -0.1em; }
.hero-title .line > * { display: inline-block; }
.rise { opacity: 0; transform: translateY(60%); animation: rise 1s var(--ease) forwards; animation-delay: calc(var(--d) * 90ms + 150ms); }
.hero-title .rise { transform: translateY(105%); opacity: 1; }
@keyframes rise { to { opacity: 1; transform: none; } }
.rotator { height: 1.25em; overflow: hidden; margin: 28px 0 40px; font-family: var(--display); font-style: italic; font-size: clamp(26px, 3vw, 40px); color: var(--gold); line-height: 1.25; }
.rot-track { display: block; animation: rotate 10s var(--ease) infinite; animation-delay: 1.6s; }
.rot-track span { display: block; height: 1.25em; }
@keyframes rotate {
  0%, 20% { transform: translateY(0); }
  25%, 45% { transform: translateY(-1.25em); }
  50%, 70% { transform: translateY(-2.5em); }
  75%, 95% { transform: translateY(-3.75em); }
  100% { transform: translateY(-5em); }
}
.hero-phone { justify-self: center; width: min(300px, 100%, 34vh); }
.hero-phone .phone { transition: transform 0.6s var(--ease); }

/* Marquee: a band that runs on its own and speeds up with the scroll */
.marquee { overflow: hidden; white-space: nowrap; user-select: none; }
.marquee-track { display: inline-flex; align-items: center; gap: 0; will-change: transform; }
.hero .marquee { margin-top: 40px; padding: 20px 0; border-top: 1px solid var(--hair); }
.hero .marquee span { font-family: var(--display); font-size: clamp(36px, 5vw, 64px); letter-spacing: -0.02em; color: var(--text); padding: 0 0.4em; }
.hero .marquee b { font-family: var(--arabic); font-weight: 400; font-size: clamp(28px, 4vw, 48px); color: var(--gold); padding: 0 0.4em; }
.hero .marquee b::after { content: ''; display: inline-block; width: 0.28em; height: 0.28em; margin-left: 0.9em; vertical-align: middle; background: var(--text-3); transform: rotate(45deg); }

/* A day, scrolled: the sky turns from Fajr to Isha */
.day { position: relative; height: 640vh; }
.day-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; color: var(--sky-ink, var(--text)); transition: color 0.6s; }
.sky { position: absolute; inset: 0; background: linear-gradient(var(--sky-top, #121230), var(--sky-bot, #3a3460)); }
.sun, .moon { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform, opacity; }
.sun { width: clamp(70px, 9vw, 120px); aspect-ratio: 1; background: #f6d98f; }
.moon { width: clamp(44px, 5vw, 70px); aspect-ratio: 1; background: transparent; box-shadow: inset -14px 6px 0 0 #ece6f6; transform: rotate(-20deg); }
.hills { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 38%; }
.hills .h1 { fill: var(--hill-1, #2c2850); }
.hills .h2 { fill: var(--hill-2, #221f40); }
.day .skyline { position: absolute; left: 50%; bottom: 0; transform: translateX(-20%); width: max(720px, 70vw); height: auto; }
.mosque { fill: #15142a; }
.windows { fill: var(--gold); transition: opacity 0.6s; }
.day-copy { position: relative; z-index: 2; padding-top: 18vh; }
.day-copy .eyebrow { color: currentColor; opacity: 0.75; }
.names { position: relative; height: clamp(220px, 32vh, 360px); }
.name { position: absolute; inset: 0; pointer-events: none; }
.name h2 { font-size: clamp(76px, 14vw, 220px); line-height: 0.9; letter-spacing: -0.045em; padding-bottom: 0.08em; }
.name h2, .name p { transform: translateY(40px); opacity: 0; transition: transform 0.7s var(--ease), opacity 0.5s; }
.name.is-on h2, .name.is-on p { transform: none; opacity: 1; }
.name.is-on .time { transition-delay: 0.08s; }
.name.is-on .note { transition-delay: 0.16s; }
.name.was h2, .name.was p { transform: translateY(-40px); }
.time { margin: 14px 0 0; font-size: clamp(22px, 2.4vw, 32px); font-weight: 600; font-variant-numeric: tabular-nums; }
.note { margin: 8px 0 0; max-width: 26em; font-size: 18px; opacity: 0.85; }
.rail { position: absolute; z-index: 2; right: 32px; top: 50%; transform: translateY(-50%); list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; text-align: right; font-size: 14px; font-weight: 600; letter-spacing: 0.06em; }
.rail li { opacity: 0.4; transition: opacity 0.3s, transform 0.4s var(--ease); }
.rail li.is-on { opacity: 1; transform: translateX(-8px); }

/* Athan */
.athan { background: var(--deep); padding: 160px 0; }
.athan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.wave { display: flex; align-items: center; gap: 5px; height: 240px; }
.wave i { flex: 1; min-width: 3px; border-radius: 999px; background: var(--gold); height: 8%; transform-origin: center; will-change: height; }
.wave i:nth-child(3n) { background: var(--text-2); }

/* Quran: the page slides sideways */
.quran { position: relative; height: 420vh; background: var(--page); color: var(--ink); }
.quran-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 72px 0 24px; }
.quran-head .big { font-size: clamp(40px, min(6vw, 8.5vh), 88px); }
.quran-ghost { position: absolute; top: 50%; left: 0; transform: translateY(-50%); white-space: nowrap; font-family: var(--display); font-style: italic; font-size: clamp(140px, 22vw, 360px); letter-spacing: -0.05em; color: var(--page-2); pointer-events: none; will-change: transform; }
.quran-head { position: relative; }
.quran-head .eyebrow { color: #9a7428; }
.quran em, .goals em { color: #a8781e; }
.quran-track { position: relative; display: flex; gap: clamp(32px, 5vw, 80px); padding: clamp(16px, 3vh, 40px) 0 0 max(32px, calc((100vw - 1240px) / 2 + 32px)); will-change: transform; }
/* The phone is sized from the window's height as well as its width, so the heading, the phone and its
   caption always fit inside the pinned frame. */
.panel { flex: 0 0 auto; width: clamp(140px, min(22vw, calc((100svh - 420px) / 2.3)), 290px); margin: 0; }
.panel .phone { box-shadow: none; }
.panel figcaption { margin-top: 20px; font-size: 16px; color: var(--ink-2); }
.panel figcaption strong { display: block; font-family: var(--display); font-size: 22px; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 4px; }

/* Goals */
.goals { background: var(--page); color: var(--ink); padding: 80px 0 180px; }
.goals .body { color: var(--ink-2); }
.goals .eyebrow { color: #9a7428; }
.goals-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 80px; align-items: center; }
.ring-wrap { position: relative; width: min(420px, 100%); justify-self: center; }
.ring { width: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 18; }
.ring-bg { stroke: var(--page-2); }
.ring-fg { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 527.8; stroke-dashoffset: 527.8; }
.ring-count { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.count { font-family: var(--display); font-size: clamp(80px, 10vw, 140px); line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.ring-count small { font-size: 15px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }

/* Qibla */
.qibla { position: relative; height: 260vh; background: var(--night); }
.qibla-stage { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; overflow: hidden; }
.qibla-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.compass-wrap { position: relative; width: min(500px, 100%); justify-self: center; }
.compass .rim { fill: none; stroke: var(--text-3); stroke-width: 2.5; transition: stroke 0.5s; }
.compass .pointer { fill: var(--text-3); transition: fill 0.5s; }
.compass.aligned .rim { stroke: var(--gold); }
.compass.aligned .pointer { fill: var(--gold); }
.dial { will-change: transform; }
.dial line { stroke: var(--text-3); stroke-width: 1.2; }
.dial line.major { stroke: var(--text); stroke-width: 2; }
.dial text { fill: var(--text-2); font: 600 13px var(--body); text-anchor: middle; dominant-baseline: middle; }
.dial text.cardinal { fill: var(--text); font-size: 18px; }
.dial text.north { fill: #d98a8a; }
.dial .kaaba { fill: var(--text-3); transition: fill 0.5s; }
.compass.aligned .kaaba { fill: var(--gold); }
.compass-read { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.deg { font-family: var(--display); font-size: clamp(56px, 7vw, 92px); line-height: 1; color: var(--text-2); transition: color 0.5s; font-variant-numeric: tabular-nums; }
.state { margin-top: 6px; font-size: 15px; color: var(--text-3); }
.compass-wrap.aligned .deg { color: var(--gold); }
.compass-wrap.aligned .state { color: var(--text-2); }

/* Calendar */
.calendar { background: var(--navy); padding: 160px 0 140px; }
.calendar .big { max-width: 13em; margin-bottom: 56px; }
.cal-row { padding: 8px 0; }
.day-card { display: inline-grid; grid-template-columns: auto repeat(6, auto); align-items: center; gap: 0 22px; margin-right: 16px; padding: 18px 26px; border-radius: 22px; background: var(--card); font-variant-numeric: tabular-nums; }
.day-card .d { display: grid; line-height: 1.2; min-width: 92px; }
.day-card .d b { font-family: var(--display); font-size: 26px; color: var(--text); }
.day-card .d b small { margin-left: 6px; font: 600 14px var(--body); color: var(--text-2); }
.day-card .d span { font-size: 13px; color: var(--text-3); }
.day-card .t { display: grid; text-align: center; font-size: 19px; color: var(--text); }
.day-card .t small { font-size: 11px; letter-spacing: 0.06em; color: var(--text-3); text-transform: uppercase; }
.day-card.today .d b { color: var(--gold); }
.cal-note { margin-top: 40px; }

/* Promise: three lines that slide in from alternate sides */
.promise { background: var(--deep); padding: 140px 0; overflow: hidden; }
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.promises li { display: flex; align-items: baseline; justify-content: center; gap: 28px; white-space: nowrap; will-change: transform; }
.promises strong { font-family: var(--display); font-weight: 600; font-size: clamp(64px, 12vw, 190px); line-height: 1; letter-spacing: -0.045em; }
.promises li:nth-child(2) strong { font-style: italic; color: var(--gold); }
.promises span { font-size: 18px; color: var(--text-2); white-space: normal; max-width: 12em; }

/* Questions */
.questions { background: var(--navy); padding: 160px 0; }
.two { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 64px; align-items: start; }
.faq details { border-bottom: 1px solid var(--hair); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 64px; padding: 20px 0; font-family: var(--display); font-size: 23px; letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; flex: none; width: 14px; height: 14px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: translateY(-4px) rotate(45deg); transition: transform 0.3s var(--ease); }
.faq details[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.faq details p { margin: 0 0 24px; color: var(--text-2); max-width: 36em; }

/* Closing */
.closing { background: linear-gradient(var(--navy), var(--night)); padding: 160px 0; text-align: center; }
.closing-inner { display: flex; flex-direction: column; align-items: center; gap: 40px; }
.closing-icon { border-radius: 22px; }

/* Footer */
.footer { background: var(--night); padding: 36px 0 48px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-links { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; font-size: 15px; }
.footer-links a { display: inline-block; padding: 12px 0; color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.copy { margin: 0; color: var(--text-3); font-size: 14px; }

/* Legal pages */
.legal { max-width: 720px; margin: 0 auto; padding: 128px 24px 96px; }
.legal h1 { font-size: clamp(36px, 6vw, 52px); line-height: 1.08; }
.legal .updated { margin: 10px 0 36px; color: var(--text-3); font-size: 15px; }
.legal h2 { margin: 40px 0 10px; font-family: var(--body); font-size: 20px; letter-spacing: 0; }
.legal p, .legal li { color: var(--text-2); }
.legal strong { color: var(--text); }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 8px; }

@media (max-width: 900px) {
  .wrap { padding: 0 20px; }
  .hero { padding-top: 100px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-phone { width: min(260px, 70%); }
  .athan-grid, .qibla-grid, .goals-grid, .two { grid-template-columns: 1fr; gap: 48px; }
  .wave { height: 160px; }
  .rail { display: none; }
  .day-copy { padding-top: 14vh; }
  .quran-track { padding-left: 20px; }
  .panel { width: clamp(140px, min(62vw, calc((100svh - 400px) / 2.3)), 280px); }
  .panel figcaption { font-size: 15px; }
  .panel figcaption strong { font-size: 19px; }
  .promises li { flex-direction: column; align-items: center; gap: 4px; text-align: center; }
  .promises span { max-width: none; }
  .qibla-stage { align-items: flex-start; padding-top: 84px; }
  .qibla-grid { gap: 28px; }
  .qibla .body { font-size: 16px; margin-top: 16px; }
  .compass-wrap { width: clamp(200px, min(86vw, calc(100svh - 470px)), 340px); }
  .athan, .calendar, .questions, .closing { padding: 112px 0; }
}
@media (max-width: 560px) {
  .nav-text { display: none; }
  .body { font-size: 17px; }
  .day .skyline { width: 640px; transform: translateX(-35%); }
  .qibla { height: 200vh; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { animation: none; opacity: 1; transform: none; }
  .hero-title .rise { transform: none; }
  .rot-track { animation: none; }
  .stars i, .day-stars i { animation: none; }
}
