:root {
    --bg: #000;
    --fg: #fff;
    --accent: #ff0000;
    --grey-1: #080808;
    --grey-2: #151515;
    --grey-3: #2a2a2a;
    --pixel-font: 'DotGothic16', sans-serif;
    --main-font: 'Space Grotesk', sans-serif;
    --header-font: 'Syne', sans-serif;
}

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

@media (hover: hover) and (pointer: fine) {
    * { cursor: none !important; }
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--main-font);
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    width: 100vw;
}

/* ========================================
   1. ENTER SCREEN (AUTOMATED BOOT & GLITCH)
   ======================================== */

#enter-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow: hidden;
}

.data-stream {
    position: absolute;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    padding: 20px;
    font-family: var(--pixel-font);
    font-size: 0.5rem;
    color: var(--grey-3);
    overflow: hidden;
    line-height: 1.5;
    opacity: 0.3;
}

@media (max-width: 768px) {
    .data-stream {
        display: none;
    }
}

.boot-sequence {
    position: absolute;
    top: 40px;
    right: 40px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: right;
}

.boot-line {
    font-family: var(--pixel-font);
    font-size: 0.6rem;
    color: var(--grey-3);
    opacity: 0;
    animation: bootIn 0.5s forwards;
    animation-delay: var(--d);
}

@media (max-width: 768px) {
    .boot-sequence {
        top: 15px;
        right: 0;
        left: 0;
        width: 100%;
        align-items: center;
        text-align: center;
        gap: 5px;
    }
    
    .boot-line {
        font-size: 0.4rem;
        max-width: 90%;
        line-height: 1.4;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .boot-sequence {
        top: 12px;
        gap: 4px;
    }
    
    .boot-line {
        font-size: 0.35rem;
        max-width: 95%;
    }
}

@media (max-width: 360px) {
    .boot-line {
        font-size: 0.32rem;
    }
}

@keyframes bootIn {
    to { opacity: 1; transform: translateX(-5px); }
}

.pixel-frame {
    border: 1px solid var(--grey-3);
    padding: 30px 60px;
    background: transparent;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0;
    transform: scale(0.9);
    animation: frameIn 1.5s forwards 1s;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    .pixel-frame {
        padding: 20px 40px;
    }
}

@media (max-width: 480px) {
    .pixel-frame {
        padding: 18px 30px;
    }
}

@keyframes frameIn {
    to { opacity: 1; transform: scale(1); }
}

.pixel-frame:hover {
    border-color: var(--fg);
    background: var(--fg);
}

.pixel-frame:hover .enter-text {
    color: var(--bg);
}

.enter-text {
    font-size: 1.2rem;
    letter-spacing: 1em;
    color: var(--grey-3);
    font-weight: 700;
    text-indent: 1em;
    transition: color 0.3s;
    position: relative;
}

@media (max-width: 768px) {
    .enter-text {
        font-size: 0.95rem;
        letter-spacing: 0.4em;
        text-indent: 0.4em;
    }
}

@media (max-width: 480px) {
    .enter-text {
        font-size: 0.85rem;
        letter-spacing: 0.25em;
        text-indent: 0.25em;
    }
}

@media (max-width: 360px) {
    .enter-text {
        font-size: 0.8rem;
        letter-spacing: 0.18em;
        text-indent: 0.18em;
    }
}

/* Glitch Layers for Text */
.enter-text::before, .enter-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.pixel-frame:hover .enter-text::before {
    animation: textGlitch 0.3s infinite;
    color: #f0f;
    z-index: -1;
}

.pixel-frame:hover .enter-text::after {
    animation: textGlitch 0.3s infinite reverse;
    color: #0ff;
    z-index: -2;
}

@keyframes textGlitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.touch-hint {
    margin-top: 20px;
    font-size: 0.6rem;
    letter-spacing: 0.4em;
    color: #444;
    opacity: 0;
    animation: fadeIn 1s forwards 2.5s, pulse 2s infinite;
}

@media (max-width: 768px) {
    .touch-hint {
        font-size: 0.5rem;
        letter-spacing: 0.2em;
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .touch-hint {
        font-size: 0.45rem;
        letter-spacing: 0.12em;
        margin-top: 12px;
    }
}

@media (max-width: 360px) {
    .touch-hint {
        font-size: 0.4rem;
        letter-spacing: 0.08em;
    }
}

@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.progress-container {
    width: 200px;
    margin-top: 40px;
    opacity: 0;
    animation: fadeIn 1s forwards 1.5s;
}

@media (max-width: 480px) {
    .progress-container {
        width: 200px;
        margin-top: 28px;
    }
}

.progress-bar {
    height: 1px;
    background: var(--grey-3);
    width: 0;
    animation: progressGrow 4s cubic-bezier(0.1, 0, 0.9, 1) forwards 2s;
}

@keyframes progressGrow {
    to { width: 100%; background: var(--accent); }
}

.progress-status {
    font-family: var(--pixel-font);
    font-size: 0.5rem;
    color: var(--grey-3);
    margin-top: 8px;
    text-align: center;
}

@media (max-width: 480px) {
    .progress-status {
        font-size: 0.45rem;
    }
}

@media (max-width: 360px) {
    .progress-status {
        font-size: 0.4rem;
    }
}

.system-log {
    margin-top: 30px;
    font-size: 0.6rem;
    letter-spacing: 0.5em;
    color: var(--grey-3);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: fadeIn 1s forwards 3s;
}

@media (max-width: 768px) {
    .system-log {
        font-size: 0.5rem;
        letter-spacing: 0.3em;
        margin-top: 22px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .system-log {
        font-size: 0.45rem;
        letter-spacing: 0.2em;
        margin-top: 18px;
        gap: 8px;
    }
}

@media (max-width: 360px) {
    .system-log {
        font-size: 0.4rem;
        letter-spacing: 0.12em;
    }
}

.pulse-red {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: blink 0.8s infinite;
}

/* Overlays for More Fuss */
.crt-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 1001;
}

.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 1002;
}

/* ========================================
   2. JUMPSCARE
   ======================================== */

#jumpscare {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

#jumpscare.active { display: flex; animation: shake 0.1s infinite; }

@keyframes shake {
    0% { transform: translate(0); }
    25% { transform: translate(5px, -5px); }
    50% { transform: translate(-5px, 5px); }
    75% { transform: translate(5px, 5px); }
}

#scare-canvas {
    width: 100%;
    height: 100%;
    filter: brightness(250%) contrast(180%) grayscale(1);
}

