:root {
    /* --- COFFEE THEME (DEFAULT / LIGHT) --- */
    --bg: #F9F7F1;              /* Cream Background */
    --text: #2d2420;            /* Dark Brown Text (High Contrast) */
    --text-muted: #5c4f45;      /* Lighter Brown for secondary text */
    --accent: #D4A373;          /* Gold/Brown Accent */
    --card-bg: #EAE6DB;         /* Darker Cream for cards */
    --border: rgba(60, 54, 51, 0.15); 
    
    /* TAGS (Coffee Mode) */
    --tag-bg: #4A403A; /* Dark Coffee background */
    --tag-text: #F9F7F1; /* Cream text */

    --font-head: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --spooky-opacity: 0;
    --cursor-color: rgba(212, 163, 115, 0.4);
}

/* --- VAMPIRE MODE (DARK) --- */
body.vampire-mode {
    --bg: #050000;              /* Pitch Black */
    --text: #e0e0e0;            /* Off-White Text */
    --text-muted: #a0a0a0;      /* Grey for secondary text */
    --accent: #ff0000;          /* Bright Red */
    --card-bg: #110505;         /* Very Dark Red/Black for cards */
    --border: rgba(255, 0, 0, 0.2);
    
    /* TAGS (Vampire Mode Base) */
    --tag-bg: #500000; 
    --tag-text: #ffcccc;
    
    --spooky-opacity: 0.2;
    --cursor-color: rgba(255, 0, 0, 0.6);
}

/* GLOBAL TRANSITIONS */
body, .bento-box, .work-item, nav, .menu-btn, .close-btn, .nav-overlay {
    transition: background-color 0.6s ease, color 0.6s ease, border-color 0.6s ease, background-image 0.6s ease, box-shadow 0.6s ease;
}

/* GLOBAL RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }
html.lenis { height: auto; } 
.lenis.lenis-smooth { scroll-behavior: auto; } 

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overflow-x: hidden;
    cursor: none !important; /* Force hide default cursor */
    width: 100%;
}

/* TEXT & LINK COLOR FORCING */
h1, h2, h3, h4, a, p, span { color: inherit; }
a { text-decoration: none; cursor: none !important; }
button, .menu-btn, .close-btn { cursor: none !important; }

/* INTERACTION / GAME CONTAINER */
#interaction-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9990; overflow: hidden;
}
.game-piece { position: absolute; font-size: 2rem; pointer-events: none; user-select: none; z-index: 9991; }

/* BACKGROUNDS */
.noise {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    pointer-events: none; z-index: 8000; opacity: 0.04;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
}
.spooky-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    pointer-events: none; z-index: -1; opacity: var(--spooky-opacity);
    background-image: 
        radial-gradient(circle at 20% 20%, #800000 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, #500000 0%, transparent 40%);
    transition: opacity 0.8s;
}
body.vampire-mode .spooky-bg::after {
    content: "🦇 🎃 🧛 🕸️"; 
    font-size: 4rem; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); opacity: 0.2; filter: blur(2px);
    letter-spacing: 50px; width: 100%; text-align: center;
}

/* THEME TOGGLE */
#theme-toggle {
    position: fixed; bottom: 30px; right: 30px;
    width: 60px; height: 60px; border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card-bg); color: var(--text);
    font-size: 1.5rem; z-index: 9998;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex; justify-content: center; align-items: center;
    transition: 0.3s;
}

/* CURSOR (Desktop Only) */
.cursor, .cursor-follower {
    position: fixed; border-radius: 50%; 
    pointer-events: none; /* CRITICAL: Prevents glitching */
    z-index: 10000; top: 0; left: 0;
    transform: translate(-50%, -50%); 
}
.cursor { width: 8px; height: 8px; background: var(--text); opacity: 0.9; }
.cursor-follower { 
    width: 40px; height: 40px; 
    background: var(--cursor-color); 
    border: none;
}

@media (max-width: 1023px) {
    .cursor, .cursor-follower { display: none !important; }
    body, a, button { cursor: auto !important; }
}

