:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.06);
}

[data-theme="dark"] {
  --bg: #0b0b0f;
  --surface: #15151b;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --border: #27272a;
  --accent: #818cf8;
  --accent-soft: #1e1b4b;
  --shadow: 0 8px 24px rgb(0 0 0 / 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { width: min(1100px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em;
  /* Zelfde kleurverloop als "Tom" in de titel */
  background: linear-gradient(90deg, var(--accent), #ec4899, #f59e0b, var(--accent));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: glans 6s linear infinite;
}
.nav-links { display: flex; align-items: center; gap: 28px; font-weight: 500; font-size: 0.95rem; }
.nav-links a:not(.btn):hover { color: var(--accent); }
.nav-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; font-size: 1.1rem;
}
.menu-btn { display: none; }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 600;
  transition: transform 0.2s, opacity 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-small { padding: 8px 16px; font-size: 0.9rem; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.link { color: var(--accent); font-weight: 600; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center;
  padding-block: 96px 64px;
}
.eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; margin-bottom: 12px; }
h1 { font-size: clamp(2.5rem, 6vw, 4.2rem); line-height: 1.05; letter-spacing: -0.04em; font-weight: 800; }
.lead { font-size: 1.2rem; color: var(--muted); margin-top: 20px; max-width: 34ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-photo img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 24px; box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--accent-soft), var(--border));
}

/* Sections */
.section { padding-block: 72px; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -0.03em; margin-bottom: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.small-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 14px; }

.over-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; }
.over-text p { font-size: 1.1rem; margin-bottom: 16px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li, .tag {
  padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
  background: var(--accent-soft); color: var(--accent);
}

/* Project cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 0.95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 10px; font-size: 0.75rem; }
.card-links { display: flex; gap: 16px; margin-top: auto; padding-top: 8px; font-weight: 600; font-size: 0.9rem; }
.card-links a { color: var(--accent); }

/* Gallery */
/* Kolommen even hoog: het verschil wordt over alle foto's in een kortere kolom verdeeld */
.gallery { display: flex; gap: 16px; align-items: stretch; }
.gallery .kolom { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.foto {
  position: relative; flex: 1 0 auto; margin: 0;
  border-radius: 12px; overflow: hidden; background: var(--border); cursor: zoom-in;
}
.foto img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.foto img.geladen { opacity: 1; }
.foto:hover img { transform: scale(1.04); }

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgb(0 0 0 / 0.9);
  display: grid; place-items: center; padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 90vh; border-radius: 12px; }
.lightbox-close { position: absolute; top: 16px; right: 16px; }

/* Repos */
.repos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.repo {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; display: flex; flex-direction: column; gap: 8px; transition: border-color 0.2s;
}
.repo:hover { border-color: var(--accent); }
.repo h3 { font-size: 1rem; }
.repo p { color: var(--muted); font-size: 0.9rem; flex: 1; }
.repo-meta { display: flex; gap: 16px; font-size: 0.8rem; color: var(--muted); }

/* Contact */
.contact { text-align: center; }
.contact h2 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.03em; }
.contact .lead { margin-inline: auto; }
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.footer { padding-block: 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Mobile */
@media (max-width: 800px) {
  .hero, .over-grid { grid-template-columns: 1fr; }
  .hero { padding-block: 48px; }
  .hero-photo { order: -1; max-width: 280px; }
  .menu-btn { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 20px; padding: 24px;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
}

/* ============ Extra animaties ============ */
@property --hoek { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
/* Niets mag breder zijn dan het scherm (anders kun je op mobiel zijwaarts schuiven).
   'clip' i.p.v. 'hidden' zodat de sticky menubalk blijft werken. */
html, body { overflow-x: clip; }

/* Scrollbalk bovenaan */
.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 60; width: 100%; height: 3px;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), #ec4899, #f59e0b);
}

/* Bewegende kleurvlekken achter de hero */
.hero { position: relative; }
.hero-bg { position: absolute; inset: -10% -15%; z-index: -1; pointer-events: none; }
.blob {
  position: absolute; width: 420px; aspect-ratio: 1; border-radius: 50%;
  filter: blur(90px); opacity: 0.35; animation: blob 18s ease-in-out infinite alternate;
}
.blob-1 { background: var(--accent); top: 0; left: 5%; }
.blob-2 { background: #ec4899; bottom: 0; right: 5%; opacity: 0.25; animation-delay: -6s; }
.blob-3 { background: #06b6d4; top: 30%; left: 40%; width: 320px; opacity: 0.2; animation-delay: -12s; }
[data-theme="light"] .blob { opacity: 0.18; }
@keyframes blob {
  33% { transform: translate(60px, -40px) scale(1.1); }
  66% { transform: translate(-40px, 50px) scale(0.95); }
  100% { transform: translate(20px, -20px) scale(1.05); }
}

/* Hero intro */
.intro { opacity: 0; animation: intro 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s) forwards; }
@keyframes intro {
  from { opacity: 0; transform: translateY(24px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
.eyebrow { min-height: 1.6em; }
.typing::after { content: "▍"; margin-left: 2px; animation: knipper 1s steps(1) infinite; }
@keyframes knipper { 50% { opacity: 0; } }

.hero .accent {
  background: linear-gradient(90deg, var(--accent), #ec4899, #f59e0b, var(--accent));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: glans 6s linear infinite;
}
@keyframes glans { to { background-position: 300% 0; } }

/* Profielfoto: inzoomen, zweven, gloed */
.hero-photo {
  position: relative; isolation: isolate;
  animation: foto-in 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both, zweef 6s ease-in-out 1.4s infinite;
}
.hero-photo::before {
  content: ""; position: absolute; inset: -4px; z-index: -1; border-radius: 28px;
  background: conic-gradient(from var(--hoek), var(--accent), #ec4899, #f59e0b, #06b6d4, var(--accent));
  filter: blur(18px); opacity: 0.55; animation: draai 6s linear infinite;
}
.hero-photo img { transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes foto-in { from { opacity: 0; transform: scale(0.9) rotate(-3deg); } }
@keyframes zweef { 50% { translate: 0 -12px; } }
@keyframes draai { to { --hoek: 360deg; } }

/* Menu: onderstreping + actieve sectie */
.nav-links a:not(.btn) { position: relative; }
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.3s;
}
.nav-links a:not(.btn):hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a:not(.btn).active { color: var(--accent); }
#theme-toggle { transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
#theme-toggle:hover { transform: rotate(180deg); }

/* Knoppen: glans bij hover */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, transparent 30%, color-mix(in srgb, var(--accent) 45%, transparent) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform 0.6s;
}
.btn:hover::after { transform: translateX(100%); }

/* Sectietitels: lijn groeit mee */
.section-title::after {
  content: ""; display: block; width: 48px; height: 4px; border-radius: 2px; margin-top: 12px;
  background: linear-gradient(90deg, var(--accent), #ec4899);
  transform: scaleX(0); transform-origin: left; transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s;
}
.section-title.visible::after, .visible .section-title::after { transform: scaleX(1); }

/* Skills */
.chips li { transition: opacity 0.7s ease, transform 0.3s, background 0.2s, color 0.2s; }
.chips li.visible:hover { transform: translateY(-3px) rotate(-2deg); background: var(--accent); color: var(--bg); }

/* Kaarten en repos: spotlight onder de muis */
.card, .repo { position: relative; }
.card::before, .repo::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%);
}
.card:hover::before, .repo:hover::before { opacity: 1; }
.card img { transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.card:hover img { transform: scale(1.05); }


/* Lightbox */
.lightbox:not([hidden]) { animation: vervaag 0.25s ease; }
.lightbox:not([hidden]) img { animation: zoom 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes vervaag { from { opacity: 0; } }
@keyframes zoom { from { opacity: 0; transform: scale(0.92); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .intro { opacity: 1; }
  .section-title::after { transform: none; }
}

/* Taalkeuze */
.lang-select {
  height: 40px; padding: 0 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.85rem; font-weight: 600; max-width: 150px;
}
@media (max-width: 800px) { .lang-select { max-width: 72px; padding: 0 6px; } }

/* Nog geen projecten */
.card.leeg { grid-column: 1 / -1; text-align: center; border-style: dashed; }
.card.leeg .card-body { padding: 48px 24px; align-items: center; }
.card.leeg p { max-width: 46ch; }

/* GitHub-profielkaart */
.repos:has(.gh-card) { grid-template-columns: 1fr; }
.gh-card { flex-direction: row; align-items: center; gap: 20px; padding: 24px; }
.gh-avatar { width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0; background: var(--border); }
.gh-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gh-info h3 { font-size: 1.15rem; }
.gh-info p { flex: none; }
.gh-stat { font-size: 0.8rem; color: var(--muted); }
.gh-knop { flex-shrink: 0; }
@media (max-width: 560px) {
  .gh-card { flex-direction: column; text-align: center; }
}

/* Galerij: eerst een paar rijen, rest via "Toon meer" */
.gallery:not(.alles) .foto.extra { display: none; }
.gallery-meer { display: flex; justify-content: center; margin-top: 32px; }
.gallery-meer .btn[hidden] { display: none; }

/* Mobiel: gloed achter de hero binnen de schermbreedte houden.
   -16px = de zijmarge van .container, dus de gloed loopt nog tot de schermrand. */
@media (max-width: 800px) {
  .hero-bg { inset: -10% -16px; overflow: hidden; }
  .blob { width: 300px; filter: blur(70px); }
}
