/* Habitora – Grundstil nach Brand Guidelines v1.0 (Figma) */

@font-face {
  font-family: "Outfit";
  src: url("../fonts/outfit-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Farben und Schriften: hier zentral anpassen */
:root {
  --sage: #254032;      /* Brand Mark, Hauptfarbe */
  --linen: #f9f6f0;     /* Hintergrund */
  --clay: #803e4c;      /* Akzent */
  --midnight: #1e221f;  /* Text */
  --mist: #d5dcd7;      /* Linien, helle Flächen */

  --bg: var(--linen);
  --bg-alt: #f1ede4;
  --ink: var(--midnight);
  --ink-soft: #4d544f;
  --line: var(--mist);
  --on-dark: #ffffff;
  --on-dark-soft: #c3cec7;

  --display: "Outfit", system-ui, sans-serif;
  --body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1160px;
  --gutter: clamp(18px, 5vw, 44px);
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/24px var(--body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

/* Typografie: Display 48/56, H1 36/44, H2 28/36, H3 22/28 (Outfit Semibold) */
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; text-wrap: balance; color: var(--sage); }
h1 { font-size: clamp(2.25rem, 5.5vw, 3rem); line-height: 1.17; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.25rem); line-height: 1.22; letter-spacing: -0.015em; }
h3 { font-size: 1.375rem; line-height: 28px; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.lead { font-size: 18px; line-height: 27px; }
.small { font-size: 14px; line-height: 21px; }

.label {
  font: 500 12px/16px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--clay);
}

/* Buttons: Primary, Secondary, Ghost, Accent, Dark */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; border: 1px solid var(--sage);
  font: 600 14px/18px var(--body); text-decoration: none; cursor: pointer;
  background: var(--sage); color: #fff; transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--midnight); border-color: var(--midnight); }
.btn.secondary { background: var(--linen); color: var(--sage); }
.btn.secondary:hover { background: var(--sage); color: #fff; border-color: var(--sage); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--sage); text-decoration: underline; text-underline-offset: 3px; }
.btn.ghost:hover { color: var(--clay); }
.btn.accent { background: var(--clay); border-color: var(--clay); }
.btn.accent:hover { background: #6a3240; border-color: #6a3240; }
.btn.dark { background: var(--midnight); border-color: var(--midnight); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--mist); border-color: var(--mist); color: #666; cursor: not-allowed; }

/* Header */
.header { position: sticky; top: 0; z-index: 20; background: rgba(249, 246, 240, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.logo { display: inline-flex; text-decoration: none; }
.logo img { width: 136px; height: auto; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a:not(.btn) { text-decoration: none; font-weight: 500; font-size: 15px; color: var(--ink-soft); }
.nav a:not(.btn):hover { color: var(--sage); }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } .nav .btn { padding: 10px 18px; } .logo img { width: 118px; } }

/* Hero: ganze Breite, links Skizze, rechts Foto */
.hero {
  --split: 54%;       /* Startpunkt des Schiebereglers */
  --text-split: 54%;  /* bis wohin der Text reicht (bleibt beim Schieben fix) */
  position: relative; isolation: isolate; overflow: hidden; background: var(--linen);
  min-height: min(calc(100svh - 72px), 860px); display: flex; align-items: center;
  padding: clamp(56px, 8vw, 104px) 0;
}
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.hero-skizze {
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}
/* heller Schleier hinter dem Text, damit er gut lesbar bleibt */
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(249,246,240,.94) 0%, rgba(249,246,240,.86) calc(var(--text-split) - 20%), rgba(249,246,240,.5) calc(var(--text-split) - 10%), rgba(249,246,240,0) calc(var(--text-split) - 2%));
}
.hero-tag {
  position: absolute; bottom: 24px; z-index: 1; padding: 8px 12px; border-radius: 999px;
  font: 500 12px/16px var(--body); letter-spacing: .12em; text-transform: uppercase;
  transition: opacity .2s; pointer-events: none;
}
.hero-tag.is-weg { opacity: 0; }
/* Schieberegler */
.hero > .wrap { pointer-events: none; }
.hero-text { pointer-events: auto; }
.hero-handle {
  position: absolute; top: 0; bottom: 0; left: var(--split); width: 44px; margin-left: -22px; z-index: 2;
  cursor: ew-resize; touch-action: none; outline: none; display: none;
}
.js .hero-handle { display: block; }
.hero-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 21px; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(37,64,50,.18); }
.hero-knob {
  position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; transform: translate(-50%, -50%);
  display: grid; place-items: center; border-radius: 50%; background: var(--sage); color: #fff;
  border: 2px solid #fff; box-shadow: 0 6px 18px rgba(30,34,31,.22); transition: transform .15s;
}
.hero-handle:hover .hero-knob, .hero-handle.is-drag .hero-knob { transform: translate(-50%, -50%) scale(1.08); }
.hero-handle:focus-visible .hero-knob { outline: 2px solid var(--clay); outline-offset: 3px; }
.hero.is-drag { user-select: none; -webkit-user-select: none; }
.tag-idee { right: calc(100% - var(--split) + 24px); background: var(--linen); color: var(--sage); border: 1px solid var(--mist); }
.tag-ergebnis { left: calc(var(--split) + 24px); background: var(--sage); color: #fff; }
.hero-text { max-width: min(540px, calc(var(--text-split) - 10vw)); }
@media (max-width: 1200px) { .hero { --split: 60%; --text-split: 60%; } }
@media (max-width: 860px) { .hero-text { max-width: none; } }
.hero .label { display: block; margin-bottom: 20px; }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.25rem); line-height: 1.08; letter-spacing: -0.025em; }
.hero h1 span { color: var(--clay); }
.hero .lead { color: var(--ink); max-width: 44ch; margin: 24px 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { color: var(--ink-soft); margin: 16px 0 0; }
@media (max-width: 860px) {
  .hero { display: block; min-height: 0; padding: 0 0 clamp(48px, 10vw, 72px); }
  .hero-media { position: relative; inset: auto; aspect-ratio: 4 / 3; margin-bottom: 32px; }
  .hero-media::after { display: none; }
  .hero { --split: 50%; }
  .tag-idee { right: calc(100% - var(--split) + 12px); } .tag-ergebnis { left: calc(var(--split) + 12px); }
  .hero-knob { width: 42px; height: 42px; }
  .hero-tag { bottom: 14px; font-size: 11px; padding: 6px 10px; }
}

/* Bilder */
.gallery { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; }
.gallery figure { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--mist); aspect-ratio: 4 / 5; }
.gallery .g-wide { aspect-ratio: auto; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption {
  position: absolute; left: 16px; bottom: 16px; background: var(--linen); color: var(--sage);
  font: 500 12px/16px var(--body); letter-spacing: .12em; text-transform: uppercase; padding: 8px 12px; border-radius: 999px;
}
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } .gallery figure, .gallery .g-wide { aspect-ratio: 4 / 3; } }

