/* Secret door to the Back Room (mini casino), hidden in the hero logo.
   A gold door outline is traced like a laser cut seen from behind a metal plate, glows, and dims away.
   Knock three times on the logo: the eye bar slides open, eyes look out, and the logo fades into the door. */

.hero-right { flex-direction: column; }

.logo-door {
    position: relative;
    width: 100%;
    max-width: 420px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
.logo-door .hero-logo-img { max-width: none; margin-left: 0; margin-right: 0; }
.logo-door:focus-visible .ld-gold { animation-play-state: paused; stroke-dashoffset: 0; opacity: .9; }

.ld-fx {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    aspect-ratio: 1;
    pointer-events: none;
}

/* The door outline: a dark metal plate seen from behind, a cutter traces the shape from the other side.
   Only the glow shows. A white-gold spark leads, a softer gold line stays behind it, the whole outline
   holds for a few seconds, then dims away. Timing and brightness are driven from backroom-door.js. */
.ld-outline { --ld-core: #d9a548; --ld-halo: #c8741f; --ld-head: #fff1c4; --ld-knob: #f0c26a; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ld-outline path, .ld-outline circle { fill: none; }
.ld-halo, .ld-gold, .ld-head { stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: 0; }
.ld-halo { stroke: var(--ld-halo); stroke-width: 1.9px; filter: blur(5px); }
.ld-gold { stroke: var(--ld-core); stroke-width: .42px; filter: drop-shadow(0 0 2px rgba(255, 190, 90, .8)); }
.ld-head { stroke: var(--ld-head); stroke-width: .62px; filter: drop-shadow(0 0 3px #ffd98a) drop-shadow(0 0 8px rgba(255, 170, 60, .8)); }
.ld-spark { fill: #fffbe8 !important; stroke: none; r: .8px; opacity: 0; filter: drop-shadow(0 0 3px #fff0c0) drop-shadow(0 0 9px #ffb347); }
.ld-sparkglow { stroke: none; opacity: 0; }
.ld-knob { fill: var(--ld-knob) !important; stroke: none; opacity: 0; filter: drop-shadow(0 0 3px rgba(255, 190, 90, .9)); }
.logo-door:focus-visible .ld-gold { opacity: 1 !important; stroke-dashoffset: 0 !important; }

/* light view: the plate is paper, so the line becomes a deep amber ink that still glows a little */
:root[data-theme="light"] .ld-outline { --ld-core: #a8651a; --ld-halo: #e89a3c; --ld-head: #7a3f0a; --ld-knob: #a8651a; }
:root[data-theme="light"] .ld-halo { filter: blur(4px); }
:root[data-theme="light"] .ld-gold { filter: drop-shadow(0 0 2px rgba(232, 154, 60, .8)); }
:root[data-theme="light"] .ld-head { filter: drop-shadow(0 0 4px rgba(232, 154, 60, .9)); }
:root[data-theme="light"] .ld-spark { fill: #7a3f0a !important; filter: drop-shadow(0 0 4px #e89a3c); }

/* the slot behind the eye bar, with the eyes */
.ld-slot, .ld-cover {
    position: absolute;
    left: 25%;
    top: 31.5%;
    width: 53%;
    height: 8%;
    opacity: 0;
}
.ld-slot {
    background: #030202;
    box-shadow: inset 0 .6vmin 1.4vmin #000, 0 0 0 1px rgba(212, 162, 76, .25);
    overflow: hidden;
}
.ld-cover {
    background: url("Images/cl-logo-dark.png") 53.19% 34.24% / 188.68% 1250% no-repeat;
    transition: transform .7s cubic-bezier(.6, 0, .2, 1);
}
.logo-door.opening .ld-slot, .logo-door.opening .ld-cover { opacity: 1; }
.logo-door.open .ld-cover { transform: translateX(78%); }

.ld-eyes { position: absolute; inset: 0; }
.ld-eyes i {
    position: absolute;
    top: 50%;
    width: 9%;
    height: 34%;
    margin-top: -1.2%;
    border-radius: 50%;
    background: #e9e1cf;
    box-shadow: 0 0 6px rgba(255, 230, 190, .35);
    transform: translateY(-50%);
    animation: ldBlink 3.2s infinite;
}
.ld-eyes i:first-child { left: 27%; }
.ld-eyes i:last-child { left: 56%; }
.ld-eyes i::after {
    content: '';
    position: absolute;
    top: 16%;
    left: 32%;
    width: 38%;
    height: 70%;
    border-radius: 50%;
    background: #140b06;
    transition: left .35s;
}
.ld-eyes.l i::after { left: 8%; }
.ld-eyes.r i::after { left: 56%; }
.ld-eyes.squint i { height: 14%; }
@keyframes ldBlink { 0%, 44%, 50%, 100% { transform: translateY(-50%) scaleY(1); } 47% { transform: translateY(-50%) scaleY(.1); } }

/* knocking */
.logo-door.knock .hero-logo-img { animation: ldKnock .2s; }
@keyframes ldKnock { 30% { transform: translateX(-3px) rotate(-.4deg); } 60% { transform: translateX(2px); } }
.ld-knock {
    position: absolute;
    z-index: 3;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 22px;
    color: rgba(237, 231, 217, .75);
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-8deg);
    animation: ldKnockText .9s ease-out forwards;
}
@keyframes ldKnockText { from { opacity: 0; transform: translate(-50%, -30%) rotate(-8deg) scale(.8); } 20% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -140%) rotate(-8deg); } }

/* the way through: the logo zooms toward the eyes and fades into the door */
.logo-door.through { transition: transform 1s cubic-bezier(.6, 0, .4, 1); transform: scale(1.35); transform-origin: 50% 36%; }
.ld-veil {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(ellipse 40% 50% at var(--x, 50%) var(--y, 40%), rgba(51, 25, 15, .9), #070505 70%);
    transition: opacity .8s ease .1s;
}
.ld-veil.on { opacity: 1; pointer-events: auto; }

/* a tiny handwritten "knock x3" beside the doorknob, lit together with the knob */
.ld-note {
    position: absolute;
    left: 81.5%;
    top: 62%;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    color: var(--ld-knob, #f0c26a);
    text-shadow: 0 0 6px rgba(255, 190, 90, .55);
    opacity: 0;
    transform: translateY(-50%) rotate(-7deg);
    user-select: none;
}
.ld-note i { font-style: normal; font-size: 11px; opacity: .85; }
:root[data-theme="light"] .ld-note { color: #8a521a; text-shadow: none; }

/* a broken neon sign in the product ticker */
.ticker-neon {
    font-size: 9.5px;
    color: #ff7a5c;
    text-decoration: none;
    text-shadow: 0 0 3px #ff5533, 0 0 9px rgba(200, 52, 26, .8);
    opacity: .55;
    animation: ldNeon 7s steps(1) infinite;
}
.ticker-neon:hover { opacity: 1; }
@keyframes ldNeon {
    0%, 100% { opacity: .55; }
    11% { opacity: .12; } 12% { opacity: .55; } 13% { opacity: .08; } 15% { opacity: .5; }
    52% { opacity: .55; } 53% { opacity: .2; } 54% { opacity: .55; }
    78% { opacity: .1; } 81% { opacity: .55; }
}

/* a tiny door in the footer */
footer { position: relative; }
.footer-door {
    position: absolute;
    left: 50%;
    bottom: 9px;
    transform: translateX(-50%);
    color: #D4A24C;
    opacity: .3;
    line-height: 0;
    transition: opacity .2s;
}
.footer-door:hover, .footer-door:focus-visible { opacity: .9; }

@media (max-width: 960px) {
    .logo-door { max-width: 260px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
    .ld-gold { stroke-dashoffset: 0; opacity: .4; }
    .ld-knob { opacity: .3; }
    .ld-note { opacity: .45; }
    .ticker-neon { animation: none; }
}
