/* --- FONT DEFINITIONS --- */
/* A more robust way than relying on local fonts is to serve them directly. */
/* This assumes the font files are in ../fonts/inter/ */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter/InterVariable.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: normal;
}

@font-face {
    font-family: 'Geist Mono';
    src: url('../fonts/geist-mono/GeistMonoVariable.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
}

/* --- CSS VARIABLES --- */
:root {
    --bg-color: #f4f2ea;
    --text-color: #1a1a1a;
    --text-secondary-color: #5c5c5c;
    --grid-color: #dcdcdc00;
    --accent-color: #000000;
}

/* --- RESET & BASE STYLES --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Selection background and font color */
::selection {
  background: black;
  color: white;
}

html {
    font-size: 100%; /* Corresponds to 16px */
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    letter-spacing: 0px; /* for monospace -0.4px */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 7rem; /* Make space for fixed header */

    /* Architect-style grid background 
    background-image:
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 2rem 2rem;
    */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', 'Geist Mono', monospace;
    font-weight: 500;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

/* --- LAYOUT UTILITIES --- */
.container {
    width: 100%;
    max-width: 900px; /* Max width for content for readability */
    margin-left: auto;
    margin-right: auto;
}

.main-content {
    flex-grow: 1;
    padding: 4vw;
    display: flex;
    flex-direction: column;
}

/* --- HEADER --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(244, 242, 234, 0.66);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-align: center;
    padding: 1.5rem 4vw;
    animation: slideDown 1.2s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    border-bottom: 1px solid #ebe8df;
}

.site-title {
    font-size: 1.25rem;
    letter-spacing: 0.2px;
    font-family: 'Geist Mono', monospace;
}

.site-subtitle {
    font-size: .75rem;
    color: var(--text-secondary-color);
    margin-top: 0.125rem;
    font-family: 'Geist Mono', monospace;
}
.language-switcher {
    margin-top: 1rem;
    font-family: 'Geist Mono', monospace;
    font-size: 0.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    max-height: 5em;
    opacity: 1;
    /* Defines the container's transition when scrolling UP (scrolled class is removed) */
    /* The container expands first, then the links appear */
    transition: max-height 0.3s ease-in-out 0.2s, margin-top 0.3s ease-in-out 0.2s, opacity 0.3s ease-in-out 0.2s;
}

.language-switcher a {
    color: var(--text-secondary-color);
    text-decoration: none;
    padding: 0.2rem 0.4rem;
    margin: 0 0.1rem;
    white-space: nowrap;
    display: inline-block;
    max-width: 100px;
    opacity: 1;
    /* Defines the links' transition when scrolling UP */
    /* The links expand AFTER the container is visible (delay of 0.4s) */
    transition: max-width 0.3s ease-in-out 0.4s, opacity 0.3s ease-in-out 0.4s, padding 0.3s ease-in-out 0.4s, margin 0.3s ease-in-out 0.4s;
}


.language-switcher a:hover {
    color: var(--text-color);
}

.language-switcher a.active {
    font-weight: 600;
    color: var(--text-color);
    pointer-events: none;
    background-color: #e0ded7;
}

/* --- SCROLLED STATE ANIMATIONS (for scrolling DOWN) --- */

/* 1. Collapse links first */
.site-header.scrolled .language-switcher a:not(.active) {
    max-width: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    /* Animate links immediately */
    transition: max-width 0.2s ease-in-out, opacity 0.2s ease-in-out, padding 0.2s ease-in-out, margin 0.2s ease-in-out;
}

/* 2. Then, after a delay, collapse the container */
.site-header.scrolled .language-switcher {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    pointer-events: none;
    /* Delay this animation until after the links have collapsed */
    transition-delay: 0.2s;
}

/* --- FOOTER --- */
.site-footer {
    text-align: center;
    padding: 2rem 4vw;
    font-size: 0.8rem;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-family: 'Geist Mono', monospace;
}

.footer-nav a {
    color: var(--text-secondary-color);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 5px;
    text-decoration-thickness: 1px;
    text-decoration-style: dashed;
    transition: text-underline-offset 0.2s ease-out, color 0.2s ease-out, text-decoration-color 0.2s ease-out;
}

.footer-nav a:hover {
    color: var(--text-secondary-color);
    text-decoration-color: var(--text-secondary-color);
    text-underline-offset: 3px;
}

/* --- LANDING PAGE: PROJECT LIST --- */
.page-landingpage {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    text-align: left;
}

.project-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
}

