:root {
    --primary-color: #2d241e;
    /* Deep Charcoal Brown */
    --accent-olive: #606c38;
    /* Based on the green skirt */
    --accent-terracotta: #bc6c25;
    /* Warm earthy accent */
    --accent-sand: #dda15e;
    /* Lighter sand tone */
    --accent-red: #9e2a2b;
    /* Based on bracelet accent */
    --text-color: #4a3f35;
    --light-bg: #fefae0;
    /* Warm cream from the image */
    --border-color: #e9edc9;
    --sidebar-width: 250px;
    --font-main: 'Outfit', sans-serif;
}

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

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

body {
    font-family: var(--font-main);
    color: var(--primary-color);
    background-color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

/* Sidebar Styling - Modern Redesign */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    border-right: 1px solid var(--border-color);
    padding: 20px 15px;
    /* Reduced padding */
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fcfdff 0%, #f1f5f9 100%);
    z-index: 100;
    animation: sidebarIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes sidebarIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.logo {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 25px;
    background: linear-gradient(135deg, var(--accent-olive) 0%, var(--accent-terracotta) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

/* AI Assistant Sidebar Redesign */
.ai-assistant {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
    border-radius: 20px;
    padding: 15px;
    /* Slightly reduced padding */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
    margin-top: 10px;
}

.ai-assistant h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-assistant h3::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    /* Green status dot */
    border-radius: 50%;
    display: inline-block;
}

.chat-window {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 15px;
    scrollbar-width: none;
}

.chat-window::-webkit-scrollbar {
    display: none;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 90%;
}

.message-wrapper.bot {
    align-self: flex-start;
}

.message-wrapper.user {
    align-self: flex-end;
}

.message {
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.85rem;
    line-height: 1.5;
    position: relative;
    animation: chatPopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes chatPopIn {
    0% {
        opacity: 0;
        transform: scale(0) translateY(20px);
    }

    40% {
        transform: scale(1.15);
    }

    60% {
        transform: scale(0.95);
    }

    85% {
        transform: scale(1.02);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.message.bot {
    transform-origin: bottom left;
}

.message.user {
    transform-origin: bottom right;
}

.message.bot {
    background: #f1f5f9;
    color: var(--primary-color);
    border-top-left-radius: 2px;
    width: 180px;
}

/* Bot color variations - Earth Tones */
.message.bot.olive {
    background-color: #f0f4e4;
    border-left: 3px solid var(--accent-olive);
}

.message.bot.terracotta {
    background-color: #fff4ea;
    border-left: 3px solid var(--accent-terracotta);
}

.message.bot.orange {
    background-color: #fffbeb;
    border-left: 3px solid var(--accent-sand);
}

.message.bot.red {
    background-color: #fef2f2;
    border-left: 3px solid var(--accent-red);
}

.message.user {
    background: var(--accent-terracotta);
    /* Changed to earth tone */
    color: #fff;
    border-top-right-radius: 2px;
}

.chat-input-container {
    display: flex;
    position: relative;
    width: 100%;
}

#ai-input {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 25px;
    padding: 10px 45px 10px 15px;
    /* right padding for button space */
    font-size: 0.85rem;
    outline: none;
    color: var(--primary-color);
}

#ai-send-btn {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--accent-olive) 0%, var(--accent-terracotta) 100%);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#ai-send-btn:hover {
    transform: translateY(-50%) scale(1.1) rotate(15deg);
    box-shadow: 0 6px 15px rgba(96, 108, 56, 0.3);
}

.sidebar-footer {
    padding-top: 15px;
}

.email-link {
    display: block;
    margin-bottom: 20px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 1px solid var(--primary-color);
    width: fit-content;
    padding-bottom: 2px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    color: #333;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.social-icons a:hover {
    transform: translateY(-3px);
}

/* Main Content Styling */
main {
    margin-left: var(--sidebar-width);
    padding: 0;
}

.mobile-header {
    display: none;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 60px 20px 60px;
    /* Reduced vertical padding */
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 40%);
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
    text-align: center;
    padding-top: 20px;
}

.hero-image-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin-bottom: -50px;
    z-index: 1;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.diamond-bg {
    position: absolute;
    width: 450px;
    height: 450px;
    background-color: var(--accent-color);
    transform: rotate(45deg);
    z-index: 1;
    border-radius: 80px;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 20px 50px rgba(236, 72, 153, 0.15);
    animation: fadeInScale 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-text {
    z-index: 2;
    pointer-events: none;
    animation: slideUpFade 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s backwards;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.role {
    font-size: 0.8rem;
    letter-spacing: 6px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--accent-olive);
    text-transform: uppercase;
}

.hero-text h1 {
    font-size: 6rem;
    font-weight: 800;
    line-height: 0.8;
    margin: 0;
    color: var(--primary-color);
    letter-spacing: -2px;
    background: linear-gradient(135deg, var(--primary-color) 60%, var(--accent-olive) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-socials {
    margin-top: 30px;
    display: flex;
    gap: 20px;
    justify-content: center;
    pointer-events: auto;
    /* Allow clicking socials */
}

.hero-socials a {
    color: var(--text-color);
    font-size: 1.3rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
}

.hero-socials a:hover {
    transform: translateY(-8px) scale(1.2);
}

.hero-socials a:nth-child(1):hover {
    color: #E1306C;
}

.hero-socials a:nth-child(2):hover {
    color: #0077b5;
}

.hero-socials a:nth-child(3):hover {
    color: #3b5998;
}

.hero-socials a:nth-child(4):hover {
    color: #333;
}

.hero-number {
    position: absolute;
    font-size: 35rem;
    font-weight: 800;
    color: #f7f7f7;
    right: -150px;
    bottom: -150px;
    z-index: -1;
    line-height: 1;
}

.hero-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Better vertical alignment */
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    gap: 20px;
}

.services-grid {
    display: flex;
    gap: 30px;
    /* Reduced gap to prevent overlap */
    flex: 1;
    justify-content: space-evenly;
}

.service-item {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

.service-item.color-1 .service-num {
    color: var(--accent-olive);
}

.service-item.color-2 .service-num {
    color: var(--accent-terracotta);
}

.service-item.color-3 .service-num {
    color: var(--accent-red);
}

.section-title h2 {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0;
    color: var(--accent-olive);
}

.service-item h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.service-item p {
    font-size: 0.8rem;
    color: var(--text-color);
    line-height: 1.5;
}

.download-resume-btn {
    background: linear-gradient(135deg, var(--accent-olive) 0%, var(--accent-terracotta) 100%);
    color: #fff;
    border: none;
    padding: 16px 20px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 12px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    white-space: nowrap;
}

.download-resume-btn:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 15px 30px rgba(96, 108, 56, 0.25);
    background: linear-gradient(135deg, var(--accent-terracotta) 0%, var(--accent-olive) 100%);
}

/* Skills Marquee */
.skills-section {
    padding: 60px 0;
    overflow: hidden;
    margin: 40px 0;
}

.marquee-container {
    width: 100%;
    position: relative;
    display: flex;
}

.marquee-content {
    display: flex;
    gap: 60px;
    animation: marquee 30s linear infinite;
    white-space: nowrap;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 10px 20px;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-olive);
}

.skill-item i {
    font-size: 1.5rem;
    color: var(--accent-terracotta);
}

.skill-item i.fab.fa-jenkins {
    color: #D24939;
}

.skill-item i.fab.fa-git-alt {
    color: #F05032;
}

.skill-item i.fab.fa-js {
    color: #F7DF1E;
}

.skill-item i.fas.fa-database {
    color: var(--accent-olive);
}

.skill-item:has(span:contains("MySQL")) i {
    color: #4479A1;
}

.content-section {
    padding: 30px 50px;
    background: #fff;
}

/* Education/Experience Alignment Fix */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.education-col,
.experience-col {
    display: flex;
    flex-direction: column;
}

.experience-col {
    margin-top: 27px;
    /* Aligning with Education h2 which has a tag above it */
}

.section-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: #aaa;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 10px;
}

h2 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 40px;
    line-height: 1.1;
}

.entry {
    margin-bottom: 40px;
}

.entry-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-terracotta);
}

