:root {
    --red: rgb(199, 0, 0);
}

* {
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
    color: rgba(0, 0, 0, 0.925);
}

h1 {
    font-size: 3.5rem;
    margin: 0;
    font-family: 'Lobster', cursive;
    color: var(--red);
    line-height: 1;
    font-weight: 400;
}

h2 {
    font-weight: 600;
    margin-top: 8px;
    font-size: 1.35rem;
}

h3.card-title {
    margin: 0 0 6px 0;
    line-height: 1.25;
}

h4 {
    font-size: 1.5rem;
    margin: 0;
    font-family: 'Lobster', cursive;
    color: var(--red);
    line-height: 1;
    font-weight: 400;
}

html {
    /* rotated cards can poke past the edge on phones; clip keeps sticky working */
    overflow-x: clip;
}

body {
    background-color: #EEEEEE;
}

main.grid {
    display: grid;
    grid-template-columns: 3fr 5fr;
    gap: 16px;
    max-width: calc(1200px + 10vh);
    margin: 0 auto;
    padding: 5vh;
}

.content {
    position: relative;
}

.inner-content {
    background-color: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 2px hsla(0, 0%, 0%, 0.03);
    position: sticky;
    top: 5vh;
    display: flex;
    flex-direction: column;
}

/* Square verse image: shown whole (never cropped), shrinks on short screens */
.verse {
    display: block;
    width: min(100%, calc(90vh - 150px));
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 4px;
}

.gallery {
    display: flex;
    flex-direction: column;
    /* Must exceed how far two tilted cards' corners can swing toward each other
       (card width × sin(3°) × 2 ≈ 39px at the widest card); see scatter.js */
    gap: 48px;
}

/* Section headings: the story's connecting lines between photo groups */
.section-heading {
    font-family: 'Lobster', cursive;
    font-weight: 400;
    color: var(--red);
    font-size: 2rem;
    line-height: 1.25;
    text-align: center;
    text-wrap: balance;
    margin: 16px 0 0;
    padding: 0 16px;
    transform: translateY(var(--translate-y, 0));
}

.section-heading::before {
    content: "";
    display: block;
    width: 120px;
    height: 14px;
    margin: 0 auto 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14' viewBox='0 0 120 14'%3E%3Cpath d='M2 7h46M72 7h46' stroke='%23c70000' stroke-width='1.5' stroke-linecap='round' opacity='.5'/%3E%3Cpath d='M60 0l2.2 4.8L67 7l-4.8 2.2L60 14l-2.2-4.8L53 7l4.8-2.2z' fill='%23c70000'/%3E%3C/svg%3E") no-repeat center;
}

.section-heading.closing {
    font-size: 2.5rem;
    margin-top: 32px;
}

.see-you {
    font-size: 2.5rem;
    margin-top: 0;
    text-align: center;
}

/* Side-by-side "less of this / more of this" cards */
.pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px 40px; /* side-by-side tilted cards need room too */
    align-items: start;
}

.inner-content p {
    line-height: 1.75;
}

.gallery-card {
    width: 100%;
    background-color: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 5px 15px hsla(0, 0%, 0%, 0.1);
}

.gallery-card p {
    color: rgba(0, 0, 0, 0.55);
}

.date {
    margin: 0;
}

.description {
    margin: 0;
    margin-bottom: 8px;
}

.card-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    margin-bottom: 16px;
}

.card-img.sm {
    max-width: 100px;
}

@media screen and (max-width: 1000px) {
    h1 {
        font-size: 3rem;
    }

    main.grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .inner-content {
        position: static;
    }

    .verse {
        width: 100%;
    }

    .section-heading {
        font-size: 1.75rem;
    }

    .section-heading.closing {
        font-size: 2.1rem;
    }
}

@media screen and (max-width: 520px) {
    .pair {
        grid-template-columns: 1fr;
    }
}

/* Snowfall Effect */
#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
    transition: opacity 1.2s ease;
}

#snow-container.hidden {
    opacity: 0;
}

.snowflake {
    position: absolute;
    top: -10px;
    background-color: white;
    border-radius: 50%;
    animation-name: fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-10px) translateX(0);
    }

    25% {
        transform: translateY(25vh) translateX(15px);
    }

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

    75% {
        transform: translateY(75vh) translateX(15px);
    }

    100% {
        transform: translateY(105vh) translateX(0);
    }
}

/* Modern Scroll Effects */

/* Hover Lift */
.gallery-card {
    /* Default state variables */
    --rotate: 0deg;
    --translate-y: 0;
    --translate-x: 0;
    --scale: 1;

    transform: rotate(var(--rotate)) translateY(var(--translate-y)) translateX(var(--translate-x)) scale(var(--scale));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Ensure z-index transition is instant so it pops over immediately */
    transition-property: transform, box-shadow, z-index;
}

.gallery-card:hover {
    --rotate: 0deg !important;
    --translate-x: 0 !important;
    /* Straighten out */
    --translate-y: -5px;
    --scale: 1.02;
    z-index: 10;
    box-shadow: 0 15px 30px hsla(0, 0%, 0%, 0.15);
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    --translate-y: 50px;
    /* Override transition for the entrance animation */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    --translate-y: 0;
}