/* The home page story: one fixed 3D scene, text written straight onto it.
   Same family as shajarahlabs.com and masarquran.com: Newsreader 300 at large sizes, small spaced capitals, gold, grain. */

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body.story { background: #0B1517; }
body.story.loading { overflow: hidden; }

#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
.story .veil { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 42%, transparent 38%, rgba(5, 10, 11, .78) 100%); }
.grain {
  position: fixed; inset: -50%; z-index: 2; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@media (pointer: coarse), (max-width: 900px) { .grain { display: none; } }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); } 60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }
.story main, .story .site-foot { position: relative; z-index: 3; }

/* loader */
#loader { position: fixed; inset: 0; z-index: 100; background: #0B1517; display: grid; place-items: center; transition: opacity 1.4s var(--ease), visibility 1.4s; }
#loader.done { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; padding: 0 24px; }
.loader-mark { display: block; width: clamp(132px, 20vw, 190px); height: auto; margin: 0 auto 26px; opacity: 0; animation: rise 1.8s var(--ease) .2s forwards; }
.loader-bar { width: 180px; height: 1px; margin: 0 auto; background: var(--night-line); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: var(--p, 0%); background: var(--gold); transition: width .4s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* type */
.story .eyebrow { font-size: 11.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin: 0 0 22px; font-weight: 600; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.num { font-family: var(--display); font-size: 13px; letter-spacing: .1em; display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--hair); border-radius: 50%; color: var(--gold-hi); }
.story h2 { font-family: var(--display); font-weight: 300; font-size: clamp(36px, 4.6vw, 68px); line-height: 1.02; letter-spacing: -.02em; margin: 0 0 26px; }
.story h2 em, .story h1 em { color: var(--gold-hi); }
.story-text p, .lede { color: var(--moon); opacity: .86; font-size: clamp(17px, 1.3vw, 19.5px); }
.lede.dim, .story-text .muted-s { color: var(--moon-muted); opacity: 1; }
.muted-s { font-size: 15px !important; }

/* split headings: each word rises from a mask */
.split .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding: .1em .1em .26em 0; margin: -.1em -.1em -.26em 0; }
.split .w > span { display: inline-block; transform: translateY(130%); transition: transform 1.3s var(--ease); transition-delay: calc(var(--i) * 55ms); }
.split.in .w > span { transform: none; }

