/* Nyalakan Pelita (idulfitri/pelita): luxe Islamic stationery for Lebaran */

:root {
    --ec-bg: #033a2c;
    --ec-bg2: #0b6149;
    --ec-ink: #fff6df;
    --ec-muted: #cfe8d8;
    --ec-card: #fffaf0;
    --ec-card-ink: #0f3a2e;
    --ec-card-muted: #6a6a48;
    --ec-accent: #d4a63c;
    --ec-glow: #ffd36e;
    --ec-lantern: #c9962e;
    --ec-leaf: #2f9a62;
    --ec-deep: #022a20;
    --pl-foil: linear-gradient(135deg, #a8741a, #ffe9a6 28%, #d4a63c 50%, #fff1c2 72%, #9a6614);
    --pl-gold: #b98523;
    --pl-title: 'Marcellus', 'Times New Roman', serif;
    --pl-arabic: 'Amiri', serif;
    --pl-script: 'Great Vibes', 'Marcellus', cursive;
    --pl-text: 'Nunito Sans', system-ui, sans-serif;
    /* girih: an eight-pointed star lattice in faint gold */
    --pl-girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='none' stroke='%23e2b85a' stroke-opacity='.2' stroke-width='1'%3E%3Cpath d='M22 22h36v36H22z'/%3E%3Cpath d='M40 14.5 65.5 40 40 65.5 14.5 40z'/%3E%3Cpath d='M0 0l14.5 14.5M80 0 65.5 14.5M0 80l14.5-14.5M80 80 65.5 65.5M40 0v14.5M40 80V65.5M0 40h14.5M80 40H65.5'/%3E%3Ccircle cx='40' cy='40' r='6'/%3E%3C/g%3E%3C/svg%3E");
}

body.pl {
    background:
        var(--pl-girih) 0 0 / 80px 80px,
        radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--ec-glow) 22%, transparent), transparent 55%),
        radial-gradient(ellipse at 50% 110%, color-mix(in srgb, var(--ec-glow) 18%, transparent), transparent 60%),
        linear-gradient(180deg, var(--ec-deep), var(--ec-bg) 35%, var(--ec-bg2));
    background-attachment: fixed;
    color: var(--ec-ink);
    font-family: var(--pl-text);
    font-size: 1.02rem;
    line-height: 1.8;
}
.pl-defs { position: absolute; }

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

/* ---------- shared ornaments ---------- */
.pl-arabesque { position: absolute; width: 5rem; height: 5rem; overflow: visible; pointer-events: none; }
.pl-arabesque--bl { bottom: 16px; left: 16px; }
.pl-arabesque--br { bottom: 16px; right: 16px; transform: scaleX(-1); }
.pl-arabesque--tl { top: 16px; left: 16px; transform: scaleY(-1); }
.pl-arabesque--tr { top: 16px; right: 16px; transform: scale(-1); }
.pl-divider { display: block; width: 11rem; height: auto; margin: .3rem auto; overflow: visible; }
.pl-divider--small { width: 8.5rem; }

/* ---------- cover ---------- */
.pl-cover {
    --ec-open-ms: 650;
    display: flex; flex-direction: column; align-items: center;
    min-height: 100vh;
    padding: 0 1.25rem 2rem;
    text-align: center;
    overflow: hidden;
    transition: opacity .6s ease;
}
.ec-js .pl-cover {
    background:
        var(--pl-girih) 0 0 / 80px 80px,
        radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--ec-glow) 22%, transparent), transparent 55%),
        radial-gradient(ellipse at 50% 110%, color-mix(in srgb, var(--ec-glow) 18%, transparent), transparent 60%),
        linear-gradient(180deg, var(--ec-deep), var(--ec-bg) 35%, var(--ec-bg2));
}
.pl-mihrab { position: absolute; left: 10px; right: 10px; top: 10px; bottom: 10px; width: calc(100% - 20px); height: calc(100% - 20px); pointer-events: none; }
.pl-finial { position: absolute; top: 0; left: 50%; width: 3rem; translate: -50% -10%; overflow: visible; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--ec-glow) 60%, transparent)); }

