/* ── Self-hosted Inter (variable weight 400–600) ── */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                   U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                   U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                   U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                   U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                   U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
                   U+FEFF, U+FFFD;
}

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

:root {
    --bg: #ffffff;
    --text: #111111;
    --muted: #6b7280;
    --subtle: #374151;
    --border: #e5e7eb;
}

/* Global link reset — overrides Safari/iOS default blue/purple */
a, a:link, a:visited, a:hover, a:active {
    color: inherit;
    -webkit-text-fill-color: inherit;
}

html { font-size: 16px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Layout ───────────────────────────── */
.layout {
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ── Sidebar ──────────────────────────── */
.sidebar {
    width: 320px;
    flex-shrink: 0;
    padding: 64px 40px 64px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

/* ── Scrollable Content ───────────────── */
.content {
    flex: 1;
    min-width: 0;
    padding: 64px 0 80px 48px;
    border-left: 1px solid var(--border);
}

/* ── Language Nav ─────────────────────── */
.lang-nav {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
}

/* ── Burger Button ────────────────────── */
.burger-btn {
    position: fixed;
    top: 18px;
    left: 24px;
    z-index: 500;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .burger-btn {
        position: static;
    }
}

.burger-btn span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.burger-btn.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger-btn.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Lang Buttons Wrapper ─────────────── */
.lang-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Fullscreen Menu ──────────────────── */
.fullscreen-menu {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.fullscreen-menu.open {
    opacity: 1;
    pointer-events: auto;
}

.fullscreen-menu ul {
    list-style: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.fullscreen-menu ul li a,
.fullscreen-menu ul li a:link,
.fullscreen-menu ul li a:visited {
    font-size: clamp(1.7rem, 5vw, 2.8rem);
    font-weight: 300;
    letter-spacing: -0.03em;
    color: var(--text);
    -webkit-text-fill-color: var(--text);
    text-decoration: none;
    display: block;
    padding: 10px 24px;
    line-height: 1.2;
    transition: color 0.15s;
}

.fullscreen-menu ul li a:hover,
.fullscreen-menu ul li a:active {
    color: var(--muted);
    -webkit-text-fill-color: var(--muted);
}


.lang-sep {
    color: var(--border);
    font-size: 14px;
    user-select: none;
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    color: var(--muted);
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}

.lang-btn:hover { color: var(--text); }
.lang-btn.active { color: var(--text); font-weight: 500; }

/* ── Header / Sidebar content ────────── */
h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 10px;
}

.headline {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
    margin-bottom: 18px;
}

.contact-links {
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-links a,
.contact-links a:link,
.contact-links a:visited {
    color: var(--text);
    -webkit-text-fill-color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1px;
    transition: border-color 0.15s;
}

.contact-links a:hover,
.contact-links a:active {
    border-color: var(--text);
}

/* ── Dividers ─────────────────────────── */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 44px 0;
}

/* ── Section Headings ─────────────────── */
h2 {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 28px;
}

h3 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin: 28px 0 14px;
}

h3:first-of-type { margin-top: 0; }

/* ── About ────────────────────────────── */
#about p {
    font-size: 0.925rem;
    color: var(--subtle);
    margin-bottom: 14px;
}

#about p:last-of-type { margin-bottom: 0; }

/* ── Jobs & Education ─────────────────── */
.job { margin-bottom: 36px; }
.job:last-child { margin-bottom: 0; }

.job-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.job-title {
    font-size: 0.925rem;
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.4;
    color: var(--text);
}

.job-company { font-size: 0.85rem; color: var(--muted); }

.job-date {
    font-size: 0.8rem;
    color: var(--muted);
}

.job-list {
    list-style: none;
    padding: 0;
    margin-top: 8px;
}

.job-list li {
    font-size: 0.875rem;
    line-height: 1.65;
    padding-left: 1.4em;
    position: relative;
    margin-bottom: 7px;
    color: var(--subtle);
}

.job-list li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--muted);
}

