/* ===== Schriften (lokal) ===== */
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/AtkinsonHyperlegibleNext-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/AtkinsonHyperlegibleNext-RegularItalic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/AtkinsonHyperlegibleNext-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/AtkinsonHyperlegibleNext-BoldItalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ===== Reset / Basis ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
html:focus-within { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", Arial, sans-serif;
  font-size: clamp(17px, 1rem + 0.60vw, 20px);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
@media (min-resolution: 2dppx) {
  body { font-size: clamp(18px, 1rem + 0.70vw, 20px); }
}

:root {
  --header-h: 0px;

  --radius: .66rem;
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --maxw: 72ch;

  /* Einheitliche Chip-Höhen */
  --chip-h: 2.25rem;     
  --nav-size: 16px;      
  --chip-px: .6rem;      

  /* Theme-Toggle (kleiner, aber bedienbar) */
  --toggle-h: 2rem;
  --toggle-px: .5rem;
  --toggle-icon: 1rem;
  --toggle-font: .75rem;

  /* Gruvbox-Dark Default */
  --bg: #282828;
  --fg: #ebdbb2;
  --muted: #bdae93;
  --accent: #d79921;
  --accent-2: #83a598;
  --surface: #32302f;

  color-scheme: dark light;
}

/* Theme-Auswahl */
#theme-default:checked ~ .site {
  --bg: #282828;
  --fg: #ebdbb2;
  --muted: #bdae93;
  --accent: #d79921;
  --accent-2: #83a598;
  --surface: #32302f;
}
#theme-light:checked ~ .site {
  --bg: #fbf1c7;
  --fg: #3c3836;
  --muted: #7c6f64;
  --accent: #af3a03;
  --accent-2: #076678;
  --surface: #f2e5bc;
}

.site {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Skip-Link */
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus,
.skip-link:focus-visible {
  position: fixed; left: var(--space-2); top: var(--space-2); width: auto; height: auto;
  background: var(--surface); color: var(--fg); padding: .5rem .75rem; border-radius: var(--radius);
  outline: 2px solid var(--accent);
  z-index: 1101; /* über dem fixierten Header */
}

/* Visually hidden */
.visually-hidden,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Theme-Toggle Styles: weiter unten in der A11y-Sektion (Radios visuell versteckt) */
.subheading {
  font-size: 1.05rem;       
  font-weight: 600;         
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--muted);      
}

/* ===== Header & Navigation (Basis) ===== */
.site-footer { padding: 0; }
.site-footer__inner{
  width: min(100% - 2*var(--space-2), var(--maxw));
  margin: 0 auto;
  padding: var(--space-2);
}
.site-title {
  margin: 0;
  font-size: clamp(1.35rem, 3.6vw, 1.9rem);
  line-height: 1.15;
}
.site-title a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
.site-title a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: .4rem;
}
.tagline {
  margin: .15rem 0 0 0;
  font-size: clamp(.95rem, 2.8vw, 1.05rem);
  font-weight: 400;
  color: var(--muted);
}

/* Einheitliche Navigation (Chips) */
.site-nav__list {
  list-style: none;
  margin: 0 0 .5rem 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--chip-h);
  padding: 0 var(--chip-px);
  font-size: 1em;       
  line-height: 1;       
  text-decoration: none;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  white-space: nowrap;
}
/* Fallback ohne color-mix */
.site-nav a[aria-current="page"] {
  background: var(--surface);
}
/* Progressive Enhancement mit color-mix */
@supports (color: color-mix(in oklab, white 10%, black)) {
  .site-nav a[aria-current="page"] {
    background: color-mix(in oklab, var(--surface) 85%, transparent);
  }
}

.site-nav a:visited { color: var(--fg); }
.site-nav a:hover,
.site-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@supports (color: color-mix(in oklab, white 10%, black)) {
  .site-nav a:hover,
  .site-nav a:focus-visible {
    background: color-mix(in oklab, var(--surface) 85%, transparent);
  }
}

/* ===== Main Content ===== */
main { width: min(100% - 2*var(--space-2), var(--maxw)); margin: 0 auto; padding: var(--space-3) var(--space-2); }
section + section { margin-top: var(--space-3); }
h1 { font-size: 1.35rem; margin: 0 0 .5rem 0; }
h2 { font-size: 1.25rem; margin: 0 0 .5rem 0; }

/* Fixed Header: Anker & Überschriften nicht unter dem Header verstecken */
:where(h1, h2, h3, h4, h5, h6) {
  scroll-margin-top: calc(var(--header-h) + var(--space-3));
}

.keylist { padding-left: 1.1rem; }
.keylist li { margin: .25rem 0; }

/* Zertifikats-Badges — exakt gleiche Höhe wie Navigation */
.badges { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--chip-h);     
  padding: 0 var(--chip-px);     
  border-radius: 999px;
  background: var(--surface);    
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.15),
    0 .5px 0 rgba(0,0,0,.3);
  color: var(--fg);
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1;                
  text-decoration: none;
  transition: box-shadow .15s ease, transform .15s ease;
}
@supports (color: color-mix(in oklab, white 10%, black)) {
  .badge {
    background:
      linear-gradient(
        to bottom,
        color-mix(in oklab, var(--surface) 82%, transparent) 0%,
        color-mix(in oklab, var(--surface) 94%, transparent) 100%
      );
    box-shadow:
      inset 0 0 0 1px color-mix(in oklab, var(--fg) 18%, transparent),
      0 .5px 0 color-mix(in oklab, var(--bg) 55%, transparent);
  }
  .badge:where(:hover, :focus-visible) {
    box-shadow:
      inset 0 0 0 1px color-mix(in oklab, var(--accent) 35%, transparent),
      0 1px 2px color-mix(in oklab, var(--bg) 60%, transparent);
  }
}

