@font-face {
    font-family: 'HongLeiXiaoZhiTiao';
    src: url('assets/fonts/鸿雷小纸条青春体.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'PingFangSaTuoTi';
    src: url('assets/fonts/平方洒脱体.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --ink-color: #2e333a;
    --ink-light: #6d7580;
    --accent-color: #6a7f96;
    --accent-light: #8a9db0;
    --accent-soft: rgba(106, 127, 150, 0.12);
    --paper-color: #e8eaed;
    --paper-light: #f5f6f7;
    --paper-dark: #d8dce2;
    --stone: #8a847c;
    --polaroid: #fdfcf8;
    --shadow-soft: 0 12px 36px rgba(46, 51, 58, 0.1);
    --shadow-card: 0 6px 20px rgba(46, 51, 58, 0.07);
    --font-serif: 'HongLeiXiaoZhiTiao', 'Noto Serif SC', serif;
    --font-hand: 'PingFangSaTuoTi', 'Ma Shan Zheng', cursive;
    --font-elegant: 'HongLeiXiaoZhiTiao', 'ZCOOL XiaoWei', serif;
    --font-en: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    background-color: var(--paper-color);
    color: var(--ink-color);
    line-height: 1.9;
    overflow-x: hidden;
    position: relative;
}

.paper-texture {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.045;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 28px;
    position: relative;
    z-index: 1;
}

/* ── Hero collage ── */
.hero-collage {
    position: relative;
    min-height: min(92vh, 820px);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    grid-template-rows: 1fr auto;
    gap: 24px 40px;
    padding: 72px 0 0;
    align-items: start;
}

.hero-copy {
    grid-column: 1;
    grid-row: 1;
    padding-top: 28px;
    max-width: 460px;
    animation: fadeUp 1s ease both;
}

.hero-label,
.timer-label-en,
.timeline-label-en,
.footer-label-en {
    font-family: var(--font-en);
    font-size: 0.78rem;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--ink-light);
    margin-bottom: 22px;
}

.hero-title {
    font-family: var(--font-hand);
    font-size: clamp(2.8rem, 6vw, 4.2rem);
    font-weight: normal;
    line-height: 1.25;
    color: var(--ink-color);
    letter-spacing: 0.06em;
    margin-bottom: 28px;
}

.hero-subtitle {
    font-family: var(--font-elegant);
    font-size: 1.05rem;
    color: var(--ink-light);
    letter-spacing: 0.28em;
    margin-bottom: 36px;
}

.hero-meta {
    font-family: var(--font-en);
    font-size: 0.85rem;
    letter-spacing: 0.28em;
    color: var(--accent-color);
    font-style: italic;
}

.hero-photos {
    grid-column: 2;
    grid-row: 1 / 3;
    position: relative;
    min-height: 520px;
    animation: fadeUp 1.1s ease 0.15s both;
}

.polaroid {
    position: absolute;
    background: var(--polaroid);
    padding: 12px 12px 42px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.polaroid:hover {
    z-index: 5;
    box-shadow: 0 18px 40px rgba(46, 51, 58, 0.14);
}

.polaroid-photo {
    width: 200px;
    height: 240px;
    overflow: hidden;
    background: var(--paper-dark);
}

.polaroid-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(0.88) contrast(1.02);
}

.polaroid figcaption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 12px;
}

.avatar-name {
    font-family: var(--font-hand);
    font-size: 1.15rem;
    color: var(--ink-color);
}

.avatar-desc {
    font-family: var(--font-en);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--ink-light);
}

.polaroid-him {
    top: 40px;
    left: 8%;
    transform: rotate(-6deg);
    z-index: 2;
}

.polaroid-him:hover {
    transform: rotate(-3deg) translateY(-6px);
}

.polaroid-her {
    top: 160px;
    right: 4%;
    transform: rotate(5deg);
    z-index: 3;
}

.polaroid-her:hover {
    transform: rotate(2deg) translateY(-6px);
}

.polaroid-her .polaroid-photo {
    width: 180px;
    height: 220px;
}