.job-list a,
.job-list a:link,
.job-list a:visited,
.job-company a,
.job-company a:link,
.job-company a:visited {
    color: var(--subtle);
    -webkit-text-fill-color: var(--subtle);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.15s;
}

.job-list a:hover,
.job-list a:active,
.job-company a:hover,
.job-company a:active {
    color: var(--text);
    -webkit-text-fill-color: var(--text);
    border-color: var(--muted);
}

.edu-desc {
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.6;
}

/* ── Skills ───────────────────────────── */
.skills-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skills-list li {
    font-size: 0.82rem;
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--subtle);
    transition: border-color 0.15s, color 0.15s;
    line-height: 1.3;
}

.skills-list li:hover {
    border-color: #9ca3af;
    color: var(--text);
}

/* ── Projects ─────────────────────────── */
.project {
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}

.project:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.project-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.project-name { font-size: 0.925rem; font-weight: 600; }

.project-link,
.project-link:link,
.project-link:visited {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--muted);
    -webkit-text-fill-color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1px;
    transition: color 0.15s, border-color 0.15s;
}

.project-link:hover,
.project-link:active {
    color: var(--text);
    -webkit-text-fill-color: var(--text);
    border-color: var(--text);
}

.project-desc {
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--subtle);
    margin-bottom: 8px;
}

.project-note { font-size: 0.875rem; color: var(--muted); }
.tech-stack { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.02em; }

/* ── Scroll-to-top ────────────────────── */
#scroll-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg);
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, border-color 0.15s, color 0.15s;
    z-index: 150;
}

#scroll-top.visible {
    opacity: 1;
    pointer-events: auto;
}

#scroll-top:hover {
    border-color: var(--muted);
    color: var(--text);
}

/* ── Footer ───────────────────────────── */
footer p {
    text-align: center;
    font-size: 0.78rem;
    color: var(--muted);
}

/* ── Mobile ───────────────────────────── */
@media (max-width: 768px) {
    /* Both bars fixed with explicit pixel heights —
       prevents iOS Safari from resizing them when
       the address bar shows/hides during scroll. */

    .lang-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 40px;
        padding: 0 20px;
        justify-content: space-between;
        background: var(--bg);
        z-index: 500;
    }

    .sidebar {
        position: fixed;
        top: 40px;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        padding: 12px 20px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        overflow: hidden;
        z-index: 200;
        border-right: none;
    }

    .sidebar h1 {
        font-size: 1.1rem;
        line-height: 1.2;
        margin-bottom: 2px;
    }

    .sidebar .headline {
        display: block;
        font-size: 0.68rem;
        line-height: 1.4;
        margin-bottom: 6px;
    }

    .sidebar .contact-links {
        display: flex;
        flex-direction: row;
        gap: 16px;
        font-size: 0.78rem;
        overflow: hidden;
        max-height: 40px;
        opacity: 1;
        transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.25s ease;
    }

    .sidebar {
        transition: padding 0.25s ease;
    }

    .layout {
        transition: margin-top 0.25s ease;
    }

    /* ── Minimized state ── */
    .sidebar.minimized {
        padding: 8px 20px;
    }

    .sidebar.minimized .contact-links {
        max-height: 0;
        opacity: 0;
        margin-top: 0;
    }

    .hl-short { display: none; }

    .sidebar.minimized .hl-full { display: none; }

    .sidebar.minimized .hl-short {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Push content below both fixed bars */
    .layout {
        flex-direction: column;
        padding: 0;
        margin-top: 144px; /* updated dynamically by JS */
        min-height: auto;
        align-items: stretch;
    }

    .content {
        padding: 28px 20px 60px;
        border-left: none;
    }

    .job-header {
        flex-direction: column;
        gap: 4px;
    }

    .project-header {
        flex-direction: column;
        gap: 4px;
    }
}
