/* =========================================================
   Malerbetrieb Joh. Oswald Riede – Stylesheet
   Grundsatz: Gestaltung nur über Klassen. Keine globalen Regeln
   für p, h1–h6, ul, a usw. – eingefügte Textbausteine (z. B. auf
   der Impressum-Seite) behalten dadurch ihr Standard-Aussehen.
   ========================================================= */

/* ---------- Schriften (lokal, DSGVO-konform) ---------- */
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Farben & Maße ---------- */
:root {
  /* Logo-Farben (aus dem Original-Logo gemessen) */
  --c-yellow: #fff500;
  --c-blue: #291670;
  --c-red: #d8261c;
  --c-green: #41735a;
  --c-orange: #e87846;
  --c-purple: #874a74;

  /* Leuchtfarben für die Farbwolken: gleiche Farbtöne, etwas heller,
     weil das sehr dunkle Logo-Blau weichgezeichnet grau-schmutzig wirkt */
  --glow-yellow: #fff200;
  --glow-blue: #4a36d6;
  --glow-red: #ef3b2f;

  --ink: #17132b;
  --muted: #5d5a70;
  --line: #e9e7f1;
  --bg: #ffffff;
  --bg-soft: #f8f7fb;

  --radius: 1.25rem;
  --header-h: 4.25rem;
  --container: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --ease: cubic-bezier(.22, .8, .24, 1);
}

/* ---------- Minimaler Reset (bewusst ohne Typografie-Regeln) ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Anker-Sprünge nicht unter der fixierten Kopfzeile verstecken */
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

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

:focus-visible {
  outline: 3px solid var(--c-blue);
  outline-offset: 3px;
  border-radius: .25rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Hilfsklassen ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: .75rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: .5rem;
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* =========================================================
   Farbwolken (gemeinsame Basis für Hero, Menü, Kontakt)
   multiply mischt die Farben subtraktiv – wie Farbe auf Papier
   und wie im Logo selbst (Gelb + Rot = Orange usw.)
   ========================================================= */
.glow {
  position: absolute;
  border-radius: 50%;
  aspect-ratio: 1;
  mix-blend-mode: multiply;
  pointer-events: none;
  will-change: transform;
}
.glow--y { background: radial-gradient(circle, rgba(255, 242, 0, .85) 0%, rgba(255, 242, 0, .35) 35%, rgba(255, 242, 0, 0) 68%); }
.glow--b { background: radial-gradient(circle, rgba(74, 54, 214, .45) 0%, rgba(74, 54, 214, .16) 35%, rgba(74, 54, 214, 0) 68%); }
.glow--r { background: radial-gradient(circle, rgba(239, 59, 47, .5) 0%, rgba(239, 59, 47, .18) 35%, rgba(239, 59, 47, 0) 68%); }

/* =========================================================
   Kopfzeile
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding-inline: var(--gutter);
  transition: background-color .35s, box-shadow .35s, backdrop-filter .35s;
}
/* Zustand nach dem Scrollen (Klasse setzt script.js) */
.site-header.is-scrolled,
html:not(.js) .site-header {
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
body.menu-open .site-header {
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.site-header__brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: -.01em;
  /* Im Hero steht das große Logo – das kleine erst beim Scrollen zeigen */
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .35s, transform .35s var(--ease);
}
.site-header.is-scrolled .site-header__brand,
body.menu-open .site-header__brand {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.site-header__brand img { width: 2.25rem; height: auto; display: block; }

/* Telefonnummer oben mittig */
.phone-pill {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: .95rem;
  white-space: nowrap;
  box-shadow: 0 6px 24px -12px rgba(23, 19, 43, .35);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.phone-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(216, 38, 28, .35);
  box-shadow: 0 10px 28px -12px rgba(216, 38, 28, .45);
}
.phone-pill .icon { color: var(--c-red); }
.phone-pill__label { color: var(--muted); font-size: .85rem; }
.phone-pill__number { font-weight: 500; letter-spacing: .02em; }

/* Hamburger */
.menu-toggle {
  justify-self: end;
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .25s, background-color .25s;
}
.menu-toggle:hover { border-color: #cfcbe0; }
.menu-toggle__bars {
  position: relative;
  display: block;
  width: 1.2rem;
  height: .85rem;
}
.menu-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .35s var(--ease), opacity .2s, top .35s var(--ease);
}
.menu-toggle__bars span:nth-child(1) { top: 0; }
.menu-toggle__bars span:nth-child(2) { top: calc(50% - 1px); }
.menu-toggle__bars span:nth-child(3) { top: calc(100% - 2px); }
/* Offen: zu einem X umklappen */
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) { top: calc(50% - 1px); transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) { top: calc(50% - 1px); transform: rotate(-45deg); }

@media (max-width: 40rem) {
  .phone-pill__label { display: none; }
  .phone-pill { padding: .5rem .9rem; }
  .site-header__name { display: none; }
}

/* =========================================================
   Vollbild-Menü
   ========================================================= */
.menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 1rem) var(--gutter) 2rem;
  background: var(--bg);
  overflow: hidden auto;
  /* Öffnen als wachsender Farbkreis von rechts oben */
  clip-path: circle(0 at calc(100% - var(--gutter) - 1.5rem) calc(var(--header-h) / 2));
  transition: clip-path .6s var(--ease);
}
.menu.is-open {
  clip-path: circle(150% at calc(100% - var(--gutter) - 1.5rem) calc(var(--header-h) / 2));
}
.menu[hidden] { display: none; }

