:root {
  --bg: #f5f1ea;
  --surface: #ffffff;
  --surface-soft: #ebe4da;
  --text: #1d2528;
  --muted: #667174;
  --accent: #b78647;
  --accent-dark: #7c5529;
  --border: rgba(29, 37, 40, 0.12);
  --shadow: 0 20px 60px rgba(29, 37, 40, 0.12);
  --header-bg: rgba(245, 241, 234, 0.9);
  --hero-overlay-start: rgba(29, 37, 40, 0.82);
  --hero-overlay-end: rgba(29, 37, 40, 0.36);
  --header-height: 84px;
}

[data-theme='dark'] {
  --bg: #121618;
  --surface: #1c2326;
  --surface-soft: #2a3236;
  --text: #f3f0ea;
  --muted: #a8b0b3;
  --accent: #c99654;
  --accent-dark: #e0b478;
  --border: rgba(243, 240, 234, 0.12);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(18, 22, 24, 0.92);
  --hero-overlay-start: rgba(0, 0, 0, 0.78);
  --hero-overlay-end: rgba(0, 0, 0, 0.48);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  color-scheme: light;
}

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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(29, 37, 40, 0.08);
  overflow: hidden;
}

[data-theme='dark'] .scroll-progress {
  background: rgba(243, 240, 234, 0.08);
}

.scroll-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  transition: width 120ms ease-out;
  will-change: width;
}

.navbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.navbar-end {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
}

.logo-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo-tagline {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.nav-links a {
  transition: color 180ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent-dark);
}

.navbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.theme-toggle-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0;
  border-radius: 999px;
  background: var(--text);
  flex-shrink: 0;
}

.hero {
  min-height: 78vh;
  display: grid;
  place-items: center;
  padding: 96px 16px;
  background:
    linear-gradient(135deg, var(--hero-overlay-start), var(--hero-overlay-end)),
    url("assets/altbaukonzept-hero.png") center / cover no-repeat;
  color: #ffffff;
}

.hero-content {
  width: min(1120px, 100%);
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.45rem, 6vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 26px 0 34px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.15rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.button-block {
  width: 100%;
}

.button-sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.9rem;
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: var(--surface-soft);
  color: var(--accent-dark);
}

button.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 3rem);
  align-items: start;
}

.contact-address {
  font-style: normal;
  margin: 24px 0 0;
  line-height: 1.8;
  color: var(--muted);
}

.contact-address a {
  font-weight: 700;
  color: var(--accent-dark);
}

.contact-address a:hover,
.contact-address a:focus-visible {
  color: var(--accent);
}

