/* System fonts only: no third-party font requests (no Google Fonts, no GDPR notice needed). */
:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #1b1d22;
  --muted: #5d6270;
  --line: #e4e0d8;
  --accent: #1f5f8b;
  --accent-soft: #e6eff6;
  --ok: #276b43;
  --ok-soft: #e5f3ea;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131417;
    --surface: #1b1d21;
    --ink: #ecebe8;
    --muted: #a3a7b1;
    --line: #2c2f35;
    --accent: #7cb6e0;
    --accent-soft: #1b2a36;
    --ok: #74c793;
    --ok-soft: #18291f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
/* Links inside running text are underlined: colour alone is not enough contrast against body text. */
.legal a, .lead a, .card p a, .project .links a { text-decoration: underline; text-underline-offset: 2px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* Top nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav .brand { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); }
.nav ul { display: flex; gap: 22px; list-style: none; font-size: 14px; }
.nav ul a { color: var(--muted); }
.nav ul a:hover { color: var(--ink); text-decoration: none; }
@media (max-width: 720px) { .nav ul li:not(:last-child) { display: none; } }
.nav .wrap > ul { margin-left: auto; }
.lang { display: flex; gap: 2px; margin-left: 18px; font-size: 13px; font-weight: 600; }
.lang a { color: var(--muted); padding: 3px 7px; border-radius: 6px; }
.lang a:hover { color: var(--ink); text-decoration: none; }
.lang a[aria-current] { color: var(--ink); background: var(--accent-soft); }
.lang-hint { background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.lang-hint .wrap { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px; }
.lang-hint a { font-weight: 600; }
.lang-hint button { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }

/* Hero */
.hero { padding: 64px 0 48px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 220px; gap: 48px; align-items: center; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ok-soft); color: var(--ok);
  font-size: 13px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 20px;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(38px, 6vw, 56px); line-height: 1.08; letter-spacing: -0.01em;
}
.role { font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); margin: 14px 0 22px; max-width: 34em; }
.role strong { color: var(--ink); font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0e1a24; } }
.btn svg { width: 17px; height: 17px; flex: none; }
.portrait {
  width: 220px; height: 220px; border-radius: 50%; object-fit: cover;
  border: 6px solid var(--surface); box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
@media (max-width: 720px) {
  .hero { padding: 36px 0 32px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .portrait { order: -1; width: 128px; height: 128px; border-width: 4px; }
}
@media (max-width: 480px) { .hero .btn.primary { flex: 1 0 100%; justify-content: center; } }

/* Key numbers */
.stats { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 20px; }
.stat b { display: block; font-family: var(--serif); font-size: 30px; line-height: 1.1; color: var(--accent); }
.stat span { font-size: 13.5px; color: var(--muted); }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Sections */
section { padding: 56px 0 8px; scroll-margin-top: 60px; }
h2 {
  font-family: var(--serif); font-weight: 600; font-size: 28px; margin-bottom: 8px;
}
.lead { color: var(--muted); max-width: 40em; margin-bottom: 28px; }
h3 { font-size: 17px; line-height: 1.35; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.card .icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 14px;
}
.card .icon svg { width: 20px; height: 20px; }
.card p { color: var(--muted); font-size: 15px; margin: 8px 0 12px; }
.card ul { list-style: none; font-size: 14.5px; }
.card li { padding: 3px 0 3px 18px; position: relative; }
.card li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }

/* Experience timeline */
.job { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 24px 0; border-top: 1px solid var(--line); }
.job:first-of-type { border-top: 0; padding-top: 4px; }
.job .when { color: var(--muted); font-size: 14px; }
.job .when b { display: block; color: var(--ink); font-weight: 600; font-size: 15px; }
.job .co { color: var(--muted); font-size: 15px; margin: 2px 0 10px; }
.job ul { padding-left: 18px; }
.job li { margin: 4px 0; }
.job .stack { margin-top: 10px; }
.sub { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
@media (max-width: 720px) { .job { grid-template-columns: 1fr; gap: 6px; } }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 13px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}

/* Projects */
.project { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.project .links { display: flex; gap: 14px; font-size: 14.5px; font-weight: 600; margin-top: 14px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.placeholder { border-style: dashed; display: grid; place-items: center; text-align: center; color: var(--muted); min-height: 120px; }

/* Skills */
.skills { display: grid; grid-template-columns: 180px 1fr; gap: 14px 24px; align-items: baseline; }
.skills dt { font-weight: 600; font-size: 15px; }
@media (max-width: 720px) { .skills { grid-template-columns: 1fr; gap: 6px; } .skills dd { margin-bottom: 12px; } }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .two { grid-template-columns: 1fr; } }
.one { display: grid; grid-template-columns: 1fr; gap: 16px; }
.plain { list-style: none; }
.plain li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.plain li span { margin-left: auto; }
.card h3 + .plain { margin-top: 10px; }
.card .plain + h3 { margin-top: 22px; }
.plain li:first-child { border-top: 0; }
.plain li span { color: var(--muted); }

/* Working together */
.facts { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.facts li { display: grid; grid-template-columns: 180px 1fr; gap: 4px 24px; padding: 14px 22px; border-top: 1px solid var(--line); }
.facts li:first-child { border-top: 0; }
.facts b { font-weight: 600; }
.facts span { color: var(--muted); }
@media (max-width: 720px) { .facts li { grid-template-columns: 1fr; } }

/* Contact */
.contact { margin: 56px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; }
.contact h2 { margin-bottom: 6px; }
@media (max-width: 720px) { .contact { padding: 24px; } }

footer { padding: 36px 0 48px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer nav { display: flex; gap: 18px; }
footer a { color: var(--muted); }

/* Legal pages */
.legal { max-width: 720px; padding: 48px 20px 24px; margin: 0 auto; }
.legal h1 { font-size: 38px; margin-bottom: 24px; }
.legal h2 { font-size: 20px; margin: 28px 0 8px; }
.legal p, .legal address { color: var(--ink); font-style: normal; margin-bottom: 10px; }
.legal .note { color: var(--muted); font-size: 14px; }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

@media print {
  /* Force the light palette: a dark-mode device would otherwise print light text on white. */
  :root, :root:not([data-theme="light"]) {
    --bg: #fff; --surface: #fff; --ink: #000; --muted: #444; --line: #ccc;
    --accent: #1f5f8b; --accent-soft: #eef3f7; --ok: #276b43; --ok-soft: #fff;
    color-scheme: light;
  }
  body { background: #fff; font-size: 13px; }
  .nav, .lang-hint, .hero .actions, footer { display: none !important; }
  .hero { padding: 0 0 20px; }
  .hero .wrap { grid-template-columns: 1fr 120px; gap: 24px; }
  .portrait { width: 120px; height: 120px; box-shadow: none; border-width: 0; }
  section { padding-top: 22px; }
  .contact { margin-top: 24px; padding: 20px; }
  .contact .btn { border: 0; padding: 0; background: none; color: var(--ink); }
  .contact a[href^="https"]::after { content: " (" attr(href) ")"; font-weight: 400; color: var(--muted); }
  .job, .card, .stat, .facts li { break-inside: avoid; }
  h2 { break-after: avoid; }
}
