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

:root {
    --metro-accent: #e51a24;
    --metro-accent-hover: #ff2a35;
    --bg-dark: #e51a24;
    --bg-light: #ffffff;
    --text-light: #ffffff;
    --text-dark: #111111;
    --text-muted: #666666;
    --font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow: hidden;
    height: 100vh;
}

.metro-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 320px;
    background-color: var(--bg-dark);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    padding: 40px 0 20px 0;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    margin-bottom: 40px;
}

.sidebar-brand {
    font-size: 26px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.search-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item {
    color: var(--text-light);
    text-decoration: none;
    padding: 12px 30px;
    font-size: 15px;
    font-weight: 400;
    transition: background 0.15s ease;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background-color: var(--bg-light);
    color: var(--metro-accent);
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px 30px 0 30px;
}

.footer-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    opacity: 0.7;
}

.footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.content-pane {
    flex-grow: 1;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.portfolio-header {
    margin-bottom: 35px;
    max-width: 700px;
}

.portfolio-title {
    font-size: 32px;
    font-weight: 300;
    color: var(--metro-accent);
    line-height: 1.2;
}

.portfolio-subtitle {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-top: 5px;
    margin-bottom: 15px;
    font-weight: 600;
}

.portfolio-bio {
    font-size: 15px;
    line-height: 1.6;
    color: #444444;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(4, 170px);
    grid-auto-rows: 170px;
    gap: 15px;
    margin-bottom: 40px;
}

.tile {
    position: relative;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.1s ease, border-color 0.2s ease;
}

.tile:hover {
    border-color: rgba(0, 0, 0, 0.15);
    transform: scale(0.99);
}

.tile-large {
    grid-column: span 4;
    grid-row: span 2;
}

.tile-small {
    grid-column: span 2;
    grid-row: span 1;
}

.tile-text-only {
    background-color: #f7f7f7;
    border-left: 4px solid var(--metro-accent);
}

.tile-text-container {
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.tile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    padding: 15px;
}

.project-category {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.project-title {
    color: var(--text-light);
    font-size: 15px;
    font-weight: 400;
}

.project-title-dark {
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 600;
}

.project-desc {
    color: #555555;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 5px;
}

.project-tags {
    color: var(--metro-accent);
    font-size: 11px;
    font-family: monospace;
    font-weight: 600;
}

/* --- Content Footer --- */
.content-footer {
    margin-top: auto;
}

.action-link {
    color: var(--metro-accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.action-link:hover {
    color: var(--metro-accent-hover);
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .tile-grid {
        grid-template-columns: repeat(2, 170px);
    }
    .tile-large {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .metro-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        padding: 20px 0;
    }
    .sidebar-header {
        margin-bottom: 15px;
    }
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    .nav-item {
        white-space: nowrap;
        padding: 8px 20px;
    }
    .sidebar-footer {
        display: none;
    }
    .content-pane {
        padding: 30px 20px;
    }
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    padding: 0 20px;
}

.back-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--text-light);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
    flex-shrink: 0;
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.back-btn:active {
    transform: scale(0.9);
}

.back-arrow {
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    margin-top: -2px;
}

.detail-header .search-btn {
    margin-left: auto;
}

.detail-header ~ .sidebar-nav .nav-item.active {
    background-color: rgba(0, 0, 0, 0.12); 
    color: var(--text-light);              
    font-weight: 400;                      
}