/* Ghost OS Theme v3.3
   All colors derived from accent + neutral grays */

:root {
    /* Accent color from Ghost settings */
    --accent-light: color-mix(in srgb, var(--accent) 100%, white 25%);
    --accent-dark: color-mix(in srgb, var(--accent) 100%, black 25%);
    --accent-glow: color-mix(in srgb, var(--accent) 12%, transparent);
    --accent-border: color-mix(in srgb, var(--accent) 35%, transparent);
    --accent-border-light: color-mix(in srgb, var(--accent) 20%, transparent);
    
    /* Neutral grays - no blue tint */
    --gray-950: #0a0a0a;
    --gray-900: #121212;
    --gray-850: #1a1a1a;
    --gray-800: #222222;
    --gray-700: #333333;
    --gray-600: #4a4a4a;
    --gray-500: #666666;
    --gray-400: #888888;
    --gray-300: #aaaaaa;
    --gray-200: #cccccc;
    --gray-100: #e5e5e5;
    --gray-50: #f5f5f5;
    
    /* Text colors - from Ghost settings, with fallbacks */
    --text-faint: color-mix(in srgb, var(--text-muted) 70%, transparent);
    
    /* Theme colors - default normal brightness */
    --bg: var(--gray-900);
    --bg-secondary: var(--gray-850);
    --bg-tertiary: var(--gray-950);
    
    /* Layout */
    --scale: 1.2;
    --taskbar-height: calc(56px * var(--scale));
    --sidebar-width: calc(200px * var(--scale));
    
    /* Fallback gradients for taskbar and spotlight if not set via Ghost settings */
    --taskbar-gradient-fallback: linear-gradient(90deg, rgba(10,10,10,0.95), rgba(18,18,18,0.95));
    --spotlight-gradient-fallback: linear-gradient(180deg, rgba(18,18,18,0.95), rgba(10,10,10,0.95));
}

/* Background brightness variants */
.bg-light {
    --bg: var(--gray-800);
    --bg-secondary: var(--gray-700);
    --bg-tertiary: var(--gray-850);
}

.bg-normal {
    --bg: var(--gray-900);
    --bg-secondary: var(--gray-850);
    --bg-tertiary: var(--gray-950);
}

.bg-dark {
    --bg: var(--gray-950);
    --bg-secondary: var(--gray-900);
    --bg-tertiary: #050505;
}

.bg-very-dark {
    --bg: #050505;
    --bg-secondary: var(--gray-950);
    --bg-tertiary: #000000;
}

/* Responsive scale - improved for consistent sizing across all viewport sizes */
/* Large Desktop (1600px+): default --scale: 1.2 from :root */
@media (max-width: 1600px) { :root { --scale: 1.15; } }
@media (max-width: 1400px) { :root { --scale: 1.12; } }
@media (max-width: 1200px) { :root { --scale: 1.08; } }
@media (max-width: 1024px) { :root { --scale: 1.05; } }
@media (max-width: 900px) { :root { --scale: 1.02; } }
@media (max-width: 768px) { :root { --scale: 1; } }

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: calc(16px * var(--scale));
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 768px) {
    html { font-size: 16px; }
}

/* Ensure minimum icon and text sizes on small desktop screens (769px-1200px) */
@media (min-width: 769px) and (max-width: 1200px) {
    .desktop-icon .icon-img {
        min-width: 3.5rem;
        min-height: 3.5rem;
    }
    
    .desktop-icon .icon-label {
        font-size: 0.7rem;
    }
    
    .taskbar-item .nav-icon {
        min-width: 1.35rem;
        min-height: 1.35rem;
    }
    
    .taskbar-item .nav-label {
        font-size: 0.62rem;
    }
}

/* Medium desktop screens specific fixes (1024px-1400px) */
@media (min-width: 1024px) and (max-width: 1400px) {
    .desktop-icon {
        width: 6rem;
    }
    
    .desktop-icon .icon-img {
        width: 4rem;
        height: 4rem;
    }
    
    .desktop-icon .icon-label {
        font-size: 0.72rem;
        max-width: 5.5rem;
    }
}

html, body { height: 100%; width: 100%; overflow: hidden; }

