/* ==========================================================================
   Sabu & Mubeena · wedding invitation
   Ported from the Claude Design prototype: one painting, night to dusk,
   folded into an envelope; ivory paper below.

   Body state classes, set by main.js:
     st-closed   envelope shown, waiting for a tap
     st-opening  the opening sequence and the hero entrance (about 4.6 s)
     st-open     everything settled
     is-locked   page scroll locked while the envelope covers it
   ========================================================================== */

:root {
	--night: #0B1433;
	--navy: #121D45;
	--ink: #1A2650;
	--ink2: #4A5578;
	--paper: #F4EEE2;
	--gold: #C8A253;
	--gold-ink: #7A5C1B;
	--gold-lt: #EED9A0;
	--ivory: #F7F2E7;
	--link: #24407C;
	--hero: url("../img/hero-m.webp");
	--ease-out: cubic-bezier(.22, 1, .36, 1);
	--ease-io: cubic-bezier(.65, 0, .35, 1);
	--ease-in: cubic-bezier(.5, 0, .75, 0);
}

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

html {
	-webkit-text-size-adjust: 100%;
	background: var(--paper);
}

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100svh;
	overflow-x: hidden;
	background: var(--paper);
	color: var(--ink);
	font-family: "Instrument Serif", Georgia, serif;
	font-size: 19px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

body.is-locked {
	overflow: hidden;
}

p,
h1,
h2,
h3 {
	text-wrap: balance;
}

