:root {
    --terracotta: #BA4A38;
    --dark-green: #2F4F4F;
    --gold: #D4AF37;
    --sand: #f4f1ea;
    --white: #ffffff;
    --black: #1a1a1a;

    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--sand);
    color: var(--black);
    overflow-x: hidden;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--terracotta);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    color: var(--gold);
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 5px;
}

/* Navigation */
.nav-fixed {
    position: fixed;
    top: 30px;
    left: 40px;
    right: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1002;
    mix-blend-mode: difference;
    color: var(--white);
    transition: color 0.3s ease;
}

body.menu-open .nav-fixed {
    mix-blend-mode: normal;
    color: var(--gold);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 2px;
}

.menu-btn {
    cursor: pointer;
    width: 40px;
    height: 20px;
    position: relative;
    z-index: 1002;
}

.menu-btn span {
    display: block;
    width: 100%;
    height: 1px;
    background-color: var(--white);
    position: absolute;
    transition: all 0.3s ease;
}

body.menu-open .menu-btn span {
    background-color: var(--gold);
}

.menu-btn span:first-child {
    top: 0;
}

.menu-btn span:last-child {
    bottom: 0;
}

body.menu-open .menu-btn span:first-child {
    transform: rotate(45deg);
    top: 9px;
}

body.menu-open .menu-btn span:last-child {
    transform: rotate(-45deg);
    bottom: 10px;
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--terracotta);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    /* Below nav-fixed (1002) but above everything else */
    clip-path: circle(0% at 95% 5%);
    transition: clip-path 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

body.menu-open .nav-overlay {
    clip-path: circle(140% at 95% 5%);
}

.nav-overlay ul {
    list-style: none;
    text-align: center;
}

.nav-overlay li {
    margin: 20px 0;
    overflow: hidden;
}

.nav-link {
    display: block;
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease, color 0.3s;
}

body.menu-open .nav-overlay .nav-link {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.2s;
}

.nav-link:hover {
    color: var(--gold);
}

/* Sections */
section.panel {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    padding: 0;
}

/* Hero */
.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

.hero-content {
    z-index: 2;
}

.hero-date {
    font-family: var(--font-body);
    font-size: 1.2rem;
    letter-spacing: 4px;
    margin-bottom: 2rem;
    text-transform: uppercase;
    font-weight: 300;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 6vw;
    /* Responsive font size */
    line-height: 1;
    font-weight: 300;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
}

.hero-title .amp {
    font-style: italic;
    color: var(--gold);
    font-size: 0.8em;
    margin: 10px 0;
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-style: italic;
    letter-spacing: 1px;
    opacity: 0.9;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 2;
}

.scroll-indicator span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--white);
    opacity: 0.7;
}

.scroll-indicator .line {
    width: 1px;
    height: 50px;
    background-color: var(--gold);
}

/* Connectors */
/* Connectors - The Golden Rail */
.snake-connector {
    width: 100px;
    /* Precise gap for horizontal curve */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
    z-index: 0;
    /* Behind photos */
    position: relative;
    opacity: 0.8;
}

.snake-vertical-connector {
    height: 100%;
    /* Full column height */
    width: 100%;
    /* Full column width */
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    /* Behind photos */
    pointer-events: none;
    opacity: 0.8;
}

.connector-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    /* CRITICAL: Allows drawing outside box to overlap */
}

/* Ensure thread is distinct */
.connector-svg path {
    vector-effect: non-scaling-stroke;
    /* constant thickness */
}

.connector-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Couple Section */
.couple {
    background-color: var(--sand);
    display: flex;
    align-items: center;
}

.couple-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    height: 100vh;
}

.couple-img-container {
    height: 100%;
    padding: 80px;
    /* whitespace */
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-wrapper {
    width: 100%;
    height: 100%;
    max-height: 800px;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
    /* premium feel */
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 10s ease;
}

.img-wrapper:hover img {
    transform: scale(1.05);
    /* subtle zoom */
}

.couple-text-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 120px 80px 40px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1;
    color: var(--terracotta);
    margin-bottom: 2rem;
    font-weight: 300;
}

.section-title i {
    font-family: var(--font-heading);
    font-weight: 300;
    color: var(--gold);
}

.lead-text {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-style: italic;
    color: var(--terracotta);
    margin-bottom: 2rem;
    line-height: 1.3;
}

.body-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--black);
    opacity: 0.8;
    max-width: 500px;
}