.menu__glow { position: absolute; inset: 0; pointer-events: none; }
.menu__glow .glow { width: 70vmax; filter: blur(10px); opacity: .7; }
.menu__glow .glow--y { right: -20vmax; top: -25vmax; }
.menu__glow .glow--b { left: -25vmax; bottom: -30vmax; }
.menu__glow .glow--r { right: -30vmax; bottom: -35vmax; }

.menu__list {
  position: relative;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  max-width: var(--container);
}
.menu__link {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: .35em 0;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(2rem, 7vw, 4.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity .5s, transform .5s var(--ease), color .2s;
}
.menu.is-open .menu__link { opacity: 1; transform: none; }
.menu.is-open li:nth-child(1) .menu__link { transition-delay: .12s; }
.menu.is-open li:nth-child(2) .menu__link { transition-delay: .18s; }
.menu.is-open li:nth-child(3) .menu__link { transition-delay: .24s; }
.menu.is-open li:nth-child(4) .menu__link { transition-delay: .30s; }
.menu__link:hover { color: var(--c-red); }
.menu__num {
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--muted);
}

.menu__footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 2rem;
  align-items: baseline;
  width: 100%;
  max-width: var(--container);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .95rem;
}
.menu__phone { color: var(--ink); font-weight: 500; font-size: 1.15rem; text-decoration: none; }
.menu__small { color: var(--muted); }

body.menu-open { overflow: hidden; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  --p: 0; /* Scroll-Fortschritt 0…1, setzt script.js */
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 6rem;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}
/* Weicher Übergang ins Weiß am unteren Rand */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
  z-index: 1;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__logo {
  position: relative;
  z-index: 1;
  width: clamp(170px, 36vmin, 290px);
  aspect-ratio: 231 / 219;
  margin-bottom: clamp(2rem, 5vh, 3.25rem);
  transform: translateY(calc(var(--p) * 60px)) scale(calc(1 - var(--p) * .18));
}
.hero__logo img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(23, 19, 43, .12));
}

/* Farbwolken: gleiche Mittelpunkte wie die Logo-Kreise, aber groß und weich */
.hero__glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: calc(.75 - var(--p) * .7);
}
.hero__glow .glow { width: 220%; }
.hero__glow .glow--y { left: 51%;   top: 30.7%; animation: glow-breathe-y 9s ease-in-out infinite; }
.hero__glow .glow--b { left: 29.2%; top: 68.5%; animation: glow-breathe-b 11s ease-in-out infinite; }
.hero__glow .glow--r { left: 71%;   top: 69.4%; animation: glow-breathe-r 10s ease-in-out infinite; }

