/* ===========================
   homeplanning — style.css
   =========================== */

/* ── Fonts ── */
@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/PlayfairDisplay-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/PlayfairDisplay-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/SourceSans3-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/SourceSans3-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ── Custom Properties ── */
:root {
  --clr-dark: #3a3a3a;
  --clr-accent: #f58220;
  --clr-bg: #f5f0eb;
  --clr-bg-alt: #ebe4db;
  --clr-dark-bg: #2e2e2e;
  --clr-textleiste: #dcd5cc;
  --clr-white: #fff;
  --ff-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ff-body: 'Source Sans 3', 'Source Sans Pro', -apple-system, sans-serif;
  --max-w: 1200px;
  --header-h: 96px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
}
/* Lenis controls scrolling; disable native smooth so it doesn't fight. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--clr-dark);
  background: var(--clr-bg);
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* ── Skip to content ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--clr-accent);
  color: var(--clr-white);
  padding: 8px 16px;
  z-index: 1000;
  border-radius: 0 0 4px 4px;
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ── Header / Nav ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 0 32px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), transparent);
  transition: background 0.3s, box-shadow 0.3s, height 0.3s, padding 0.3s;
}
.site-header.scrolled {
  background: rgba(245, 240, 235, 0.38);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  box-shadow: 0 1px 12px rgba(0,0,0,0.04);
  height: 64px;
}
.site-header__logo-link { display: flex; align-items: center; }

.logo {
  height: 72px;
  width: auto;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.4));
  transition: height 0.3s, filter 0.3s;
}
.site-header.scrolled .logo {
  height: 48px;
  filter: none;
}

.nav-links {
  display: flex;
  gap: 32px;
}
.nav-links a {
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--clr-white);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: color 0.3s, text-shadow 0.3s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--clr-accent);
  transition: width 0.3s;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.site-header.scrolled .nav-links a {
  color: var(--clr-dark);
  text-shadow: none;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: 110;
}
.hamburger span {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--clr-white);
  transition: transform 0.3s, opacity 0.3s, background 0.3s;
}
.site-header.scrolled .hamburger span { background: var(--clr-dark); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav overlay */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--clr-bg);
  z-index: 105;
  display: flex;
  flex-direction: column;
  padding: 100px 32px 32px;
  gap: 24px;
  transition: right 0.35s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}
.mobile-nav.open { right: 0; }
.mobile-nav a {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--clr-dark);
}
.mobile-nav a:hover { color: var(--clr-accent); }
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 104;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.mobile-overlay.open { opacity: 1; pointer-events: auto; }

/* ── HOME button ── */
.home-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--clr-accent);
  color: var(--clr-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.home-btn.visible { opacity: 1; pointer-events: auto; }
.home-btn:hover { transform: scale(1.1); }
.home-btn svg { width: 20px; height: 20px; }

/* ── Project full-viewport parallax sections ── */
.project {
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  color: var(--clr-white);
}
.project__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.project__bg,
.project__video {
  position: absolute;
  left: 0;
  top: -15%;
  width: 100%;
  height: 130%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  object-fit: cover;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.project__video {
  object-fit: cover;
  pointer-events: none;
}
.project__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.35) 0%,
    rgba(0,0,0,0.25) 40%,
    rgba(0,0,0,0.55) 100%
  );
  z-index: 1;
  pointer-events: none;
}
.project__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
}
.project__subtitle {
  font-family: var(--ff-body);
  font-size: clamp(0.9rem, 1.6vw, 1.15rem);
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.95;
  margin-bottom: 16px;
}
.project__title {
  font-family: var(--ff-heading);
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 1px;
  margin-bottom: 20px;
}
.project__location {
  font-family: var(--ff-body);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 400;
  letter-spacing: 2px;
  opacity: 0.9;
}

/* Scroll arrow on each project */
.scroll-arrow {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  animation: bounce 2s infinite;
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(2px);
}
.scroll-arrow svg {
  width: 24px;
  height: 24px;
  margin: 10px;
  stroke: var(--clr-white);
  opacity: 0.9;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-8px); }
  60% { transform: translateX(-50%) translateY(-4px); }
}

