/* =============================================================================================
   WEBSITE-LAUNCH CURTAIN (owner, 20 Nov 2026) - homepage only, only while the CMS switch is on.
   Markup: Areas/Public/Views/Home/V4/_LaunchCurtain.cshtml   Script: js/public/launch-curtain.js
   A theatre stage: two velvet curtain panels (folds drawn with gradients), a scalloped valance with a
   gold fringe, a plaque, and a gold cord hanging down to the launch button. Pressing it: the cord
   tugs, two party poppers fire, each curtain GATHERS to its side (scaleX from its outer edge, so the
   folds bunch like real drapery) and then slides fully off the screen, the valance lifts away, and the
   layer is removed - only the normal homepage remains (confetti keeps falling over it briefly).
   Tokens below are this component's own palette (stage velvet + gold), not brand colours.
   ============================================================================================= */
.lc {
    --lc-velvet-deep: #2a0306;
    --lc-velvet-dark: #4a070c;
    --lc-velvet-mid: #7a0f17;
    --lc-velvet-light: #a3202a;
    --lc-velvet-sheen: #c0414a;
    --lc-gold-dark: #7a5512;
    --lc-gold: #c99a2e;
    --lc-gold-light: #f3d77f;
    --lc-stage: #090103;
    --lc-plaque: #fffaf0;
    --lc-plaque-ink: #2a1a08;
    --lc-plaque-mut: #6b5634;
    --lc-val-h: clamp(34px, 4.6vh, 44px);   /* thin, like the site's top bar (owner, 20 Nov 2026) */
    --lc-ease-open: cubic-bezier(.62, .02, .18, 1);

    position: fixed; inset: 0; z-index: 2147483000;
    overflow: hidden; isolation: isolate;
    font-family: 'Poppins', system-ui, sans-serif;
}
/* Page under the curtain must not scroll; an already-opened visitor never sees it at all. */
html.lc-lock, html.lc-lock body { overflow: hidden !important; }
html.lc-skip .lc { display: none !important; }

/* ---- stage (the dark space behind the curtains) ---- */
.lc__stage {
    position: absolute; inset: 0; z-index: 0;
    background: radial-gradient(ellipse at 50% 40%, #2a080b 0%, var(--lc-stage) 70%);
    transition: opacity 2.2s ease .8s;   /* the homepage shows through as the curtains part */
}

/* ---- the two velvet panels ----
   .lc__panel = position + the OPENING transform (gather to the side).
   .lc__cloth = the velvet + the idle sway. They are separate on purpose: Chrome does not start a
   transform transition while an animation is running on that same property, so a sway on the panel
   itself made the curtains jump open instead of drawing apart. */
.lc__panel {
    position: absolute; top: 0; bottom: 0; width: 50.6%; z-index: 1;
    will-change: transform;
    transition: transform 2.7s var(--lc-ease-open) .35s, filter 2.7s ease .35s;
}
.lc__cloth {
    position: absolute; inset: 0; display: block;
    background:
        /* light from above, shadow pooling at the floor */
        linear-gradient(to bottom, rgba(0,0,0,.55) 0%, rgba(0,0,0,.05) 22%, rgba(255,255,255,.04) 55%, rgba(0,0,0,.18) 86%, rgba(0,0,0,.55) 100%),
        /* the folds: dark valley -> lit ridge -> dark valley, repeated */
        repeating-linear-gradient(90deg,
            var(--lc-velvet-deep) 0%,
            var(--lc-velvet-dark) 1.1%,
            var(--lc-velvet-mid) 2.3%,
            var(--lc-velvet-light) 3.3%,
            var(--lc-velvet-sheen) 3.8%,
            var(--lc-velvet-light) 4.4%,
            var(--lc-velvet-mid) 5.5%,
            var(--lc-velvet-dark) 6.6%,
            var(--lc-velvet-deep) 7.4%);
    box-shadow: inset 0 -40px 60px rgba(0,0,0,.45);
    animation: lcSway 7s ease-in-out infinite;
}
.lc__panel--l .lc__cloth { transform-origin: 0 0; }
.lc__panel--r .lc__cloth { transform-origin: 100% 0; animation-delay: -3.5s; }
.lc__panel--l { left: 0; transform-origin: 0 50%; }
.lc__panel--r { right: 0; transform-origin: 100% 50%; }
/* the meeting edges: a deep shadow where the two curtains overlap */
.lc__panel--l::after, .lc__panel--r::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 26px; pointer-events: none;
}
.lc__panel--l::after { right: 0; background: linear-gradient(to left, rgba(0,0,0,.65), transparent); }
.lc__panel--r::after { left: 0; background: linear-gradient(to right, rgba(0,0,0,.65), transparent); }
/* gold trim + fringe along the hem */
.lc__trim {
    position: absolute; left: 0; right: 0; bottom: 0; height: 30px;
    background:
        repeating-linear-gradient(90deg, var(--lc-gold-dark) 0 2px, var(--lc-gold) 2px 4px, var(--lc-gold-light) 4px 5px, var(--lc-gold) 5px 7px) bottom / 100% 18px no-repeat,
        linear-gradient(to bottom, var(--lc-gold-light), var(--lc-gold) 45%, var(--lc-gold-dark)) top / 100% 12px no-repeat;
    box-shadow: 0 -2px 6px rgba(0,0,0,.4);
}
@keyframes lcSway { 0%, 100% { transform: skewX(0deg); } 50% { transform: skewX(.35deg); } }

