@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Press+Start+2P&display=swap');

:root {
    --bg: #0a0a0c;
    --bg-light: #12121a;
    --bg-sidebar: #0e0e14;
    --text: #c0c0c8;
    --text-bright: #e8e8f0;
    --accent: #9b6d9b;
    --accent-dim: #6b4a6b;
    --accent-glow: rgba(155, 109, 155, 0.15);
    --border: #2a2a3a;
    --pixel: 4px;
    --font-pixel: 'Press Start 2P', monospace;
    --font-body: 'JetBrains Mono', monospace;
    --sidebar-width: 280px;
}

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

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scanline overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* ── Layout ── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: var(--pixel) solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-inner {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sidebar-logo {
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.5rem;
}

.sidebar-logo:hover {
    color: var(--text-bright);
}

.sidebar-name {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.sidebar-tagline {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Sidebar nav */
.sidebar-nav {
    list-style: none;
    margin-bottom: 2rem;
}

.sidebar-nav li {
    margin-bottom: 0.3rem;
}

.sidebar-nav a {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.4rem 0;
    display: block;
    transition: color 0.2s;
}

.sidebar-nav a::before {
    content: '> ';
    color: var(--accent-dim);
    opacity: 0;
    transition: opacity 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--accent);
}

.sidebar-nav a:hover::before,
.sidebar-nav a.active::before {
    opacity: 1;
}

/* Language switcher */
.lang-switcher {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.lang-switcher a {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

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

.lang-switcher a.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* Sidebar contact */
.sidebar-contact {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.sidebar-contact a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text);
    text-decoration: none;
    padding: 0.35rem 0;
    transition: color 0.2s;
}

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

.sidebar-contact .contact-label {
    color: var(--accent-dim);
    font-size: 0.75rem;
    min-width: 3rem;
}

/* ── Main content ── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content {
    max-width: 800px;
    padding: 2.5rem 3rem;
    flex: 1;
}

/* ── Pixel border box ── */
.pixel-box {
    background: var(--bg-light);
    border: var(--pixel) solid var(--accent);
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    image-rendering: pixelated;
}

.pixel-box::before {
    content: '';
    position: absolute;
    top: calc(-1 * var(--pixel));
    left: calc(-1 * var(--pixel));
    right: calc(-1 * var(--pixel));
    bottom: calc(-1 * var(--pixel));
    border: var(--pixel) solid var(--accent-dim);
    pointer-events: none;
    z-index: -1;
}

/* ── Page title (hero replacement) ── */
.page-title {
    font-family: var(--font-body);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--accent-dim);
    margin-bottom: 2rem;
}

/* ── Section titles ── */
.section-title {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.section-title::before {
    content: '> ';
    color: var(--accent-dim);
}

/* ── About ── */
.about-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text);
}

.about-text p {
    margin-bottom: 1rem;
}

/* ── Links ── */
a {
    color: var(--accent);
    text-decoration: none;
}

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

/* ── Blog post list ── */
.post-list {
    list-style: none;
}

.post-item {
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 0;
}

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

.post-date {
    font-size: 0.8rem;
    color: var(--accent-dim);
    display: block;
    margin-bottom: 0.3rem;
}

.post-link {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-bright);
    text-decoration: none;
    transition: color 0.2s;
}

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

.post-excerpt {
    font-size: 0.9rem;
    color: var(--text);
    margin-top: 0.3rem;
    opacity: 0.7;
}

/* ── Blog post article ── */
.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.post-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--accent-dim);
}

.post-content {
    font-size: 1rem;
    line-height: 1.8;
}

.post-content p {
    margin-bottom: 1.2rem;
}

.post-content h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    margin: 2rem 0 1rem;
    line-height: 1.5;
}

.post-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-bright);
    margin: 1.5rem 0 0.8rem;
    line-height: 1.5;
}

.post-content ul,
.post-content ol {
    margin: 1rem 0 1rem 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content strong {
    color: var(--text-bright);
}

.post-content code {
    background: var(--bg);
    color: var(--accent);
    padding: 0.15rem 0.4rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

.post-content pre {
    background: var(--bg);
    border: 2px solid var(--border);
    padding: 1.2rem;
    margin: 1.2rem 0;
    overflow-x: auto;
    line-height: 1.6;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.88rem;
    color: var(--text-bright);
}

.post-content blockquote {
    border-left: var(--pixel) solid var(--accent);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: var(--accent-glow);
    color: var(--text-bright);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border: 2px solid var(--border);
    margin: 1rem 0;
}

/* ── Post navigation ── */
.post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
    gap: 1rem;
}

.post-nav a {
    font-size: 0.85rem;
    color: var(--text);
    text-decoration: none;
    line-height: 1.5;
    max-width: 45%;
}

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

.post-nav .prev::before {
    content: '<< ';
    color: var(--accent-dim);
}

.post-nav .next::after {
    content: ' >>';
    color: var(--accent-dim);
}

/* ── CV styles ── */
.cv-level {
    margin-bottom: 2.5rem;
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border);
}

.cv-level:hover {
    border-left-color: var(--accent);
}