.defs {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.ar {
	font-family: "Amiri", serif;
	direction: rtl;
}

.ruq {
	font-family: "Aref Ruqaa", serif;
	direction: rtl;
	font-weight: 700;
}

.qr {
	font-family: "Amiri Quran", "Amiri", serif;
	direction: rtl;
}

.lab {
	font-family: "Jost", sans-serif;
	font-weight: 500;
	font-size: 11px;
	letter-spacing: .28em;
	text-transform: uppercase;
}

.it {
	font-style: italic;
}

.shim {
	background: linear-gradient(100deg, #D9B66A 0%, #F3DFA6 30%, #FFF7E0 44%, #EBCB82 58%, #C9A04E 80%, #EED9A0 100%);
	background-size: 260% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	animation: shimmer 9s ease-in-out infinite;
}

@keyframes shimmer {
	0%, 100% { background-position: 100% 0; }
	50% { background-position: 0 0; }
}

:focus-visible {
	outline: 2px solid var(--link);
	outline-offset: 3px;
}

/* clip, not hidden: a hidden overflow makes .page a scroll container,
   which would bind every view() timeline inside it to .page. */
.page {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	overflow: clip;
}

/* ---------- Hero: one painting, night to dusk ---------- */

.hero {
	position: relative;
	background: var(--night);
}

.hero .pic {
	display: block;
	width: 100%;
	height: auto;
}

.hero .veil {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 780px;
	background: linear-gradient(180deg, rgb(8 16 42 / .35), rgb(8 16 42 / 0) 85%);
	pointer-events: none;
}

.hero .t {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: max(76px, env(safe-area-inset-top)) 24px 0;
	text-align: center;
	color: var(--ivory);
}

.hero .bism {
	margin: 0;
	font-size: 22px;
	line-height: 1.9;
	color: var(--gold-lt);
	opacity: .95;
}

.hero .bism-en {
	margin: 2px 0 0;
	font-size: 15px;
	color: rgb(247 242 231 / .72);
}

.names-ar {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 30px 0 0;
	line-height: 1.2;
}

.names-ar .n {
	font-size: clamp(44px, 13.8vw, 54px);
	white-space: nowrap;
}

.names-ar .w {
	margin: 2px 0;
	font-size: 30px;
	font-weight: 400;
	line-height: 1;
	color: var(--gold-lt);
}

.names-en {
	margin: 0;
	font-size: 30px;
	font-weight: 400;
	line-height: 1.12;
	color: var(--ivory);
	outline: none;
}

.names-en .amp {
	font-style: italic;
	color: var(--gold-lt);
}

.hero .tagline {
	margin: 22px 0 14px;
	font-size: 10.5px;
	line-height: 1.4;
	color: rgb(247 242 231 / .8);
}

.hero .dt {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin-top: 22px;
	color: rgb(247 242 231 / .85);
}

.hero .dt .line {
	width: 1px;
	height: 34px;
	background: linear-gradient(180deg, transparent, var(--gold-lt));
}

.hero .dt-place {
	letter-spacing: .18em;
	opacity: .8;
}

/* Hero text entrance, after the envelope opens. */
.hero .t > * {
	transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out), filter 1.2s var(--ease-out);
}

.st-closed .hero .t > *,
.st-opening .hero .t > * {
	opacity: 0;
	transform: translateY(14px);
	filter: blur(6px);
}

.st-opening .hero .t > * {
	animation: rise 1.1s var(--ease-out) both;
}

.st-opening .hero .t > :nth-child(1) { animation-delay: 2.05s; }
.st-opening .hero .t > :nth-child(2) { animation-delay: 2.15s; }
.st-opening .hero .t > :nth-child(3) { animation-delay: 2.3s; }
.st-opening .hero .t > :nth-child(4) { animation-delay: 2.5s; }
.st-opening .hero .t > :nth-child(5) { animation-delay: 2.55s; }
.st-opening .hero .t > :nth-child(6) { animation-delay: 2.65s; }

@keyframes rise {
	to { opacity: 1; transform: none; filter: blur(0); }
}

/* The Arabic names write in, right to left. */
.st-opening .names-ar .n {
	animation: write 1.5s var(--ease-io) both;
}

.st-opening .names-ar .n:first-child { animation-delay: 2.35s; }
.st-opening .names-ar .n:last-child { animation-delay: 2.85s; }

@keyframes write {
	from { clip-path: inset(-20% 0 -20% 100%); }
	to { clip-path: inset(-20% 0 -20% 0); }
}

/* ---------- On paper ---------- */

.sec {
	position: relative;
	padding: 0 26px;
	text-align: center;
}

.star {
	display: block;
	margin: 0 auto;
	color: var(--gold);
}

.verse {
	padding-top: 8px;
	padding-bottom: 96px;
}

.verse .q {
	margin: 14px 0 4px;
	font-size: 31px;
	line-height: 2.05;
	color: var(--navy);
}

.verse .en {
	max-width: 560px;
	margin: 0 auto 20px;
	font-size: 25px;
	font-style: italic;
	line-height: 1.35;
	color: var(--ink);
}

.verse .ref {
	margin: 0;
	color: var(--ink2);
}

.h-se {
	margin: 10px 0 0;
	font-size: 44px;
	font-weight: 400;
	line-height: 1.1;
	color: var(--navy);
}

.h-en {
	display: block;
	margin: 10px 0 0;
	color: var(--ink2);
}

/* Countdown */
.count {
	padding-bottom: 104px;
}

.digits {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	max-width: 440px;
	margin: 30px auto 0;
}

.digit {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 0 4px;
}

.digit + .digit {
	border-inline-start: 1px solid rgb(200 162 83 / .45);
}

.digit .v {
	font-size: 58px;
	line-height: 1;
	color: var(--navy);
	font-variant-numeric: lining-nums tabular-nums;
}

.digit .l {
	font-size: 10px;
	letter-spacing: .22em;
	color: var(--ink2);
}

.count .sub {
	margin: 26px 0 0;
	font-size: 18px;
	color: var(--ink2);
}

.thanks-h {
	margin: 0 0 6px;
	font-size: 34px;
	font-weight: 400;
	color: var(--navy);
}

.thanks p {
	margin: 0;
	color: var(--ink2);
}

[hidden] {
	display: none !important;
}

/* Events */
.events {
	padding-bottom: 110px;
}

.evs {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	max-width: 1000px;
	margin: 36px auto 0;
}

.ev {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 34px 0;
}

.ev + .ev {
	border-top: 1px solid rgb(200 162 83 / .45);
}

.ev .ttl {
	margin: 0;
	font-size: 40px;
	font-weight: 400;
	line-height: 1.1;
	color: var(--navy);
}

.ev .day {
	position: relative;
	margin: 14px 0 2px;
	line-height: .9;
}

.ev .day .wash {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 230px;
	height: 150px;
	margin: -75px 0 0 -115px;
	background: var(--hero) 40% 47% / 1100px auto;
	-webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent);
	mask-image: radial-gradient(closest-side, #000 35%, transparent);
	opacity: .55;
	pointer-events: none;
}

.ev .day .num {
	position: relative;
	font-size: 118px;
	letter-spacing: -.02em;
	color: var(--navy);
}

.ev .mon {
	margin: 0;
	font-size: 22px;
	font-style: italic;
	color: var(--ink);
}

.ev .time {
	margin: 14px 0 0;
	font-family: "Jost", sans-serif;
	font-size: 15px;
	letter-spacing: .04em;
	color: var(--ink);
}

.ev .venue {
	margin: 16px 0 0;
	font-size: 27px;
	line-height: 1.15;
	color: var(--navy);
}

.ev .place {
	margin: 4px 0 0;
	font-family: "Jost", sans-serif;
	font-size: 14px;
	color: var(--ink2);
}

.acts {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 22px;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-height: 46px;
	padding: 0 20px;
	border: 1px solid var(--navy);
	border-radius: 999px;
	font-family: "Jost", sans-serif;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: .04em;
	text-decoration: none;
	cursor: pointer;
	transition: background .3s, color .3s, border-color .3s;
}

.btn.ghost {
	background: transparent;
	color: var(--navy);
}

.btn.ghost:hover,
.btn.ghost[aria-expanded="true"] {
	background: rgb(18 29 69 / .06);
}

.calm {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin-top: 14px;
	font-family: "Jost", sans-serif;
	font-size: 14px;
}

.calm a {
	padding: 6px 2px;
	color: var(--link);
	text-underline-offset: 4px;
}

.map {
	position: relative;
	display: block;
	width: 100%;
	max-width: 380px;
	height: 190px;
	margin: 22px auto 0;
	overflow: hidden;
	border-radius: 20px;
	color: var(--ink);
	text-decoration: none;
	box-shadow: 0 18px 36px -22px rgb(18 29 69 / .55), 0 0 0 1px rgb(200 162 83 / .45);
	transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out);
}