/* hero: the display above, the name and the promise below */
.ch-hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; justify-content: center; text-align: center; padding: 0 0 4vh; position: relative; }
.hero-copy { max-width: 1000px; text-align: center; }
.hero-copy .eyebrow { justify-content: center; margin-bottom: 6px; }
.hero-ar { font-family: var(--arabic); color: var(--gold); font-size: clamp(34px, 3.6vw, 52px); line-height: 1.4; margin: 0; text-shadow: 0 0 40px rgba(212, 174, 85, .35); }
.ch-hero h1 { font-family: var(--display); font-weight: 300; font-size: clamp(40px, 5.6vw, 88px); line-height: .98; letter-spacing: -.035em; margin: 0 0 18px; }
.hero-tag { font-family: var(--display); font-weight: 300; font-size: clamp(16px, 1.4vw, 20px); color: var(--moon-muted); margin: 0 auto 22px; max-width: 36em; }
.hero-copy .ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-rise { opacity: 0; transform: translateY(16px); transition: opacity 1.6s var(--ease), transform 1.6s var(--ease); }
body.ready .hero-rise { opacity: 1; transform: none; }
body.ready .hero-rise:nth-child(2) { transition-delay: 2.3s; }
body.ready .hero-rise:nth-child(3) { transition-delay: 2.6s; }
/* the name arrives after the light has gathered: out of a soft blur, settling from a touch larger */
.ch-hero h1 { opacity: 0; filter: blur(14px); transform: scale(1.04); transition: opacity 1.8s cubic-bezier(.2, .7, .1, 1), filter 2.2s cubic-bezier(.2, .7, .1, 1), transform 2.6s cubic-bezier(.2, .7, .1, 1); }
.ch-hero h1.in { opacity: 1; filter: none; transform: none; }
.ch-hero h1 .w > span { transition-duration: 1.6s; }
.scroll-cue { margin-top: 22px; font-size: 10.5px; letter-spacing: .34em; text-transform: uppercase; color: var(--moon-muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* The cue sits at the foot of the first screen (the hero itself is taller than one screen on wide layouts). */
.ch-hero .scroll-cue { position: absolute; left: 0; right: 0; margin-top: 0; top: calc(98vh - 62px); top: calc(100svh - 2vh - 62px); }
.scroll-cue span { width: 1px; height: 30px; background: linear-gradient(to bottom, transparent, var(--gold)); animation: cue 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.ch-hero .hero-copy { padding-bottom: 4vh; }

/* chapters: text on one side, the scene on the other, no boxes */
.ch { min-height: 130vh; display: flex; align-items: center; padding: 14vh 0; }
.ch-day { display: block; min-height: 0; padding: 0; }
.ch-day .moment { min-height: 105vh; display: flex; align-items: center; }
.ch-day .moment:first-child { padding-top: 10vh; }
.ch-day .moment:last-child { min-height: 120vh; }
.two { display: grid; grid-template-columns: minmax(0, 560px) 1fr; gap: clamp(24px, 6vw, 100px); width: 100%; max-width: none; padding: 0 var(--gutter); }
.two.right { grid-template-columns: 1fr minmax(0, 560px); }
@media (min-width: 1101px) { .two.right .story-text { margin-right: clamp(0px, 13vw, 230px); } }
.story-text { position: relative; text-shadow: 0 2px 30px rgba(5, 10, 11, .9); opacity: 0; transform: translateY(40px); transition: opacity 1.3s var(--ease), transform 1.3s var(--ease); }
.story-text::before { content: none; position: absolute; inset: -80px -110px; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(8, 15, 16, .74), rgba(8, 15, 16, 0)); }
.story-text.in { opacity: 1; transform: none; }
.proof { font-size: 14.5px !important; border-left: 1px solid var(--emerald); padding-left: 14px; color: var(--moon-muted) !important; opacity: 1 !important; margin-top: 18px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-hi); text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 4px; cursor: pointer; font-size: 15px; }

.stats { list-style: none; padding: 0; margin: 26px 0 26px; display: flex; flex-wrap: wrap; gap: 14px 44px; }
.stats li { display: flex; flex-direction: column; }
.stats b { font-family: var(--display); font-weight: 200; font-size: clamp(40px, 4.2vw, 62px); line-height: 1; letter-spacing: -.03em; font-variant-numeric: lining-nums tabular-nums; color: var(--moon); }
.stats span { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin-top: 8px; }

.times { list-style: none; padding: 0; margin: 10px 0 0; display: grid; border-top: 1px solid var(--hair); }
.times li { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid rgba(212, 174, 85, .12); }
.times .nm { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--moon-muted); font-weight: 600; }
.times .ar { font-family: var(--arabic); color: var(--gold); font-size: 20px; }
.times .t { font-family: var(--display); font-weight: 300; font-size: 26px; font-variant-numeric: tabular-nums; min-width: 6em; text-align: right; color: var(--moon); }
.times li.next .nm, .times li.next .t { color: var(--gold-hi); }
.times li.next .nm::after { content: 'next'; margin-left: 10px; font-size: 10px; letter-spacing: .14em; color: #0B1517; background: var(--emerald); padding: 3px 8px; border-radius: 999px; font-weight: 700; vertical-align: 2px; }
.times li.sun { opacity: .72; }

.vows { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 0; border-left: 1px solid var(--hair); }
.vows li { position: relative; padding: 13px 0 13px 24px; color: var(--moon-muted); font-size: 17px; }
.vows li::before { content: ''; position: absolute; left: -4px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 12px var(--emerald); }
.vows b { color: var(--moon); font-weight: 600; }

.buy .buy-line { display: flex; align-items: center; gap: 22px; margin: 26px 0 16px; flex-wrap: wrap; }
.buy .price { font-family: var(--display); font-weight: 300; font-size: 46px; letter-spacing: -.02em; }
.buy .btn { flex: 1; min-width: 200px; }

.after { position: relative; z-index: 3; background: linear-gradient(180deg, transparent, var(--night) 22%); }
.after h2 { font-size: clamp(34px, 4vw, 56px); }
.fallback { display: none; }
body.no-gl .fallback { display: block; margin-top: 20px; }
body.no-gl .story-text, body.no-gl .split .w > span, body.no-gl .hero-rise, body.no-gl .ch-hero h1 { opacity: 1; transform: none; filter: none; }

/* chapter rail: names on the right, Arabic numerals, the current one in gold */
.rail { position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: 16px; opacity: 0; visibility: hidden; transition: opacity .6s, visibility .6s; }
.rail.on { opacity: 1; visibility: visible; }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-decoration: none; font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--moon-muted); opacity: .32; transition: opacity .5s, color .5s; }
.rail a i { font-style: normal; font-family: var(--arabic); font-size: 17px; letter-spacing: 0; width: 18px; text-align: center; }
.rail a span { white-space: nowrap; }
.rail a:hover, .rail a:focus-visible { opacity: .8; }
.rail a.on { opacity: 1; color: var(--gold); }
body.no-gl .rail { display: none; }
@media (max-width: 1100px) { .rail { display: none; } }