body {
    font-family: var(--font-body, 'DM Sans', sans-serif);
    background: var(--bg);
    color: var(--text-secondary);
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }

/* Desktop */
.os-desktop {
    position: fixed;
    inset: 0;
    background: var(--bg);
    overflow: hidden;
}

.desktop-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.desktop-bg-overlay {
    position: absolute;
    inset: 0;
}

.overlay-none .desktop-bg-overlay { background: transparent; }
.overlay-light .desktop-bg-overlay { background: rgba(0,0,0,0.2); }
.overlay-medium .desktop-bg-overlay { background: rgba(0,0,0,0.4); }
.overlay-strong .desktop-bg-overlay { background: rgba(0,0,0,0.6); }
.overlay-very-strong .desktop-bg-overlay { background: rgba(0,0,0,0.8); }

.desktop-content {
    position: absolute;
    top: 0; left: 0; right: 0;
    bottom: var(--taskbar-height);
    z-index: 10;
    overflow: hidden;
}

/* Hero */
.hero-content {
    position: absolute;
    top: 45%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
    width: 90%;
    max-width: 1400px;
}

.hero-title {
    font-family: var(--font-hero, 'Playfair Display', serif);
    font-size: clamp(2.5rem, 9vw, 7rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
    text-shadow: 0 2px 40px rgba(0,0,0,0.5);
}

/* Larger on portrait/vertical displays */
@media (max-aspect-ratio: 1/1) {
    .hero-title {
        font-size: clamp(3rem, 15vw, 10rem);
    }
}

/* Animated Mask Effect - image fills the text with blur */
.hero-title-mask {
    background-image: var(--hero-bg);
    background-size: 200% 200%;
    background-position: center;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: none;
    animation: heroMaskMove 80s ease-in-out infinite;
    filter: contrast(1.1) brightness(1.05) blur(0.5px);
}

/* Slow looping animation - 70% slower than original */
@keyframes heroMaskMove {
    0%, 100% { 
        background-size: 200% 200%; 
        background-position: 0% 0%; 
    }
    25% { 
        background-size: 220% 220%; 
        background-position: 100% 0%; 
    }
    50% { 
        background-size: 200% 200%; 
        background-position: 100% 100%; 
    }
    75% { 
        background-size: 180% 180%; 
        background-position: 0% 100%; 
    }
}

.hero-line {
    width: 80px;
    height: 2px;
    background: var(--accent);
    margin: 1.5rem auto;
    opacity: 0.8;
}

.hero-subtitle {
    font-size: clamp(0.7rem, 2vw, 1rem);
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-shadow: 0 1px 10px rgba(0,0,0,0.5);
}

/* Desktop Icons */
.desktop-icons {
    position: absolute;
    top: 1.5rem; left: 1.25rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    z-index: 20;
}

.desktop-icon {
    width: 5.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
    position: relative;
}

.desktop-icon.dragging {
    position: fixed !important;
    z-index: 1000 !important;
    opacity: 0.9;
    background: var(--accent-glow);
    pointer-events: none;
}

.desktop-icon:hover { background: var(--accent-glow); }

.desktop-icon .icon-img {
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 0.4rem;
    border: 1px solid var(--accent-border-light);
    overflow: hidden;
}

.desktop-icon .icon-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.desktop-icon .icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

.desktop-icon .icon-label {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    max-width: 5rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* Spotlight */
.spotlight-wrapper {
    position: absolute;
    top: 50%; right: 1.5rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 30;
}

.spotlight-nav {
    display: none;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    background: var(--gray-900);
    border: 1px solid var(--accent-border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.spotlight-nav:hover {
    background: var(--accent-glow);
    color: var(--accent-light);
    border-color: var(--accent);
}

.spotlight-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 280px;
    max-height: calc(100vh - var(--taskbar-height) - 4rem);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.spotlight-container::-webkit-scrollbar {
    display: none;
}

.spotlight-widget {
    background: var(--spotlight-gradient, var(--spotlight-gradient-fallback));
    border: 1px solid var(--accent-border);
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.spotlight-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.spotlight-widget:hover .spotlight-close {
    opacity: 0.7;
}

.spotlight-close:hover {
    opacity: 1;
    color: var(--accent-light);
}

.spotlight-widget:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
}

.widget-link { display: block; }

.widget-image {
    height: 120px;
    background-size: cover;
    background-position: center;
    opacity: 0.7;
    position: relative;
}

.widget-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, var(--gray-900) 100%);
}

.widget-content { padding: 1rem; }

.widget-title {
    font-family: var(--font-headline, 'Playfair Display', serif);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.widget-excerpt {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.read-more {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--accent-light);
}

/* Taskbar */
.taskbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--taskbar-height);
    background: var(--taskbar-gradient, var(--taskbar-gradient-fallback));
    border-top: 1px solid var(--accent-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.taskbar-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.taskbar-separator {
    width: 1px;
    height: 1.5rem;
    background: var(--accent-border);
    margin: 0 0.25rem;
}

.taskbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    height: 3rem;
    padding: 0 0.75rem;
    font-size: 0.55rem;
    color: var(--text-muted);
    transition: all 0.15s;
    gap: 0.2rem;
}

.taskbar-item:hover {
    background: var(--accent-glow);
    color: var(--text-secondary);
}

.taskbar-item.active {
    background: var(--accent-glow);
    color: var(--text-primary);
}

.nav-icon {
    width: 1.2rem;
    height: 1.2rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.6;
}

.taskbar-item:hover .nav-icon,
.taskbar-item.active .nav-icon { opacity: 1; }

.nav-label { 
    font-weight: 500; 
    color: var(--taskbar-label-color);
}

/* Notizen icon - uses taskbar icon color */
.nav-icon-notizen {
    background-image: none;
    background-color: var(--taskbar-icon-color);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 1;
}

.taskbar-notizen .nav-icon-notizen {
    background-image: none;
    background-color: var(--taskbar-icon-color);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 1;
}

/* Custom uploaded icons - styled with theme color via CSS mask */
.nav-icon-custom {
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    opacity: 1;
}

/* Themed custom icons - uses mask for SVG icons */
.nav-icon-custom.nav-icon-themed {
    background-color: var(--taskbar-icon-color);
    background-image: none !important;
    -webkit-mask-image: var(--icon-url);
    mask-image: var(--icon-url);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.nav-icon-page {
    background-image: none;
    background-color: var(--taskbar-icon-color);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Crect x='3' y='3' width='18' height='18'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Crect x='3' y='3' width='18' height='18'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Impressum icon - Scale/Balance */
.nav-icon-impressum {
    background-image: none;
    background-color: var(--taskbar-icon-color);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='M7 21h10'/%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='M7 21h10'/%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 1;
}

/* Modals */
.overlay-container {
    position: fixed;
    inset: 0;
    bottom: var(--taskbar-height);
    z-index: 50;
}

.overlay-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
}

.modal-transparent .overlay-bg {
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(2px);
}

.overlay-modal {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 80rem;
    height: 92%;
    background: var(--modal-bg, var(--bg-secondary));
    border: 1px solid var(--accent-border);
    display: flex;
    overflow: hidden;
}

.overlay-modal-page { max-width: 60rem; }
.overlay-modal-archive { max-width: 90rem; }

/* Sidebar */
.modal-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-tertiary);
    border-right: 1px solid var(--accent-border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    height: 3.5rem;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--accent-border-light);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-light);
    letter-spacing: 0.05em;
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.sidebar-list::-webkit-scrollbar { width: 4px; }
.sidebar-list::-webkit-scrollbar-thumb { background: var(--accent-border-light); }

.sidebar-item {
    display: block;
    padding: 0.75rem 1rem;
    transition: background 0.15s;
}

.sidebar-item:hover { background: var(--accent-glow); }

.sidebar-item.active {
    background: var(--accent-glow);
    border-left: 2px solid var(--accent);
}

.sidebar-item-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.sidebar-item:hover .sidebar-item-title,
.sidebar-item.active .sidebar-item-title { color: var(--text-primary); }

/* Modal Header */
.modal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.modal-header {
    height: 3.5rem;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--accent-border-light);
    background: var(--bg-tertiary);
    cursor: grab;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-tags {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.header-tag {
    font-weight: 500;
    color: var(--accent-light);
    padding: 0.15rem 0.5rem;
    background: var(--accent-glow);
    border: 1px solid var(--accent-border-light);
    text-decoration: none;
}

.header-tag:hover {
    border-color: var(--accent-border);
}

.header-date,
.header-reading-time {
    color: var(--text-faint);
}

.modal-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.share-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    transition: all 0.15s;
}

.share-btn:hover {
    background: var(--accent-glow);
    color: var(--accent-light);
}

.modal-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    transition: all 0.15s;
}

