/* ==========================================================
   Fabian Müller Galabau & Forst
   Tokens → Basis → Layout → Sektionen
   ========================================================== */

@font-face {
  font-family: "Zilla Slab";
  src: url("../fonts/zilla-slab-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Zilla Slab";
  src: url("../fonts/zilla-slab-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Tannengrün – dunkle Flächen */
  --spruce-950: #101a14;
  --spruce-900: #17231c;
  --spruce-800: #203329;
  --spruce-700: #2e4838;
  /* Fichtenholz – helle Flächen */
  --wood-100: #efe2c8;
  --wood-200: #e6d3ae;
  --wood-300: #d4b985;
  /* Akzente */
  --larch: #c68a45;
  --larch-hi: #d99d58;
  --leaf: #8db36b;
  --moss: #4f7a3a;
  --bark: #33261b;
  --bark-soft: #6b5a48;

  --font-head: "Zilla Slab", Rockwell, "Roboto Slab", Georgia, serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --wrap: 1200px;
  --header-h: 4.5rem;
  --radius: 3px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Basis ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--spruce-900);
  color: var(--wood-100);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.5vw + 1rem, 1.1875rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--leaf);
  outline-offset: 3px;
}
.on-wood :focus-visible { outline-color: var(--moss); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--wood-100);
  color: var(--bark);
  font-weight: 600;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85em 1.5em;
  border: 2px solid var(--larch);
  border-radius: var(--radius);
  background: var(--larch);
  color: var(--spruce-900);
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { background: var(--larch-hi); border-color: var(--larch-hi); }
.btn-ghost {
  background: transparent;
  border-color: rgba(239, 226, 200, 0.45);
  color: var(--wood-100);
}
.btn-ghost:hover { background: rgba(239, 226, 200, 0.1); border-color: var(--wood-100); }
.btn-small { padding: 0.55em 1.1em; font-size: 0.95rem; }

/* ---------- Kopfzeile ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--spruce-900);
  border-bottom: 1px solid rgba(239, 226, 200, 0.12);
}
.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.brand img { width: 2.75rem; height: 2.75rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font: 700 1.2rem/1.1 var(--font-head); }
.brand-text span { font-size: 0.9rem; color: var(--wood-300); }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2rem); }
.nav a:not(.btn) {
  text-decoration: none;
  font-weight: 500;
  padding-block: 0.4rem;
  background: linear-gradient(var(--larch), var(--larch)) left bottom / 0 2px no-repeat;
  transition: background-size 0.25s var(--ease);
}
.nav a:not(.btn):hover { background-size: 100% 2px; }

.nav-toggle {
  display: none;
  padding: 0.55em 1em;
  border: 2px solid rgba(239, 226, 200, 0.45);
  border-radius: var(--radius);
  background: none;
  color: inherit;
  font: 600 0.95rem/1 var(--font-body);
  cursor: pointer;
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .nav {
    position: absolute;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: var(--spruce-900);
    border-bottom: 1px solid rgba(239, 226, 200, 0.12);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.5rem);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .nav.is-open { visibility: visible; opacity: 1; transform: none; }
  .nav a:not(.btn) { padding-block: 0.9rem; border-bottom: 1px solid rgba(239, 226, 200, 0.1); background: none; }
  .nav .btn { margin-top: 1rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--spruce-900);
  padding-block: clamp(3rem, 8vw, 6rem);
}
.rings {
  position: absolute;
  left: 72%;
  top: 50%;
  width: min(1700px, 190vw);
  height: auto;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  fill: none;
  stroke: var(--wood-300);
  stroke-width: 1.6;
  opacity: 0.2;
  pointer-events: none;
}
.rings path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ring-draw 1.8s var(--ease) forwards;
  animation-delay: calc(var(--i) * 55ms);
}
@keyframes ring-draw { to { stroke-dashoffset: 0; } }

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.9rem, 7.2vw, 6.25rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.hero h1 .line > span {
  display: block;
  animation: line-up 0.9s var(--ease) both;
}
.hero h1 .line:nth-child(2) > span { animation-delay: 0.12s; }
@keyframes line-up { from { transform: translateY(105%); } }

.lead {
  max-width: 34rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-size: clamp(1.15rem, 1.2vw + 0.9rem, 1.4rem);
  line-height: 1.5;
  color: var(--wood-200);
  animation: fade-in 0.8s 0.45s both;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  animation: fade-in 0.8s 0.55s both;
}
@keyframes fade-in { from { opacity: 0; } }

.hero-photo {
  margin: 0;
  animation: photo-in 1.1s 0.2s var(--ease) both;
}
.hero-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 62%;
  border-radius: var(--radius);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.35);
}
@keyframes photo-in { from { opacity: 0; clip-path: inset(12% 0 0 0); } }

@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo img { aspect-ratio: 4 / 3; object-position: 50% 68%; }
  .rings { left: 80%; top: 30%; }
}

/* ---------- Abschnitte allgemein ---------- */
.section { padding-block: clamp(4rem, 9vw, 8rem); }

