/* ============================================================
   global.css: Technik-Geruest + Design-Tokens der Site.

   WICHTIG: Die :root-Bloecke unten sind die EINZIGE Stelle, an der
   Design lebt (Farben, Font, Typo-Scale, Abstaende, Radien, Schatten,
   Motion). Alle Werte sind PLATZHALTER, nur damit der Styleguide vor
   Phase 2 ueberhaupt rendert. Phase 2 (Corporate Identity) MUSS jeden
   Token projektspezifisch setzen. Kein Platzhalter geht live, und
   zwei Kundenseiten teilen niemals dieselben Tokens.

   Nicht verhandelbar (Qualitaets-Untergrenzen, KEIN Design):
   Body-Schrift nie unter 17px, Touch-Targets min. 44px, WCAG-AA-
   Kontrast, Animationen nur mit transform + opacity.

   Fonts: self-hosted via css/fonts.css (scripts/fetch-fonts.sh),
   NIEMALS fonts.googleapis.com einbinden.
   ============================================================ */

:root {
  /* ── Farben: "Licht im Laubdach" — die Site steht auf hellem Papier, Gruen
     kommt als Typo, Linie und Flaeche dazu. Dunkles Waldgruen ist bewusst
     selten (ein CTA-Band, einzelne Highlight-Karten) und nie mehr Fast-Schwarz.
     WCAG AA geprueft. ── */
  --color-brand-main:       #2C6E49;  /* Waldgruen: Buttons, Links, Eyebrow */
  --color-brand-darker:     #1F4F34;  /* Hover / gedrueckt */
  --color-brand-lighter:    #3E8C60;
  --color-brand-subtle:     #EAF4E7;  /* zarter Gruenschleier: Chips, Secondary-Hover */
  --color-bg-light:         #FBFCF7;  /* helles Papier mit gruenem Unterton */
  --color-bg-dark:          #1D4030;  /* Waldgruen-Sections (frueher fast schwarz) */
  --color-bg-card:          #FFFFFF;
  --color-bg-accent:        #F1F5E7;  /* Feld/Sand: alternierende Section-Flaeche */
  --color-border:           #E3EAD8;
  --color-text-muted:       #63715E;
  --color-off-white:        #FBFCF7;
  --color-success:          #6E9E28;
  --color-heading:          #16352A;  /* tiefes Tannengruen fuer Headlines */
  --color-body:             #384738;  /* gruene Tinte fuer Fliesstext */

  /* ── Brand-Zusatztokens (in Sections nutzbar) ── */
  --color-lime:             #9CCB3B;  /* Wachstums-Akzent, NUR dekorativ (Striche, Fuellungen) */
  --color-lime-soft:        #F2F9E3;  /* sehr helle Lindgruen-Flaeche */
  --color-canopy:           #E9F3DC;  /* Laubdach: helle Kronen-Flaeche (Hero, Seiten-Header) */
  --color-earth:            #6E4A2A;  /* Wurzel-Braun, unterstuetzend */
  --color-on-dark-muted:    #B9CDB4;  /* gedaempfter Text auf dunklem Grund */

  /* ── Typografie: Space Grotesk (Headlines) + Figtree (Body) ── */
  --font-main:              'Figtree', -apple-system, 'Segoe UI', sans-serif;
  --font-heading:           'Space Grotesk', 'Figtree', -apple-system, sans-serif;
  --font-weight-heading:    500;
  --letter-spacing-h1:      -0.03em;
  --letter-spacing-h2:      -0.02em;
  --font-size-body:         18px;    /* frei waehlbar, aber NIE unter 17px */
  --line-height-body:       1.65;
  --line-height-heading:    1.08;
  --font-size-h1:           66px;
  --font-size-h1-md:        46px;    /* greift <= 1024px */
  --font-size-h1-sm:        34px;    /* greift <= 767px  */
  --font-size-h2:           44px;
  --font-size-h2-md:        36px;
  --font-size-h2-sm:        28px;
  --font-size-h3:           28px;
  --font-size-h3-sm:        23px;
  --font-size-h4:           21px;
  --font-size-h5:           18px;
  --font-size-eyebrow:      13px;    /* einzige erlaubte Ausnahme unter 17px */

  /* ── Layout + Abstaende ── */
  --max-width:              1180px;
  --container-padding:      40px;
  --container-padding-sm:   20px;
  --section-padding:        80px 40px;
  --section-padding-mobile: 68px 20px;
  --header-gap-eyebrow:     14px;    /* Abstand Eyebrow -> Title   */
  --header-gap-title:       20px;    /* Abstand Title -> Subline   */
  --header-gap-subline:     44px;    /* Abstand Subline -> Inhalt  */

  /* ── Form + Tiefe ── */
  --radius-s:               8px;     /* Buttons, Inputs  */
  --radius-m:               16px;    /* Cards, Bilder    */
  --radius-l:               28px;    /* grosse Feature-Bloecke */
  --radius-pill:            999px;
  --shadow-card:            0 1px 2px rgba(20, 35, 26, 0.05), 0 14px 34px -12px rgba(20, 45, 30, 0.16);
  --shadow-float:           0 2px 6px rgba(20, 35, 26, 0.08), 0 30px 60px -24px rgba(20, 45, 30, 0.28);

  /* ── Motion: ruhig, "waechst von unten" ── */
  --ease-out:               cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring:            cubic-bezier(0.34, 1.4, 0.64, 1);
  --duration-fast:          0.25s;
  --reveal-duration:        0.8s;
  --reveal-distance:        28px;
}

