/* Common base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: #222;
    background: #fff;
    position: relative;
}

/* Menu toggle button */
.menu-toggle {
    display: none;
    position: fixed;
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    z-index: 1100;
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    transition: 0.3s;
}

/* Sidebar navigation */
.sidebar {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    z-index: 100;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.sidebar-nav a {
    color: #444;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 400;
    transition: all 0.3s ease;
    text-align: center;
    display: block;
    padding: 8px 16px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.sidebar-nav a:hover {
    color: #000;
    background-color: #f5f5f5;
    transform: translateX(-4px);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px 20px;
}

/* Page header */
.page-header {
    text-align: center;
    font-size: 2.8em;
    font-weight: 300;
    color: #000;
    margin: 8px 0 16px;
    letter-spacing: -0.5px;
}

/* Section headings */
h2 {
    font-size: 1.7em;
    font-weight: 400;
    color: #000;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 30px 15px;
        padding-right: 20px;
    }
    
    .page-header {
        font-size: 2.2em;
    }
    
    h2 {
        font-size: 1.5em;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        top: calc(16px + env(safe-area-inset-top, 0px) + 44px);
        right: calc(16px + env(safe-area-inset-right, 0px));
        width: 160px;
        border-radius: 24px;
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
        background: transparent;
        border: none;
        transform: translateX(calc(100% + 24px));
        transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
        padding: 0;
        overflow: visible;
        z-index: 1000;
        will-change: transform;
    }

    .sidebar::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        border-radius: inherit;
        background: rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(14px) saturate(180%) brightness(1.10);
        -webkit-backdrop-filter: blur(14px) saturate(180%) brightness(1.10);
        border: 1px solid rgba(255, 255, 255, 0.45);
        filter: url(#liquid-glass);
    }

    .sidebar::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        border-radius: inherit;
        background: radial-gradient(170px 150px at 22% 14%, rgba(255,255,255,0.55), rgba(255,255,255,0) 62%),
                    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0));
        opacity: 0.95;
        mix-blend-mode: screen;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-nav {
        position: relative;
        z-index: 1;
        gap: 0;
        width: 100%;
        padding: 12px 10px;
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-nav a {
        padding: 12px;
        font-size: 0.95em;
        text-align: center;
        border-radius: 14px;
        color: rgba(0, 0, 0, 0.9);
        background: transparent;
        transition: all 0.2s ease;
    }
    
    .sidebar-nav a:hover,
    .sidebar-nav a:active {
        background: rgba(255, 255, 255, 0.18);
    }
}

@media (max-width: 1024px) and (orientation: landscape) {
    .container {
        padding-right: 150px;
    }
}
