:root {
    --ink: #e0e0e0;
    --muted: #90a0ad;
    --gray: #b0b0b0;
    --line: #2e3440;
    --bg: #1a1d23;
    --text: #d8dee9;
    --text-muted: #a0a8b4;
    --stack: #9989ce;
    --link: #7fb3d3;
    --link-hover: #a8d0e8;
    --education-bg: #232730;
    --max-width: 820px;
}

.light {
    --ink: #0e232e;
    --muted: #5a6b78;
    --gray: #848484;
    --line: #e3e6e8;
    --bg: #ffffff;
    --text: #1a1a1a;
    --text-muted: #333;
    --stack: #6e5ea5;
    --link: #2a6496;
    --link-hover: #1a4a6e;
    --education-bg: #f4f4f2;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

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

a:hover {
    color: var(--link-hover);
}

body {
    margin: 0;
    padding: 3rem 1.25rem 4rem;
    font-family:
        "Cantarell",
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

.resume {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ---------- Header ---------- */
header.intro {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1.5rem;
}

h1 {
    font-family: "Liberation Serif", "Times New Roman", Georgia, serif;
    font-weight: normal;
    font-size: clamp(2.4rem, 6vw, 3.4rem);
    color: var(--ink);
    margin: 0 0 0.35rem;
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--muted);
    font-style: italic;
    font-size: 1rem;
    letter-spacing: 0.5px;
    margin: 0;
}

.tagline .sep {
    margin: 0 0.5rem;
    opacity: 0.6;
}

.contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem 1.75rem;
    margin-top: 1.25rem;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.contact a {
    color: var(--link);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.contact a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.contact .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.langs {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* ---------- Summary ---------- */
.summary {
    max-width: 660px;
    margin: 0 auto 2.5rem;
    text-align: center;
    color: var(--text);
    font-size: 0.97rem;
    line-height: 2;
}

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

h2 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ink);
    margin: 0 0 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}

/* ---------- Experience entry ---------- */
.entry {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}



.entry .date {
    font-size: 0.78rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-top: 0.15rem;
    text-align: right;
}

.entry .body {
    min-width: 0;
}

.company-line {
    margin-bottom: 0.15rem;
}

.role {
    display: block;
    font-weight: 700;
    color: var(--text);
    font-size: 1.05rem;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.company {
    display: block;
    font-weight: 400;
    color: var(--muted);
    font-size: 0.88rem;
    letter-spacing: 0.5px;
    line-height: 1.3;
    margin-top: 0.1rem;
}

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0 0.6rem;
}

.stack .tag {
    background: color-mix(in srgb, var(--stack) 15%, transparent);
    color: var(--stack);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    white-space: nowrap;
}

.entry ul {
    margin: 0.25rem 0 0;
    padding: 0;
    list-style: none;
}

.entry ul li {
    position: relative;
    padding-left: 0.9rem;
    margin-bottom: 0.2rem;
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.55;
}

.entry ul li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--muted);
}

.entry p.note {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0;
    line-height: 1.55;
}

/* ---------- Education ---------- */
.education {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--education-bg);
    border-radius: 10px;
}

.education .date {
    font-size: 0.78rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-top: 0.15rem;
    text-align: right;
}

.education h3 {
    margin: 0 0 0.15rem;
    color: var(--ink);
    font-size: 1.1rem;
}

.education .coursework {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---------- Beyond work ---------- */
.beyond {
    margin-top: 2.5rem;
}

.beyond-body {
    font-size: 0.92rem;
    color: var(--text);
    margin: 0 0 1rem;
    line-height: 1.6;
}

.beyond-body strong {
    color: var(--stack);
    font-weight: 600;
}

.projects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.project {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem 1rem;
    background: var(--education-bg);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s;
}

.project:hover {
    background: color-mix(in srgb, var(--stack) 10%, var(--education-bg));
}

.project-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.project-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

@media (max-width: 640px) {
    .projects {
        grid-template-columns: 1fr;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    body {
        padding: 1.75rem 1rem 3rem;
        font-size: 14px;
    }
    .entry,
    .education {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }
    .entry .date,
    .education .date {
        text-align: left;
        color: var(--ink);
        font-weight: 600;
    }
    .contact {
        gap: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }
}

/* ---------- Print ---------- */
@media print {
    body {
        padding: 0.6cm 1cm;
        font-size: 10pt;
        color: #000;
        background: #fff;
    }
    .resume {
        max-width: 100%;
    }
    header.intro {
        border-bottom: 1px solid #999;
    }
    h2 {
        border-bottom: 1px solid #999;
    }
    .entry {
        page-break-inside: avoid;
    }
    .education {
        background: #f6f6f6;
    }
    .project {
        background: #f6f6f6;
    }
    .theme-toggle {
        display: none !important;
    }
}

/* ---------- Theme Toggle ---------- */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.2s,
        color 0.2s;
    z-index: 100;
    line-height: 1;
}

.theme-toggle:hover {
    opacity: 0.8;
}