.contact-form {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-row {
  margin: 0 0 1rem;
}

.form-row label {
  display: block;
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.form-row input:focus,
.form-row textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.form-checkbox {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.form-checkbox input {
  width: auto;
  margin-top: 0.35rem;
}

.form-checkbox label {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--muted);
}

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

.form-hint {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.captcha-box {
  margin: 1.5rem 0 0;
  padding: 1.25rem 1.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.captcha-heading {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.captcha-intro {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.captcha-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.captcha-visual {
  flex: 0 0 auto;
  min-height: 52px;
  padding: 0.35rem 0.5rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  line-height: 0;
}

.captcha-visual svg {
  display: block;
  max-width: 100%;
  height: auto;
}

[data-theme='dark'] .captcha-visual {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-style: solid;
}

.captcha-input-row input {
  max-width: 12rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-family: ui-monospace, monospace;
}

.captcha-status {
  min-height: 1.25rem;
  font-size: 0.875rem;
  margin: 0.5rem 0 0;
}

.captcha-status--ok {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  background: #e8f5ef;
  border: 1px solid #b8dcc8;
  color: #1a3d2e;
}

.captcha-status--err {
  color: #9a3d36;
}

[data-theme='dark'] .captcha-status--ok {
  background: #1a2e24;
  border-color: #2d5a47;
  color: #b8dcc8;
}

.captcha-visual--loading {
  display: flex;
  align-items: center;
  min-width: 200px;
  min-height: 52px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.req {
  color: #c62828;
  text-decoration: none;
  font-weight: 700;
  cursor: help;
}

.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.875em;
}

.form-feedback {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9375rem;
}

.form-feedback--success {
  background: #e8f5ef;
  border: 1px solid #b8dcc8;
  color: #1a3d2e;
}

.form-feedback--error {
  background: #fcefed;
  border: 1px solid #f0c4c0;
  color: #5c2a26;
}

[data-theme='dark'] .form-feedback--success {
  background: #1a2e24;
  border-color: #2d5a47;
  color: #b8dcc8;
}

[data-theme='dark'] .form-feedback--error {
  background: #2a1f1f;
  border-color: #6b3f3a;
  color: #f0c4c0;
}

.form-feedback ul {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0;
  border-top: 1px solid var(--border);
}

.section-heading {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f3d0a2;
}

.section h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.intro-text {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.legal-content {
  max-width: 760px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.legal-disclosure {
  max-width: 760px;
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.legal-disclosure summary::-webkit-details-marker {
  display: none;
}

.legal-disclosure summary::after {
  content: "+";
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent-dark);
  font-size: 1.25rem;
  line-height: 30px;
  text-align: center;
  transition: transform 180ms ease, background 180ms ease;
}

.legal-disclosure[open] summary::after {
  content: "−";
  background: var(--surface-soft);
}

.legal-disclosure summary:hover,
.legal-disclosure summary:focus-visible {
  color: var(--accent-dark);
}

.legal-disclosure .legal-content {
  margin-top: 0;
  padding: 36px 24px 24px;
  border-top: 1px solid var(--border);
}

.legal-block + .legal-block {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.legal-block h3 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.legal-block h4 {
  margin: 24px 0 10px;
  color: var(--text);
  font-size: 1.05rem;
}

.legal-block p {
  margin: 0 0 14px;
}

.legal-block ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.legal-block li + li {
  margin-top: 6px;
}

.legal-block a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-block a:hover,
.legal-block a:focus-visible {
  color: var(--accent);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 42px;
}

.service-card {
  position: relative;
  min-height: 330px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    transform 260ms ease,
    box-shadow 260ms ease,
    border-color 260ms ease;
}

.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(183, 134, 71, 0.14), transparent 58%);
  opacity: 0;
  transition: opacity 260ms ease;
  pointer-events: none;
}

.service-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  box-shadow: 0 30px 80px rgba(183, 134, 71, 0.24);
}

.service-card:hover::before {
  opacity: 1;
}

[data-theme='dark'] .service-card:hover {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.service-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 330px;
  padding: 34px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.service-card:hover .service-number {
  background: var(--accent);
  color: #ffffff;
  transform: scale(1.08);
}

.service-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-weight: 900;
  transition: background 260ms ease, color 260ms ease, transform 260ms ease;
}

.service-card h3 {
  margin: 32px 0 14px;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 6px;
  transition: color 260ms ease, text-decoration-color 260ms ease;
}

.service-card:hover h3 {
  color: var(--accent-dark);
  text-decoration-color: var(--accent);
}

.service-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 28px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-dark);
  transition: color 260ms ease, transform 260ms ease, gap 260ms ease;
}

.service-card-cta::after {
  content: '→';
  font-size: 1.15rem;
  transition: transform 260ms ease;
}

.service-card:hover .service-card-cta {
  color: var(--accent);
  gap: 12px;
}

.service-card:hover .service-card-cta::after {
  transform: translateX(4px);
}

.service-card-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  border-radius: 28px;
}

.subpage-section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 120px 0 96px;
}

.subpage-section h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.subpage-section .button {
  margin-top: 28px;
}

.service-card p {
  margin: 0;
  color: var(--muted);
}

.service-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.service-card li + li {
  margin-top: 10px;
}

.site-footer {
  padding: 28px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-dark);
  box-shadow: var(--shadow);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 220ms ease,
    visibility 220ms ease,
    transform 220ms ease,
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-2px);
}

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

  .nav-links {
    position: absolute;
    top: calc(var(--header-height) + 8px);
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    transition:
      background 180ms ease,
      color 180ms ease,
      box-shadow 180ms ease,
      transform 180ms ease;
  }

  .nav-links a:hover,
  .nav-links a:focus-visible {
    color: var(--text);
    background: var(--surface-soft);
    box-shadow: inset 3px 0 0 var(--accent);
    transform: translateX(2px);
  }

  .nav-links.is-open {
    display: flex;
  }

  .hero {
    min-height: 68vh;
    padding: 72px 16px;
  }

  .section {
    padding: 72px 0;
  }

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

  .service-card-link {
    min-height: auto;
  }

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