.modal-close:hover {
    background: var(--accent-glow);
    color: var(--accent-light);
}

/* Reader */
.modal-reader {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2.5rem 3rem;
}

.modal-reader::-webkit-scrollbar { width: 6px; }
.modal-reader::-webkit-scrollbar-thumb { background: var(--accent-border-light); }
.modal-reader::-webkit-scrollbar-corner { background: transparent; }

.reader-container { 
    max-width: calc(720px * var(--scale)); 
    width: 100%;
    box-sizing: border-box;
}
.reader-container-wide { 
    max-width: calc(800px * var(--scale)); 
}

.reader-title {
    font-family: var(--font-headline, 'Playfair Display', serif);
    font-size: 2rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 1.5rem;
}

.page-title { margin-bottom: 2rem; }

.reader-feature-image { margin-bottom: 2rem; }
.reader-feature-image img { width: 100%; border: 1px solid var(--accent-border-light); }
.reader-feature-image figcaption {
    font-size: 0.75rem;
    color: var(--text-faint);
    padding: 0.75rem 0;
    text-align: center;
    font-style: italic;
}

.reader-body {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.reader-body p { margin-bottom: 1.25rem; }

.reader-body p:first-of-type::first-letter {
    font-family: var(--font-headline, 'Playfair Display', serif);
    font-size: 3.5rem;
    float: left;
    line-height: 1;
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    color: var(--accent-light);
    font-weight: 500;
}

.reader-body a {
    color: var(--accent-light);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.reader-body h2 {
    font-family: var(--font-headline, 'Playfair Display', serif);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 2.5rem 0 1rem;
}

.reader-body h3 {
    font-family: var(--font-headline, 'Playfair Display', serif);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 2rem 0 0.75rem;
}

.reader-body ul, .reader-body ol { margin: 1.25rem 0; padding-left: 1.5rem; }
.reader-body li { margin-bottom: 0.6rem; }

.reader-body blockquote {
    margin: 1.75rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 3px solid var(--accent);
    background: var(--bg-tertiary);
    font-style: italic;
    color: var(--text-muted);
}

.reader-body img,
.reader-body video,
.reader-body iframe,
.reader-body embed {
    max-width: 100%;
    height: auto;
}

.reader-body pre {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-border-light);
    overflow-x: auto;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    max-width: 100%;
}

.reader-body code {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.9em;
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--accent-border-light);
}

