:root {
    --deep-red: #8b0000;
    --soft-red: #c53030;
    --pastel-peach: #ffd8c4;
    --soft-pink: #ffb6c1;
    --white: #ffffff;
    --serif-font: 'Playfair Display', serif;
    --transition-duration: 1.8s;
}
 
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    font-family: var(--serif-font);
    color: var(--deep-red);
    font-size: 16px;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

/* Desktop-only cursor styling */
@media (min-width: 769px) {
    html, body {
        cursor: none;
    }
    
    #cursor {
        position: fixed;
        width: 30px;
        height: 30px;
        pointer-events: none;
        z-index: 9999;
        font-size: 24px;
        transform-origin: center;
        user-select: none;
        line-height: 1;
        display: block;
    }
}

/* Mobile floating rose */
@media (max-width: 768px) {
    #cursor {
        display: none; /* Hide the cursor-following rose */
    }
    
    .floating-rose {
        position: fixed;
        font-size: 24px;
        z-index: 50;
        pointer-events: none;
        animation: floatAround 15s linear infinite;
        opacity: 1; /* Fully opaque rose */
    }
}

@keyframes floatAround {
    0% {
        top: 20%;
        left: 20%;
        transform: rotate(0deg);
    }
    25% {
        top: 80%;
        left: 30%;
        transform: rotate(90deg);
    }
    50% {
        top: 50%;
        left: 80%;
        transform: rotate(180deg);
    }
    75% {
        top: 10%;
        left: 70%;
        transform: rotate(270deg);
    }
    100% {
        top: 20%;
        left: 20%;
        transform: rotate(360deg);
    }
}

/* Video Background - Only for intro screen */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    overflow: hidden;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    min-width: 100%;
    min-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 0, 0, 0.5);
    z-index: -9;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-text {
    text-align: center;
    opacity: 0;
    transition: opacity var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1001;
}

.loading-text h1 {
    font-size: 8rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
    font-style: italic;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

.loading-text h2 {
    font-size: 2.5rem;
    font-weight: 400;
    font-style: italic;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

.main-content {
    opacity: 0;
    transition: opacity var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    z-index: 1;
    background: var(--white);
}

/* Common navigation styling for all devices */
nav {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2rem;
    z-index: 100;
}

nav a {
    color: var(--deep-red);
    text-decoration: none;
    position: relative;
    font-size: 1.2rem;
    opacity: 0.8;
    transition: opacity 0.5s ease;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    font-style: italic;
}

nav a:hover {
    opacity: 1;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--deep-red);
    transition: width 0.5s ease;
}

nav a:hover::after {
    width: 100%;
}

.section {
    min-height: 100vh;
    padding: 6rem 2rem 2rem;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Common gallery layout for all devices */
.gallery-container {
    width: 100%;
    max-width: 1800px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(100px, auto);
    gap: 20px;
    padding: 0 20px;
}

.gallery-item:nth-child(1) {
    grid-column: 2 / 8;
    grid-row: 1 / 3;
}

.gallery-item:nth-child(2) {
    grid-column: 8 / 12;
    grid-row: 1 / 2;
}

.gallery-item:nth-child(3) {
    grid-column: 8 / 12;
    grid-row: 2 / 3;
}

.gallery-item:nth-child(4) {
    grid-column: 2 / 6;
    grid-row: 3 / 4;
}

.gallery-item:nth-child(5) {
    grid-column: 6 / 10;
    grid-row: 3 / 4;
}

.gallery-item:nth-child(6) {
    grid-column: 10 / 12;
    grid-row: 3 / 4;
}

/* About section styles - for desktop */
.about-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.about-container > div {
    display: flex;
    gap: 2rem;
    align-items: center;
    width: 100%;
}

.about-content {
    flex: 1;
}

.portrait-container {
    max-width: 300px;
    flex-shrink: 0;
    border: 1px solid var(--deep-red);
    display: flex;
}

.portrait-image {
    width: 100%;
    height: auto;
    display: block;
}

.about-text {
    font-size: 0.9rem;
    text-align: justify;
    line-height: 1.5;
}

.social-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: var(--deep-red);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.3s;
}

.social-link:hover {
    border-bottom-color: var(--deep-red);
}

.section.active {
    display: flex;
    animation: fadeIn var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

h2.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    font-weight: 400;
    font-style: italic;
    text-align: center;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.8s ease;
    background: var(--white);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s ease;
    display: block;
}

/* Individual image positioning for better crops */
.gallery-item:nth-child(1) img {
    object-position: center 65%; /* Show more of the bottom */
}

.gallery-item:nth-child(2) img {
    object-position: center 60%; /* Show more of the bottom */
}

.gallery-item:nth-child(3) img {
    object-position: center 30%; /* Show more of the top */
}

.gallery-item:nth-child(4) img {
    object-position: center 35%; /* Show more of the top */
}

.gallery-item:nth-child(5) img {
    object-position: center 65%; /* Show more of the bottom */
}

.gallery-item:nth-child(6) img {
    object-position: 40% center; /* Keep original position */
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Image overlay is hidden as requested */
.image-overlay {
    display: none;
}

/* MODAL - FULLSCREEN WITH IMAGE BORDER */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    border: none;
    background-color: transparent;
}

.modal-image {
    max-width: 80%;
    max-height: 80vh;
    object-fit: contain;
    border: 1px solid black; /* ONLY the image has a border */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.modal-text {
    position: absolute;
    right: 2rem;
    bottom: 2rem;
    max-width: 300px;
    font-family: var(--serif-font);
    font-style: italic;
    color: var(--deep-red);
    font-size: 1.2rem;
    text-align: right;
    border: none;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--deep-red);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10000;
    border: none;
}

.modal-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* Cursor enhancements for modals - desktop only */
@media (min-width: 769px) {
    .modal.active ~ #cursor,
    .modal.active + #cursor,
    #cursor {
        z-index: 100000 !important;
        visibility: visible !important;
        display: block !important;
        opacity: 1 !important;
        pointer-events: none !important;
    }
}

