:root {
    --accent-blue: #00e5ff;
    --chrome-light: #ffffff;
    --chrome-mid: #aeb6bf;
    --chrome-dark: #34495e;
    
    /* High contrast heavy chrome text gradient */
    --chrome-text-grad: linear-gradient(
        to bottom,
        #ffffff 0%,
        #d5dadd 30%,
        #11151a 50%,
        #ffffff 55%,
        #828d99 80%,
        #2a3540 100%
    );
}

* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }

body {
    background-color: #000;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.cyberpunk-font { font-family: 'Orbitron', sans-serif; }
.cyber-mono { font-family: 'Share Tech Mono', monospace; }

/* The Brushed Silver Background Plate */
#chrome-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
    background: 
        /* SVG Noise for grain */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.1'/%3E%3C/svg%3E"),
        /* Brushed vertical lines */
        repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 4px),
        /* Broad metallic sweeps */
        linear-gradient(135deg, #d5dadd 0%, #aeb6bf 40%, #7d8a97 50%, #d5dadd 60%, #9aa5b1 100%);
    box-shadow: inset 0 0 100px rgba(0,0,0,0.5); /* Vignette */
}

/* Scanner Bar */
.scanner-bar {
    position: fixed; left: 0; top: 110%; width: 100%; height: 8px; z-index: 5;
    background: linear-gradient(to bottom, rgba(0,229,255,0.8), rgba(255,255,255,1), rgba(0,229,255,0.8));
    box-shadow: 0 0 20px 8px rgba(0, 229, 255, 0.4), 0 0 60px 20px rgba(0, 229, 255, 0.2);
    opacity: 0; mix-blend-mode: screen; /* Starts hidden until wipe */
}

/* Chrome Stars */
#star-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none;
}
.star {
    position: absolute;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.8));
}

/* Main Content Wrapper */
#main-content {
    position: relative; z-index: 2; width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}

/* Shattering Text */
.title {
    font-size: 6.5rem; font-weight: bold; letter-spacing: 0.3rem; margin-bottom: 50px;
    text-transform: uppercase; display: flex; gap: 0.5rem;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.5));
    position: relative; z-index: 6; /* Always visible above the gates */
}