.reader-body pre code { background: none; padding: 0; border: none; }

.reader-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--accent-border-light);
}

.reader-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.reader-tag-link {
    font-size: 0.75rem;
    color: var(--text-faint);
    background: var(--bg-tertiary);
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--accent-border-light);
    transition: all 0.15s;
}

.reader-tag-link:hover {
    background: var(--accent-glow);
    color: var(--accent-light);
}

/* Archive */
.archive-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.tag-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--accent-border-light);
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.archive-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-border-light);
    transition: border-color 0.2s;
}

.archive-item:hover { border-color: var(--accent-border); }

.archive-link { display: block; }

.archive-image {
    height: 140px;
    background-size: cover;
    background-position: center;
    opacity: 0.6;
}

.archive-image-empty { background: var(--bg-secondary); }

.archive-item-content { padding: 1rem; }

.archive-tag {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--accent-light);
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 0.4rem;
}

.archive-title {
    font-family: var(--font-headline, 'Playfair Display', serif);
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.archive-excerpt {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.archive-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.7rem;
    color: var(--text-faint);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--accent-border-light);
    font-size: 0.85rem;
}

.pagination a {
    color: var(--accent-light);
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-border);
}

.pagination a:hover { background: var(--accent-glow); }

/* Ghost Cards - kg-width-full required */
.kg-card { margin: 1.75rem 0; }

.kg-image-card img, .kg-image { width: 100%; border: 1px solid var(--accent-border-light); }

