/* ============ Tokens ============
   One accent hue in both modes: LIGHT UP orange #f57e51.
   --accent       fills: buttons, logo on hover, lines, dots, highlights
   --accent-text  orange text (large numbers, section numbers); a touch deeper
                  in light mode so it stays readable on white                */
:root {
  --bg: #fafaf9;
  --bg-elev: #ffffff;
  --text: #1c1917;
  --muted: #57534e;
  --border: #e7e5e4;
  --accent: #f57e51;
  --accent-deep: #c85a30;
  --accent-text: #d9581f;
  --accent-soft: rgba(245, 126, 81, 0.16);
  --mark-bg: rgba(245, 126, 81, 0.42);
  --on-accent: #1c1917;
  --keycap-bg: #ffffff;
  --keycap-edge: #d6d3d1;
  --keycap-hover-text: #ffffff;   /* text flips to the opposite of its resting colour */

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --header-h: 64px;
  --maxw: 1080px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0c0a09;
  --bg-elev: #1c1917;
  --text: #f5f5f4;
  --muted: #a8a29e;
  --border: #292524;
  --accent-text: #f57e51;
  --accent-soft: rgba(245, 126, 81, 0.16);
  --mark-bg: rgba(245, 126, 81, 0.38);
  --keycap-bg: #1c1917;
  --keycap-edge: #44403c;
  --keycap-hover-text: #1c1917;
  color-scheme: dark;
}

/* Without JavaScript: follow the system setting */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0c0a09; --bg-elev: #1c1917; --text: #f5f5f4; --muted: #a8a29e;
    --border: #292524; --accent-text: #f57e51; --mark-bg: rgba(245, 126, 81, 0.38);
    --keycap-bg: #1c1917; --keycap-edge: #44403c; --keycap-hover-text: #1c1917;
    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
a { color: inherit; }
::selection { background: var(--accent-soft); }

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Logo: a neutral keyboard key that lights up and presses down on hover */
.brand { text-decoration: none; }
.keycap {
  display: inline-block;
  padding: 5px 9px 6px;
  font: 700 0.92rem/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--text);
  background: var(--keycap-bg);
  border: 1px solid var(--keycap-edge);
  border-radius: 8px;
  box-shadow: inset 0 -3px 0 var(--keycap-edge);
  transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
.brand:hover .keycap,
.brand:focus-visible .keycap {
  background: var(--accent);
  border-color: var(--accent-deep);
  color: var(--keycap-hover-text);
  transform: translateY(1px);
  box-shadow: inset 0 -2px 0 var(--accent-deep);
}
.brand:active .keycap { transform: translateY(2px); box-shadow: inset 0 -1px 0 var(--accent-deep); }

.site-nav { margin-left: auto; }
.site-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 4px;
}
.site-nav a {
  position: relative;
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color .15s ease, background-color .15s ease;
}
.site-nav a:hover { color: var(--text); background: var(--accent-soft); }
.site-nav a.is-active { color: var(--text); }
.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.controls { display: flex; align-items: center; gap: 8px; }
.brand + .controls { margin-left: auto; }  /* subpages without nav */

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}
.lang-switch button {
  font: 600 0.78rem/1 var(--mono);
  letter-spacing: 0.04em;
  background: none;
  border: 0;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg, .socials svg, .card-icon svg {
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
.menu-btn { display: none; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font: 600 0.98rem/1 var(--font);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }

/* ============ Hero ============ */
.hero { padding: 88px 0 80px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 0.8rem/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 3.3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
}
@media (min-width: 861px) {
  .hero h1 { white-space: nowrap; font-size: clamp(2.3rem, 4.4vw, 3.3rem); }
}
.lead {
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  line-height: 1.5;
  max-width: 36ch;
}
mark {
  background: var(--mark-bg);
  color: inherit;
  padding: 0.02em 0.22em 0.06em;
  margin: 0 -0.06em;
  border-radius: 0.3em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.roles { color: var(--muted); font-size: 0.98rem; max-width: 56ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.portrait { margin: 0; position: relative; }
.portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.portrait::after {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  z-index: -1;
}

/* ============ Sections ============ */
.section {
  padding: 88px 0;
  border-top: 1px solid var(--border);
}
.section-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-weight: 750;
  margin-bottom: 40px;
}
.num {
  font: 600 0.85rem/1 var(--mono);
  color: var(--accent-text);
  letter-spacing: 0.06em;
}
.sub-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 0.8rem/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.sub-title::before {
  content: "";
  width: 22px; height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 56px;
  align-items: center;
}
.prose p { max-width: 62ch; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 650; }

.stats {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  display: flex;
  flex-direction: column-reverse;  /* number on top, label below; label stays first for screen readers */
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-elev);
  padding: 24px 22px;
}
.stat dd {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-text);
}
.stat dt {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

/* Vita timeline */
.vita { margin-top: 80px; }
.timeline {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  position: relative;
}
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 32px;
  padding: 0 0 28px;
}
/* the vertical line + dot sit in the gap between date and content */
.timeline li::before {
  content: "";
  position: absolute;
  left: 135px; top: 8px; bottom: -8px;
  width: 1px;
  background: var(--border);
}
.timeline li:last-child::before { display: none; }
.timeline li::after {
  content: "";
  position: absolute;
  left: 131px; top: 5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--keycap-edge);
}
.timeline li.is-current::after { background: var(--accent); border-color: var(--accent); }
.when {
  font: 500 0.85rem/1.6 var(--mono);
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.timeline li > div { padding-left: 8px; }
.timeline h4 { font-size: 1.05rem; font-weight: 650; margin-bottom: 4px; }
.timeline .org { margin: 0 0 4px; color: var(--muted); font-size: 0.95rem; }
.timeline p { margin: 0; font-size: 0.95rem; }
.timeline p:not(.org) { max-width: 62ch; }
.org-link { margin-left: 8px; font-size: 0.85rem; font-weight: 500; letter-spacing: 0; }
.languages { color: var(--muted); font-size: 0.95rem; padding-left: 160px; }
.languages strong { color: var(--text); font-weight: 600; }

.text-link {
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--accent);
}
.text-link:hover { color: var(--accent-text); }

