:root {
    --bg: #121212;
    --toggle-bg: #c2cae0;
    --card: #ededed;
    --item-bg: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --accent: #2563eb;
    --border: #e2e8f0;
    --chip-bg: #eef2ff;
    --chip-text: #4338ca;
    --chip-border: #c7d2fe;
    --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.06);
    --radius: 14px;
}

    /* Dark mode */
    :root.dark {
        --toggle-bg: #415c86;
        --card: #0f1724;
        --item-bg: #1e293b;
        --text: #e6eef8;
        --muted: #94a3b8;
        --accent: #60a5fa;
        --border: #1f2a38;
        --chip-bg: #0b122b;
        --chip-text: #bfdbfe;
        --chip-border: #3b82f6;
        --shadow: none;
    }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font: 400 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wrapper { max-width: 1000px; margin: 40px auto; padding: 0 20px; }

.resume {
    display: grid;
    padding-top: 20px;
    gap: 20px;
}

@media (max-width: 900px) {
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
}

/* Header */
.header { display: flex; flex-direction: column; gap: 14px; position: relative; }
.header .title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.header h1 { font-size: 2rem; line-height: 1.2; margin: 0; }
.header .role { font-weight: 600; color: var(--accent); }
.header .contact { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: .95rem; }
.contact a { color: inherit; text-decoration: none; border-bottom: 1px dashed rgba(37,99,235,.4); }
.contact a:hover { color: var(--accent); border-color: var(--accent); }

/* Theme toggle button */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--toggle-bg);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .icon { width: 16px; height: 16px; display: inline-block; }

/* Certification icons in header (top-right) */
.header .certs {
    position: absolute;
    top: 12px;
    right: 14px;
    display: flex;
    gap: 2px;
    align-items: center;
}
.cert-icon {
    width: 80px;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* On small screens, stack / flow the certs into the header layout */
@media (max-width: 700px) {
    .header { position: static; }
    .header .certs { position: static; margin-left: auto; }
    .cert-icon { width: 40px; }
}

.summary { margin: 0; color: var(--muted); }

/* Sections */
.section { display: flex; flex-direction: column; gap: 18px; }
.section h2 {
    font-size: 1.1rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
}

.item {
    display: grid;
    gap: 4px 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--item-bg);
}

.item:not(:last-child) { margin-bottom: 10px; }
.item .meta { color: var(--muted); font-size: .95rem; white-space: nowrap; }
.item .title { font-weight: 600; }
.item .sub { color: var(--muted); }
.item ul { margin: 8px 0 0 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { padding: 6px 10px; border-radius: 999px; background: var(--chip-bg); color: var(--chip-text); font-weight: 600; font-size: .85rem; border: 1px solid var(--chip-border); }

/* Sidebar */
.sidebar .box + .box { margin-top: 20px; }
.box h3 { font-size: 1rem; margin: 0 0 8px; color: var(--muted); letter-spacing: .02em; text-transform: none; }
.list-plain { margin: 0; padding-left: 18px; }
.list-plain li { margin: 6px 0; }
hr.div { border: 0; border-top: 1px solid var(--border); margin: 6px 0 12px; }

.badge { display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 12px; background: #ecfeff; color: #0e7490; border: 1px solid #cffafe; }

footer { margin-top: 14px; text-align: center; color: var(--muted); font-size: .85rem; padding-bottom: 10px;}

/* Print styles */
@media print {
    body { background: white; }
    .wrapper { max-width: auto; margin: 0; padding: 0; }
    .card { box-shadow: none; border-color: #ddd; }
    .resume { display: block; }
    a { text-decoration: none; color: inherit; }
    .item { break-inside: avoid; }
    .section { margin: 0 0 12px; }
    footer { display: none; }
}