@font-face {
    font-family: 'Riffic';
    src: url('../RifficFree-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

body {
    background-color: #050505;
    color: #e0e0e0;
    font-family: 'Quicksand', sans-serif;
    overflow-x: hidden;
}

/* Add smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Scrollbar styling */
html::-webkit-scrollbar {
    width: 8px;
}
html::-webkit-scrollbar-track {
    background: #050505;
}
html::-webkit-scrollbar-thumb {
    background: #ff69b4;
    border-radius: 10px;
}
html::-webkit-scrollbar-thumb:hover {
    background: #ff4fa6;
}

/* Firefox support */
html, body {
    scrollbar-width: thin;
    scrollbar-color: #ff69b4 #050505;
}

* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Allow text selection on specific elements */
#d-global-name,
#d-username,
#d-activity,
footer {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}



/* Subtle Grain/Noise Effect */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Ensure content stays above noise */
body > * {
    position: relative;
    z-index: 1;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 4px solid #1e1f22;
    z-index: 20;
}
.status-online  { background-image: url('https://files.catbox.moe/ma1fn2.png'); }
.status-idle    { background-image: url('https://files.catbox.moe/qtgqzn.png'); }
.status-dnd     { background-image: url('https://files.catbox.moe/fignnf.png'); }
.status-offline { background-image: url('https://files.catbox.moe/l9epn6.png'); }

#nav-overlay {
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}
#nav-overlay.open {
    opacity: 1;
    visibility: visible;
}

.discord-card {
    background: #0a0a0c;
}

.animated-divider {
    position: relative;
    background: rgba(255, 105, 180, 0.14);
    overflow: hidden;
}

.animated-divider::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0; 
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 105, 180, 0.9),
        transparent
    );
    animation: shimmer-effect 3s infinite linear;
}

@keyframes shimmer-effect {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.cursor::after {
    content: '|';
    color: #ff69b4;
    animation: blink 1s step-end infinite;
}

#typed-quote {
    color: #ff69b4;
}

#quote-container p {
    color: #ff69b4 !important;
}

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

:root {
    color-scheme: dark;
}

/* Better focus states for accessibility */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #ff69b4;
    outline-offset: 4px;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Mobile active states */
/*@media (hover: none) {
    button:active,
    a:active {
        transform: scale(0.98);
        opacity: 0.7;
    }
}*/

::selection {
    background-color: rgba(255, 105, 180, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background-color: rgba(255, 105, 180, 0.3);
    color: #ffffff;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 4px solid #1e1f22;
    z-index: 30;
}

/* ========================================
   GLITCH EFFECT (When switching to DDLC)
   ======================================== */
.no-transitions, .no-transitions * {
    transition: none !important;
}

body.is-glitching {
    animation: ddlc-glitch 0.15s cubic-bezier(.25, .46, .45, .94) both infinite;
    overflow: hidden;
}

body.is-glitching::after {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="2" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.5;
    z-index: 9999;
    pointer-events: none;
    mix-blend-mode: exclusion;
}

/* ========================================  
   for firefox
   ======================================== */  

@keyframes ddlc-glitch {  
    0% { 
        transform: translate(0) scale(1); 
        filter: invert(0) hue-rotate(0deg) contrast(1) drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); 
    }  
    20% { 
        transform: translate(-15px, 10px) skewX(8deg) scale(1.02); 
        filter: invert(1) hue-rotate(90deg) contrast(1) drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); 
    }  
    40% { 
        transform: translate(15px, -10px) skewX(-8deg) scale(0.98); 
        filter: invert(0) hue-rotate(0deg) contrast(3) drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); 
    }  
    60% { 
        transform: translate(-10px, 5px) skewX(15deg) scale(1.05); 

        filter: invert(0) hue-rotate(0deg) contrast(1) drop-shadow(15px 0 0 red) drop-shadow(-15px 0 0 cyan); 
    }  
    80% { 
        transform: translate(10px, -5px) skewX(-15deg) scale(0.95); 
        filter: invert(1) hue-rotate(0deg) contrast(2) drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); 
    }  
    100% { 
        transform: translate(0) scale(1); 
        filter: invert(0) hue-rotate(0deg) contrast(1) drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); 
    }  
}