@keyframes glow-breathe-y {
  0%, 100% { transform: translate(-50%, -62%) scale(.9); }
  50%      { transform: translate(-50%, -70%) scale(1.08); }
}
@keyframes glow-breathe-b {
  0%, 100% { transform: translate(-62%, -42%) scale(.92); }
  50%      { transform: translate(-70%, -36%) scale(1.06); }
}
@keyframes glow-breathe-r {
  0%, 100% { transform: translate(-38%, -42%) scale(.95); }
  50%      { transform: translate(-30%, -36%) scale(1.1); }
}

/* Farbringe, die aus den Kreisen herauslaufen und im Weiß verklingen */
.hero__ripple {
  position: absolute;
  z-index: 1;
  width: 57.3%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--rc);
  opacity: 0;
  transform: translate(-50%, -50%) scale(1);
  animation: ripple 6s var(--ease) infinite;
  pointer-events: none;
}
.hero__ripple--y { --rc: rgba(240, 225, 0, .9); left: 51%;   top: 30.7%; }
.hero__ripple--b { --rc: rgba(41, 22, 112, .55); left: 29.2%; top: 68.5%; animation-delay: 2s; }
.hero__ripple--r { --rc: rgba(216, 38, 28, .6);  left: 71%;   top: 69.4%; animation-delay: 4s; }

@keyframes ripple {
  0%   { opacity: 0;   transform: translate(-50%, -50%) scale(1); }
  8%   { opacity: .9; }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(2.6); }
}

.hero__kicker,
.hero__title,
.hero__tagline,
.hero__sub { position: relative; z-index: 2; }

.hero__kicker {
  /* Der Kicker steht als <span> INNERHALB der H1 (damit die Überschrift
     das Wort "Malerbetrieb" enthält). Ein <span> ist von Haus aus inline –
     diese beiden Zeilen machen daraus wieder eine eigene Zeile mit der
     ursprünglichen Zeilenhöhe. Ohne sie rutscht der Kicker neben den Namen. */
  display: block;
  line-height: 1.6;
  margin: 0 0 .35rem;
  font-size: clamp(.8rem, 1.6vw, .95rem);
  font-weight: 500;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--muted);
  /* Sperrung rechts ausgleichen, damit der Text optisch mittig sitzt */
  margin-right: -.42em;
}
.hero__title {
  margin: 0;
  font-size: clamp(2.35rem, 7.2vw, 5.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.035em;
  color: var(--ink);
}
.hero__tagline {
  margin: 1.1rem 0 0;
  max-width: 34rem;
  font-size: clamp(1rem, 2.1vw, 1.25rem);
  font-weight: 400;
  color: var(--ink);
}
.hero__sub {
  margin: .35rem 0 0;
  font-size: clamp(.9rem, 1.7vw, 1rem);
  font-weight: 300;
  color: var(--muted);
}

.scroll-hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: calc(1 - var(--p) * 3);
}
.scroll-hint .icon { animation: nudge 2.2s ease-in-out infinite; }
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* =========================================================
   Sektionen allgemein
   ========================================================= */
.section {
  position: relative;
  padding-block: clamp(4.5rem, 10vw, 7rem);
}

.section-head { max-width: 44rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 1rem;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
}
/* Drei Punkte in den Logo-Farben als wiederkehrendes Motiv */
.dots {
  width: .6rem;
  height: .6rem;
  margin-right: 1.5rem;
  border-radius: 50%;
  background: var(--c-yellow);
  box-shadow: .75rem 0 0 var(--c-blue), 1.5rem 0 0 var(--c-red);
}

.section-title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.9rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
}
.lead {
  margin: 0 0 1rem;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink);
}
.body-text { margin: 0 0 1rem; color: var(--muted); }

/* Einblenden beim Scrollen – nur wenn JS läuft (Klasse .js am <html>),
   sonst bleibt alles sichtbar */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   Über uns
   ========================================================= */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}