.kg-width-wide {
    margin-left: -8%;
    margin-right: -8%;
    width: 116%;
    max-width: none;
}

.kg-width-full {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    max-width: none;
}

.kg-width-full img { width: 100%; border: none; }

.kg-gallery-container { display: flex; flex-wrap: wrap; gap: 4px; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }

.kg-bookmark-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-border-light);
}

.kg-bookmark-container { display: flex; }
.kg-bookmark-content { flex: 1; padding: 1.25rem; }
.kg-bookmark-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.4rem; }
.kg-bookmark-description { font-size: 0.85rem; color: var(--text-muted); }
.kg-bookmark-thumbnail { width: 10rem; flex-shrink: 0; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; border: none; }

/* ========================================
   GHOST BUTTONS - Theme consistent
   ======================================== */
.kg-button-card {
    margin: 1.5rem 0;
}

.kg-button-card a,
.kg-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent-light);
    transition: all 0.2s;
    border-radius: 0;
}

.kg-button-card a:hover,
.kg-btn:hover {
    background: var(--accent);
    color: var(--gray-950);
}

/* Filled/Accent button variant */
.kg-button-card.kg-style-accent a,
.kg-btn-accent {
    background: var(--accent);
    color: var(--gray-950);
    border-color: var(--accent);
}

.kg-button-card.kg-style-accent a:hover,
.kg-btn-accent:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
}

/* Ghost card callouts/CTA */
.kg-callout-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-border-light);
    border-left: 3px solid var(--accent);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0;
}

.kg-callout-card-emoji {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.kg-callout-text {
    color: var(--text-secondary);
}

/* Product card buttons */
.kg-product-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-border-light);
    border-radius: 0;
}

.kg-product-card-button {
    background: var(--accent) !important;
    color: var(--gray-950) !important;
    border-radius: 0 !important;
    font-family: var(--font-body) !important;
}

.kg-product-card-button:hover {
    background: var(--accent-light) !important;
}

/* Toggle/Accordion cards */
.kg-toggle-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-border-light);
    border-radius: 0;
}

/* ========================================
   GLOBAL BUTTON OVERRIDE - All buttons theme consistent
   ======================================== */
/* Override any button with rounded corners or non-theme colors */
button,
.button,
[class*="btn"],
[class*="button"],
a[class*="btn"],
a[class*="button"],
input[type="submit"],
input[type="button"],
.gh-portal-btn,
.gh-btn,
.kg-header-card-button,
.kg-signup-card button,
.kg-subscribe-card button {
    border-radius: 0 !important;
}

/* Ensure filled buttons use accent color */
button:not(.modal-close):not(.share-btn):not(.lightbox-close):not(.lightbox-nav):not(.spotlight-nav),
.button,
[class*="btn"]:not(.share-btn):not(.lightbox-close):not(.lightbox-nav):not(.spotlight-nav),
a[class*="button"],
input[type="submit"],
input[type="button"],
.gh-portal-btn-main,
.kg-header-card-button a,
.kg-signup-card button,
.kg-subscribe-card button {
    background: var(--accent) !important;
    color: var(--gray-950) !important;
    border: 1px solid var(--accent) !important;
    border-radius: 0 !important;
    font-family: var(--font-body) !important;
    font-weight: 500 !important;
    transition: all 0.2s !important;
}

button:not(.modal-close):not(.share-btn):not(.lightbox-close):not(.lightbox-nav):not(.spotlight-nav):hover,
.button:hover,
[class*="btn"]:not(.share-btn):not(.lightbox-close):not(.lightbox-nav):not(.spotlight-nav):hover,
a[class*="button"]:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.gh-portal-btn-main:hover,
.kg-header-card-button a:hover,
.kg-signup-card button:hover,
.kg-subscribe-card button:hover {
    background: var(--accent-light) !important;
    border-color: var(--accent-light) !important;
}

/* Secondary/outline button variant */
.btn-outline,
.button-outline,
.gh-portal-btn-secondary {
    background: transparent !important;
    color: var(--accent) !important;
    border: 1px solid var(--accent) !important;
}

.btn-outline:hover,
.button-outline:hover,
.gh-portal-btn-secondary:hover {
    background: var(--accent) !important;
    color: var(--gray-950) !important;
}