@-moz-document url-prefix() {
    /* no shake on firefox */
    @keyframes ddlc-glitch {  
        0% { filter: invert(0) hue-rotate(0deg) contrast(1) drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); }  
        20% { filter: invert(1) hue-rotate(90deg) contrast(1) drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); }  
        40% { filter: invert(0) hue-rotate(0deg) contrast(3) drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); }  
        60% { filter: invert(0) hue-rotate(0deg) contrast(1) drop-shadow(15px 0 0 red) drop-shadow(-15px 0 0 cyan); }  
        80% { filter: invert(1) hue-rotate(0deg) contrast(2) drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); }  
        100% { filter: invert(0) hue-rotate(0deg) contrast(1) drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); }  
    }
    
    /*  */
    body.is-glitching {
        animation-duration: 0.25s !important;
    }
}

/* ========================================
   DDLC MODE THEME OVERRIDES
   ======================================== */
body.ddlc-mode {
    background-color: #fff9fc !important;
    background-image: radial-gradient(#ffbde1 2px, transparent 2px);
    background-size: 30px 30px;
    color: #000000;
}

/* Hide Unwanted Sections */
body.ddlc-mode #monika-hero-container,
body.ddlc-mode #quote-container,
body.ddlc-mode #sns-links,
body.ddlc-mode #year-container {
    display: none !important;
}

body.ddlc-mode::before { opacity: 0; }

/* Discord Card UI changes */
body.ddlc-mode .discord-card {
    background-color: #ffffff !important;
    border: 6px solid #ffbde1 !important;
    box-shadow: 0 0 0 4px white !important;
    border-radius: 0 !important;
}
body.ddlc-mode .discord-card .bg-gradient-to-r { display: none; }
body.ddlc-mode #d-global-name { color: #000000 !important; font-family: 'Fredoka', sans-serif; font-weight: 700; }
body.ddlc-mode #d-username { color: #ff69b4 !important; }
body.ddlc-mode #d-activity {
    background-color: #ffbde1 !important;
    border-color: #ff69b4 !important;
    color: #ffffff !important;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.1);
}

/* Skill Tags UI changes */
body.ddlc-mode .skill-tag {
            background-color: #ffffff !important;
            border: 3px solid #ffbde1 !important;
            color: #000000 !important;
            font-weight: 700;
            border-radius: 0 !important;
        }
        body.ddlc-mode .skill-tag:hover {
            background-color: #ffbde1 !important;
            color: #ffffff !important;
            border-color: #ff69b4 !important;
            transform: scale(1.05);
        }

/* Show DDLC Texts */
body.ddlc-mode #just-monika-text { display: flex !important; }
body.ddlc-mode #footer-kyo { display: none !important; }
body.ddlc-mode #footer-monika { display: inline !important; }
body.ddlc-mode #footer-heart { color: #ff69b4 !important; }

