/* =================== Variables & Base =================== */
:root {
  --bg: #f2eee8;
  --header-footer: #e6dfd6;
  --card: #e0d7cc;
  --brand: #d62828;
  --fg: #3e3a36;
  --muted: #7a6f67;
  --radius: 14px;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1
}

a {
  color: var(--brand);
  text-decoration: none
}

a:hover,
a:focus {
  text-decoration: underline
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px
}

/* =================== Header (Desktop default) =================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-footer);
  border-bottom: 1px solid #0001;
  box-shadow: 0 2px 4px #0001;
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0
}

.brand-logo img {
  height: 60px;
  width: auto;
  display: block
}

/* Desktop nav */
.nav {
  margin-left: auto
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap
}

.nav li {
  position: relative
}

.nav a {
  display: inline-block;
  padding: 10px 12px;
  color: var(--fg)
}

.nav a:hover::after,
.nav a:focus::after {
  content: "";
  display: block;
  height: 3px;
  margin-top: 6px;
  border-radius: 3px;
  background: var(--brand);
}

/* Desktop dropdown */
.has-sub>a .caret {
  font-size: .9em;
  opacity: .8;
  margin-left: 6px
}

.has-sub .sub {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 220px;
  padding: 8px 0;
  background: #fffdf8;
  color: var(--fg);
  box-shadow: 0 8px 24px #0000001a;
  border-radius: 6px;
  display: none;
  z-index: 1000;
}

.has-sub .sub a {
  display: block;
  color: var(--fg);
  padding: 10px 16px
}

.has-sub .sub a:hover {
  background: #0000000a
}

.has-sub:hover .sub,
.has-sub:focus-within .sub {
  display: block
}

/* =================== Toggle (Burger) =================== */
.nav-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--fg);
  margin: 5px 0;
  transition: transform .2s, opacity .2s
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg)
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg)
}

/* =================== Mobile Overlay (always defined) =================== */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--header-footer);
  color: var(--fg);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s ease, opacity .28s ease;
  padding: max(16px, env(safe-area-inset-top)) 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
}

.mobile-overlay.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.overlay-close {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  right: 12px;
  font-size: 32px;
  line-height: 1;
  color: var(--fg);
  background: transparent;
  border: 0;
  padding: 6px;
  cursor: pointer;
}

.mobile-overlay ul {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
}

.mobile-overlay>ul>li {
  margin: 10px 0;
}

.mobile-overlay a {
  color: var(--fg);
  text-decoration: none;
  font-size: 1.6rem;
  font-weight: 700;
}

.mobile-overlay .overlay-sub {
  margin: 8px 0 0 16px;
}

.mobile-overlay .overlay-sub a {
  font-size: 1.2rem;
  font-weight: 600;
  opacity: .9;
}

/* Body scroll lock */
body.no-scroll {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Motion preference */
@media (prefers-reduced-motion:reduce) {
  .nav-toggle span {
    transition: none
  }

  .mobile-overlay {
    transition: none
  }
}

/* =================== Breakpoints =================== */
/* <850px: Desktop-Nav aus, Burger an */
@media (max-width:850px) {
  .brand-logo img {
    height: 48px
  }

  .desktop-nav {
    display: none
  }

  .nav-toggle {
    display: inline-block
  }
}

/* =================== Utility =================== */
.section {
  padding: 40px 0
}

.section h1,
.section h2 {
  margin: 0 0 14px
}

.button {
  display: inline-block;
  border: 0;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600
}

.button.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand)
}

.card {
  background: var(--card);
  border: 1px solid #0001;
  border-radius: var(--radius);
  padding: 18px
}

.rounded {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid #0001
}

/* =================== Footer =================== */
.site-footer {
  margin-top: auto;
  padding: 28px 0;
  border-top: 1px solid #0001;
  background: var(--header-footer)
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px
}

@media (max-width:900px) {
  .footer-grid {
    grid-template-columns: 1fr
  }
}

.legal {
  text-align: center;
  font-size: .8rem;
  color: #666
}