:root {
    --bg-color: #080808;
    --accent-color: #ffffff;
    --gray-text: #888888;
    --card-bg: rgba(15, 15, 15, 0.35);
    --border-color: rgba(255, 255, 255, 0.1);
}

/* --- CUSTOM CURSOR OVERRIDE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: none !important;
}

body {
    background-color: var(--bg-color);
    color: var(--accent-color);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    perspective: 1000px;
}

/* CUSTOM CURSOR: BURNING ARROW (monochrome) */
#cursor-fire {
    position: fixed;
    inset: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 999998;
}
#cursor-arrow {
    position: fixed;
    top: 0; left: 0;
    width: 14px; height: 21px;        /* the arrow's tip is the element's top-left pixel */
    pointer-events: none;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: transform;
}
#cursor-arrow svg {
    width: 100%; height: 100%;
    overflow: visible;
    /* the site's soft white glow, with a hairline dark edge so it reads on white too */
    filter: drop-shadow(0 0 0.6px rgba(0,0,0,0.9)) drop-shadow(0 0 2.5px rgba(255,255,255,0.75)) drop-shadow(0 0 8px rgba(255,255,255,0.25));
    transition: filter 0.2s ease;
}
/* glassy arrow like the site's cards: dark translucent body, thin bright outline */
#cursor-arrow path { fill: rgba(10,10,10,0.55); stroke: #ffffff; stroke-width: 1.1; stroke-linejoin: round; }
#cursor-arrow.hot svg {
    filter: drop-shadow(0 0 0.6px rgba(0,0,0,0.9)) drop-shadow(0 0 4px rgba(255,255,255,0.95)) drop-shadow(0 0 13px rgba(255,255,255,0.4));
}

/* Fixed Video Background & Atmospheric Effects */
.video-background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    overflow: hidden;
    background: #000;
}

.video-background-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) brightness(35%) contrast(120%);
    transition: opacity 0.5s ease;
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle, transparent 30%, rgba(0, 0, 0, 0.95) 100%);
    pointer-events: none;
}

/* Click to Enter Overlay */
#enter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: #000000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease, visibility 1s;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 2px;
    color: var(--gray-text);
}

#enter-overlay:hover { color: #fff; text-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }

/* SNAP SCROLLING ARCHITECTURE */
.scroll-container {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    -webkit-scroll-snap-type: y mandatory;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.scroll-container::-webkit-scrollbar { display: none; }

.section {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    position: relative;
    padding: 20px 20px 80px 20px;
}

/* Fade-In Content Wrapper */
.fade-content {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    will-change: opacity, transform;
}
.fade-content.visible { opacity: 1; transform: scale(1); }

/* --- UPDATED TOP CONTROLS & HOVER SLIDER --- */
.top-controls {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0;
    padding-right: 15px;
}
.mute-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.4rem;
    transition: 0.3s;
    padding-right: 12px;
}
.mute-btn:hover { color: #fff; text-shadow: 0 0 10px #fff; }

.volume-slider {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 0px;
    opacity: 0;
    pointer-events: none;
    height: 4px;
    background: #ffffff;
    border-radius: 2px;
    outline: none;
    transition: width 0.4s ease, opacity 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.top-controls:hover .volume-slider {
    width: 80px;
    opacity: 1;
    pointer-events: auto;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}
.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

/* --- TRANSPARENT CORNER VIEW COUNT WIDGET --- */
.view-count-corner {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--gray-text);
    transition: color 0.3s, transform 0.2s ease-out;
    background: transparent;
    pointer-events: none;
}

.view-count-corner:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* Central Bio Profile Card */
.profile-card { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; }
.avatar { width: 95px; height: 95px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); object-fit: cover; filter: grayscale(30%); margin-bottom: 15px;}
.avatar { transition: transform 0.12s ease, filter 0.3s ease, box-shadow 0.3s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Universal Gothic Title Styling */
.title-container { min-height: 4.5rem; display: flex; align-items: center; justify-content: center; }
.title-hero { margin-bottom: 2px; }
.title-section { margin-bottom: 40px; }

.gothic-title { font-family: 'Pirata One', serif; font-size: 3.5rem; font-weight: 400; letter-spacing: 1px; text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); display: inline-block; }
.gothic-title::after { content: '|'; animation: cursor-blink 0.8s infinite; margin-left: 4px; color: var(--accent-color); }
@keyframes cursor-blink { 50% { opacity: 0; } }