/* Contact section styling */
.contact-container {
    text-align: center;
}

.contact-text {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.contact-email {
    font-size: 1.5rem;
    color: var(--deep-red);
    text-decoration: none;
    border-bottom: 1px solid var(--deep-red);
    padding-bottom: 0.2rem;
    transition: opacity 0.3s ease;
}

.contact-email:hover {
    opacity: 0.8;
}

footer {
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
    opacity: 0.8;
}

/* Desktop-specific adjustments */
@media (min-width: 769px) {
    .gallery-container {
        grid-auto-rows: minmax(200px, auto);
    }
    
    .main-content {
        padding: 2rem;
    }
}

/* Mobile Styles - Desktop-like grid but with original about section */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        cursor: auto; /* Allow normal cursor on mobile */
    }
    
    /* Mobile navigation adjustments - smaller fonts and closer to top */
    nav {
        top: 0.5rem;
        gap: 1.5rem;
    }
    
    nav a {
        font-size: 0.9rem;
    }
    
    /* Mobile sections - much smaller padding to reduce whitespace */
    .section {
        padding: 2.75rem 0.25rem 0.25rem;
        min-height: auto; /* Remove min-height to reduce extra whitespace */
    }
    
    /* Reduce padding on main content for mobile */
    .main-content {
        padding: 0.5rem 0.25rem;
    }
    
    /* Mobile gallery - same grid but with larger sizes and less padding */
    .gallery-container {
        width: 100%;
        gap: 6px;
        padding: 0 2px;
        grid-auto-rows: minmax(80px, auto); /* Larger minimum size for better visibility */
    }
    
    /* Making the grid span more of the screen width on mobile */
    .gallery-item:nth-child(1) {
        grid-column: 1 / 8; /* Start from the edge */
    }
    
    .gallery-item:nth-child(2) {
        grid-column: 8 / 13; /* Extend to the edge */
    }
    
    .gallery-item:nth-child(3) {
        grid-column: 8 / 13; /* Extend to the edge */
    }
    
    .gallery-item:nth-child(4) {
        grid-column: 1 / 5; /* Start from the edge */
    }
    
    .gallery-item:nth-child(5) {
        grid-column: 5 / 9;
    }
    
    .gallery-item:nth-child(6) {
        grid-column: 9 / 13; /* Extend to the edge */
    }
    
    /* Mobile image crops */
    .gallery-item:nth-child(1) img {
        object-position: center 95%; /* More of the bottom on mobile */
    }
    
    .gallery-item:nth-child(2) img {
        object-position: center 90%; /* More of the bottom on mobile */
    }
    
    .gallery-item:nth-child(3) img {
        object-position: center 25%; /* More of the top on mobile */
    }
    
    .gallery-item:nth-child(4) img {
        object-position: center 30%; /* More of the top on mobile */
    }
    
    .gallery-item:nth-child(5) img {
        object-position: center 85%; /* More of the bottom on mobile */
    }
    
    /* Mobile modal adjustments */
    .modal-image {
        max-width: 90%;
        max-height: 70vh;
    }
    
    .modal-text {
        position: relative;
        right: auto;
        bottom: auto;
        margin-top: 1rem;
        font-size: 0.9rem;
        text-align: center;
        max-width: 90%;
        padding: 0 1rem;
    }
    
    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.5rem;
    }
    
    /* ORIGINAL MOBILE ABOUT SECTION THAT YOU LIKED */
    .about-container {
        padding: 0 1rem;
    }
    
    .about-container > div {
        display: flex;
        flex-direction: column-reverse;
        gap: 1.5rem;
    }
    
    .portrait-container {
        margin: 0 auto 1rem;
        width: 100%;
        max-width: 250px;
        border: 1px solid var(--deep-red);
    }
    
    .portrait-image {
        width: 100%;
        height: auto;
        display: block;
    }
    
    .about-content {
        width: 100%;
    }
    
    .about-text {
        font-size: 0.85rem;
        text-align: left;
        line-height: 1.5;
    }
    
    .social-link {
        display: block;
        text-align: center;
        margin-top: 1rem;
    }
    
    /* Section title size adjusted for mobile */
    h2.section-title {
        font-size: 1.8rem; 
        margin-bottom: 1.5rem;
    }
    
    /* Mobile contact section - more compact */
    .contact-text {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .contact-email {
        font-size: 1.1rem;
    }
    
    /* Mobile title container */
    .title-container {
        margin-left: 1rem !important;
    }
    
    .title-text h1 {
        font-size: 1.8rem !important;
    }
    
    /* Mobile footer - minimal padding */
    footer {
        margin-top: 0.5rem;
        padding: 0.5rem 0;
        font-size: 0.75rem;
    }
}