/* ===================================
   RESET & BASE
   =================================== */

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

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f7f4;
    color: #2a2a2a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   TYPOGRAPHY
   =================================== */

.prompt,
.wish-text,
.nudge-text,
.rotating-wish-text {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.75;
}

.prompt {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 2.5rem;
    letter-spacing: -0.02em;
}

.wish-text {
    font-size: 1.75rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin-bottom: 4rem;
}

.nudge-text {
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.8;
}

/* ===================================
   LAYOUT
   =================================== */

.view {
    display: none;
    min-height: 100vh;
    padding: 3rem 1.5rem;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.view.active {
    display: flex;
    opacity: 1;
}

.container {
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80vh;
}

/* ===================================
   SUBMISSION VIEW
   =================================== */

#submissionView {
    align-items: center;
}

/* Rotating Wish Display */
.rotating-wish {
    width: 100%;
    min-height: 120px;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.rotating-wish.visible {
    opacity: 1;
}

.rotating-wish-text {
    font-size: 1.5rem;
    font-weight: 400;
    color: #6b665a;
    font-style: italic;
    text-align: center;
    letter-spacing: -0.01em;
}

.wish-form {
    width: 100%;
}

.wish-input {
    width: 100%;
    min-height: 180px;
    padding: 1.25rem;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.25rem;
    line-height: 1.75;
    border: 1px solid #d4d0c8;
    border-radius: 4px;
    background-color: #ffffff;
    color: #2a2a2a;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 0.75rem;
}

.wish-input:focus {
    outline: none;
    border-color: #6b665a;
    box-shadow: 0 0 0 3px rgba(107, 102, 90, 0.1);
}

.wish-input::placeholder {
    color: #9a9589;
}

.subtle-note {
    font-size: 0.875rem;
    color: #7a7568;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.submit-btn {
    padding: 0.875rem 2.5rem;
    font-size: 1rem;
    font-weight: 500;
    background-color: #2a2a2a;
    color: #f8f7f4;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.submit-btn:hover {
    background-color: #3a3a3a;
}

.submit-btn:active {
    transform: scale(0.98);
}

.archive-link {
    display: inline-block;
    margin-top: 2.5rem;
    font-size: 0.9rem;
    color: #6b665a;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.archive-link:hover {
    border-bottom-color: #6b665a;
}

/* ===================================
   NUDGE VIEW
   =================================== */

.nudge-view {
    align-items: center;
    background-color: #2a2a2a;
    color: #f8f7f4;
}

.nudge-view .container {
    text-align: center;
}

.continue-btn {
    margin-top: 3rem;
    padding: 0.875rem 2.5rem;
    font-size: 1rem;
    background-color: transparent;
    color: #f8f7f4;
    border: 1px solid #f8f7f4;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.continue-btn:hover {
    background-color: #f8f7f4;
    color: #2a2a2a;
}

/* ===================================
   ARCHIVE VIEW
   =================================== */

.archive-view {
    display: none;
    flex-direction: column;
    padding-top: 2rem;
}

.archive-view.active {
    display: flex;
}

.archive-header {
    max-width: 680px;
    margin: 0 auto 3rem;
    width: 100%;
}

.back-link {
    font-size: 0.9rem;
    color: #6b665a;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.back-link:hover {
    border-bottom-color: #6b665a;
}

.wishes-container {
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

.wish-item {
    margin-bottom: 5rem;
    opacity: 0;
    animation: fadeInWish 1s ease forwards;
}

@keyframes fadeInWish {
    to {
        opacity: 1;
    }
}

.wish-item:last-child {
    margin-bottom: 3rem;
}

.wish-timestamp {
    font-size: 0.75rem;
    color: #9a9589;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.archive-footer {
    max-width: 680px;
    margin: 4rem auto 2rem;
    width: 100%;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #e5e3db;
}

.footer-link {
    font-size: 0.85rem;
    color: #7a7568;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.footer-link:hover {
    border-bottom-color: #7a7568;
}

/* ===================================
   MODAL
   =================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(42, 42, 42, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    max-width: 580px;
    background-color: #f8f7f4;
    padding: 3rem;
    border-radius: 4px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #7a7568;
    cursor: pointer;
    line-height: 1;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #2a2a2a;
}

.modal-text {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.125rem;
    line-height: 1.8;
    color: #2a2a2a;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .prompt {
        font-size: 2rem;
    }

    .wish-text {
        font-size: 1.5rem;
        margin-bottom: 3rem;
    }

    .nudge-text {
        font-size: 1.25rem;
    }

    .wish-input {
        font-size: 1.125rem;
        min-height: 160px;
    }

    .modal-content {
        padding: 2rem;
    }

    .modal-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .prompt {
        font-size: 1.75rem;
    }

    .wish-text {
        font-size: 1.25rem;
    }

    .nudge-text {
        font-size: 1.125rem;
    }

    .view {
        padding: 2rem 1.25rem;
    }

    .wish-item {
        margin-bottom: 3.5rem;
    }
}
