:root {
    --color-night: #0a0e27;
    --color-twilight: #1a1f3a;
    --color-star: #fef9c7;
    --color-accent: #e8d5b5;
    --color-text: #f5f1e8;
    --color-text-dim: #b8afa0;

    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'Raleway', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--color-night);
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Layered background for depth */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(30, 40, 80, 0.4) 0%, transparent 60%),
        linear-gradient(180deg, var(--color-night) 0%, var(--color-twilight) 50%, #0d1230 100%);
    z-index: 0;
}

/* Stars background */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--color-star);
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 3s infinite;
    box-shadow: 0 0 4px var(--color-star);
}

.star--medium {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 6px var(--color-star);
}

.star--bright {
    width: 4px;
    height: 4px;
    box-shadow: 0 0 10px 2px var(--color-star);
    animation-name: twinkleBright;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

@keyframes twinkleBright {
    0%, 100% { opacity: 0.1; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.3); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Content wrapper */
.content-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    max-width: 100%;
}

/* Header */
.site-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out;
}

.date-display {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.day-counter {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 200;
    letter-spacing: 0.1em;
    color: var(--color-text-dim);
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 42rem;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 1.2s ease-out 0.3s both;
}

.message-container {
    width: 100%;
    text-align: center;
    padding: 2rem 1rem 6rem;
}

.message-type {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 2rem;
    opacity: 0.8;
}

.message-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.8;
    font-weight: 300;
    color: var(--color-text);
    margin-bottom: 2rem;
    font-style: italic;
}

.message-photo {
    position: relative;
    margin: 2.5rem auto;
    max-width: min(85%, 480px);
    padding: 16px;
    background: linear-gradient(135deg,
        rgba(232, 213, 181, 0.08) 0%,
        rgba(254, 249, 199, 0.04) 50%,
        rgba(232, 213, 181, 0.08) 100%);
    border: 1px solid rgba(232, 213, 181, 0.15);
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(232, 213, 181, 0.06),
        inset 0 0 30px rgba(232, 213, 181, 0.03);
}

/* Inner decorative border */
.message-photo::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px solid rgba(232, 213, 181, 0.12);
    pointer-events: none;
}

/* Outer glow halo */
.message-photo::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg,
        rgba(254, 249, 199, 0.15),
        transparent 30%,
        transparent 70%,
        rgba(254, 249, 199, 0.15));
    z-index: -1;
    filter: blur(8px);
}

/* Four corner ornaments */
.corner {
    position: absolute;
    width: 18px;
    height: 18px;
    z-index: 1;
}

.corner::before,
.corner::after {
    content: '';
    position: absolute;
    background: rgba(232, 213, 181, 0.4);
}

.corner::before {
    width: 100%;
    height: 1px;
}

.corner::after {
    width: 1px;
    height: 100%;
}

.corner--tl { top: 3px; left: 3px; }
.corner--tl::before { top: 0; left: 0; }
.corner--tl::after { top: 0; left: 0; }

.corner--tr { top: 3px; right: 3px; }
.corner--tr::before { top: 0; right: 0; }
.corner--tr::after { top: 0; right: 0; }

.corner--bl { bottom: 3px; left: 3px; }
.corner--bl::before { bottom: 0; left: 0; }
.corner--bl::after { bottom: 0; left: 0; }

.corner--br { bottom: 3px; right: 3px; }
.corner--br::before { bottom: 0; right: 0; }
.corner--br::after { bottom: 0; right: 0; }

.message-photo img {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 55vh;
    object-fit: contain;
    display: block;
}

.message-signature {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 300;
    color: var(--color-text-dim);
    margin-top: 2rem;
    font-style: italic;
}

/* Waiting state */
.waiting-container {
    text-align: center;
    padding: 3rem 1rem;
}

.waiting-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 300;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.waiting-message {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text-dim);
    max-width: 28rem;
    margin: 0 auto;
}

.countdown {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 300;
    color: var(--color-star);
    margin: 2rem 0;
    letter-spacing: 0.05em;
}

/* Navigation */
.navigation {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3rem;
    z-index: 10;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(232, 213, 181, 0.3);
    color: var(--color-accent);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    backdrop-filter: blur(10px);
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Tablet and up */
@media (min-width: 768px) {
    .content-wrapper {
        padding: 2.5rem;
    }

    .site-header {
        margin-bottom: 4rem;
    }

    .date-display {
        font-size: 1.25rem;
    }

    .day-counter {
        font-size: 1rem;
    }

    .message-text {
        font-size: 1.875rem;
        line-height: 2;
    }

    .message-container {
        padding: 2rem 2rem 7rem;
    }

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

    .waiting-message {
        font-size: 1.125rem;
    }

    .countdown {
        font-size: 4rem;
    }

    .navigation {
        bottom: 3rem;
        gap: 4rem;
    }

    .nav-btn {
        width: 3.5rem;
        height: 3.5rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    body::before {
        background:
            radial-gradient(ellipse at 50% 40%, rgba(30, 40, 80, 0.5) 0%, transparent 50%),
            radial-gradient(ellipse at 20% 80%, rgba(20, 25, 60, 0.3) 0%, transparent 40%),
            radial-gradient(ellipse at 80% 20%, rgba(25, 30, 65, 0.3) 0%, transparent 40%),
            linear-gradient(180deg, var(--color-night) 0%, var(--color-twilight) 50%, #0d1230 100%);
    }

    .content-wrapper {
        padding: 3rem;
    }

    .message-text {
        font-size: 2.25rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    :root {
        --color-text: #ffffff;
        --color-accent: #ffd700;
    }
}