/* Responsive Token-Umschaltung: Komponenten unten enthalten KEINE
   eigenen Breakpoint-Werte, hier werden nur Tokens umgeschaltet. */
@media (max-width: 1024px) {
  :root {
    --font-size-h1: var(--font-size-h1-md);
    --font-size-h2: var(--font-size-h2-md);
  }
}
@media (max-width: 767px) {
  :root {
    --font-size-h1: var(--font-size-h1-sm);
    --font-size-h2: var(--font-size-h2-sm);
    --font-size-h3: var(--font-size-h3-sm);
    --container-padding: var(--container-padding-sm);
    --header-gap-eyebrow: 10px;
    --header-gap-title: 14px;
    --header-gap-subline: 28px;
  }
}

/* ============================================================
   Ab hier nur noch Technik: alles referenziert Tokens,
   nirgendwo stehen Design-Literale.
   ============================================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* KEIN scroll-behavior: smooth hier oder anderswo: kollidiert mit Lenis (Phase 5). */

body {
  font-family: var(--font-main);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-body);
  background: var(--color-bg-light);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
}

h1 { font-size: var(--font-size-h1); letter-spacing: var(--letter-spacing-h1); }
h2 { font-size: var(--font-size-h2); letter-spacing: var(--letter-spacing-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }
h5 { font-size: var(--font-size-h5); }

a { color: var(--color-brand-main); text-decoration: none; }
a:hover { color: var(--color-brand-darker); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-brand-main);
  outline-offset: 2px;
}

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Fixed-Nav liegt ueber dem Inhalt: Anker-Sprünge um die Nav-Hoehe versetzen,
   damit der Section-Anfang nicht verdeckt wird (Hero braucht keinen Versatz). */
