@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=VT323&display=swap');

body { font-family: 'Nunito', sans-serif; } 

:root {
    --bg-primary: 253 251 247; --bg-secondary: 255 255 255; --bg-tertiary: 243 240 235; --bg-nav: 253 251 247;
    --text-primary: 60 55 50; --text-secondary: 90 85 80; --text-tertiary: 120 115 110; --text-headings: 45 40 35;
    --border-primary: 220 215 210; --border-secondary: 235 230 225;
    --glassy-card-bg: 255 255 255 / 0.7; --glassy-card-border: 230 225 220 / 0.8;
    --shadow-soft: 0 10px 30px -10px rgba(90, 80, 70, 0.08);
    --accent-color: #3b82f6;
    --font-main: 'Nunito', sans-serif;
    --border-radius-main: 1.25rem;
}

html.dark {
    --bg-primary: 22 24 35; --bg-secondary: 30 33 48; --bg-tertiary: 45 48 65; --bg-nav: 22 24 35;
    --text-primary: 220 225 235; --text-secondary: 170 180 200; --text-tertiary: 120 130 150; --text-headings: 240 245 255;
    --border-primary: 60 65 85; --border-secondary: 45 50 70;
    --glassy-card-bg: 35 38 55 / 0.6; --glassy-card-border: 255 255 255 / 0.15;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

html.theme-blue {
    --bg-primary: 3 7 18; --bg-secondary: 15 23 42; --bg-tertiary: 30 41 59; --bg-nav: 3 7 18;
    --text-primary: 224 242 254; --text-secondary: 186 230 253; --text-tertiary: 125 211 252; --text-headings: 204 251 241;
    --border-primary: 56 189 248; --border-secondary: 14 165 233;
    --glassy-card-bg: 15 23 42 / 0.4; --glassy-card-border: 56 189 248 / 0.4;
    --accent-color: #2dd4bf;
    --shadow-soft: 0 0 20px rgba(45, 212, 191, 0.15);
}

html.theme-stardew {
    --bg-primary: #E3F2FD; 
    --bg-secondary: #1D3658;
    --bg-tertiary: #B3D9FF; 
    --bg-nav: #FF9800;
    
    --text-primary: #3d2e23;
    --text-secondary: #5d4037;
    --text-tertiary: #1D3658;
    --text-headings: #1a237e;
    
    --border-primary: #FFD54F;
    --border-secondary: #1D3658;
    
    --glassy-card-bg: rgba(255, 255, 255, 0.9);
    --glassy-card-border: 4px solid #1D3658;
    --shadow-soft: 6px 6px 0px rgba(29, 54, 88, 0.4);
    
    --accent-color: #0277BD;
    --font-main: 'VT323', monospace;
    --border-radius-main: 4px;
}

html.theme-stardew body {
    font-family: 'VT323', monospace;
    font-size: 1.25rem;
    background-color: #E3F2FD;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
    background-size: 20px 20px;
}

html.theme-stardew h1, html.theme-stardew h2, html.theme-stardew h3 {
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px #90CAF9;
}

html.theme-stardew .floating-nav {
    background: linear-gradient(180deg, #8D6E63 0%, #6D4C41 50%, #5D4037 100%) !important;
    border: 4px solid #3E2723 !important;
    box-shadow: 0 6px 0 #3E2723 !important;
    border-radius: 4px;
}

html.theme-stardew .floating-nav a {
    color: #FFECB3 !important;
    text-shadow: 2px 2px 0px #3E2723;
}

html.theme-stardew .floating-nav a:hover,
html.theme-stardew .floating-nav a.text-blue-600 {
    color: #FFD54F !important;
}

html.theme-stardew .glassy-publication-card,
html.theme-stardew .timeline-content,
html.theme-stardew #mobile-menu {
    background-color: #E3F2FD;
    border: 3px solid #1565C0;
    box-shadow: 
        inset 0 0 0 2px #90CAF9,
        4px 4px 0px rgba(21, 101, 192, 0.4);
    border-radius: 0px;
}

html.theme-stardew .timeline-icon {
    background-color: #FFD54F;
    border: 3px solid #3E2723;
    color: #3E2723;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

html.theme-stardew .theme-btn.active,
html.theme-stardew a.bg-blue-500 {
    background-color: #66BB6A;
    border: 2px solid #1B5E20;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.4), 0 4px 0 #1B5E20;
    color: white;
    text-shadow: 1px 1px 0 #1B5E20;
    border-radius: 4px;
    transform: translateY(-2px);
}
html.theme-stardew a.bg-blue-500:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 #1B5E20;
}

body { 
    background-color: rgb(var(--bg-primary)); 
    color: rgb(var(--text-secondary)); 
    transition: all 0.5s ease; 
}

.gradient-text { 
    background: linear-gradient(90deg, var(--accent-color), #10b981); 
    -webkit-background-clip: text; background-clip: text; color: transparent; 
}

.floating-nav {
    background-color: rgba(var(--bg-nav), 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--border-primary), 0.4);
    box-shadow: var(--shadow-soft);
    border-radius: var(--border-radius-main);
}

.glassy-publication-card { 
    background: rgba(var(--glassy-card-bg)); 
    backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--glassy-card-border)); 
    border-radius: var(--border-radius-main); 
    transition: all 0.3s ease; 
    box-shadow: var(--shadow-soft);
}
.glassy-publication-card:hover { 
    transform: translateY(-4px); 
    background: rgba(var(--glassy-card-hover-bg)); 
}