/* NAV */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 30px 5vw; position: fixed; top: 0; width: 100%; z-index: 1000;
    transition: all 0.4s ease;
}
nav.scrolled {
    padding: 20px 5vw; background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.logo { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; font-style: italic; }
.jp { font-family: var(--font-body); font-size: 0.8rem; opacity: 0.6; font-style: normal; }
.menu-btn { 
    font-family: var(--font-body); padding: 8px 20px; 
    border: 1px solid var(--border); border-radius: 30px; font-size: 0.8rem;
    font-weight: 500;
}

/* FULLSCREEN MENU (FIXED VERTICAL LAYOUT) */
.nav-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: var(--bg); z-index: 1001; 
    display: flex; flex-direction: column; 
    justify-content: center; 
    align-items: center;
    clip-path: circle(0% at 100% 0%); 
    transition: clip-path 0.8s cubic-bezier(0.7,0,0.3,1);
}
.nav-overlay.active { clip-path: circle(150% at 100% 0%); }

.close-btn { 
    position: absolute; top: 30px; right: 5vw; 
    padding: 10px 20px; border: 1px solid var(--border); border-radius: 30px;
    font-weight: 500;
}

/* MENU LINKS STACKED VERTICALLY */
.nav-links {
    display: flex;
    flex-direction: column; /* Forces vertical stack */
    gap: 30px; /* Space between items */
    text-align: center;
}

.nav-links a {
    font-family: var(--font-head); 
    font-size: clamp(3rem, 10vw, 6rem);
    color: var(--text); 
    opacity: 0.3; 
    transition: 0.4s; 
    font-style: italic;
    display: block; /* Ensure they take up their own line */
}
.nav-links a:hover { opacity: 1; color: var(--accent); transform: scale(1.05); }

