/* ═══════════════════════════════════════════════════════════════
   THE SHADOWLAND GALLERY — Gate Styles
   "The Lock" — Where the worthy prove themselves
   ═══════════════════════════════════════════════════════════════ */

:root {
    --ember: #e8420f;
    --ember-glow: #ff6a1a;
    --ember-dark: #8b1a1a;
    --blood: #6b0000;
    --void: #050505;
    --void-mid: #0a0a0a;
    --void-light: #111111;
    --ash: #1a1a1a;
    --smoke: #2a2a2a;
    --bone: #c8bfb0;
    --ghost: #888278;
    --mist: #55504a;
    --font-display: 'Cinzel Decorative', 'Cinzel', serif;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Rajdhani', sans-serif;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--void);
    color: var(--bone);
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ─── BACKGROUND EFFECTS ──────────────────────────────────────── */

#embers {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.fog-container {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.fog {
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(30, 10, 5, 0.3) 0%, transparent 70%);
    opacity: 0.4;
}

.fog-1 {
    top: -50%;
    left: -50%;
    animation: fogDrift1 30s ease-in-out infinite;
}

.fog-2 {
    bottom: -50%;
    right: -50%;
    animation: fogDrift2 25s ease-in-out infinite reverse;
}

@keyframes fogDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(5%, 3%) scale(1.05); }
    66% { transform: translate(-3%, 5%) scale(0.95); }
}

@keyframes fogDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-4%, -3%) scale(1.05); }
    66% { transform: translate(3%, -5%) scale(0.95); }
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 100%);
}

/* ─── GATE CONTAINER ──────────────────────────────────────────── */

.gate-container {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px 24px;
    max-width: 520px;
    width: 100%;
    animation: gateReveal 2s ease-out;
}

@keyframes gateReveal {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ─── SIGIL ───────────────────────────────────────────────────── */

.sigil-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    position: relative;
}

.sigil {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(232, 66, 15, 0.3));
    animation: sigilFloat 6s ease-in-out infinite;
}

@keyframes sigilFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.pulse-ring {
    animation: pulseRing 3s ease-in-out infinite;
    transform-origin: center;
}

@keyframes pulseRing {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.sigil-star {
    animation: sigilRotate 40s linear infinite;
    transform-origin: 100px 100px;
}

@keyframes sigilRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.eye-pupil {
    animation: eyePulse 4s ease-in-out infinite;
}

@keyframes eyePulse {
    0%, 100% { r: 6; opacity: 0.9; }
    50% { r: 8; opacity: 1; }
}

/* ─── TITLE ───────────────────────────────────────────────────── */

.gallery-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: 8px;
}

.title-the {
    font-family: var(--font-heading);
    font-size: 14px;
    letter-spacing: 12px;
    text-transform: uppercase;
    color: var(--ghost);
    font-weight: 400;
    animation: titleFade 2s ease-out 0.3s both;
}

.title-main {
    font-family: var(--font-display);
    font-size: clamp(32px, 8vw, 52px);
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(180deg, var(--bone) 0%, var(--ember-glow) 50%, var(--ember) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 15px rgba(232, 66, 15, 0.3));
    line-height: 1.1;
    animation: titleFade 2s ease-out 0.5s both;
}

.title-sub {
    font-family: var(--font-heading);
    font-size: clamp(18px, 4vw, 26px);
    letter-spacing: 10px;
    text-transform: uppercase;
    color: var(--ghost);
    font-weight: 400;
    margin-top: 2px;
    animation: titleFade 2s ease-out 0.7s both;
}

@keyframes titleFade {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.gallery-tagline {
    font-family: var(--font-body);
    font-size: 14px;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--mist);
    font-weight: 300;
    margin-bottom: 24px;
    animation: titleFade 2s ease-out 0.9s both;
}

/* ─── DIVIDER ─────────────────────────────────────────────────── */

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 auto 32px;
    max-width: 280px;
    animation: titleFade 2s ease-out 1s both;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ember-dark), transparent);
}

.divider-icon {
    color: var(--ember);
    font-size: 10px;
    animation: diamondPulse 3s ease-in-out infinite;
}

@keyframes diamondPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ─── LOCK FORM ───────────────────────────────────────────────── */

.lock-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    animation: titleFade 2s ease-out 1.2s both;
}

.lock-prompt {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--ghost);
    margin-bottom: 24px;
    font-weight: 300;
    line-height: 1.6;
}

.lock-prompt strong {
    color: var(--bone);
    font-weight: 600;
}

/* ─── ENTER BUTTON ───────────────────────────────────────────── */

.enter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 18px 48px;
    background: var(--ember);
    border: 1px solid rgba(232, 66, 15, 0.5);
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 15px;
    letter-spacing: 4px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
    animation: titleFade 1.5s ease-out 1s both;
}

.enter-btn:hover {
    background: var(--ember-glow);
    letter-spacing: 6px;
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(232, 66, 15, 0.4), 0 0 60px rgba(232, 66, 15, 0.15);
}

