@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Manrope:wght@400;500;600&display=swap');

:root {
    --paper: #fdfcf8;
    --paper-2: #f7f6f2;
    --ink: #1d2230;
    --silver: #c9d1d9;
    --silver-soft: #e3e7ee;
    --gold: #d8a846;
    --gold-deep: #b88932;
    --blue: #5b7fbf;
    --blue-deep: #324564;

    --shadow-soft: 0 10px 24px rgba(29, 34, 48, 0.12);
    --shadow-card: 0 8px 22px rgba(29, 34, 48, 0.1);
    --radius: 0px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(247, 246, 242, 0.8)),
        repeating-linear-gradient(90deg, rgba(216, 168, 70, 0.02) 0, rgba(216, 168, 70, 0.02) 1px, transparent 1px, transparent 8px),
        repeating-linear-gradient(0deg, rgba(91, 127, 191, 0.02) 0, rgba(91, 127, 191, 0.02) 1px, transparent 1px, transparent 10px),
        #f7f6f2;
    color: var(--ink);
    line-height: 1.7;
    min-height: 100vh;
    letter-spacing: 0.01em;
}

.page-wrap {
    position: relative;
    overflow: hidden;
}

.card-shell {
    max-width: 1100px;
    margin: clamp(2rem, 4vw, 3.5rem) auto;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    position: relative;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.9), transparent 42%),
        radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.75), transparent 40%),
        var(--paper);
    border-radius: 0;
    box-shadow: 0 12px 30px rgba(29, 34, 48, 0.1);
    overflow: hidden;
}

.card-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.55), transparent 36%),
        radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.45), transparent 34%);
    opacity: 0.7;
    pointer-events: none;
}

.card-shell::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2.2px 2.2px at 15% 20%, rgba(91, 127, 191, 0.35), transparent),
        radial-gradient(2px 2px at 35% 30%, rgba(216, 168, 70, 0.35), transparent),
        radial-gradient(2.4px 2.4px at 65% 25%, rgba(255, 255, 255, 0.55), transparent),
        radial-gradient(2px 2px at 80% 40%, rgba(91, 127, 191, 0.3), transparent),
        radial-gradient(2.2px 2.2px at 25% 70%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2.4px 2.4px at 60% 78%, rgba(216, 168, 70, 0.32), transparent);
    opacity: 0.8;
    animation: snow-inner 14s linear infinite;
    mix-blend-mode: screen;
}

@keyframes snow-inner {
    0% {
        background-position: 0 -160px;
    }

    100% {
        background-position: 0 160px;
    }
}

.card-border {
    position: absolute;
    inset: 12px;
    border-radius: 0;
    border: 1.5px solid var(--gold);
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(91, 127, 191, 0.18);
}

.snow-border {
    /* Removed in favor of .global-snow */
    display: none;
}

.global-snow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.global-snow::before {
    content: '';
    position: absolute;
    inset: 0;
    top: -220px;
    /* Start above viewport for smooth loop */
    bottom: -220px;
    /* Extend below */
    background-image:
        radial-gradient(3px 3px at 10% 10%, rgba(91, 127, 191, 0.4), transparent),
        /* Blue */
        radial-gradient(2.6px 2.6px at 30% 20%, rgba(160, 170, 190, 0.45), transparent),
        /* Silver */
        radial-gradient(2.4px 2.4px at 70% 30%, rgba(216, 168, 70, 0.35), transparent),
        /* Gold */
        radial-gradient(3px 3px at 90% 15%, rgba(91, 127, 191, 0.35), transparent),
        /* Blue */
        radial-gradient(2.6px 2.6px at 20% 80%, rgba(160, 170, 190, 0.5), transparent),
        /* Silver */
        radial-gradient(2.4px 2.4px at 60% 85%, rgba(216, 168, 70, 0.4), transparent),
        /* Gold */
        radial-gradient(2.2px 2.2px at 85% 75%, rgba(91, 127, 191, 0.4), transparent);
    /* Blue */
    opacity: 1;
    /* Increased from 0.8 */
    mix-blend-mode: normal;
    /* Changed from screen as it might be over light backgrounds */
    animation: snow-fall 16s linear infinite;
    background-repeat: repeat;
    background-size: 250px 250px;
    /* Larger repeat pattern for full screen */
}

