:root {
            --bg: #0f1117;
            --surface: #1a1d27;
            --surface2: #222633;
            --border: #2e3342;
            --text: #e8eaf0;
            --text-muted: #9ca3b4;
            --accent: #6c8cff;
            --accent2: #4ecdc4;
            --accent3: #ff6b6b;
            --radius: 12px;
            --maxw: 1100px;
        }

        [data-theme="light"] {
            --bg: #f5f6fa;
            --surface: #ffffff;
            --surface2: #e8eaf0;
            --border: #d1d5e0;
            --text: #1a1d27;
            --text-muted: #5a6070;
        }

        /* Color palette overrides */
        [data-palette="nord"] {
            --bg: #2e3440;
            --surface: #3b4252;
            --surface2: #434c5e;
            --border: #4c566a;
            --text: #eceff4;
            --text-muted: #d8dee9;
            --accent: #88c0d0;
            --accent2: #8fbcbb;
            --accent3: #bf616a;
        }
        [data-palette="dracula"] {
            --bg: #282a36;
            --surface: #44475a;
            --surface2: #6272a4;
            --border: #6272a4;
            --text: #f8f8f2;
            --text-muted: #bd93f9;
            --accent: #bd93f9;
            --accent2: #50fa7b;
            --accent3: #ff79c6;
        }
        [data-palette="solarized"] {
            --bg: #002b36;
            --surface: #073642;
            --surface2: #00384e;
            --border: #586e75;
            --text: #eee8d5;
            --text-muted: #93a1a1;
            --accent: #268bd2;
            --accent2: #2aa198;
            --accent3: #d33682;
        }
        [data-palette="ocean"] {
            --bg: #0f172a;
            --surface: #1e293b;
            --surface2: #334155;
            --border: #475569;
            --text: #f1f5f9;
            --text-muted: #94a3b8;
            --accent: #38bdf8;
            --accent2: #818cf8;
            --accent3: #f472b6;
        }

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

        body {
            font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
            min-height: 100vh;
            transition: background 0.3s, color 0.3s;
        }

        .container {
            max-width: var(--maxw);
            margin: 0 auto;
            padding: 2rem 1.5rem;
        }

        .theme-toggle {
            position: fixed;
            top: 1.5rem;
            right: 1.5rem;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 50%;
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1.2rem;
            z-index: 100;
            transition: all 0.2s;
        }

        .theme-toggle:hover {
            background: var(--surface2);
            transform: scale(1.05);
        }

        .palette-toggle {
            position: fixed;
            top: 5rem;
            right: 1.5rem;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 20px;
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1.2rem;
            z-index: 100;
            transition: all 0.2s;
        }
        .palette-toggle:hover {
            background: var(--surface2);
            transform: scale(1.05);
        }

        .lang-toggle {
            position: fixed;
            top: 1.5rem;
            right: 4.5rem;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 20px;
            padding: 0.4rem 0.8rem;
            display: flex;
            align-items: center;
            gap: 0.3rem;
            cursor: pointer;
            font-size: 0.85rem;
            z-index: 100;
            transition: all 0.2s;
        }

        .lang-toggle:hover {
            background: var(--surface2);
        }

        .header {
            background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 2.5rem;
            margin-bottom: 2rem;
            display: flex;
            align-items: center;
            gap: 2rem;
            flex-wrap: wrap;
        }

        .header h1 {
            display: inline-block;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--accent);
        }

        .header-avatar {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
            border: 3px solid var(--accent);
        }

        .header-info h1 {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
        }

        .header-info .tagline {
            color: var(--text-muted);
            font-size: 1.1rem;
        }

        .header-contact {
            margin-left: auto;
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
            font-size: 0.95rem;
        }

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

        .header-contact a:hover { text-decoration: underline; }

        .grid {
            display: grid;
            grid-template-columns: 1fr 340px;
            gap: 2rem;
        }

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

        .card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 1.75rem;
            margin-bottom: 1.5rem;
        }

        .card h2 {
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 1.25rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--accent);
            display: inline-block;
        }

        .timeline-item {
            position: relative;
            padding-left: 1.75rem;
            padding-bottom: 1.5rem;
            border-left: 2px solid var(--border);
        }

        .timeline-item:last-child { padding-bottom: 0; }

        .timeline-item::before {
            content: '';
            position: absolute;
            left: -7px;
            top: 4px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: var(--accent);
            border: 2px solid var(--bg);
        }

        .timeline-item .role {
            font-weight: 600;
            font-size: 1.05rem;
            margin-bottom: 0.15rem;
        }

        .timeline-item .company {
            color: var(--accent2);
            font-size: 0.9rem;
            margin-bottom: 0.4rem;
        }

        .timeline-item .period {
            color: var(--text-muted);
            font-size: 0.85rem;
            margin-bottom: 0.5rem;
        }

        .timeline-item ul {
            list-style: none;
            padding: 0;
        }

        .timeline-item ul li {
            padding: 0.15rem 0;
            color: var(--text-muted);
            font-size: 0.95rem;
        }

        .timeline-item ul li::before {
            content: '▸ ';
            color: var(--accent);
        }

        .skill-bar {
            margin-bottom: 1rem;
        }

        .skill-bar .skill-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.35rem;
            font-size: 0.9rem;
        }

        .skill-bar .skill-header span:last-child {
            color: var(--text-muted);
        }

        .skill-bar .bar {
            height: 8px;
            background: var(--surface2);
            border-radius: 4px;
            overflow: hidden;
        }

        .skill-bar .bar-fill {
            height: 100%;
            border-radius: 4px;
            transition: width 0.6s ease;
        }

        .bar-fill.bash { width: 95%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
        .bar-fill.python { width: 85%; background: linear-gradient(90deg, #3776ab, #ffd43b); }
        .bar-fill.js { width: 45%; background: linear-gradient(90deg, #f7df1e, #323330); }
        .bar-fill.html { width: 40%; background: linear-gradient(90deg, #e34c26, #f16529); }

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

        .tag {
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 20px;
            padding: 0.3rem 0.85rem;
            font-size: 0.85rem;
            color: var(--text-muted);
        }

        .lang-item {
            display: flex;
            justify-content: space-between;
            padding: 0.4rem 0;
            border-bottom: 1px solid var(--border);
        }

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

        .lang-item .lang-name { font-weight: 500; }
        .lang-item .lang-level { color: var(--text-muted); font-size: 0.9rem; }

        .about-text {
            color: var(--text-muted);
            font-size: 0.95rem;
            line-height: 1.7;
        }

        .project-item {
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 1rem 1.25rem;
            margin-bottom: 0.75rem;
        }

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

        .project-item .project-title {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 0.25rem;
        }

        .project-item .project-desc {
            color: var(--text-muted);
            font-size: 0.9rem;
            margin-bottom: 0.4rem;
        }

        .project-item .project-tech {
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
        }

        .project-item .project-tech span {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 0.15rem 0.6rem;
            font-size: 0.75rem;
            color: var(--accent);
        }

        .download-btn {
            display: block;
            width: 100%;
            gap: 0.5rem;
            background: linear-gradient(135deg, var(--accent), var(--accent2));
            color: #fff;
            border: none;
            border-radius: 8px;
            padding: 0.75rem 1.5rem;
            font-size: 0.95rem;
            font-weight: 600;
            text-decoration: none;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .download-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            width: 100%;
        }

        .download-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(108, 140, 255, 0.3);
        }

        .activity-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
        }

        .activity-card {
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 1.25rem;
            text-align: center;
            transition: transform 0.2s, border-color 0.2s;
        }

        .activity-card:hover {
            transform: translateY(-3px);
            border-color: var(--accent);
        }

        .activity-card .activity-icon {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

        .activity-card .activity-name {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 0.25rem;
        }

        .activity-card .activity-link {
            color: var(--accent);
            font-size: 0.85rem;
            text-decoration: none;
        }

        .activity-card .activity-link:hover { text-decoration: underline; }

        .contribution-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.6rem 0;
            border-bottom: 1px solid var(--border);
        }

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

        .contribution-item .contrib-icon {
            font-size: 1.2rem;
            flex-shrink: 0;
        }

        .contribution-item .contrib-text {
            flex: 1;
            font-size: 0.9rem;
        }

        .contribution-item .contrib-text a {
            color: var(--accent);
            text-decoration: none;
        }

        .contribution-item .contrib-text a:hover { text-decoration: underline; }

        .contribution-item .contrib-date {
            color: var(--text-muted);
            font-size: 0.8rem;
            flex-shrink: 0;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            margin-bottom: 1rem;
        }

        .stat-item {
            text-align: center;
            padding: 1rem;
            background: var(--surface2);
            border-radius: 8px;
        }

        .stat-item .stat-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--accent);
        }

        .stat-item .stat-label {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .footer {
            text-align: center;
            padding: 2rem 0 1rem;
            color: var(--text-muted);
            font-size: 0.85rem;
        }

        .last-updated {
            text-align: center;
            color: var(--text-muted);
            font-size: 0.8rem;
            margin-bottom: 1rem;
        }

        /* Donut chart */
        .donut-container {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 2rem;
            flex-wrap: wrap;
            margin-bottom: 1rem;
        }
        .donut-chart {
            position: relative;
            width: 180px;
            height: 180px;
        }
        .donut-chart svg {
            transform: rotate(-90deg);
        }
        .donut-chart .donut-center {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
        }
        .donut-chart .donut-center .donut-total {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--accent);
        }
        .donut-chart .donut-center .donut-label {
            font-size: 0.75rem;
            color: var(--text-muted);
        }
        .donut-legend {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .donut-legend .legend-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
        }
        .donut-legend .legend-color {
            width: 12px;
            height: 12px;
            border-radius: 3px;
        }
        .donut-legend .legend-label {
            flex: 1;
        }
        .donut-legend .legend-value {
            color: var(--text-muted);
            font-size: 0.85rem;
        }

        /* Skill Matrix */
        .skill-matrix-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 0.75rem;
            margin-top: 1rem;
        }
        .skill-matrix-cell {
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 0.75rem 0.5rem;
            text-align: center;
            font-size: 0.85rem;
            color: var(--text);
        }
        .skill-matrix-cell .skill-level {
            font-weight: 700;
            font-size: 1rem;
            color: var(--accent);
        }
        .skill-matrix-cell .skill-label {
            font-size: 0.7rem;
            color: var(--text-muted);
            margin-top: 0.25rem;
            display: block;
        }
        .skill-matrix-empty {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 2rem;
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        /* Timeline animation */
        .timeline-item {
            opacity: 0;
            transform: translateX(-20px);
            animation: slideIn 0.5s ease forwards;
        }
        .timeline-item:nth-child(1) { animation-delay: 0.1s; }
        .timeline-item:nth-child(2) { animation-delay: 0.2s; }
        .timeline-item:nth-child(3) { animation-delay: 0.3s; }
        .timeline-item:nth-child(4) { animation-delay: 0.4s; }
        .timeline-item:nth-child(5) { animation-delay: 0.5s; }
        @keyframes slideIn {
            to { opacity: 1; transform: translateX(0); }
        }

        /* Contact form */
        .contact-form {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }
        .contact-form input,
        .contact-form textarea {
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 0.75rem 1rem;
            color: var(--text);
            font-size: 0.95rem;
            font-family: inherit;
        }
        .contact-form input:focus,
        .contact-form textarea:focus {
            outline: none;
            border-color: var(--accent);
        }
        .contact-form textarea {
            min-height: 120px;
            resize: vertical;
        }
        .contact-form button {
            background: linear-gradient(135deg, var(--accent), var(--accent2));
            color: #fff;
            border: none;
            border-radius: 8px;
            padding: 0.75rem 1.5rem;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .contact-form button:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(108, 140, 255, 0.3);
        }

        /* Share buttons */
        .share-buttons {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }
        .share-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            background: var(--surface2);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 0.5rem 1rem;
            color: var(--text);
            font-size: 0.85rem;
            text-decoration: none;
            cursor: pointer;
            transition: all 0.2s;
        }
        .share-btn:hover {
            background: var(--surface);
            border-color: var(--accent);
        }

        /* Print-friendly: een CV hoort 2-3 pagina's te zijn, niet 11.
           De volledige projectlijst, heatmap en video zijn scherm-only; de PDF
           toont uitgelicht werk, ervaring, opleiding en vaardigheden. */
        @media print {
            /* Printbreedte is ~816px, net onder de 860px mobile-breakpoint.
               Zonder deze regel klapt de layout naar 1 kolom en wordt de PDF
               8 pagina's i.p.v. 3. */
            .grid { grid-template-columns: 1fr 240px !important; gap: 1rem !important; }
            .container { padding: 0 !important; max-width: none !important; }
            body { background: #fff; color: #000; font-size: 10pt; }
            .card, .header { border-color: #ddd; background: #fff; box-shadow: none; }
            .header-avatar { background: #333; }
            .theme-toggle, .lang-toggle, .share-buttons, .contact-form,
            #projects-section, #contribution-heatmap, #gource-section,
            .no-print, .last-updated { display: none !important; }
            #featured-section { display: block !important; }
            .timeline-item { opacity: 1; transform: none; animation: none; page-break-inside: avoid; }
            .donut-chart { display: none; }
            .donut-legend { display: flex; }
            /* Only small blocks avoid a page break. A section taller than a
               page (the work-experience timeline) would otherwise be pushed
               to a fresh page and leave the previous one half empty. */
            .card { margin-bottom: 0.6rem !important; padding: 0.7rem !important; }
            .card h2 { break-after: avoid; page-break-after: avoid; }
            .timeline-item { break-inside: avoid; page-break-inside: avoid; }
            .footer { page-break-before: avoid; margin-top: 0.5rem !important; font-size: 8pt !important; }
            h2 { page-break-after: avoid; font-size: 12pt !important; margin-bottom: 0.5rem !important; }
            video { display: none !important; }
            .stats-grid { gap: 0.5rem !important; }
            .stat-value { font-size: 1.4rem !important; }
            .project-item, .timeline-item { margin-bottom: 0.5rem !important; }
            .about-text { font-size: 9.5pt !important; }
        }

        /* Auto theme */
        @media (prefers-color-scheme: light) {
            :root:not([data-theme="dark"]) {
                --bg: #f5f6fa;
                --surface: #ffffff;
                --surface2: #e8eaf0;
                --border: #d1d5e0;
                --text: #1a1d27;
                --text-muted: #5a6070;
            }
        }
    
/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  overflow: visible;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem 1rem;
  z-index: 1000;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Platform cards ─────────────────────────────────────────────── */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.platform-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.platform-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--accent);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.card-icon {
  font-size: 1.25rem;
}

.card-name {
  font-weight: 700;
  font-size: 1rem;
}

.field-row {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.field-label {
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.1rem;
}

.field-value {
  font-weight: 600;
  display: block;
}

.streak-bar,
.rep-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 0.25rem;
  overflow: hidden;
}

.streak-fill,
.rep-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.streak-fill {
  background: #ff6b6b;
}

.rep-fill {
  background: #4ecdc4;
}

.card-empty {
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 1rem;
  text-align: center;
}

.card-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Proficiency badges (skill proficiency section) */
.profile-proficiency {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.profile-proficiency-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.profile-proficiency-name {
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 8rem;
  flex-shrink: 0;
}
.profile-proficiency-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}
.profile-proficiency-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.profile-proficiency-level {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 2rem;
  text-align: right;
}

/* Writing / articles list */
.article-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.article-item:last-child {
  border-bottom: none;
}
.article-item a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.article-item a:hover {
  text-decoration: underline;
}
.article-item .article-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.itchio-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

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

.itchio-item a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.itchio-item a:hover {
  text-decoration: underline;
}

/* itch.io games / projects list */
.game-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.game-item:last-child {
  border-bottom: none;
}
.game-item a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.game-item a:hover {
  text-decoration: underline;
}
.game-item .game-platform {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Volunteer / community entries */
.volunteer-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.volunteer-item:last-child {
  border-bottom: none;
}
.volunteer-item .volunteer-role {
  font-weight: 600;
  color: var(--accent);
}
.volunteer-item .volunteer-org {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.volunteer-item .volunteer-period {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Courses / learning paths */
.course-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.course-item:last-child {
  border-bottom: none;
}
.course-item .course-name {
  font-weight: 600;
  font-size: 0.85rem;
}
.course-item .course-provider {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.course-item .course-period {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Mobile: single column stack */
@media (max-width: 640px) {
  .platform-grid {
    grid-template-columns: 1fr;
  }
  .platform-card {
    padding: 0.75rem;
  }

  /* Skill matrix: 2-column grid on small screens */
  .skill-matrix-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .skill-matrix-cell {
    padding: 0.5rem 0.4rem;
    font-size: 0.8rem;
  }
  .skill-matrix-cell .skill-level {
    font-size: 0.9rem;
  }
  .skill-matrix-cell .skill-label {
    font-size: 0.65rem;
  }

  /* Donut chart: smaller on mobile */
  .donut-chart {
    width: 140px;
    height: 140px;
  }
  .donut-chart .donut-center .donut-total {
    font-size: 1.25rem;
  }
  .donut-legend {
    font-size: 0.8rem;
  }

  /* Achievements: tighter padding on mobile */
  #achievements-container > div {
    padding: 0.5rem;
  }
  #achievements-container > div > div {
    font-size: 0.8rem;
  }
  #achievements-container > div > div > div:first-child {
    font-size: 1.25rem;
  }

  /* Field rows: allow wrapping on narrow cards */
  .field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .field-value {
    white-space: normal;
  }

  /* Repos showcase: tighter cards on mobile */
  .repo-card {
    padding: 0.6rem;
    margin-bottom: 0.6rem;
  }
  .repo-header {
    flex-direction: column;
    gap: 0.4rem;
  }
  .repo-meta {
    flex-direction: column;
    gap: 0.2rem;
  }
  .repo-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Timeline: tighter spacing on mobile for expanded experience list */
  .timeline-item {
    padding: 0.6rem;
    margin-bottom: 0.4rem;
  }
  .timeline-item .role {
    font-size: 1rem;
  }
  .timeline-item .company,
  .timeline-item .period {
    font-size: 0.8rem;
  }
}

/* GitHub Repos Showcase cards */
.repo-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--card-bg);
  transition: transform 0.15s, box-shadow 0.15s;
}
.repo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-color: var(--accent);
}
.repo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.repo-name {
  font-weight: 600;
  color: var(--accent);
  word-break: break-all;
}
.repo-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.repo-desc {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.repo-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  align-items: center;
}
.repo-lang {
  font-weight: 500;
}
.repo-updated {
  font-size: 0.7rem;
}
.repo-topic {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  margin-right: 0.25rem;
}

/* Last-updated timestamps beneath live-data blocks */
.section-updated {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.4rem;
  font-style: italic;
}

/* Print: hide timestamps */
@media print {
  .section-updated {
    display: none !important;
  }
}

/* Print: hide repos showcase, keep featured */
@media print {
  #repos-showcase-section {
    display: none !important;
  }
}

/* Print: show all cards, remove backgrounds, ensure readability */
@media print {
  .platform-card {
    background: white !important;
    border: 1px solid #999 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .platform-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  .field-label {
    color: #333 !important;
  }
  .card-empty {
    display: none !important;
  }
  .streak-bar,
  .rep-bar {
    display: none !important;
  }
  .card-footer {
    display: none !important;
  }

  /* Hide Gource video in print */
  #gource-section,
  .gource-video,
  video {
    display: none !important;
  }

  /* Skill matrix: print-friendly chips */
  .skill-matrix-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.3rem !important;
  }
  .skill-matrix-cell {
    background: #f0f0f0 !important;
    color: #000 !important;
    border: 1px solid #999 !important;
    padding: 0.3rem 0.5rem !important;
    font-size: 0.75rem !important;
    break-inside: avoid;
  }
  .skill-matrix-cell .skill-level {
    color: #000 !important;
  }
  .skill-matrix-cell .skill-label {
    color: #333 !important;
  }

  /* Achievements: print-friendly badges */
  #achievements-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    gap: 0.5rem !important;
  }
  #achievements-container > div {
    background: #f0f0f0 !important;
    border: 1px solid #999 !important;
    border-radius: 6px !important;
    padding: 0.5rem !important;
    text-align: center !important;
    break-inside: avoid;
  }
  #achievements-container > div > div {
    color: #000 !important;
  }
}