/* helle Flächen mit feiner Holzmaserung */
.on-wood {
  background-color: var(--wood-100);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='520'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0022 0.2' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.3 0 0 0 0 0.15 0 0 0 0.6 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  color: var(--bark);
}
.on-spruce { background: var(--spruce-900); color: var(--wood-100); }
.on-spruce-deep { background: var(--spruce-950); color: var(--wood-100); }

.section-head { max-width: 40rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
.section-head p { margin-top: 1rem; font-size: 1.15rem; }
.on-wood .section-head p { color: var(--bark-soft); }
.on-spruce .section-head p { color: var(--wood-200); }

/* ---------- Leistungen ---------- */
.services {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.service-media {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--wood-300);
  box-shadow: 0 1rem 2.5rem rgba(51, 38, 27, 0.25);
}
.service-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.55s ease;
}
.service-media img.is-active { opacity: 1; }

.group {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 0.25rem;
  font: 500 1.05rem/1 var(--font-head);
  color: var(--moss);
}
.group::after { content: ""; flex: 1; height: 1px; background: rgba(51, 38, 27, 0.25); }
.service-group + .service-group { margin-top: 2.5rem; }

.service { border-bottom: 1px solid rgba(51, 38, 27, 0.2); }
.service h4 { font-size: inherit; letter-spacing: 0; line-height: 1; }
.service-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1.2rem 0;
  border: 0;
  background: none;
  color: var(--bark-soft);
  font: 700 clamp(1.55rem, 3.2vw, 2.3rem)/1.1 var(--font-head);
  letter-spacing: -0.01em;
  text-align: left;
  cursor: pointer;
  transition: color 0.25s;
}
.service-toggle:hover,
.service.is-active .service-toggle { color: var(--bark); }
/* Ring-Marker: füllt sich, wenn der Eintrag aktiv ist */
.service-toggle::after {
  content: "";
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  transition: background-color 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.service.is-active .service-toggle::after {
  background: var(--moss);
  border-color: var(--moss);
  box-shadow: 0 0 0 4px var(--wood-100), 0 0 0 6px var(--moss);
}

.service-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
}
.service.is-active .service-body { grid-template-rows: 1fr; }
.service-inner {
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0.4s;
}
.service.is-active .service-inner { visibility: visible; }
.service-inner p { max-width: 34rem; color: var(--bark); }
.service-link {
  display: inline-block;
  margin: 1rem 0 1.6rem;
  font-weight: 600;
  color: var(--moss);
  text-underline-offset: 0.25em;
}
.service-link:hover { color: var(--bark); }
.service-photo { display: none; margin-top: 1.25rem; }
.service-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }

@media (max-width: 900px) {
  .services { grid-template-columns: 1fr; }
  .service-media { display: none; }
  .service-photo { display: block; }
}