.enter-btn .btn-glow {
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: conic-gradient(from 0deg, transparent, rgba(232, 66, 15, 0.4), transparent, transparent);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: -1;
    animation: glowRotate 4s linear infinite;
}

.enter-btn:hover .btn-glow {
    opacity: 1;
}

.members-note {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--ghost);
    font-weight: 300;
    letter-spacing: 0.5px;
    margin-top: 4px;
    animation: titleFade 1.5s ease-out 1.2s both;
}

.members-note a {
    color: var(--ember);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.members-note a:hover {
    color: var(--ember-glow);
}

.verify-form {
    margin-bottom: 16px;
}

.input-wrapper {
    position: relative;
    display: flex;
    background: var(--void-light);
    border: 1px solid var(--smoke);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.4s, box-shadow 0.4s;
}

.input-wrapper:focus-within {
    border-color: var(--ember);
    box-shadow: 0 0 30px rgba(232, 66, 15, 0.15), inset 0 0 20px rgba(232, 66, 15, 0.05);
}

.input-glow {
    position: absolute;
    inset: -1px;
    border-radius: 12px;
    background: conic-gradient(from var(--glow-angle, 0deg), transparent, var(--ember), transparent, transparent);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s;
}

.input-wrapper:focus-within .input-glow {
    opacity: 0.3;
    animation: glowRotate 4s linear infinite;
}

@keyframes glowRotate {
    to { --glow-angle: 360deg; }
}

@property --glow-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px 20px;
    color: var(--bone);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.5px;
    outline: none;
    min-width: 0;
}

.input-wrapper input::placeholder {
    color: var(--mist);
    font-weight: 300;
}

.input-wrapper button {
    background: var(--ember);
    border: none;
    padding: 16px 28px;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 3px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, letter-spacing 0.3s;
    white-space: nowrap;
    position: relative;
}

.input-wrapper button:hover {
    background: var(--ember-glow);
    letter-spacing: 5px;
}

.btn-loading {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: var(--ember);
}

.btn-loading .spinner {
    animation: spin 0.8s linear infinite;
    transform-origin: center;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

button.loading .btn-text { opacity: 0; }
button.loading .btn-loading { display: flex; }

/* ─── MESSAGES ────────────────────────────────────────────────── */

.error-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 14px 20px;
    background: rgba(232, 66, 15, 0.08);
    border: 1px solid rgba(232, 66, 15, 0.2);
    border-radius: 10px;
    color: #ff8a6a;
    font-size: 14px;
    animation: errorShake 0.5s ease-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.hidden { display: none !important; }

.success-msg {
    padding: 40px 20px;
    text-align: center;
}

.welcome-name {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--ember-glow);
    margin-bottom: 8px;
    animation: titleFade 1s ease-out both;
}

.welcome-text {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--ghost);
    font-weight: 300;
    letter-spacing: 3px;
    animation: titleFade 1s ease-out 0.3s both;
}

/* ─── PORTAL EFFECT ───────────────────────────────────────────── */

.portal-effect {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    position: relative;
}

.portal-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--ember);
    border-radius: 50%;
    animation: portalExpand 1.5s ease-out infinite;
}

.ring-2 { animation-delay: 0.3s; }
.ring-3 { animation-delay: 0.6s; }

@keyframes portalExpand {
    0% { transform: scale(0.3); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* ─── BOTTOM LINK ─────────────────────────────────────────────── */

.members-only {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--mist);
    margin-top: 32px;
    font-weight: 300;
    letter-spacing: 1px;
    animation: titleFade 2s ease-out 1.5s both;
}

.members-only a {
    color: var(--ember);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.members-only a:hover {
    color: var(--ember-glow);
}

/* ─── AMBIENT TOGGLE ──────────────────────────────────────────── */

.ambient-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--smoke);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ghost);
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.ambient-toggle:hover {
    border-color: var(--ember);
    color: var(--ember);
}

.ambient-toggle.active {
    color: var(--ember-glow);
    border-color: var(--ember);
    box-shadow: 0 0 15px rgba(232, 66, 15, 0.2);
}

/* ─── WHOLE PAGE TRANSITION ───────────────────────────────────── */

body.entering {
    animation: enterPortal 1.5s ease-in forwards;
}

@keyframes enterPortal {
    0% { filter: brightness(1); }
    50% { filter: brightness(2) saturate(0); }
    100% { filter: brightness(0); opacity: 0; }
}

/* ─── RESPONSIVE ──────────────────────────────────────────────── */

@media (max-width: 600px) {
    .gate-container {
        padding: 30px 16px;
    }

    .sigil-container {
        width: 90px;
        height: 90px;
        margin-bottom: 24px;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .input-wrapper input {
        padding: 14px 16px;
        text-align: center;
    }

    .input-wrapper button {
        padding: 14px;
    }

    .title-the { letter-spacing: 8px; font-size: 12px; }
    .title-sub { letter-spacing: 6px; }

    .enter-btn {
        padding: 16px 32px;
        font-size: 14px;
        letter-spacing: 3px;
    }
}

/* ─── SCROLLBAR ───────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--smoke); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ember-dark); }