.timeline-container { position: relative; padding-left: 2.5rem; }
.timeline-container::before { content: ''; position: absolute; left: 1.25rem; top: 0.5rem; bottom: 0.5rem; width: 3px; background-color: rgba(var(--border-primary), 0.5); border-radius: 2px; }
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-icon { 
    position: absolute; left: -2.5rem; top: 0; 
    display: flex; align-items: center; justify-content: center; 
    width: 2.5rem; height: 2.5rem; border-radius: 9999px; 
    background-color: rgb(var(--bg-secondary)); 
    border: 2px solid rgba(var(--border-primary), 1); 
    color: var(--accent-color); 
    z-index: 10; 
}
.timeline-content { 
    background-color: rgba(var(--bg-primary), 0.4); 
    padding: 1rem 1.25rem; border-radius: var(--border-radius-main);
    border: 1px solid rgba(var(--border-primary), 0.4); 
    transition: transform 0.2s ease-out; 
}
.timeline-content:hover { transform: translateX(5px); background-color: rgba(var(--bg-secondary), 0.6); }

#snow-container, #bubbles-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; display: none; }
.snowflake { position: absolute; top: -10px; color: #fff; font-size: 1em; font-family: Arial; text-shadow: 0 0 3px rgba(135, 206, 235, 0.8); animation-name: fall, shake; animation-duration: 10s, 3s; animation-timing-function: linear, ease-in-out; animation-iteration-count: infinite, infinite; }
.bubble { position: absolute; bottom: -20px; background-color: rgba(255, 255, 255, 0.1); border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.3); animation-name: rise; animation-timing-function: ease-in; animation-iteration-count: infinite; }
@keyframes fall { 0% { top: -10%; } 100% { top: 100%; } }
@keyframes rise { 0% { bottom: -20px; transform: translateX(0); opacity: 0; } 50% { opacity: 1; } 100% { bottom: 110%; transform: translateX(-20px); opacity: 0; } }
@keyframes shake { 0% { transform: translateX(0px); } 50% { transform: translateX(40px); } 100% { transform: translateX(0px); } }

.theme-btn.active { background-color: var(--accent-color); color: white; }

html.theme-blue body {
    background: linear-gradient(180deg, #0f172a 0%, #1e3a8a 50%, #0891b2 100%);
    background-size: 100% 150%;
    background-attachment: fixed;
}
html.theme-blue .floating-nav,
html.theme-blue .glassy-publication-card,
html.theme-blue .timeline-content {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.typewriter { overflow: hidden; border-right: 2px solid var(--accent-color); white-space: nowrap; margin: 0 auto; letter-spacing: .15em; display: inline-block; font-weight: 600; font-size: 1.2rem; }
.blink { border-right: 2px solid rgb(var(--text-headings)); animation: blink-caret 0.75s step-end infinite; }
@keyframes blink-caret { 50% { border-color: transparent; } }
@media (min-width: 640px) { .typewriter { font-size: 1.5rem; } }
.news-scroll::-webkit-scrollbar { width: 6px; }
.news-scroll::-webkit-scrollbar-thumb { background-color: rgba(var(--border-primary), 1); border-radius: 10px; }