/* Torn landscape collage piece */
.torn-landscape {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    width: min(100%, 420px);
    margin-top: auto;
    margin-bottom: 8px;
    transform: rotate(-2deg);
    animation: fadeUp 1.2s ease 0.3s both;
    filter: drop-shadow(0 8px 18px rgba(46, 51, 58, 0.12));
}

.torn-landscape::before {
    content: '';
    position: absolute;
    inset: -6px -4px auto -4px;
    height: 18px;
    background: var(--polaroid);
    z-index: 2;
    clip-path: polygon(
        0% 60%, 2% 20%, 4% 70%, 7% 10%, 10% 65%, 13% 25%, 16% 75%, 19% 15%,
        22% 60%, 25% 30%, 28% 70%, 32% 20%, 36% 65%, 40% 15%, 44% 70%, 48% 25%,
        52% 60%, 56% 20%, 60% 75%, 64% 15%, 68% 65%, 72% 30%, 76% 70%, 80% 20%,
        84% 60%, 88% 25%, 92% 70%, 96% 15%, 100% 55%,
        100% 100%, 0% 100%
    );
}

.landscape-art {
    display: block;
    width: 100%;
    height: 150px;
    clip-path: polygon(
        0% 12%, 3% 4%, 6% 14%, 9% 2%, 12% 13%, 15% 5%, 18% 15%, 22% 3%,
        26% 12%, 30% 4%, 34% 14%, 38% 2%, 42% 13%, 46% 5%, 50% 14%, 54% 3%,
        58% 12%, 62% 5%, 66% 14%, 70% 2%, 74% 13%, 78% 4%, 82% 14%, 86% 3%,
        90% 12%, 94% 5%, 97% 13%, 100% 4%,
        100% 100%, 0% 100%
    );
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Timer ── */
.timer-section {
    margin: 48px 0 20px;
    padding: 56px 24px;
    background: var(--paper-light);
    position: relative;
    box-shadow: var(--shadow-card);
}

.timer-section::before,
.timer-section::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 14px;
    background: var(--paper-color);
    pointer-events: none;
}

.timer-section::before {
    top: -1px;
    clip-path: polygon(
        0 0, 100% 0,
        100% 100%, 97% 40%, 94% 90%, 91% 30%, 88% 85%, 85% 35%,
        82% 95%, 78% 25%, 74% 80%, 70% 40%, 66% 90%, 62% 30%, 58% 85%,
        54% 35%, 50% 95%, 46% 25%, 42% 80%, 38% 40%, 34% 90%, 30% 30%,
        26% 85%, 22% 35%, 18% 95%, 14% 25%, 10% 80%, 6% 40%, 3% 90%, 0 45%
    );
}

.timer-section::after {
    bottom: -1px;
    clip-path: polygon(
        0 55%, 3% 10%, 6% 70%, 10% 20%, 14% 75%, 18% 15%, 22% 80%, 26% 25%,
        30% 70%, 34% 20%, 38% 75%, 42% 15%, 46% 80%, 50% 25%, 54% 70%, 58% 20%,
        62% 75%, 66% 15%, 70% 80%, 74% 25%, 78% 70%, 82% 20%, 86% 75%, 90% 15%,
        94% 70%, 97% 25%, 100% 60%,
        100% 100%, 0 100%
    );
}

.timer-container {
    text-align: center;
    position: relative;
    z-index: 1;
}

.timer-label-en {
    margin-bottom: 12px;
}

.timer-title {
    font-family: var(--font-elegant);
    font-size: 1.15rem;
    color: var(--ink-light);
    margin-bottom: 32px;
    letter-spacing: 0.35em;
}

.timer-display {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.timer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 64px;
}

.timer-number {
    font-family: var(--font-en);
    font-size: 3.2rem;
    font-weight: 500;
    color: var(--ink-color);
    line-height: 1;
    letter-spacing: 0.04em;
}

.timer-label {
    font-family: var(--font-elegant);
    font-size: 0.85rem;
    color: var(--accent-color);
    letter-spacing: 0.3em;
}

