/* ==========================================================================
   T2T – Stylesheet
   Farben, Abstände und Schrift als Custom Properties auf :root.
   Die Palette nur hier ändern, nicht in einzelnen Regeln.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --color-text: #141416;
  --color-text-soft: #52525b;
  --color-bg: #f8f8f8;
  --color-accent: #111111;
  --color-accent-contrast: #ffffff;
  --color-muted: #eeeef0;
  --color-surface: #ffffff;
  --color-border: #e4e4e7;
  --color-footer-bg: #0b0b0c;
  --color-footer-text: #f4f4f5;
  --color-footer-soft: #a1a1aa;
  --color-header-bg: rgba(248, 248, 248, 0.72);
  --color-header-bg-open: rgba(248, 248, 248, 0.97);
  --shadow-sm: 0 1px 2px rgba(16, 16, 20, 0.06);
  --shadow-md: 0 1px 2px rgba(16, 16, 20, 0.04), 0 8px 24px -8px rgba(16, 16, 20, 0.14);
  --shadow-lg: 0 2px 4px rgba(16, 16, 20, 0.04), 0 24px 48px -16px rgba(16, 16, 20, 0.22);

  --max-width: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 14px;
  --radius-lg: 20px;
  --section-space: clamp(3rem, 7vw, 5.5rem);
  --header-height: 72px;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-text: #f4f4f5;
    --color-text-soft: #a1a1aa;
    --color-bg: #0c0c0e;
    --color-accent: #ffffff;
    --color-accent-contrast: #0c0c0e;
    --color-muted: #1c1c20;
    --color-surface: #151518;
    --color-border: #2a2a30;
    --color-footer-bg: #000000;
    --color-header-bg: rgba(12, 12, 14, 0.72);
    --color-header-bg-open: rgba(12, 12, 14, 0.97);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px -16px rgba(0, 0, 0, 0.8);
  }
}

:root[data-theme="dark"] {
  --color-text: #f4f4f5;
  --color-text-soft: #a1a1aa;
  --color-bg: #0c0c0e;
  --color-accent: #ffffff;
  --color-accent-contrast: #0c0c0e;
  --color-muted: #1c1c20;
  --color-surface: #151518;
  --color-border: #2a2a30;
  --color-footer-bg: #000000;
  --color-header-bg: rgba(12, 12, 14, 0.72);
  --color-header-bg-open: rgba(12, 12, 14, 0.97);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px -16px rgba(0, 0, 0, 0.8);
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

/* --- Grundlagen ---------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

::selection {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease, opacity 0.2s ease;
}

p a,
li a,
address a {
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}

p a:hover,
li a:hover,
address a:hover {
  text-decoration-color: currentColor;
}

h1,
h2,
h3 {
  color: var(--color-text);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  color: var(--color-accent);
  font-size: clamp(2.25rem, 1.6rem + 3vw, 4rem);
  letter-spacing: -0.035em;
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  margin: 0 0 1rem;
}

h3 {
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 650;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease-out);
}

.skip-link:focus {
  transform: none;
}

/* Platz für Header und Footer reservieren, bis main.js sie geladen hat */
[data-include$="header.html"] {
  min-height: var(--header-height);
}

[data-include$="footer.html"] {
  min-height: 5rem;
  background: var(--color-footer-bg);
}

/* --- Layout -------------------------------------------------------------- */

main {
  flex: 1 0 auto;
  outline: none;
}

.site-header,
main {
  width: 100%;
}

main {
  max-width: calc(var(--max-width) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) var(--section-space);
}

section {
  padding-top: var(--section-space);
}

main > section:first-child {
  padding-top: clamp(3rem, 8vw, 6rem);
}