.location-tag { font-family: 'Share Tech Mono', monospace; font-size: 0.85rem; color: var(--gray-text); display: flex; align-items: center; gap: 5px; margin-bottom: 10px; }
.stars-divider { color: var(--gray-text); font-size: 0.6rem; letter-spacing: 4px; margin-bottom: 20px; }

/* 3D Tilt Targets & Box Base */
.tilt-target {
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
    will-change: transform;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    /* Keeps the blurred backdrop on a single stable compositor layer while it
       rotates, instead of letting Safari/Firefox re-rasterize the blur every
       frame — that re-rasterization is what shows up as flicker. */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

/* Discord Presence Widget */
.discord-widget { padding: 14px 18px; width: 100%; max-width: 290px; display: flex; align-items: center; gap: 12px; margin-bottom: 25px; }
.discord-avatar-wrapper { position: relative; width: 40px; height: 40px; transform: translateZ(20px); }
.discord-avatar { width: 100%; height: 100%; border-radius: 50%; background: #222; }
.discord-status-dot { position: absolute; bottom: -2px; right: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #0f0f0f; }
.discord-status-dot.online { background-color: #23a55a; }
.discord-status-dot.idle { background-color: #f0b232; }
.discord-status-dot.dnd { background-color: #f23f43; }
.discord-status-dot.offline { background-color: #747f8d; }
.discord-info { text-align: left; flex-grow: 1; transform: translateZ(15px); }
.discord-name-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; font-weight: 600; }
.discord-timestamp { font-size: 0.7rem; color: var(--gray-text); }
.discord-status-text { font-size: 0.75rem; color: #ccc; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* Social Icons */
.social-links { display: flex; gap: 22px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center; }
.social-icon { color: rgba(255, 255, 255, 0.5); font-size: 2.2rem; transition: color 0.3s, transform 0.3s, text-shadow 0.3s; text-decoration: none; display: inline-block; }
.social-icon:hover { color: #fff; transform: scale(1.2) translateY(-2px); text-shadow: 0 0 15px #ffffff, 0 0 30px rgba(255, 255, 255, 0.6); }

/* STATIC PINNED MUSIC PLAYER */
.music-player-wrapper {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 40px);
    max-width: 440px;
    perspective: 1000px;
}

.music-player { padding: 14px 22px; width: 100%; display: flex; align-items: center; justify-content: space-between;}
.track-info-side { display: flex; align-items: center; gap: 12px; width: 40%; transform: translateZ(15px); }
.track-art { width: 38px; height: 38px; border-radius: 6px; background-position: center; background-repeat: no-repeat; background-size: cover; filter: grayscale(100%) contrast(150%); }
.track-details { display: flex; flex-direction: column; overflow: hidden; }
.track-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-controls-side { display: flex; align-items: center; gap: 15px; width: 60%; justify-content: flex-end; transform: translateZ(20px); }
.progress-container { display: flex; align-items: center; gap: 8px; flex-grow: 1; }
.time-stamp { font-family: 'Share Tech Mono', monospace; font-size: 0.75rem; color: var(--gray-text); min-width: 28px; }
.progress-bar-wrapper { flex-grow: 1; height: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; position: relative; }
.progress-fill { height: 100%; background: #fff; width: 0%; border-radius: 2px; position: absolute; top: 0; left: 0; }
.control-buttons { display: flex; align-items: center; gap: 14px; color: rgba(255, 255, 255, 0.6); }
.control-btn { font-size: 1.3rem; transition: 0.3s; }
.control-btn:hover { color: #fff; transform: scale(1.2); text-shadow: 0 0 12px #ffffff, 0 0 25px rgba(255, 255, 255, 0.7); }
.control-btn:active { transform: scale(0.95); }
.play-pause-btn { font-size: 1.6rem; color: #fff; }

/* About Section */
.about-content { font-size: 1.1rem; line-height: 1.8; color: var(--gray-text); text-align: center; max-width: 600px; padding: 30px; }
.glow-word { display: inline-block; transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.2s; }
.glow-word:hover { color: #ffffff; text-shadow: 0 0 12px #ffffff, 0 0 20px rgba(255, 255, 255, 0.8); transform: scale(1.05); z-index: 2; }

/* Bento Grid */
.bento-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; width: 100%; }
.bento-box { padding: 25px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.bento-box h3 { font-family: 'Share Tech Mono', monospace; font-size: 1rem; color: #ccc; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; transform: translateZ(10px); }

/* Github Stats Widget */
.github-chart-container { width: 100%; display: flex; justify-content: center; transform: translateZ(15px); }
.github-chart-container img { width: 100%; object-fit: contain; filter: drop-shadow(0 0 5px rgba(255,255,255,0.1)); border-radius: 10px; pointer-events: none;}

/* Tech Spectrum */
.tech-list { display: flex; flex-direction: column; gap: 12px; transform: translateZ(15px); }
.tech-item { display: flex; flex-direction: column; gap: 5px; }
.tech-header { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 600; color: #aaa; }
.tech-bar-bg { width: 100%; height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; }
.tech-bar-fill { height: 100%; background: #fff; box-shadow: 0 0 10px #fff; }

/* Typing Pro Stats */
.typing-stats { transform: translateZ(15px); display: flex; justify-content: space-around; align-items: flex-end; }
.stat-group { display: flex; flex-direction: column; align-items: center; gap: 5px;}
.stat-val { font-family: 'Share Tech Mono', monospace; font-size: 3rem; font-weight: 800; color: #fff; text-shadow: 0 0 15px rgba(255,255,255,0.5); line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--gray-text); text-transform: uppercase; letter-spacing: 2px; }

/* Discord Block specific */
.discord-server-content { transform: translateZ(15px); text-align: center; }
.server-icon { font-size: 3.5rem; line-height: 1; margin-bottom: 10px; color: #fff; font-family: 'Pirata One', serif; filter: drop-shadow(0 0 10px rgba(255,255,255,0.5)); }
.join-btn { display: inline-block; margin-top: 15px; padding: 10px 25px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255,255,255,0.3); border-radius: 20px; color: #fff; text-decoration: none; font-family: 'Share Tech Mono', monospace; transition: 0.3s; }
.join-btn:hover { background: #fff; color: #000; box-shadow: 0 0 15px #fff; }

/* Projects Grid */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; width: 100%; margin-bottom: 30px; }
.project-card { padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: inherit; }
.project-card.full-span { grid-column: 1 / -1; }
.project-card:hover { box-shadow: 0 0 25px rgba(255, 255, 255, 0.3), inset 0 0 15px rgba(255,255,255,0.1); border-color: rgba(255, 255, 255, 0.4); }
.project-card:hover .project-title { text-shadow: 0 0 10px #fff; }
.project-card:hover .gh-icon { color: #fff; transform: scale(1.2); filter: drop-shadow(0 0 10px #fff); }
.project-info { transform: translateZ(15px); display: flex; flex-direction: column; gap: 8px; }
.project-title { font-family: 'Share Tech Mono', monospace; font-size: 1.1rem; color: #fff; transition: 0.3s; }
.project-desc { font-size: 0.75rem; color: var(--gray-text); }
.project-tags { display: flex; gap: 8px; margin-top: 5px; flex-wrap: wrap;}
.p-tag { font-size: 0.6rem; padding: 3px 8px; background: rgba(255,255,255,0.1); border-radius: 4px; font-family: 'Share Tech Mono', monospace;}
.gh-icon { font-size: 1.5rem; color: rgba(255,255,255,0.5); transform: translateZ(20px); transition: 0.3s; margin-left: 10px;}

/* Quick Category Navigation */
.category-nav { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.category-nav a { font-family: 'Share Tech Mono', monospace; font-size: 0.85rem; color: var(--gray-text); text-decoration: none; transition: color 0.3s, text-shadow 0.3s; }
.category-nav a:hover { color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, 0.8); }

/* --- SMART MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .gothic-title { font-size: 2.8rem; }
    .bento-grid, .projects-grid { grid-template-columns: 1fr; }
    .scroll-container { scroll-snap-type: none; }

    .section { height: auto; min-height: 100vh; min-height: 100svh; padding: 80px 20px 180px 20px; }

    /* --- VOLUME MOBILE OVERRIDES --- */
    .top-controls { gap: 12px; padding-right: 0; }
    .mute-btn { padding-right: 0; }
    .volume-slider { width: 80px; opacity: 1; pointer-events: auto; }

    /* --- VIEW COUNT CORNER MOBILE OVERRIDES --- */
    .view-count-corner {
        top: 25px;
        right: 25px;
        padding: 5px;
    }

    .music-player { flex-direction: column; gap: 15px; padding: 18px; }
    .track-info-side { width: 100%; justify-content: center; text-align: center; }
    .player-controls-side { width: 100%; justify-content: center; flex-direction: column; gap: 15px; }
    .progress-container { width: 100%; }
    .control-buttons { justify-content: center; width: 100%; }

    .social-icon { font-size: 1.8rem; }
    .discord-widget { max-width: 100%; }

    .tilt-target {
        background: rgba(15, 15, 15, 0.55) !important;
        border: 1px solid rgba(255, 255, 255, 0.25) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8) !important;
        transform: none !important;
    }

    .music-player-wrapper {
        bottom: max(20px, env(safe-area-inset-bottom) + 15px);
    }
    .track-info-side,
    .player-controls-side,
    .discord-info,
    .discord-avatar-wrapper {
        transform: none !important;
    }
    .discord-status-text { max-width: none; }
    .track-name, .discord-status-text { white-space: normal; word-wrap: break-word; }

    * { cursor: auto !important; }
    #cursor-arrow, #cursor-fire { display: none !important; }
}
/* The name's easter egg: a black screen and one line (see Dream.jsx) */
.dream {
    position: fixed;
    inset: 0;
    z-index: 9997;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: dream-in 0.8s ease forwards;
}
.dream.closing { animation: dream-out 0.7s ease forwards; }
@keyframes dream-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dream-out { from { opacity: 1; } to { opacity: 0; } }

.dream-line {
    max-width: 900px;
    text-align: center;
    font-family: 'Space Mono', 'Share Tech Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.05rem, 2.4vw, 1.9rem);
    line-height: 1.6;
    letter-spacing: 1px;
    color: #ececec;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    white-space: pre-wrap;
}
.dream-word { white-space: nowrap; }

/* a letter waits invisible, flickers through noise, then locks in with a flash */
.dream-letter.waiting { opacity: 0; }
.dream-letter.scrambling { color: #6f6f6f; text-shadow: 0 0 6px rgba(255, 255, 255, 0.25); }
.dream-letter.locked { animation: dream-lock 0.45s ease-out; }
@keyframes dream-lock {
    from { color: #fff; text-shadow: 0 0 14px #fff, 0 0 26px rgba(255, 255, 255, 0.7); }
    to { color: #ececec; text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
}

/* once decoded, the line breaks up for a split second every few seconds */
.dream-line.decoded { animation: dream-glitch 3.4s steps(1) infinite; }
@keyframes dream-glitch {
    0%, 88%, 100% { transform: none; text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); clip-path: none; }
    89% { transform: translate(-6px, 1px) skewX(-8deg); text-shadow: 3px 0 rgba(255, 30, 60, 0.85), -3px 0 rgba(0, 220, 255, 0.85); clip-path: inset(0 0 52% 0); }
    90% { transform: translate(5px, -1px); text-shadow: -4px 0 rgba(255, 30, 60, 0.85), 4px 0 rgba(0, 220, 255, 0.85); clip-path: inset(46% 0 0 0); }
    91% { transform: translate(-2px, 0) skewX(5deg); text-shadow: 2px 0 rgba(255, 30, 60, 0.7), -2px 0 rgba(0, 220, 255, 0.7); clip-path: none; }
    92% { transform: translate(3px, 0); text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
}

.dream-caret {
    opacity: 0;
    margin-left: 4px;
    color: #fff;
    animation: dream-caret 1s steps(1) infinite;
}
/* hidden until the line is written, then blinking */
@keyframes dream-caret { 0% { opacity: 1; } 50% { opacity: 0; } }

.dream-hint {
    position: absolute;
    bottom: 12vh;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: #555;
    opacity: 0;
    animation: dream-in 1.2s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
    .dream-line.decoded { animation: none; }
}