/* Engraved Form */
#access-form {
    position: relative; z-index: 3; /* Hidden behind the gates until they open */
    background: var(--chrome-text-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.chrome-text {
    background: var(--chrome-text-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Individual Character Container */
.char-container {
    position: relative; display: inline-block; width: auto; height: 1.2em;
}

/* Invisible placeholder for spacing */
.char-placeholder {
    visibility: hidden; font-family: 'Michroma', sans-serif; background: none;
}

/* The 4 Shards inside each character */
.shard {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    font-family: 'Orbitron', sans-serif;
    background: var(--chrome-text-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.1s;
    transform-origin: center center;
}

/* Engraved UI */
.engraved-form-container {
    width: 100%; max-width: 400px;
    display: flex; flex-direction: column; gap: 20px;
}

.engraved-input, .engraved-btn {
    width: 100%; padding: 18px; font-size: 1.1rem; text-align: center; letter-spacing: 0.2rem;
    outline: none; border: none; border-radius: 8px;
    background: transparent;
}

/* Physical Carved-In Look */
.engraved-input {
    color: #444; font-weight: bold;
    /* Inner shadow to look carved deeply into the metal */
    box-shadow: 
        inset 5px 5px 12px rgba(0, 0, 0, 0.4), 
        inset -5px -5px 12px rgba(255, 255, 255, 0.9),
        0 2px 2px rgba(255, 255, 255, 0.6);
    transition: all 0.3s;
}

.engraved-input:focus {
    color: var(--accent-blue);
    box-shadow: 
        inset 5px 5px 15px rgba(0, 0, 0, 0.6), 
        inset -5px -5px 12px rgba(255, 255, 255, 0.9),
        0 2px 2px rgba(255, 255, 255, 0.6),
        inset 0 0 10px rgba(0, 229, 255, 0.3);
}

.engraved-input::placeholder { color: #888; text-shadow: 1px 1px 1px rgba(255,255,255,0.3); }

/* Physical Raised Button */
.engraved-btn {
    color: var(--chrome-dark); font-weight: bold;
    /* Outer shadow to look raised from the metal */
    box-shadow: 
        7px 7px 15px rgba(0, 0, 0, 0.3), 
        -7px -7px 15px rgba(255, 255, 255, 0.9),
        inset 1px 1px 2px rgba(255, 255, 255, 0.5);
    transition: all 0.1s;
}

.engraved-btn:active {
    /* Pushed in state */
    box-shadow: 
        inset 5px 5px 12px rgba(0, 0, 0, 0.4), 
        inset -5px -5px 12px rgba(255, 255, 255, 0.9);
    transform: translateY(2px);
    color: var(--accent-blue);
}

.engraved-text {
    text-align: center; font-weight: bold; font-size: 1.2rem;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

/* Custom Cursor & Trail */
#custom-cursor {
    position: fixed; top: 0; left: 0; width: 80px; height: 80px;
    border-radius: 50%; pointer-events: none; z-index: 9999;
    transform: translate(-50%, -50%);
    backdrop-filter: url(#svg-ripple) hue-rotate(180deg) blur(2px);
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: inset 0 0 15px rgba(0, 229, 255, 0.3);
}

.cursor-trail {
    position: fixed; top: 0; left: 0; width: 10px; height: 10px;
    border-radius: 50%; pointer-events: none; z-index: 9998;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #fff, var(--accent-blue));
    box-shadow: 0 0 10px var(--accent-blue);
    opacity: 0.8;
}
.trail-1 { width: 8px; height: 8px; opacity: 0.6; }
.trail-2 { width: 6px; height: 6px; opacity: 0.4; }
.trail-3 { width: 4px; height: 4px; opacity: 0.2; }
.trail-4 { width: 2px; height: 2px; opacity: 0.1; }

/* Intro Blackout */
#intro-blackout {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: #02040a; z-index: 4;
}
#decryption-text {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 1.5rem; letter-spacing: 0.5rem; z-index: 6;
}

@media (max-width: 768px) {
    .title { 
        font-size: 14vw; /* Massively expanded to span the entire screen width */
        gap: 0; 
        letter-spacing: 0;
        margin-bottom: 40px;
        white-space: nowrap; /* Prevent wrapping */
    }
    .input-wrapper { 
        flex-direction: column; 
        align-items: center;
        gap: 20px;
    }
    .email-input { 
        width: 60vw; /* Exactly 3/5ths of screen width */
        max-width: none; 
        text-align: center;
        padding: 12px 20px;
    }
    .submit-btn { 
        width: 60vw; /* Exactly 3/5ths of screen width */
        max-width: none; 
    }
    #decryption-text { 
        font-size: 1.2rem; 
        letter-spacing: 0.2rem; 
        width: auto; 
        text-align: left; 
        top: 75%; 
        left: 10%; 
        transform: none;
    }
    /* Hide custom cursor on mobile to avoid blocking native touches */
    #custom-cursor, .cursor-trail { display: none !important; }
}

/* Success Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(2, 4, 10, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.5s ease;
}
.modal-overlay.active {
    opacity: 1; pointer-events: auto;
}
.modal-box {
    width: 90%; max-width: 500px;
    padding: 40px; text-align: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #d5dadd 0%, #aeb6bf 40%, #7d8a97 50%, #d5dadd 60%, #9aa5b1 100%);
    box-shadow: 
        10px 10px 30px rgba(0, 0, 0, 0.7), 
        -5px -5px 20px rgba(255, 255, 255, 0.5),
        inset 2px 2px 5px rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.4);
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .modal-box {
    transform: scale(1);
}
.carved-text {
    color: #444; font-weight: bold;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8), -1px -1px 2px rgba(0,0,0,0.5);
}
.carved-text.accent {
    color: var(--accent-blue);
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5), -1px -1px 2px rgba(0,0,0,0.8), 0 0 10px rgba(0,229,255,0.5);
}