/* --- Header -------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  padding: 0.75rem max(var(--gutter), calc((100% - var(--max-width)) / 2));
  background: var(--color-header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: 0 6px 24px -12px rgba(0, 0, 0, 0.18);
}

.logo {
  display: flex;
  align-items: center;
  border-radius: 999px;
}

.logo img {
  display: block;
  height: 40px;
  width: auto;
  transition: transform 0.3s var(--ease-out), filter 0.3s ease;
}

.logo:hover img {
  transform: scale(1.04);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo img {
    filter: invert(1);
  }
}

:root[data-theme="dark"] .logo img {
  filter: invert(1);
}

.theme-toggle {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.3s var(--ease-out);
}

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

.theme-toggle:active {
  transform: scale(0.94);
}

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

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

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

nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

nav a {
  position: relative;
  display: inline-block;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.975rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
}

nav > a::after,
.nav-item > a::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.2rem;
  height: 2px;
  border-radius: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

nav > a:hover::after,
.nav-item > a:hover::after,
nav > a[aria-current="page"]::after,
.nav-item > a[aria-current="page"]::after,
.nav-item:has([aria-current="page"]) > a::after {
  transform: scaleX(1);
}

nav a[aria-current="page"],
.nav-item:has([aria-current="page"]) > a {
  color: var(--color-accent);
  font-weight: 600;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.submenu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  min-width: 12rem;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.25s var(--ease-out), visibility 0s linear 0.25s;
}

/* Unsichtbare Brücke, damit das Untermenü beim Hinunterfahren offen bleibt */
.submenu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.5rem;
  height: 0.5rem;
}

.nav-item:hover .submenu,
.nav-item:focus-within .submenu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.2s ease, transform 0.25s var(--ease-out), visibility 0s;
}

.submenu a {
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
}

.submenu a:hover,
.submenu a[aria-current="page"] {
  background: var(--color-muted);
}

/* --- Hero mit Video (Startseite) ----------------------------------------- */

.hero {
  max-width: 48rem;
}

.hero p {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.6;
  color: var(--color-text-soft);
  margin: 0;
}

.hero p a:not(.button) {
  color: var(--color-text);
}

.hero-video {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: clamp(460px, 78vh, 760px);
  min-height: clamp(460px, 78svh, 760px);
  margin-top: calc(var(--header-height) * -1);
  padding: calc(var(--header-height) + 3rem) var(--gutter) clamp(3rem, 9vw, 6.5rem);
  overflow: hidden;
  background: #000000;
  color: #ffffff;
  text-align: center;
}

.hero-video-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.hero-video::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 35%, rgba(0, 0, 0, 0.35) 60%, rgba(0, 0, 0, 0.85) 100%),
    radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.35) 100%);
}

.hero-video-text {
  position: relative;
  max-width: 52rem;
}