.project-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Delay für jedes Projekt-Item */
.project-item:nth-child(1) { animation-delay: 1.0s; }
.project-item:nth-child(2) { animation-delay: 1.2s; }
.project-item:nth-child(3) { animation-delay: 1.4s; }
.project-item:nth-child(4) { animation-delay: 1.6s; }
.project-item:nth-child(5) { animation-delay: 1.8s; }
.project-item:nth-child(6) { animation-delay: 2.0s; }
.project-item:nth-child(7) { animation-delay: 2.2s; }
.project-item:nth-child(8) { animation-delay: 2.4s; }
.project-item:nth-child(9) { animation-delay: 2.6s; }
.project-item:nth-child(10) { animation-delay: 2.8s; }


.project-item a {
    display: block;
    text-decoration: none;
    color: var(--text-color); /* Setzt eine explizite Startfarbe */
    outline: none;
}

.project-item:not(.disabled) a:hover {
     text-decoration: none;
     color: var(--text-color);
}

.project-content {
    padding: 1.5rem;
    border: 1px solid transparent; /* Start-Rahmen bleibt transparent */
    transition: background-color 0.2s ease-out, border-color 0.2s ease-out;
}

.project-item:not(.disabled) a:hover .project-content {
    background-color: #ebe9e2;
}

.project-item-header {
    display: flex;
    flex-direction: row;
    align-items: start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.project-title {
    text-transform: uppercase;
    font-family: 'Geist Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    transition: color 0.3s ease;
    line-height: 1.35;
}

.project-item:not(.disabled) .project-title {
    position: relative;
    left: 30px;
}

.project-item:not(.disabled) .project-title::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: #28a745;
    border-radius: 50%;
    filter: blur(1px);
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.6);

}

.project-item:not(.disabled) .project-title::after {
    content: '';
    position: absolute;
    left: -24px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-color: #28a745;
    border-radius: 50%;
    filter: blur(4px);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 0.55;
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}


.project-item:not(.disabled) a:hover .project-title {
    color: var(--accent-color);
}

.project-domain {
    font-family: 'Geist Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary-color);
}

.project-description {
    font-size: 1rem;
    margin-top: 0.5rem;
    color: var(--text-secondary-color);
}

.project-item.disabled a {
    cursor: not-allowed;
    pointer-events: none;
}

.project-item.disabled .project-title,
.project-item.disabled .project-description,
.project-item.disabled .project-domain,
.project-item.disabled .project-status-label {
    opacity: 0.5;
}

.project-status-label {
    background-color: #28a746d5;
    color: white;
    font-family: 'Geist Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.9px;
    padding: 0.2rem 0.6rem;
    border-radius: 0px;
    text-transform: uppercase;
    white-space: nowrap;
}


/* --- PRIVACY PAGE --- */
.page-privacy .container {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.page-privacy h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.page-privacy h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--grid-color);
    padding-bottom: 0.5rem;
}

.page-privacy p {
    margin-bottom: 1rem;
}

/* --- ERROR PAGE --- */
.page-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-grow: 1;
}

.page-error h1 {
    font-size: 2.5rem;
}

.page-error p {
    font-size: 1.25rem;
    color: var(--text-secondary-color);
    margin-top: 0.5rem;
}


/* --- KEYFRAME ANIMATIONS --- */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 600px) {
    html {
        font-size: 93.75%; /* 15px base */
    }
/* for when only fixed on mobile
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(244, 242, 234, 0.66);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: 1rem 4vw;
    }
*/

    .site-header {
        padding: 1rem 4vw;
    }

    body {
        padding-top: 8rem; /* Make space for fixed header */
        background-size: 1.5rem 1.5rem;
    }
}