.timer-divider {
    font-family: var(--font-en);
    font-size: 1.6rem;
    color: var(--accent-light);
    opacity: 0.7;
    margin: 0 2px;
}

.timer-date {
    margin-top: 36px;
    font-family: var(--font-hand);
    font-size: 1.15rem;
    color: var(--ink-light);
    letter-spacing: 0.2em;
}

/* ── Timeline ── */
.timeline-section {
    padding: 88px 0 40px;
}

.timeline-header {
    text-align: center;
    margin-bottom: 72px;
}

.timeline-title {
    font-family: var(--font-hand);
    font-size: 2.4rem;
    color: var(--ink-color);
    margin-bottom: 10px;
    letter-spacing: 0.08em;
}

.timeline-subtitle {
    font-family: var(--font-elegant);
    font-size: 0.95rem;
    color: var(--ink-light);
    letter-spacing: 0.32em;
}

.timeline {
    position: relative;
    max-width: 880px;
    margin: 0 auto;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        180deg,
        transparent,
        var(--accent-light) 8%,
        var(--accent-light) 92%,
        transparent
    );
    opacity: 0.45;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 72px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 28px;
    width: 10px;
    height: 10px;
    transform: translateX(-50%);
    z-index: 2;
}

.dot-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--paper-light);
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 0 4px var(--paper-color);
    transition: transform 0.3s ease;
}

.timeline-item:hover .dot-inner {
    transform: scale(1.35);
}

.future-dot {
    border-color: var(--ink-light);
    border-style: dashed;
}

.timeline-card {
    width: 44%;
    background: var(--polaroid);
    padding: 28px 24px 32px;
    position: relative;
    box-shadow: var(--shadow-card);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.timeline-card::before {
    content: '';
    position: absolute;
    left: -2px;
    right: -2px;
    top: -8px;
    height: 16px;
    background: var(--paper-color);
    clip-path: polygon(
        0 0, 100% 0,
        100% 100%, 96% 35%, 92% 85%, 88% 25%, 84% 80%, 80% 40%,
        76% 90%, 72% 30%, 68% 75%, 64% 35%, 60% 85%, 56% 25%, 52% 80%,
        48% 40%, 44% 90%, 40% 30%, 36% 75%, 32% 35%, 28% 85%, 24% 25%,
        20% 80%, 16% 40%, 12% 90%, 8% 30%, 4% 75%, 0 45%
    );
}

.timeline-card:hover {
    transform: translateY(-6px) rotate(0deg) !important;
    box-shadow: var(--shadow-soft);
}

.timeline-item.left .timeline-card {
    margin-left: 0;
}

.timeline-item.right .timeline-card {
    margin-left: auto;
}

.card-torn {
    display: none;
}

.card-date {
    font-family: var(--font-en);
    font-size: 0.78rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    letter-spacing: 0.18em;
}

.card-title {
    font-family: var(--font-hand);
    font-size: 1.45rem;
    color: var(--ink-color);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(106, 127, 150, 0.22);
}

.card-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    margin: 14px 0;
    display: block;
    filter: saturate(0.9);
}

.card-content {
    font-family: var(--font-elegant);
    font-size: 0.95rem;
    color: var(--ink-light);
    line-height: 2.1;
    text-align: left;
}

.card-content p {
    margin-bottom: 8px;
    text-indent: 2em;
}

.card-content p:last-child {
    margin-bottom: 0;
}