/* On-screen collapse. These rules are scoped to @media screen so a printed
   CV always shows every entry — the paper version must not be truncated. */
@media screen {
  /* Collapse work experience to 4 most recent entries unless expanded */
  section.card:has(h2[data-i18n="experience"]):not(.expanded) .timeline-item:nth-child(n+5) { display: none !important; }
  section#certificates-section:not(.expanded) .timeline-item:nth-child(n+4) { display: none !important; }

  /* Collapse skills list to 3 unless expanded */
  #skills-container:not(.expanded) .skill-bar:nth-child(n+4) { display: none !important; }

  #repos-showcase-section:not(.expanded) .repo-card:nth-child(n+5) { display: none !important; }

  /* Collapse the expertise tags to 4 unless expanded */
  #expertise-section:not(.expanded) .tags .tag:nth-child(n+5) { display: none !important; }
}

/* Print: the collapse buttons have no meaning on paper. */
@media print {
  .show-more-btn { display: none !important; }

  /* Compact the work-experience timeline so the whole CV fits on paper.
     Older agency roles keep their title, company and period but drop the
     bullet detail — the full descriptions stay on the website. */
  section.card:has(h2[data-i18n="experience"]) .timeline-item {
    padding-bottom: 0.45rem;
    padding-left: 1.1rem;
  }
  section.card:has(h2[data-i18n="experience"]) .timeline-item .role { font-size: 0.92rem; margin-bottom: 0.05rem; }
  section.card:has(h2[data-i18n="experience"]) .timeline-item .company { font-size: 0.8rem; margin-bottom: 0.05rem; }
  section.card:has(h2[data-i18n="experience"]) .timeline-item .period { font-size: 0.76rem; margin-bottom: 0.15rem; }
  section.card:has(h2[data-i18n="experience"]) .timeline-item ul li { font-size: 0.82rem; padding: 0.02rem 0; }

  /* Entries 5 and up (children 6+ of the section) are shown as one-liners:
     the four most recent roles keep their bullet detail, the earlier ones
     become a compact role/company/date list. */
  section.card:has(h2[data-i18n="experience"]) .timeline-item:nth-child(n+6) ul { display: none !important; }
  section.card:has(h2[data-i18n="experience"]) .timeline-item:nth-child(n+6) { padding-bottom: 0.25rem; }
  section.card:has(h2[data-i18n="experience"]) .timeline-item:nth-child(n+6) .role,
  section.card:has(h2[data-i18n="experience"]) .timeline-item:nth-child(n+6) .company,
  section.card:has(h2[data-i18n="experience"]) .timeline-item:nth-child(n+6) .period {
    display: inline;
    font-size: 0.8rem;
    margin-right: 0.3rem;
  }
  section.card:has(h2[data-i18n="experience"]) .timeline-item:nth-child(n+6) .period { margin-bottom: 0; }

  /* Tighten the certificate timeline the same way. */
  section#certificates-section .timeline-item { padding-bottom: 0.4rem; }
  section#certificates-section .timeline-item ul li { font-size: 0.82rem; padding: 0.02rem 0; }

  /* Compact the featured projects and the skills list. */
  #featured-container .project-item { margin-bottom: 0.4rem !important; }
  #featured-container .project-desc { font-size: 8.5pt !important; }
  #featured-container .project-tech { font-size: 8pt !important; }
  .skill-bar { margin-bottom: 0.4rem !important; }
  .skill-bar .bar { height: 5px !important; }
  .card p.about-text { margin-bottom: 0.4rem !important; }
  .card ul { margin-top: 0.3rem !important; margin-bottom: 0.3rem !important; }

  /* Compact the header: keep the photo, name, contact line and intro, but
     drop the vertical padding and the avatar size. */
  .header { padding: 0.9rem !important; margin-bottom: 0.8rem !important; }
  .header-avatar { width: 78px !important; height: 78px !important; }
  .header h1 { font-size: 1.5rem !important; margin-bottom: 0.2rem !important; }
  .header-contact { gap: 0.3rem 0.9rem !important; margin-top: 0.3rem !important; }
  .header-info .about-text { font-size: 9pt !important; line-height: 1.35 !important; }
}