.entry h3 {
    font-size: 1.4rem;
    margin: 8px 0;
    color: var(--accent-olive);
}

.entry p {
    color: var(--text-color);
    font-size: 0.9rem;
    border-left: 2px solid var(--border-color);
    padding-left: 15px;
    margin-left: 5px;
}

.entry-list {
    margin: 10px 0 0 25px;
    padding: 0;
    list-style-type: circle;
    font-size: 0.85rem;
    color: var(--text-color);
}

.entry-list li {
    margin-bottom: 5px;
}

/* Footer */
.site-footer {
    padding: 30px 60px;
    text-align: right;
}

.site-footer p {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.6;
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.23, 1, 0.32, 1),
        transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
}

.reveal-up {
    transform: translateY(50px);
}

.reveal-up.active {
    transform: translateY(0);
}

.reveal-down {
    transform: translateY(-50px);
}

.reveal-down.active {
    transform: translateY(0);
}

.reveal-left {
    transform: translateX(50px);
}

.reveal-left.active {
    transform: translateX(0);
}

.reveal-right {
    transform: translateX(-50px);
}

.reveal-right.active {
    transform: translateX(0);
}

.reveal-scale {
    transform: scale(0.9);
}

.reveal-scale.active {
    transform: scale(1);
}

.reveal-slider {
    transform: scale(1.1);
    filter: blur(10px) opacity(0);
}