.node-labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; transition: opacity .4s; }
.node-labels span { position: absolute; left: 0; top: 0; font-family: var(--arabic); color: var(--gold-hi); font-size: 16px; text-shadow: 0 0 18px rgba(5, 10, 11, .9); white-space: nowrap; }
@media (max-width: 900px) { .node-labels span { font-size: 13px; } }
.rail { transition: opacity .5s, visibility .6s; }

/* city dialog */
.city-dialog { border: 1px solid var(--hair); border-radius: 22px; background: var(--night-raised); color: var(--moon); padding: 0; width: min(460px, calc(100vw - 32px)); }
.city-dialog::backdrop { background: rgba(3, 8, 8, .72); backdrop-filter: blur(4px); }
.city-form { padding: 28px; display: grid; gap: 12px; }
.city-form h2 { font-family: var(--display); font-weight: 300; font-size: 30px; margin: 0; letter-spacing: -.012em; }
.city-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; min-height: 40px; }
.city-list button { width: 100%; text-align: left; background: none; border: 0; padding: 11px 12px; border-radius: 10px; cursor: pointer; color: var(--moon); font-size: 15.5px; }
.city-list button:hover, .city-list button:focus-visible { background: rgba(212, 174, 85, .1); }
.city-list small { color: var(--moon-muted); margin-left: 8px; }

@media (max-width: 1180px), (max-aspect-ratio: 3/2) {
  .two, .two.right { grid-template-columns: 1fr; }
  .rail { display: none; }
  .two > div:empty { display: none; }
  /* overflow-x: clip: the soft backdrop behind the text reaches 30px past it, which made the page 11px wider than a phone screen */
  .ch { min-height: 125vh; align-items: flex-end; padding: 58vh 0 10vh; overflow-x: clip; }
  .ch-day { padding: 0; }
  .ch-day .moment { min-height: 110vh; align-items: flex-end; padding: 58vh 0 10vh; }
  /* The opening is exactly one screen tall here, so the line, the promise and the button are all in view on arrival. */
  .ch-hero { padding: 0; min-height: 100vh; min-height: 100svh; }
  .ch-hero .hero-copy { padding-bottom: 12vh; }
  .story-text::before { content: ''; inset: -40px -30px; background: radial-gradient(closest-side, rgba(8, 15, 16, .85), rgba(8, 15, 16, .22) 68%, rgba(8, 15, 16, 0)); }
  .stats { gap: 14px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .story-text, .split .w > span, .hero-rise, .ch-hero h1 { opacity: 1; transform: none; filter: none; transition: none; }
  .grain, .scroll-cue span { animation: none; }
}