.kg-toggle-heading-text {
    color: var(--text-primary);
    font-family: var(--font-headline);
}

.kg-toggle-content {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .modal-sidebar { width: 12rem; }
    .spotlight-container { width: 240px; }
}

@media (max-width: 900px) {
    .overlay-modal { width: 98%; height: 94%; }
    .modal-sidebar { width: 10rem; }
}

@media (max-width: 768px) {
    .spotlight-wrapper {
        position: absolute;
        right: 0.5rem; left: 0.5rem;
        top: auto; bottom: 1rem;
        transform: none;
    }
    
    .spotlight-nav {
        display: flex;
    }
    
    .spotlight-container {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        width: auto;
        max-height: none;
        flex: 1;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
    }
    
    .spotlight-widget {
        width: 220px;
        flex-shrink: 0;
        scroll-snap-align: start;
    }
    
    /* Desktop icons are now handled in the new responsive section below */
    
    .modal-reader { padding: 1.5rem 1.25rem; }
    .taskbar-item { min-width: 3rem; }
    .nav-label { display: none; }
    .archive-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .spotlight-wrapper { display: none; }
    .overlay-modal { width: 100%; height: 100%; border: none; }
}

@media print {
    .taskbar, .spotlight-wrapper, .desktop-icons, .modal-header, .modal-sidebar, .overlay-bg { display: none !important; }
    body, .os-desktop, .desktop-content, .overlay-container, .overlay-modal, .modal-main, .modal-reader {
        position: static !important; width: auto !important; height: auto !important;
        background: white !important; overflow: visible !important;
    }
    .reader-body { color: black; }
}

/* ========================================
   EXCERPT / UNTERTITEL
   ======================================== */
.reader-excerpt {
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 1.1rem;
    font-weight: 400;
    font-style: normal;
    color: var(--text-secondary);
    margin-top: -0.5rem;
    margin-bottom: 2.5rem;
    padding-left: 1rem;
    border-left: 3px solid var(--accent, #888);
    line-height: 1.7;
    letter-spacing: 0.01em;
}

@media (max-width: 768px) {
    .reader-excerpt {
        font-size: 1rem;
        margin-bottom: 2rem;
        padding-left: 0.75rem;
    }
}

/* ========================================
   YOUTUBE / VIDEO EMBEDS LARGER
   ======================================== */
.reader-body iframe[src*="youtube"],
.reader-body iframe[src*="vimeo"],
.reader-body .kg-video-card,
.reader-body .kg-embed-card {
    width: 100% !important;
    max-width: none !important;
    aspect-ratio: 16/9;
    height: auto !important;
    min-height: 400px;
}

.kg-embed-card {
    margin: 2rem 0;
}

.kg-embed-card iframe {
    width: 100% !important;
    min-height: 450px;
}

/* Wide video embeds */
.reader-body .kg-width-wide iframe,
.reader-body .kg-width-full iframe {
    min-height: 500px;
}

/* ========================================
   DESKTOP FOLDERS
   ======================================== */
.desktop-folder {
    cursor: pointer;
}

.folder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f5d76e 0%, #d4a017 100%);
    border: 1px solid var(--accent-border-light) !important;
}

.folder-icon svg {
    width: 65%;
    height: 65%;
    color: #8B6914;
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.3));
}

.folder-icon-custom {
    border: 1px solid var(--accent-border-light);
}

.folder-icon-custom img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   FOLDER POPUP - Simple & Solid
   ======================================== */

/* Popup Window - solid background, no backdrop needed */
.folder-popup {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    max-height: 70vh;
    background: #0a0a0a;
    border: 1px solid var(--accent-border);
    z-index: 10000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* Header */
.folder-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #111;
    border-bottom: 1px solid var(--accent-border-light);
}

.folder-popup-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}

.folder-popup-close {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    background: transparent;
    border: none;
    cursor: pointer;
}

.folder-popup-close:hover {
    color: #fff;
}

/* Content Grid */
.folder-popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    align-content: start;
}

/* Folder Items - Simple Links */
.folder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.folder-item:hover {
    background: rgba(255,255,255,0.05);
}

