/* ============================================================
   Site-wide theme — dark navy palette shared with the melding
   calculator. Blue/gold accents (colourblind-safe pairing);
   state is never shown by colour alone.
   ============================================================ */
:root {
    --bg: #0c1326;
    --panel: #141d38;
    --panel2: #1b2748;
    --line: #2a3a66;
    --ink: #e8ecf7;
    --dim: #9aa6c8;
    --accent: #5fb3ff;
    --accent2: #ffcb5f;
    --chip: #243466;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    color: var(--ink);
    background: radial-gradient(1200px 700px at 70% -10%, #1a2a55 0%, var(--bg) 55%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--accent);
}

a:focus, button:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Navigation ---------- */
nav {
    background: rgba(20, 29, 56, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    gap: 1rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.2rem;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: var(--dim);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

.nav-links a:hover {
    color: var(--ink);
    background: var(--panel2);
    border-color: var(--line);
}

/* ---------- Language toggle (top right, persistent) ---------- */
.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--ink);
}

.lang-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.flag {
    font-size: 1rem;
}

/* ---------- Hero / about ---------- */
.about-section {
    padding: 2.6rem 0 1.8rem;
}

.about-section h1 {
    font-size: 2.2rem;
    margin-bottom: 0.2rem;
    letter-spacing: 0.3px;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.1rem;
}

.about-text p {
    color: var(--dim);
    max-width: 70ch;
    margin-bottom: 0.8rem;
    font-size: 0.97rem;
}

.cta-buttons {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
}

.cta-button {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid var(--line);
}

.cta-button.primary {
    background: var(--accent);
    color: #06203b;
    border-color: var(--accent);
}

.cta-button.primary:hover {
    background: #7cc2ff;
}

.cta-button.secondary {
    background: var(--panel2);
    color: var(--ink);
}

.cta-button.secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- Sections ---------- */
.main-content {
    padding-bottom: 3rem;
}

.section {
    padding: 1.6rem 0 0.6rem;
    border-top: 1px solid var(--line);
    margin-top: 1.2rem;
}

.section h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent2);
    margin-bottom: 1rem;
    font-weight: 700;
}

.section h3 {
    font-size: 1rem;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

/* ---------- Skills ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.skill-category {
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.9rem 1rem;
}

.skill-category h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--dim);
    margin-bottom: 0.6rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.skill-tag {
    background: var(--chip);
    color: var(--ink);
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--line);
}

/* ---------- Project / tool cards ---------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.project-card {
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}

a.project-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

a.project-card:hover {
    border-color: var(--accent);
}

a.project-card:hover h3 {
    color: var(--accent);
}

.project-card h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.project-card p {
    color: var(--dim);
    font-size: 0.88rem;
    margin-bottom: 0.7rem;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tech-tag {
    background: var(--chip);
    border: 1px solid var(--line);
    color: var(--dim);
    padding: 0.1rem 0.55rem;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
}

/* ---------- Tools: Games > series > game hierarchy ---------- */
.series-group {
    margin-bottom: 1.6rem;
}

.series-title {
    font-size: 1.15rem;
    color: var(--ink);
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
}

.game-group {
    margin: 0 0 1.2rem 0.2rem;
    padding-left: 0.9rem;
    border-left: 2px solid var(--line);
}

.game-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent);
    margin-bottom: 0.7rem;
}

/* ---------- Education / experience rows ---------- */
.education-timeline {
    display: flex;
    flex-direction: column;
}

.education-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
}

.education-item:last-child {
    border-bottom: none;
}

.education-item h3 {
    font-size: 0.98rem;
    margin-bottom: 0.1rem;
}

.education-meta {
    color: var(--accent2);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.education-item p {
    color: var(--dim);
    font-size: 0.9rem;
    max-width: 75ch;
}

/* ---------- Contact ---------- */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
}

.contact-item {
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.contact-icon {
    font-size: 1rem;
}

.contact-item h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dim);
    margin: 0;
}

.contact-item p {
    font-size: 0.9rem;
    color: var(--ink);
    width: 100%;
}

/* ---------- Project pages ---------- */
.project-hero {
    padding: 2.2rem 0 0.8rem;
}

.project-hero h1 {
    font-size: 1.9rem;
    margin-bottom: 0.2rem;
}

.project-hero p {
    color: var(--accent);
    font-weight: 600;
    font-size: 1rem;
}

.project-content {
    padding-bottom: 3rem;
}

.project-content .section p {
    color: var(--dim);
    font-size: 0.95rem;
    max-width: 75ch;
    margin-bottom: 0.9rem;
}

.project-content .section ul {
    color: var(--dim);
    font-size: 0.95rem;
    margin: 0 0 0.9rem 1.3rem;
}

.project-content .section li {
    margin-bottom: 0.3rem;
}

.project-content h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--accent2);
    margin: 1.4rem 0 0.6rem;
}

.project-image {
    display: block;
    width: 100%;
    max-width: 640px;
    border-radius: 10px;
    border: 1px solid var(--line);
    margin: 1rem 0 1.2rem;
}

.project-links {
    display: flex;
    gap: 0.7rem;
    margin: 1.4rem 0 0;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--panel2);
    color: var(--ink);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
}

.project-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.back-button {
    margin-bottom: 1.2rem;
    color: var(--dim);
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.6rem 0;
    }

    .nav-right {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-links {
        justify-content: center;
    }

    .about-section h1 {
        font-size: 1.7rem;
    }

    .skills-grid,
    .project-grid {
        grid-template-columns: 1fr;
    }
}