/* Details */
.details {
    position: relative;
    background-color: var(--dark-green);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.details-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../Assets/Images/16a_optimized.jpg') fixed center center/cover;
    opacity: 0.7;
    /* Darker overlay for better text visibility */
    z-index: 0;
}

.details-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    padding: 40px;
}

.details-content .section-title.center {
    text-align: center;
    color: var(--white);
    margin-bottom: 4rem;
}

.details-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.card {
    background: rgba(0, 0, 0, 0.3);
    /* Darker background for contrast */
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 60px 30px;
    text-align: center;
    transition: all 0.4s ease;
    border-radius: 4px;
    backdrop-filter: blur(5px);
}

.card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-10px);
}

.center-card {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--gold);
}

.center-card:hover {
    transform: scale(1.05) translateY(-10px);
}

.card-icon {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 20px;
    display: block;
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 300;
}

.big-date {
    font-size: 3rem;
    font-family: var(--font-heading);
    color: var(--gold);
    line-height: 1;
}

.time {
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.link-u {
    display: inline-block;
    margin-top: 20px;
    color: var(--gold);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
}

.link-u:hover {
    border-bottom-color: var(--gold);
}

/* Sticky Mosaic Timeline Section */
.timeline-section {
    position: relative;
    overflow: hidden;
    background-color: var(--dark-green);
    /* Elegant dark background for depth */
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Title that blends with content */
.timeline-title {
    position: absolute;
    top: 5vh;
    left: 5vw;
    transform: none;
    width: auto;
    z-index: 50;
    margin-bottom: 0;
    color: var(--white);
    opacity: 1.1;
    /* Subtle watermark feel */
    font-size: 4rem;
    pointer-events: none;
}



@keyframes pulseNav {
    0% {
        transform: translateY(-50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-50%) scale(1.1);
        opacity: 1;
    }

    100% {
        transform: translateY(-50%) scale(1);
        opacity: 0.5;
    }
}

.gallery-container {
    width: 100%;
    height: 80vh;
    /* More height for vertical variance */
    display: flex;
    align-items: center;
    position: relative;
}

/* Snake Timeline Section */
.timeline-section {
    position: relative;
    overflow: hidden;
    background-color: var(--dark-green);
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gallery-container {
    width: 100%;
    height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* Snake Track (Horizontal Scroll Container) */
.snake-track {
    display: flex;
    flex-direction: row;
    padding-left: 20vw;
    padding-right: 25vw;
    gap: 0;
    /* Manual spacing via connectors */
    width: max-content;
    height: 100%;
    align-items: center;
}

/* Linear Timeline */
.timeline-track {
    display: flex;
    flex-direction: row;
    position: relative;
    height: 100%;
    align-items: center;
    padding: 0px 5vw;
    gap: 9vw;
    /* Spacing between years */
    width: max-content;
}

.central-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    /* Spans the max-content width automatically? No, absolute in flex container might be tricky. */
    /* Better: Use :before on track? Or simply width 100% of scrollWidth via JS? 
       Actually, if width is max-content, 100% works. */
    height: 2px;
    background-color: var(--gold);
    z-index: 1;
    transform: translateY(-50%);
}

.timeline-intro,
.timeline-outro {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--gold);
    z-index: 5;
    background: var(--dark-green);
    /* Mask line? */
    padding: 0 20px;
}

.timeline-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 20px;
    flex-shrink: 0;
}

.timeline-meta {
    position: absolute;
    width: auto;
    height: auto;
    font-family: var(--font-heading);
    font-size: 5rem;
    color: var(--white);
    line-height: 1;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 20;
}

.timeline-content {
    position: absolute;
    width: 250px;
    height: 300px;
}

/* Modifiers */
.item-top .timeline-content {
    bottom: 50px;
}

.item-top .timeline-meta {
    bottom: 50px;
    left: -185px;
}

.item-bottom .timeline-content {
    top: 50px;
}

.item-bottom .timeline-meta {
    top: 50px;
    left: -194px;
}

/* Photo Styles */
.media-card {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border: 5px solid white;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.media-card img,
.media-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stack Effect */
/* Stack Defaults (Messy Pile) */
.card-0 {
    transform: rotate(-3deg);
    z-index: 3;
}

.card-1 {
    transform: rotate(10deg) translate(30px, 5px);
    z-index: 2;
}

.card-2 {
    transform: rotate(-10deg) translate(-25px, 10px);
    z-index: 1;
}

.timeline-content:hover .media-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Container Hover: Spread them out nicely */
.timeline-content:hover .card-0 {
    transform: translateX(-140px) rotate(-10deg) scale(0.9);
    z-index: 5;
}

.timeline-content:hover .card-1 {
    transform: translateX(0px) translateY(-20px) scale(0.9);
    z-index: 6;
}

.timeline-content:hover .card-2 {
    transform: translateX(140px) rotate(10deg) scale(0.9);
    z-index: 5;
}

/* Individual Card Hover: Pop to front */
.timeline-content .media-card:hover {
    transform: scale(1.15) rotate(0deg) !important;
    /* Override spread position */
    z-index: 100 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}


.year-label-vertical {
    font-size: 3rem;
}


/* Mobile Styling */
@media (max-width: 768px) {
    .mosaic-track {
        padding-left: 20px;
        gap: 20px;
    }

    .photo-card {
        width: 70vw;
    }

    .year-sticky-marker span {
        font-size: 3rem;
        writing-mode: horizontal-tb;
        transform: none;
    }

    .year-input-marker {
        position: absolute;
        top: 20px;
        left: 20px;
        height: auto;
    }


    .year-section {
        flex-direction: column;
        /* Stack on mobile? No, user wants horizontal. Keep horizontal but simplify. */
        align-items: flex-start;
    }

    .year-gallery {
        padding-left: 60px;
        /* Room for aligned year */
    }

    /* Reset alignments on mobile for safety, or keep purely center */
    .align-top,
    .align-mid,
    .align-low {
        align-self: center;
        /* Center everything on mobile for better UX */
        margin: 0;
    }
}

/* RSVP */
.rsvp {
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rsvp-container {
    width: 100%;
    max-width: 600px;
    padding: 40px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rsvp-header {
    margin-bottom: 40px;
}

.rsvp-header p {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--terracotta);
    font-style: italic;
}

.rsvp-form-minimal {
    width: 100%;
}

.input-group {
    position: relative;
    margin-bottom: 30px;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 10px 0;
    font-size: 1.1rem;
    color: var(--black);
    border: none;
    border-bottom: 1px solid #ddd;
    outline: none;
    background: transparent;
    font-family: var(--font-body);
    transition: all 0.3s;
}

.input-group select {
    cursor: pointer;
    color: var(--black);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    border-bottom-color: var(--gold);
}

.input-group label {
    position: absolute;
    top: 10px;
    left: 0;
    font-size: 1rem;
    color: #999;
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-group input:focus~label,
.input-group input:not(:placeholder-shown)~label,
.input-group textarea:focus~label,
.input-group textarea:not(:placeholder-shown)~label {
    top: -20px;
    font-size: 0.8rem;
    color: var(--gold);
}

.input-group label.static-label {
    top: -20px;
    font-size: 0.8rem;
    color: var(--gold);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .input-group {
    flex: 1;
}

.submit-btn-minimal {
    background: transparent;
    border: 1px solid var(--dark-green);
    color: var(--terracotta);
    border: 1px solid var(--terracotta);
    padding: 15px 40px;
    font-family: var(--font-body);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 50px;
    margin-top: 20px;
}

.submit-btn-minimal:hover {
    background-color: var(--terracotta);
    color: var(--white);
}

/* Success Message */
.success-message {
    background-color: rgba(47, 79, 79, 0.1);
    color: var(--dark-green);
    padding: 20px;
    margin-bottom: 30px;
    border-left: 3px solid var(--gold);
    text-align: left;
}

/* Footer */
.minimal-footer {
    width: 100%;
    padding: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    letter-spacing: 2px;
}

/* Responsive */
@media (max-width: 900px) {
    .details-bg {
        background-attachment: scroll;
        /* Fixes mobile jitter */
    }

    .couple-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .couple-img-container {
        padding: 40px;
        height: 50vh;
    }

    .couple-text-container {
        padding: 40px;
    }

    .hero-title {
        font-size: 15vw;
        /* Much larger on mobile for impact */
    }

    .section-title {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    .details-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .center-card {
        transform: none;
    }

    .center-card:hover {
        transform: translateY(-10px);
    }

    .nav-fixed {
        left: 20px;
        right: 20px;
        top: 20px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Mobile Navigation Tweaks */
    .nav-link {
        font-size: 2rem;
    }

    .nav-fixed {
        top: 20px;
        left: 20px;
        right: 20px;
    }

    /* Hero Tweaks */
    .hero-content {
        padding: 0 20px;
    }

    .hero-subtitle {
        font-size: 1.2rem;
        margin-top: 10px;
    }

    /* Couple Section - Editorial Mobile */
    .couple-img-container {
        height: 60vh;
        /* Make image dominant */
        padding: 0;
    }

    .couple-text-container {
        padding: 40px 20px;
        text-align: center;
        /* Center text on mobile */
        background-color: var(--sand);
        position: relative;
        z-index: 2;
        margin-top: -50px;
        /* Overlap effect */
        margin-left: 20px;
        margin-right: 20px;
        border-radius: 4px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    }

    .lead-text {
        font-size: 1.4rem;
    }

    /* Details Section - Mobile Cards */
    .details {
        padding: 60px 0;
    }

    .details-content {
        padding: 20px;
    }

    .details-cards {
        gap: 20px;
    }

    .card {
        padding: 40px 20px;
        background: rgba(0, 0, 0, 0.5);
        /* Higher contrast on mobile */
    }

    /* RSVP Section */
    .rsvp-container {
        padding: 20px;
    }

    .rsvp-form-minimal {
        padding: 0 10px;
    }

    .input-group label {
        font-size: 0.9rem;
    }

    /* Disable snap scroll on mobile if needed or tweak */
    section.panel {
        min-height: 100vh;
        /* improved centering */
        display: flex;
        align-items: center;
        width: 100%;
        padding: 40px 0;
    }

    .hero {
        min-height: 100vh;
    }

    /* Timeline Mobile Adjustments */

    /* Hide Desktop Timeline on Mobile */
    .timeline-section {
        display: none !important;
    }

    /* Show Mobile Timeline */
    .mobile-timeline-section {
        display: flex !important;
        flex-direction: column;
        height: 100vh;
        background-color: var(--dark-green);
        justify-content: center;
        overflow: hidden;
        position: relative;
    }

    .mobile-timeline-header {
        position: absolute;
        top: 5vh;
        width: 100%;
        text-align: center;
        z-index: 10;
        pointer-events: none;
    }

    .mobile-timeline-header h2 {
        color: var(--white);
        margin: 0;
        font-size: 2.5rem;
    }

    .mobile-track {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        height: 80vh;
        /* Taller to fit everything */
        align-items: center;
        padding: 0 8vw;
        /* Center focus */
        gap: 0;
        /* Continuous line requires 0 gap */
    }

    .mobile-track::-webkit-scrollbar {
        display: none;
    }

    .mobile-item {
        flex: 0 0 40vw;
        scroll-snap-align: end;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }

    /* Central Line Segment */
    .mobile-item::before {
        content: '';
        position: absolute;
        width: 100%;
        height: 2px;
        background-color: var(--gold);
        top: 50%;
        left: 0;
        z-index: 0;
    }

    /* Central Dot */
    .mobile-item::after {
        content: '';
        position: absolute;
        width: 12px;
        height: 12px;
        background-color: var(--gold);
        border-radius: 50%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1;
    }

    /* Stack Container turned back into Relative Pile */
    .mobile-media-stack {
        position: absolute;
        width: 100%;
        height: 250px;
        z-index: 2;
        display: block;
        /* No flex/carousel */
        overflow: visible;
        /* Show overlapping cards */
    }

    /* Odd Items (Top) - Move Stack UP */
    .mobile-item:nth-child(odd) .mobile-media-stack {
        top: 50%;
        transform: translateY(-280px);
        /* Position Above Line */
    }

    /* Even Items (Bottom) - Move Stack DOWN */
    .mobile-item:nth-child(even) .mobile-media-stack {
        top: 50%;
        transform: translateY(30px);
        /* Position Below Line */
    }

    /* Photos Stacked */
    .mobile-card {
        position: absolute;
        /* Stack them! */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 3px solid var(--white);
        border-radius: 2px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), z-index 0s;
        /* Default: Allow browser handling (Scroll) */
        user-select: none;
    }

    .mobile-card img,
    .mobile-card video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Specific Rotations for the "Messy Pile" look */
    /* Card 0 (Bottom-most usually, or top? Let's make 0 the default visible one, others behind) */
    .mobile-card-0 {
        z-index: 3;
        transform: rotate(-5deg);
    }

    .mobile-card-1 {
        z-index: 2;
        transform: rotate(14deg) translate(30px, 5px);
    }

    .mobile-card-2 {
        z-index: 1;
        transform: rotate(-26deg) translate(-34px, 10px);
    }

    /* Interactive State - Popped to Front */
    .mobile-card.is-front {
        z-index: 100 !important;
        transform: rotate(0deg) scale(1.05) !important;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    }

    /* Year Placement - Next to Photos */
    .mobile-year {
        position: absolute;
        font-family: var(--font-heading);
        font-size: 3.5rem;
        /* Readable size */
        color: var(--white);
        /* White text usually looks better next to photos */
        opacity: 1;
        margin: 0;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        z-index: 5;
        white-space: nowrap;
        height: auto;
        width: auto;
        /* Reset vertical rotation default */
        transform: none;
        top: auto;
        left: auto;
        bottom: auto;
        right: auto;
    }

    .mobile-item:nth-child(odd) .mobile-year {
        left: -21px;
        /* To the right of the photo */
        top: 60%;
        transform: translateY(-280px) rotate(-90deg);
        /* Align with photo vertical center */
        transform-origin: left center;
    }

    .mobile-item:nth-child(even) .mobile-year {
        right: 114%;
        /* To the left of the photo */
        top: 46%;
        transform: translateY(30px) rotate(-90deg);
        /* Align with photo vertical center */
        transform-origin: right center;
    }

    .mobile-outro {
        flex: 0 0 30vw;
        /* Match item width */
        scroll-snap-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--gold);
        font-family: var(--font-heading);
        font-size: 1.5rem;
    }

    .submit-btn-minimal {
        width: 100%;
        justify-content: center;
    }
}

/* Default state: Hide Mobile Timeline on Desktop */
.mobile-timeline-section {
    display: none;
}

/* Clean up unused snake classes */
.snake-track,
.snake-column,
.media-group,
.year-label-vertical,
.snake-connector,
.snake-vertical-connector {
    display: none;
}

/* Partilha / Sharing Page Styles */

.partilha-body {
    background-color: var(--sand);
    min-height: 100vh;
}

/* Login/Name Wall Overlay */
.partilha-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    z-index: 2000;
    display: flex;
    overflow: hidden;
}

.login-split-image {
    flex: 1;
    height: 100%;
    background: url('../Assets/Images/Catarina e Henrique-11.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
    display: none;
    /* Mobile first: hidden */
}

.login-split-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
}

.login-split-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: var(--white);
    position: relative;
    max-width: 100%;
}

@media (min-width: 768px) {
    .login-split-image {
        display: block;
        max-width: 50%;
    }

    .login-split-form {
        max-width: 50%;
    }
}

.login-content {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--terracotta);
    margin-bottom: 20px;
}

.login-subtitle {
    color: var(--dark-green);
    margin-bottom: 40px;
    font-weight: 300;
    line-height: 1.6;
}

.styled-input-group {
    position: relative;
    margin-bottom: 30px;
    text-align: left;
}

.styled-input {
    width: 100%;
    padding: 15px 0;
    border: none;
    border-bottom: 2px solid #ddd;
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--black);
    background: transparent;
    outline: none;
    transition: border-color 0.3s;
}

.styled-input:focus {
    border-bottom-color: var(--terracotta);
}

.styled-input-label {
    position: absolute;
    top: 15px;
    left: 0;
    color: #999;
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.styled-input:focus~.styled-input-label,
.styled-input:not(:placeholder-shown)~.styled-input-label {
    top: -10px;
    font-size: 0.8rem;
    color: var(--terracotta);
}

/* Partilha Header */
.partilha-header {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.partilha-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--terracotta);
}

.partilha-welcome {
    font-size: 1.1rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 10px;
}

/* Upload Section */
.upload-area {
    background: var(--white);
    border-radius: 20px;
    padding: 40px 20px;
    margin: 0 auto 50px;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(186, 74, 56, 0.1);
    /* subtle terracotta border */
}

.upload-button-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: linear-gradient(135deg, var(--terracotta), #a03525);
    color: var(--white);
    font-size: 1.2rem;
    padding: 18px 40px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(186, 74, 56, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-body);
    font-weight: 500;
}

.upload-button-lg:active {
    transform: scale(0.98);
}

.upload-hint {
    margin-top: 20px;
    color: #888;
    font-size: 0.9rem;
}

/* New Action Buttons */
.action-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    margin-bottom: 15px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 75px;
    /* Reduced from 90px */
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.action-btn i {
    font-size: 1.5rem;
    /* Reduced from 1.8rem */
    margin-bottom: 2px;
}

.action-btn:active {
    transform: scale(0.96);
}

.btn-camera {
    background: var(--terracotta);
    color: var(--white);
}

.btn-video {
    background: var(--dark-green);
    color: var(--white);
}

.btn-gallery {
    grid-column: 1 / -1;
    /* Full width */
    background: transparent;
    border: 1px solid var(--terracotta);
    /* Thinner border */
    color: var(--terracotta);
    height: 50px;
    /* Reduced from 60px */
    flex-direction: row;
    /* Horizontal layout */
    font-size: 0.9rem;
}

.btn-gallery i {
    font-size: 1.1rem;
    margin-bottom: 0;
}

.btn-gallery:hover {
    background: rgba(186, 74, 56, 0.05);
}

/* Gallery Grid */
.partilha-grid {
    column-count: 2;
    column-gap: 20px;
    padding: 0 20px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .partilha-grid {
        column-count: 3;
    }
}

@media (min-width: 1024px) {
    .partilha-grid {
        column-count: 4;
    }
}

.grid-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: #000;
}