.hero-video h1 {
  margin: 0 0 1.25rem;
  color: #ffffff;
  font-size: clamp(2.6rem, 1.5rem + 5vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}

.hero-logo {
  display: inline-block;
  height: 0.82em;
  width: auto;
  margin-left: 0.08em;
  vertical-align: -0.06em;
  filter: invert(1) drop-shadow(0 2px 20px rgba(0, 0, 0, 0.35));
}

.hero-video p {
  max-width: 40rem;
  margin: 0 auto;
  font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.35rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

.hero-video-toggle {
  position: absolute;
  right: var(--gutter);
  bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 0.2s ease;
}

@media (max-width: 599px) {
  .hero-video {
    padding-bottom: 5.5rem;
  }
}

.hero-video-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.hero-video-toggle:focus-visible {
  outline-color: #ffffff;
}

.hero-video-toggle svg {
  width: 18px;
  height: 18px;
}

.hero-video-toggle .icon-play,
.hero-video-toggle[aria-pressed="true"] .icon-pause {
  display: none;
}

.hero-video-toggle[aria-pressed="true"] .icon-play {
  display: block;
}

/* Header über dem Video: transparent, helle Schrift, bis gescrollt wird */
body:has(> .hero-video) .site-header:not(.is-scrolled):not(.nav-open) {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body:has(> .hero-video) .site-header:not(.is-scrolled):not(.nav-open) .logo img {
  filter: invert(1);
}

body:has(> .hero-video) .site-header:not(.is-scrolled):not(.nav-open) nav > a,
body:has(> .hero-video) .site-header:not(.is-scrolled):not(.nav-open) .nav-item > a,
body:has(> .hero-video) .site-header:not(.is-scrolled):not(.nav-open) .theme-toggle {
  color: #ffffff;
}

body:has(> .hero-video) .site-header:not(.is-scrolled):not(.nav-open) .theme-toggle {
  border-color: rgba(255, 255, 255, 0.35);
}

body:has(> .hero-video) .site-header:not(.is-scrolled):not(.nav-open) .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

body:has(> .hero-video) .site-header:not(.is-scrolled):not(.nav-open) nav > a::after,
body:has(> .hero-video) .site-header:not(.is-scrolled):not(.nav-open) .nav-item > a::after {
  background: #ffffff;
}

body:has(> .hero-video) .site-header:not(.is-scrolled):not(.nav-open) .nav-toggle span {
  background: #ffffff;
}

/* --- Karten -------------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-top: 2rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--color-text) 18%, transparent);
}

.card h3 {
  margin: 0 0 0.75rem;
}

.card p {
  margin: 0 0 1rem;
  color: var(--color-text-soft);
}

.card p:last-child {
  margin-bottom: 0;
}

.card h3 a {
  color: inherit;
}

.card-sub {
  margin-top: -0.25rem;
  font-weight: 600;
  color: var(--color-text) !important;
}

.card-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.card-more::after {
  content: "→";
  transition: transform 0.3s var(--ease-out);
}

.card-more:hover::after,
.card:hover .card-more::after {
  transform: translateX(4px);
}

/* Ganze Karte klickbar, wenn sie einen «weiter»-Link hat */
.card-more::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card-image {
  display: block;
  width: calc(100% + 2 * clamp(1.5rem, 3vw, 2rem));
  max-width: none;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin: calc(-1 * clamp(1.5rem, 3vw, 2rem)) calc(-1 * clamp(1.5rem, 3vw, 2rem)) 1.5rem;
  transition: transform 0.6s var(--ease-out);
}

.card:hover .card-image {
  transform: scale(1.03);
}

/* --- Service-Karten (Startseite) ------------------------------------------ */

.card-icon {
  display: block;
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card-icon {
    filter: invert(1);
  }
}

:root[data-theme="dark"] .card-icon {
  filter: invert(1);
}

/* Kreislauf: Richtung oben, Idee rechts, Struktur unten, Design links */
.cards-4 {
  --gap: clamp(1rem, 2vw, 1.5rem);
  gap: var(--gap);
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas:
    ". top ."
    "left ring right"
    ". bottom .";
  align-items: center;
}

.cards-4 .card {
  padding: 1.25rem;
}

.cards-4 .card:nth-child(1) {
  grid-area: top;
}

.cards-4 .card:nth-child(2) {
  grid-area: right;
}

.cards-4 .card:nth-child(3) {
  grid-area: bottom;
}

.cards-4 .card:nth-child(4) {
  grid-area: left;
}

.cycle-ring {
  grid-area: ring;
  justify-self: center;
  width: 100%;
  max-width: 16rem;
  height: auto;
  color: var(--color-text);
}

/* Auf Tablet und Handy untereinander, mit Pfeilen nach unten */
@media (max-width: 56rem) {
  .cards-4 {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .cards-4 .card:nth-child(n) {
    grid-area: auto;
    overflow: visible;
  }

  .cards-4 .card:nth-child(-n + 3)::after {
    content: "↓";
    position: absolute;
    left: 50%;
    bottom: calc(var(--gap) / -2 - 0.75rem);
    transform: translateX(-50%);
    color: var(--color-muted);
    font-size: 1.25rem;
    line-height: 1;
  }

  .cycle-ring {
    display: none;
  }
}

@media (min-width: 40rem) {
  .cards-4 .card {
    padding: clamp(1.5rem, 3vw, 2rem);
  }
}

/* --- Geräte (Startseite) ------------------------------------------------- */

/*
#webdesign:not(.offer) > h2,
#webdesign:not(.offer) > p,
#service > h2,
#service > p {
   text-align: center; 

}

#webdesign:not(.offer) > p,
#service > p {
  max-width: 50rem;
  margin-left: auto;
  margin-right: auto;
  color: var(--color-text-soft);
}
*/

.devices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 0;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-lg);
}

.device {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: 8.5rem;
  padding: 1.5rem 1rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), background-color 0.3s ease;
}

.device svg {
  width: 44px;
  height: 44px;
  transition: transform 0.4s var(--ease-out);
}

.devices:hover .device {
  box-shadow: var(--shadow-md);
}

.device:hover {
  transform: translateY(-4px);
}

.device:hover svg {
  transform: scale(1.08);
}

@media (max-width: 479px) {
  .devices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .device {
    min-width: 0;
  }
}

/* --- Service-Tabs (Startseite) ------------------------------------------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  width: fit-content;
  max-width: 100%;
  margin: 2rem auto 1.25rem;
  padding: 0.3rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
}

.tabs button {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  min-height: 44px;
  padding: 0.5rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

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

.tabs button[aria-selected="true"] {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  max-width: 48rem;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  font-size: 1.05rem;
}

.tab-panel p {
  margin: 0;
}

.tab-panel:not([hidden]) {
  animation: fade-up 0.45s var(--ease-out);
}

@media (max-width: 479px) {
  .tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    border-radius: var(--radius-lg);
  }

  .tabs button {
    border-radius: 14px;
  }
}

/* --- Firma: Zahlen und Team ---------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 1rem;
  margin-top: var(--section-space);
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.7)),
    url("../img/firma-banner-frei.jpg") center / cover;
  color: #ffffff;
  text-align: center;
  overflow: hidden;
}

.stat-number {
  display: block;
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.member {
  text-align: center;
  padding: 2rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.member:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.member img {
  display: block;
  width: 160px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--color-bg), 0 0 0 5px var(--color-border);
}

.member h3 {
  margin: 0;
}

.member p {
  margin: 0.25rem 0 0;
  color: var(--color-text-soft);
}

#team > p {
  color: var(--color-text-soft);
}

@media (min-width: 768px) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }

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

address {
  font-style: normal;
  margin-bottom: 1rem;
  padding: 1.5rem 1.75rem;
  width: fit-content;
  min-width: min(100%, 20rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  line-height: 1.75;
}

/* --- Knopf ---------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.button::after {
  content: "↗";
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* --- Nach oben ----------------------------------------------------------- */

.to-top {
  position: fixed;
  right: var(--gutter);
  bottom: 1.25rem;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out), visibility 0s linear 0.3s, background-color 0.2s ease;
}