/* ========================================
   3. REVEAL
   ======================================== */

#reveal-screen {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    overflow: hidden;
}

.reveal-content,
.minimal-reveal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 100vw;
    padding: 0 15px;
}

.line {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    letter-spacing: 1.2em;
    opacity: 0;
    transform: translateY(30px);
    margin: 20px 0;
    transition: all 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    text-align: center;
}

@media (max-width: 768px) {
    .line {
        letter-spacing: 0.4em;
        margin: 12px 0;
        font-size: clamp(0.9rem, 5vw, 1.2rem);
        max-width: 90vw;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .line {
        letter-spacing: 0.25em;
        margin: 10px 0;
        font-size: clamp(0.8rem, 4.5vw, 1rem);
        max-width: 95vw;
    }
}

@media (max-width: 360px) {
    .line {
        letter-spacing: 0.15em;
        font-size: clamp(0.7rem, 4vw, 0.9rem);
    }
}

.line.bold { font-weight: 800; color: var(--accent); }

.reveal-active .line { opacity: 1; transform: translateY(0); }

.sub-line {
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    color: #333;
    opacity: 0;
    margin-top: 40px;
    transition: opacity 2s ease 2s;
    text-align: center;
    max-width: 90vw;
}

@media (max-width: 768px) {
    .sub-line {
        font-size: 0.55rem;
        letter-spacing: 0.2em;
        margin-top: 25px;
        max-width: 95vw;
    }
}

@media (max-width: 480px) {
    .sub-line {
        font-size: 0.48rem;
        letter-spacing: 0.12em;
        margin-top: 20px;
    }
}

@media (max-width: 360px) {
    .sub-line {
        font-size: 0.42rem;
        letter-spacing: 0.08em;
    }
}

.reveal-active .sub-line { opacity: 1; }

/* ========================================
   4. MAIN HUB
   ======================================== */

#main-hub {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 50px 20px;
    min-height: 100vh;
    overflow-y: auto;
    background: var(--bg);
    padding-bottom: 100px;
}

@media (max-width: 768px) {
    #main-hub {
        padding: 40px 15px;
        padding-bottom: 80px;
    }
}

@media (max-width: 480px) {
    #main-hub {
        padding: 32px 12px;
        padding-bottom: 70px;
    }
}

.noise-bg {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
}

.hub-header { 
    margin-bottom: 100px; 
    text-align: center; 
    padding: 0 20px;
}

.glitch-title {
    font-family: var(--header-font);
    font-size: clamp(3rem, 15vw, 7rem);
    letter-spacing: -0.06em;
    line-height: 0.85;
    text-transform: uppercase;
    word-break: break-word;
}

.hub-subtitle {
    font-size: 0.55rem;
    letter-spacing: 0.8em;
    color: #333;
    margin-top: 25px;
    max-width: 100%;
    text-align: center;
}