/* How I help */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-icon {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
  margin-bottom: 18px;
}
.card-icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.card p { color: var(--muted); margin-bottom: 18px; }
.card .proof {
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font: 600 0.8rem/1.4 var(--mono);
  letter-spacing: 0.02em;
  color: var(--text);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: start;
}
.contact-intro { font-size: 1.15rem; max-width: 36ch; }
.mail-link {
  display: inline-block;
  margin-top: 8px;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  transition: color .15s ease;
}
.mail-link:hover { color: var(--accent-text); }

.socials {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.socials a {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  transition: border-color .15s ease, color .15s ease, transform .15s ease, background-color .15s ease;
}
.socials a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  transform: translateY(-2px);
}
.socials svg { width: 20px; height: 20px; }

.contact-form {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  gap: 16px;
}
.contact-form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; }
.contact-form input,
.contact-form textarea {
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  width: 100%;
  resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.contact-form .btn { justify-self: start; }
.form-note { margin: 0; color: var(--muted); font-size: 0.85rem; }
.form-error { margin: 0; color: var(--text); font-weight: 600; font-size: 0.9rem; }
.form-error::before { content: "● "; color: var(--accent); }

/* Footer */
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; }
.footer-links a { text-decoration: none; color: var(--muted); }
.footer-links a:hover, .footer-links a[aria-current="page"] { color: var(--text); }

/* Legal pages (Impressum, Datenschutz) */
:root:not([data-lang="en"]) [data-lang-block="en"],
:root[data-lang="en"] [data-lang-block="de"] { display: none; }
.legal-note { color: var(--muted); font-size: 0.92rem; font-style: italic; }
main.legal { max-width: 760px; padding-top: 64px; padding-bottom: 88px; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 16px; }
.legal h2 { font-size: 1.15rem; margin: 40px 0 12px; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 20px; margin: 0 0 1em; }
.legal li { margin-bottom: 4px; }
.legal a { text-decoration: none; border-bottom: 1px solid var(--accent); }
.legal a:hover { color: var(--accent-text); }
.legal-lead { font-size: 1.1rem; color: var(--muted); max-width: 62ch; }
.legal-meta { margin-top: 48px; color: var(--muted); font-size: 0.92rem; }
.back-link { font-size: 0.92rem; color: var(--muted); text-decoration: none; margin-right: 8px; }
.back-link:hover { color: var(--text); }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.muted { color: var(--muted); }

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .menu-btn { display: inline-grid; }
  .controls { margin-left: auto; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .site-nav a { padding: 12px; font-size: 1.05rem; }
  .site-nav a.is-active::after { left: 12px; right: auto; width: 24px; bottom: 6px; }

  .hero { padding: 48px 0 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .portrait { order: -1; width: 168px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .cards { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .vita { margin-top: 56px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; padding-left: 26px; }
  .timeline li::before { left: 4px; top: 10px; }
  .timeline li::after { left: 0; top: 6px; }
  .when { text-align: left; }
  .timeline li > div { padding-left: 0; }
  .languages { padding-left: 0; }
  .stat { padding: 20px 18px; }
  .stat dd { font-size: 1.6rem; }
  .card, .contact-form { padding: 22px; }
  .back-link { display: none; }  /* the logo already links home */
}