/* ── Textleiste (detail bar between projects) ── */
.textleiste {
  background: var(--clr-textleiste);
  color: var(--clr-dark);
  padding: 40px 24px;
}
.textleiste__list {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 36px;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  text-align: center;
}
.textleiste__list li {
  position: relative;
  padding: 0 0 0 20px;
}
.textleiste__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--clr-accent);
  border-radius: 50%;
}
.textleiste__list li:first-child { padding-left: 0; }
.textleiste__list li:first-child::before { display: none; }

/* ── Section base ── */
.section {
  padding: 96px 24px;
}
.section--alt { background: var(--clr-bg-alt); }
.section__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.section__title {
  font-family: var(--ff-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
}
.section__title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--clr-accent);
  margin: 16px auto 0;
}

/* ── Vorher/Nachher: full-bleed slider ── */
.ba-section.section {
  padding: 0;
  overflow: hidden;
}
.ba-section .section__inner {
  max-width: none;
  margin: 0;
}
.ba-header {
  background: var(--clr-textleiste);
  width: 100%;
  margin: 0;
  padding: 32px 24px;
}
.ba-header .section__title {
  margin-bottom: 0;
}
.ba-container {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  user-select: none;
}
.ba-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  height: 85vh;
  min-height: 520px;
  background: var(--clr-dark-bg);
}
.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ba-img--after {
  clip-path: inset(0 calc(100% - var(--ba-pos, 50%)) 0 0);
}
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ba-pos, 50%);
  transform: translateX(-50%);
  width: 4px;
  background: var(--clr-white);
  cursor: ew-resize;
  z-index: 5;
}
.ba-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--clr-white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.ba-handle::after {
  content: '◀ ▶';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: var(--clr-dark);
  white-space: nowrap;
  z-index: 1;
  letter-spacing: 2px;
}
.ba-label {
  position: absolute;
  top: 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--clr-white);
  background: rgba(0,0,0,0.4);
  padding: 4px 12px;
  border-radius: 4px;
  z-index: 4;
  pointer-events: none;
}
.ba-label--vorher { left: 16px; }
.ba-label--nachher { right: 16px; }
.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 6;
  -webkit-appearance: none;
  appearance: none;
}
.ba-nav {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(46, 46, 46, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  z-index: 8;
}
.ba-nav button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, color 0.25s;
}
.ba-nav button:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.ba-counter {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  min-width: 60px;
  text-align: center;
  color: #fff;
}

/* ── Leistungen (services) ── */
.leistungen-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.leistung-card {
  text-align: center;
  padding: 32px 16px;
  border-radius: 8px;
  transition: background 0.3s;
  cursor: default;
}
.leistung-card:hover {
  background: rgba(245, 130, 32, 0.06);
}
.leistung-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--clr-accent);
}
.leistung-icon svg {
  width: 100%;
  height: 100%;
}
.leistung-title {
  font-family: var(--ff-heading);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}
.leistung-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--clr-dark);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease, margin 0.45s ease;
  margin-top: 0;
}
.leistung-card:hover .leistung-desc,
.leistung-card.active .leistung-desc {
  max-height: 320px;
  margin-top: 12px;
}
.leistung-desc ul {
  list-style: none;
  padding: 0;
  text-align: center;
}
.leistung-desc li {
  padding: 10px 4px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.leistung-desc li + li::before {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  margin: 0 auto 10px;
  background: var(--clr-accent);
  transform: scaleX(0.3);
  transform-origin: center;
  transition: transform 0.4s ease;
}
.leistung-card:hover .leistung-desc li,
.leistung-card.active .leistung-desc li {
  opacity: 0.9;
  transform: translateY(0);
}
.leistung-card:hover .leistung-desc li + li::before,
.leistung-card.active .leistung-desc li + li::before {
  transform: scaleX(1);
}
.leistung-desc li:nth-child(1) { transition-delay: 0.08s; }
.leistung-desc li:nth-child(2) { transition-delay: 0.16s; }
.leistung-desc li:nth-child(3) { transition-delay: 0.24s; }
.leistung-desc li:nth-child(4) { transition-delay: 0.32s; }

/* ── Galerie: full-bleed Masonry ── */
.galerie-section.section {
  padding: 0;
  overflow: hidden;
}
.galerie-section .section__inner {
  max-width: none;
  margin: 0;
}
.galerie-header {
  background: var(--clr-textleiste);
  padding: 32px 24px;
}
.galerie-header .section__title {
  margin-bottom: 0;
}

/* Dichtes Masonry-Raster: variierende Kachelgrößen je nach Bildseitenverhältnis */
.galerie-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 200px;
  grid-auto-flow: dense;
  gap: 8px;
  padding: 8px;
}
.galerie-item {
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: var(--clr-bg-alt);
  grid-column: span 1;
  grid-row: span 1;
}
.galerie-item--wide { grid-column: span 2; }
.galerie-item--tall { grid-row: span 2; }
.galerie-item--big  { grid-column: span 2; grid-row: span 2; }
.galerie-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.galerie-item:hover img { transform: scale(1.05); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}
.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  color: var(--clr-white);
  font-size: 32px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--clr-white);
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: background 0.3s;
}
.lightbox__nav:hover { background: rgba(255,255,255,0.2); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }

/* ── Footer / Kontakt ── */
.footer {
  background: var(--clr-dark-bg);
  color: rgba(255,255,255,0.9);
  padding: 96px 24px 32px;
}
.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.footer .section__title {
  color: var(--clr-white);
}
.footer__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.footer__logo {
  height: 96px;
  width: auto;
  filter: brightness(0) invert(0.9) sepia(0.2);
}
.footer__photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.footer__person-text {
  margin-top: 4px;
}
.footer__name {
  font-family: var(--ff-heading);
  font-size: 1.35rem;
  font-weight: 700;
}
.footer__role {
  font-size: 0.9rem;
  opacity: 0.7;
  letter-spacing: 1px;
}
.footer__contact {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
}
.footer__contact p { margin: 0; }
.footer__contact a {
  color: var(--clr-accent);
  transition: opacity 0.3s;
}
.footer__contact a:hover { opacity: 0.8; }
.footer__addresses {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin: 4px 0;
}
.footer__addresses address {
  font-style: normal;
  line-height: 1.55;
}
.footer__legal {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  font-size: 0.8rem;
  line-height: 1.8;
  opacity: 0.7;
}
.footer__legal h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 16px 0 4px;
  letter-spacing: 1px;
  opacity: 1;
}

/* ── Scroll animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 1280px) {
  .galerie-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 190px;
  }
}

@media (max-width: 1024px) {
  .leistungen-grid { grid-template-columns: repeat(2, 1fr); }
  .footer__top { grid-template-columns: 1fr; }
  .galerie-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 180px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 72px;
  }

  .site-header { padding: 0 20px; }
  .logo { height: 52px; }
  .site-header.scrolled .logo { height: 40px; }

  .nav-links { display: none; }
  .hamburger { display: flex; }

  .project { min-height: 480px; }
  .project__title { font-size: clamp(2rem, 8vw, 3.2rem); }

  .textleiste { padding: 28px 20px; }
  .textleiste__list {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 8px;
  }
  .textleiste__list li { padding-left: 20px; }
  .textleiste__list li::before { display: block; }
  .textleiste__list li:first-child { padding-left: 20px; }
  .textleiste__list li:first-child::before { display: block; }

  .leistungen-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .leistung-desc { max-height: none; margin-top: 12px; }
  .leistung-desc li { opacity: 0.9; transform: none; }
  .leistung-desc li + li::before { transform: scaleX(1); }

  .section { padding: 64px 20px; }
  .ba-header { padding: 24px 20px; }
  .ba-wrapper { height: 70vh; min-height: 420px; }
  .section__title { margin-bottom: 32px; }

  .footer { padding: 64px 20px 24px; }
}

@media (max-width: 768px) {
  .galerie-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
    gap: 6px;
    padding: 6px;
  }
  .galerie-header { padding: 24px 20px; }
  .galerie-item--big { grid-column: span 2; grid-row: span 2; }
  .galerie-item--wide { grid-column: span 2; }
  .galerie-item--tall { grid-column: span 1; grid-row: span 2; }
}

@media (max-width: 480px) {
  .leistungen-grid { grid-template-columns: 1fr; }
  .galerie-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    padding: 4px;
    gap: 4px;
  }
  .galerie-item,
  .galerie-item--wide,
  .galerie-item--tall,
  .galerie-item--big {
    aspect-ratio: 4/3;
    grid-column: span 1;
    grid-row: span 1;
  }
  .ba-wrapper { height: 60vh; min-height: 360px; }
}
