/* --- 0. CRITICAL UTILITIES --- */
[hidden] { display: none !important; }

/* --- 1. THEME VARIABLES --- */
:root {
    /* Light Mode */
    --bg: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.95);
    --text: #111111;
    --text-muted: #666666;
    --accent: #000000;
    --border: #e5e5e5;
    --img-border: 1px solid #000000;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --osd-bg: #f5f5f5; 
    
    --font-main: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --header-height: 70px;
    --gap: 80px;
}

[data-theme="dark"] {
    --bg: #111111;
    --bg-header: rgba(17, 17, 17, 0.95);
    --text: #e0e0e0;
    --text-muted: #888888;
    --accent: #ffffff;
    --border: #333333;
    --img-border: none;
    --shadow: 0 4px 12px rgba(0,0,0,0.5);
    --osd-bg: #000000;
}

/* --- RESET --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg); color: var(--text); font-family: var(--font-main); font-weight: 300; transition: background-color 0.3s, color 0.3s; }
button { background: none; border: none; font-family: inherit; color: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* --- HEADER --- */
.site-header { position: sticky; top: 0; z-index: 100; height: var(--header-height); background-color: var(--bg-header); border-bottom: 1px solid var(--border); backdrop-filter: blur(5px); transition: background-color 0.3s, border-color 0.3s; }
.header-inner { max-width: 1600px; margin: 0 auto; padding: 0 30px; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.5px; }
.header-controls { display: flex; align-items: center; gap: 20px; }
.main-nav { display: flex; gap: 30px; align-items: center; }
.nav-link { font-size: 0.95rem; color: var(--text-muted); transition: color 0.2s ease; display: flex; align-items: baseline; gap: 6px; }
.nav-link:hover, .nav-link.active { color: var(--accent); font-weight: 500; }
.nav-date { font-size: 0.75rem; font-weight: 300; opacity: 0.7; white-space: nowrap; }
.theme-toggle { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text); transition: background 0.2s; }
.theme-toggle:hover { background-color: var(--border); }
.theme-icon { width: 20px; height: 20px; fill: currentColor; }
.mobile-toggle { display: none; font-size: 1.5rem; }
.mobile-menu { position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 15px; align-items: center; }

/* --- LAYOUTS --- */
#app-container { max-width: 1600px; margin: 0 auto; padding: 40px 30px 100px; min-height: 100vh; }
.home-splash { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
.home-splash img { max-width: 100%; max-height: 80vh; box-shadow: var(--shadow); border: var(--img-border); }
.gallery-grid { display: grid; grid-template-columns: 1fr; max-width: 1000px; margin: 0 auto; gap: var(--gap); }
.art-card { opacity: 0; animation: fadeIn 0.6s forwards; }
.art-card img { width: 100%; height: auto; display: block; transition: opacity 0.3s; cursor: zoom-in; background-color: rgba(128,128,128,0.1); border: var(--img-border); }
.art-card img:hover { opacity: 0.9; }
.art-info { margin-top: 15px; font-size: 0.9rem; color: var(--text-muted); display: flex; justify-content: space-between; }
.art-title { color: var(--text); font-size: 1rem; }
.about-container { max-width: 800px; margin: 0 auto; padding-top: 20px; }
.about-text { line-height: 1.6; margin-bottom: 40px; font-size: 1.1rem; }
.cv-section h3 { margin: 0 0 20px; font-weight: 500; font-size: 1rem; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.cv-item { display: flex; margin-bottom: 8px; font-size: 0.95rem; }
.cv-year { width: 60px; flex-shrink: 0; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.about-img { width: 100%; max-width: 500px; margin-bottom: 30px; display: block; border: var(--img-border); }
.contact-link { color: var(--text); text-decoration: underline; }

/* --- ZOOM OVERLAY (OpenSeadragon) --- */
.zoom-overlay { 
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; 
    background: var(--osd-bg);
    z-index: 200; 
    display: flex; flex-direction: column; 
    opacity: 1; transition: opacity 0.3s;
}

.osd-viewer {
    width: 100%;
    height: 100%;
    flex-grow: 1;
}

.zoom-controls {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 20px;
    background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}

.zoom-info {
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg-header);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    pointer-events: auto;
}

.zoom-actions {
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.zoom-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.1s, background 0.2s;
}

.zoom-btn:hover { background: var(--border); }
.zoom-btn:active { transform: scale(0.95); }
#osd-home { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; width: auto; padding: 0 16px; border-radius: 22px; }

.loader { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--text-muted); font-size: 0.8rem; letter-spacing: 1px; animation: pulse 1.5s infinite; pointer-events: none;}

/* --- TOAST NOTIFICATION --- */
.toast {
    position: absolute;
    bottom: 80px; /* Above the control bar */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text);
    color: var(--bg);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 300;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0% { opacity: 0.3; } 50% { opacity: 1; } 100% { opacity: 0.3; } }

@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-toggle { display: block; }
    .gallery-grid { gap: 40px; }
    .zoom-controls { padding: 15px; }
    .zoom-info { max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}