/* ==========================================================================
   Planada Bau – Maler- & Lackierbetrieb
   style.css
   Struktur: Reset / Variables / Base / Typography / Utilities / Header /
   Hero / Sections / Services / About / Why / References / Before-After /
   Lightbox / Contact / Footer / Animations / Responsive / Accessibility
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: clip;
}

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

img {
  height: auto;
  width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
}

/* --------------------------------------------------------------------------
   Variables
   -------------------------------------------------------------------------- */
:root {
  /* Farben – an das Firmenlogo angelehnt (Navy + Gold) */
  --color-primary: #1e3a5f;          /* tiefes Navy (Logo) */
  --color-primary-soft: #2a4a73;
  --color-secondary: #f7f4ee;        /* warmes Weiß */
  --color-background: #fbf9f5;
  --color-surface: #ffffff;
  --color-text: #232427;
  --color-muted: #6b6963;
  --color-line: #e7e2d8;
  --color-accent: #c8961e;           /* Gold (Logo) */
  --color-accent-dark: #96700f;
  --color-accent-soft: #f4e9cf;
  --color-success: #3d7a4f;
  --color-error: #a8402f;

  /* Typografie */
  --font-heading: "Manrope", "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  /* Layout */
  --container: 1180px;
  --gutter: clamp(20px, 5vw, 40px);
  --header-h: 80px;
  --header-h-compact: 64px;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;

  /* Schatten */
  --shadow-soft: 0 10px 30px -12px rgb(26 24 16 / 0.18);
  --shadow-lift: 0 24px 50px -20px rgb(26 24 16 / 0.28);

  /* Transition */
  --ease-out: cubic-bezier(0.22, 0.61, 0.21, 1);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 800;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

p {
  text-wrap: pretty;
}

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

.section {
  padding-block: clamp(72px, 9vw, 120px);
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(40px, 6vw, 64px);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--color-accent);
}

.section-head.centered .eyebrow::after {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--color-accent);
}

.section-head p {
  margin-top: 16px;
  color: var(--color-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.9688rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
    background-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
  will-change: transform;
}

.btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s var(--ease-out);
}

.btn:hover svg {
  transform: translateX(4px);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-secondary);
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  background: var(--color-primary-soft);
}

.btn-accent {
  background: var(--color-accent);
  color: #201808;
  box-shadow: var(--shadow-soft);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  background: #d5a52c;
}

.btn-ghost {
  border: 1.5px solid var(--color-line);
  background: transparent;
  color: var(--color-primary);
}

.btn-ghost:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.btn-ghost.on-dark {
  border-color: rgb(255 255 255 / 0.25);
  color: var(--color-secondary);
}

.btn-ghost.on-dark:hover {
  border-color: var(--color-secondary);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--color-primary);
  color: var(--color-secondary);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  transition: top 0.2s var(--ease-out);
}

.skip-link:focus-visible {
  top: 16px;
}

/* Bild-Platzhalter, falls eine Bilddatei fehlt (z. B. vor dem Upload) */
.img-frame {
  position: relative;
  background: linear-gradient(145deg, #ece7dd, #ded7c8);
  overflow: hidden;
}

.img-frame::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  text-align: center;
  padding: 16px;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8d8676;
  background: repeating-linear-gradient(
    -45deg,
    rgb(255 255 255 / 0.35) 0 12px,
    rgb(255 255 255 / 0.05) 12px 24px
  );
}

.img-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-frame.is-missing::after {
  display: grid;
}

.img-frame.is-missing img {
  visibility: hidden;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: rgb(251 249 245 / 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: height 0.3s var(--ease-out), border-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.site-header.is-scrolled {
  height: var(--header-h-compact);
  border-color: var(--color-line);
  box-shadow: 0 6px 24px -18px rgb(26 24 16 / 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  z-index: 120;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
  color: var(--color-primary);
}

.brand-sub {
  font-size: 0.7188rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 36px);
}

.main-nav a {
  position: relative;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 6px 2px;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.main-nav a:hover::after,
.main-nav a[aria-current="true"]::after {
  transform: scaleX(1);
}

.header-cta {
  min-height: 44px;
  padding: 0 22px;
  font-size: 0.875rem;
}

/* Burger */
.burger {
  display: none;
  position: relative;
  z-index: 120;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--color-line);
  background: var(--color-surface);
  transition: border-color 0.25s var(--ease-out);
}

.burger:hover {
  border-color: var(--color-primary);
}

.burger-box {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.burger-lines {
  position: relative;
  width: 20px;
  height: 14px;
}

.burger-lines span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--color-primary);
  transition: transform 0.3s var(--ease-out), opacity 0.2s var(--ease-out),
    top 0.3s var(--ease-out);
}

.burger-lines span:nth-child(1) { top: 0; }
.burger-lines span:nth-child(2) { top: 6px; }
.burger-lines span:nth-child(3) { top: 12px; }

.burger[aria-expanded="true"] .burger-lines span:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}

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