section[id]:not(#hero) { scroll-margin-top: 92px; }

/* ── Signatur: Jahresringe ──
   Konzentrische Ringe wie der Querschnitt eines Stamms — das, was ein Baumpfleger
   liest. Wird sparsam eingesetzt (Hero + Seiten-Header), immer sehr zurueckhaltend
   und rein dekorativ. Zwei ueberlagerte Perioden machen die Ringe ungleichmaessig
   und damit organisch statt technisch.
   Steuerbar pro Einsatzort: --rings-x / --rings-y (Mittelpunkt), --rings-opacity. */
.sk-rings {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--rings-opacity, 0.5);
  background:
    repeating-radial-gradient(
      circle at var(--rings-x, 100%) var(--rings-y, 0%),
      transparent 0 46px,
      color-mix(in srgb, var(--color-brand-main) 26%, transparent) 46px 48px
    ),
    repeating-radial-gradient(
      circle at var(--rings-x, 100%) var(--rings-y, 0%),
      transparent 0 122px,
      color-mix(in srgb, var(--color-lime) 60%, transparent) 122px 125px
    );
  -webkit-mask-image: radial-gradient(circle at var(--rings-x, 100%) var(--rings-y, 0%), #000 12%, transparent 74%);
  mask-image: radial-gradient(circle at var(--rings-x, 100%) var(--rings-y, 0%), #000 12%, transparent 74%);
}
/* Die Ringe zeichnen sich beim Laden auf — Teil der Eingangs-Sequenz, aber
   bewusst laenger und spaeter als der Text, damit sie Hintergrund bleiben.
   Reine CSS-Animation: laeuft auch ohne JS und braucht keinen Startimpuls. */
.sk-rings {
  animation: sk-rings-in 1.6s var(--ease-out) 0.15s both;
}
@keyframes sk-rings-in {
  from { opacity: 0; }
  to   { opacity: var(--rings-opacity, 0.5); }
}
html.screenshot .sk-rings { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .sk-rings { animation: none; }
}

/* ── Seiten-Header (Unterseiten-Banner) ──
   Heller Laubdach-Banner am Seitenanfang: gibt der Unterseite einen Titel und
   traegt die Jahresring-Signatur. Auf allen Unterseiten via section:<seite>-header. */
.sk-pagehead {
  position: relative;
  isolation: isolate;
  padding: 158px var(--container-padding) 68px;
  overflow: hidden;
  background: linear-gradient(168deg, var(--color-canopy) 0%, var(--color-bg-light) 68%);
}
.sk-pagehead .sk-rings {
  --rings-x: 88%;
  --rings-y: -14%;
  --rings-opacity: 0.4;
}
.sk-pagehead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-lime) 22%, var(--color-lime) 78%, transparent);
}
.sk-pagehead > .container { position: relative; z-index: 1; }
.sk-pagehead-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  font-family: var(--font-heading);
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}
.sk-pagehead-crumb a { color: var(--color-text-muted); transition: color var(--duration-fast) ease; }
.sk-pagehead-crumb a:hover { color: var(--color-brand-main); }
.sk-pagehead-crumb-sep { color: var(--color-border); }
.sk-pagehead-crumb-current { color: var(--color-heading); font-weight: 600; }
.sk-pagehead-title {
  font-family: var(--font-heading);
  font-size: clamp(2.3rem, 4.6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: var(--letter-spacing-h1);
  line-height: 1.05;
  color: var(--color-heading);
  max-width: 20ch;
}
.sk-pagehead-sub {
  margin-top: 18px;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--color-body);
  max-width: 54ch;
}
@media (max-width: 767px) {
  .sk-pagehead { padding: 124px var(--container-padding) 50px; }
  .sk-pagehead-sub { font-size: 1.05rem; }
}

/* ── Leistungs-Detailseite (Content links, Bild + "Das ist dabei"-Karte rechts) ── */
.sk-detail {
  padding: var(--section-padding);
  background: var(--color-bg-light);
}
.sk-detail-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 56px;
  align-items: start;
}
.sk-detail-lead {
  font-size: 1.28rem;
  line-height: 1.5;
  color: var(--color-heading);
  font-weight: 500;
  margin-bottom: 22px;
}
.sk-detail-main p { color: var(--color-body); font-size: 1.05rem; line-height: 1.7; max-width: 64ch; margin-bottom: 16px; }
.sk-detail-cta { margin-top: 14px; }
/* Links (Text) bleibt beim Scrollen sticky, rechts (Bild + Karte) scrollt normal mit */
.sk-detail-main {
  position: sticky;
  top: 96px;
  align-self: start;
}
.sk-detail-aside {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.sk-detail-img {
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  aspect-ratio: 4 / 3;
}
.sk-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.sk-detail-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-lime);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
  padding: 28px 28px 30px;
}
.sk-detail-card h2 {
  font-size: 1.15rem;
  font-family: var(--font-heading);
  color: var(--color-heading);
  margin-bottom: 18px;
}
.sk-detail-list { list-style: none; display: grid; gap: 13px; }
.sk-detail-list li { display: flex; gap: 11px; align-items: flex-start; color: var(--color-body); font-size: 1rem; line-height: 1.45; }
.sk-detail-list svg {
  flex-shrink: 0;
  margin-top: 1px;
  width: 22px;
  height: 22px;
  padding: 3px;
  color: var(--color-brand-main);
  background: var(--color-lime-soft);
  border-radius: var(--radius-pill);
}
@media (max-width: 900px) {
  .sk-detail-grid { grid-template-columns: 1fr; gap: 34px; }
  .sk-detail-main { position: static; }
}
@media (max-width: 767px) {
  .sk-detail { padding: var(--section-padding-mobile); }
  .sk-detail-lead { font-size: 1.15rem; }
  .sk-detail-cta .btn-primary { width: 100%; }
}