.grid-item img,
.grid-item video {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

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

.grid-item-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 15px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.3s;
}

/* Locked State */
.locked-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-green);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background-image: url('../Assets/Images/16a_optimized.jpg');
    background-size: cover;
    background-blend-mode: overlay;
}

.locked-date {
    font-family: var(--font-heading);
    font-size: 5rem;
    color: var(--gold);
    margin-bottom: 20px;
}

/* Mobile Optimizations for Partilha */
@media (max-width: 768px) {
    .partilha-header {
        padding: 20px;
    }

    .partilha-title {
        font-size: 2.2rem;
    }

    .partilha-welcome {
        font-size: 1rem;
    }

    /* Grid Optimization */
    .partilha-grid {
        column-count: 2;
        column-gap: 10px;
        padding: 0 10px 100px;
        /* Extra padding bottom for sticky button space */
    }

    .grid-item {
        margin-bottom: 10px;
    }

    /* Sticky Upload Button */
    .upload-area {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 15px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        max-width: none;
        border: none;
        border-top: 1px solid rgba(186, 74, 56, 0.2);
    }

    .upload-area .upload-hint {
        display: none;
        /* Hide hint to save space */
    }

    .upload-button-lg {
        width: 100%;
        padding: 12px 20px;
        font-size: 1.1rem;
    }

    .upload-area form {
        width: 100%;
    }

    /* Login Screen Tweaks */
    .partilha-login-card {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 20px;
        border-radius: 0;
    }

    .login-title {
        font-size: 2.5rem;
    }

    .nav-fixed {
        /* Hide nav on sharing page if needed, or adjust z-index to be below sticky button */
    }
}

