/* Custom Typography & Base Styles */
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    line-height: 1.6;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Timeline Vertical Line */
.timeline-container::before {
    content: '';
    position: absolute;
    left: 31px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

/* The Tile Card Design */
.tile-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tile-card:hover {
    border-color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 4px 4px 0px #0f172a;
}

.tile-card.active {
    border-color: #3b82f6;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.1);
}

/* Fixed: Smooth Height Animation logic */
.content-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease-out;
    overflow: hidden;
}

/* When JS adds the .active class, this triggers the expansion */
.tile-card.active .content-wrapper {
    grid-template-rows: 1fr;
}

/* Inner container to ensure grid calculates height correctly */
.content-wrapper > div {
    min-height: 0;
}

.chevron {
    transition: transform 0.3s ease;
    color: #94a3b8;
}

.tile-card.active .chevron {
    transform: rotate(180deg);
    color: #3b82f6;
}

/* PIXEL ART VIEWPORT & PANNING */
.viewport {
    position: relative;
    width: 100%;
    height: 320px;
    background-color: #ffffff;
    overflow: hidden; 
    border-radius: 0.5rem;
    touch-action: none;
}

.pixel-art {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    image-rendering: -moz-crisp-edges;
    display: block;
    width: auto !important;
    height: auto !important;
    user-select: none;
    -webkit-user-drag: none;
    position: absolute;
    top: 50%;
    left: 50%;
}

.cursor-grab { cursor: grab; }
.cursor-grabbing { cursor: grabbing; }

/* UI Controls for Viewport */
.zoom-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.viewport:hover .zoom-controls {
    opacity: 1;
}

.control-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid #e2e8f0;
    padding: 6px;
    border-radius: 6px;
    color: #475569;
    transition: all 0.2s;
    cursor: pointer;
}

.control-btn:hover {
    background: white;
    color: #3b82f6;
    border-color: #3b82f6;
}

.bg-checkerboard {
    background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%), 
                      linear-gradient(-45deg, #f1f5f9 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #f1f5f9 75%), 
                      linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #ffffff;
}