.map:hover {
	transform: translateY(-3px);
	box-shadow: 0 26px 40px -22px rgb(18 29 69 / .6), 0 0 0 1px rgb(200 162 83 / .8);
}

.map-art {
	position: absolute;
	inset: 0;
	display: block;
	transition: transform 1.2s var(--ease-out);
}

.map:hover .map-art {
	transform: scale(1.06);
}

.map .pin {
	position: absolute;
	left: 50%;
	top: 40%;
	width: 34px;
	height: 44px;
	margin: -44px 0 0 -17px;
	animation: pinDrop 2.6s var(--ease-out) infinite;
}

.map .pin svg {
	position: relative;
	display: block;
	filter: drop-shadow(0 4px 4px rgb(18 29 69 / .35));
}

.map .ring {
	position: absolute;
	left: 50%;
	bottom: -6px;
	width: 14px;
	height: 6px;
	margin-left: -7px;
	border-radius: 50%;
	background: rgb(18 29 69 / .25);
	animation: pinRing 2.6s ease-out infinite;
}

@keyframes pinDrop {
	0%, 60%, 100% { transform: translateY(0); }
	70% { transform: translateY(-8px); }
	80% { transform: translateY(0); }
}

@keyframes pinRing {
	0%, 60% { box-shadow: 0 0 0 0 rgb(36 64 124 / .35); }
	100% { box-shadow: 0 0 0 26px rgb(36 64 124 / 0); }
}

.map-bar {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 10px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 12px;
	background: rgb(251 248 241 / .86);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	text-align: left;
}

.map-bar .mv {
	overflow: hidden;
	font-size: 18px;
	line-height: 1.1;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: var(--navy);
}

.map-bar .mo {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-family: "Jost", sans-serif;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .08em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--link);
}

/* Closing */
.fin {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0 0 calc(56px + env(safe-area-inset-bottom));
	text-align: center;
}

.fin-art {
	position: relative;
	width: 100%;
	max-width: 640px;
	overflow: hidden;
	overflow: clip;
}

.fin-art .pic {
	display: block;
	width: 100%;
	height: auto;
	-webkit-mask-image: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / .35) 9%, #000 26%, #000 78%, transparent 100%);
	mask-image: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / .35) 9%, #000 26%, #000 78%, transparent 100%);
}

.fin-head {
	position: absolute;
	left: 0;
	right: 0;
	top: 19%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 0 20px;
}

.fin-head h2 {
	max-width: 320px;
	margin: 0;
	font-size: 40px;
	font-weight: 400;
	line-height: 1.1;
	color: var(--navy);
	text-shadow: 0 1px 18px rgb(244 238 226 / .7);
}

.fin-txt {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 600px;
	margin-top: -40px;
	padding: 0 28px;
}

.fin .msg {
	margin: 0;
	font-size: 25px;
	font-style: italic;
	line-height: 1.4;
	color: var(--ink);
}