/* HERO */
.hero { min-height: 90vh; display: flex; align-items: flex-start; padding-top: 22vh; position: relative; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.hero-top { display: flex; justify-content: space-between; margin-bottom: 40px; font-size: 0.9rem; color: var(--text-muted); width: 100%; }
.status-indicator { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; background: #8DA399; border-radius: 50%; }
body.vampire-mode .dot { background: #ff0000; box-shadow: 0 0 10px #ff0000; }

.hero-title {
    font-family: var(--font-head); font-size: clamp(3rem, 10vw, 7.5rem);
    line-height: 1.1; font-weight: 400; color: var(--text);
    display: flex; flex-direction: column;
}
body.vampire-mode .hero-title { font-family: 'Creepster', cursive; letter-spacing: 2px; }
.hero-title .italic { font-style: italic; color: var(--accent); }
.hero-footer { position: absolute; bottom: 40px; width: 90%; display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-muted); }

/* MARQUEE */
.marquee-wrap { padding: 40px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; }
.marquee-content {
    font-family: var(--font-head); font-size: 1.5rem; font-style: italic; color: var(--accent);
    white-space: nowrap; display: inline-block; animation: scroll 30s linear infinite;
}
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.section { padding: 120px 0; }
.section-label { font-family: var(--font-body); font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 60px; }

/* WORK LIST */
.work-list { display: grid; gap: 40px; }
.work-item {
    display: flex; justify-content: space-between; align-items: flex-end;
    padding: 40px; background: var(--card-bg); border-radius: 12px;
    border: 1px solid transparent; transition: 0.4s ease;
}
.work-item:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.work-info h2 { font-family: var(--font-head); font-size: 2rem; margin-bottom: 10px; font-weight: 500; }
.work-info p { color: var(--text-muted); font-size: 1rem; }

/* BENTO GRID */
.bento-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.bento-box {
    background: var(--card-bg); padding: 40px; border-radius: 12px;
    display: flex; flex-direction: column; justify-content: space-between;
    min-height: 250px; border: 1px solid transparent; transition: 0.3s;
    position: relative; overflow: hidden; /* Ensure wave stays inside */
}
.bento-box:hover { border-color: var(--accent); }
.bento-box h3 { font-family: var(--font-head); font-style: italic; font-size: 1.5rem; margin-bottom: 20px; color: var(--accent); }
.bio-box p { font-size: 1.2rem; line-height: 1.6; color: var(--text-muted); }

/* --- VAMPIRE MODE CARD SILK HOVER (ALL 3 CARDS) --- */
body.vampire-mode .bento-box {
    transition: all 0.5s ease;
}
body.vampire-mode .bento-box:hover {
    /* Blackish-Red Silk Gradient */
    background: linear-gradient(135deg, #0a0000 0%, #200000 30%, #400000 50%, #200000 70%, #0a0000 100%);
    background-size: 200% 200%;
    animation: silkCardFlow 3s ease infinite;
    border-color: #ff0000;
    box-shadow: 0 10px 40px rgba(255, 0, 0, 0.2);
}

@keyframes silkCardFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- LANGUAGES BOX SPECIAL STYLES (PINK WAVE - COFFEE MODE ONLY) --- */
.jp-box {
    grid-column: span 2; flex-direction: row; align-items: center;
    /* Light Pink Wave SVG Background for Coffee Mode */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23F7C5D0' fill-opacity='0.5' d='M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,160C960,139,1056,149,1152,160C1248,171,1344,181,1392,186.7L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: bottom;
    background-size: cover;
}

/* Remove wave in Vampire mode so it doesn't clash with the silk animation */
body.vampire-mode .jp-box {
    background-image: none;
}

/* --- TAGS & LANGUAGES STYLING --- */
.tag, .stack-list span, .interest-list span {
    display: inline-block; margin: 0 6px 10px 0; padding: 8px 18px;
    border-radius: 8px; font-size: 0.85rem; font-weight: 500;
    border: 1px solid transparent;
    
    /* DEFAULT (Coffee Mode): Solid Dark Coffee Background */
    background-color: var(--tag-bg) !important; 
    color: var(--tag-text) !important;
    transition: all 0.3s ease;
}

/* HOVER EFFECT (Coffee Mode) */
.tag:hover, .stack-list span:hover, .interest-list span:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background-color: var(--bg) !important; /* Cream background */
    color: #2d2420 !important; /* Dark Coffee Text */
    border-color: #2d2420;
}

/* --- VAMPIRE MODE SILK TAGS --- */
body.vampire-mode .tag, 
body.vampire-mode .stack-list span, 
body.vampire-mode .interest-list span {
    background: linear-gradient(110deg, #400000 0%, #800000 25%, #ff0000 50%, #800000 75%, #400000 100%) !important;
    background-size: 200% 100% !important;
    color: #ffd7d7 !important;
    border: 1px solid #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
    animation: silkFlow 3s linear infinite;
}

body.vampire-mode .tag:hover, 
body.vampire-mode .stack-list span:hover, 
body.vampire-mode .interest-list span:hover {
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    transform: translateY(-3px) scale(1.05);
    color: white !important;
    background-color: transparent !important;
}

@keyframes silkFlow {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* FOOTER & SAY HELLO HOVER */
.footer { text-align: center; padding-top: 50px; }

.huge-link {
    font-family: var(--font-head); 
    font-size: clamp(3rem, 10vw, 8rem);
    color: var(--text); 
    position: relative; 
    display: inline-block;
    transition: 0.3s;
    cursor: pointer;
}

/* Say Hello Underline Animation */
.huge-link::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 4px;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    transition: width 0.4s ease;
}

.huge-link:hover {
    color: var(--accent);
    transform: skewX(-10deg); /* Slight italic tilt */
}

.huge-link:hover::after {
    width: 100%; /* Line grows */
}

.footer-bottom { 
    margin-top: 100px; padding: 40px 0; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.9rem;
}

/* MOBILE OPTIMIZATION */
@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr; }
    .jp-box { grid-column: span 1; flex-direction: column; align-items: flex-start; }
    .hero-title { font-size: 3.5rem; }
    .work-item { flex-direction: column; align-items: flex-start; gap: 20px; }
    .footer-bottom { flex-direction: column; gap: 20px; }
    .section { padding: 80px 0; }
    .container { width: 92%; }
    body.vampire-mode .spooky-bg::after { font-size: 2rem; letter-spacing: 20px; }
}