.reveal-slider.active {
    transform: scale(1);
    filter: blur(0) opacity(1);
}

/* Staggered Delay Utilities */
.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

.delay-5 {
    transition-delay: 0.5s;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-text h1 {
        font-size: 6rem;
    }

    .hero-number {
        font-size: 15rem;
    }
}

@media (max-width: 900px) {
    .logo {
        margin-bottom: 0px;
    }

    .sidebar {
        display: flex;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 100%;
        max-width: 300px;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
        animation: none;
        /* Prevent sliding in on load for mobile */
    }

    .sidebar.active {
        transform: translateX(0);
    }

    main {
        margin-left: 0;
    }

    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 30px;
        position: fixed;
        width: 100%;
        top: 0;
        background: #fff;
        z-index: 1000;
        border-bottom: 1px solid var(--border-color);
    }

    .menu-toggle i {
        color: var(--accent-terracotta);
        font-size: 1.5rem;
    }

    .hero {
        padding-top: 120px;
        padding-left: 30px;
        padding-right: 30px;
    }

    .hero-image-container {
        width: 300px;
        height: 300px;
    }

    .hero-img {
        width: 100%;
        border-width: 3px;
    }

    .hero-text {
        position: static;
        text-align: center;
        margin-top: 30px;
        transform: none;
    }

    .hero-text h1 {
        font-size: 5rem;
    }

    .hero-socials {
        justify-content: center;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-footer {
        flex-direction: column;
        align-items: center;
        gap: 40px;
        padding-bottom: 40px;
    }

    .services-grid {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .service-item {
        max-width: 100%;
    }
}

.photo-slider-section {
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
    margin-top: -150px;
}

/* perspective container */
.carousel {
    width: 100%;
    height: 400px;
    perspective: 700px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Aggressive mask to hide the sides/front rotation completely */
    /* -webkit-mask-image: linear-gradient(to right, transparent 5%, black 40%, black 60%, transparent 95%);
    mask-image: linear-gradient(to right, transparent 5%, black 40%, black 60%, transparent 95%); */
}

/* rotating cylinder */
.carousel-track {
    position: relative;
    width: 200px;
    height: 300px;
    transform-style: preserve-3d;
    animation: rotateCarousel 40s linear infinite;
}

/* slides */
.slide {
    position: absolute;
    width: 200px;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    backface-visibility: hidden;
    /* Hide the slide's back side */
}

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

/* cylinder positioning - rotate 180deg so they face INWARD */
/* 12 slides = 30 degree intervals */
/* translateZ increased to 500px to add gaps between photos */
.slide:nth-child(1) {
    transform: rotateY(0deg) translateZ(500px) rotateY(180deg);
}

.slide:nth-child(2) {
    transform: rotateY(30deg) translateZ(500px) rotateY(180deg);
}

.slide:nth-child(3) {
    transform: rotateY(60deg) translateZ(500px) rotateY(180deg);
}

.slide:nth-child(4) {
    transform: rotateY(90deg) translateZ(500px) rotateY(180deg);
}

.slide:nth-child(5) {
    transform: rotateY(120deg) translateZ(500px) rotateY(180deg);
}

.slide:nth-child(6) {
    transform: rotateY(150deg) translateZ(500px) rotateY(180deg);
}

.slide:nth-child(7) {
    transform: rotateY(180deg) translateZ(500px) rotateY(180deg);
}

.slide:nth-child(8) {
    transform: rotateY(210deg) translateZ(500px) rotateY(180deg);
}

.slide:nth-child(9) {
    transform: rotateY(240deg) translateZ(500px) rotateY(180deg);
}

.slide:nth-child(10) {
    transform: rotateY(270deg) translateZ(500px) rotateY(180deg);
}

.slide:nth-child(11) {
    transform: rotateY(300deg) translateZ(500px) rotateY(180deg);
}

.slide:nth-child(12) {
    transform: rotateY(330deg) translateZ(500px) rotateY(180deg);
}

/* rotation animation */
@keyframes rotateCarousel {
    from {
        transform: rotateY(0deg);
    }

    to {
        transform: rotateY(360deg);
    }
}

/* Contact Section */
.contact-section {
    padding: 20px 50px 80px;
    background: #fff;
}

.contact-container {
    display: flex;
    gap: 60px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info {
    flex: 1;
}

.contact-info h2 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.contact-info p {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 35px;
    max-width: 500px;
}

.contact-details {
    margin-bottom: 30px;
}

.contact-details p {
    font-size: 1rem;
    margin-bottom: 8px;
}

.email-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--accent-olive) 0%, var(--accent-terracotta) 100%);
    color: #fff;
    border: none;
    padding: 16px 25px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
}

