/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-block: var(--space-sm);
  background: color-mix(in oklch, var(--color-bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-normal) var(--ease-out-expo),
              box-shadow var(--duration-normal) var(--ease-out-expo);
}

.site-header.is-scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-ink);
}

.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 30%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }

.footer-brand .brand-mark { box-shadow: none; }

.brand-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.1;
}

.brand-tagline {
  display: block;
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-stone);
  font-weight: 600;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links {
  display: flex;
  gap: var(--space-md);
}

.nav-links a {
  position: relative;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink-soft);
  padding-block: 0.3rem;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: var(--color-terracotta);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-ink);
}

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

.nav-links a.nav-cta {
  padding-block: 0.55rem;
}
.nav-links a.nav-cta::after { display: none; }

/* Contact block only ever renders inside the mobile drawer -- the desktop
   header already omits this info and doesn't need it duplicated. */
.nav-contact { display: none; }

@media (min-width: 1100px) {
  /* .btn-ghost's default border-color reads as near-invisible against the
     translucent light header background; tint it with the brand forest
     color so the pill still registers as a distinct secondary CTA at rest.
     (Scoped to desktop -- on the dark green mobile drawer the default light
     border-color already has plenty of contrast.) */
  .nav-links a.nav-cta {
    border-color: color-mix(in oklch, var(--color-forest) 45%, transparent);
  }
  .nav-links a.nav-cta:hover { border-color: var(--color-forest); }
}

/* ---------- Leistungen dropdown ---------- */
.nav-item-dropdown { position: relative; }
/* .accordion-item is reused here purely for the shared open/close JS pattern;
   the FAQ-only border-bottom divider it carries doesn't belong in the nav. */
.nav-item-dropdown.accordion-item { border-bottom: none; }
.nav-item-dropdown__row { display: flex; align-items: center; gap: 0.2rem; }
.nav-item-dropdown__toggle {
  background: none;
  border: none;
  padding: 0.2rem;
  color: var(--color-ink-soft);
  cursor: pointer;
  display: inline-flex;
  transition: transform var(--duration-fast) var(--ease-out-expo), color var(--duration-fast) var(--ease-out-expo);
}
.nav-item-dropdown__toggle:hover { color: var(--color-forest); }
.nav-item-dropdown[data-open="true"] .nav-item-dropdown__toggle { transform: rotate(180deg); }

.nav-item-dropdown__menu {
  display: none;
  flex-direction: column;
}
.nav-item-dropdown[data-open="true"] .nav-item-dropdown__menu { display: flex; }

@media (min-width: 1100px) {
  /* Plain nav links render as inline text while the Leistungen item's link
     sits inside a flex row (.nav-item-dropdown__row), which blockifies it
     and changes how its vertical padding contributes to box height. With
     the default stretch/top-alignment, that made "Leistungen" sit visibly
     lower than its siblings. Centering each nav item within the row instead
     of stretching it removes the dependency on that box-height difference. */
  .nav-links { align-items: center; }

  .nav-item-dropdown__menu {
    position: absolute;
    top: 100%;
    left: 0;
    /* padding-top (not margin) keeps the hoverable box flush against the
       trigger link -- a visible gap here breaks :hover on mouse travel. */
    padding-top: var(--space-sm);
    min-width: 14rem;
    z-index: 110;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--duration-fast) var(--ease-out-expo), transform var(--duration-fast) var(--ease-out-expo), visibility 0s linear var(--duration-fast);
  }
  .nav-item-dropdown__menu-inner {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xs);
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  .nav-item-dropdown:hover .nav-item-dropdown__menu,
  .nav-item-dropdown:focus-within .nav-item-dropdown__menu,
  .nav-item-dropdown[data-open="true"] .nav-item-dropdown__menu {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity var(--duration-fast) var(--ease-out-expo), transform var(--duration-fast) var(--ease-out-expo), visibility 0s linear 0s;
  }
  .nav-item-dropdown__menu li { width: 100%; }
  .nav-item-dropdown__menu a {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-ink-soft);
    white-space: nowrap;
  }
  .nav-item-dropdown__menu a:hover { background: var(--color-forest-pale); color: var(--color-forest); }
  .nav-item-dropdown__menu a::after { display: none; }
}

@media (max-width: 1099px) {
  .nav-item-dropdown__row { width: 100%; justify-content: space-between; }
  .nav-item-dropdown__toggle { color: var(--color-bg); padding: 0.4rem; }
  .nav-item-dropdown__menu {
    padding-left: var(--space-md);
    gap: var(--space-sm);
    margin-top: var(--space-sm);
  }
  .nav-item-dropdown__menu a { color: color-mix(in oklch, var(--color-bg) 85%, transparent); font-size: var(--text-base); }
  .nav-item-dropdown__menu a::after { display: none; }
}

.nav-toggle {
  display: none;
  position: relative;
  z-index: 101;
  width: 2.75rem; height: 2.75rem;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.nav-toggle svg { width: 1.35rem; height: 1.35rem; }

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: color-mix(in oklch, var(--color-ink) 55%, transparent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out-expo),
              visibility 0s linear var(--duration-normal);
  z-index: 40;
}

