/* ==========================================================================
   Maarten Vandeperre · shared site styles
   Dark-first design with a light theme (html[data-theme="light"]).
   ========================================================================== */

:root {
  --bg: #070b16;
  --bg-2: #0c1222;
  --surface: rgba(255,255,255,0.04);
  --surface-strong: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.09);
  --text: #e8ecf5;
  --muted: #94a0b8;
  --accent: #4f8cff;
  --accent-2: #8b5cf6;
  --red: #ee0000;
  --glow: rgba(79,140,255,0.35);
  --radius: 18px;
  --maxw: 1180px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 116px;        /* navigation height at the top of the page */
  --nav-h-small: 76px;   /* navigation height once scrolled */
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-2: #eef1f8;
  --surface: rgba(10,20,50,0.035);
  --surface-strong: rgba(10,20,50,0.06);
  --border: rgba(10,20,50,0.1);
  --text: #0d1426;
  --muted: #55607a;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --glow: rgba(37,99,235,0.2);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h-small) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; letter-spacing: -0.02em; margin: 0; color: var(--text); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.grad-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--red));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Nav ---------- */
.nav {
  display: block; margin: 0; /* neutralise Bootstrap's .nav on article pages */
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: 16px; transition: height .35s ease; }
.nav.scrolled .wrap { height: var(--nav-h-small); }
.brand { display: flex; align-items: center; gap: 18px; font-family: var(--display); font-weight: 700; font-size: 1.9rem; white-space: nowrap; letter-spacing: -0.02em; transition: font-size .35s ease, gap .35s ease; }
.brand img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); box-shadow: 0 10px 30px -12px var(--glow); transition: width .35s ease, height .35s ease, transform .3s, border-color .3s; }
.brand:hover img { transform: rotate(-6deg) scale(1.05); border-color: var(--accent); }
.nav.scrolled .brand { font-size: 1.4rem; gap: 14px; }
.nav.scrolled .brand img { width: 52px; height: 52px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: .93rem; font-weight: 500;
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-strong); }
.nav-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1rem;
  transition: transform .2s, background .2s;
}
.icon-btn:hover { transform: translateY(-1px); background: var(--surface-strong); }
.menu-btn { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  border: 1px solid transparent; cursor: pointer; font-family: var(--font); line-height: 1.2; color: inherit; background: none;
}
.btn-primary { background: linear-gradient(100deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 30px -8px var(--glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -10px var(--glow); color: #fff; }
.btn-ghost { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn-ghost:hover { background: var(--surface-strong); transform: translateY(-2px); color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: .85rem; }

/* ---------- Shared sections ---------- */
section { padding: 100px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 44px; flex-wrap: wrap; }
.kicker { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--muted); max-width: 560px; margin: 14px 0 0; }
.link-arrow { color: var(--text); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.link-arrow i { transition: transform .2s; }
.link-arrow:hover i { transform: translateX(4px); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .3s, border-color .3s, background .3s, box-shadow .3s;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 24px 50px -28px var(--glow); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .72rem; padding: 3px 9px; border-radius: 999px; background: var(--surface-strong); color: var(--muted); }
.chip { font-size: .8rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); }

/* Page header used on inner pages */
.page-hero { position: relative; padding: calc(var(--nav-h) + 50px) 0 50px; overflow: hidden; }
.page-hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 700px; z-index: -1;
  background:
    radial-gradient(520px 340px at 80% 30%, rgba(79,140,255,0.2), transparent 70%),
    radial-gradient(420px 300px at 15% 10%, rgba(139,92,246,0.16), transparent 70%);
  filter: blur(10px);
}
.page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .45;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 70%);
}
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; }
.page-hero p { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 18px 0 0; }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0 calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: .88rem; border-top: 1px solid var(--border); margin-top: 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.site-footer a:hover { color: var(--text); }
.site-footer .socials { display: flex; gap: 8px; }

