:root {
  --ink: #0f2340;
  --muted: #4a5b74;
  --line: #c9d9e6;
  --accent: #1e4375;
  --accent-hover: #2c5a96;
  --accent-soft: #dbe9f4;
  --accent-deep: #0b2040;
  --accent-mid: #4f80b8;
  --bg: #eef4fa;
  --bg-warm: #f7fafd;
  --surface: #ffffff;
  --shadow: 0 10px 30px rgba(15, 35, 64, 0.08);
  --shadow-lg: 0 18px 48px rgba(15, 35, 64, 0.12);
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
  --header-h: 4.25rem;
  --max: 70rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: Nunito, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 8% -10%, #dbe9f4 0%, transparent 55%),
    radial-gradient(700px 380px at 100% 8%, #c9dbe9 0%, transparent 50%),
    var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus { top: 0.75rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.85rem clamp(1.25rem, 5vw, 3.5rem);
  background: rgba(238, 244, 250, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 35, 64, 0.12);
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 1rem;
}

nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-deep);
  padding: 0.35rem 0.15rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
nav a:hover { color: var(--accent); border-bottom-color: var(--accent-soft); }

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}
.logo img {
  display: block;
  width: 36px;
  height: 40px;
  object-fit: contain;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--accent-deep);
  cursor: pointer;
}
.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: var(--accent-soft);
}
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}
.nav-toggle-icon {
  position: relative;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }
.site-header.is-open .nav-toggle-icon { background: transparent; }
.site-header.is-open .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}
.site-header.is-open .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

body.nav-open { overflow: hidden; }

main { overflow-x: clip; }

.hero,
section {
  padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 5vw, 3.5rem);
}

.section-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
  max-width: calc(var(--max) + 7vw);
  margin: 0 auto;
}

.hero-copy {
  display: grid;
  gap: 1.1rem;
  justify-items: start;
}

.hero p.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  background: var(--accent-mid);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.15rem, 4.6vw, 3.45rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--accent-deep);
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: var(--accent-deep);
}

h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0.85rem 0 0.35rem;
  color: var(--ink);
}

.hero p,
.lead,
.card p,
.reference-card p {
  color: var(--muted);
  max-width: 42rem;
  margin: 0;
}

.section-head {
  margin-bottom: 1.75rem;
  max-width: 40rem;
}
.section-head .lead + .lead { margin-top: 0.45rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.45rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 35, 64, 0.25);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 35, 64, 0.28);
}
.btn:active { transform: translateY(0); }

.hero-visual {
  position: relative;
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 12% -6% -8% 18%;
  background: linear-gradient(145deg, #a0bddb, #dbe9f4 70%);
  border-radius: calc(var(--radius) + 0.5rem);
  filter: blur(2px);
  opacity: 0.55;
  z-index: 0;
}
.hero-visual img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: min(420px, 58vw);
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.cards,
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 0.85rem 1.15rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-mid);
}
.card img,
.grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.card h3 { margin-top: 0.95rem; }
.card > :not(img) { padding-inline: 0.35rem; }

.grid img {
  height: 210px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.grid a:hover img,
.grid img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.band {
  background: linear-gradient(180deg, rgba(247, 250, 253, 0.55), rgba(247, 250, 253, 0.9));
}

.references-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}
.reference-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow);
}
.reference-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-sm);
  background: #111;
}
.reference-card h3 { margin: 0; }
.reference-card > a:last-of-type {
  margin-top: auto;
}
.reference-card a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
  width: fit-content;
  border-bottom: 2px solid var(--accent-soft);
}
.reference-card a:hover { color: var(--accent-hover); border-bottom-color: var(--accent); }

.contact-panel {
  display: grid;
  gap: 1rem;
  max-width: 36rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.45rem 1.55rem;
  box-shadow: var(--shadow);
}

form {
  display: grid;
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-deep);
}

input,
textarea {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-warm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input:hover,
textarea:hover { border-color: var(--accent-mid); }
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 35, 64, 0.15);
}

