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

:root {
    --terracotta: #c4622d;
    --leather: #8a4a28;
    --parchment: #f2dcc2;
    --ink: #1a1209;
    --rust: #a04a20;
    --aged-paper: #e8d4b8;
}

body {
    font-family: 'Libre Baskerville', serif;
    background-color: var(--parchment);
    color: var(--ink);
    line-height: 1.8;
    overflow-x: hidden;
}

/* Sidebar */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(138, 74, 40, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(164, 74, 32, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(138, 74, 40, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 30% 70%, rgba(26, 18, 9, 0.05) 0%, transparent 30%),
        linear-gradient(180deg, #5c3318 0%, #4a2812 50%, #3d200e 100%);
    border-right: 3px solid var(--leather);
}

.sidebar-header {
    margin-bottom: 3rem;
}

.site-title {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 1.6rem;
    color: var(--parchment);
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.quest-word {
    font-weight: 700;
    color: var(--terracotta);
    font-size: 2rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.tab {
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    padding: 0.75rem 1rem;
    text-align: left;
    font-family: 'Anonymous Pro', monospace;
    font-size: 0.9rem;
    color: var(--aged-paper);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab:hover {
    color: var(--parchment);
    border-left-color: var(--terracotta);
    background: rgba(196, 98, 45, 0.1);
}

.tab.active {
    color: var(--parchment);
    border-left-color: var(--terracotta);
    background: rgba(196, 98, 45, 0.15);
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(242, 220, 194, 0.2);
}

.sidebar-note,
.sidebar-date {
    font-family: 'Anonymous Pro', monospace;
    font-size: 0.75rem;
    color: rgba(242, 220, 194, 0.6);
}

/* Main Content */
#content {
    margin-left: 260px;
    padding: 3rem 4rem;
    max-width: 900px;
}

.deco-border {
    height: 4px;
    margin-bottom: 3rem;
    background: repeating-linear-gradient(
        90deg,
        var(--terracotta) 0px,
        var(--terracotta) 20px,
        transparent 20px,
        transparent 25px,
        var(--rust) 25px,
        var(--rust) 30px,
        transparent 30px,
        transparent 35px
    );
}

.content-section {
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.content-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.content-section h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--leather);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--terracotta);
}

.content-section p {
    margin-bottom: 1.2rem;
    font-size: 1rem;
}

blockquote {
    border-left: 4px solid var(--terracotta);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    background: var(--aged-paper);
    font-style: italic;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--leather);
}

/* Finding Cards */
.finding-card {
    background: var(--aged-paper);
    border: 1px solid rgba(138, 74, 40, 0.3);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    border-radius: 2px;
    transition: border-color 0.3s ease;
}

.finding-card:hover {
    border-color: var(--terracotta);
}

.finding-card h3 {
    font-family: 'Anonymous Pro', monospace;
    font-size: 0.95rem;
    color: var(--terracotta);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Archive Grid */
.archive-grid {
    margin-top: 1.5rem;
}

.archive-item {
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(138, 74, 40, 0.2);
    font-family: 'Anonymous Pro', monospace;
    font-size: 0.85rem;
    align-items: center;
}

.archive-id {
    color: var(--terracotta);
    font-weight: 700;
}

.archive-title {
    color: var(--ink);
}

.archive-date {
    color: var(--leather);
    text-align: right;
}

/* Terminal */
.terminal-block {
    background: #1a1209;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1.5rem;
}

.terminal-header {
    background: #2a1e10;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--terracotta);
    opacity: 0.7;
}

.terminal-dot:first-child {
    background: var(--rust);
}

.terminal-dot:nth-child(2) {
    background: var(--terracotta);
}

.terminal-dot:nth-child(3) {
    background: var(--leather);
}

.terminal-title {
    font-family: 'Anonymous Pro', monospace;
    font-size: 0.75rem;
    color: rgba(242, 220, 194, 0.5);
    margin-left: auto;
}

.terminal-body {
    padding: 1.5rem;
    font-family: 'Anonymous Pro', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
}

.terminal-line {
    color: var(--parchment);
    margin-bottom: 0.3rem;
}

.terminal-line .prompt {
    color: var(--terracotta);
    margin-right: 0.5rem;
}

.terminal-line.output {
    color: var(--aged-paper);
    opacity: 0.8;
    padding-left: 1.5rem;
}

.terminal-line.blink {
    animation: blink 1.2s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Footer */
.site-footer {
    padding-top: 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.site-footer.visible {
    opacity: 1;
    transform: translateY(0);
}

.site-footer p {
    font-family: 'Anonymous Pro', monospace;
    font-size: 0.8rem;
    color: var(--leather);
    margin-top: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    #content {
        margin-left: 0;
        padding: 2rem 1.5rem;
    }

    .archive-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}
