/* ============================================================================
   magiconair.net - Terminal-inspired personal homepage
   ============================================================================ */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --accent-orange: #f0883e;
    --accent-yellow: #d29922;
    --border: #30363d;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--accent-orange);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

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

h2 a:hover {
    text-decoration: none;
    opacity: 0.8;
}

p {
    margin-bottom: 1rem;
}

strong {
    font-weight: 500;
    color: var(--text-primary);
}

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

/* Header */
header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.avatar {
    grid-row: 1;
    align-self: stretch;
    height: 0;
    min-height: 100%;
    width: auto;
    border-radius: 4px;
    border: 2px solid var(--border);
}

.identity h1 {
    margin-bottom: 0.25rem;
}

.handle {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.title {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.location {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Sections */
section {
    margin-bottom: 3rem;
}

/* Projects */
.project {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.project-header a {
    font-size: 1.1rem;
    font-weight: 500;
}

.stars {
    font-size: 0.8rem;
    color: var(--accent-yellow);
    background-color: var(--bg-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.project p {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 0.875rem;
}

/* Experience */
.job {
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.company {
    font-weight: 500;
    color: var(--text-primary);
}

a.company {
    color: var(--text-primary);
}

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

.period {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.role {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.job ul {
    list-style: none;
    padding-left: 0;
}

.job li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.job li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* Skills */
.skill-group {
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-label {
    color: var(--text-muted);
    min-width: 100px;
}

.skill-list {
    color: var(--text-secondary);
}

/* Contact */
.contact-list {
    list-style: none;
    padding: 0;
}

.contact-list li {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 1rem;
}

.contact-list .label {
    color: var(--text-muted);
    min-width: 80px;
}

/* CV Navigation */
.cv-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

/* CV Job Entries */
.cv-job {
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}

.cv-job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.cv-company {
    font-weight: 500;
    color: var(--text-primary);
}

.cv-period {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cv-employer {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.cv-job ul {
    list-style: none;
    padding-left: 0;
}

.cv-job li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cv-job li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* Reference List */
.reference-list {
    list-style: none;
    padding: 0;
}

.reference-list li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.reference-list li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* Footer */
footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 2rem 1.5rem;
    }

    header {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .avatar {
        width: 100px;
        height: auto;
        min-height: 0;
    }

    .identity {
        grid-row: 2;
    }

    h1 {
        font-size: 1.75rem;
    }

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

    .job-header {
        flex-direction: column;
    }

    .skill-group {
        flex-direction: column;
        gap: 0.25rem;
    }

    .skill-label {
        min-width: auto;
    }

    .contact-list li {
        flex-direction: column;
        gap: 0.25rem;
    }

    .contact-list .label {
        min-width: auto;
    }

    .cv-job-header {
        flex-direction: column;
    }
}

/* Selection */
::selection {
    background-color: var(--accent);
    color: var(--bg-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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