:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #4b5567;
  --line: #dde2ea;
  --accent: #0b6bcb;
  --accent-strong: #0855a3;
  --accent-soft: #e6f0fb;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 6%);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --max: 980px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #121b2d;
    --text: #e6eaf2;
    --muted: #a3adbf;
    --line: #23304a;
    --accent: #5aa9ff;
    --accent-strong: #8cc4ff;
    --accent-soft: #15253f;
    --on-accent: #0b1220;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .reveal-section h2::after { transform: none !important; }
  .role:hover, .cert-group:hover, .card:hover, .btn:hover { transform: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font);
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0; }

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }

.muted { color: var(--muted); font-weight: 400; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }

.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; font-weight: 650; }
.brand:hover { color: var(--text); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: .85rem;
  letter-spacing: .02em;
}

.nav-links { display: flex; gap: .25rem; margin: 0; padding: 0; list-style: none; }

.nav-links a {
  display: block;
  padding: .45rem .7rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--text); background: var(--accent-soft); }

.nav-links .lang-switch {
  margin-left: .35rem;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: .85rem;
  font-weight: 650;
  letter-spacing: .04em;
}
.nav-links .lang-switch:hover { border-color: var(--accent); background: transparent; }

@media (max-width: 640px) {
  .brand-name { display: none; }
  .nav-links a { padding: .45rem .5rem; font-size: .9rem; }
}

@media (max-width: 420px) {
  .nav { gap: .4rem; }
  .nav-links { gap: 0; }
  .nav-links a { padding: .4rem .28rem; font-size: .84rem; }
  .nav-links .lang-switch { margin-left: .1rem; font-size: .78rem; }
}

@media (max-width: 480px) {
  .brand { display: none; }
  .nav { justify-content: center; }
}

@media (max-width: 340px) {
  .nav-links a { padding-inline: .2rem; font-size: .76rem; }
  .nav-links .lang-switch { padding-inline: .3rem; font-size: .72rem; }
}

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  padding-block: clamp(3rem, 8vw, 5.5rem) 2.5rem;
}

