/* miris.day - evolved-minimal game dev journal
   Fonts: Caveat (display), Inter (body), JetBrains Mono (code), Space Grotesk (accents)
   Palette: #2A3A4A deep-slate, #4A5A6A medium-slate, #6A8AAA ocean-blue,
            #A0D8C8 mint, #E8A0B0 rose, #F0F4F8 cloud, #FAFBFC snow */

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Properties */
:root {
    --deep-slate: #2A3A4A;
    --medium-slate: #4A5A6A;
    --ocean-blue: #6A8AAA;
    --mint: #A0D8C8;
    --rose: #E8A0B0;
    --cloud: #F0F4F8;
    --snow: #FAFBFC;
    --sidebar-width: 220px;
}

/* Base */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--medium-slate);
    background-color: var(--snow);
    line-height: 1.8;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--cloud);
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.25rem;
    z-index: 10;
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    border-right: 1px solid rgba(106, 138, 170, 0.1);
}

.sidebar.visible {
    transform: translateX(0);
}

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

.site-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    color: var(--deep-slate);
    line-height: 1.1;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    transition-delay: 0.3s;
}

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

.site-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--ocean-blue);
    letter-spacing: 0.1em;
    margin-top: 0.35rem;
    opacity: 0;
    transition: opacity 0.6s ease;
    transition-delay: 0.6s;
}

.site-subtitle.visible {
    opacity: 1;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
}

.nav-item {
    padding: 0.6rem 0;
    cursor: pointer;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.nav-item.revealed {
    opacity: 1;
    transform: translateX(0);
}

.nav-item:hover {
    border-left-color: var(--mint);
    background-color: rgba(160, 216, 200, 0.08);
}

.nav-item.active {
    border-left-color: var(--rose);
}

.nav-date {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--ocean-blue);
    letter-spacing: 0.05em;
}

.nav-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--deep-slate);
    margin-top: 0.1rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(106, 138, 170, 0.1);
    display: flex;
    justify-content: center;
}

.geometric-deco {
    opacity: 0.7;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 20;
    background: var(--snow);
    border: 1px solid rgba(106, 138, 170, 0.15);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    cursor: pointer;
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(42, 58, 74, 0.06);
}

.mobile-toggle:hover {
    box-shadow: 0 2px 12px rgba(42, 58, 74, 0.12);
}

/* Main Content */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 3rem 4rem;
    max-width: calc(100% - var(--sidebar-width));
}

.content-inner {
    max-width: 720px;
    margin: 0 auto;
}

/* Section Dividers - geometric shapes between entries */
.section-divider {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.section-divider.visible {
    opacity: 1;
}

/* Journal Entries */
.journal-entry {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.journal-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

.entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.entry-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--ocean-blue);
    letter-spacing: 0.08em;
}

.entry-deco {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.entry-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    color: var(--deep-slate);
    line-height: 1.2;
    margin-bottom: 1.25rem;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
}

.entry-title:hover {
    color: var(--ocean-blue);
}

.entry-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: var(--mint);
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.entry-title:hover::after {
    width: 40px;
}

/* Entry Body - Progressive Disclosure */
.entry-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}

.entry-body.expanded {
    max-height: 3000px;
    opacity: 1;
}

.entry-body p {
    margin-bottom: 1.25rem;
    font-weight: 300;
}

/* Entry Sketches */
.entry-sketch {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background-color: var(--snow);
    border: 1px solid rgba(106, 138, 170, 0.1);
    border-radius: 6px;
    transition: border-color 0.3s ease;
}

.entry-sketch:hover {
    border-color: rgba(106, 138, 170, 0.2);
}

.sketch-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Code Blocks */
.code-block {
    margin: 1.5rem 0;
    background-color: var(--cloud);
    border-radius: 6px;
    padding: 1.25rem;
    overflow-x: auto;
    border-left: 3px solid var(--mint);
    transition: border-left-color 0.3s ease;
}

.code-block:hover {
    border-left-color: var(--ocean-blue);
}

.code-block pre {
    margin: 0;
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--ocean-blue);
    line-height: 1.7;
    white-space: pre;
}

/* Entry List */
.entry-list {
    margin: 1rem 0 1.25rem 1.5rem;
    font-weight: 300;
}

.entry-list li {
    margin-bottom: 0.4rem;
    padding-left: 0.25rem;
}

.entry-list li::marker {
    color: var(--mint);
}

/* Content Footer */
.content-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(106, 138, 170, 0.08);
    text-align: center;
}

.footer-deco {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.footer-text {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--ocean-blue);
    letter-spacing: 0.12em;
    text-transform: lowercase;
}

/* Responsive */
@media (max-width: 900px) {
    .content {
        padding: 2.5rem 2.5rem;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 200px;
    }

    .content {
        padding: 2rem 1.5rem;
    }

    .sidebar {
        width: var(--sidebar-width);
    }
}

@media (max-width: 560px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        width: 240px;
        transform: translateX(-100%);
        box-shadow: 2px 0 20px rgba(42, 58, 74, 0.1);
    }

    .sidebar.visible {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        max-width: 100%;
        padding: 4rem 1.25rem 2rem;
    }

    .mobile-toggle {
        display: block;
    }
}

/* Selection */
::selection {
    background-color: rgba(160, 216, 200, 0.3);
    color: var(--deep-slate);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(106, 138, 170, 0.2);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(106, 138, 170, 0.4);
}