/* ---- valance (pelmet) with scalloped edge + fringe ---- */
.lc__valance {
    position: absolute; left: -2%; right: -2%; top: 0; height: var(--lc-val-h); z-index: 4;
    background:
        linear-gradient(to bottom, rgba(0,0,0,.5), rgba(0,0,0,0) 40%, rgba(0,0,0,.35)),
        repeating-linear-gradient(90deg, var(--lc-velvet-dark) 0 1.2%, var(--lc-velvet-mid) 2.2%, var(--lc-velvet-light) 3%, var(--lc-velvet-mid) 3.8%, var(--lc-velvet-dark) 5%);
    /* scallops along the bottom edge */
    -webkit-mask: radial-gradient(circle at 50% 0, #000 70%, transparent 71%) 0 100% / 34px 10px repeat-x, linear-gradient(#000, #000) 0 0 / 100% calc(100% - 5px) no-repeat;
            mask: radial-gradient(circle at 50% 0, #000 70%, transparent 71%) 0 100% / 34px 10px repeat-x, linear-gradient(#000, #000) 0 0 / 100% calc(100% - 5px) no-repeat;
    box-shadow: 0 4px 12px rgba(0,0,0,.55);
    transition: transform 1.3s var(--lc-ease-open) 2.1s;
}
.lc__fringe {
    position: absolute; left: 0; right: 0; bottom: 5px; height: 4px;
    background: linear-gradient(to bottom, var(--lc-gold-light), var(--lc-gold) 60%, var(--lc-gold-dark));
}

/* ---- plaque ---- */
.lc__plaque {
    position: absolute; z-index: 6; left: 50%; top: calc(var(--lc-val-h) + 5vh);
    transform: translateX(-50%);
    width: min(88vw, 540px); box-sizing: border-box;
    padding: 22px 28px 20px; text-align: center;
    background: linear-gradient(to bottom, var(--lc-plaque), #f4ead2);
    border: 2px solid var(--lc-gold);
    outline: 1px solid var(--lc-gold-light); outline-offset: -7px;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 0 0 6px rgba(201,154,46,.18);
    transition: opacity .45s ease, transform .6s ease;
}
.lc__logo { display: block; height: clamp(44px, 7vh, 64px); width: auto; margin: 0 auto 10px; }
.lc__title {
    margin: 0; color: var(--lc-plaque-ink);
    font-family: 'Playfair Display', Georgia, serif; font-weight: 700; line-height: 1.2;
    font-size: clamp(20px, 3.2vw, 30px);
}
.lc__sub { margin: 8px 0 0; color: var(--lc-plaque-mut); font-size: clamp(13px, 1.6vw, 16px); font-weight: 500; letter-spacing: .02em; }

/* ---- the cord, the button it is tied to, and the tassel ---- */
.lc__pull {
    position: absolute; z-index: 5; left: 50%; top: var(--lc-val-h);
    display: flex; flex-direction: column; align-items: center;
    transform: translateX(-50%);
    transition: opacity .45s ease;
}
.lc__cord {
    display: block; width: 7px; height: clamp(260px, 56vh, 540px);
    background: repeating-linear-gradient(-45deg, var(--lc-gold-dark) 0 3px, var(--lc-gold) 3px 6px, var(--lc-gold-light) 6px 8px, var(--lc-gold) 8px 11px);
    border-radius: 4px;
    box-shadow: 2px 0 3px rgba(0,0,0,.45);
}
.lc__btn {
    position: relative; margin-top: -2px;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 30px; border-radius: 999px; cursor: pointer; white-space: nowrap;
    font: 700 clamp(14px, 1.6vw, 17px)/1 'Poppins', system-ui, sans-serif; letter-spacing: .04em;
    color: var(--lc-plaque-ink);
    background: linear-gradient(to bottom, var(--lc-gold-light), var(--lc-gold) 55%, var(--lc-gold-dark));
    border: 2px solid var(--lc-gold-light);
    box-shadow: 0 6px 0 var(--lc-gold-dark), 0 14px 30px rgba(0,0,0,.55);
    transition: transform .2s ease, box-shadow .2s ease;
    animation: lcGlow 2.4s ease-in-out infinite;
}
.lc__btn:hover { transform: translateY(-2px); }
.lc__btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--lc-gold-dark), 0 8px 18px rgba(0,0,0,.5); }
.lc__btn:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.lc__knot { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--lc-gold-light), var(--lc-gold-dark)); box-shadow: inset 0 0 0 2px var(--lc-gold-dark); }
.lc__tassel {
    display: block; width: 18px; height: 44px; margin-top: 6px;
    background: repeating-linear-gradient(90deg, var(--lc-gold-dark) 0 2px, var(--lc-gold) 2px 4px, var(--lc-gold-light) 4px 5px);
    -webkit-mask: linear-gradient(to bottom, #000 70%, transparent);
            mask: linear-gradient(to bottom, #000 70%, transparent);
    border-radius: 6px 6px 3px 3px;
    animation: lcSwing 3s ease-in-out infinite; transform-origin: 50% 0;
}
@keyframes lcGlow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(243,215,127,0)); } 50% { filter: drop-shadow(0 0 14px rgba(243,215,127,.65)); } }
@keyframes lcSwing { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

/* ---- party poppers: gold-striped cones in the bottom corners, angled at the centre ---- */
.lc__popper {
    position: absolute; z-index: 6; bottom: 18px; width: 54px; height: 86px;
    background:
        repeating-linear-gradient(135deg, var(--lc-gold-light) 0 7px, var(--lc-gold) 7px 14px, var(--lc-velvet-light) 14px 21px, var(--lc-gold) 21px 28px);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    border-radius: 4px;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.55));
    transition: transform .25s cubic-bezier(.3,1.6,.5,1), opacity .5s ease;
}
.lc__popper--l { left: 22px; transform: rotate(38deg); transform-origin: 50% 100%; }
.lc__popper--r { right: 22px; transform: rotate(-38deg); transform-origin: 50% 100%; }
/* the recoil when they fire */
.lc.is-popped .lc__popper--l { transform: rotate(32deg) translate(-6px, 10px) scale(.94); }
.lc.is-popped .lc__popper--r { transform: rotate(-32deg) translate(6px, 10px) scale(.94); }
/* the confetti canvas lives on <body> (so it keeps falling after the curtain is gone) */
.lc-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 2147483001; pointer-events: none; }