/* Sektionen */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section.alt { background: var(--bg-alt); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head .label { display: block; margin-bottom: 12px; }
.section-head p { color: var(--ink-soft); max-width: 44ch; margin: 0; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: var(--linen); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.card .area { font-family: var(--display); font-size: 2.25rem; font-weight: 600; color: var(--clay); line-height: 1; letter-spacing: -0.02em; }
.card .area small { font-size: 14px; color: var(--ink-soft); font-family: var(--body); letter-spacing: 0; font-weight: 500; }
.card p { color: var(--ink-soft); margin: 0; }
.cards-cta { margin: 32px 0 0; color: var(--ink-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cards-cta .btn.ghost { padding-inline: 8px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }

/* Angebotsfinder */
.finder-wrap { display: grid; grid-template-columns: 1fr 1.5fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.finder-wrap > *, .choices > * { min-width: 0; }
.finder-intro .label { display: block; margin-bottom: 12px; }
.finder-intro p { color: var(--ink-soft); margin-top: 16px; max-width: 40ch; }
.finder, .finder-noscript { background: var(--linen); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); }
.finder { display: none; }
.js .finder { display: block; }
.finder-progress { height: 4px; background: var(--mist); border-radius: 999px; overflow: hidden; }
.finder-progress span { display: block; height: 100%; width: 25%; background: var(--sage); border-radius: inherit; transition: width .3s; }
.finder-count { color: var(--ink-soft); margin: 12px 0 20px; }
.finder-step { border: 0; padding: 0; margin: 0; min-width: 0; }
.finder-step legend { font: 600 1.375rem/28px var(--display); color: var(--sage); margin-bottom: 20px; padding: 0; }
.finder-step legend small { display: block; font: 400 14px/21px var(--body); color: var(--ink-soft); margin-top: 4px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choices.chips { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 16px 18px 16px 48px; position: relative;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; transition: border-color .15s, background .15s;
}
.choice span::before {
  content: ""; position: absolute; left: 18px; top: 18px; width: 18px; height: 18px;
  border: 1.5px solid var(--mist); border-radius: 50%; background: #fff; transition: all .15s;
}
.choice input[type=checkbox] + span::before { border-radius: 5px; }
.choice strong { font-weight: 600; font-size: 15px; line-height: 21px; color: var(--ink); }
.choice small { font-size: 13px; line-height: 18px; color: var(--ink-soft); }
.choice:hover span { border-color: var(--sage); }
.choice input:focus-visible + span { outline: 2px solid var(--clay); outline-offset: 2px; }
.choice input:checked + span { border-color: var(--sage); background: #eef2ef; }
.choice input:checked + span::before { border-color: var(--sage); background: var(--sage); box-shadow: inset 0 0 0 3px #fff; }
.choice input[type=checkbox]:checked + span::before {
  box-shadow: none;
  background: var(--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.finder-error { color: var(--clay); min-height: 21px; margin: 16px 0 0; }
.finder-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 8px; }
.finder-nav [data-finder-back][disabled] { visibility: hidden; }
.finder-result { outline: none; }
.finder-result .label { display: block; margin-bottom: 8px; }
.finder-result h3 { font-size: clamp(1.75rem, 3.6vw, 2.25rem); line-height: 1.22; }
.finder-result .result-text { color: var(--ink-soft); margin: 12px 0 20px; }
.result-summary { list-style: none; padding: 16px 0; margin: 0 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 6px; color: var(--ink-soft); }
.result-summary b { color: var(--ink); font-weight: 600; }
@media (max-width: 860px) { .finder-wrap { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .choices { grid-template-columns: 1fr; gap: 10px; }
  .choices.chips { grid-template-columns: 1fr 1fr; }
  .chips .choice span { padding: 14px 12px 14px 40px; }
  .chips .choice span::before { left: 12px; top: 15px; }
  .chips .choice strong { font-size: 14px; hyphens: auto; }
}
@media (max-width: 360px) { .choices.chips { grid-template-columns: 1fr; } }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: s; }
.steps li { border-top: 1px solid var(--sage); padding-top: 20px; counter-increment: s; }
.steps li::before { content: "Schritt " counter(s); display: block; font: 500 12px/16px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--clay); margin-bottom: 10px; }
.steps p { color: var(--ink-soft); margin: 8px 0 0; font-size: 14px; line-height: 21px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* Kontakt */
.contact { background: var(--sage); color: var(--on-dark); }
.contact h2 { color: #fff; margin: 12px 0 20px; }
.contact .label { color: var(--mist); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(30px, 6vw, 80px); }
.contact-grid > div p { color: var(--on-dark-soft); }
.form { display: grid; gap: 14px; }
.form-choice { display: grid; gap: 2px; padding: 14px 16px; border-radius: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); }
.form-choice .small { color: var(--on-dark-soft); }
.form-choice strong { font-weight: 600; color: #fff; }
.form .optional { font-weight: 400; opacity: .75; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: block; font-size: 13px; font-weight: 500; color: var(--on-dark-soft); margin-bottom: 6px; }
.form input, .form textarea {
  width: 100%; font: inherit; color: #fff; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.22); border-radius: 10px; padding: 12px 14px;
}
.form input:focus, .form textarea:focus { outline: none; border-color: #fff; }
.form textarea { min-height: 140px; resize: vertical; }
.form .btn { background: var(--linen); color: var(--sage); border-color: var(--linen); justify-self: start; }
.form .btn:hover { background: var(--clay); border-color: var(--clay); color: #fff; }
.hp { position: absolute; left: -9999px; }
.status { font-size: 14px; min-height: 1.4em; }
@media (max-width: 760px) { .contact-grid, .form .row { grid-template-columns: 1fr; } }

/* Footer */
.footer { background: var(--midnight); color: #a7b0aa; padding: 32px 0; font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer img { width: 112px; height: auto; }
.footer nav { display: flex; gap: 20px; align-items: center; }
.footer a { text-decoration: none; } .footer a:hover { color: #fff; }

/* Unterseiten */
.page { padding: clamp(56px, 9vw, 104px) 0; }
.page .wrap { max-width: 760px; }
.page h1 { margin-bottom: 32px; }
.page h2 { font-size: 1.375rem; line-height: 28px; margin: 32px 0 8px; }
.page p { color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* Navigation unten (nur Handy) – aktiver Punkt wird zur Pille mit Beschriftung */
.bnav { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .bnav {
    --bnav-aktiv: var(--sage);
    --bnav-ink: var(--sage);
    display: block; position: fixed; z-index: 40; left: 10px; right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 8px; border-radius: 26px;
    background: rgba(213, 220, 215, .6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  /* erscheint erst nach etwas Scrollen (Klasse setzt main.js; ohne JavaScript immer sichtbar) */
  .js .bnav {
    transform: translateY(calc(100% + 24px)); opacity: 0; visibility: hidden;
    transition: transform .35s ease, opacity .35s ease, visibility 0s .35s;
  }
  .js .bnav.is-sichtbar { transform: none; opacity: 1; visibility: visible; transition: transform .35s ease, opacity .35s ease; }
  .bnav-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 4px;
    padding: 8px; border-radius: 20px; background: #fff; box-shadow: 0 1px 2px rgba(30,34,31,.06);
  }
  .bnav-item {
    display: flex; align-items: center; height: 48px; padding: 0 14px; border-radius: 999px;
    color: var(--bnav-ink); text-decoration: none; -webkit-tap-highlight-color: transparent;
    transition: background .3s ease, color .3s ease, padding .3s ease;
  }
  .bnav-item svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .bnav-item span {
    max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; margin-left: 0;
    font: 500 14px/1 var(--body); transition: max-width .35s ease, opacity .25s ease, margin .35s ease;
  }
  .bnav-item.is-aktiv { background: var(--bnav-aktiv); color: #fff; padding: 0 20px 0 16px; }
  .bnav-item.is-aktiv span { max-width: 96px; opacity: 1; margin-left: 10px; }
  .bnav-item:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
}
@media (max-width: 360px) { .bnav-item { padding: 0 10px; } .bnav-item.is-aktiv { padding: 0 14px 0 12px; } }
@media (prefers-reduced-motion: reduce) { .bnav-item, .bnav-item span { transition: none; } }
