/* bernhard.ertl.one – plain CSS, no external resources */

/* ---------- Tokens ---------- */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1f23;
  --muted: #5b6470;
  --border: #e4e7eb;
  --accent: #1652d4;        /* fills: buttons, monogram, current dot */
  --accent-text: #1652d4;   /* text, links, icons, focus ring */
  --accent-soft: #e8eefb;
  --on-accent: #ffffff;
  --header-bg: rgba(250, 250, 249, 0.85);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 64rem;
  --gutter: 1.25rem;
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1215;
    --surface: #171b20;
    --text: #e6e9ed;
    --muted: #9aa4af;
    --border: #2a3038;
    --accent: #1652d4;
    --accent-text: #7fa6ff;
    --accent-soft: #16233f;
    --on-accent: #ffffff;
    --header-bg: rgba(15, 18, 21, 0.85);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1215;
  --surface: #171b20;
  --text: #e6e9ed;
  --muted: #9aa4af;
  --border: #2a3038;
  --accent: #1652d4;
  --accent-text: #7fa6ff;
  --accent-soft: #16233f;
  --on-accent: #ffffff;
  --header-bg: rgba(15, 18, 21, 0.85);
  color-scheme: dark;
}

/* ---------- Language visibility ---------- */
/* Default (no JS): <html lang="en">, so German is hidden. */
html[lang="en"] [lang="de"],
html[lang="de"] [lang="en"],
html[lang="en"] [data-show="de"],
html[lang="de"] [data-show="en"] { display: none !important; }

/* Controls only make sense with JS */
html:not(.js) .controls { display: none; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
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;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-text); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.prose { max-width: 40rem; }
.muted { color: var(--muted); }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  height: 3.75rem;
}
.brand {
  font-weight: 650; color: var(--text); text-decoration: none; white-space: nowrap;
  display: flex; align-items: center; gap: 0.6rem;
}
.brand-mark {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 8px;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--mono); font-size: 0.8rem; font-weight: 700; letter-spacing: 0;
}
.nav { display: none; margin-left: auto; }
.nav ul { display: flex; gap: 1.5rem; list-style: none; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--text); }
.controls { display: flex; gap: 0.5rem; margin-left: auto; }
.nav + .controls { margin-left: 0; }
@media (min-width: 52rem) {
  .nav { display: block; }
  .controls { margin-left: 1rem; }
}

.ctrl {
  display: inline-flex; align-items: center; gap: 0.45rem;
  height: 2.25rem; min-width: 2.25rem; padding: 0 0.6rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.ctrl:hover { border-color: var(--muted); }
.ctrl .lt { display: inline-flex; align-items: center; gap: 0.45rem; }
.ctrl svg { width: 1.1rem; height: 1.1rem; }
.ctrl svg.flag { width: auto; height: 0.95rem; border-radius: 2px; box-shadow: 0 0 0 1px var(--border); }

/* sun/moon: show the icon of the mode you'd switch to */
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ---------- Sections ---------- */
section { padding-block: 4.5rem; scroll-margin-top: 3.75rem; }
section + section { border-top: 1px solid var(--border); }
.eyebrow {
  font-family: var(--mono); font-size: 0.85rem; color: var(--accent-text);
  margin: 0 0 0.6rem; letter-spacing: 0;
}
.eyebrow .prompt { color: var(--muted); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem); margin-bottom: 2rem; }
h3 { font-size: 1.1rem; }

/* ---------- Hero ---------- */
.hero { padding-block: 3.5rem 4.5rem; }
.hero .wrap {
  display: grid; gap: 2rem; align-items: center;
}
.hero-photo {
  width: 9.5rem; height: 9.5rem; border-radius: 20px;
  object-fit: cover; object-position: 50% 25%;
  background: var(--border);
  box-shadow: 0 0 0 1px var(--border), 0 10px 30px -12px rgba(0, 0, 0, 0.25);
}
.hello { font-family: var(--mono); color: var(--accent-text); font-size: 0.9rem; margin-bottom: 0.75rem; }
.hero h1 { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 3.6rem); font-weight: 750; letter-spacing: -0.025em; }
.role { font-size: 1.1rem; margin: 0.9rem 0 0.25rem; }
.location { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.95rem; margin: 0; }
.location svg { width: 1rem; height: 1rem; }
.tagline {
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.35rem); line-height: 1.5;
  margin: 1.5rem 0 2rem; max-width: 34rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