.global-snow::after {
    background-image:
        radial-gradient(3.5px 3.5px at 15% 25%, rgba(91, 127, 191, 0.25), transparent),
        radial-gradient(2.8px 2.8px at 40% 15%, rgba(160, 170, 190, 0.3), transparent),
        radial-gradient(3.5px 3.5px at 80% 40%, rgba(216, 168, 70, 0.25), transparent),
        radial-gradient(2.8px 2.8px at 25% 65%, rgba(91, 127, 191, 0.25), transparent),
        radial-gradient(3.5px 3.5px at 60% 75%, rgba(160, 170, 190, 0.3), transparent);
    filter: blur(1px);
    opacity: 0.8;
    animation-duration: 22s;
    background-size: 320px 320px;
    animation-delay: -5s;
}

@keyframes snow-fall {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(220px);
    }

    /* Match the buffer size */
}

a {
    color: inherit;
}

.hero {
    position: relative;
    padding: clamp(2rem, 4vw, 3rem);
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(201, 209, 217, 0.12), transparent 50%),
        linear-gradient(180deg, #fdfcf8 0%, #f7f6f2 100%);
    border-radius: 0;
    border: 1px solid rgba(91, 127, 191, 0.08);
}

.snow-layer {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(91, 127, 191, 0.3), transparent),
        radial-gradient(1.2px 1.2px at 30% 50%, rgba(216, 168, 70, 0.28), transparent),
        radial-gradient(1px 1px at 70% 30%, rgba(160, 170, 190, 0.35), transparent),
        radial-gradient(1.5px 1.5px at 85% 70%, rgba(255, 255, 255, 0.35), transparent);
    opacity: 0.8;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    z-index: 1;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    color: var(--silver);
    margin: 0 0 0.75rem;
}

h1,
h2,
h3 {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    color: var(--paper);
    margin: 0;
}

/* Title Readability Fix */
h1 {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: 0.04em;
    color: var(--blue-deep);
    /* Changed from var(--paper) for readability */
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
}

.lede {
    margin: 0.75rem 0 1.3rem;
    color: var(--blue-deep);
    font-size: 1.05rem;
    max-width: 36ch;
}

.hero-tags {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.hero-tags span {
    padding: 0.45rem 0.8rem;
    background: rgba(91, 127, 191, 0.05);
    border: 1px solid rgba(91, 127, 191, 0.1);
    border-radius: 0;
    font-size: 0.9rem;
    color: #3a4560;
    box-shadow: none;
}

.hero-photo {
    display: flex;
    justify-content: center;
}

.photo-frame {
    width: min(480px, 100%);
    aspect-ratio: 4 / 3;
    position: relative;
    border-radius: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(247, 246, 242, 0.9));
    box-shadow: 0 10px 22px rgba(29, 34, 48, 0.1);
    overflow: hidden;
    border: 1px solid rgba(201, 209, 217, 0.28);
}

.photo-image {
    position: absolute;
    inset: 12px;
    border-radius: 0;
    overflow: hidden;
    background: var(--photo, linear-gradient(135deg, #dce5f5, #f2f3f8));
    background-size: cover;
    background-position: center;
    filter: saturate(0.9);
    border: 1px solid rgba(91, 127, 191, 0.15);
}

.photo-placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));
    color: var(--blue-deep);
    font-size: 0.98rem;
    text-align: center;
}

.bell-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: 1px solid rgba(216, 168, 70, 0.4);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--gold-deep);
    box-shadow: 0 10px 18px rgba(29, 34, 48, 0.12);
    font-size: 1.2rem;
}

main {
    padding: clamp(1.5rem, 4vw, 3rem);
}

.fade-seed {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 500ms ease, transform 500ms ease;
}

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

.section {
    margin: clamp(3rem, 6vw, 5rem) 0;
}

.section-head {
    text-align: center;
    margin: 0 auto 2.5rem;
    max-width: 640px;
}

.section-head h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: 0.02em;
}

.note {
    color: var(--silver);
    margin-top: 0.6rem;
}

/* Google Fonts for handwriting style matches - assuming Cormorant/Manrope are already there, 
   but for "handwritten" note let's use a nice serif italic or we can add a new font if needed later. 
   For now we stick to Cormorant Italics for the "note" feel. */

.profiles .profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    padding: 2rem 1rem;
    align-items: start;
}

.polaroid-card {
    background: #fff;
    padding: 1rem 1rem 2.5rem 1rem;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    /* Initial subtle shadow */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    border-radius: 2px;
    position: relative;
    transform-origin: center top;
}

/* Random subtle rotations for that "pinned up" feel */
.polaroid-card:nth-child(odd) {
    transform: rotate(-2deg);
}

