@font-face {
    font-family: 'FuturaDisplay';
    src: url('assets/fonts/FuturaDisplay.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

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

body {
    font-family: 'FuturaDisplay', 'Comic Sans MS', cursive, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    line-height: 1.6;

    /* Retro space background — replace with your own tiled bg image */
    background-color: #0d0221;
    background-image: 
        radial-gradient(1px 1px at 10% 20%, #ffffff, transparent),
        radial-gradient(1px 1px at 30% 60%, #ffffff, transparent),
        radial-gradient(1.5px 1.5px at 50% 10%, #ffffff, transparent),
        radial-gradient(1px 1px at 70% 40%, #ffffff, transparent),
        radial-gradient(1.5px 1.5px at 90% 80%, #ffffff, transparent),
        radial-gradient(1px 1px at 25% 90%, #ffffff, transparent),
        radial-gradient(1.5px 1.5px at 60% 70%, #ffffff, transparent),
        radial-gradient(1px 1px at 80% 15%, #ffffff, transparent);
    background-size: 200px 200px;
    color: #ffffff;

    /* Custom cursor — replace with your own .cur file */
    cursor: url('assets/cursor.cur'), auto;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    color: #ff69b4;
    text-shadow:
        2px 0 #ff00ff,
        -2px 0 #00bfff,
        0 2px #ffff00,
        0 -2px #32cd32;
}

p {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

a {
    color: #00bfff;
    text-decoration: underline;
    font-size: 1.1rem;
    margin: 0 0.75rem;
    font-weight: bold;
}

a:visited {
    color: #ff69b4;
}

a:hover {
    color: #ffff00;
}

.site-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1.5rem;
    border: 3px ridge #ff69b4;
    background: rgba(255, 105, 180, 0.1);
}

.site-nav a {
    margin: 0;
    padding: 0.3rem 0.6rem;
    font-size: 1rem;
    text-decoration: none;
    color: #ffff00;
    background: #ff00ff;
    border: 2px outset #ff69b4;
}

.site-nav a:visited {
    color: #ffff00;
}

.site-nav a:hover {
    color: #ff00ff;
    background: #ffff00;
    border-style: inset;
}

/* Fun 2000s horizontal rule */
hr {
    border: none;
    height: 4px;
    background: linear-gradient(to right, #ff69b4, #00bfff, #ffff00, #32cd32, #ff00ff);
    width: 80%;
    margin: 1.5rem auto;
}

/* ---- page-index: sprites ---- */
.sprites {
    position: relative;
    width: 100%;
    height: 96px;
    margin-bottom: 1.5rem;
}

.sprite {
    position: absolute;
    top: 50%;
    cursor: pointer;
    width: 96px;
    height: 96px;
    image-rendering: pixelated;
}

.sprite-left {
    left: calc(100% / 3);
    transform: translate(-50%, -50%);
}

.sprite-right {
    left: calc(200% / 3);
    transform: translate(-50%, -50%);
}

@keyframes bounce {
    0%   { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    25%  { transform: translate(-50%, -50%) scale(1.12) rotate(-8deg); }
    50%  { transform: translate(-50%, -50%) scale(1.12) rotate(8deg); }
    75%  { transform: translate(-50%, -50%) scale(0.95) rotate(-3deg); }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

.sprite.bounce {
    animation: bounce 0.45s ease;
}

/* ---- page-timeline ---- */
.timeline {
    position: relative;
    width: 100%;
    max-width: 900px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: #ff69b4;
    transform: translateX(-50%);
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    margin-bottom: 5rem;
    align-items: center;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.tl-marker {
    grid-column: 2;
    width: 16px;
    height: 16px;
    background: #ffff00;
    border: 3px solid #0d0221;
    z-index: 1;
    justify-self: center;
    align-self: center;
}

.tl-half {
    display: flex;
    align-items: center;
}

.tl-left {
    grid-column: 1;
    flex-direction: row;
}

.tl-right {
    grid-column: 3;
    flex-direction: row-reverse;
}

.tl-content {
    position: relative;
    width: 360px;
    height: 240px;
    flex-shrink: 0;
    border: 2px ridge #ff69b4;
    perspective: 1000px;
    cursor: pointer;
    overflow: hidden;
}

.tl-content:hover {
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.4);
}

.tl-left .tl-content {
    margin-right: 1.5rem;
}

.tl-right .tl-content {
    margin-left: 1.5rem;
}

.tl-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.tl-content.flipped .tl-flipper {
    transform: rotateY(180deg);
}

.tl-front,
.tl-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.tl-front {
    z-index: 2;
}

.tl-front .tl-img {
    width: 100%;
    height: 100%;
    background: #ff00ff;
    overflow: hidden;
}

.tl-front .tl-img img,
.tl-front .tl-img video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.tl-back {
    transform: rotateY(180deg);
    background: #1a0033;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
    text-align: center;
}

.tl-back .tl-date {
    font-size: 0.95rem;
    color: #ffff00;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.tl-back .tl-text {
    font-size: 0.9rem;
    color: #ffffff;
    overflow-wrap: break-word;
    line-height: 1.4;
    max-height: 100%;
    overflow-y: auto;
}

.tl-line {
    flex: 1;
    height: 2px;
    background: #ff69b4;
}

.future .tl-line {
    background: transparent;
    border-top: 2px dashed #ff69b4;
    height: 0;
}

/* ---- page-letter ---- */
.letter-body {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    text-align: left;
    line-height: 1.9;
    background: rgba(13, 2, 33, 0.6);
    border: 3px ridge #ff69b4;
    font-family: Georgia, 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    font-size: 1.1rem;
}

.letter-body h2 {
    color: #ff69b4;
    margin-bottom: 1rem;
}

.letter-body p {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* ---- protected content wrapper ---- */
#protected-content {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
}

#protected-content .site-nav {
    flex-shrink: 0;
}

/* ---- password gate ---- */
.password-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    width: 100%;
}

.password-box {
    background: rgba(13, 2, 33, 0.6);
    border: 3px ridge #ff69b4;
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.password-box h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.password-box p {
    font-size: 1rem;
    color: #ccc;
    margin-bottom: 1.5rem;
}

#password-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}

#password-input {
    font-family: 'FuturaDisplay', 'Comic Sans MS', cursive, sans-serif;
    font-size: 1.1rem;
    padding: 0.6rem 1rem;
    background: #1a0033;
    border: 2px inset #ff69b4;
    color: #ffffff;
    text-align: center;
    outline: none;
}

#password-input:focus {
    border-color: #ffff00;
}

#password-form button {
    font-family: 'FuturaDisplay', 'Comic Sans MS', cursive, sans-serif;
    font-size: 1.1rem;
    padding: 0.5rem 1.5rem;
    background: #ff00ff;
    color: #ffff00;
    border: 2px outset #ff69b4;
    cursor: pointer;
    font-weight: bold;
}

#password-form button:hover {
    background: #ffff00;
    color: #ff00ff;
    border-style: inset;
}

.password-error {
    display: none;
    color: #ff69b4 !important;
    font-size: 0.9rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0 !important;
}

/* ---- page container (SPA) ---- */
.page {
    display: none;
}

/* ---- Mobile styles ---- */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    p {
        font-size: 1rem;
    }

    body {
        padding: 1rem;
    }

    .site-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .site-nav a {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
        margin: 0;
    }

    /* ---- timeline mobile ---- */
    .timeline {
        max-width: 100%;
    }

    .timeline::before {
        left: 8px;
        transform: none;
    }

    .timeline-item {
        grid-template-columns: 12px 1fr;
        gap: 0.5rem;
        margin-bottom: 2.5rem;
    }

    .tl-marker {
        grid-column: 1;
        width: 12px;
        height: 12px;
        justify-self: center;
        align-self: start;
        margin-top: 0.5rem;
    }

    .tl-half {
        grid-column: 2;
        width: 100%;
        min-width: 0;
    }

    .tl-half.tl-left,
    .tl-half.tl-right {
        grid-column: 2;
        flex-direction: row;
        margin: 0;
    }

    .tl-content {
        max-width: 100%;
        margin: 0 !important;
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 4;
        padding: 0;
    }

    .tl-back {
        padding: 0.75rem;
    }

    .tl-line {
        display: none;
    }

    /* ---- letter mobile ---- */
    .letter-body {
        padding: 1.25rem;
    }

    /* ---- password gate mobile ---- */
    .password-box {
        padding: 1.5rem 1.25rem;
    }

    .password-box h1 {
        font-size: 1.35rem;
    }
}