.pl-stars { position: absolute; inset: 0; pointer-events: none; }
.pl-stars span {
    position: absolute; left: var(--x); top: var(--y);
    width: var(--s); height: var(--s);
    border-radius: 50%;
    background: #fff;
    opacity: .3;
    transition: opacity .8s ease var(--d);
}
.pl-cover.is-lit .pl-stars span { opacity: 1; box-shadow: 0 0 6px #fff; }
@media (prefers-reduced-motion: no-preference) {
    .pl-cover.is-lit .pl-stars span { animation: pl-twinkle 2.4s ease-in-out var(--d) infinite; }
}
@keyframes pl-twinkle { 50% { opacity: .35; } }

/* lanterns hang from the top on gold chains of different lengths */
.pl-lanterns { position: relative; width: 100%; max-width: 26rem; height: 16rem; flex: none; touch-action: none; }
.pl-lantern {
    position: absolute; top: 0; left: var(--left);
    width: 58px; height: calc(var(--len) + 112px);
    margin-left: -29px;
    padding: var(--len) 0 0; border: 0; background: none; cursor: pointer;
    transform-origin: 50% 0;
    -webkit-tap-highlight-color: transparent;
}
/* the chain: little gold links */
.pl-lantern::before {
    content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: calc(var(--len) + 2px); margin-left: -1px;
    background: repeating-linear-gradient(180deg, #f6d27a 0 4px, #8a5a10 4px 5px, transparent 5px 7px);
}
.pl-lantern::after { content: ''; position: absolute; inset: 0 -8px; }
.pl-lantern svg { position: relative; display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 8px 10px rgb(0 0 0 / .35)); }
.pl-lantern:focus-visible { outline: 2px solid var(--ec-glow); outline-offset: 4px; }
@media (prefers-reduced-motion: no-preference) {
    .pl-lantern { animation: pl-sway 4.2s ease-in-out var(--delay) infinite; }
}
@keyframes pl-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.pl-lantern__halo {
    position: absolute; left: 50%; top: calc(var(--len) + 62px);
    width: 150px; height: 150px; margin: -75px 0 0 -75px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--ec-glow) 70%, transparent), transparent 65%);
    opacity: 0; transform: scale(.5);
    transition: opacity .6s ease, transform .6s ease;
    pointer-events: none;
}
.pl-lantern.is-lit { --pl-glass: var(--ec-glow); --pl-glass-mid: #fff3c4; --pl-flame: 1; }
.pl-lantern.is-lit .pl-lantern__halo { opacity: 1; transform: scale(1); }

.pl-cover__body { position: relative; display: flex; flex-direction: column; align-items: center; gap: .45rem; margin-top: .6rem; }
.pl-sky { display: flex; align-items: flex-end; justify-content: center; gap: 1.6rem; }
.pl-moon { width: 4.6rem; height: 4.6rem; overflow: visible; transition: filter .8s ease; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ec-glow) 40%, transparent)); }
.pl-cover.is-lit .pl-moon { filter: drop-shadow(0 0 18px var(--ec-glow)); }
.pl-ketupat { width: 1.9rem; height: 3.8rem; overflow: visible; margin-bottom: .2rem; }
@media (prefers-reduced-motion: no-preference) {
    .pl-ketupat { animation: pl-sway 3.6s ease-in-out infinite; transform-origin: 50% 0; }
    .pl-ketupat--right { animation-delay: -1.8s; }
}
.pl-eid {
    --ec-foil-1: #b07c1e; --ec-foil-2: #fff1c2; --ec-foil-3: #e8bf58;
    margin: .1rem 0 0;
    font-family: var(--pl-title); font-size: 1.8rem; letter-spacing: .1em;
    opacity: 0; transform: translateY(6px);
    transition: opacity .8s ease .2s, transform .8s ease .2s;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--ec-glow) 55%, transparent));
}
.pl-cover.is-lit .pl-eid { opacity: 1; transform: none; }
.pl-cover__from .ec-from__label { font-size: .7rem; letter-spacing: .3em; color: var(--ec-muted); opacity: 1; }
.pl-cover__from .ec-from__name { font-family: var(--pl-title); font-size: 1.3rem; color: var(--ec-ink); }
.pl-cover__to .ec-recipient__greeting { color: var(--ec-muted); letter-spacing: .3em; }
.pl-cover__to .ec-recipient__name {
    max-width: 20rem; font-family: var(--pl-title); font-size: clamp(1.9rem, 8.5vw, 2.4rem); line-height: 1.15; text-wrap: balance;
    background: var(--pl-foil); -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 2px 2px rgb(0 0 0 / .35));
}

