/* Geometri Zamrud (ramadan/geometri-zamrud): a gold geometric-mandala Ramadan poster on deep velvet, made picture-first */

:root {
    --ec-bg: #0b4d3c;
    --ec-bg2: #13896b;
    --ec-deep: #03201a;
    --ec-ink: #fff8e6;
    --ec-muted: #cdeee0;
    --ec-gold: #e7b552;
    --ec-glow: #ffe28c;
    --ec-glass1: #e0314f;
    --ec-glass2: #17b5a5;
    --ec-glass3: #f2a33a;
    --gz-foil: linear-gradient(135deg, #a8741a, #ffe9a6 28%, #d4a63c 50%, #fff1c2 72%, #9a6614);
    --gz-script: 'Great Vibes', 'Cormorant Garamond', cursive;
    --gz-caps: 'Cinzel', 'Times New Roman', serif;
    --gz-text: 'Cormorant Garamond', Georgia, serif;
    --gz-arabic: 'Amiri', 'Traditional Arabic', serif;
    /* a gold girih lattice: eight-point khatam stars joined by octagons */
    --gz-girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23f0c766' stroke-opacity='.2' stroke-width='1'%3E%3Cpath d='M36 18 41.3 30.7 54 36 41.3 41.3 36 54 30.7 41.3 18 36 30.7 30.7Z'/%3E%3Cpath d='M23.3 23.3H48.7V48.7H23.3Z'/%3E%3Cpath d='M23.3 23.3 0 0M48.7 23.3 72 0M23.3 48.7 0 72M48.7 48.7 72 72M36 18V0M36 54V72M18 36H0M54 36H72'/%3E%3Ccircle cx='36' cy='36' r='4'/%3E%3C/g%3E%3C/svg%3E");
    /* velvet: a lit centre, deep edges */
    --gz-velvet:
        radial-gradient(ellipse 75% 40% at 45% 42%, color-mix(in srgb, var(--ec-bg2) 70%, transparent), transparent 72%),
        radial-gradient(ellipse 60% 26% at 50% 100%, color-mix(in srgb, var(--ec-glow) 18%, transparent), transparent 70%),
        radial-gradient(ellipse 120% 90% at 50% 45%, var(--ec-bg) 36%, var(--ec-deep));
}

body.gz {
    background: var(--gz-girih), var(--gz-velvet);
    background-color: var(--ec-bg);
    background-attachment: fixed;
    color: var(--ec-ink);
    font-family: var(--gz-text);
    font-size: 1.1rem;
    line-height: 1.5;
}
.gz-defs { position: absolute; }

.gz-fx { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.gz-fx i { position: absolute; left: 0; top: 0; display: block; will-change: transform, opacity; }

/* ===================== cover ===================== */
.gz-cover {
    --ec-open-ms: 600;
    flex-direction: column; gap: .45rem;
    padding: 5.4rem 1rem 1.2rem;
    background: var(--gz-girih), var(--gz-velvet); background-color: var(--ec-bg);
    text-align: center;
    transition: opacity .6s ease;
}
.ec-js [data-ec-cover].gz-cover { justify-content: center; }
/* the link preview picture (?og=1 on the demo): a calm poster, without the counter and the skip link */
.gz-cover--poster .gz-hint__count, .gz-cover--poster .gz-skip { display: none; }
.ec-opening .gz-cover { opacity: 0; }
.gz-cover__dust { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.gz-cover__dust i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: var(--ec-glow); box-shadow: 0 0 8px var(--ec-glow); opacity: .6; }
.gz-cover__top { position: absolute; left: 0; top: 0; width: 100%; height: auto; max-height: 32svh; pointer-events: none; overflow: visible; }
.gz-cover__from { position: relative; z-index: 2; }
.gz-cover__from .ec-from__label { color: var(--ec-muted); font-size: .7rem; }
.gz-cover__from .ec-from__name { font-family: var(--gz-script); font-size: 2.2rem; line-height: 1.1; color: var(--ec-ink); text-shadow: 0 2px 12px rgb(0 0 0 / .4); }

/* the mandala to build: a faint drawing, then the gold rings drawn over it */
.gz-build {
    position: relative; z-index: 2; display: block;
    width: min(80vw, 19rem, 42svh); aspect-ratio: 1; margin: .3rem auto .2rem; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.gz-build > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.gz-build__halo { opacity: .25; transition: opacity .9s ease; }
.gz-build__rays { opacity: 0; transition: opacity .9s ease .2s; }
.gz-build__ghost { opacity: .55; stroke-dasharray: .005 .009; fill-opacity: 0; }
/* each ring of the mandala, hidden until its tap: the strokes are drawn in, then the fills appear */
.gz-build__ring { stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0; transition: stroke-dashoffset 1.1s cubic-bezier(.45, .05, .25, 1), fill-opacity .7s ease .7s; }
.gz-build.is-1 .gz-build__ring--1,
.gz-build.is-2 .gz-build__ring--1, .gz-build.is-2 .gz-build__ring--2,
.gz-build.is-3 .gz-build__ring { stroke-dashoffset: 0; fill-opacity: 1; }
.gz-build.is-1 .gz-build__halo { opacity: .45; }
.gz-build.is-2 .gz-build__halo { opacity: .7; }
.gz-build.is-3 .gz-build__halo { opacity: 1; }
.gz-build.is-done .gz-build__rays { opacity: 1; }
.gz-build__star { transform-origin: 0 0; transition: transform 1.6s cubic-bezier(.3, .1, .2, 1), filter 1s ease; }
.gz-build.is-done .gz-build__star { transform: rotate(45deg) scale(1.06); filter: drop-shadow(0 0 10px var(--ec-glow)); }
.gz-build.is-tap .gz-build__star { animation: gz-tap .45s ease; }
@keyframes gz-tap { 40% { scale: 1.05; } }

.gz-hint { position: relative; z-index: 2; margin: .3rem 0 0; font-style: italic; font-size: 1.08rem; color: var(--ec-ink); }
.gz-hint__count {
    display: inline-block; margin-left: .3rem; padding: .05rem .55rem; border-radius: 999px; font-style: normal;
    font-family: var(--gz-caps); font-size: .78rem; color: #3a2405; background: var(--gz-foil);
}
.gz-cover__to { position: relative; z-index: 2; }
.gz-cover__to .ec-recipient__greeting { color: var(--ec-muted); font-size: .7rem; }
.gz-cover__to .ec-recipient__name { font-family: var(--gz-script); font-size: 2.3rem; line-height: 1.1; color: var(--ec-ink); }
.gz-skip {
    position: relative; z-index: 2; margin-top: .1rem; padding: .3rem .6rem; border: 0; background: none; cursor: pointer;
    font: inherit; font-size: .9rem; color: var(--ec-muted); text-decoration: underline; text-underline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
    .gz-cover__dust i { animation: gz-dust 5.5s ease-in-out var(--d) infinite; }
    .gz-swing { animation: gz-swing 4.2s ease-in-out var(--d, 0s) infinite; }
    .gz-twinkle { animation: gz-twinkle 2.4s ease-in-out var(--d, 0s) infinite; }
    .gz-build:not(.is-done) .gz-build__ghost { animation: gz-breathe 2.6s ease-in-out infinite; }
    .gz-build.is-done > svg { animation: gz-spin 40s linear infinite; }
    .gz-turn { animation: gz-spin 120s linear infinite; }
    .gz-turn--back { animation-direction: reverse; animation-duration: 160s; }
}
@keyframes gz-dust { 0%, 100% { transform: translateY(0); opacity: .15; } 50% { transform: translateY(-18px); opacity: .85; } }
@keyframes gz-swing { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
@keyframes gz-twinkle { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: .4; scale: .7; } }
@keyframes gz-breathe { 50% { opacity: .85; } }
@keyframes gz-spin { to { rotate: 360deg; } }
.gz-swing, .gz-twinkle { transform-box: fill-box; transform-origin: 50% 0; }
.gz-twinkle { transform-origin: 50% 50%; }

/* short screens (360×640) */
@media (max-height: 720px) {
    .gz-cover { padding-top: 4.2rem; gap: .3rem; }
    .gz-build { width: min(66vw, 17rem, 34svh); }
    .gz-cover__from .ec-from__name { font-size: 1.9rem; }
    .gz-cover__to .ec-recipient__name { font-size: 1.85rem; }
    .gz-hint { font-size: 1rem; }
}

/* ===================== the poster ===================== */
.gz-page { max-width: 27rem; margin: 0 auto; padding: 0 0 1rem; overflow: hidden; }
.gz-poster {
    position: relative; isolation: isolate;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    min-height: max(42rem, 100svh);
    padding: 8.6rem 2rem 10rem;
}

/* the drawings behind the text, cut at the poster's edges */
.gz-art { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.gz-mandala { position: absolute; display: block; height: auto; overflow: visible; }
.gz-mandala--main { width: 94%; right: -47%; top: -8.6rem; filter: drop-shadow(0 0 22px rgb(0 0 0 / .4)); }
.gz-mandala--side { width: 56%; left: -34%; top: 38%; opacity: .45; }
.gz-lanterns { position: absolute; left: .2rem; top: 0; width: 46%; height: auto; overflow: visible; }
.gz-arcade { position: absolute; left: -.6rem; right: -.6rem; bottom: 0; width: calc(100% + 1.2rem); height: auto; overflow: visible; }

.gz-head { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; width: 100%; container-type: inline-size; }

/* "Teruntuk" and "Dari": gold caps between small stars */
.gz-label {
    display: inline-flex; align-items: center; gap: .45rem;
    font-family: var(--gz-caps); font-weight: 700; font-size: .66rem; letter-spacing: .3em; text-transform: uppercase; color: var(--ec-gold);
}
.gz-label svg { width: .7rem; height: .7rem; overflow: visible; }
.gz-to { display: flex; flex-direction: column; align-items: center; gap: .05rem; margin: 0; }
.gz-to__name {
    font-style: italic; font-weight: 600; font-size: 1.5rem; line-height: 1.15; color: var(--ec-ink);
    text-shadow: 0 2px 10px rgb(0 0 0 / .45); overflow-wrap: anywhere;
}

.gz-title { margin: .4rem 0 0; font-weight: 400; line-height: 1; display: flex; flex-direction: column; align-items: center; }
.gz-title__script {
    /* Great Vibes runs about .42em a letter: one line as long as the width allows */
    font-family: var(--gz-script); font-size: min(2.9rem, calc(225cqi / var(--n, 12))); line-height: 1.1; color: var(--ec-ink);
    text-shadow: 0 2px 0 color-mix(in srgb, var(--ec-gold) 55%, transparent), 0 6px 18px rgb(0 0 0 / .4);
    overflow-wrap: anywhere; padding: 0 .2rem;
}
.gz-title__display {
    margin-top: .02rem; padding: 0 .1rem;
    /* Cinzel caps run about .8em a letter */
    font-family: var(--gz-caps); font-weight: 800; font-size: min(3.9rem, calc(118cqi / var(--n, 7))); line-height: 1.02; letter-spacing: .04em; text-transform: uppercase;
    --ec-foil-1: #b07a1c; --ec-foil-2: #fff1c2; --ec-foil-3: #e6b84e;
    filter: drop-shadow(0 3px 0 rgb(0 0 0 / .3)) drop-shadow(0 8px 16px rgb(0 0 0 / .35));
    overflow-wrap: anywhere;
}
.gz-arabic {
    margin: .25rem 0 0; font-family: var(--gz-arabic); font-weight: 700; font-size: 2.1rem; line-height: 1.55;
    --ec-foil-1: #c48a26; --ec-foil-2: #fff1c2; --ec-foil-3: #e6b84e;
    filter: drop-shadow(0 3px 8px rgb(0 0 0 / .35));
}
.gz-rule { display: flex; align-items: center; gap: .5rem; margin: .1rem 0 0; }
.gz-rule i { display: block; width: 3.6rem; height: 1.5px; background: linear-gradient(90deg, transparent, var(--ec-gold)); }
.gz-rule i:last-child { transform: scaleX(-1); }
.gz-rule svg { width: .9rem; height: .9rem; overflow: visible; }

/* photos in a gold arch frame, a pile (data-ec-stack: a tap sends the top one to the back) */
.gz-photos { position: relative; z-index: 2; width: 8.6rem; margin: .8rem auto .2rem; }
.gz-photos .ec-photos__item {
    margin: 0; padding: .28rem; border-radius: 50% 50% .4rem .4rem / 38% 38% .4rem .4rem; background: var(--gz-foil);
    box-shadow: 0 10px 22px -8px rgb(0 0 0 / .6);
}
.gz-photos img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 50% 50% .25rem .25rem / 37% 37% .25rem .25rem; }

.gz-message {
    position: relative; z-index: 2; max-width: 19.5rem; margin: .6rem auto 0;
    font-weight: 600; font-size: 1.2rem; line-height: 1.42; color: var(--ec-ink);
    text-shadow: 0 1px 8px rgb(0 0 0 / .45);
}
.gz-poster--md .gz-message { font-size: 1.1rem; }
.gz-poster--lg .gz-message { font-size: 1rem; max-width: 20.5rem; }
.gz-poster--xl .gz-message { font-size: .94rem; max-width: 21.5rem; }
.gz-message p { margin-bottom: .5em; }

.gz-from { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: .05rem; margin-top: .7rem; }
.gz-from__closing { margin: 0; font-style: italic; font-size: 1.05rem; color: var(--ec-muted); }
.gz-from__sender { display: flex; flex-direction: column; align-items: center; margin: .1rem 0 0; }
.gz-from__name {
    font-family: var(--gz-script); font-size: 2.15rem; line-height: 1.15; color: var(--ec-ink);
    text-shadow: 0 2px 0 color-mix(in srgb, var(--ec-gold) 45%, transparent), 0 6px 14px rgb(0 0 0 / .4);
    overflow-wrap: anywhere; padding: 0 .3rem;
}

.gz-actions { position: relative; z-index: 2; color: var(--ec-ink); margin-top: 1.2rem; }
.gz-tap-hint { margin: .3rem 0 0; text-align: center; font-style: italic; font-size: .85rem; color: var(--ec-muted); }
.gz-branding { color: var(--ec-muted); }

/* ===================== the picture (?gambar=story|kotak) ===================== */
/* the poster fills the stage edge to edge, the credit sits in a strip under it */
.ec-image .gz-page[data-ec-card] { padding: 0 !important; overflow: visible; }
.ec-image .gz-poster { min-height: 0; padding: 6.3rem 1.7rem 8.9rem; }
.ec-image--story .gz-poster { min-height: 606px; }
.ec-image .gz-mandala--main { width: 92%; right: -46%; top: -8.4rem; }
.ec-image .gz-to__name { font-size: 1.7rem; }
.ec-image .gz-lanterns { width: 42%; }
.ec-image .gz-title__script { font-size: min(2.6rem, calc(225cqi / var(--n, 12))); }
.ec-image .gz-title__display { font-size: min(3.5rem, calc(118cqi / var(--n, 7))); }
.ec-image .gz-arabic { font-size: 1.8rem; }
.ec-image .gz-message { margin-top: .4rem; max-width: none; font-size: 1.08rem; }
.ec-image .gz-poster--md .gz-message { font-size: 1rem; }
.ec-image .gz-poster--lg .gz-message { font-size: .92rem; }
.ec-image .gz-poster--xl .gz-message { font-size: .84rem; }
.ec-image .gz-from { margin-top: .45rem; }
.ec-image .gz-from__name { font-size: 1.9rem; }
.ec-image .gz-photos { width: 6.2rem; margin-top: .55rem; }
/* a long message leaves less room for the photo */
.ec-image .gz-poster--lg .gz-photos, .ec-image .gz-poster--xl .gz-photos { width: 4.6rem; margin-top: .4rem; }
.ec-image .gz-branding { padding: 9px 8px 8px; }
.ec-image .gz-branding a { flex-direction: row; gap: .45rem; }
.ec-image .ec-branding__label { font-size: .62rem; }
/* square: the text in the middle, a mandala in two corners, the lanterns small, no arcade, no photos */
.ec-image--kotak .gz-poster { min-height: 326px; padding: 1.5rem 3.4rem 1.2rem; }
.ec-image--kotak .gz-mandala--main { width: 46%; right: -20%; top: -32%; }
.ec-image--kotak .gz-mandala--side { width: 46%; left: -24%; top: auto; bottom: -26%; opacity: .55; }
.ec-image--kotak .gz-lanterns { width: 30%; left: -.2rem; }
.ec-image--kotak .gz-arcade, .ec-image--kotak .gz-photos { display: none; }
.ec-image--kotak .gz-to__name { font-size: 1.12rem; }
.ec-image--kotak .gz-label { font-size: .54rem; }
.ec-image--kotak .gz-title { margin-top: .15rem; }
.ec-image--kotak .gz-title__script { font-size: min(1.85rem, calc(225cqi / var(--n, 12))); }
.ec-image--kotak .gz-title__display { font-size: min(2.45rem, calc(118cqi / var(--n, 7))); }
.ec-image--kotak .gz-arabic { font-size: 1.25rem; margin-top: 0; line-height: 1.45; }
.ec-image--kotak .gz-rule { display: none; }
.ec-image--kotak .gz-message { font-size: .84rem; margin-top: .2rem; line-height: 1.34; }
.ec-image--kotak .gz-poster--md .gz-message { font-size: .78rem; }
.ec-image--kotak .gz-poster--lg .gz-message, .ec-image--kotak .gz-poster--xl .gz-message { font-size: .7rem; }
.ec-image--kotak .gz-from { margin-top: .25rem; }
.ec-image--kotak .gz-from__closing { font-size: .8rem; }
.ec-image--kotak .gz-from__name { font-size: 1.45rem; }
.ec-image--kotak .gz-branding { padding: 6px 8px 7px; }