.check-list {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: grid;
  gap: .85rem;
}
.check-list__item {
  position: relative;
  padding-left: 2.1rem;
  font-weight: 500;
}
.check-list__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: .2em;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--dot, var(--c-yellow));
  mix-blend-mode: multiply;
}
.check-list__item::after {
  content: "";
  position: absolute;
  left: .42rem;
  top: calc(.2em + .28rem);
  width: .32rem;
  height: .55rem;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check-list__item:nth-child(2) { --dot: rgba(74, 54, 214, .35); }
.check-list__item:nth-child(3) { --dot: rgba(239, 59, 47, .4); }

.stats { display: grid; gap: 1rem; }
.stat {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  isolation: isolate;
}
/* Farbfleck, der aus der Ecke ins Weiß ausläuft */
.stat::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -3.5rem;
  top: 50%;
  width: 11rem;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle, var(--sc) 0%, transparent 68%);
  opacity: .55;
}
.stat--y { --sc: var(--glow-yellow); }
.stat--b { --sc: rgba(74, 54, 214, .55); }
.stat--r { --sc: rgba(239, 59, 47, .6); }
.stat__value {
  font-size: clamp(2.4rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.04em;
}
.stat__value--word { font-size: clamp(1.9rem, 4vw, 2.5rem); }
.stat__label { color: var(--muted); font-weight: 500; }

/* =========================================================
   Leistungen
   ========================================================= */
.section--services { background: var(--bg-soft); }

.services {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* 6er-Raster: oben 3 Karten, unten 2 breitere – keine verwaiste Einzelkarte */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
}
.service { grid-column: span 2; }
.service:nth-child(n + 4) { grid-column: span 3; }
.service {
  position: relative;
  min-height: 11rem;
  padding: 1.75rem 1.6rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
  transition: transform .4s var(--ease), box-shadow .4s;
}
/* Farbkreis in der Ecke, wächst beim Überfahren */
.service::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -2.25rem;
  top: -2.25rem;
  width: 7rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  opacity: .9;
  transition: transform .6s var(--ease), opacity .6s;
}
.service:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -28px rgba(23, 19, 43, .45); }
.service:hover::before { transform: scale(1.35); opacity: 1; }

.service__num {
  display: block;
  margin-bottom: 2.25rem;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .15em;
  color: var(--muted);
}
.service__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
  max-width: 14rem;
}
.service__text { margin: .5rem 0 0; font-size: .92rem; color: var(--muted); line-height: 1.55; }

.values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
}
.value__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  color: var(--ink);
  isolation: isolate;
}
.value__icon::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background: var(--accent);
  opacity: .28;
}
.value__icon .icon { width: 1.6rem; height: 1.6rem; }
.value__title { margin: 0 0 .6rem; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.value__text { margin: 0; color: var(--muted); font-size: .98rem; }

/* =========================================================
   Referenzen
   ========================================================= */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}
/* Erste Kachel doppelt breit – etwas Rhythmus statt starrem Raster */
.ref:first-child,
.ref:last-child { grid-column: span 2; }

.ref { margin: 0; }
.ref__btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  /* Liegt unter dem Foto; sichtbar, solange kein Bild da ist */
  background:
    radial-gradient(circle at 78% 22%, var(--accent) 0%, transparent 55%),
    radial-gradient(circle at 15% 90%, rgba(74, 54, 214, .18) 0%, transparent 50%),
    var(--bg-soft);
}
.ref:first-child .ref__btn { aspect-ratio: auto; height: auto; min-height: 14rem; }
.ref:last-child .ref__btn { aspect-ratio: 8 / 3; }
.ref__img {
  /* absolut, damit die Bildgröße das Raster nicht aufbläht */
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease);
}
.ref__btn:hover .ref__img { transform: scale(1.04); }
/* Bild fehlt noch: Foto ausblenden, Verlauf zeigen, nicht vergrößerbar */
.ref.is-missing .ref__img { visibility: hidden; }
.ref.is-missing .ref__btn { cursor: default; }

.ref__cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .85rem .25rem 0;
}
.ref__title { font-weight: 500; }
.ref__tag { flex: none; font-size: .8rem; color: var(--muted); letter-spacing: .04em; }

/* Erste Kachel: Bildunterschrift unter dem Bild behalten, Höhe über Grid */
.ref:first-child { display: grid; grid-template-rows: 1fr auto; }