.polaroid-card:nth-child(even) {
    transform: rotate(2deg);
}

.polaroid-card:hover {
    transform: rotate(0) scale(1.02);
    box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
    z-index: 10;
}

.tape-strip {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 35px;
    background-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
    backdrop-filter: blur(2px);
    border-radius: 2px;
    opacity: 0.7;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Make the tape look realistic with a slight gradient */
.tape-strip::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 45%, rgba(255, 255, 255, 0.4) 50%, transparent 55%);
    background-size: 10px 10px;
    opacity: 0.3;
}

.inner-frame {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.photo-area {
    aspect-ratio: 1 / 1.1;
    /* Slightly taller than square for classic polaroid feel */
    background: var(--photo, #eee);
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
    filter: sepia(0.05) contrast(1.05);
    /* Subtle film look */
}

.caption-area {
    text-align: center;
    padding: 0 0.5rem;
}

.caption-area h3 {
    margin: 0;
    font-size: 1.6rem;
    color: var(--ink);
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
}

.handwritten-note {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.15rem;
    color: var(--blue-deep);
    margin: 0.5rem 0 0;
    opacity: 0.85;
}

.timeline {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-track {
    position: relative;
    padding-left: 0;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    /* Now acts as a container */
}

/* Move the string line to a pseudo-element so it doesn't constrain content width */
.timeline-track::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    /* Center perfectly */
    background: repeating-linear-gradient(180deg, #d8a846 0, #d8a846 4px, transparent 4px, transparent 8px);
    z-index: 0;
}

.scrapbook-item {
    position: relative;
    margin: 0 auto 3rem;
    /* width: fit-content;  <-- Removed to allow full width expansion */
    display: block;
}

/* Pin Check style marker */
.pin {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: #c83232;
    /* Red pin head */
    border-radius: 50%;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.pin::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

.paper-scrap {
    background: #fdfcf8;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 15px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
    transform: rotate(-1deg);
    max-width: 650px;
    /* Widened from 480px */
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.06);
    /* Torn paper effect if possible, or just rough border */
    border-radius: 1px;
    margin: 0 auto;
    /* Center in the relative item */
}

/* Mobile Timeline Fixes */
@media (max-width: 720px) {
    .card-shell {
        padding: 1.5rem 1rem !important;
        /* Reduce shell padding */
    }

    main {
        padding: 0 !important;
        /* Remove main padding on mobile to let content go edge-to-edge relative to shell */
    }

    .section {
        margin: 3rem 0;
        /* Reduce section vertical spacing */
    }

    .scrapbook-item {
        margin: 0 auto 2rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100%;
        padding: 0;
        /* Remove extra padding on the item wrapper */
    }

    .timeline-track {
        padding-left: 0;
    }

    .paper-scrap {
        max-width: 100%;
        margin: 0 auto;
        padding: 1.25rem 1rem;
        /* Slightly tighter padding inside the scrap */
        width: 100%;
        /* Ensure it fills container */
        box-sizing: border-box;
    }
}

.scrapbook-item:nth-child(even) .paper-scrap {
    transform: rotate(2deg);
}

.scrapbook-item:nth-child(even) {
    margin-right: -40px;
    /* Offset horizontally slightly for randomness */
}

.scrapbook-item:nth-child(odd) {
    margin-left: -40px;
}

.paper-scrap h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    color: var(--ink);
    margin: 0.2rem 0;
}

.timeline .date {
    display: inline-block;
    background: #d8a846;
    /* Gold badge */
    color: #fff;
    padding: 0.2rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 2px;
    margin-bottom: 0.5rem;
}

.timeline .desc {
    font-family: 'Manrope', sans-serif;
    color: var(--blue-deep);
    font-size: 0.95rem;
    margin: 0;
}

.closing {
    display: flex;
    justify-content: center;
}

.closing-card {
    padding: clamp(1.6rem, 4vw, 2.2rem);
    max-width: 760px;
}

.closing-card h2 {
    color: var(--blue-deep);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.closing-card p {
    color: #2f3443;
    margin: 0.25rem 0;
    line-height: 1.7;
}

.ornament {
    height: 8px;
    width: 100%;
    background-image: radial-gradient(circle, #d8a846 24%, transparent 26%), radial-gradient(circle, #5b7fbf 24%, transparent 26%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    opacity: 0.5;
    margin-bottom: 0.9rem;
}

.train {
    margin-top: 3rem;
    overflow-x: hidden;
    /* Hide train when it goes off screen */
}

/* Track matches the timeline string vibe */
.track {
    position: relative;
    height: 80px;
    background: repeating-linear-gradient(90deg, rgba(216, 168, 70, 0.15) 0, rgba(216, 168, 70, 0.15) 10px, transparent 10px, transparent 40px);
    border-bottom: 3px solid rgba(91, 127, 191, 0.2);
}

.train-line {
    position: absolute;
    right: -600px;
    top: 10px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 64px;
    animation: train-loop 20s linear infinite;
}

/* TOY TRAIN STYLING */
.engine-car,
.box-car {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.engine-car {
    width: 130px;
    height: 64px;
    position: relative;
}

.engine .body {
    position: absolute;
    bottom: 12px;
    left: 20px;
    width: 90px;
    height: 32px;
    background: #c83232;
    /* Christmas Red */
    border-radius: 10px;
    border: 2px solid #a02020;
}

.engine .cabin {
    position: absolute;
    bottom: 24px;
    right: 20px;
    width: 44px;
    height: 32px;
    background: #1d2230;
    /* Dark Ink/Blue */
    border-radius: 4px 4px 0 0;
    border: 2px solid #1d2230;
}

/* Cabin Snow */
.engine .cabin::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: white;
    border-radius: 4px 4px 10px 10px;
}

.engine .stack {
    position: absolute;
    bottom: 38px;
    left: 24px;
    width: 20px;
    height: 20px;
    background: #d8a846;
    /* Gold */
    border-radius: 4px;
    border: 1px solid #b88932;
}

.engine .wheel {
    position: absolute;
    bottom: 0;
    width: 22px;
    height: 22px;
    background: #324564;
    border-radius: 50%;
    border: 2px solid #e3e7ee;
    box-shadow: inset 0 0 0 5px #1d2230;
}

.engine .w1 {
    left: 22px;
    width: 28px;
    height: 28px;
    bottom: -2px;
}

.engine .w2 {
    left: 56px;
    width: 28px;
    height: 28px;
    bottom: -2px;
}

.engine .w3 {
    left: 96px;
    width: 18px;
    height: 18px;
}

.box-car {
    width: 80px;
    height: 50px;
    position: relative;
    background: #5b7fbf;
    /* Blue */
    border-radius: 4px;
    border: 2px solid #324564;
    margin-bottom: 2px;
}

/* Box car snow */
.box-car::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px 2px 5px 5px;
}

.box-car.cocoa {
    background: #f7e7d5;
    /* Cream */
    border: 2px solid #d8a846;
}

.box-car .box-body {
    display: block;
    text-align: center;
    font-size: 1.5rem;
    line-height: 46px;
}

.box-car .wheel {
    position: absolute;
    bottom: -8px;
    width: 18px;
    height: 18px;
    background: #324564;
    border-radius: 50%;
    border: 2px solid #e3e7ee;
}

.box-car .w1 {
    left: 10px;
}

.box-car .w2 {
    right: 10px;
    left: auto;
}

.engine-car .smoke {
    position: absolute;
    left: 28px;
    bottom: 62px;
}

.engine-car .smoke span {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(201, 209, 217, 0.9);
    border-radius: 50%;
    opacity: 0;
    animation: smoke-rise 2.2s ease-in-out infinite;
}

.engine-car .smoke span:nth-child(2) {
    left: 10px;
    animation-delay: 0.4s;
}

.engine-car .smoke span:nth-child(3) {
    left: 20px;
    animation-delay: 0.8s;
}

@keyframes train-loop {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-100% - 600px));
    }
}

@keyframes smoke-rise {
    0% {
        transform: translate3d(0, 0, 0) scale(0.6);
        opacity: 0.7;
    }

    60% {
        opacity: 0.5;
    }

    100% {
        transform: translate3d(16px, -28px, 0) scale(1.2);
        opacity: 0;
    }
}

@media (max-width: 960px) {
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

    .hero-photo {
        order: -1;
    }

    .hero {
        padding-top: 5rem;
    }
}

@media (max-width: 720px) {
    .profiles .profile-grid {
        grid-template-columns: 1fr;
    }

    .timeline-track::before {
        left: 12px;
    }

    .timeline-item {
        grid-template-columns: 30px 1fr;
    }
}

@media (max-width: 520px) {
    h1 {
        letter-spacing: 0.04em;
    }

    .photo-frame {
        aspect-ratio: 16 / 11;
    }

    .gallery-card::before {
        font-size: 0.78rem;
    }

    .favorites div {
        padding: 0.6rem 0.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}