.burger[aria-expanded="true"] .burger-lines span:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: calc(var(--header-h) + 24px) var(--gutter) calc(48px + env(safe-area-inset-bottom, 0px));
  background: var(--color-primary);
  color: var(--color-secondary);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out),
    visibility 0.35s;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu a {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  font-weight: 700;
  padding: 10px 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out),
    color 0.2s;
}

.mobile-menu.is-open a {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu a:hover {
  color: var(--color-accent);
}

.mobile-menu.is-open a:nth-child(1) { transition-delay: 0.06s; }
.mobile-menu.is-open a:nth-child(2) { transition-delay: 0.12s; }
.mobile-menu.is-open a:nth-child(3) { transition-delay: 0.18s; }
.mobile-menu.is-open a:nth-child(4) { transition-delay: 0.24s; }

.mobile-menu .menu-cta {
  margin-top: 28px;
  align-self: flex-start;
  border: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s var(--ease-out) 0.3s, transform 0.4s var(--ease-out) 0.3s;
}

.mobile-menu.is-open .menu-cta {
  opacity: 1;
  transform: translateY(0);
}

body.menu-open {
  overflow: hidden;
}

/* Brand bleibt über dem dunklen Menü lesbar */
body.menu-open .brand-name {
  color: var(--color-secondary);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(48px, 7vw, 96px));
  padding-bottom: clamp(64px, 8vw, 110px);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgb(200 150 30 / 0.1), transparent 60%),
    var(--color-background);
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgb(26 27 30 / 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 70%, transparent);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.hero-copy .eyebrow {
  margin-bottom: 22px;
}

.hero-copy h1 {
  margin-bottom: 24px;
}

.hero-copy h1 em {
  font-style: normal;
  color: var(--color-accent-dark);
  /* Unterstreichung, die auch bei Zeilenumbruch (mobil) sauber funktioniert */
  background: linear-gradient(transparent 82%, var(--color-accent-soft) 82%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hero-lead {
  max-width: 520px;
  color: var(--color-muted);
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 40px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.hero-trust li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9063rem;
  font-weight: 600;
  color: var(--color-text);
}

.hero-trust svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent-dark);
  flex: none;
}

/* Hero-Collage */
.hero-visual {
  position: relative;
  min-height: 480px;
}

.hero-frame {
  position: absolute;
  inset: 6% 0 0 12%;
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-l);
  transform: rotate(2.5deg);
  pointer-events: none;
}

.hero-main-img {
  position: relative;
  width: min(78%, 420px);
  aspect-ratio: 4 / 5;
  margin-left: auto;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-lift);
}

.hero-float-img {
  position: absolute;
  left: 0;
  bottom: 4%;
  width: min(52%, 280px);
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-m);
  border: 6px solid var(--color-surface);
  box-shadow: var(--shadow-lift);
}

.hero-badge {
  position: absolute;
  right: 0;
  bottom: -4%;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 240px;
  padding: 16px 20px;
  background: var(--color-primary);
  color: var(--color-secondary);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-lift);
}

.hero-badge svg {
  width: 26px;
  height: 26px;
  color: var(--color-accent);
  flex: none;
}

