/*
 * Entry gate
 * data-age-verification: true | false
 * data-persistence-mode: session | local
 * data-persistence-days: localStorage expiry in days
 * data-close-on-escape: true | false
 */

.entry-gate {
    --gate-bg: rgba(7, 7, 7, 0.88);
    --gate-panel-bg: linear-gradient(170deg, rgba(11, 11, 11, 0.96) 0%, rgba(17, 15, 10, 0.98) 100%);
    --gate-accent: #cfa15b;
    --gate-accent-soft: rgba(207, 161, 91, 0.36);
    --gate-text: #f5eee2;
    --gate-text-muted: rgba(245, 238, 226, 0.72);

    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 42px);
    background: radial-gradient(circle at 20% 16%, rgba(207, 161, 91, 0.09), transparent 45%),
        radial-gradient(circle at 84% 86%, rgba(169, 123, 59, 0.09), transparent 44%),
        var(--gate-bg);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 520ms ease, visibility 520ms ease;
}

.entry-gate::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 3px 3px;
    mix-blend-mode: soft-light;
    opacity: 0.35;
}

.entry-gate.is-active {
    opacity: 1;
    visibility: visible;
}

.entry-gate.is-leaving {
    opacity: 0;
}

.entry-gate__backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 7, 7, 0.44) 0%, rgba(5, 5, 5, 0.88) 100%);
}

/* ─── artwork inside the panel — sits behind all text ───────────────────── */
.entry-gate__visual {
    /* stretch edge-to-edge and fill the full panel height */
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: inherit;
    line-height: 0;
}

.entry-gate__artwork {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* center on the glowing chest/hands — upper-centre of the image */
    object-position: center 20%;
    /* fade all edges so artwork dissolves into the panel background */
    -webkit-mask-image: radial-gradient(
        ellipse 88% 82% at 50% 38%,
        black 18%,
        rgba(0,0,0,0.55) 48%,
        transparent 72%
    );
    mask-image: radial-gradient(
        ellipse 88% 82% at 50% 38%,
        black 18%,
        rgba(0,0,0,0.55) 48%,
        transparent 72%
    );
    opacity: 0.62;
    animation: gate-breathe 14s ease-in-out infinite;
}

@keyframes gate-breathe {
    0%, 100% { transform: scale(1) translateY(0); }
    50%       { transform: scale(1.022) translateY(-3px); }
}

.entry-gate__shell {
    position: relative; /* establishes stacking context — artwork is absolute inside */
    width: min(680px, 100%);
    border: 1px solid var(--gate-accent-soft);
    border-radius: 2px;
    background: var(--gate-panel-bg);
    color: var(--gate-text);
    padding: clamp(26px, 5vw, 54px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.64), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    transform: translateY(14px) scale(0.985);
    filter: blur(3px);
    opacity: 0;
    transition: transform 560ms cubic-bezier(0.2, 0.8, 0.18, 1), opacity 560ms ease, filter 560ms ease;
    overflow: hidden;
}

.entry-gate.is-active .entry-gate__shell {
    transform: translateY(0) scale(1);
    filter: blur(0);
    opacity: 1;
}

.entry-gate__shell::before,
.entry-gate__shell::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.entry-gate__shell::before {
    inset: 14px;
    border: 1px solid rgba(207, 161, 91, 0.22);
}

.entry-gate__shell::after {
    inset: -1px;
    background: linear-gradient(120deg, rgba(207, 161, 91, 0.22), transparent 38%, transparent 62%, rgba(207, 161, 91, 0.18));
    mix-blend-mode: screen;
    opacity: 0.52;
}

/* dark scrim behind all text so it reads cleanly over the artwork */
.entry-gate__eyebrow ~ *,
.entry-gate__eyebrow {
    position: relative;
    z-index: 1;
}

.entry-gate__shell::before {
    /* repurpose the inner-frame pseudo as a bottom-weighted scrim */
    inset: 14px;
    border: 1px solid rgba(207, 161, 91, 0.22);
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(6, 5, 4, 0.52) 38%,
        rgba(6, 5, 4, 0.78) 100%
    );
    pointer-events: none;
}

.entry-gate__eyebrow {
    margin: 0 0 12px;
    font-size: 0.78rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--gate-accent);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}

.entry-gate__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(2rem, 6.5vw, 4rem);
    line-height: 1.05;
    color: var(--gate-text);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95), 0 1px 3px rgba(0, 0, 0, 0.8);
}

.entry-gate__copy {
    margin: 18px 0 0;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.65;
    color: rgba(245, 238, 226, 0.92);
    max-width: 44ch;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

.entry-gate__adult-note {
    margin: 16px 0 0;
    font-size: 0.93rem;
    color: rgba(245, 238, 226, 0.90);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

.entry-gate__check {
    margin: 22px 0 0;
    display: inline-flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.92rem;
    color: rgba(245, 238, 226, 0.92);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

.entry-gate__check input {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: var(--gate-accent);
}

.entry-gate__actions {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.entry-gate__enter,
.entry-gate__leave {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 13px 20px;
    transition: transform 180ms ease, border-color 220ms ease, background 220ms ease, color 220ms ease;
}

.entry-gate__enter {
    background: linear-gradient(180deg, #e2bb7e 0%, #c79347 100%);
    color: #0b0907;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34), 0 0 24px rgba(207, 161, 91, 0.15);
}

.entry-gate.is-confirmed .entry-gate__enter:not([disabled]) {
    animation: gate-enter-call 2.6s ease-in-out infinite;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.34),
        0 0 30px rgba(207, 161, 91, 0.30),
        0 0 58px rgba(207, 161, 91, 0.18);
}

.entry-gate__enter:hover,
.entry-gate__enter:focus-visible {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #efcc93 0%, #d4a35c 100%);
}

.entry-gate__enter[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

@keyframes gate-enter-call {
    0%,
    100% {
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
    50% {
        transform: translateY(-1px) scale(1.02);
        filter: brightness(1.07);
    }
}

.entry-gate__leave {
    background: transparent;
    color: rgba(245, 238, 226, 0.88);
    border-color: rgba(245, 238, 226, 0.34);
}

.entry-gate__leave:hover,
.entry-gate__leave:focus-visible {
    border-color: var(--gate-accent-soft);
    color: var(--gate-text);
}


.entry-gate__enter:focus-visible,
.entry-gate__leave:focus-visible,
.entry-gate__check input:focus-visible {
    outline: 2px solid var(--gate-accent);
    outline-offset: 3px;
}


body.entry-gate-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .entry-gate {
        align-items: end;
    }

    .entry-gate__shell {
        width: 100%;
        padding: 24px 20px 26px;
    }

    .entry-gate__visual {
        /* already absolute — no margin override needed on mobile */
    }

    .entry-gate__actions {
        flex-direction: column;
    }

    .entry-gate__enter,
    .entry-gate__leave {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .entry-gate,
    .entry-gate__shell,
    .entry-gate__enter,
    .entry-gate__leave,
    .entry-gate__artwork {
        transition-duration: 1ms !important;
        animation-duration: 1ms !important;
    }
}
