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

:root {
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'Syne', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: var(--font-body);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Full-page simulation background */
.simulation-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: #faf6f0;
}

.simulation-bg canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Simulation Controls - Top Right */
#controls-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
}

/* Tweakpane Global Customization */
.tp-dfwv {
    --tp-base-background-color: hsla(220, 30%, 8%, 0.92) !important;
    --tp-base-shadow-color: hsla(0, 0%, 0%, 0.4) !important;
    --tp-button-background-color: hsla(220, 20%, 18%, 1) !important;
    --tp-button-background-color-active: hsla(220, 20%, 25%, 1) !important;
    --tp-button-background-color-focus: hsla(220, 20%, 22%, 1) !important;
    --tp-button-background-color-hover: hsla(220, 20%, 25%, 1) !important;
    --tp-button-foreground-color: hsla(40, 30%, 85%, 1) !important;
    --tp-container-background-color: hsla(220, 25%, 12%, 1) !important;
    --tp-container-background-color-active: hsla(220, 25%, 15%, 1) !important;
    --tp-container-background-color-focus: hsla(220, 25%, 13%, 1) !important;
    --tp-container-background-color-hover: hsla(220, 25%, 15%, 1) !important;
    --tp-container-foreground-color: hsla(40, 20%, 70%, 1) !important;
    --tp-groove-foreground-color: hsla(40, 30%, 75%, 0.2) !important;
    --tp-input-background-color: hsla(220, 25%, 15%, 1) !important;
    --tp-input-background-color-active: hsla(220, 25%, 18%, 1) !important;
    --tp-input-background-color-focus: hsla(220, 25%, 16%, 1) !important;
    --tp-input-background-color-hover: hsla(220, 25%, 18%, 1) !important;
    --tp-input-foreground-color: hsla(40, 30%, 90%, 1) !important;
    --tp-label-foreground-color: hsla(40, 20%, 65%, 1) !important;
    --tp-monitor-background-color: hsla(220, 25%, 12%, 1) !important;
    --tp-monitor-foreground-color: hsla(40, 20%, 70%, 1) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* Make folder titles more prominent */
.tp-dfwv .tp-fldv_t {
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
}

/* Custom blade styling for text content */
.tp-lblv_l {
    font-size: 11px !important;
    opacity: 0.7 !important;
}

.tp-lblv_v {
    font-size: 12px !important;
}

/* Link buttons styling */
.tp-btnv_b {
    font-weight: 500 !important;
    letter-spacing: 0.02em !important;
    transition: all 0.2s ease !important;
}

.tp-btnv_b:hover {
    transform: translateY(-1px) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    #controls-container {
        top: 12px;
        right: 12px;
        transform: scale(0.85);
        transform-origin: top right;
    }
    
    /* Make Tweakpane collapsed by default on mobile */
    .tp-dfwv {
        max-width: 200px !important;
    }
}

@media (max-width: 480px) {
    #controls-container {
        top: 8px;
        right: 8px;
        transform: scale(0.8);
    }
}

/* Selection styling */
::selection {
    background: #e8d5b7;
    color: #0a0f1c;
}