.hero-badge span {
  font-family: var(--font-heading);
  font-size: 0.8438rem;
  font-weight: 700;
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   Sections: Services
   -------------------------------------------------------------------------- */
.services {
  background: var(--color-surface);
  border-block: 1px solid var(--color-line);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.service-card {
  position: relative;
  padding: 34px 30px 30px;
  background: var(--color-background);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-m);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
  border-color: rgb(200 150 30 / 0.45);
}

.service-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

.service-card:hover .service-icon {
  background: var(--color-primary);
  color: var(--color-accent);
}

.service-icon svg {
  width: 26px;
  height: 26px;
}

.service-card h3 {
  margin-bottom: 10px;
}

.service-card p {
  font-size: 0.9688rem;
  color: var(--color-muted);
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.about-visual {
  position: relative;
}

.about-visual .img-frame {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-lift);
}

.about-visual::before {
  content: "";
  position: absolute;
  inset: auto -18px -18px auto;
  width: 46%;
  height: 46%;
  background: var(--color-accent-soft);
  border-radius: var(--radius-m);
  z-index: -1;
}

.about-copy p + p {
  margin-top: 16px;
}

.about-copy p {
  color: var(--color-muted);
}

.about-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  margin-top: 32px;
}

.about-values li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 600;
  font-size: 0.9688rem;
}

.about-values svg {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 2px;
  color: var(--color-accent-dark);
}

/* --------------------------------------------------------------------------
   Why us (dunkle Trust-Sektion)
   -------------------------------------------------------------------------- */
.why {
  background: var(--color-primary);
  color: var(--color-secondary);
}

.why h2 {
  color: var(--color-secondary);
}

.why .section-head p {
  color: rgb(247 244 238 / 0.65);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.why-card {
  padding: 32px 26px;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: var(--radius-m);
  background: rgb(255 255 255 / 0.03);
  transition: border-color 0.3s var(--ease-out), background-color 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}

.why-card:hover {
  border-color: rgb(200 150 30 / 0.6);
  background: rgb(255 255 255 / 0.06);
  transform: translateY(-4px);
}

.why-num {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--color-accent);
  margin-bottom: 18px;
}

.why-card h3 {
  color: var(--color-secondary);
  margin-bottom: 10px;
}

.why-card p {
  font-size: 0.9375rem;
  color: rgb(247 244 238 / 0.65);
}

/* --------------------------------------------------------------------------
   References / Gallery
   -------------------------------------------------------------------------- */
.references {
  background: var(--color-secondary);
  border-block: 1px solid var(--color-line);
}

/* Featured-Projekte */
.project-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  padding: clamp(28px, 4vw, 48px);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-soft);
}

.project-feature + .project-feature {
  margin-top: 24px;
}

.project-feature.reversed .feature-media {
  order: 2;
}

.feature-copy .project-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.feature-copy h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  margin-bottom: 14px;
}

.feature-copy p {
  color: var(--color-muted);
  font-size: 0.9875rem;
}

.feature-list {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.feature-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9375rem;
  font-weight: 600;
}

.feature-list svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent-dark);
  flex: none;
  margin-top: 3px;
}

.ba-hint {
  margin-top: 16px;
  font-size: 0.8438rem;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ba-hint svg {
  width: 16px;
  height: 16px;
  color: var(--color-accent-dark);
}

/* Vorher/Nachher nebeneinander */
.compare-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compare-pair figure {
  position: relative;
}

.compare-pair .img-frame {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-m);
  overflow: hidden;
}

.compare-pair button.img-open {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  border-radius: var(--radius-m);
}

/* Galerie */
.gallery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: clamp(48px, 6vw, 72px) 0 28px;
}

.gallery-head h3 {
  font-size: 1.35rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--color-line);
  background: var(--color-surface);
  font-family: var(--font-heading);
  font-size: 0.8438rem;
  font-weight: 700;
  color: var(--color-muted);
  transition: all 0.25s var(--ease-out);
}

.filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.filter-btn[aria-pressed="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-secondary);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  animation: tile-in 0.45s var(--ease-out) both;
}

.gallery-item.is-hidden {
  display: none;
}

@keyframes tile-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gallery-item .img-frame {
  aspect-ratio: 4 / 3;
}

.gallery-item.tall .img-frame {
  aspect-ratio: 3 / 4;
}

.gallery-item img {
  transition: transform 0.6s var(--ease-out);
}

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

