:root {
    --max-panel-width: 500px;
    --panel-bg: rgba(255, 255, 255, 0.8);
    --text-color: #111;
    --heading-font: 'Segoe UI', sans-serif;
    --button-bg: #ff0000;
    --button-bg-hover: #dc0000;
    --button-bg-active: #000000;
    --panel-offset: 2rem;
    --panel-blur: 1px;
    --panel-border: rgba(255, 255, 255, 0.345);
}

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

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: var(--heading-font);
    color: var(--text-color);
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--button-bg);
    border-radius: 10px;
    border: 2px solid #fff;
}

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

::-webkit-scrollbar-thumb:active {
    background: var(--button-bg-active);
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--button-bg) #f1f1f1;
}

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;

    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;

    pointer-events: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes backgroundZoom {
    from {
        transform: scale(1.1);
        opacity: 0.7;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-right {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.8s ease-out forwards;
}

.animate-delay-1 {
    animation-delay: 0.2s;
}

.animate-delay-2 {
    animation-delay: 0.4s;
}

.animate-delay-3 {
    animation-delay: 0.6s;
}

.animate-delay-4 {
    animation-delay: 0.8s;
}

.content-panel {
    opacity: 0;
}

.section-title {
    opacity: 0;
    transform: translateY(30px);
}

.section {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    z-index: 0;
}

.background-image {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.background-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
}

#about-book .background-image img {
    image-rendering: pixelated;
}

.content-panel {
    position: relative;
    z-index: 1;
    background: var(--panel-bg);
    backdrop-filter: blur(var(--panel-blur));
    -webkit-backdrop-filter: blur(var(--panel-blur));
    border: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 85%;
    max-width: var(--max-panel-width);
    padding: 2rem 2.5rem;
    gap: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 20px 30px rgba(255, 255, 255, 0.25);
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: rgba(255, 255, 255, 0.9);
    will-change: transform;
    transform: translateZ(0);
}

.content-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 40px rgba(255, 255, 255, 0.35);
}

.text-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.text-column h1 {
    font-size: 2rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.8s ease-out;
}

.text-column h2 {
    font-size: 1.75rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.8s ease-out;
}

.text-column h3 {
    font-size: 1.125rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out;
}

.image-column {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-column img {
    max-width: 100%;
    max-height: 50vh;
    object-fit: contain;
    border-radius: 1rem;
    display: block;
    opacity: 0;
    transform: scale(0.8);
    transition: all 1s ease-out;
}

.image-column img:hover {
    transform: scale(1.05);
}

.caption {
    font-size: 1.2rem;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out;
}

.cta-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    padding: 0.9rem 7rem;
    background-color: var(--button-bg);
    color: #fff;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    will-change: transform;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    animation: float 1.2s ease-in-out infinite;
    background-color: var(--button-bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 0, 0, 0.3);
}

.cta-button:active {
    animation: none;
    transform: translateY(2px);
    background-color: var(--button-bg-active);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .section:nth-of-type(even) .content-panel {
        margin-left: var(--panel-offset);
        margin-right: auto;
    }

    .section:nth-of-type(odd) .content-panel {
        margin-left: auto;
        margin-right: var(--panel-offset);
    }
}

.section-title {
    position: relative;
    z-index: 1;
    background: var(--panel-bg);
    backdrop-filter: blur(var(--panel-blur));
    -webkit-backdrop-filter: blur(var(--panel-blur));
    border: 1px solid var(--panel-border);
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    max-width: var(--max-panel-width);
    width: 85%;
    font-size: 1.75rem;
    text-align: center;
    box-shadow: 4px 4px 60px rgba(255, 255, 255, 0.4);
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.9);
    will-change: transform;
    transform: translateZ(0);
}

.section-title:hover {
    transform: scale(1.02);
}

.footer {
    background-color: #000000;
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
}

.animate-in {
    opacity: 1 !important;
    transform: translateY(0) translateX(0) scale(1) !important;
}

.animate-in .background-image {
    opacity: 1;
}

.animate-in .text-column h1,
.animate-in .text-column h2,
.animate-in .text-column h3 {
    opacity: 1;
    transform: translateY(0);
}

.animate-in .image-column img {
    opacity: 1;
    transform: scale(1);
}

.animate-in .caption {
    opacity: 1;
    transform: translateY(0);
}

.animate-in .cta-button {
    opacity: 1;
    transform: translateY(0);
}

.animate-in .text-column h1 {
    transition-delay: 0.2s;
}

.animate-in .text-column h2 {
    transition-delay: 0.3s;
}

.animate-in .image-column img {
    transition-delay: 0.4s;
}

.animate-in .text-column h3 {
    transition-delay: 0.5s;
}

.animate-in .caption {
    transition-delay: 0.6s;
}

.animate-in .cta-button {
    transition-delay: 0.7s;
}

.content-panel .text-column h1:hover {
    color: var(--button-bg);
    transition: color 0.3s ease;
}

.content-panel .text-column h2:hover {
    color: var(--button-bg);
    transition: color 0.3s ease;
}

@media (max-width: 768px) {
    .content-panel:hover {
        transform: none;
    }
    
    .image-column img:hover {
        transform: none;
    }
    
    .section-title:hover {
        transform: none;
    }
}