/* Folder Item Icons */
.folder-item-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.4rem;
    border: 1px solid var(--accent-border-light);
    overflow: hidden;
    background: #1a1a1a;
}

.folder-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.folder-item-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

/* Folder Item Labels */
.folder-item-label {
    font-size: 0.6rem;
    font-weight: 500;
    color: #ddd;
    text-align: center;
    max-width: 5rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty Folder Message */
.folder-empty-message {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    grid-column: 1 / -1;
    padding: 2rem 1rem;
}

/* ========================================
   GALLERY LIGHTBOX
   ======================================== */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-image {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    cursor: default;
}

.lightbox-close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10001;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* Make gallery images clickable */
.kg-gallery-image img,
.kg-image-card img {
    cursor: zoom-in;
    transition: opacity 0.2s;
}

.kg-gallery-image img:hover,
.kg-image-card img:hover {
    opacity: 0.9;
}

/* ========================================
   GALLERY RESPONSIVE - RIGHT EDGE FIX
   ======================================== */
.kg-gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-right: 0;
    width: 100%;
    box-sizing: border-box;
}

.kg-gallery-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}

.kg-gallery-image {
    flex: 1 1 auto;
    min-width: 0;
}

.kg-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   RESPONSIVE DESIGN - CONSOLIDATED
   All breakpoints in one place for clarity
   ======================================== */

/* Large Desktop (1400px - 1600px) */
@media (min-width: 1401px) and (max-width: 1600px) {
    :root {
        --scale: 1.15;
    }
}

/* Medium Desktop (1200px - 1400px) */
@media (min-width: 1201px) and (max-width: 1400px) {
    :root {
        --scale: 1.12;
    }
    
    .desktop-icon {
        width: 6rem;
    }
    
    .desktop-icon .icon-img {
        width: 4rem;
        height: 4rem;
    }
    
    .desktop-icon .icon-label {
        font-size: 0.72rem;
    }
}

/* Small Desktop / Large Tablets (1024px - 1200px) */
@media (min-width: 1025px) and (max-width: 1200px) {
    :root {
        --scale: 1.1;
    }
    
    .desktop-icons {
        gap: 1rem;
    }
    
    .desktop-icon {
        width: 6rem;
        padding: 0.6rem;
    }
    
    .desktop-icon .icon-img {
        width: 4rem;
        height: 4rem;
        margin-bottom: 0.5rem;
    }
    
    .desktop-icon .icon-label {
        font-size: 0.72rem;
        max-width: 5.5rem;
    }
    
    /* Taskbar items */
    .taskbar-item {
        min-width: 5rem;
        padding: 0 0.75rem;
    }
    
    .taskbar-item .nav-icon {
        width: 1.4rem;
        height: 1.4rem;
    }
    
    .taskbar-item .nav-label {
        font-size: 0.65rem;
    }
    
    /* Folder popup */
    .folder-popup {
        max-width: 450px;
    }
    
    .folder-item-icon {
        width: 3rem;
        height: 3rem;
    }
    
    .folder-item-label {
        font-size: 0.68rem;
    }
}

/* Medium Tablets / Small Laptops (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --scale: 1.08;
    }
    
    .desktop-icons {
        gap: 0.9rem;
    }
    
    .desktop-icon {
        width: 5.5rem;
        padding: 0.5rem;
    }
    
    .desktop-icon .icon-img {
        width: 3.75rem;
        height: 3.75rem;
        margin-bottom: 0.45rem;
    }
    
    .desktop-icon .icon-label {
        font-size: 0.68rem;
        max-width: 5rem;
    }
    
    /* Taskbar */
    .taskbar-item {
        min-width: 4.5rem;
        padding: 0 0.65rem;
    }
    
    .taskbar-item .nav-icon {
        width: 1.35rem;
        height: 1.35rem;
    }
    
    .taskbar-item .nav-label {
        font-size: 0.62rem;
    }
    
    /* Folder popup */
    .folder-popup {
        max-width: 420px;
    }
    
    .folder-popup-content {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.9rem;
    }
    
    .folder-item-icon {
        width: 2.85rem;
        height: 2.85rem;
    }
    
    .folder-item-label {
        font-size: 0.65rem;
    }
}