.gallery-item .img-open {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  width: 100%;
  padding: 18px;
  text-align: left;
  background: linear-gradient(to top, rgb(20 18 12 / 0.72), rgb(20 18 12 / 0) 55%);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.gallery-item:hover .img-open,
.gallery-item:focus-within .img-open {
  opacity: 1;
}

.img-open-caption {
  color: var(--color-secondary);
  font-family: var(--font-heading);
  font-size: 0.9063rem;
  font-weight: 700;
  line-height: 1.4;
}

.img-open-caption small {
  display: block;
  font-size: 0.7188rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 4px;
}

/* Touch-Geraete: Bildbeschriftung immer sichtbar (kein Hover vorhanden) */
@media (hover: none) {
  .gallery-item .img-open {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Before / After Slider
   -------------------------------------------------------------------------- */
.ba-slider {
  --pos: 50%;
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-soft);
  /* vertikal weiterscrollen moeglich, horizontal steuert der Slider */
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  background: var(--color-line);
}

.ba-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 var(--pos));
}

.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: var(--color-surface);
  box-shadow: 0 0 12px rgb(0 0 0 / 0.35);
  transform: translateX(-1px);
  pointer-events: none;
}

.ba-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.3);
}

.ba-grip svg {
  width: 20px;
  height: 20px;
}

.ba-slider:focus-within .ba-grip {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.ba-tag {
  position: absolute;
  top: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.7188rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 2;
}

.ba-tag-before {
  left: 14px;
  background: rgb(26 27 30 / 0.78);
  color: var(--color-secondary);
}

.ba-tag-after {
  right: 14px;
  background: var(--color-accent);
  color: #201808;
}

.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  z-index: 3;
}

.ba-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 46px;
  height: 100%;
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgb(16 16 18 / 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-out), visibility 0.3s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox figure {
  max-width: min(1040px, 100%);
  text-align: center;
}

.lightbox img {
  max-height: min(76vh, 860px);
  max-width: 100%;
  width: auto;
  height: auto;
  margin-inline: auto;
  border-radius: var(--radius-s);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.5);
  transform: scale(0.97);
  transition: transform 0.3s var(--ease-out);
}

.lightbox.is-open img {
  transform: scale(1);
}

.lightbox figcaption {
  margin-top: 16px;
  color: rgb(247 244 238 / 0.8);
  font-size: 0.9375rem;
}

.lightbox figcaption strong {
  display: block;
  color: var(--color-secondary);
  font-family: var(--font-heading);
  font-size: 1.0625rem;
}

.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  color: var(--color-secondary);
  border: 1px solid rgb(255 255 255 / 0.16);
  transition: background-color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.lb-btn:hover {
  background: rgb(255 255 255 / 0.18);
  transform: scale(1.06);
}

.lb-btn svg {
  width: 22px;
  height: 22px;
}

.lb-close {
  top: 20px;
  right: 20px;
}

.lb-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lb-prev:hover,
.lb-next:hover {
  transform: translateY(-50%) scale(1.06);
}

.lb-count {
  position: absolute;
  top: 32px;
  left: 28px;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgb(247 244 238 / 0.7);
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.contact-info {
  padding: clamp(28px, 3.4vw, 44px);
  background: var(--color-primary);
  color: var(--color-secondary);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-lift);
}

.contact-info h3 {
  color: var(--color-secondary);
  font-size: 1.5rem;
  margin-bottom: 14px;
}

.contact-info > p {
  color: rgb(247 244 238 / 0.65);
  font-size: 0.9688rem;
  margin-bottom: 30px;
}

.contact-rows {
  display: grid;
  gap: 18px;
}

.contact-rows li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.contact-rows .row-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.07);
  color: var(--color-accent);
}

.contact-rows .row-icon svg {
  width: 20px;
  height: 20px;
}

.contact-rows strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(247 244 238 / 0.55);
  margin-bottom: 2px;
}

.contact-rows span.value {
  font-size: 0.9688rem;
  font-weight: 600;
}

.contact-note {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgb(255 255 255 / 0.12);
  font-size: 0.875rem;
  color: rgb(247 244 238 / 0.6);
}

/* Formular */
.contact-form {
  padding: clamp(28px, 3.4vw, 44px);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-soft);
}

.form-status {
  display: none;
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: var(--radius-s);
  font-size: 0.9375rem;
  font-weight: 600;
}

.form-status.is-error {
  display: block;
  background: #f7e4e0;
  color: var(--color-error);
  border: 1px solid #e5beb6;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-primary);
}

