/* resume page structure and print styles. */
:root {
    --bg: #f7f5f0;
    --paper: #ffffff;
    --text-main: #1c1917;
    --text-sub: #57534e;
    --text-muted: #78716c;
    --accent: #2563eb;
    --rule: #d6d3cd;
    --border: #e5e1d8;
    --tl-accent: #14c3b6;
}

[data-theme="dark"] {
    --bg: #000000;
    --paper: #0c0c0e;
    --text-main: #f1f5f9;
    --text-sub: #cbd5e1;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --rule: #2a2a30;
    --border: #1f1f24;
    --tl-accent: #3ee9db;
}

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

html,
body {
    background: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    min-height: 100vh;
    padding: 2rem 1rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body::before,
body::after {
    display: none !important;
}

.container {
    width: 100%;
    max-width: 860px;
}

/* ---- Top bar ---- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-sub);
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 36px;
    padding: 0 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--paper);
    color: var(--text-main);
    font: 500 0.85rem 'Inter', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.tb-btn:hover {
    transform: translateY(-1px);
    border-color: var(--text-muted);
}

.tb-btn.primary {
    background: var(--text-main);
    color: var(--paper);
    border-color: var(--text-main);
}

.tb-btn.icon {
    width: 36px;
    padding: 0;
    justify-content: center;
}

/* ---- Paper ---- */
.paper {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem 2.75rem 2.25rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .paper {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.r-head {
    text-align: center;
    margin-bottom: 1.4rem;
}

.r-head h1 {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.r-contact {
    margin-top: 0.5rem;
    font-size: 0.86rem;
    color: var(--text-sub);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.55rem;
}

.r-contact a {
    color: var(--text-sub);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
}

.r-contact a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.r-contact .sep {
    color: var(--rule);
}

.r-section {
    margin-top: 1.35rem;
}

.r-section h2 {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-main);
    padding-bottom: 0.3rem;
    border-bottom: 1.5px solid var(--text-main);
    margin-bottom: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.r-section h2::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tl-accent);
}

.r-item {
    margin-bottom: 0.9rem;
}

.r-item:last-child {
    margin-bottom: 0;
}

.r-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.r-title {
    font-weight: 700;
    font-size: 0.98rem;
}

.r-title .stack {
    font-weight: 400;
    font-style: italic;
    color: var(--text-sub);
    font-size: 0.9rem;
}

.r-when,
.r-where {
    color: var(--text-sub);
    font-size: 0.86rem;
    white-space: nowrap;
}

.r-when {
    font-variant-numeric: tabular-nums;
}

.r-org {
    font-style: italic;
    color: var(--text-sub);
    font-size: 0.9rem;
}

.r-item ul {
    margin: 0.3rem 0 0 1.1rem;
    color: var(--text-sub);
    font-size: 0.9rem;
    line-height: 1.5;
}

.r-item li {
    margin-bottom: 0.18rem;
}

.r-item li strong,
.r-org strong {
    color: var(--text-main);
    font-weight: 600;
}

.r-skills p {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.6;
}

.r-skills strong {
    color: var(--text-main);
    font-weight: 600;
}

.r-foot {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.r-foot a {
    color: var(--accent);
    text-decoration: none;
}

@media (max-width: 640px) {
    body {
        padding: 1.25rem 0.75rem 3rem;
    }

    .paper {
        padding: 1.75rem 1.25rem 1.5rem;
        border-radius: 12px;
    }

    .r-head h1 {
        font-size: 1.7rem;
    }

    .r-row {
        flex-direction: column;
        gap: 0.1rem;
    }

    .r-when,
    .r-where {
        white-space: normal;
    }
}

/* ---- Print: clean black-on-white, one page if possible ---- */
@page {
    size: letter;
    margin: 0.45in 0.55in;
}

@media print {
    html,
    html body {
        background: #fff !important;
        color: #000 !important;
        padding: 0 !important;
        display: block !important;
    }.topbar,
    .r-foot,
    .cp-launcher,
    .term-launcher{
        display: none !important;
    }

    .container {
        max-width: none;
    }

    .paper {
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        background: #fff !important;
    }

    /* Beat the dark-theme heading colours from glass-theme.css when printing */
    html .paper .r-head h1,
    html .paper .r-section h2,
    html .paper .r-title,
    html .paper .r-item li strong,
    html .paper .r-skills strong,
    html .paper .r-org strong {
        color: #000 !important;
    }

    html .paper .r-section h2 {
        border-bottom-color: #000 !important;
    }

    .r-contact,
    .r-contact a,
    .r-when,
    .r-where,
    .r-org,
    .r-item ul,
    .r-skills p,
    .r-title .stack {
        color: #222 !important;
    }

    .r-section h2 {
        border-bottom-color: #000;
    }

    .r-section h2::before {
        display: none;
    }

    .r-contact a {
        border-bottom: none;
    }

    /* keep each entry together, but let sections flow so page 1 fills up */
    .r-item {
        break-inside: avoid;
    }

    .r-section h2 {
        break-after: avoid;
    }

    .r-head {
        margin-bottom: 0.8rem;
    }

    .r-head h1 {
        font-size: 1.55rem;
    }

    .r-contact {
        margin-top: 0.25rem;
    }

    .r-section {
        margin-top: 0.65rem;
    }

    .r-section h2 {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
        padding-bottom: 0.15rem;
    }

    .r-item {
        margin-bottom: 0.5rem;
    }

    .r-item ul {
        margin-top: 0.15rem;
        line-height: 1.35;
    }

    .r-item li {
        margin-bottom: 0.08rem;
    }

    .r-item ul,
    .r-skills p,
    .r-org,
    .r-when,
    .r-where,
    .r-contact,
    .r-title .stack {
        font-size: 0.76rem;
    }

    .r-skills p {
        line-height: 1.45;
    }

    .r-title {
        font-size: 0.86rem;
    }
}
