:root {
    --bg-color: #fcfaf2;
    /* Washi paper white */
    --text-color: #2e2925;
    /* Soft charcoal */
    --accent-red: #bc002d;
    /* Japan flag red */
    --accent-gold: #c5a059;
    --accent-green: #6e7c5e;
    /* Matcha */
    --card-bg: #ffffff;
    --border-color: #e6e2d3;

    --font-heading: 'Noto Serif JP', serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Texture */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use local asset background with overlay for readability */
    background:
        linear-gradient(rgba(255, 253, 245, 0.4), rgba(255, 253, 245, 0.5)),
        url('assets/Fujiyoshida.avif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    pointer-events: none;
    z-index: -1;
}

/* Header */
.main-header {
    text-align: center;
    padding: 3rem 1rem;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.jap-motif {
    width: 60px;
    height: 60px;
    background-color: var(--accent-red);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 20px rgba(188, 0, 45, 0.2);
}

h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.subtitle {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.countdown-tag {
    display: inline-block;
    background-color: var(--text-color);
    color: #fff;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Day Node */
.day-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.day-card:hover:not(.locked) {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-color: var(--accent-gold);
}

.day-number {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    z-index: 2;
}

.day-date {
    font-size: 0.7rem;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    color: #555;
    margin-top: 0.3rem;
    z-index: 2;
    text-align: center;
}

.day-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-top: 0.2rem;
}

/* States */
.day-card.locked {
    background-color: rgba(255, 255, 255, 0.6);
    /* Slightly more opaque */
    opacity: 0.9;
    cursor: not-allowed;
    border: 1px dashed #bbb;
    color: #999;
}

.card-countdown {
    font-size: 0.65rem;
    font-weight: 500;
    margin-top: 0.5rem;
    color: var(--accent-red);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-align: center;
}

.day-card.opened {
    background-color: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.day-card.opened .day-date {
    color: rgba(255, 255, 255, 0.8);
}

.day-card.opened .day-label {
    color: rgba(255, 255, 255, 0.8);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(46, 41, 37, 0.85);
    /* Dark overlay */
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    z-index: 1001;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-image-container {
    width: 100%;
    height: 250px;
    background-color: #ddd;
    overflow: hidden;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-body {
    padding: 2rem;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

#modal-date {
    font-family: var(--font-heading);
    color: var(--accent-red);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

#modal-location {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

#modal-fact {
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
}

/* Sakura Animation */
.sakura {
    position: absolute;
    background: #ffd7e6;
    border-radius: 100% 0 100% 0;
    opacity: 0.8;
    transform-origin: center;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Responsiveness */
@media (max-width: 600px) {
    .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 per row on mobile handled better */
        gap: 0.5rem;
        padding: 1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .day-number {
        font-size: 1.2rem;
    }
}