.to-top svg {
  width: 20px;
  height: 20px;
}

.to-top:hover {
  background: var(--color-muted);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out), visibility 0s, background-color 0.2s ease;
}

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  margin-top: auto;
  padding: 2.5rem max(var(--gutter), calc((100% - var(--max-width)) / 2));
  background: var(--color-footer-bg);
  color: var(--color-footer-soft);
  font-size: 0.9rem;
}

.site-footer p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  margin: 0;
  text-align: center;
}

.footer-logo {
  display: inline-block;
  height: 18px;
  width: auto;
  filter: invert(1);
}

.site-footer a {
  color: var(--color-footer-text);
  text-decoration: none;
}

.site-footer a:hover {
  opacity: 0.7;
}

.site-footer :focus-visible {
  outline-color: #ffffff;
}

/* --- Mobile Navigation --------------------------------------------------- */

.nav-toggle {
  display: none;
}

@media (max-width: 767px) {
  .theme-toggle {
    order: 0;
    margin-left: auto;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
  }

  .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-text);
    transition: transform 0.3s var(--ease-out), opacity 0.2s ease;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0.25rem 0 0.5rem;
    max-height: calc(100dvh - var(--header-height) - 1rem);
    overflow-y: auto;
  }

  .site-header.nav-open {
    background: var(--color-header-bg-open);
    border-bottom-color: var(--color-border);
  }

  .site-header.nav-open nav {
    display: flex;
    animation: fade-down 0.35s var(--ease-out);
  }

  nav a {
    display: block;
    padding: 0.9rem 0.25rem;
    font-size: 1.15rem;
    border-radius: 0;
    border-bottom: 1px solid var(--color-border);
  }

  nav > a::after,
  .nav-item > a::after {
    display: none;
  }

  nav > a:last-child,
  .submenu a:last-child {
    border-bottom: 0;
  }

  .nav-item {
    display: block;
  }

  .nav-item > a {
    display: block;
  }

  .submenu {
    position: static;
    min-width: 0;
    padding: 0 0 0 1rem;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: none;
    background: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .submenu::before {
    display: none;
  }

  .submenu a {
    padding: 0.7rem 0.25rem;
    font-size: 1rem;
    color: var(--color-text-soft);
    border-bottom: 0;
  }

  .submenu a:hover,
  .submenu a[aria-current="page"] {
    background: none;
    color: var(--color-text);
  }

  nav a[aria-current="page"],
  nav a:hover {
    font-weight: 600;
  }
}

