html {
    scroll-behavior: auto;
    overflow-anchor: none;
}

@media (max-width: 768px) {
    * {
        scroll-margin-top: 0;
        scroll-margin-bottom: 0;
    }
    
    body {
        overflow-anchor: none;
        -webkit-overflow-scrolling: touch;
    }
    
    input, textarea, select {
        scroll-margin: 0;
    }
}

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    transition: opacity 0.4s ease, visibility 0.4s ease, background-color 0.3s ease;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
    font-family: var(--font-display);
}

.splash-logo-part1 {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.splash-logo-part2 {
    color: var(--text-primary);
}

@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: fade-out 0.3s ease-out;
}

::view-transition-new(root) {
    animation: fade-in 0.3s ease-in;
}

@keyframes fade-out {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.98); }
}

@keyframes fade-in {
    from { opacity: 0; transform: scale(1.02); }
    to { opacity: 1; transform: scale(1); }
}

.page-transition-enter {
    animation: pageEnter 0.4s ease-out forwards;
}

.page-transition-enter #bottom-nav,
.page-transition-exit #bottom-nav {
    transform: none;
    -webkit-transform: none;
    animation: none;
}

.page-transition-exit {
    animation: pageExit 0.3s ease-in forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-base);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    animation: bodyFadeIn 0.5s ease-out;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease;
}

@media (max-width: 768px) {
    #bottom-nav {
        visibility: hidden;
        opacity: 0;
        overflow: hidden;
    }

    #bottom-nav.nm-bottom-nav-ready {
        visibility: visible;
        opacity: 1;
    }

    #bottom-nav .bottom-nav-item {
        min-width: 0;
        flex: 1 1 0;
    }
}

@keyframes bodyFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

.container {
    width: 100%;
    max-width: calc(var(--content-max-width) + 48px);
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

.container-sm {
    max-width: 800px;
}

.container-lg {
    max-width: 1600px;
}

@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}
