/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0d1117;
    --bg-elevated: #161b22;
    --border: #30363d;
    --text: #c9d1d9;
    --text-muted: #a3adb8;
    --accent: #58a6ff;
    --accent-soft: rgba(88, 166, 255, 0.12);
}

body {
    font-family: -apple-system, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

html {
    scroll-behavior: smooth;
}

a {
    color: inherit;
}

/* ===== HEADER ===== */
header {
    background: rgba(13, 17, 23, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

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

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 28px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s;
}

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

/* ===== HERO ===== */
.hero {
    border-bottom: 1px solid var(--border);
    padding: 90px 20px 60px;
    text-align: center;
    margin-top: 70px;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    text-align: left;
    margin-bottom: 30px;
}

.hero-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.hero-text {
    max-width: 480px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
    color: var(--text);
}

.hero-highlight {
    color: var(--accent);
}

.hero-text p {
    font-size: 18px;
    color: var(--text-muted);
}

.hero-tagline {
    font-size: 15px;
    color: var(--text-muted);
    margin-top: 14px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

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

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent);
}

.hero .tags {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.tag {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-muted);
    font-family: "SFMono-Regular", Consolas, monospace;
}

/* ===== SECTIONS (shared: home + project pages) ===== */
section {
    max-width: 1000px;
    margin: 70px auto;
    padding: 0 20px;
}

.page-section {
    max-width: 760px;
    margin: 36px auto;
    padding: 0 20px;
}

h2 {
    font-size: 26px;
    margin-bottom: 32px;
    color: var(--text);
}

.section-intro h2 {
    text-align: center;
    margin-bottom: 40px;
}

/* ===== ABOUT ===== */
.about-content {
    max-width: 760px;
    margin: 0 auto;
}

.about-content p {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* ===== CV ===== */
.cv-content {
    text-align: center;
}

.cv-content p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 20px;
}

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

/* ===== STACK ===== */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stack-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 20px;
    transition: border-color 0.2s;
}

.stack-item:hover {
    border-color: var(--accent);
}

.stack-item h3 {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 10px;
}

.stack-item p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== PROJECTS ===== */
#projects {
    max-width: 1200px;
}

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

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 8px 20px rgba(88, 166, 255, 0.15);
}

.project-card--management {
    border-style: dashed;
}

.card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.project-header {
    border-bottom: 1px solid var(--border);
    padding: 24px;
}

.project-header .badge {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 10px;
}

.project-header h3 {
    font-size: 19px;
    margin-bottom: 6px;
    color: var(--accent);
}

.project-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.project-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.project-tech {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.project-body .project-tech {
    margin-bottom: 16px;
}

.card-cta {
    display: block;
    margin-top: auto;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}

.project-links {
    margin-top: auto;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.project-links a {
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
}

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

.tech-badge {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    font-family: "SFMono-Regular", Consolas, monospace;
}

/* ===== PROJECT PAGE (shared template) ===== */
.page-hero {
    max-width: 760px;
    margin: 70px auto 0;
    border-bottom: 1px solid var(--border);
    padding: 40px 20px 24px;
}

.page-hero .back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 14px;
}

.page-hero .back-link:hover {
    color: var(--accent);
}

.page-hero h1 {
    font-size: 26px;
    color: var(--text);
    margin-bottom: 8px;
}

.page-hero p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 14px;
}

.page-section h2 {
    font-size: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.page-section p, .page-section li {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 14px;
}

.page-section pre {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.table-scroll {
    overflow-x: auto;
}

.page-section table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.page-section th, .page-section td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: center;
}

.page-section th {
    background: var(--bg-elevated);
    color: var(--text);
    font-weight: 600;
}

.page-section td {
    color: var(--text-muted);
}

.page-section td:first-child {
    text-align: left;
    color: var(--text);
}

.page-section td.gap {
    color: #f0883e;
    font-weight: 600;
    background: rgba(240, 136, 62, 0.08);
}

/* ===== FOOTER ===== */
footer {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 40px 20px;
    margin-top: 80px;
    color: var(--text-muted);
}

footer .role {
    color: var(--text);
    margin-bottom: 16px;
}

footer .contact-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

footer .contact-links a {
    color: var(--text-muted);
    text-decoration: none;
}

footer .contact-links a:hover {
    color: var(--accent);
}

footer .copyright {
    font-size: 13px;
    opacity: 0.7;
}

/* ===== SELECTION ===== */
::selection {
    background: var(--accent);
    color: var(--bg);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        gap: 15px;
    }

    nav ul {
        width: 100%;
        justify-content: center;
        gap: 20px;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        max-width: 100%;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero-text p {
        font-size: 16px;
    }

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

    .page-hero h1 {
        font-size: 26px;
    }

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

@media (max-width: 480px) {
    .hero h1 {
        font-size: 25px;
    }

    h2 {
        font-size: 22px;
    }

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