.dates {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	width: 100%;
	margin: 34px 0 0;
}

.dl {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	min-width: 0;
	padding: 4px 0;
	color: var(--ink);
}

.dl .lab {
	font-size: 10px;
	color: var(--ink2);
}

.dl .d {
	font-size: 22px;
	line-height: 1.2;
	white-space: nowrap;
	color: var(--navy);
}

.dl .pl {
	font-family: "Jost", sans-serif;
	font-size: 13px;
	color: var(--ink2);
}

.dates .sep {
	display: flex;
}

.fin .sig {
	margin: 46px 0 0;
	font-size: 50px;
	line-height: 1.05;
	color: var(--navy);
}

.fin .sig .amp {
	font-style: italic;
	color: var(--gold-ink);
}

.fin .foot {
	margin: 48px 0 0;
	color: var(--ink2);
}

/* ---------- Envelope: the painting, folded ---------- */

.stage {
	position: fixed;
	inset: 0;
	z-index: 20;
	perspective: 1800px;
	background: var(--night);
}

.pc {
	position: absolute;
	inset: 0;
	background: var(--night) var(--hero) center top / 100% auto no-repeat;
}

.pc::after,
.flap.f::after {
	content: "";
	position: absolute;
	inset: 0;
	background: url("../img/paper.jpg") 0 0 / 384px;
	mix-blend-mode: multiply;
	opacity: .55;
}

.flap.f::after {
	opacity: .45;
}

.pc.l {
	clip-path: polygon(0 0, 52% 54%, 0 100%);
	filter: brightness(.8) saturate(.95);
}

.pc.r {
	clip-path: polygon(100% 0, 48% 54%, 100% 100%);
	filter: brightness(.74) saturate(.95);
}

.pcw.b {
	position: absolute;
	inset: 0;
	filter: drop-shadow(0 -4px 6px rgb(4 8 24 / .45));
}

.pc.b {
	clip-path: polygon(0 100%, 50% 50%, 100% 100%);
	filter: brightness(.9);
}

.folds {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.flapsh {
	position: absolute;
	left: 0;
	top: 6px;
	width: 100%;
	height: 56%;
	clip-path: polygon(0 0, 100% 0, 50% 100%);
	background: rgb(4 8 24 / .5);
	filter: blur(5px);
}

.flapw {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 3;
	width: 100%;
	height: 56%;
	transform-origin: 50% 0;
	transform-style: preserve-3d;
}

.flap {
	position: absolute;
	inset: 0;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

.flap.f {
	clip-path: polygon(0 0, 100% 0, 50% 100%);
	background: var(--night) var(--hero) center top / 100% auto no-repeat;
}

.flap.f svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* A slow glint across the top flap. */
.flap.f::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(115deg, transparent 42%, rgb(255 236 190 / .28) 50%, transparent 58%);
	background-size: 320% 100%;
	mix-blend-mode: screen;
	animation: glint 6s ease-in-out 1s infinite;
}

@keyframes glint {
	0% { background-position: 130% 0; }
	45%, 100% { background-position: -130% 0; }
}

.flap.bk {
	transform: rotateX(180deg);
	clip-path: polygon(0 100%, 100% 100%, 50% 0);
	background: #14224A url("../img/liner.svg") center / 40px;
}

.ribbon {
	position: absolute;
	left: 0;
	right: 0;
	top: 56%;
	z-index: 4;
	height: 14px;
	margin-top: -7px;
	pointer-events: none;
}

.ribbon .h {
	position: absolute;
	top: 0;
	width: 50.5%;
	height: 100%;
	overflow: hidden;
	background: linear-gradient(180deg, #BDB099 0%, #F3ECDF 30%, #FFFDF8 48%, #E9DFCB 70%, #B7A98F 100%);
	box-shadow: inset 0 1px 0 #C8A253, inset 0 -1px 0 #C8A253, 0 3px 6px rgb(4 8 24 / .45);
}

.ribbon .h::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, transparent 35%, rgb(255 255 255 / .85) 50%, transparent 65%);
	background-size: 300% 100%;
	animation: sheen 4.5s ease-in-out infinite;
}

.ribbon .h.l { left: 0; }
.ribbon .h.r { right: 0; }
.ribbon .h.r::after { animation-delay: .25s; }

@keyframes sheen {
	0% { background-position: 120% 0; }
	60%, 100% { background-position: -120% 0; }
}