/* --- Angebot ------------------------------------------------------------- */

.offer-body {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: 1.5rem;
}

.offer-body p {
  margin: 0 0 1.1rem;
  color: var(--color-text-soft);
}

.offer-body strong {
  color: var(--color-text);
}

.offer-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.offer a {
  color: var(--color-text);
  font-weight: 600;
}

@media (min-width: 768px) {
  .offer-body {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }

  .offer-reverse .offer-image {
    order: 2;
  }
}

.back-link {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.back-link a {
  color: var(--color-text);
}

/* --- Galerien und Lightbox ----------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  margin-top: 1.5rem;
}

main > section:first-child + section > .gallery:first-child {
  margin-top: 0;
}

.gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-muted);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.gallery-item::after {
  content: attr(data-caption);
  position: absolute;
  inset: auto 0 0;
  padding: 2.5rem 1rem 0.85rem;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.7));
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
}

.gallery-item:hover,
.gallery-item:focus-visible {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after {
  opacity: 1;
  transform: none;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.05);
}

.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 1rem;
  border: 0;
  background: transparent;
  color: #ffffff;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  animation: fade-in 0.25s ease;
}

.lightbox[open]::backdrop {
  animation: fade-in 0.25s ease;
}

.lightbox figure {
  margin: 0;
  min-width: 0;
  text-align: center;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 7rem);
  max-height: calc(100dvh - 7rem);
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
}

.lightbox[open] img {
  animation: zoom-in 0.35s var(--ease-out);
}

.lightbox figcaption {
  margin-top: 0.85rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}

.lightbox button {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0 0 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.lightbox button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox button:active {
  transform: scale(0.94);
}

.lightbox button[hidden] {
  display: none;
}

.lightbox :focus-visible {
  outline-color: #ffffff;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
}

@media (max-width: 599px) {
  .lightbox {
    padding: 4.5rem 0.5rem 5rem;
  }

  .lightbox-prev,
  .lightbox-next {
    position: absolute;
    bottom: 1rem;
  }

  .lightbox-prev {
    left: calc(50% - 56px);
  }

  .lightbox-next {
    right: calc(50% - 56px);
  }

  .lightbox img {
    max-height: calc(100dvh - 12rem);
  }
}

.gallery-logos {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.gallery-logos .gallery-item {
  background: #ffffff;
  color: #52525b;
  border: 1px solid var(--color-border);
}

.gallery-logos .gallery-item img {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  padding: 1rem;
}

/* --- Kurzbiografie ------------------------------------------------------- */

.bio {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}

.bio p {
  color: var(--color-text-soft);
}

.bio a {
  color: var(--color-text);
  font-weight: 600;
}

.bio-image {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.timeline {
  position: relative;
  margin: 1.5rem 0 0;
  padding: 0 0 0 1.75rem;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 2px;
  background: var(--color-border);
}

.timeline li {
  position: relative;
  padding: 0.5rem 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem + 1px);
  top: 1.05rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-bg);
}

.timeline strong {
  display: inline-block;
  min-width: 3.75rem;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  .bio {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }

  .bio-image {
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
  }
}

/* --- Bewegung ------------------------------------------------------------ */

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes fade-up {
  from { opacity: 0; translate: 0 12px; }
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-8px); }
}

@keyframes zoom-in {
  from { opacity: 0; transform: scale(0.96); }
}

@keyframes reveal {
  from { opacity: 0; translate: 0 28px; }
  to { opacity: 1; translate: none; }
}

/* Inhalte sanft einblenden, sobald sie ins Bild scrollen (nur wo der Browser es kann) */
@media (prefers-reduced-motion: no-preference) {
  .hero-video-text {
    animation: fade-up 1s var(--ease-out) both;
  }

  main > section:first-child > * {
    animation: fade-up 0.8s var(--ease-out) both;
  }

  main > section:first-child > :nth-child(2) {
    animation-delay: 0.08s;
  }

  @supports (animation-timeline: view()) {
    .card,
    .device,
    .member,
    .stats,
    .offer-image,
    .gallery-item,
    .bio-image {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .to-top,
  .hero-video-media,
  .lightbox {
    display: none !important;
  }

  .hero-video {
    min-height: 0;
    margin: 0;
    color: #000000;
    background: none;
  }

  .hero-video h1 {
    color: #000000;
  }
}