/* Lightbox */
.lightbox {
  width: min(92vw, 70rem);
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(23, 19, 43, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.lightbox__img { display: block; width: 100%; max-height: calc(92vh - 3.5rem); object-fit: contain; background: var(--bg-soft); }
.lightbox__cap { margin: 0; padding: .9rem 1.25rem; font-weight: 500; }
.lightbox__close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

/* =========================================================
   Kontakt
   ========================================================= */
.section--contact { overflow: hidden; isolation: isolate; text-align: center; }
.contact__glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.contact__glow .glow { width: min(60rem, 120vw); opacity: .55; }
.contact__glow .glow--y { left: 50%; bottom: -38rem; transform: translateX(-50%); }
.contact__glow .glow--b { left: -18rem; bottom: -30rem; }
.contact__glow .glow--r { right: -18rem; bottom: -30rem; }

.contact { max-width: 52rem; }
.contact .eyebrow { justify-content: center; }
.contact .lead { max-width: 38rem; margin-inline: auto; }

.contact__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
  text-align: left;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.75rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.contact-card--phone { transition: transform .35s var(--ease), box-shadow .35s; }
.contact-card--phone:hover { transform: translateY(-3px); box-shadow: 0 24px 40px -28px rgba(216, 38, 28, .6); }
.contact-card__label { font-size: .85rem; color: var(--muted); }
.contact-card__value { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 700; letter-spacing: -.02em; }
.contact-card__address { font-style: normal; font-size: 1.05rem; line-height: 1.55; }
.contact-card__action {
  margin-top: auto;
  padding-top: .75rem;
  color: var(--c-red);
  font-weight: 500;
  text-decoration: none;
}
a.contact-card__action:hover { text-decoration: underline; }

/* =========================================================
   Fußzeile
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding-block: 2rem;
  font-size: .9rem;
  color: var(--muted);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.site-footer__inner img { width: 2.75rem; height: auto; }
.site-footer__copy { margin: 0; flex: 1; }
.site-footer__nav { display: flex; gap: 1.5rem; }
.site-footer__nav a { color: var(--ink); text-decoration: none; }
.site-footer__nav a:hover { text-decoration: underline; }

/* =========================================================
   Impressum / Datenschutz
   Absichtlich KEINE Regeln für p, h2, ul usw. – eingefügte
   Texte erscheinen im Browser-Standard mit der Seitenschrift.
   ========================================================= */
.legal-page { padding: calc(var(--header-h) + 2rem) 0 4rem; }
.legal {
  max-width: 48rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
  overflow-wrap: anywhere; /* lange URLs/E-Mail-Adressen umbrechen */
}
.legal + .legal { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--line); }
.legal-hint {
  padding: 1rem 1.25rem;
  border: 2px dashed #cfcbe0;
  border-radius: .75rem;
  color: var(--muted);
}
.back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.back-link img { width: 2.25rem; height: auto; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 60rem) {
  .about { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { flex-direction: column; gap: .35rem; padding: 1.25rem; }
  .values { grid-template-columns: 1fr; max-width: 40rem; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ref:last-child { grid-column: auto; }
  .ref:first-child .ref__btn { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
  .ref:last-child .ref__btn { aspect-ratio: 4 / 3; }
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service, .service:nth-child(n + 4) { grid-column: auto; }
  .service:first-child { grid-column: span 2; }
}

@media (max-width: 40rem) {
  .stats { grid-template-columns: 1fr; }
  .stat { flex-direction: row; align-items: baseline; }
  .gallery { grid-template-columns: 1fr; }
  .services { grid-template-columns: 1fr; }
  .service:first-child { grid-column: auto; }
  .service { min-height: 0; }
  .service__num { margin-bottom: 1.25rem; }
  .ref:first-child { grid-column: auto; display: block; }
  .ref:first-child .ref__btn { aspect-ratio: 4 / 3; height: auto; min-height: 0; }
  .contact__cards { grid-template-columns: 1fr; }
  .site-footer__copy { flex-basis: 100%; order: 3; }
}

/* =========================================================
   Weniger Bewegung, wenn im System so eingestellt
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .hero__ripple { display: none; }
  .hero__glow .glow--y { transform: translate(-50%, -66%); }
  .hero__glow .glow--b { transform: translate(-66%, -40%); }
  .hero__glow .glow--r { transform: translate(-34%, -40%); }
}