.email-btn:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 15px 30px rgba(96, 108, 56, 0.25);
    background: linear-gradient(135deg, var(--accent-terracotta) 0%, var(--accent-olive) 100%);
}

.map-wrapper {
    flex: 1;
    height: 370px;
    border-radius: 30px;
    border: 8px solid #f8f9fa;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

@media (max-width: 900px) {
    .contact-section {
        padding: 0px 30px 60px;
    }

    .contact-container {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .contact-info h2 {
        font-size: 2.8rem;
    }

    .contact-info p {
        margin-left: auto;
        margin-right: auto;
    }

    .map-wrapper {
        width: 100%;
        height: 370px;
    }
}

/* Travel Diary Section */
.diary-section {
    padding: 10px 50px 150px;
    margin-top: -100px;
    /* Increased bottom padding */
    min-height: 900px;
    /* Increased to fit the 3D depth */
    position: relative;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 2;
    /* Added to prevent child element overflow */
}

#container {
    width: 100%;
    max-width: 1200px;
    height: 700px;
    /* Increased height to prevent vertical clipping */
    margin: 0 auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 2500px;
    /* Enhanced perspective */
}

.v-center {
    display: inline-block;
    vertical-align: middle;
    height: 100%;
    width: 0;
}

.book {
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    width: 30em;
    height: 40em;
    transform: rotateX(45deg) rotateY(0deg) rotateZ(-45deg);
    font-size: 1.1vw;
    /* Balanced font size */
}

.book .side {
    width: 3em;
    height: 40em;
    background: #8b4513;
    /* Darker terracotta/brown for spine */
    position: absolute;
    left: -3em;
    top: 0;
    transform-origin: 100% 100%;
    transform: rotateY(-90deg) rotateX(0deg);
}

.book .bottom {
    width: 25em;
    height: 3em;
    background: #e2e2e2;
    position: absolute;
    bottom: 0;
    left: 0;
    transform-origin: 100% 100%;
    transform: rotateX(90deg);
}

.book.open {
    /* Shifted right (translateX) so both pages are clearly visible in the center */
    transform: translateX(12em) rotateX(35deg) rotateY(0deg) rotateZ(-35deg);
}

.book .paper,
.book .shadow {
    width: 25em;
    height: 40em;
    position: absolute;
    top: 0;
    left: 0;
}

.book .shadow {
    background: transparent;
    transform: translateZ(-3em);
    box-shadow: -1em 1em 0px 0px #ccc3a9;
    z-index: 1;
}

.book .paper {
    transition: transform 1s, box-shadow 0.5s 0.2s;
    transform-origin: 0 50%;
    transform-style: preserve-3d;
}

.book .paper.open {
    box-shadow: 2.2em 1em 0px 0px #ccc3a9;
    transform: rotateX(0deg) rotateY(-180deg) rotateZ(0deg);
}

.book .paper .page.front {
    transition: transform 1s;
    transform-origin: 0 50%;
    backface-visibility: hidden;
    z-index: 2;
}

.book .page {
    width: 100%;
    height: 100%;
    position: absolute;
    -webkit-transform: translateZ(0px);
    transform: translateZ(0px);
}

.book .first .page {
    background: var(--accent-terracotta);
}

.book .first .page.front:after {
    position: absolute;
    content: "";
    width: 50%;
    height: 100%;
    left: 0;
    top: 0;
    background: rgba(160, 115, 115, 0.1);
}

.book .paper .back {
    transition: transform 1s;
    transform-origin: 0 50%;
    background: #e1e1e1;
}

.book .first.paper .back {
    background: var(--accent-terracotta);
}

.book .intro {
    position: absolute;
    width: 90%;
    width: calc(100% - 3em);
    height: 90%;
    height: calc(100% - 3em);
    border: 2em solid #eee;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.book .intro h2 {
    font-size: 2.5em;
    color: #fff;
    letter-spacing: 8px;
    margin-bottom: 20px;
    font-weight: 700;
}

.book .intro h1 {
    font-size: 5em;
    color: #fff;
    font-weight: 800;
}

.book .paper:not(.first) .page {
    background: #f1f1f1;
    background-image: linear-gradient(90deg, transparent 40px, #abced4 40px, #abced4 42px, transparent 42px),
        linear-gradient(#e1e1e1 0.1em, transparent 0.1em);
    background-size: 100% 1.5em;
}

.book .paper:not(.first) .back {
    background: #e1e1e1;
}

.book .open.second .back {
    transform: translateZ(-1px);
}

.book .open.third .back {
    transform: translateZ(-2px);
}

.book .paper.first {
    z-index: 8;
}

.book .paper.second {
    z-index: 7;
}

.book .paper.third {
    z-index: 6;
}

.book .paper.fourth {
    z-index: 5;
}

.book .paper.first .front {
    transform: translateZ(0.4px);
}

.book .paper.second .front {
    transform: translateZ(0.3px);
}

.book .paper.third .front {
    transform: translateZ(0.2px);
}

.book .paper.fourth .front {
    transform: translateZ(0.1px);
}

#diary-link {
    position: absolute;
    bottom: 30px;
    right: 50px;
    color: #615858;
    letter-spacing: 2px;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 2px solid #615858;
}

/* Diary Decorations - Chat Bubbles */
.diary-bubble {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    animation: floatDecor 6s ease-in-out infinite;
}

.diary-bubble span {
    padding: 10px 20px;
    border: 2px dotted var(--accent-sand);
    border-radius: 30px;
    background: transparent;
    color: var(--accent-terracotta);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: inline-block;
}

.bubble-1 {
    top: 10%;
    left: 8%;
    animation-delay: 0s;
}

.bubble-1 span {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.bubble-2 {
    top: 15%;
    right: 12%;
    animation-delay: 1s;
}

.bubble-2 span {
    border-color: var(--accent-terracotta);
    color: var(--accent-terracotta);
}

.bubble-3 {
    bottom: 20%;
    left: 8%;
    animation-delay: 2s;
}

.bubble-3 span {
    border-color: var(--accent-olive);
    color: var(--accent-olive);
}

.bubble-4 {
    bottom: 15%;
    right: 10%;
    animation-delay: 3s;
}

.bubble-4 span {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.bubble-5 {
    top: 40%;
    left: 5%;
    animation-delay: 4s;
}

.bubble-5 span {
    border-color: var(--accent-sand);
    color: var(--accent-sand);
}

.bubble-6 {
    bottom: 50%;
    right: 6%;
    animation-delay: 5s;
}

.bubble-6 span {
    border-color: var(--accent-olive);
    color: var(--accent-olive);
}

/* Decorative Image Bubbles */
.diary-img-bubble {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 15px;
    overflow: hidden;
    border: 2px dotted var(--accent-sand);
    padding: 3px;
    background: transparent;
    pointer-events: none;
    z-index: 1;
    animation: floatDecor 8s ease-in-out infinite;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.diary-img-bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.img-bubble-1 {
    top: 20%;
    left: 20%;
    animation-delay: 0.5s;
    width: 60px;
    height: 60px;
}

.img-bubble-2 {
    top: 25%;
    right: 5%;
    animation-delay: 1.5s;
    width: 90px;
    height: 90px;
    border-color: var(--accent-terracotta);
}

.img-bubble-3 {
    bottom: 35%;
    left: 5%;
    animation-delay: 2.5s;
    width: 75px;
    height: 75px;
    border-color: var(--accent-olive);
}

.img-bubble-4 {
    bottom: 10%;
    right: 20%;
    animation-delay: 3.5s;
    width: 65px;
    height: 65px;
}

.img-bubble-5 {
    top: 60%;
    left: 15%;
    animation-delay: 4.5s;
    width: 85px;
    height: 85px;
    border-color: var(--accent-red);
}

.img-bubble-6 {
    top: 30%;
    right: 15%;
    animation-delay: 5.5s;
    width: 70px;
    height: 70px;
    border-color: var(--accent-olive);
}

@keyframes floatDecor {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

.flight-path {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background-image: radial-gradient(circle at 50% 50%, transparent 60%, rgba(188, 108, 37, 0.05) 100%); */
    pointer-events: none;
    z-index: 0;
}

.flight-path::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(90deg, transparent, transparent 10px, var(--accent-sand) 10px, var(--accent-sand) 20px);
    opacity: 0.1;
    transform: rotate(-15deg);
}

@media (max-width: 1200px) {
    .diary-decor {
        font-size: 2rem;
    }
}

@media (max-width: 900px) {
    .diary-decor {
        display: none;
    }

    /* Keep mobile clean */

    .book {
        font-size: 1.8vw;
    }

    .diary-section {
        min-height: 700px;
        padding: 50px 20px 100px;
    }
}

@media (max-width: 600px) {
    .book {
        font-size: 2.8vw;
        /* Adjusted for smaller viewports to prevent horizontal overflow */
    }

    .book.open {
        transform: translateX(4em) rotateX(35deg) rotateY(0deg) rotateZ(-35deg);
        /* Reduced shift for mobile */
    }

    .diary-section {
        min-height: 550px;
        margin-top: -150px;
        overflow: hidden;
    }

    .bubble-1,
    .bubble-3,
    .bubble-5,
    .bubble-6,
    .img-bubble-5,
    .img-bubble-6 {
        display: none;
    }

    .img-bubble-4 {
        bottom: 5%;
    }

    .img-bubble-3 {
        bottom: 25%;
    }

    /* Mobile Layout Overflow Fixes */
    h2 {
        font-size: 2.2rem;
        margin-bottom: 20px;
    }

    .hero-text h1 {
        font-size: 3.2rem;
    }

    .content-section {
        padding: 40px 50px;
        overflow-x: hidden;
    }

    .grid-container {
        gap: 30px;
        width: 100%;
    }

    .entry p {
        padding-left: 10px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .site-footer {
        padding: 30px 15px;
        text-align: center;
    }

    .contact-info h2 {
        font-size: 2.2rem;
    }
}