.cv-level-header {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

.cv-level-period {
    font-size: 0.8rem;
    color: var(--accent-dim);
    margin-bottom: 0.8rem;
    display: block;
}

.cv-role {
    font-size: 1.1rem;
    color: var(--text-bright);
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.cv-company {
    color: var(--accent-dim);
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

.cv-desc {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 0.8rem;
}

.cv-desc p {
    margin-bottom: 0.5rem;
}

.cv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.cv-tag {
    font-size: 0.75rem;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.2rem 0.5rem;
    line-height: 1;
}

/* ── Info bar ── */
.info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-item {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.5;
}

.info-item span {
    color: var(--accent);
}

/* ── Stat bars ── */
.stat-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text);
    min-width: 210px;
}

.stat-fill {
    height: 12px;
    background: var(--accent);
    image-rendering: pixelated;
}

.stat-track {
    flex: 1;
    height: 12px;
    background: var(--border);
}

/* ── Pixel art decorations ── */
.pixel-art {
    display: block;
    margin: 1.5rem auto;
    image-rendering: pixelated;
}

/* Space invader in sidebar */
.pixel-invader {
    width: 33px;
    height: 24px;
    transform: scale(3);
    transform-origin: left top;
    margin: 1.5rem 0 2.5rem 0.5rem;
    color: var(--accent);
    box-shadow:
        /* row 1 */
        2px 0 0 currentColor,
        8px 0 0 currentColor,
        /* row 2 */
        3px 1px 0 currentColor,
        7px 1px 0 currentColor,
        /* row 3 */
        2px 2px 0 currentColor,
        3px 2px 0 currentColor,
        4px 2px 0 currentColor,
        5px 2px 0 currentColor,
        6px 2px 0 currentColor,
        7px 2px 0 currentColor,
        8px 2px 0 currentColor,
        /* row 4 */
        1px 3px 0 currentColor,
        2px 3px 0 currentColor,
        4px 3px 0 currentColor,
        5px 3px 0 currentColor,
        6px 3px 0 currentColor,
        8px 3px 0 currentColor,
        9px 3px 0 currentColor,
        /* row 5 */
        0px 4px 0 currentColor,
        1px 4px 0 currentColor,
        2px 4px 0 currentColor,
        3px 4px 0 currentColor,
        4px 4px 0 currentColor,
        5px 4px 0 currentColor,
        6px 4px 0 currentColor,
        7px 4px 0 currentColor,
        8px 4px 0 currentColor,
        9px 4px 0 currentColor,
        10px 4px 0 currentColor,
        /* row 6 */
        0px 5px 0 currentColor,
        2px 5px 0 currentColor,
        3px 5px 0 currentColor,
        4px 5px 0 currentColor,
        5px 5px 0 currentColor,
        6px 5px 0 currentColor,
        7px 5px 0 currentColor,
        8px 5px 0 currentColor,
        10px 5px 0 currentColor,
        /* row 7 */
        0px 6px 0 currentColor,
        2px 6px 0 currentColor,
        8px 6px 0 currentColor,
        10px 6px 0 currentColor,
        /* row 8 */
        3px 7px 0 currentColor,
        4px 7px 0 currentColor,
        6px 7px 0 currentColor,
        7px 7px 0 currentColor;
    height: 1px;
    width: 1px;
    background: transparent;
}

/* Pixel heart for footer */
.pixel-heart {
    display: inline-block;
    width: 2px;
    height: 2px;
    position: relative;
    top: -9px;
    margin: 0 14px 0 4px;
    color: var(--accent);
    box-shadow:
        2px 0 0 currentColor,
        4px 0 0 currentColor,
        8px 0 0 currentColor,
        10px 0 0 currentColor,
        0px 2px 0 currentColor,
        2px 2px 0 currentColor,
        4px 2px 0 currentColor,
        6px 2px 0 currentColor,
        8px 2px 0 currentColor,
        10px 2px 0 currentColor,
        12px 2px 0 currentColor,
        0px 4px 0 currentColor,
        2px 4px 0 currentColor,
        4px 4px 0 currentColor,
        6px 4px 0 currentColor,
        8px 4px 0 currentColor,
        10px 4px 0 currentColor,
        12px 4px 0 currentColor,
        2px 6px 0 currentColor,
        4px 6px 0 currentColor,
        6px 6px 0 currentColor,
        8px 6px 0 currentColor,
        10px 6px 0 currentColor,
        4px 8px 0 currentColor,
        6px 8px 0 currentColor,
        8px 8px 0 currentColor,
        6px 10px 0 currentColor;
    background: transparent;
}

/* Pixel stars scattered */
.pixel-stars {
    position: relative;
}

.pixel-stars::before {
    content: '';
    position: absolute;
    top: -15px;
    right: 0;
    width: 1px;
    height: 1px;
    transform: scale(2);
    color: var(--accent-dim);
    box-shadow:
        0 0 0 currentColor,
        4px 2px 0 currentColor,
        12px -4px 0 currentColor,
        25px 1px 0 currentColor,
        40px -3px 0 currentColor,
        58px 0px 0 currentColor,
        75px -5px 0 currentColor;
    background: transparent;
    animation: twinkle 3s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Section title pixel arrow */
.section-title::after {
    content: '';
    display: inline-block;
    width: 1px;
    height: 1px;
    margin-left: 8px;
    vertical-align: middle;
    transform: scale(2);
    color: var(--accent-dim);
    box-shadow:
        0 0 0 currentColor,
        1px 1px 0 currentColor,
        0 2px 0 currentColor;
    background: transparent;
}

/* ── Footer ── */
.site-footer {
    border-top: var(--pixel) solid var(--border);
    padding: 1.5rem 3rem;
    margin-top: auto;
}

.footer-text {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-dim);
}

/* ── Mobile toggle ── */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: var(--bg-sidebar);
    border: 2px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 1.2rem;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    line-height: 1;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content {
        padding: 3.5rem 1.5rem 2rem;
    }

    .site-footer {
        padding: 1.5rem;
    }

    .post-nav {
        flex-direction: column;
    }

    .post-nav a {
        max-width: 100%;
    }

    .stat-label {
        min-width: 120px;
        font-size: 0.7rem;
    }

    .info-bar {
        flex-direction: column;
        gap: 0.5rem;
    }
}
