:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --border-primary: #2a2a2a;
    --border-secondary: #3a3a3a;

    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-tertiary: #c0c0c0;
    --text-muted: #a0a0a0;

    --accent-from: #5c5cff;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    --title-font: "Italianno", cursive;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e5e5e5;
    --border-primary: #e0e0e0;
    --border-secondary: #d0d0d0;

    --text-primary: #0a0a0a;
    --text-secondary: #1a1a1a;
    --text-tertiary: #404040;
    --text-muted: #666666;

    --accent-from: #1818ff;
}

::selection {
    background-color: var(--accent-from);
    color: white;
}

::-moz-selection {
    background-color: var(--accent-from);
    color: white;
}

/* 
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-from);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}
*/

::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
}

::view-transition-new(root) {
    z-index: 9999;
}

::view-transition-old(root) {
    z-index: 1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    display: block;
    position: relative;
}

.section-title {
    font-family: var(--title-font);
    font-size: 3rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

@keyframes itemFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blur-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    z-index: 9999;
    pointer-events: none;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    mask-image: linear-gradient(to bottom, black 0%, black 10%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 10%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.blur-overlay.visible {
    opacity: 1;
}

.container>* {
    opacity: 0;
    transform: translateY(10px);
    animation: itemFade 0.5s ease-out forwards;
    animation-delay: calc(var(--i) * 0.15s);
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.right-buttons {
    display: flex;
    gap: 0;
    align-items: center;
}

.theme-toggle {
    display: flex;
}

.theme-home {
    border-top-left-radius: 25px;
    border-bottom-left-radius: 25px;
}

.theme-back {
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
}

.theme-sound {
    border-top-left-radius: 25px;
    border-bottom-left-radius: 25px;
}

.theme-theme {
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
}

.theme-btn {
    width: 35px;
    height: 35px;
    background-color: var(--bg-secondary);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.theme-btn svg {
    width: 15px;
    height: 15px;
}

.theme-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Layout */
.project-view-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 45vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
    animation: itemFade 0.6s ease-out forwards;
}

.container {
    max-width: none;
    width: 55vw;
    margin-left: 45vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2rem 3rem;
    gap: 1.5rem;
    box-sizing: border-box;
}

.container>.top-bar:first-child {
    position: sticky;
    top: 0;
    z-index: 5;
    padding-top: 1rem;
}

.content-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.content-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.content {
    flex: 1;
    position: relative;
    min-height: 40vh;
}

.content .page {
    display: none;
    line-height: 1.9;
    font-size: 0.95rem;
    color: var(--text-tertiary);
    letter-spacing: 0.01em;
    animation: fadeIn 0.4s ease-out;
}

.content .page.active {
    display: block;
}

.content .page p {
    margin-bottom: 1.25rem;
}

.content .page p:last-child {
    margin-bottom: 0;
}

.page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.page-arrow {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.page-arrow svg {
    width: 16px;
    height: 16px;
}

.page-arrow:hover:not(:disabled) {
    background-color: var(--bg-tertiary);
}

.page-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.page-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    min-width: 3rem;
    text-align: center;
}

/* Mobile */
@media (max-width: 900px) {

    .top-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .right-buttons {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .theme-toggle {
        display: flex;
        overflow: hidden;
        border-radius: 999px;

        background: rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(28px) saturate(180%);
        -webkit-backdrop-filter: blur(28px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, .18);

        box-shadow:
            0 10px 40px rgba(0, 0, 0, .18),
            inset 0 1px 1px rgba(255, 255, 255, .35);
    }

    .theme-btn {
        width: 38px;
        height: 38px;

        border: none;
        background: transparent;

        color: var(--text-primary);

        display: flex;
        align-items: center;
        justify-content: center;

        cursor: pointer;
        transition: all .25s ease;
        position: relative;
    }

    .theme-btn svg {
        width: 16px;
        height: 16px;
    }

    .theme-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        color: white;
    }

    .theme-btn:active {
        background: rgba(255, 255, 255, 0.12);
        transform: scale(.95);
    }

    /* Divider between buttons */
    .theme-btn+.theme-btn {
        border-left: 1px solid rgba(255, 255, 255, .08);
    }

    .project-view-image {
        position: relative;
        width: 100%;
        height: 45vh;
        z-index: 0;
    }

    .container {
        width: 100%;
        margin-left: 0;
        padding: 1.5rem;
    }

    .container>.top-bar:first-child {
        position: fixed;
        top: max(1rem, env(safe-area-inset-top));
        left: 1rem;
        right: 1rem;
        z-index: 9999;
    }
}

@media (max-width: 640px) {
    .project-view-image {
        height: 38vh;
    }

    .container {
        padding: 1.25rem;
    }
}

/* Accessibility */
.theme-btn:focus-visible,
.page-arrow:focus-visible {
    z-index: 2;
    outline: 2px solid var(--accent-from);
    outline-offset: 2px;
}