@media (min-width: 48rem) {
  .hero { padding-block: 6rem; }
  .hero .wrap { grid-template-columns: 1fr auto; gap: 4rem; }
  .hero-photo { width: 17rem; height: 17rem; border-radius: 28px; order: 2; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.75rem 1.25rem; border-radius: 10px;
  font-weight: 600; text-decoration: none; line-height: 1.2;
  border: 1px solid transparent;
}
.btn svg { width: 1.1rem; height: 1.1rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { color: var(--text); border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-lg { padding: 0.95rem 1.6rem; font-size: 1.05rem; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; position: relative; max-width: 46rem; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 0.6rem; bottom: 0.6rem;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-left: 2rem; padding-bottom: 2.5rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 0.42rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent-text);
}
.tl-item.current::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.1rem 1rem; }
.tl-role { font-size: 1.1rem; font-weight: 650; }
.tl-org { color: var(--muted); margin: 0.1rem 0 0.75rem; }
.tl-date { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-list { padding-left: 1.1rem; }
.tl-list li { margin-bottom: 0.35rem; }
.tl-list li::marker { color: var(--accent-text); }
.tl-roles { list-style: none; margin-top: 0.5rem; }
.tl-roles > li { padding: 0.9rem 0 0.9rem 1rem; border-left: 2px solid var(--accent-soft); margin-bottom: 0.25rem; }
.tl-roles .tl-role { font-size: 1rem; }
.tl-roles p { margin: 0.25rem 0 0; }
.tl-note { margin-top: 0.75rem; font-size: 0.95rem; color: var(--muted); }
.tl-short { list-style: none; }
.tl-short li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem; padding: 0.2rem 0; }
.tl-sub { font-size: 0.85rem; font-family: var(--mono); color: var(--muted); font-weight: 400; margin-bottom: 0.5rem; }

/* ---------- Skills ---------- */
.skills { display: grid; gap: 2rem 3rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.skills h3 { margin-bottom: 0.75rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; }
.tags li {
  font-size: 0.875rem; line-height: 1.3; padding: 0.3rem 0.7rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}

/* ---------- Certs & education ---------- */
.two-col { display: grid; gap: 2.5rem 3rem; }
@media (min-width: 48rem) { .two-col { grid-template-columns: 3fr 2fr; } }
.two-col h3 { margin-bottom: 1rem; }
.plain-list { list-style: none; }
.plain-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.plain-list li:first-child { padding-top: 0; }
.plain-list li:last-child { border-bottom: 0; }
.plain-list small { display: block; color: var(--muted); font-size: 0.875rem; }
.edu strong { display: block; }
.edu p { margin: 0.25rem 0 0; }

/* ---------- Beyond work ---------- */
.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem;
}
.card-icon {
  width: 2.75rem; height: 2.75rem; border-radius: 10px; margin-bottom: 1rem;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
}
.card-icon svg { width: 1.5rem; height: 1.5rem; }
.card h3 { margin-bottom: 0.6rem; }
.card p { font-size: 0.975rem; }
.card p:last-child { margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact .prose { margin-inline: auto; }
.contact .actions { justify-content: center; margin-top: 1.5rem; }

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

/* ---------- Impressum ---------- */
.legal { padding-block: 3.5rem 5rem; }
.legal h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.6rem); margin-bottom: 0.5rem; }
.legal .lead { color: var(--muted); margin-bottom: 2.5rem; }
.legal dl { display: grid; gap: 0.4rem 2rem; margin: 0 0 2.5rem; max-width: 40rem; }
.legal dt { font-weight: 650; }
.legal dd { margin: 0 0 1rem; }
@media (min-width: 40rem) {
  .legal dl { grid-template-columns: 12rem 1fr; }
  .legal dd { margin: 0; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .controls, .skip { display: none; }
  section { padding-block: 1.5rem; }
  a { color: inherit; }
}
