:root {
    /* Colors */
    --color-bg: #ffffff;
    --color-bg-card: #f7f7f7;
    --color-text-primary: #000000;
    --color-text-secondary: #767676; /* Accessible grey */
    --color-accent: #000000;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 48px;

    /* Layout */
    --sidebar-width: 320px;
    --border-radius: 12px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-base: 20px;
    --line-height-base: 1.5;
}

[data-theme="dark"] {
    --color-bg: #111111;
    --color-bg-card: #1a1a1a;
    --color-text-primary: #ffffff;
    --color-text-secondary: #a0a0a0;
    --color-accent: #ffffff;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

/* Layout Grid */
.layout-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    padding: var(--spacing-xl);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    background-color: var(--color-bg);
    z-index: 100;
}

.content-area {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: var(--spacing-xl);
    box-sizing: border-box;
    max-width: 1600px;
}

/* Responsive */
@media (max-width: 900px) {
    .layout-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: var(--spacing-md);
        flex-direction: row;
        align-items: center;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }
    .nav-menu {
        display: none; /* Mobile menu needed if generic, but for now specific */
    }
    .nav-extras {
        display: flex;
        align-items: center;
        gap: var(--spacing-md);
    }
    .content-area {
        margin-left: 0;
        padding: var(--spacing-md);
    }
}

/* Components */
.nav-header {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.logo {
    margin-bottom: var(--spacing-xl);
    font-size: 1.2rem;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.nav-link {
    display: block;
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 4px 0;
}

.nav-link:hover {
    opacity: 0.7;
}

.nav-extras {
    margin-top: auto;
}

/* Theme Toggle (Light Switch Style) */
.theme-toggle {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 50px;
    height: 28px;
    position: relative;
    display: block;
}

.toggle-track {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
    border-radius: 30px;
    transition: background-color 0.3s ease;
    position: relative;
    border: 1px solid rgba(0,0,0,0.1);
}

[data-theme="dark"] .toggle-track {
    background-color: #333;
    border-color: rgba(255,255,255,0.1);
}

.toggle-thumb {
    display: block;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

[data-theme="dark"] .toggle-thumb {
    transform: translateX(22px);
    background-color: #000;
    box-shadow: 0 2px 4px rgba(255,255,255,0.2);
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 40px; /* Generous spacing */
}

.project-card {
    background-color: var(--color-bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

[data-theme="dark"] .project-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.card-image {
    width: 100%;
}

.project-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 4/3;
}

.card-image-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, rgba(0,0,0,0.05), rgba(0,0,0,0.02));
}

[data-theme="dark"] .card-image-placeholder {
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
}

.project-info {
    padding: var(--spacing-lg);
}

.project-title {
    font-weight: 500;
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xs);
}

.project-meta {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: var(--spacing-lg);
    line-height: 1.2;
}

h2 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: var(--spacing-md);
}

p {
    margin-bottom: var(--spacing-md);
    max-width: 800px;
}

/* Project Detail */
.project-detail {
    max-width: 1200px;
}

.project-header {
    margin-bottom: 60px;
}

.project-media {
    display: grid;
    gap: 40px;
    margin-top: 60px;
}

.media-block img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    display: block;
}

.embed-block {
    margin-top: 60px;
    background: var(--color-bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* Clock */
.clock {
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}