/* ---------- Video dialog ---------- */
dialog.video-dialog { padding: 0; border: 0; background: transparent; width: min(1000px, 94vw); max-width: none; overflow: visible; }
dialog.video-dialog::backdrop { background: rgba(3,6,14,.85); backdrop-filter: blur(6px); }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.dialog-close { position: absolute; top: -48px; right: 0; color: #fff; }

/* ---------- Video / talk cards ---------- */
.talk { overflow: hidden; display: flex; flex-direction: column; text-align: left; color: inherit; font: inherit; padding: 0; }
.talk .thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #10204a, #1b1240 60%, #3a0a1a); cursor: pointer; border: 0; padding: 0; width: 100%; display: block; }
.talk .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; display: block; }
.talk:hover .thumb img { transform: scale(1.05); }
.talk .play { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.55)); }
.talk .play span {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; color: #fff;
  background: rgba(238,0,0,.92); box-shadow: 0 10px 30px -5px rgba(238,0,0,.6); transition: transform .25s;
}
.talk:hover .play span { transform: scale(1.12); }
.talk .thumb .no-video { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: #fff; }
.talk .thumb .no-video b { font-family: var(--display); font-size: 1.35rem; display: block; }
.talk .thumb .no-video span { font-size: .8rem; opacity: .7; }
.talk .meta { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.talk .event { font-size: .8rem; color: var(--accent); font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
.talk .event time { color: var(--muted); font-weight: 500; white-space: nowrap; }
.talk h3 { font-size: 1.05rem; line-height: 1.35; font-weight: 600; }
.talk .kind { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.talk .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }

/* ---------- Article cards ---------- */
.post { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.post time { font-size: .8rem; color: var(--muted); }
.post h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 600; }
.post p { color: var(--muted); font-size: .92rem; margin: 0; flex: 1; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post .read { font-weight: 600; font-size: .9rem; display: inline-flex; gap: 6px; align-items: center; color: var(--accent); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ---------- Listing pages (talks, blog) ---------- */
.toolbar {
  position: sticky; top: calc(var(--nav-h-small) + env(safe-area-inset-top, 0px)); z-index: 20;
  padding: 14px 0; margin-bottom: 26px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.toolbar-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { position: relative; flex: 1 1 260px; }
.search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.field {
  width: 100%; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: .95rem; outline: none; transition: border-color .2s, background .2s;
}
.field:focus { border-color: var(--accent); background: var(--surface-strong); }
.search .field { padding-left: 42px; }
select.field { width: auto; padding-right: 36px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='%2394a0b8'%3E%3Cpath d='M1.6 4.6a.75.75 0 0 1 1.06 0L8 9.94l5.34-5.34a.75.75 0 1 1 1.06 1.06l-5.87 5.87a.75.75 0 0 1-1.06 0L1.6 5.66a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
select.field option { background: var(--bg-2); color: var(--text); }
.tag-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; max-height: 78px; overflow: hidden; transition: max-height .3s; }
.tag-filter.expanded { max-height: 1200px; }
.tag-btn {
  font: inherit; font-size: .8rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; transition: all .2s;
}
.tag-btn:hover { color: var(--text); border-color: var(--muted); }
.tag-btn.active { background: linear-gradient(100deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.toolbar-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 12px; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.text-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.empty { text-align: center; padding: 80px 20px; color: var(--muted); grid-column: 1 / -1; }
.empty i { font-size: 2.4rem; display: block; margin-bottom: 12px; }
.year-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; margin: 18px 0 2px; }
.year-divider span { font-family: var(--display); font-size: 1.6rem; font-weight: 700; }
.year-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.year-divider small { color: var(--muted); font-size: .85rem; order: 2; }

/* ---------- Article pages (blog/*.html) ---------- */
.article-page { padding-top: calc(var(--nav-h) + 20px); }
.article-wrap { max-width: 780px; margin: 0 auto; padding: 0 24px; }
.article-wrap .container { max-width: none; padding: 0; }
.article-wrap section { padding: 0; background: none !important; }
.blog-post-content header h1 { font-size: clamp(2rem, 5vw, 3rem) !important; font-weight: 700; margin-bottom: 18px !important; }
.blog-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .9rem; }
.blog-meta .text-muted, .blog-meta span { margin-left: 0 !important; }
.blog-meta i { margin-right: 6px; }
.blog-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 8px; }
.blog-tags .badge { font-family: var(--font); font-weight: 500; font-size: .75rem; padding: 5px 11px; border-radius: 999px; background: var(--surface-strong) !important; color: var(--muted) !important; margin: 0 !important; }
.blog-content { font-size: 1.07rem; line-height: 1.8; color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.blog-content h2 { font-size: 1.75rem; margin: 2.2em 0 .6em; }
.blog-content h3 { font-size: 1.3rem; margin: 1.8em 0 .5em; }
.blog-content h4, .blog-content h5, .blog-content h6 { font-family: var(--display); color: var(--text); margin: 1.4em 0 .4em; }
.blog-content p, .blog-content ul, .blog-content ol { margin: 0 0 1.15em; }
.blog-content li { margin-bottom: .4em; }
.blog-content a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.blog-content a:hover { text-decoration-color: var(--accent); }
.blog-content strong { color: var(--text); }
.blog-content .lead, .blog-content .lead p { font-size: 1.2rem; color: var(--text); font-weight: 400; }
.blog-content code { font-family: var(--mono); font-size: .88em; background: var(--surface-strong); padding: 2px 6px; border-radius: 6px; color: var(--text); }
.blog-content pre { background: #0a0f1d; color: #dbe4ff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; overflow-x: auto; font-size: .88rem; line-height: 1.6; }
.blog-content pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.blog-content img { border-radius: 14px; }
.blog-content figure { margin: 2em 0; }
.blog-content figcaption, .blog-content .figure-caption { color: var(--muted); font-size: .88rem; margin-top: 10px; text-align: center; }
.blog-content blockquote { border-left: 3px solid var(--accent); margin: 1.5em 0; padding: .4em 0 .4em 1.2em; color: var(--text); font-style: italic; }
.blog-content hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }

/* Bootstrap components used inside archived articles, re-themed */
.article-page .alert { border-radius: 16px; padding: 18px 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text); margin-bottom: 1.4em; }
.article-page .alert-info { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.article-page .alert-success { background: color-mix(in srgb, #10b981 11%, transparent); border-color: color-mix(in srgb, #10b981 35%, transparent); }
.article-page .alert-warning { background: color-mix(in srgb, #f59e0b 11%, transparent); border-color: color-mix(in srgb, #f59e0b 35%, transparent); }
.article-page .alert-primary { background: color-mix(in srgb, var(--accent-2) 11%, transparent); border-color: color-mix(in srgb, var(--accent-2) 35%, transparent); }
.article-page .alert-light, .article-page .bg-light { background: var(--surface) !important; border-color: var(--border) !important; color: var(--text); }
.article-page .alert h5, .article-page .alert h6, .article-page .alert-heading { color: var(--text); font-family: var(--display); }
.article-page .alert-link { color: var(--accent); }
.article-page .alert p:last-child { margin-bottom: 0; }
.article-page .card { background: var(--surface); border-color: var(--border); color: var(--text); }
.article-page .card:hover { transform: none; box-shadow: none; }
.article-page .card-header { background: var(--surface-strong); border-color: var(--border); }
.article-page .table { color: var(--text); --bs-table-color: var(--text); --bs-table-bg: transparent; --bs-table-striped-bg: var(--surface); --bs-table-striped-color: var(--text); --bs-table-border-color: var(--border); border-color: var(--border); font-size: .95rem; }
.article-page .table th { color: var(--text); font-family: var(--display); }
.article-page .table td, .article-page .table th { padding: .75rem; vertical-align: top; }
.article-page .text-muted { color: var(--muted) !important; }
.article-page .text-primary { color: var(--accent) !important; }
.article-page .text-success { color: #34d399 !important; }
.article-page .text-danger { color: #f87171 !important; }
.article-page .text-warning { color: #fbbf24 !important; }
.article-page .text-info { color: #38bdf8 !important; }
.article-page .border-primary { border-color: color-mix(in srgb, var(--accent) 45%, transparent) !important; }
.article-page .card-title { font-family: var(--display); color: var(--text); }
.article-page .card-text { color: var(--muted); }
.article-page .row { --bs-gutter-x: 1.25rem; }
.article-page .border-top, .article-page .border, .article-page .border-bottom { border-color: var(--border) !important; }
.article-page .list-group-item { background: var(--surface); border-color: var(--border); color: var(--text); }
.article-page .btn-outline-primary { border-color: var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 10px 18px; }
.article-page .btn-outline-primary:hover { background: var(--surface-strong); color: var(--text); border-color: var(--border); }
.article-page .btn-primary { border: 0; border-radius: 999px; padding: 10px 18px; }
.article-page .btn-outline-secondary { border-color: var(--border); color: var(--muted); border-radius: 999px; }
.blog-footer { color: var(--muted); }
.blog-footer a { color: var(--accent); }

/* Reading progress bar on articles */
.progress-bar-top { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--red)); }

/* ---------- CV page ---------- */
.cv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.cv-col h3.resume-title { font-size: 1.5rem; margin: 0 0 22px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cv-col h3.resume-title small { font-family: var(--font); font-size: .85rem; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.cv-col h3.resume-title:not(:first-child) { margin-top: 48px; }
.resume-item { position: relative; padding: 0 0 26px 26px; border-left: 2px solid var(--border); }
.resume-item::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.resume-item h4 { font-size: 1.05rem; font-weight: 600; text-transform: none; line-height: 1.35; }
.resume-item h4 small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.resume-item h5 { display: inline-block; font-family: var(--font); font-size: .78rem; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 3px 10px; border-radius: 999px; margin: 8px 0 6px; letter-spacing: 0; }
.resume-item p, .resume-item li, .cv-col > p { color: var(--muted); font-size: .95rem; }
.resume-item p { margin: 6px 0; }
.resume-item em a, .resume-item a, .cv-col a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.resume-item em { font-style: normal; }
.resume-item ul { padding-left: 18px; margin: 8px 0; }
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 40px; }
.skill-row { display: grid; gap: 6px; }
.skill-row .top { display: flex; justify-content: space-between; font-size: .92rem; gap: 12px; }
.skill-row .top span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.skill-bar { height: 6px; border-radius: 999px; background: var(--surface-strong); overflow: hidden; }
.skill-bar div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width 1.2s cubic-bezier(.2,.7,.2,1); }
.in .skill-bar div, .skill-bar.in div { width: var(--w); }
.experience-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.experience { padding: 22px 24px; }
.experience h4 { font-size: 1.02rem; margin-bottom: 8px; }
.experience p { color: var(--muted); font-size: .9rem; margin: 0; }
.logo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.logo-wall div { aspect-ratio: 1; border-radius: 14px; background: #fff; display: grid; place-items: center; padding: 16px; border: 1px solid var(--border); transition: transform .25s; }
.logo-wall div:hover { transform: translateY(-3px) rotate(-2deg); }
.logo-wall img { max-height: 100%; object-fit: contain; }
.paper { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.paper a { display: block; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.paper img { display: block; width: 100%; transition: transform .4s; }
.paper a:hover img { transform: scale(1.02); }
.cv-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .cv-grid, .experience-grid { grid-template-columns: 1fr 1fr; }
  .cv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --nav-h: 88px; --nav-h-small: 68px; }
  .brand { font-size: 1.15rem; gap: 10px; }
  .brand img { width: 56px; height: 56px; }
  .nav.scrolled .brand { font-size: 1.05rem; gap: 10px; }
  .nav.scrolled .brand img { width: 44px; height: 44px; }
  .menu-btn { display: inline-grid; }
  .nav-links {
    position: absolute; top: 100%; left: 16px; right: 16px; flex-direction: column; align-items: stretch;
    padding: 10px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--border);
    display: none; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 16px; }
  section { padding: 72px 0; }
  .wrap, .article-wrap { padding: 0 16px; }
  .grid-3, .experience-grid, .skills-grid, .paper { grid-template-columns: 1fr; }
  .page-hero { padding-top: calc(var(--nav-h) + 24px); }
  .toolbar-row select.field { flex: 1 1 140px; }
}
@media (max-width: 380px) {
  .brand { font-size: 1rem; gap: 8px; }
  .brand img { width: 46px; height: 46px; }
}