.tails {
	position: absolute;
	left: 50%;
	top: 56%;
	z-index: 5;
	width: 200px;
	height: 140px;
	margin: -8px 0 0 -100px;
	pointer-events: none;
}

.tails svg {
	width: 100%;
	height: 100%;
	overflow: visible;
	filter: drop-shadow(0 3px 4px rgb(4 8 24 / .45));
}

.tails .tl,
.tails .tr {
	transform-box: fill-box;
	transform-origin: 50% 0;
}

.seal,
.halo {
	position: absolute;
	left: 50%;
	top: 56%;
	width: 86px;
	height: 86px;
	margin: -43px 0 0 -43px;
	pointer-events: none;
}

.seal {
	z-index: 6;
}

.seal .h {
	position: absolute;
	inset: 0;
}

/* The seal cracks along a jagged line into two halves. */
.seal .h.l {
	clip-path: polygon(0 0, 52% 0, 46% 22%, 56% 41%, 44% 60%, 54% 80%, 48% 100%, 0 100%);
}

.seal .h.r {
	clip-path: polygon(52% 0, 100% 0, 100% 100%, 48% 100%, 54% 80%, 44% 60%, 56% 41%, 46% 22%);
}

.seal svg {
	width: 100%;
	height: 100%;
	overflow: visible;
	filter: drop-shadow(0 4px 5px rgb(4 8 24 / .55));
	animation: breathe 3.2s ease-in-out infinite;
}

@keyframes breathe {
	50% { transform: scale(1.035); }
}

.halo {
	z-index: 5;
	border-radius: 50%;
	animation: halo 2.8s var(--ease-out) infinite;
}

@keyframes halo {
	0% { box-shadow: 0 0 0 0 rgb(238 217 160 / .5); }
	80%, 100% { box-shadow: 0 0 0 26px rgb(238 217 160 / 0); }
}

.envbtn {
	all: unset;
	position: absolute;
	inset: 0;
	z-index: 7;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.envbtn:focus-visible {
	outline: 2px solid var(--gold-lt);
	outline-offset: -6px;
}

.etop {
	position: absolute;
	left: 0;
	right: 0;
	top: 9%;
	z-index: 7;
	margin: 0;
	text-align: center;
	color: var(--ivory);
	pointer-events: none;
}

.etop .nm {
	display: block;
	font-size: 30px;
	line-height: 1.1;
}

.etop .nm .amp {
	font-style: italic;
	color: var(--gold-lt);
}

.etop .lab {
	display: block;
	margin-top: 10px;
	color: rgb(247 242 231 / .75);
}

.hint {
	position: absolute;
	left: 50%;
	bottom: max(28px, env(safe-area-inset-bottom));
	z-index: 7;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 10px 18px;
	transform: translateX(-50%);
	border: 1px solid rgb(238 217 160 / .3);
	border-radius: 999px;
	background: rgb(8 16 42 / .5);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	color: var(--ivory);
	white-space: nowrap;
	pointer-events: none;
}

.hint .dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--gold-lt);
	animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
	50% { opacity: .25; transform: scale(.6); }
}

/* ---------- Ambient effects (specks placed by main.js) ---------- */

