@view-transition {
    navigation: auto;
}

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

/* Theme Variables */
:root {
    color-scheme: light dark;
}

/* Light Theme */
@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #fbf1c7;
        --bg-secondary: #ebdbb2;

        --text-primary: #3c3836;
        --text-secondary: #504945;
        --text-tertiary: #7c6f64;

        --border-color: #d5c4a1;

        --link-color: #458588;
        --link-hover: #076678;

        --accent: #929e3f;

        --kbd-bg: #f3f3f3;
        --kbd-fg: #222;
        --kbd-border: #ddd;
    }
}

/* Dark Theme */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #282828;
        --bg-secondary: #3c3836;

        --text-primary: #ebdbb2;
        --text-secondary: #d5c4a1;
        --text-tertiary: #928374;

        --border-color: #504945;

        --link-color: #83a598;
        --link-hover: #8ec07c;

        --accent: #fabd32;

        --kbd-bg: #2a2a2a;
        --kbd-fg: #eaeaea;
        --kbd-border: #3a3a3a;
    }
}

/* Explicit light override */
[data-theme="light"] {
    --bg-primary: #fbf1c7;
    --bg-secondary: #ebdbb2;

    --text-primary: #3c3836;
    --text-secondary: #504945;
    --text-tertiary: #7c6f64;

    --border-color: #d5c4a1;

    --link-color: #458588;
    --link-hover: #076678;

    --accent: #929e3f;

    --kbd-bg: #f3f3f3;
    --kbd-fg: #222;
    --kbd-border: #ddd;
}

/* Explicit dark override */
[data-theme="dark"] {
    --bg-primary: #282828;
    --bg-secondary: #3c3836;

    --text-primary: #ebdbb2;
    --text-secondary: #d5c4a1;
    --text-tertiary: #928374;

    --border-color: #504945;

    --link-color: #83a598;
    --link-hover: #8ec07c;

    --accent: #fabd32;

    --kbd-bg: #2a2a2a;
    --kbd-fg: #eaeaea;
    --kbd-border: #3a3a3a;
}

/* Accents */
::selection {
    background: var(--accent);
    color: #282828;
}

.theme-toggle:hover {
    color: var(--link-color);
}

.project {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px dashed var(--border-color); /* You can change 'dashed' to 'solid' if you prefer a straight line */
}

.project:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.project-meta {
    color: var(--text-tertiary);
}

.status-active {
    color: #98971a;
}

.status-development {
    color: #d79921;
}

/* --- Image Lightbox Styles --- */
.image-modal {
    border: none;
    background: transparent;
    margin: auto;
    max-width: 100vw;
    max-height: 100vh;
    padding: 0;
    overflow: visible;
}

/* The dark overlay behind the image */
.image-modal::backdrop {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px); /* Adds a nice frosted glass effect */
}

.image-modal img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: block;
}

.close-btn {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s;
}

.close-btn:hover {
    transform: scale(1.1);
}


/* UI Style */
body {
    font-family: 'Source Serif 4', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

nav {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    transition: border-color 0.3s ease;
}

nav .nav-content {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

nav a:hover,
nav a.active {
    color: var(--accent);
}

figure {
    img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        cursor: zoom-in;
    }

    figcaption {
        text-align: center;
        font-size: 0.9rem;
        color: var(--text-tertiary);
        margin-top: 0.5rem;
    }
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--text-primary);
}

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    view-transition-name: page-title;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 3rem 0 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1rem;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.hidden {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    background-color: var(--kbd-bg, #f3f3f3);
    color: var(--kbd-fg, #222);
    border: 1px solid var(--kbd-border, #ddd);
    white-space: nowrap;
}

pre {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

footer {
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

@media (max-width: 768px) {
    nav {
        padding: 1rem;
    }

    nav ul {
        gap: 1.5rem;
    }

    .container {
        padding: 2rem 1.5rem;
    }

    h1 {
        font-size: 2.5rem;
    }
}