:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-alt: #eaeef4;
  --ink: #1c2733;
  --ink-soft: #57657a;
  --accent: #2c5aa0;
  --accent-ink: #f4f8fd;
  --line: #d8e0ea;
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1140px;

  --header-bg: rgba(246, 248, 251, 0.88);
  --glass-bg: rgba(244, 248, 253, 0.8);
  --glass-bg-hover: rgba(244, 248, 253, 0.97);
  --btn-primary-hover: #204480;

  /* Fixed dark surface for the contact card — stays dark in both themes */
  --surface-dark: #1c2733;
  --surface-dark-text: #f6f8fb;

  /* Hero background pattern */
  --deco-a: #cfe0f5;
  --deco-b: #dde3ea;
  --hero-pin: #ffffff;
  --hero-pin-opacity: 0.65;
  --hero-order-bg: #eaeef4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #10141a;
    --bg-alt: #171d26;
    --ink: #e8edf3;
    --ink-soft: #93a1b5;
    --accent: #6fa3e0;
    --accent-ink: #10141a;
    --line: #29323d;

    --header-bg: rgba(16, 20, 26, 0.85);
    --glass-bg: rgba(23, 29, 38, 0.75);
    --glass-bg-hover: rgba(23, 29, 38, 0.92);
    --btn-primary-hover: #8fc4f5;

    --deco-a: #2a3644;
    --deco-b: #333f4e;
    --hero-pin-opacity: 0.13;
    --hero-order-bg: #171d26;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10141a;
  --bg-alt: #171d26;
  --ink: #e8edf3;
  --ink-soft: #93a1b5;
  --accent: #6fa3e0;
  --accent-ink: #10141a;
  --line: #29323d;

  --header-bg: rgba(16, 20, 26, 0.85);
  --glass-bg: rgba(23, 29, 38, 0.75);
  --glass-bg-hover: rgba(23, 29, 38, 0.92);
  --btn-primary-hover: #8fc4f5;

  --deco-a: #2a3644;
  --deco-b: #333f4e;
  --hero-pin-opacity: 0.13;
  --hero-order-bg: #171d26;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 112px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}

h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.eyebrow {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1em;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
}
.brand svg { display: block; height: 78px; width: auto; }
.brand:hover { text-decoration: none; opacity: .85; }

.nav {
  display: flex;
  gap: 2rem;
}
.nav a {
  position: relative;
  color: var(--ink);
  font-weight: 500;
  font-size: .95rem;
  padding-bottom: 5px;
}
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a.active { color: var(--accent); }
.nav a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-left: auto;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
@media (min-width: 861px) {
  .nav-toggle { display: none; }
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* Hero */
.hero {
  position: relative;
  padding: 7rem 0 6rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-pin-line { opacity: var(--hero-pin-opacity); }
.hero .wrap {
  position: relative;
  z-index: 1;
}
.hero-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3rem;
}
.hero-text { min-width: 0; }
.hero-services {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  flex-shrink: 0;
}
.hero-services li {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hero-service-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.hero-services span {
  font-weight: 600;
  color: var(--ink);
  font-size: 1.05rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  margin-bottom: .4em;
}
.hero-lead {
  max-width: 640px;
  font-size: 1.15rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: .85em 1.6em;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: var(--btn-primary-hover); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Sections */
section { padding: 5.5rem 0; }
.section-lead {
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 2.5rem;
}

.leistungen { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.grid { display: grid; gap: 1.5rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 0.8rem;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5em;
}
.card-icon { width: 40px; height: 40px; flex-shrink: 0; display: block; }
.card h3 { margin: 0; }
.card p { font-size: .95rem; margin-bottom: 0; }

/* Ueber uns */
.ueber-uns-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: start;
}
.ueber-uns-text h2 { max-width: 560px; }

.ueber-uns-points {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.point {
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
}
.point h3 {
  font-size: 1.05rem;
  margin-bottom: .3rem;
}
.point p {
  font-size: .92rem;
  margin-bottom: 0;
}

/* Referenzen */
.referenzen { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.ref-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.ref-grid li {
  padding: 0.88rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  display: flex;
  flex-direction: column;
}
.ref-grid li:nth-child(odd) { padding-right: 1.6rem; }
.ref-grid li:nth-child(even) { padding-left: 1.6rem; }
.ref-grid li span {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: .9rem;
}

/* Kontakt */
.kontakt-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: start;
}
.kontakt-card {
  position: relative;
  background: var(--surface-dark);
  color: var(--surface-dark-text);
  border-radius: var(--radius);
  padding: 2.2rem;
  overflow: hidden;
}
.kontakt-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.kontakt-card > *:not(.kontakt-card-bg) {
  position: relative;
  z-index: 1;
}
.kontakt-logo {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin-bottom: 1.4rem;
}
.kontakt-card p { color: #c3ccd9; margin-bottom: .3em; }
.kontakt-card address { font-style: normal; color: #c3ccd9; margin-bottom: 1em; }
.kontakt-card a { color: #9dc0f2; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-inner p { margin: 0; font-size: .9rem; }
.footer-nav { display: flex; gap: 1.5rem; }
.footer-nav a { font-size: .9rem; color: var(--ink-soft); }
.footer-nav a:hover { color: var(--accent); }

/* Back to top */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 7px;
  background: var(--glass-bg);
  border: 1px solid var(--line);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, background .15s ease;
}
.back-to-top:hover { background: var(--glass-bg-hover); text-decoration: none; }
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-toggle {
  position: fixed;
  right: 24px;
  bottom: 84px;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 7px;
  background: var(--glass-bg);
  border: 1px solid var(--line);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease;
}
.theme-toggle:hover { background: var(--glass-bg-hover); }
.theme-toggle svg[hidden] { display: none; }

/* Responsive */
@media (max-width: 860px) {
  html { scroll-padding-top: 153px; }
  .nav { display: none; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 2.5rem; }
  .hero-services { width: 100%; }
  .header-inner { flex-wrap: wrap; row-gap: 8px; }
  .brand { flex: 1 0 100%; }
  .brand svg { width: 100%; height: auto; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .ueber-uns-inner, .kontakt-inner { grid-template-columns: 1fr; }
  .ref-grid { grid-template-columns: 1fr; }
  .ref-grid li:nth-child(odd), .ref-grid li:nth-child(even) { padding-left: 0; padding-right: 0; }

  .site-header.nav-open .nav {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 1.5rem 24px;
    gap: 1.2rem;
  }
}

/* Mobil im Querformat: volle Logobreite würde den Header viel zu hoch machen */
@media (max-width: 860px) and (max-height: 500px) {
  html { scroll-padding-top: 60px; }
  .header-inner { flex-wrap: nowrap; padding-top: 8px; padding-bottom: 8px; }
  .brand { flex: 0 0 auto; }
  .brand svg { width: auto; height: 36px; }
  .nav-toggle { width: 32px; height: 32px; }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 4.5rem 0 3.5rem; }
  section { padding: 3.5rem 0; }
}