/* ---------- Projekte ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem 1.25rem; }
.shot { margin: 0; }
@media (max-width: 1000px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.shot button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--spruce-800);
  cursor: zoom-in;
}
.shot img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform 0.5s var(--ease); }
.shot button:hover img { transform: scale(1.03); }
.shot figcaption { margin-top: 0.6rem; font-size: 0.95rem; line-height: 1.45; color: var(--wood-200); }

.lightbox {
  width: min(94vw, 62rem);
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--spruce-950);
  color: var(--wood-100);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(8, 14, 10, 0.88); }
.lightbox[open] { animation: fade-in 0.25s both; }
.lightbox-inner { display: grid; grid-template-rows: minmax(0, 1fr) auto; max-height: 94vh; }
.lightbox img { width: 100%; max-height: calc(94vh - 5.5rem); object-fit: contain; background: #000; }
.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
}
.lightbox-bar p { font-size: 0.98rem; }
.lightbox-actions { display: flex; gap: 0.5rem; flex: none; }
.lightbox-actions button {
  padding: 0.5em 0.9em;
  border: 2px solid rgba(239, 226, 200, 0.4);
  border-radius: var(--radius);
  background: none;
  color: inherit;
  font: 600 0.95rem/1 var(--font-body);
  cursor: pointer;
  transition: background-color 0.2s;
}
.lightbox-actions button:hover { background: rgba(239, 226, 200, 0.12); }
@media (max-width: 600px) { .lightbox-bar { flex-direction: column; align-items: stretch; } }

/* ---------- Über uns ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.about h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
.about-text p { margin-top: 1.25rem; max-width: 36rem; }
.about-text p:first-of-type { margin-top: 1.75rem; font-size: 1.2rem; }
.about-photo { margin: 0; }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 40%; border-radius: var(--radius); box-shadow: 0 1rem 2.5rem rgba(51, 38, 27, 0.25); }

.steps-title { margin-top: clamp(3.5rem, 7vw, 6rem); font-size: clamp(1.5rem, 2.6vw, 2rem); }
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
  margin-top: 1.75rem;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding-top: 1.1rem;
  border-top: 2px solid var(--bark);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: -1.2rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--bark);
  color: var(--wood-100);
  font: 700 1.1rem/1 var(--font-head);
  box-shadow: 0 0 0 5px var(--wood-100);
}
.steps h4 { margin-top: 0.9rem; font-size: 1.35rem; }
.steps p { margin-top: 0.4rem; font-size: 1rem; color: var(--bark-soft); }

@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
  .about-photo img { aspect-ratio: 4 / 3; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 2.5rem; }
}
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Kontakt ---------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.contact h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
.contact-text > p { margin-top: 1.25rem; max-width: 30rem; color: var(--wood-200); }
.details { margin-top: 2rem; display: grid; gap: 1.1rem; }
.details dt { font-size: 0.95rem; color: var(--wood-300); }
.details dd { margin: 0.1rem 0 0; font: 500 1.3rem/1.3 var(--font-head); }
.details a { text-underline-offset: 0.2em; }
.todo { border-bottom: 2px dashed var(--larch); }

.form {
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: var(--radius);
  background-image: none;
}
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; font-size: 0.98rem; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75em 0.9em;
  border: 2px solid rgba(51, 38, 27, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 252, 244, 0.75);
  color: var(--bark);
  font: 400 1rem/1.4 var(--font-body);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: 3px solid var(--moss); outline-offset: 1px; border-color: var(--moss); background: #fffdf7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.consent { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.95rem; color: var(--bark-soft); }
.consent input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--moss); }
.consent a { color: var(--bark); }
.form .btn { justify-self: start; background: var(--spruce-900); border-color: var(--spruce-900); color: var(--wood-100); }
.form .btn:hover { background: var(--spruce-700); border-color: var(--spruce-700); }
.form-note { min-height: 1.5em; font-size: 0.95rem; color: var(--moss); font-weight: 600; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Fußzeile ---------- */
.site-footer { padding-block: 2.5rem; background: var(--spruce-950); color: var(--wood-200); font-size: 0.98rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; }
.site-footer .brand img { width: 2.25rem; height: 2.25rem; }
.site-footer .brand-text strong { font-size: 1.05rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-links a { text-underline-offset: 0.25em; }

/* ---------- Rechtstexte ---------- */
.legal { padding-block: clamp(3rem, 7vw, 5.5rem); min-height: 70vh; }
.legal .prose { max-width: 42rem; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.legal h2 { margin-top: 2.5rem; font-size: 1.5rem; }
.legal p, .legal ul { margin-top: 0.8rem; }
.legal ul { padding-left: 1.2rem; list-style: disc; }
.legal .notice { margin-top: 1.5rem; padding: 1rem 1.2rem; border-left: 4px solid var(--larch); background: rgba(198, 138, 69, 0.18); font-size: 0.98rem; }
.legal a { color: var(--moss); }

/* ---------- Weniger Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
  .rings path { stroke-dashoffset: 0; }
}