/* Tablets (up to 768px) */
@media (max-width: 768px) {
    :root {
        --scale: 1;
    }
    
    html {
        font-size: 16px;
    }
    
    .desktop-icons { 
        position: absolute;
        top: 1rem;
        left: 0.75rem;
        right: auto;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        max-width: calc(100vw - 1.5rem);
        z-index: 20;
    }
    
    .desktop-icon {
        width: auto;
        min-width: 0;
        padding: 0.5rem;
    }
    
    .desktop-icon .icon-img {
        width: 3.5rem;
        height: 3.5rem;
        margin-bottom: 0.4rem;
    }
    
    .desktop-icon .icon-label {
        font-size: 0.68rem;
        max-width: 4.5rem;
    }
    
    /* Folder popup tablet */
    .folder-popup {
        width: 95%;
        max-width: none;
        max-height: 65vh;
        border-radius: 6px;
    }
    
    .folder-popup-content {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.85rem;
        padding: 1rem;
    }
    
    .folder-item {
        padding: 0.6rem 0.4rem;
    }
    
    .folder-item-icon {
        width: 3rem;
        height: 3rem;
    }
    
    .folder-item-label {
        font-size: 0.65rem;
        max-width: 4.5rem;
    }
}

/* Landscape phones (max 480px width in landscape) */
@media (max-width: 480px) and (orientation: landscape) {
    .desktop-icons {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.4rem;
        left: 0.5rem;
        top: 0.5rem;
    }
    
    .desktop-icon {
        padding: 0.3rem;
    }
    
    .desktop-icon .icon-img {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .desktop-icon .icon-label {
        font-size: 0.55rem;
        max-width: 3.5rem;
    }
    
    /* Lightbox mobile landscape */
    .lightbox-close,
    .lightbox-nav {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .lightbox-close {
        top: 1rem;
        right: 1rem;
    }
    
    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
    
    /* Folder popup landscape */
    .folder-popup {
        max-height: 80vh;
    }
    
    .folder-popup-content {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.6rem;
    }
    
    .folder-item-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .folder-item-label {
        font-size: 0.55rem;
    }
}

/* Portrait phones (max 500px in portrait) */
@media (max-width: 500px) and (orientation: portrait) {
    :root {
        --scale: 1.1;
    }
    
    .desktop-icons { 
        position: absolute;
        top: 1.25rem;
        left: 1rem;
        right: auto;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        max-width: calc(100vw - 2rem);
        z-index: 20;
    }
    
    .desktop-icon {
        width: auto;
        min-width: 0;
        padding: 0.55rem;
    }
    
    .desktop-icon .icon-img {
        width: 4rem;
        height: 4rem;
        margin-bottom: 0.45rem;
    }
    
    .desktop-icon .icon-label {
        font-size: 0.78rem;
        max-width: 5rem;
        line-height: 1.3;
    }
    
    /* Hero sizing for portrait phones */
    .hero-title {
        font-size: clamp(2.8rem, 13vw, 5.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(0.65rem, 2.8vw, 0.95rem);
        letter-spacing: 0.15em;
    }
    
    /* Taskbar for portrait phones */
    .taskbar-item {
        min-width: 4.25rem;
        height: 3.25rem;
        padding: 0 0.55rem;
    }
    
    .nav-icon {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .nav-label {
        font-size: 0.62rem;
    }
    
    /* Folder popup for portrait phones */
    .folder-popup {
        width: 92%;
        max-height: 70vh;
    }
    
    .folder-popup-content {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.9rem;
        padding: 1.1rem;
    }
    
    .folder-item {
        padding: 0.55rem 0.35rem;
    }
    
    .folder-item-icon {
        width: 3.25rem;
        height: 3.25rem;
        margin-bottom: 0.4rem;
    }
    
    .folder-item-label {
        font-size: 0.7rem;
        max-width: 4.5rem;
    }
}

/* Very narrow phones (max 360px) */
@media (max-width: 360px) {
    .desktop-icons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .desktop-icon .icon-img {
        width: 3.75rem;
        height: 3.75rem;
    }
    
    .desktop-icon .icon-label {
        font-size: 0.72rem;
    }
    
    .folder-popup-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .folder-item-icon {
        width: 3rem;
        height: 3rem;
    }
}