@media (max-width: 768px) {
    .hub-header {
        margin-bottom: 50px;
        padding: 0 10px;
        width: 100%;
    }
    
    .glitch-title {
        font-size: clamp(1.4rem, 8vw, 2.8rem);
        letter-spacing: -0.02em;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: none;
    }
    
    .hub-subtitle {
        font-size: 0.45rem;
        letter-spacing: 0.25em;
        margin-top: 15px;
        max-width: 95vw;
    }
}

@media (max-width: 480px) {
    .hub-header {
        margin-bottom: 40px;
        padding: 0 8px;
        width: 100%;
    }
    
    .glitch-title {
        font-size: clamp(1.1rem, 7vw, 2rem);
        letter-spacing: 0;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        line-height: 1;
    }
    
    .hub-subtitle {
        font-size: 0.38rem;
        letter-spacing: 0.15em;
        margin-top: 12px;
        max-width: 98vw;
    }
}

@media (max-width: 360px) {
    .glitch-title {
        font-size: clamp(0.95rem, 6vw, 1.5rem);
        letter-spacing: 0;
    }
    
    .hub-subtitle {
        font-size: 0.35rem;
        letter-spacing: 0.1em;
    }
}

.links-container {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 10px;
}

@media (max-width: 480px) {
    .links-container {
        padding: 0;
        gap: 14px;
    }
}

.hub-link {
    display: flex;
    flex-direction: column;
    padding: 30px;
    background: var(--grey-1);
    border: 1px solid var(--grey-2);
    text-decoration: none;
    position: relative;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 60px;
}

@media (max-width: 768px) {
    .hub-link {
        padding: 22px 18px;
        min-height: 72px;
    }
}

@media (max-width: 480px) {
    .hub-link {
        padding: 20px 16px;
        min-height: 70px;
    }
}

.hub-link:hover { background: var(--fg); border-color: var(--fg); }

.link-label { 
    font-weight: 700; 
    font-size: 0.95rem; 
    letter-spacing: 0.15em; 
    color: var(--fg); 
    transition: color 0.3s; 
}

.link-sub { 
    font-size: 0.55rem; 
    letter-spacing: 0.15em; 
    color: #444; 
    margin-top: 6px; 
    transition: color 0.3s; 
}

@media (max-width: 768px) {
    .link-label {
        font-size: 0.9rem;
        letter-spacing: 0.1em;
    }
    
    .link-sub {
        font-size: 0.5rem;
        letter-spacing: 0.1em;
    }
}

@media (max-width: 480px) {
    .link-label {
        font-size: 0.85rem;
        letter-spacing: 0.1em;
    }
    
    .link-sub {
        font-size: 0.5rem;
        letter-spacing: 0.09em;
        margin-top: 4px;
    }
}

.hub-link:hover .link-label { color: var(--bg); }
.hub-link:hover .link-sub { color: #888; }

.link-primary { border-color: rgba(255, 0, 0, 0.4); }
.link-primary:hover { background: var(--accent); border-color: var(--accent); }
.link-primary:hover .link-label { color: var(--fg); }
.link-primary:hover .link-sub { color: rgba(255, 255, 255, 0.6); }

/* Dropdown */
.dropdown-content { display: none; flex-direction: column; gap: 2px; margin-top: 2px; }
.dropdown-content.show { display: flex; }

.dropdown-item {
    background: var(--grey-1);
    padding: 18px 30px;
    text-decoration: none;
    font-size: 0.65rem;
    color: #444;
    letter-spacing: 0.25em;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 50px;
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .dropdown-item {
        padding: 15px 22px;
        font-size: 0.6rem;
        letter-spacing: 0.18em;
    }
}

@media (max-width: 480px) {
    .dropdown-item {
        padding: 14px 18px;
        font-size: 0.54rem;
        letter-spacing: 0.14em;
        min-height: 48px;
    }
}

.dropdown-item:hover { color: var(--fg); background: var(--grey-2); }

/* Cursor */
#custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 1px solid #fff;
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    #custom-cursor {
        display: block;
    }
}

.cursor-hover #custom-cursor { width: 60px; height: 60px; }

/* Footer */
.hub-footer {
    position: fixed;
    bottom: 30px;
    width: 100%;
    padding: 0 50px;
    display: flex;
    justify-content: space-between;
    font-size: 0.5rem;
    letter-spacing: 0.5em;
    color: #222;
    z-index: 10;
}

@media (max-width: 768px) {
    .hub-footer {
        position: static;
        padding: 20px 20px 30px;
        font-size: 0.45rem;
        letter-spacing: 0.35em;
        flex-direction: column;
        gap: 6px;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hub-footer {
        position: static;
        padding: 15px 15px 25px;
        font-size: 0.4rem;
        letter-spacing: 0.28em;
        text-align: center;
    }
}

@keyframes fadeIn { to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