.hero-network {
  position: absolute;
  top: 0;
  left: -1.25rem;
  z-index: -1;
  width: calc(100% + 2.5rem);
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 62% 48%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 85% at 62% 48%, #000 35%, transparent 100%);
  animation: fade-in 1.4s ease-out both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.hero-photo, .eyebrow, .hero h1, .lead, .hero-actions {
  animation: rise .55s cubic-bezier(.2, .7, .2, 1) both;
}
.eyebrow { animation-delay: 80ms; }
.hero h1 { animation-delay: 160ms; }
.lead { animation-delay: 240ms; }
.hero-actions { animation-delay: 320ms; }

@media (max-width: 640px) {
  .hero-network {
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 45%, #000 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 90% 70% at 50% 45%, #000 30%, transparent 100%);
  }
}

.hero-photo img {
  width: clamp(150px, 24vw, 240px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.eyebrow {
  margin: 0 0 .6rem;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 3.75rem); font-weight: 600; letter-spacing: -.01em; }

.lead { max-width: 36rem; margin: 1rem 0 1.75rem; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.2rem); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: .975rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-ghost { background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
}

/* Facts */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.facts-grid > div { padding: 1.1rem 1.25rem; border-left: 1px solid var(--line); }
.facts-grid > div:first-child { border-left: 0; }
.facts-grid dt { color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.facts-grid dd { margin: .25rem 0 0; font-weight: 650; }

@media (max-width: 760px) {
  .facts-grid { grid-template-columns: 1fr 1fr; }
  .facts-grid > div:nth-child(3) { border-left: 0; }
  .facts-grid > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* Sections */
.section { padding-block: clamp(2.5rem, 6vw, 4rem); }

.section h2 {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: 1.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.2rem);
  font-weight: 600;
}
.section h2::after { content: ""; flex: 1; height: 1px; background: var(--line); transform-origin: left; }

.reveal-section h2::after { transform: scaleX(0); transition: transform .9s cubic-bezier(.2, .7, .2, 1) .15s; }
.reveal-section.is-visible h2::after { transform: none; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

.subhead { margin: 3rem 0 1.25rem; color: var(--muted); font-size: 1rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }

.prose { max-width: 44rem; }
.prose p { margin: 0 0 1rem; }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.tags li {
  padding: .35rem .8rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: .9rem;
  font-weight: 550;
}

/* Timeline */
.timeline { position: relative; margin: 0; padding: 0; list-style: none; display: grid; gap: 1.25rem; }

.role {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.role-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  height: 96px;
  padding: .9rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.role-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; min-height: 0; object-fit: contain; }
.role-logo-tall { height: 120px; }
.role-logo-text {
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-align: center;
}
.timeline-compact .role-logo-text { font-size: .9rem; }

.role-meta { margin: 0 0 .3rem; color: var(--muted); font-size: .875rem; font-weight: 550; font-variant-numeric: tabular-nums; }

.role h3, .role h4, .card h3 { font-size: 1.2rem; font-weight: 650; }

.role-org { margin: .25rem 0 .75rem; font-weight: 550; }
.role-org a { text-decoration: none; }
.role-org a:hover { text-decoration: underline; }

.role-body > p:last-child { margin-bottom: 0; }
.role-body p { margin: 0 0 .75rem; }

.steps, .bullets { margin: 0 0 .9rem; padding-left: 1.1rem; }
.steps li, .bullets li { margin-bottom: .35rem; }
.steps li::marker, .bullets li::marker { color: var(--accent); }

.timeline-compact .role { grid-template-columns: 130px 1fr; padding: 1.25rem; }
.timeline-compact .role-logo { height: 76px; padding: .6rem .75rem; }
.timeline-compact h4 { font-size: 1.075rem; }

@media (max-width: 640px) {
  .role, .timeline-compact .role { grid-template-columns: 1fr; gap: 1rem; }
  .role-logo, .timeline-compact .role-logo { justify-self: start; width: 160px; height: 72px; }
  .role-logo-tall { height: 96px; }
}

/* Education & contact */
.card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card .role-org { margin-bottom: 0; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); text-decoration: underline; }

.article-card { max-width: 44rem; margin-top: 2rem; }

.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 760px) {
  .edu-grid { grid-template-columns: 1fr; }
}

.cert-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.25rem; }
.cert-group {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cert-group h3 { margin-bottom: .9rem; font-size: 1.05rem; font-weight: 650; }
.certs { margin: 0; padding: 0; list-style: none; }
.certs li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .55rem 0;
  border-top: 1px solid var(--line);
  font-size: .95rem;
  font-weight: 550;
}
.certs li:first-child { border-top: 0; padding-top: 0; }
.cert-meta { flex-shrink: 0; color: var(--muted); font-size: .85rem; font-weight: 500; font-variant-numeric: tabular-nums; }

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

/* Hover polish */
:where(.role, .card, .cert-group) { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.role-logo { transition: border-color .25s ease; }

@media (hover: hover) {
  .role:hover, .cert-group:hover, .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgb(15 23 42 / 6%), 0 14px 32px rgb(15 23 42 / 10%);
  }
  .role:hover, .cert-group:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
  .role:hover .role-logo { border-color: var(--accent); }
}

.contact { max-width: 44rem; }
.contact p { margin: 0 0 1.25rem; }

.social { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.social a {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.social a:hover { border-color: var(--accent); color: var(--accent); }

/* Footer */
.site-footer { margin-top: 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; }
.footer-inner p { margin: 0; }

/* 404 */
.not-found { min-height: 60vh; display: grid; place-content: center; text-align: center; padding-block: 4rem; }
.not-found p { color: var(--muted); }

/* Print: a clean, ink-friendly CV */
@media print {
  :root {
    --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --line: #ccc;
    --accent: #0b6bcb; --accent-strong: #0855a3; --accent-soft: #fff; --shadow: none;
  }
  @page { margin: 14mm; }
  body { font-size: 10.5pt; line-height: 1.45; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .site-header, .site-footer, .skip-link, .hero-actions, .tags, .social, .hero-network { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .reveal-section h2::after { transform: none !important; }
  .container { width: 100%; }
  .hero { padding: 0 0 1rem; gap: 1.5rem; grid-template-columns: auto 1fr; text-align: left; }
  .hero-photo img { width: 110px; border: 0; box-shadow: none; }
  h1 { font-size: 24pt; }
  .lead { margin: .4rem 0 0; }
  .section { padding-block: .9rem; }
  .section h2 { margin-bottom: .6rem; font-size: 15pt; }
  .subhead { margin: 1rem 0 .5rem; }
  .facts-grid { border-radius: 0; }
  .facts-grid > div { padding: .5rem .75rem; }
  .timeline { gap: .5rem; }
  .role, .timeline-compact .role { grid-template-columns: 90px 1fr; gap: 1rem; padding: .6rem 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; break-inside: avoid; }
  .role-logo, .timeline-compact .role-logo { width: 90px; height: 48px; padding: .3rem; border: 0; }
  .card { padding: .6rem 0; border: 0; }
  .article-card { display: none; }
  .cert-groups { gap: 1rem; margin-top: .5rem; }
  .cert-group { padding: 0; border: 0; break-inside: avoid; }
  .certs li { padding: .25rem 0; font-size: 9.5pt; }
  a { color: inherit; text-decoration: none; }
  .contact p::after { content: " robert.sprenkels@kaspersky.com · linkedin.com/in/robertsprenkels"; display: block; margin-top: .25rem; font-weight: 600; }
  .edu-grid { gap: 1rem; }
  .lang-switch { display: none; }
}