.hint {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}
.hint a {
  color: var(--accent);
  font-weight: 800;
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem clamp(1.25rem, 5vw, 3.5rem);
  border-top: 1px solid rgba(15, 35, 64, 0.35);
  background: var(--accent-deep);
  color: #c9dbe9;
  font-weight: 600;
}
footer a { color: #dbe9f4; text-decoration: none; font-weight: 800; }
footer a:hover { color: #fff; }
footer .logo img { width: 36px; height: 40px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; margin: 0; font-size: 0.95rem; font-weight: 700; }
.form-status.ok { color: #166534; }
.form-status.error { color: #b42318; }
input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #b42318;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12);
}
.field-error { color: #b42318; font-size: 0.85rem; font-weight: 700; }
button[disabled] { opacity: 0.7; cursor: progress; }

@media (max-width: 900px) {
  :root { --header-h: 3.25rem; }

  .hero,
  .cards,
  .grid,
  .references-grid { grid-template-columns: 1fr; }
  .hero-visual img { height: 280px; }

  .site-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    height: auto;
    min-height: var(--header-h);
    padding: 0 clamp(1rem, 5vw, 1.5rem);
    gap: 0.75rem;
  }
  html.js-nav .site-header {
    flex-wrap: nowrap;
    height: var(--header-h);
    overflow: visible;
  }
  .logo img {
    width: 29px;
    height: 32px;
  }
  .nav-toggle { display: inline-flex; }

  nav {
    position: static;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    gap: 0;
    padding: 0.35rem 0 0.75rem;
    background: var(--bg);
  }
  html.js-nav nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    z-index: 2;
    background: var(--bg);
    border-bottom: 1px solid rgba(15, 35, 64, 0.12);
    box-shadow: var(--shadow);
  }
  html.js-nav .site-header:not(.is-open) nav,
  nav[hidden] { display: none; }
  nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 clamp(1rem, 5vw, 1.5rem);
    font-size: 1rem;
    border-bottom: 0;
  }
  nav a:hover { background: var(--accent-soft); }

  .site-header.is-open::after {
    content: "";
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background: rgba(15, 35, 64, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-toggle-icon,
  .nav-toggle-icon::before,
  .nav-toggle-icon::after {
    transition: none;
  }
}

/* Galerie mit Unterschriften */
.gallery-item {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}
.gallery-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery-trigger:hover,
.gallery-trigger:focus-visible {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}
.gallery-trigger img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius);
}
.gallery-item figcaption {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-deep);
  text-align: center;
}


/* CMS & Portal (#8) */
.cms-blocks {
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 1.75rem;
}

.cms-block {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 2.5vw, 1.35rem);
  box-shadow: var(--shadow);
}

.cms-copy {
  display: grid;
  gap: 0.55rem;
  justify-items: start;
}

.cms-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-mid);
}

.cms-copy h3 {
  margin: 0;
}

.cms-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 38rem;
}

.cms-media {
  margin: 0;
}

.cms-media .gallery-trigger img {
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top center;
}

.cms-footnote {
  margin: 0 0 1.25rem;
  max-width: 42rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

@media (max-width: 900px) {
  .cms-block {
    grid-template-columns: 1fr;
  }
  .cms-media {
    order: -1;
  }
}

/* Lightbox ohne Framework */
.lightbox[hidden] { display: none !important; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  border: 0;
  cursor: zoom-out;
}
.lightbox-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.75rem;
  width: min(96vw, 1100px);
  max-height: 92vh;
  padding: 0.85rem 0.85rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  outline: none;
}
.lightbox-dialog img {
  width: 100%;
  max-height: calc(92vh - 5.5rem);
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #0f172a0d;
}
.lightbox-caption {
  margin: 0;
  text-align: center;
  font-weight: 700;
  color: var(--accent-deep);
}
.lightbox-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 35, 64, 0.3);
}
.lightbox-close:hover { background: var(--accent-hover); }

body.lightbox-open { overflow: hidden; }

@media (max-width: 900px) {
  .gallery-trigger img { height: 200px; }
}