/* =========================== OPENING ===========================
   1. the cord is tugged and the poppers fire;
   2. each curtain draws fully to its side, the folds gathering (scaleX from its outer edge);
   3. the gathered drapes slide completely OFF the screen and the valance lifts out of view;
   4. the script then removes the layer - the normal homepage is all that remains. */
.lc.is-pulled .lc__pull { animation: lcTug .45s ease-out; }
@keyframes lcTug { 0% { transform: translate(-50%, 0); } 40% { transform: translate(-50%, 26px); } 100% { transform: translate(-50%, 0); } }
.lc.is-opening .lc__plaque { opacity: 0; transform: translate(-50%, -24px); }
.lc.is-opening .lc__pull { opacity: 0; transition-delay: .3s; }
.lc.is-opening .lc__cloth { animation: none; }
.lc.is-opening .lc__panel { transition: none; }
.lc.is-opening .lc__panel--l { animation: lcOpenL 6.5s linear forwards; }   /* slow, stately draw (owner) */
.lc.is-opening .lc__panel--r { animation: lcOpenR 6.5s linear forwards; }
/* Even, unhurried draw (owner, 20 Nov 2026): ~4.3 s parting to the sides, ~2.2 s gliding off screen.
   The easing is baked into the keyframes (smoothstep points) and played LINEAR, so the curtains move at a
   steady pace instead of hanging still and then rushing - a single ease curve did exactly that. */