/* Text & Colors */
body.ddlc-mode .text-kyo-emerald,
body.ddlc-mode .text-gray-400 { color: #ff69b4 !important; }
body.ddlc-mode #d-activity.text-white { color: white !important; }
body.ddlc-mode .cursor::after { color: #ff69b4 !important; }

/* Header/Footer/Menus */
body.ddlc-mode header { mix-blend-mode: normal !important; }
body.ddlc-mode #site-logo { color: #ff69b4 !important; font-weight: bold; text-shadow: 2px 2px 0px white; }
body.ddlc-mode #site-logo img { filter: brightness(0) invert(1) drop-shadow(2px 2px 0px #ff69b4) !important; opacity: 1 !important; }
body.ddlc-mode #menu-btn { color: #ff69b4 !important; }
body.ddlc-mode #nav-overlay { background: rgba(255, 255, 255, 0.95) !important; }
body.ddlc-mode footer { background: transparent !important; }
body.ddlc-mode footer .text-gray-500 { color: #888888 !important; font-weight: bold; }
body.ddlc-mode ::selection { background-color: rgba(255, 105, 180, 0.4) !important; color: #000000 !important; }

#footer-heart {
    transition: transform 0.2s ease-out;
}

/* ========================================
   MUSIC PLAYER
   ======================================== */
.monika-music-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: #1f2937;
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 22px;
    z-index: 9999;
    transition: all 0.4s ease-in-out;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    display: none; /* Toggled to flex in JS */
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    touch-action: none;
}

/* Let CSS handle the hover state instead of JS event listeners */
.monika-music-btn:hover {
    opacity: 1;
}

/* Active state toggled via JS */
.monika-music-btn.playing {
    color: #ff69b4;
    box-shadow: 0 0 8px #ff69b4;
    opacity: 1;
}

/* ========================================
   MONIKA POPUP
   ======================================== */
#monika-popup {
    display: none; /* JS toggles this to 'flex' */
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0; /* More compatible than inset: 0 */
    z-index: 100;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

#monika-popup-content {
    background-color: #ffffff;
    border: 6px solid #ffbde1;
    padding: 2.5rem;
    width: 90%; /* Safely contains the box without needing margins */
    max-width: 28rem;
    display: flex; /* Force flexbox for foolproof centering */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 4px white;
    user-select: none;
}

#monika-popup-content h3 {
    font-size: 2.25rem;
    margin-bottom: 2rem; /* Replaces Tailwind's mb-8 */
}

@media (min-width: 768px) {
    #monika-popup-content h3 {
        font-size: 3rem;
    }
}

#monika-ok-btn {
    font-size: 44px;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    -webkit-text-stroke: 4px #BB5499;
    text-shadow: 4px 4px 0px #FFE7F4;
    display: inline-block;
}

/* Projects — same palette as site (dark + pink glass) */
.projects-strip {
    width: 100%;
    background: radial-gradient(
        ellipse 90% 55% at 50% 0%,
        rgba(255, 105, 180, 0.07) 0%,
        transparent 58%
    );
    border-top: 1px solid rgba(255, 105, 180, 0.15);
}

#projects {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

#projects h2 {
    color: #f4f4f5;
    font-size: 1.875rem;
    line-height: 2.25rem;
}

@media (min-width: 768px) {
    #projects h2 {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }
}

#projects .text-center > p {
    color: #a1a1aa;
    font-size: 0.875rem;
}

#projects .projects-inner {
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
    padding: 3.5rem 1.5rem 5rem;
}

@media (min-width: 768px) {
    #projects .projects-inner {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

#projects .project-card-body {
    padding: 1.5rem;
}

#projects .project-card-image {
    background: #0a0a0a;
    height: 13rem;
    min-height: 13rem;
}

/* Projects: 3 columns (Tailwind dist lacks grid/flex gap utilities used in markup) */
#projects .projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
}

@media (max-width: 900px) {
    #projects .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Project cards — glass on dark (match global glass-card vibe) */
#projects .glass-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

#projects .glass-card:hover {
    transform: translateY(-0.5rem);
    border-color: rgba(255, 105, 180, 0.45);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.45),
        0 0 28px -8px rgba(255, 105, 180, 0.35);
}

#projects .project-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #d4d4d8;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Default glass (if reused outside #projects) */
.glass-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.font-script {
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
}

.text-sakura-dark {
    color: #fbcfe8;
}

/* Script titles on dark cards — pink accent */
#projects .text-sakura-dark {
    color: #ff9dcf;
}

#projects .project-card-desc {
    color: #d4d4d8;
}

