:root {
    --bg-color: #050816;
    --bg-elevated: rgba(15, 23, 42, 0.9);
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.2);
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --border-soft: rgba(148, 163, 184, 0.3);
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.8);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, #0f172a 0, transparent 50%),
        radial-gradient(circle at bottom right, #0f172a 0, transparent 50%),
        radial-gradient(circle at top right, #1e293b 0, transparent 55%),
        var(--bg-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(18px);
    background: linear-gradient(to bottom, rgba(5, 8, 22, 0.95), rgba(5, 8, 22, 0.7));
    border-bottom: 1px solid var(--border-soft);
}

.site-header .container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.2rem 1.5rem;
}

.branding {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.header-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.site-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
    padding: 0;
    margin: 0.4rem 0 0;
    flex-wrap: wrap;
}

.nav-links a {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background-color: rgba(15, 23, 42, 0.9);
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    border-color: var(--accent-soft);
    background-color: rgba(15, 23, 42, 1);
    text-decoration: none;
}

.language-switcher {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.15rem;
    border-radius: 999px;
    background-color: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-soft);
}

.language-switcher button {
    border: none;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
}

.language-switcher button[aria-pressed="true"] {
    background-color: var(--accent-soft);
    color: var(--text-main);
}

main {
    flex: 1;
}

.hero {
    padding: 3.5rem 0 2.5rem;
}

.hero h2 {
    font-size: 2.1rem;
    margin: 0 0 0.75rem;
}

.hero p {
    max-width: 36rem;
    margin: 0;
    color: var(--text-muted);
}

.section {
    padding: 2.5rem 0;
}

.section h2 {
    font-size: 1.4rem;
    margin: 0 0 1rem;
}

.section p {
    margin: 0;
    color: var(--text-muted);
}

.project-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.project-card {
    background: var(--bg-elevated);
    border-radius: 1rem;
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.project-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.project-title a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.project-description {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.site-footer {
    border-top: 1px solid var(--border-soft);
    padding: 1.25rem 0 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Language visibility */
body[data-lang="en"] .lang-it {
    display: none;
}

body[data-lang="it"] .lang-en {
    display: none;
}

@media (min-width: 720px) {
    .site-header .container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .header-right {
        align-items: flex-end;
    }

    .hero {
        padding-top: 4.5rem;
        padding-bottom: 3rem;
    }

    .hero h2 {
        font-size: 2.5rem;
    }

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