.pl-hint { margin: .3rem 0 0; display: flex; align-items: center; gap: .6rem; font-size: .9rem; color: var(--ec-muted); }
.pl-hint__count { padding: .1rem .6rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--ec-glow) 60%, transparent); color: var(--ec-glow); font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-skip { padding: .3rem .8rem; border: 0; background: none; cursor: pointer; color: var(--ec-muted); font: inherit; font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; }

.ec-opening .pl-cover { opacity: 0; }

/* ---------- the card ---------- */
.pl-page {
    position: relative; z-index: 1;
    width: 100%; max-width: 32rem;
    margin: 0 auto;
    padding: 0 1.1rem;
    cursor: pointer;
}

/* hero: an ivory mihrab with a star band and small lanterns */
.pl-hero {
    position: relative;
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 3rem 0 3.4rem;
}
.pl-arch { position: relative; width: min(90vw, 350px); aspect-ratio: 300 / 470; }
.pl-arch__frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 24px 34px rgb(0 0 0 / .45)); }
.pl-arch__inside {
    position: absolute; left: 12%; right: 12%; top: 36%; bottom: 14%;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    gap: .15rem;
    text-align: center;
    color: var(--ec-card-ink);
}
.pl-crest { display: block; flex: none; width: 4.4rem; height: 4.4rem; overflow: visible; margin-bottom: .2rem; }
.pl-arabic {
    --ec-foil-1: #6e4206; --ec-foil-2: #e2ad3f; --ec-foil-3: #9c6410;
    margin: 0; font-family: var(--pl-arabic); font-weight: 700; font-size: 2.1rem; line-height: 1.5;
    filter: drop-shadow(0 1px 0 #fff8e6);
}
.pl-hero__to .ec-recipient__greeting { color: var(--ec-card-muted); letter-spacing: .32em; }
.pl-hero__to .ec-recipient__name { font-family: var(--pl-script); font-size: clamp(1.9rem, 8.5vw, 2.4rem); line-height: 1.15; color: var(--ec-card-ink); }
.pl-hero__title {
    --ec-foil-1: #6e4206; --ec-foil-2: #e2ad3f; --ec-foil-3: #9c6410;
    margin: .25rem 0 0;
    font-family: var(--pl-title); font-weight: 400;
    font-size: clamp(1.75rem, 8vw, 2.2rem); line-height: 1.15;
    text-wrap: balance; overflow-wrap: break-word;
    filter: drop-shadow(0 1px 0 #fff8e6) drop-shadow(0 3px 4px color-mix(in srgb, var(--ec-card-ink) 25%, transparent));
}
.pl-scroll { position: absolute; bottom: 1rem; left: 0; right: 0; margin: 0; text-align: center; font-size: .85rem; color: var(--ec-muted); }
@media (prefers-reduced-motion: no-preference) {
    .pl-scroll span { display: inline-block; animation: pl-bob 1.8s ease-in-out infinite; }
}
@keyframes pl-bob { 50% { transform: translateY(5px); } }

/* photos in arched windows with a beaded gold frame */
.pl-gallery { padding: .5rem 0 3rem; text-align: center; }
.pl-gallery .pl-divider { margin-bottom: 1.6rem; }
.pl-photos { width: min(70%, 15rem); margin: 0 auto; }
.pl-photos .ec-photos__item {
    margin: 0; padding: 7px;
    border-radius: 999px 999px 8px 8px;
    background: radial-gradient(circle, #fff1c2 1.4px, transparent 1.8px) 0 0 / 9px 9px, var(--pl-foil);
    box-shadow: 0 22px 36px -18px rgb(0 0 0 / .6);
}
.pl-photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 999px 999px 4px 4px; border: 3px solid var(--ec-card); }
.pl-gallery__hint { margin: 1.4rem 0 0; font-size: .85rem; color: var(--ec-muted); }

/* the letter: ivory with a star band, arabesque corners, a crest watermark */
.pl-letter {
    position: relative;
    margin-top: 1rem;
    padding: 3.6rem clamp(1.8rem, 8vw, 2.8rem) 4.2rem;
    background-color: var(--ec-card);
    color: var(--ec-card-ink);
    box-shadow: 0 36px 64px -34px rgb(0 0 0 / .65);
    text-align: center;
}
.pl-letter::before { content: ''; position: absolute; inset: 12px; border: 1px solid #c9962e; pointer-events: none; }
.pl-letter__band {
    position: absolute; left: 12px; right: 12px; top: 12px; height: 14px;
    background:
        radial-gradient(circle, #c9962e 2px, transparent 2.5px) 7px 7px / 14px 14px repeat-x,
        linear-gradient(#c9962e, #c9962e) 0 0 / 100% 1px no-repeat,
        linear-gradient(#c9962e, #c9962e) 0 100% / 100% 1px no-repeat;
}
.pl-letter .pl-arabesque { width: 3.8rem; height: 3.8rem; }
.pl-letter .pl-arabesque--tl { top: 30px; left: 6px; }
.pl-letter .pl-arabesque--tr { top: 30px; right: 6px; }
.pl-letter .pl-arabesque--bl { bottom: 6px; left: 6px; }
.pl-letter .pl-arabesque--br { bottom: 6px; right: 6px; }
.pl-letter__watermark { position: absolute; left: 50%; top: 50%; width: 13rem; translate: -50% -50%; opacity: .07; pointer-events: none; }
.pl-letter__message { position: relative; font-size: 1.05rem; text-align: left; color: color-mix(in srgb, var(--ec-card-ink) 92%, transparent); }
/* an illuminated initial */
.pl-letter__message .ec-initial {
    float: left; margin: .12em .16em 0 0; padding: .08em .16em .02em;
    font-family: var(--pl-title); font-size: 2.7em; line-height: .9;
    color: #fff4d8;
    background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--ec-bg2) 60%, white), var(--ec-bg) 75%);
    border: 2px solid #d4a63c;
    outline: 1px solid #d4a63c; outline-offset: 2px;
    border-radius: 3px;
}
.pl-letter__sign { position: relative; margin-top: 2rem; }
.pl-letter__closing { margin: .3rem 0 0; font-style: italic; color: var(--ec-card-muted); }
.pl-signature { color: var(--ec-card-ink); }
.pl-signature text { font-family: var(--pl-script); }

/* a gold eight-pointed seal with the sender's initial */
.pl-seal { position: absolute; left: 50%; bottom: -2.2rem; width: 4.6rem; height: 4.6rem; translate: -50% 0; filter: drop-shadow(0 6px 10px rgb(0 0 0 / .45)); }
.pl-seal svg { width: 100%; height: 100%; overflow: visible; }
.pl-seal span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--pl-title); font-size: 1.5rem; color: #ffe9a6; }

.pl-actions { margin-top: 4.4rem; color: var(--ec-ink); }
.pl-actions .ec-actions__button { border-color: #d4a63c; color: var(--ec-ink); }
.pl-tap-hint { margin: .6rem 0 0; text-align: center; font-size: .8rem; color: var(--ec-muted); }
.pl-branding { color: var(--ec-muted); }

@media (min-width: 768px) {
    .pl-page { max-width: 34rem; }
}

/* picture mode: the arch and the letter fit the stage */
.ec-image .pl-hero { padding: 2.4rem 0 1.4rem; }
.ec-image .pl-letter { margin-bottom: 3rem; }
