:root {
    --bg-color: #000000;
    --input-bg: #1e1e1e;
    --text-color: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: #000000 !important;
}

body {
    background-color: #000000 !important;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100vw;
    font-family: 'Inter', system-ui, sans-serif;
    transition: background-color 0.5s ease;
    overscroll-behavior: none;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#app {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.view {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.view.active {
    display: flex;
}

/* PIN View */
#pin-view {
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease, transform 0.8s ease;
}

#pin-view.fade-out {
    opacity: 0;
    filter: blur(8px);
    transform: scale(1.03);
    pointer-events: none;
}

#pin-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#pin-input {
    background-color: #1a1b1e;
    border: 1px solid #2d2d2d;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 1.5rem;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    width: 280px;
    max-width: 90vw;
    outline: none;
    letter-spacing: 0.15em;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', system-ui, sans-serif;
}

#pin-input::placeholder {
    color: #5c5f66;
    letter-spacing: normal;
    font-size: 1.25rem;
}

#pin-input:focus {
    background-color: #212328;
    border-color: #4a4d55;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05), 0 8px 30px rgba(0, 0, 0, 0.6);
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake {
    animation: shake 0.4s;
}

.error-flash {
    background-color: #4a1c1c !important;
}

/* Letter View */
#letter-view {
    justify-content: center;
    align-items: flex-start;
    padding: 80px 20px;
    overflow-y: auto;
    font-family: 'EB Garamond', serif;
    background-color: var(--bg-color);
}

/* Scrollbar tweaks for elegance */
#letter-view::-webkit-scrollbar {
    width: 8px;
}

#letter-view::-webkit-scrollbar-track {
    background: #000;
}

#letter-view::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

#letter-view::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#letter-content {
    max-width: 650px;
    width: 100%;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 1.25rem;
    color: var(--text-color);
    opacity: 0;
    transform: translateY(30px);
    filter: blur(5px);
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1), transform 1.5s cubic-bezier(0.16, 1, 0.3, 1), filter 1.5s ease;
    padding-bottom: 80px;
}

#letter-content.show {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

#letter-content h1,
#letter-content h2,
#letter-content h3 {
    margin-top: 2.5em;
    margin-bottom: 1em;
    font-weight: 300;
    color: #fff;
}

#letter-content h1 {
    font-weight: bold;
}

#letter-content hr {
    display: none;
}

#letter-content p {
    margin-bottom: 1.5em;
}

#letter-content em {
    font-style: italic;
    color: #ccc;
}

#letter-content strong {
    font-weight: 700;
    color: #fff;
}

#letter-content a {
    color: #bbb;
    text-decoration: none;
    border-bottom: 1px dashed #555;
    transition: color 0.2s, border-bottom-color 0.2s;
}

#letter-content a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

#letter-content blockquote {
    border-left: 3px solid #333;
    padding-left: 1.5em;
    margin-left: 0;
    margin-top: 2em;
    margin-bottom: 2em;
    font-style: italic;
    color: #aaa;
}