/* Buttons: Look kommt komplett aus den Tokens (Radius, Farben, Motion).
   min-height 48px ist Touch-Target-Untergrenze, kein Design. */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 30px;
  border-radius: var(--radius-s);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: none;
  transition:
    background-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    transform var(--duration-fast) var(--ease-spring),
    box-shadow var(--duration-fast) ease;
}
.btn-primary {
  background: var(--color-brand-main);
  color: #FFFFFF;
  box-shadow: 0 10px 22px -10px rgba(31, 79, 52, 0.7);
}
.btn-primary:hover {
  background: var(--color-brand-darker);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -12px rgba(31, 79, 52, 0.75);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: transparent;
  color: var(--color-brand-main);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-brand-main) 34%, transparent);
}
.btn-secondary:hover {
  background: var(--color-brand-subtle);
  box-shadow: inset 0 0 0 1.5px var(--color-brand-main);
  transform: translateY(-2px);
}
.btn-secondary:active { transform: translateY(0); }

/* ── Section-Header: Eyebrow / Title / Subline ──
   PFLICHT: Jeder Section-Header nutzt diese 3 Klassen, damit Groessen,
   Abstaende und Alignment in JEDER Section identisch sind. Das ist ein
   Konsistenz-Mechanismus INNERHALB einer Site; wie er aussieht, steuern
   die Tokens oben. Niemals pro Section ueberschreiben. */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-heading);
  font-size: var(--font-size-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-brand-main);
  margin-bottom: var(--header-gap-eyebrow);
}
/* Wurzel-Signatur: kleiner Lindgruen-Strich vor jedem Eyebrow (Echo des Logo-Wurzelwerks) */
.section-eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--color-lime);
  border-radius: var(--radius-pill);
}
.section-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
  letter-spacing: var(--letter-spacing-h2);
  color: var(--color-heading);
  margin-bottom: var(--header-gap-title);
}
.section-subline {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-text-muted);
  margin-bottom: var(--header-gap-subline);
  max-width: 640px;
}

/* ── Reveal-Animationen (Init in js/main.js) ──
   Charakter (Distanz, Dauer, Kurve) kommt aus den Motion-Tokens.

   WICHTIG: Der versteckte Zustand steht bewusst OHNE JS-Klasse davor. Nur so
   gilt er schon beim ersten Paint. Setzt ihn erst das (deferred) main.js per
   Klasse, hat der Browser den sichtbaren Zustand bereits gezeichnet — die
   Transition laeuft dann rueckwaerts ins Versteckte und wird zwei Frames
   spaeter wieder umgedreht. Sichtbares Ergebnis: gar keine Eingangsanimation.

   Zwei Absicherungen, damit niemand vor einer leeren Seite sitzt:
   1. Kein JS im Browser -> @media (scripting: none) zeigt alles sofort.
   2. main.js laedt nicht -> Notbremse-Animation schaltet nach 4s auf sichtbar.
      Sie greift nie, sobald main.js html.js-ready gesetzt hat. */
[data-reveal] {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity var(--reveal-duration) var(--ease-out),
    transform var(--reveal-duration) var(--ease-out);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
html:not(.js-ready) [data-reveal] {
  animation: sk-reveal-failsafe 0.01s linear 4s forwards;
}
@keyframes sk-reveal-failsafe {
  to { opacity: 1; transform: none; }
}
@media (scripting: none) {
  [data-reveal] { opacity: 1; transform: none; transition: none; animation: none; }
}
/* Screenshots deterministisch: screenshot.mjs setzt html.screenshot */
html.screenshot [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; animation: none; }
}

/* ── Google Maps Zwei-Klick (Markup: snippets/google-maps-consent.html) ── */
.map-consent {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--color-bg-accent);
}
.map-consent > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px) brightness(0.85);
}
.map-consent-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: rgba(15, 23, 42, 0.55);
}
.map-consent-overlay p {
  color: var(--color-off-white);
  font-size: var(--font-size-body);
  max-width: 520px;
}
.map-consent-overlay a { color: #FFFFFF; text-decoration: underline; }