.form-field label .req {
  color: var(--color-accent-dark);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-s);
  background: var(--color-background);
  /* 16px verhindert automatisches Hineinzoomen auf iOS */
  font-size: 1rem;
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
    background-color 0.25s var(--ease-out);
}

.form-field textarea {
  min-height: 140px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: 0 0 0 4px rgb(200 150 30 / 0.15);
}

.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
  border-color: var(--color-error);
}

/* Honeypot – für Menschen unsichtbar */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-check {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.form-check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--color-accent-dark);
}

.form-check a {
  color: var(--color-accent-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-form .btn {
  grid-column: 1 / -1;
  justify-self: start;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--color-primary);
  color: rgb(247 244 238 / 0.7);
  padding: clamp(56px, 7vw, 84px) 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(40px, 5vw, 64px);
}

.footer-brand .brand-name {
  color: var(--color-secondary);
}

.footer-brand p {
  margin-top: 16px;
  font-size: 0.9375rem;
  max-width: 300px;
}

.site-footer h4 {
  color: var(--color-secondary);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.footer-links {
  display: grid;
  gap: 10px;
  font-size: 0.9375rem;
}

.footer-links a {
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgb(255 255 255 / 0.1);
  padding: 22px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8438rem;
}

.footer-bottom nav {
  display: flex;
  gap: 22px;
}

.footer-bottom a:hover {
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Legal pages
   -------------------------------------------------------------------------- */
.legal {
  padding-top: calc(var(--header-h) + clamp(48px, 6vw, 80px));
}

.legal-content {
  max-width: 760px;
}

.legal-content h2 {
  font-size: 1.5rem;
  margin: 40px 0 12px;
}

.legal-content h3 {
  margin: 28px 0 10px;
}

.legal-content p,
.legal-content li {
  color: var(--color-muted);
  margin-bottom: 12px;
  font-size: 0.9875rem;
}

.legal-content ul {
  padding-left: 20px;
  list-style: disc;
}

.placeholder-box {
  padding: 18px 22px;
  border: 1.5px dashed var(--color-accent);
  background: var(--color-accent-soft);
  border-radius: var(--radius-s);
  color: var(--color-accent-dark);
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 18px 0;
}

/* Danke-Seite */
.thanks-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(var(--header-h) + 40px) var(--gutter) 60px;
  text-align: center;
}

.thanks-card {
  max-width: 620px;
  padding: clamp(36px, 6vw, 64px);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-lift);
}

.thanks-logo {
  width: min(230px, 70%);
  height: auto;
  margin: 0 auto 18px;
}

.thanks-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 26px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
}

.thanks-icon svg {
  width: 36px;
  height: 36px;
}

.thanks-card h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 16px;
}

.thanks-card p {
  color: var(--color-muted);
  margin-bottom: 30px;
}

/* --------------------------------------------------------------------------
   Animations (Scroll-Reveal)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .why-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-feature,
  .project-feature.reversed {
    grid-template-columns: 1fr;
  }

  .project-feature.reversed .feature-media {
    order: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .main-nav,
  .header-cta {
    display: none;
  }

  .burger {
    display: block;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 0;
    margin-top: 12px;
  }

  /* Mobile: robuste Collage ohne Absolute-Positionierungs-Mathematik */
  .hero-frame {
    display: none;
  }

  .hero-main-img {
    width: 100%;
    max-width: none;
    margin: 0;
    aspect-ratio: 4 / 3;
  }

  .hero-float-img {
    position: relative;
    left: auto;
    bottom: auto;
    width: 46%;
    margin: -46px 0 0 12px;
    z-index: 2;
  }

  .hero-badge {
    position: static;
    max-width: none;
    margin-top: 18px;
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .services-grid,
  .why-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field {
    grid-column: 1 / -1;
  }

  .compare-pair {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .compare-pair .img-frame {
    aspect-ratio: 4 / 3;
  }

  .lb-prev {
    left: 10px;
  }

  .lb-next {
    right: 10px;
  }
}

@media (max-width: 380px) {
  .hero-actions .btn {
    width: 100%;
  }

  .brand-sub {
    display: none;
  }

  .header-inner {
    gap: 12px;
  }
}

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

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