@keyframes lcOpenL {
    0% { transform: translateX(0) scaleX(1.000) skewX(-0.00deg); filter: brightness(1.000); }
    11.0% { transform: translateX(0) scaleX(0.941) skewX(-0.11deg); filter: brightness(0.989); }
    22.0% { transform: translateX(0) scaleX(0.793) skewX(-0.39deg); filter: brightness(0.961); }
    33.0% { transform: translateX(0) scaleX(0.600) skewX(-0.75deg); filter: brightness(0.925); }
    44.0% { transform: translateX(0) scaleX(0.407) skewX(-1.11deg); filter: brightness(0.889); }
    55.0% { transform: translateX(0) scaleX(0.259) skewX(-1.39deg); filter: brightness(0.861); }
    66% { transform: translateX(0) scaleX(0.200) skewX(-1.50deg); filter: brightness(0.850); }
    77.3% { transform: translateX(-29.8%) scaleX(.2) skewX(-1.50deg); filter: brightness(.85); }
    88.7% { transform: translateX(-85.2%) scaleX(.2) skewX(-1.50deg); filter: brightness(.85); }
    100% { transform: translateX(-115.0%) scaleX(.2) skewX(-1.50deg); filter: brightness(.85); }
}
@keyframes lcOpenR {
    0% { transform: translateX(0) scaleX(1.000) skewX(0.00deg); filter: brightness(1.000); }
    11.0% { transform: translateX(0) scaleX(0.941) skewX(0.11deg); filter: brightness(0.989); }
    22.0% { transform: translateX(0) scaleX(0.793) skewX(0.39deg); filter: brightness(0.961); }
    33.0% { transform: translateX(0) scaleX(0.600) skewX(0.75deg); filter: brightness(0.925); }
    44.0% { transform: translateX(0) scaleX(0.407) skewX(1.11deg); filter: brightness(0.889); }
    55.0% { transform: translateX(0) scaleX(0.259) skewX(1.39deg); filter: brightness(0.861); }
    66% { transform: translateX(0) scaleX(0.200) skewX(1.50deg); filter: brightness(0.850); }
    77.3% { transform: translateX(29.8%) scaleX(.2) skewX(1.50deg); filter: brightness(.85); }
    88.7% { transform: translateX(85.2%) scaleX(.2) skewX(1.50deg); filter: brightness(.85); }
    100% { transform: translateX(115.0%) scaleX(.2) skewX(1.50deg); filter: brightness(.85); }
}
.lc.is-opening .lc__valance { transform: translateY(-120%); transition: transform 1.8s cubic-bezier(.45,.05,.3,1) 4.4s; }
.lc.is-opening .lc__stage { opacity: 0; }
.lc.is-opening .lc__popper { opacity: 0; transition: transform .25s ease, opacity .8s ease 2.6s; }

/* phones: a shorter cord so the button stays on screen, smaller scallops */
@media (max-width: 640px) {
    .lc__cord { height: clamp(230px, 50vh, 420px); }
    .lc__plaque { padding: 18px 18px 16px; }
    .lc__valance {
        -webkit-mask-size: 26px 8px, 100% calc(100% - 4px);
                mask-size: 26px 8px, 100% calc(100% - 4px);
    }
}

/* reduced motion: no sway, glow or swing; opening is a plain fade */
@media (prefers-reduced-motion: reduce) {
    .lc__cloth, .lc__btn, .lc__tassel { animation: none !important; }
    .lc.is-opening .lc__panel--l, .lc.is-opening .lc__panel--r { animation-duration: .01s; }
    .lc.is-opening .lc__valance, .lc.is-opening .lc__stage { transition-duration: .01s; transition-delay: 0s; }
    .lc__popper { display: none; }
}
/* ---- plaque: DMA logo + the 70-years badge side by side; the optional text box under the subtitle ---- */
.lc__logos { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0 auto 10px; }
.lc__logos .lc__logo { margin: 0; }
.lc__logo--badge { height: clamp(46px, 7.4vh, 68px); }
.lc__logos .lc__logo + .lc__logo { padding-left: 18px; border-left: 1px solid rgba(122, 85, 18, .35); }
.lc__extra { margin: 12px auto 0; padding: 10px 14px; max-width: 46ch; white-space: pre-line;
    font-size: clamp(13px, 1.5vw, 15px); line-height: 1.5; color: var(--lc-plaque-ink);
    background: rgba(201, 154, 46, .12); border: 1px dashed rgba(201, 154, 46, .6); border-radius: 10px; }

/* Welcome slide (home slider) shares the curtain's lifetime: already opened in this tab = hidden before
   paint, so a reload never flashes it; the hero script then removes it and its dot. */
.lc-skip .hero-slide--welcome, .lc-skip .hero-dot[data-welcome] { display: none !important; }