.contact { list-style: none; padding: 0; margin: 0; }
.contact li { margin: .25rem 0; }

.site-footer { background: var(--surface); color: var(--fg); }
.site-footer a { color: var(--fg); }
.credits, .hint { color: var(--muted); font-size: .95em; }

/* ===== Fokus & Auswahl ===== */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-2); color: #fff; }

/* ===== Responsive ===== */
@media (max-width: 480px) {
  body { font-size: 16px; }
  main { padding: var(--space-2); }
  .site-title { margin-bottom: .25rem; }
  .tagline{
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;   /* max 2 Zeilen */
    overflow: hidden;
    margin: .15rem 0 0;
    font-size: .9rem;
    line-height: 1.2;
    opacity: .9;
  }
}
@media (min-width: 1200px) {
  :root { --maxw: 85ch; }
  .keylist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--space-3);
  }
  .badges { justify-content: flex-start; gap: .75rem; }
}
@media (min-width: 1600px) {
  :root { --maxw: 90ch; }
}

/* ===== Bewegungsreduktion ===== */
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ===== Druck ===== */
@media print {
  .theme-toggle, .site-nav, .nav-toggle { display: none !important; }
  .site { background: #fff; color: #000; }
}
/* === A11y: Radios visuell verstecken, aber fokusierbar/lesbar lassen === */
.vh-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
  appearance: none;
}
/* === Theme-Toggle: sichtbare Buttons sind die Labels === */
fieldset.theme-toggle {
  border: 0;
  margin: 0;
  padding: .15rem;
  min-inline-size: 0;
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: var(--toggle-font);
  border-radius: .75rem;
  border: 1px solid color-mix(in srgb, var(--muted) 45%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
fieldset.theme-toggle label.toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--toggle-h);
  min-width: var(--toggle-h);
  padding: 0;
  border-radius: .6rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}
fieldset.theme-toggle label.toggle-btn:hover {
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  color: var(--fg);
}
fieldset.theme-toggle label.toggle-btn .icon {
  width: var(--toggle-icon);
  height: var(--toggle-icon);
  display: block;
  fill: currentColor;
  stroke: none;
}
/* === Toggle States: aktiv & Fokus === */
#theme-default:checked + label.toggle-btn,
#theme-light:checked  + label.toggle-btn {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--fg);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--muted));
  box-shadow: none;
}
#theme-default:focus-visible + label.toggle-btn,
#theme-light:focus-visible  + label.toggle-btn {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  box-shadow: none;
}
/* === Robuste Theme-Zuweisung mit :has() === */
html:has(#theme-default:checked) .site {
  --bg: #282828;
  --fg: #ebdbb2;
  --muted: #bdae93;
  --accent: #d79921;
  --accent-2: #83a598;
  --surface: #32302f;
}
html:has(#theme-light:checked) .site {
  --bg: #fbf1c7;
  --fg: #3c3836;
  --muted: #7c6f64;
  --accent: #af3a03;
  --accent-2: #076678;
  --surface: #f2e5bc;
}

/* ===== Header: Fixed + Auto-Hide ===== */
.site-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0;
  background: var(--surface);
  transform: translateY(0);
  transition: transform 180ms ease;
  will-change: transform;
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
}

.site-header__inner{
  width: min(100% - 2*var(--space-2), var(--maxw));
  margin: 0 auto;
  padding: var(--space-2);
}

.site-header.is-hidden{
  transform: translateY(calc(-1 * var(--header-h)));
}

/* Platz für fixierten Header */
main{
  padding-top: calc(var(--space-3) + var(--header-h));
}

/* ===== Header-Layout ===== */
.site-header__top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.site-brand{ min-width: 0; }

.site-header__actions{
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 0 0 auto;
}

/* ===== Navigation ===== */
.site-nav{
  font-size: var(--nav-size);
}

.site-nav__list{
  list-style: none;
  margin: var(--space-1) 0 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.site-nav__list li{ margin: 0; }

/* Burger-Button */
.nav-toggle{
  display: none;
  min-height: var(--chip-h);
  padding: 0 var(--chip-px);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.nav-toggle:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


.site-nav__extras{
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
}

@media (min-width: 641px){
  .site-nav__extras{ display: none; }
}
/* Mobile: Burger sichtbar, Liste als Dropdown */
@media (max-width: 640px){
  .site-header__inner{ padding: var(--space-1) var(--space-2); }
  .site-header__top{ align-items: center; }
  .tagline{ line-height: 1.3; }
  main{ padding-top: calc(var(--space-2) + var(--header-h)); }

  html.js .nav-toggle{ display: inline-flex; align-items: center; justify-content: center; }

  /* Menü offen + Querformat: Header als Scroll-Container, damit alle Punkte erreichbar sind */
  html.js[data-nav-open="true"] .site-header{
    max-height: 100vh;
    max-height: 100svh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  html.js[data-nav-open="true"] .site-header__inner{
    padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
  }


  /* No-Flash: JS + Mobile -> Navigation initial zu, bis geöffnet */
  html.js[data-nav-open="false"] .site-nav__list{ display: none; }
  html.js[data-nav-open="true"]  .site-nav__list{ display: flex; }

  .site-nav__list{
    margin-top: .5rem;
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav__list[hidden]{
    display: none !important;
  }

  .site-nav__list a{
    width: 100%;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce){
  .site-header{ transition: none; }
}
