* {
    box-sizing: border-box;
}

/* Theme colors (DARKER GREEN - subtle tweak) */
:root {
    --page-bg: #f6f9f7;
    --panel-bg: #ffffff;
    --soft-bg: #f1f8f4;
    --text: #1d1f1e;
    --muted: #4b635d;
    --light-muted: #6e806b;
    --border: #dbe7df;
    --border-soft: #e8f2ec;

    /* slightly darker green accent */
    --accent: #1f9d55;
    --accent-hover: #15803d;

    --dark-chip: #0f3d23;
    --shadow: 0 16px 40px rgba(31, 157, 85, 0.08);
}

body.dark-mode {
    --page-bg: #0f1411;
    --panel-bg: #151c17;
    --soft-bg: #1b241d;
    --text: #f3f4f6;
    --muted: #c1d6c7;
    --light-muted: #9bb5a3;
    --border: #243428;
    --border-soft: #2c3d31;

    /* darker + more muted green */
    --accent: #22c55e;
    --accent-hover: #16a34a;

    --dark-chip: #14532d;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

/* Base */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--page-bg);
    transition: background 180ms ease, color 180ms ease;
}

a {
    color: inherit;
    text-decoration: none;
}

section {
    scroll-margin-top: 96px;
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--panel-bg) 92%, transparent);
    backdrop-filter: blur(14px);
}

.header-content {
    position: relative;
    min-height: 72px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
}

nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--muted);
    font-size: 15px;
}

.header-actions {
    display: flex;
    justify-content: flex-end;
}

.theme-toggle {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--soft-bg);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

/* Home */
nav a:hover,
.member-list a:hover,
.github-button:hover,
.project-card:hover h3,
.org-link:hover {
    color: var(--text);
}

.page-layout {
    min-height: calc(100vh - 142px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 36px;
    align-items: center;
    padding: 64px 0;
}

.intro {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 18px;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.08;
    letter-spacing: 0;
}

.intro-text {
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 34px;
    color: var(--muted);
    font-size: 19px;
    line-height: 1.6;
}

.join-box {
    max-width: 430px;
    margin: 0 auto;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.join-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.join-box h2,
.members h2 {
    margin-bottom: 10px;
    font-size: 24px;
}

.join-box p {
    margin-bottom: 22px;
    color: var(--muted);
    line-height: 1.5;
}

.discord-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 6px;
    background: var(--accent);
    color: #ffffff;
    font-weight: 700;
}

.discord-button:hover {
    background: var(--accent-hover);
}

.github-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel-bg);
    color: var(--muted);
    font-weight: 700;
}

/* Team members */
.members {
    align-self: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.members-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 10px;
}

.member-count {
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 14%, var(--panel-bg));
    color: var(--accent);
    font-weight: 800;
}

.members-note {
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.member-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 330px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.member-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 10px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--soft-bg);
}

.member-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--dark-chip);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
}

.member-info {
    min-width: 0;
    flex: 1;
}

.member-name {
    display: block;
    font-weight: 800;
}

.member-role {
    display: block;
    margin-top: 3px;
    color: var(--light-muted);
    font-size: 13px;
}

.member-list a {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.member-toggle {
    width: 100%;
    min-height: 40px;
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--soft-bg);
    color: var(--accent);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.member-toggle:hover {
    border-color: var(--accent);
}

.org-link {
    margin-top: 18px;
    color: var(--accent);
    font-weight: 700;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    background: var(--panel-bg);
}

footer p {
    margin: 0;
    padding: 22px 0;
    color: var(--light-muted);
    font-size: 14px;
}

/* Sections */
.section-block {
    padding: 76px 0;
    border-top: 1px solid var(--border);
    background: var(--panel-bg);
}

.contact-block {
    background: var(--page-bg);
}

.projects-block {
    background: var(--panel-bg);
}

.impressum-block {
    padding: 26px 0;
    border-top: 1px solid var(--border);
    background: var(--panel-bg);
}

.section-content {
    max-width: 760px;
}

.section-content h2 {
    margin-bottom: 16px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.15;
}

.section-content p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.contact-card {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 26px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.contact-label {
    color: var(--light-muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.contact-card a {
    color: var(--accent);
    font-weight: 800;
}

/* Projects */
.projects-heading {
    margin-bottom: 28px;
}

.projects-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.projects-message {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--light-muted);
}

.project-card {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--soft-bg);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    box-shadow: var(--shadow);
}

.project-card h3 {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 20px;
    line-height: 1.2;
}

.project-card p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
}

.project-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    color: var(--light-muted);
    font-size: 13px;
}

.project-language {
    color: var(--text);
    font-weight: 700;
}

/* Impressum */
.impressum-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.impressum-details p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.impressum-details strong {
    color: var(--text);
}

.impressum-details a {
    color: var(--accent);
    font-weight: 700;
}

.impressum-links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 820px) {
    .header-content {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 10px;
        padding: 14px 0;
    }

    .page-layout {
        grid-template-columns: 1fr;
        align-items: start;
        padding: 42px 0;
    }

    .intro,
    .join-box {
        max-width: none;
    }

    .members {
        align-self: auto;
    }

    .projects-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .impressum-details {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }
}

@media (max-width: 520px) {
    .container {
        width: min(100% - 28px, 1120px);
    }

    .header-content {
        min-height: 64px;
        gap: 8px;
    }

    .header-actions {
        justify-content: center;
    }

    nav {
        gap: 14px;
        flex-wrap: wrap;
    }

    h1 {
        font-size: 38px;
    }

    .intro-text {
        font-size: 17px;
    }

    .join-box,
    .members {
        padding: 20px;
    }

    .member-list li {
        align-items: flex-start;
    }

    .projects-list {
        grid-template-columns: 1fr;
    }

    .contact-card {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
    }
}