.nav-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--duration-normal) var(--ease-out-expo), visibility 0s linear 0s;
}

@media (max-width: 1099px) {
  .nav-toggle { display: inline-flex; }

  /* backdrop-filter on .site-header creates a new containing block for any
     position:fixed descendant, so the drawer below would be fixed relative
     to the header's own box instead of the viewport. */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; }

  .main-nav {
    position: fixed;
    z-index: 90;
    inset: 0 0 0 auto;
    width: min(80vw, 22rem);
    background: var(--color-forest);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
    padding: 6.5rem var(--space-lg) var(--space-lg);
    transform: translateX(100%);
    visibility: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform var(--duration-normal) var(--ease-out-expo),
                visibility 0s linear var(--duration-normal);
  }

  .main-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform var(--duration-normal) var(--ease-out-expo),
                visibility 0s linear 0s;
  }

  .nav-links {
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
  }

  .nav-links a { color: var(--color-bg); font-size: var(--text-lg); }
  .nav-links a::after { background: var(--color-terracotta); }

  /* Match the primary CTA's full-width pill treatment so the secondary
     ETG24 button reads as an equally deliberate action, not a stray link. */
  .nav-links a.nav-cta {
    width: 100%;
    margin-top: var(--space-sm);
  }

  .main-nav .btn-primary { margin-top: var(--space-lg); width: 100%; }

  .nav-contact {
    display: block;
    width: 100%;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid color-mix(in oklch, var(--color-bg) 18%, transparent);
  }

  .nav-contact__title {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: color-mix(in oklch, var(--color-bg) 70%, transparent);
    margin-bottom: var(--space-sm);
  }

  .nav-contact ul { display: flex; flex-direction: column; gap: var(--space-xs); }

  .nav-contact li,
  .nav-contact a {
    font-size: var(--text-sm);
    color: color-mix(in oklch, var(--color-bg) 85%, transparent);
  }

  .nav-contact a:hover { color: var(--color-terracotta); }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-forest);
  color: color-mix(in oklch, var(--color-bg) 88%, transparent);
  padding-block: var(--space-2xl) var(--space-lg);
  /* Reset the legacy `.site-footer { text-align: center }` rule from
     global.css, which otherwise inherits into every column/heading/list
     here and makes the grid look crooked instead of straight. */
  text-align: left;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.footer-brand .brand { color: var(--color-bg); }
.footer-brand p { margin-top: var(--space-sm); color: color-mix(in oklch, var(--color-bg) 75%, transparent); max-width: 32ch; }

.footer-col h3 {
  color: var(--color-bg);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.footer-col ul { display: flex; flex-direction: column; gap: var(--space-xs); }
.footer-col a { color: color-mix(in oklch, var(--color-bg) 80%, transparent); font-size: var(--text-sm); }
.footer-col a:hover { color: var(--color-terracotta); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
  border-top: 1px solid color-mix(in oklch, var(--color-bg) 18%, transparent);
  font-size: var(--text-xs);
  color: color-mix(in oklch, var(--color-bg) 65%, transparent);
}

.footer-bottom ul { display: flex; gap: var(--space-md); }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Page header (Unterseiten) ---------- */
.page-hero {
  padding-top: clamp(3rem, 2rem + 4vw, 5.5rem);
  padding-bottom: var(--space-xl);
  background: var(--color-bg-alt);
  position: relative;
  overflow: hidden;
}

.page-hero .eyebrow { margin-bottom: var(--space-xs); }
.page-hero h1 { max-width: 20ch; }
.page-hero .lede { margin-top: var(--space-md); }

.page-hero-decor {
  position: absolute;
  right: -6rem; top: -4rem;
  width: 22rem; opacity: 0.5;
  color: var(--color-forest-pale);
}

.anchor-nav {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

.anchor-nav a {
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink-soft);
}
.anchor-nav a:hover { border-color: var(--color-forest); color: var(--color-forest); }

/* ---------- Section headers & layout utilities ---------- */
.section-head {
  max-width: 46rem;
  margin-bottom: var(--space-xl);
}

.section-head h2 { margin-block: var(--space-2xs) 0; }
.section-head.center { margin-inline: auto; text-align: center; }

.divider-motif {
  width: 100%;
  height: auto;
  color: var(--color-forest-pale);
  margin-block: var(--space-lg);
  animation: divider-breathe 5s var(--ease-out-soft) infinite;
}

@keyframes divider-breathe {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(0.85); opacity: 0.7; }
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.service-intro { margin-bottom: var(--space-xl); }
.service-intro .section-head { margin-bottom: 0; }

.service-illustration {
  display: block;
  width: 100%;
  max-width: 19rem;
  height: auto;
  margin-inline: auto;
}

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ---------- Homepage – embedded Werteermittlung calculator ---------- */
.home-calculator {
  padding-block: var(--space-section);
  background: var(--color-bg-alt);
}
