/* =========================================================
   Tim von der Heyde – IT-Service
   style.css – Design-Tokens, Reset, Typografie, Grundgerüst
   ========================================================= */

/* ---------- Design-Tokens ---------- */
:root {
  /* Farben – abgeleitet aus dem Logo (Blau/Navy) */
  --color-primary: #1477d6;
  --color-primary-light: #2e9bfa;
  --color-navy: #081527;
  --color-navy-soft: #0e2038;
  --color-accent: #ff7a45;
  --color-accent-dark: #e05f2c;

  --color-surface: #ffffff;
  --color-surface-tint: #eef5fe;
  --color-surface-tint-strong: #dcebfc;
  --color-border: #e1e7ef;

  --color-text: #17212e;
  --color-text-secondary: #52606e;
  --color-text-muted: #8a93a0;
  --color-text-on-dark: #f3f6fa;
  --color-text-on-dark-secondary: #a9b7c6;

  --color-success: #1e9e6b;
  --color-success-bg: #e7f7f0;
  --color-danger: #d63b3b;
  --color-danger-bg: #fdecec;

  /* Typografie */
  --font-heading: "Segoe UI", "Helvetica Neue", Arial, system-ui, -apple-system, sans-serif;
  --font-body: "Segoe UI", "Helvetica Neue", Arial, system-ui, -apple-system, sans-serif;

  /* Radien & Schatten */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(8, 21, 39, 0.08);
  --shadow-md: 0 8px 24px rgba(8, 21, 39, 0.10);
  --shadow-lg: 0 16px 40px rgba(8, 21, 39, 0.14);

  /* Layout */
  --container-width: 1180px;
  --header-height: 76px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6rem;

  --transition-fast: 150ms ease;
  --transition-base: 220ms ease;

  /* Nur fuer den Sticky-Header (braucht Transparenz, deshalb eigene Variable) */
  --color-header-bg: rgba(255, 255, 255, 0.92);
}

/* =========================================================
   Dark Mode
   - greift automatisch, wenn das Betriebssystem/der Browser
     ein dunkles Design bevorzugt (prefers-color-scheme)
   - kann ueber den Umschalter im Header manuell erzwungen
     werden (dann steht data-theme="dark" bzw. "light" am
     <html>-Element, siehe js/main.js)
   ========================================================= */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary: #5aa6ff;
    --color-primary-light: #8cc4ff;
    --color-navy: #060c16;
    --color-navy-soft: #0c1930;
    --color-accent: #ff9764;
    --color-accent-dark: #ff7a45;

    --color-surface: #121a26;
    --color-surface-tint: #1a2433;
    --color-surface-tint-strong: #223047;
    --color-border: #2a3648;

    --color-text: #edf1f6;
    --color-text-secondary: #b7c2d0;
    --color-text-muted: #8492a4;

    --color-success: #34d399;
    --color-success-bg: #113328;
    --color-danger: #ff7a7a;
    --color-danger-bg: #3a1414;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);

    --color-header-bg: rgba(9, 14, 22, 0.86);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --color-primary: #5aa6ff;
  --color-primary-light: #8cc4ff;
  --color-navy: #060c16;
  --color-navy-soft: #0c1930;
  --color-accent: #ff9764;
  --color-accent-dark: #ff7a45;

  --color-surface: #121a26;
  --color-surface-tint: #1a2433;
  --color-surface-tint-strong: #223047;
  --color-border: #2a3648;

  --color-text: #edf1f6;
  --color-text-secondary: #b7c2d0;
  --color-text-muted: #8492a4;

  --color-success: #34d399;
  --color-success-bg: #113328;
  --color-danger: #ff7a7a;
  --color-danger-bg: #3a1414;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);

  --color-header-bg: rgba(9, 14, 22, 0.86);

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-surface);
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-primary-light);
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  color: var(--color-text);
}

h1 { font-size: clamp(2.1rem, 1.6rem + 2vw, 3.3rem); }
h2 { font-size: clamp(1.6rem, 1.35rem + 1.2vw, 2.35rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p {
  margin: 0 0 var(--space-2);
  max-width: 62ch;
}

p.lede {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
}

/* Sichtbarer Fokus für Tastaturbedienung (Barrierefreiheit) */
:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Bewegung reduzieren, wenn vom Betriebssystem gewünscht */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Skip-Link für Tastatur- und Screenreader-Nutzung */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -60px;
  background: var(--color-navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Anker-Sprungziele nicht unter dem Sticky-Header verschwinden lassen */
section[id],
div[id].section {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

/* ---------- Layout-Grundgerüst ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.section {
  padding-block: var(--space-6);
}

.section--tint {
  background: var(--color-surface-tint);
}

.section--navy {
  background: var(--color-navy);
  color: var(--color-text-on-dark);
}

.section--navy h2,
.section--navy h3 {
  color: #fff;
}

.section--navy p {
  color: var(--color-text-on-dark-secondary);
}

.section-head {
  max-width: 46rem;
  margin-bottom: var(--space-5);
}

.section-head p {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

/* Absätze haben global eine max-width für Lesbarkeit (siehe p-Regel oben).
   Diese eigene Box muss zusätzlich zentriert werden - text-align allein
   zentriert nur den Text *innerhalb* der (sonst linksbündigen) Box. */
.section-head--center p {
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--color-border);
}

.header-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  /* Der Header darf breiter sein als der Inhalt weiter unten (.container
     bei 1180px) - bei vielen Menüpunkten reicht das sonst nicht aus. */
  max-width: 1440px;
  margin-inline: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  color: var(--color-text);
}

.brand img {
  height: 44px;
  width: 44px;
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-size: 1rem;
}

.brand-name small {
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--color-primary);
  letter-spacing: 0.02em;
}

/* Hauptnavigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.nav-list {
  display: flex;
  gap: 1.15rem;
}

.nav-list a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.header-cta {
  flex-shrink: 0;
}

/* ---------- Dark-Mode-Umschalter ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  flex-shrink: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--color-surface-tint);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-moon {
  display: none;
}

/* Zweite, gleichwertige Umschalter-Variante als Zeile im mobilen Menü
   (nur auf sehr schmalen Bildschirmen sichtbar, siehe responsive.css) */
.theme-toggle--menu {
  display: none;
  width: auto;
  height: auto;
  border: none;
  border-radius: 0;
  justify-content: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 0.4rem;
  width: 100%;
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.96rem;
}

.theme-toggle--menu:hover {
  background: var(--color-surface-tint);
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: block;
  }
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.4rem;
  color: var(--color-text);
}

.nav-toggle svg {
  width: 26px;
  height: 26px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-navy);
  color: var(--color-text-on-dark-secondary);
  padding-block: var(--space-6) var(--space-4);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  margin-bottom: var(--space-2);
  font-family: var(--font-heading);
  font-weight: 700;
}

.footer-brand img {
  height: 38px;
  width: 38px;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: var(--space-2);
}

.footer-col ul li {
  margin-bottom: 0.55rem;
}

.footer-col a {
  color: var(--color-text-on-dark-secondary);
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-3);
  font-size: 0.85rem;
}

.footer-legal {
  display: flex;
  gap: var(--space-3);
}

.footer-legal a {
  color: var(--color-text-on-dark-secondary);
  text-decoration: none;
}

.social-links {
  display: flex;
  gap: 0.6rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.social-links a:hover {
  background: var(--color-primary);
}

.social-links svg {
  width: 18px;
  height: 18px;
}