.fxl {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.dust {
	z-index: 6;
}

.dust i {
	position: absolute;
	border-radius: 50%;
	background: radial-gradient(circle, #FFF4D0 0%, #EED9A0 45%, rgb(238 217 160 / 0) 70%);
	opacity: 0;
	animation: drift linear infinite;
}

@keyframes drift {
	0% { transform: translate(0, 0); opacity: 0; }
	15% { opacity: .9; }
	50% { transform: translate(14px, -90px); }
	85% { opacity: .7; }
	100% { transform: translate(-8px, -190px); opacity: 0; }
}

.tw {
	z-index: 1;
}

.tw i {
	position: absolute;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: #FFF3CF;
	box-shadow: 0 0 6px 1px rgb(255 236 190 / .8);
	animation: twinkle ease-in-out infinite;
}

@keyframes twinkle {
	0%, 100% { opacity: .15; transform: scale(.6); }
	50% { opacity: 1; transform: scale(1.1); }
}

.shoot {
	position: absolute;
	left: 12%;
	top: 6%;
	z-index: 1;
	width: 140px;
	height: 1.5px;
	opacity: 0;
	background: linear-gradient(90deg, rgb(255 243 207 / 0), #FFF3CF);
	transform: rotate(18deg);
	pointer-events: none;
	animation: shoot 9s ease-in 4s infinite;
}

@keyframes shoot {
	0% { opacity: 0; transform: translate(0, 0) rotate(18deg); }
	2% { opacity: 1; }
	8% { opacity: 0; transform: translate(260px, 85px) rotate(18deg); }
	100% { opacity: 0; }
}

.motes {
	z-index: 2;
}

.motes i {
	position: absolute;
	border-radius: 50%;
	background: var(--gold);
	animation: mote ease-in-out infinite alternate;
}

@keyframes mote {
	0% { transform: translate(0, 0); opacity: .15; }
	100% { transform: translate(10px, -34px); opacity: .6; }
}

.bloom {
	position: absolute;
	left: 50%;
	top: 56%;
	z-index: 8;
	width: 10px;
	height: 10px;
	margin: -5px 0 0 -5px;
	border-radius: 50%;
	opacity: 0;
	background: radial-gradient(circle, rgb(255 246 220 / .95), rgb(238 217 160 / .55) 30%, rgb(238 217 160 / 0) 70%);
	pointer-events: none;
}

.petals {
	position: fixed;
	inset: 0;
	z-index: 25;
	overflow: hidden;
	pointer-events: none;
}

.petal {
	position: absolute;
	top: -6%;
	animation: fall linear both;
}

.petal i {
	display: block;
	width: 12px;
	height: 16px;
	border-radius: 70% 0;
	background: linear-gradient(135deg, #FFFFFF, #F1E9DA 60%, #D9CDB6);
	box-shadow: 0 1px 2px rgb(4 8 24 / .25);
	animation: sway ease-in-out infinite alternate;
}

.petal.g i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: radial-gradient(circle, #FFF4D0, #E3C27A 60%, rgb(227 194 122 / 0) 72%);
	box-shadow: none;
}

@keyframes fall {
	0% { top: -6%; opacity: 0; }
	8% { opacity: 1; }
	85% { opacity: 1; }
	100% { top: 106%; opacity: 0; }
}

@keyframes sway {
	0% { translate: -18px 0; rotate: -30deg; }
	100% { translate: 18px 0; rotate: 40deg; }
}

/* ---------- Opening sequence, about 3 s ---------- */

@keyframes fade {
	to { opacity: 0; }
}

.st-opening .etop,
.st-opening .hint,
.st-opening .halo {
	animation: fade .35s ease both;
}

.st-opening .tails .tl { animation: tailL .75s var(--ease-in) .1s both; }
.st-opening .tails .tr { animation: tailR .75s var(--ease-in) .18s both; }

@keyframes tailL {
	30% { transform: rotate(8deg); }
	100% { transform: translate(-30px, 70px) rotate(38deg); opacity: 0; }
}

@keyframes tailR {
	30% { transform: rotate(-8deg); }
	100% { transform: translate(30px, 76px) rotate(-34deg); opacity: 0; }
}

.st-opening .ribbon .h.l { animation: ribL .7s var(--ease-io) .25s both; }
.st-opening .ribbon .h.r { animation: ribR .7s var(--ease-io) .25s both; }

@keyframes ribL { to { transform: translateX(-105%); opacity: 0; } }
@keyframes ribR { to { transform: translateX(105%); opacity: 0; } }

.st-opening .seal .h.l { animation: sealL .5s var(--ease-in) .85s both; }
.st-opening .seal .h.r { animation: sealR .5s var(--ease-in) .85s both; }

@keyframes sealL {
	30% { transform: translate(-3px, 0) rotate(-4deg); }
	100% { transform: translate(-22px, 110px) rotate(-24deg); opacity: 0; }
}

@keyframes sealR {
	30% { transform: translate(3px, 0) rotate(4deg); }
	100% { transform: translate(22px, 118px) rotate(28deg); opacity: 0; }
}

.st-opening .flapsh { animation: fade .3s ease 1.1s both; }
.st-opening .flapw { animation: flapOpen .95s cubic-bezier(.45, .05, .25, 1) 1.15s both; }

@keyframes flapOpen {
	to { transform: rotateX(178deg); }
}

.st-opening .bloom { animation: bloom 1.4s var(--ease-out) 1.05s both; }

@keyframes bloom {
	0% { opacity: 0; transform: scale(1); }
	25% { opacity: 1; }
	100% { opacity: 0; transform: scale(160); }
}

.st-opening .dust { animation: fade .8s ease 1.6s both; }
.st-opening .folds { animation: fade .5s ease 1.6s both; }
.st-opening .pc.l { animation: pkL 1s var(--ease-io) 1.65s both; }
.st-opening .pc.r { animation: pkR 1s var(--ease-io) 1.65s both; }
.st-opening .pcw.b { animation: pkB 1s var(--ease-io) 1.7s both; }

@keyframes pkL { to { transform: translateX(-60%); opacity: 0; } }
@keyframes pkR { to { transform: translateX(60%); opacity: 0; } }
@keyframes pkB { to { transform: translateY(45%); opacity: 0; } }

/* The stage's own night background fades as the pockets slide away. */
.st-opening .stage {
	background: transparent;
	transition: background .5s ease 1.6s;
	animation: fade .4s ease 2.6s both;
}

/* ---------- Music ---------- */

.music {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid rgb(238 217 160 / .6);
	border-radius: 50%;
	background: rgb(8 16 42 / .75);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	color: var(--ivory);
	cursor: pointer;
	animation: fadeIn .6s ease both;
}

.st-open .music {
	animation: none;
}

@keyframes fadeIn {
	from { opacity: 0; transform: scale(.8); }
	to { opacity: 1; transform: none; }
}

.music .eq {
	display: flex;
	align-items: flex-end;
	gap: 2px;
	height: 14px;
}

.music .eq i {
	width: 2px;
	height: 40%;
	background: var(--gold-lt);
	animation: eq 1.1s ease-in-out infinite;
}

.music .eq i:nth-child(2) { animation-delay: .25s; }
.music .eq i:nth-child(3) { animation-delay: .5s; }

@keyframes eq {
	50% { height: 100%; }
}

.music[aria-pressed="false"] .eq,
.music[aria-pressed="true"] .play {
	display: none;
}

/* ---------- Scroll-driven reveals, where supported ---------- */

@supports (animation-timeline: view()) {
	.hero .t {
		animation: heroPar linear both;
		animation-timeline: scroll(root);
		animation-range: 0px 900px;
	}

	@keyframes heroPar {
		to { transform: translateY(260px); opacity: .15; }
	}

	.verse .q {
		animation: writeQ linear both;
		animation-timeline: view();
		animation-range: entry 20% cover 45%;
	}

	@keyframes writeQ {
		from { clip-path: inset(-30% 0 -30% 100%); }
		to { clip-path: inset(-30% 0 -30% 0); }
	}

	.h-se,
	.fin-head h2 {
		animation: wipeUp linear both;
		animation-timeline: view();
		animation-range: entry 10% cover 30%;
	}

	@keyframes wipeUp {
		from { clip-path: inset(100% 0 -20% 0); transform: translateY(24px); }
		to { clip-path: inset(-20% 0 -20% 0); transform: none; }
	}

	.star {
		animation: spin linear both;
		animation-timeline: view();
		animation-range: entry 0% cover 40%;
	}

	@keyframes spin {
		from { transform: rotate(-180deg) scale(.2); opacity: 0; }
		to { transform: none; opacity: 1; }
	}

	.ev .day .num {
		animation: numIn linear both;
		animation-timeline: view();
		animation-range: entry 10% cover 40%;
	}

	@keyframes numIn {
		from { transform: scale(.7); letter-spacing: .2em; opacity: 0; }
		to { transform: none; opacity: 1; }
	}

	.ev .day .wash {
		animation: washIn linear both;
		animation-timeline: view();
		animation-range: entry 0% cover 45%;
	}

	@keyframes washIn {
		from { transform: scale(.3); opacity: 0; }
		to { transform: none; opacity: .55; }
	}

	.digit {
		animation: rv linear both;
		animation-timeline: view();
		animation-range: entry 0% cover 30%;
	}

	.digit:nth-child(2) { animation-range: entry 6% cover 34%; }
	.digit:nth-child(3) { animation-range: entry 12% cover 38%; }

	.fin-art .pic {
		animation: zoomOut linear both;
		animation-timeline: view();
		animation-range: entry 0% cover 60%;
	}

	@keyframes zoomOut {
		from { transform: scale(1.12); }
		to { transform: none; }
	}

	.dates .dl:first-child {
		animation: fromL linear both;
		animation-timeline: view();
		animation-range: entry 0% cover 35%;
	}

	.dates .dl:last-child {
		animation: fromR linear both;
		animation-timeline: view();
		animation-range: entry 0% cover 35%;
	}

	@keyframes fromL {
		from { transform: translateX(-40px); opacity: 0; }
		to { transform: none; opacity: 1; }
	}

	@keyframes fromR {
		from { transform: translateX(40px); opacity: 0; }
		to { transform: none; opacity: 1; }
	}

	.rv {
		animation: rv linear both;
		animation-timeline: view();
		animation-range: entry 0% cover 30%;
	}

	@keyframes rv {
		from { opacity: 0; transform: translateY(28px); filter: blur(4px); }
		to { opacity: 1; transform: none; filter: blur(0); }
	}

	.rv2 {
		animation: rv2 linear both;
		animation-timeline: view();
		animation-range: entry 0% cover 25%;
	}

	@keyframes rv2 {
		from { opacity: 0; transform: translateY(18px); }
		to { opacity: 1; transform: none; }
	}
}

/* Without scroll-driven animations, main.js reveals with an observer. */
.io-reveal .rv,
.io-reveal .rv2 {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out);
}

.io-reveal .rv.is-visible,
.io-reveal .rv2.is-visible {
	opacity: 1;
	transform: none;
}

/* ---------- Desktop ---------- */

@media (min-width: 900px) {
	:root {
		--hero: url("../img/hero-d.webp");
	}

	.page {
		font-size: 21px;
	}

	.hero .veil { height: 900px; }
	.hero .t { padding-top: 92px; }
	.hero .bism { font-size: 30px; }
	.hero .bism-en { font-size: 17px; }

	.names-ar {
		flex-direction: row-reverse;
		align-items: baseline;
		gap: 30px;
		margin-top: 40px;
	}

	.names-ar .n { font-size: 92px; }
	.names-ar .w { font-size: 52px; }
	.names-en { font-size: 48px; }
	.hero .tagline { margin: 26px 0 18px; font-size: 12px; }

	.verse { padding-top: 40px; padding-bottom: 140px; }
	.verse .q { font-size: 50px; }
	.verse .en { max-width: 720px; font-size: 32px; }
	.h-se { font-size: 64px; }

	.count { padding-bottom: 150px; }
	.digits { max-width: 680px; }
	.digit .v { font-size: 104px; }
	.digit .l { font-size: 11px; }

	.evs {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		margin-top: 52px;
	}

	.ev { padding: 20px 40px; }

	.ev + .ev {
		border-top: 0;
		border-inline-start: 1px solid rgb(200 162 83 / .45);
	}

	.ev .day .num { font-size: 150px; }
	.map { height: 210px; }
	.events { padding-bottom: 160px; }

	.fin { padding-bottom: 80px; }
	.fin-art { max-width: 820px; }

	.fin-art .pic {
		-webkit-mask-image:
			linear-gradient(180deg, transparent 0%, rgb(0 0 0 / .35) 9%, #000 26%, #000 78%, transparent 100%),
			linear-gradient(90deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
		-webkit-mask-composite: source-in;
		mask-image:
			linear-gradient(180deg, transparent 0%, rgb(0 0 0 / .35) 9%, #000 26%, #000 78%, transparent 100%),
			linear-gradient(90deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
		mask-composite: intersect;
	}

	.fin-head h2 { max-width: 560px; font-size: 62px; }
	.fin-txt { max-width: 720px; margin-top: -60px; }
	.fin .msg { font-size: 32px; }
	.dates { gap: 40px; margin-top: 48px; }
	.dl .d { font-size: 26px; }
	.fin .sig { margin-top: 64px; font-size: 76px; }

	.etop .nm { font-size: 44px; }

	.seal,
	.halo {
		width: 104px;
		height: 104px;
		margin: -52px 0 0 -52px;
	}

	.tails {
		width: 250px;
		height: 175px;
		margin: -10px 0 0 -125px;
	}

	.ribbon {
		height: 17px;
		margin-top: -8px;
	}
}

/* ---------- Reduced motion: a simple fade instead of the sequence ---------- */

@media (prefers-reduced-motion: reduce) {
	.dust,
	.petals,
	.tw,
	.motes,
	.shoot,
	.bloom {
		display: none;
	}

	*,
	*::before,
	*::after {
		animation: none !important;
	}

	.st-opening .stage {
		opacity: 0;
		transition: opacity .4s ease;
	}

	.st-opening .hero .t > * {
		opacity: 1;
		transform: none;
		filter: none;
		transition: opacity .4s ease;
	}
}