/* Identity Section & Compact Input */
.identity-section {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px auto;
}

.styled-input-group.compact {
    margin-bottom: 0;
}

.styled-input-group.compact .styled-input {
    padding: 10px 15px;
    font-size: 1rem;
    color: var(--dark-green);
    border-color: rgba(47, 79, 79, 0.3);
}

.styled-input-group.compact .styled-input:focus {
    border-color: var(--terracotta);
}

.styled-input-group.compact .styled-input-label {
    color: rgba(47, 79, 79, 0.6);
    top: 10px;
    left: 15px;
    /* Adjust to match input padding */
    pointer-events: none;
    transition: all 0.3s ease;
}

.styled-input-group.compact .styled-input:focus~.styled-input-label,
.styled-input-group.compact .styled-input:not(:placeholder-shown)~.styled-input-label {
    top: -8px;
    font-size: 0.8rem;
    color: var(--terracotta);
    left: 10px;
    background: var(--white);
    padding: 0 5px;
}

/* Adjust button group spacing */
.action-btn-group {
    margin-top: 10px;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--white);
    color: var(--black);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border-left: 4px solid var(--terracotta);
    max-width: 90vw;
}

.notification-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-toast i {
    color: var(--terracotta);
    font-size: 1.5rem;
}

.notification-content {
    display: flex;
    flex-direction: column;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--terracotta);
}

.notification-body {
    font-size: 0.85rem;
    color: #555;
}