.card-badge {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    color: var(--accent-color);
    opacity: 0.45;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-badge svg {
    width: 16px;
    height: 16px;
}

.future-card {
    background: rgba(253, 252, 248, 0.72);
    border: 1px dashed rgba(106, 127, 150, 0.35);
}

/* ── Footer ── */
.footer {
    padding: 80px 0 56px;
    text-align: center;
}

.footer-text {
    font-family: var(--font-hand);
    font-size: 1.9rem;
    color: var(--ink-color);
    margin: 10px 0 16px;
    letter-spacing: 0.12em;
}

.footer-date {
    font-family: var(--font-elegant);
    font-size: 0.88rem;
    color: var(--ink-light);
    letter-spacing: 0.28em;
}

.elsewhere {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid rgba(106, 127, 150, 0.18);
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.elsewhere-label-en {
    font-family: var(--font-en);
    font-size: 0.72rem;
    letter-spacing: 0.38em;
    text-transform: uppercase;
    color: var(--ink-light);
    margin-bottom: 10px;
}

.elsewhere-title {
    font-family: var(--font-hand);
    font-size: 1.25rem;
    color: var(--ink-color);
    letter-spacing: 0.12em;
    margin-bottom: 22px;
}

.elsewhere-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.elsewhere-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    text-decoration: none;
    background: var(--polaroid);
    border: 1px solid rgba(106, 127, 150, 0.18);
    padding: 16px 16px 18px;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.elsewhere-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(106, 127, 150, 0.4);
}

.elsewhere-card-en {
    font-family: var(--font-en);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.elsewhere-card-name {
    font-family: var(--font-hand);
    font-size: 1.15rem;
    color: var(--ink-color);
    letter-spacing: 0.06em;
}

.elsewhere-card-desc {
    font-family: var(--font-elegant);
    font-size: 0.82rem;
    color: var(--ink-light);
    letter-spacing: 0.06em;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .elsewhere-cards {
        grid-template-columns: 1fr;
    }
}

.back-to-top {
    position: fixed;
    bottom: 96px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: transparent;
    color: var(--ink-color);
    border: none;
    border-radius: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.25s ease;
    z-index: 999;
    box-shadow: none;
}

.back-to-top:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.back-to-top.show {
    opacity: 0.55;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top.show:hover {
    opacity: 0.9;
}

.back-to-top svg {
    width: 22px;
    height: 22px;
}

.music-bubble {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 0.5px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.22);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    color: rgba(46, 51, 58, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(46, 51, 58, 0.08),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.6);
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
    z-index: 1000;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.music-bubble:hover {
    background: rgba(255, 255, 255, 0.38);
    color: rgba(46, 51, 58, 0.62);
    transform: scale(1.04);
}

.music-bubble:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.48);
}

.music-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-left: 1px;
    opacity: 0.55;
}

.music-icon.pause-icon {
    display: none;
    margin-left: 0;
}

.music-bubble.playing .music-icon:not(.pause-icon) {
    display: none;
}

.music-bubble.playing .music-icon.pause-icon {
    display: block;
}

.music-bubble.playing {
    color: rgba(46, 51, 58, 0.5);
}

@media (max-width: 860px) {
    .hero-collage {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        min-height: auto;
        padding-top: 48px;
        gap: 32px;
    }

    .hero-copy {
        grid-column: 1;
        grid-row: 1;
        max-width: none;
        text-align: center;
        padding-top: 0;
    }

    .hero-photos {
        grid-column: 1;
        grid-row: 2;
        min-height: 380px;
        margin: 0 auto;
        width: 100%;
        max-width: 420px;
    }

    .polaroid-him {
        left: 4%;
        top: 10px;
    }

    .polaroid-her {
        right: 2%;
        top: 120px;
    }

    .polaroid-photo {
        width: 150px;
        height: 180px;
    }

    .polaroid-her .polaroid-photo {
        width: 140px;
        height: 168px;
    }

    .torn-landscape {
        grid-column: 1;
        grid-row: 3;
        width: 100%;
        max-width: 360px;
        margin: 0 auto 20px;
    }

    .timer-number {
        font-size: 2.2rem;
        min-width: 48px;
    }

    .timeline-line,
    .timeline-dot {
        left: 16px;
    }

    .timeline-card {
        width: calc(100% - 48px);
        margin-left: 48px !important;
    }

    .timeline-card::before {
        display: none;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 0 18px;
    }

    .polaroid {
        padding: 8px 8px 32px;
    }

    .polaroid-photo {
        width: 128px;
        height: 156px;
    }

    .polaroid-her .polaroid-photo {
        width: 118px;
        height: 144px;
    }

    .hero-photos {
        min-height: 320px;
    }

    .timer-section {
        padding: 44px 12px;
    }

    .timer-item {
        min-width: 48px;
    }
}
