/* K³ VISUALS · Motion-Schicht, nachträglich über den Astro-Build gelegt.
   Alles hier animiert nur transform/opacity/clip-path; Werte nach improve-animations/AUDIT.md. */

:root { interpolate-size: allow-keywords; }

/* ---------- Gestapelte Bögen: jede Sektion schiebt sich über die vorige ---------- */
.sheet {
  position: relative;
  z-index: 1;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  margin-top: -28px;
  padding-top: calc(var(--section) + 28px);
  box-shadow: 0 -30px 60px -34px rgba(0, 0, 0, .75);
}
.sheet.strip, .sheet.process, .sheet.faq { background: var(--ink-900); }
.sheet.cta-band { overflow: hidden; border-top: 0; padding-top: calc(clamp(88px, 12vw, 170px) + 28px); }
.sheet > .container { will-change: transform; }

/* ---------- Leistungen: Karten klappen beim Hereinscrollen auf, Bilder laufen mit ---------- */
.services-grid > .svc-wrap { display: grid; min-width: 0; will-change: transform; }
.services-grid > .svc-wrap--hero { grid-area: span 1 / span 2; }
@media (width <= 1100px) { .services-grid > .svc-wrap--hero { grid-area: auto; grid-column: span 2; } }
@media (width <= 680px)  { .services-grid > .svc-wrap--hero { grid-column: span 1; } }

/* Transform übernimmt GSAP (Kipp-Hover), die CSS-Transition darauf würde jede Bewegung verschleppen */
.services-grid .svc { transition: border-color .3s ease, background-color .3s ease; will-change: transform; }
@media (hover: none) { .services-grid .svc:hover { transform: none; } }

/* Bild etwas größer als sein Rahmen, damit die Parallaxe keine Ränder zeigt */
.svc-media[data-parallax-scope] img { height: 118%; margin-top: -9%; }

/* ---------- Kundenstimmen: Spalten driften mit, Sterne springen auf ---------- */
.tm-grid > .tm-card { transition: border-color .3s ease, background-color .3s ease; will-change: transform; }
.tm-score-stars > span { display: inline-block; will-change: transform; }

/* ---------- Ablauf: die grüne Linie zeichnet sich über die vier Schritte ---------- */
.process-list { position: relative; }
.process-line {
  position: absolute; left: 0; top: -1px;
  width: 100%; height: 2px;
  background: var(--green);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Über mich: Porträt schwingt beim Hereinscrollen auf ---------- */
.about-media { will-change: transform, clip-path; }

/* ---------- FAQ: Antworten falten auf statt aufzuspringen ---------- */
.faq-item[open] .faq-a { animation: faq-in .38s var(--ease-out) both; }
@keyframes faq-in { from { opacity: 0; transform: translateY(-8px); } }
@supports (interpolate-size: allow-keywords) {
  .faq-item::details-content {
    height: 0; overflow: clip;
    transition: height .42s var(--ease-out), content-visibility .42s allow-discrete;
  }
  .faq-item[open]::details-content { height: auto; }
}

/* ---------- Logo: etwas breiter als die alte Wortmarke, damit das K auf dem Würfel in der Nav lesbar bleibt ---------- */
.nav-logo { width: clamp(120px, 11.5vw, 166px); }

/* ---------- Logo: das Monogramm zeichnet sich beim Laden, erst der Rahmen, dann K und 3, dann die Wortmarke ----------
   Die Pfade tragen pathLength="1", darum reicht dasharray 1 fuer den Zeichen-Effekt. */
.logo .logo-frame, .logo .logo-k, .logo .logo-arms, .logo .logo-exp {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: logo-draw .7s var(--ease-out) both;
}
.logo .logo-frame { animation-duration: .9s; animation-delay: .1s; }
.logo .logo-k     { animation-delay: .75s; }
.logo .logo-arms  { animation-duration: .45s; animation-delay: 1.15s; }
.logo .logo-exp   { animation-duration: .4s;  animation-delay: 1.3s; }
.logo .logo-word  { animation: logo-fade .7s var(--ease-out) 1s both; }
@keyframes logo-draw { to { stroke-dashoffset: 0; } }
@keyframes logo-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .logo .logo-frame, .logo .logo-k, .logo .logo-arms, .logo .logo-exp { animation: none; stroke-dashoffset: 0; }
  .logo .logo-word { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet > .container, .services-grid > .svc-wrap, .services-grid .svc, .tm-grid > .tm-card, .about-media { will-change: auto; }
}

/* ---------- Hero: Verlauf schwarz statt gruen, unten in Schwarz auslaufend ---------- */
.hero .hero-tint {
  background:
    radial-gradient(70% 90% at 12% 100%, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 60%),
    linear-gradient(90deg, #0b0d0ff2 0%, #0b0d0fcc 40%, #0b0d0f80 75%, #0b0d0f99 100%),
    linear-gradient(180deg, #0b0d0f8c 0%, #0b0d0f00 30%, #0b0d0f00 56%, #0b0d0fd9 84%, #0b0d0f 100%);
}

/* ---------- Hero: Anfrageformular rechts (Sendelogik wie Kontaktseite, Skript in index.html) ---------- */
.hero .hero-inner { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 470px); }
.hero .hero-form-card { width: min(100%, 470px); padding: 24px 24px 20px; gap: 16px; }
.hero-form-head { display: grid; gap: 6px; }
.hero-form-head p { font-size: .9rem; line-height: 1.5; text-wrap: pretty; }
.hero-form { display: grid; gap: 12px; }
.hero-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.hf-field { display: grid; gap: 5px; }
.hf-field--full { grid-column: 1 / -1; }
.hf-field > span { color: var(--ink-200); font-size: .76rem; font-weight: 500; }
.hero-form input, .hero-form select, .hero-form textarea {
  width: 100%; font: inherit; font-size: .94rem; color: var(--white);
  background: #0b0d0fa6; border: 1px solid var(--line-strong); border-radius: 10px;
  padding: .68em .9em; transition: border-color .2s, box-shadow .2s;
}
.hero-form select {
  appearance: none; padding-right: 2.4em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2398a1a8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.hero-form select:invalid { color: var(--ink-400); }
.hero-form select option { background: var(--ink-900); color: var(--white); }
.hero-form textarea { resize: vertical; min-height: 82px; }
.hero-form input::placeholder, .hero-form textarea::placeholder { color: var(--ink-400); }
.hero-form :is(input, select, textarea):focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-soft); outline: none; }
.hero-form :is(input, select, textarea):user-invalid { border-color: #e8795a; }
.hf-check { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-300); font-size: .74rem; line-height: 1.45; padding-top: 2px; }
.hf-check input { width: 16px; height: 16px; flex: none; margin-top: 2px; padding: 0; accent-color: var(--green); }
.hf-check a { color: var(--green); text-decoration: underline; text-underline-offset: .2em; }
.hf-hp { position: absolute; left: -9999px; opacity: 0; height: 0; }
.hero-form .hf-submit { width: 100%; }
.hf-status { min-height: 1.3em; margin-top: -4px; color: var(--green); font-size: .86rem; font-weight: 500; text-align: center; }
.hf-status.is-error { color: #e8795a; }

@media (width <= 1024px) {
  .hero .hero-inner { grid-template-columns: 1fr; }
  .hero .hero-form-card { justify-self: start; width: min(100%, 520px); }
}
@media (width <= 480px) {
  .hero-form-grid { grid-template-columns: 1fr; }
  .hero .hero-form-card { padding: 20px 18px 16px; }
}

/* ---------- Grundriss-Szene: am Ende blendet das Modell in ein echtes Rendering ueber ---------- */
.scene .scene-render { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; will-change: opacity, transform; }
.scene.is-static .scene-render, .scene.no-webgl .scene-render { display: none; }

/* ---------- Intro: Monogramm gross vor dem Rendering, dann Flug in die Navigation ---------- */
#k3-intro .k3-intro-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; animation: k3-intro-zoom 3.4s var(--ease-out) both; }
#k3-intro .k3-intro-tint { position: absolute; inset: 0; background: radial-gradient(60% 60% at 50% 50%, #0b0d0f99, #0b0d0fe6 100%), linear-gradient(#0b0d0f80, #0b0d0f80); }
#k3-intro .k3-intro-logo { position: absolute; left: 50%; top: 50%; width: clamp(240px, 46vw, 680px); transform: translate(-50%, -50%); color: var(--white); will-change: transform; }
#k3-intro .k3-intro-logo .logo { width: 100%; height: auto; display: block; filter: drop-shadow(0 20px 60px rgba(0, 0, 0, .55)); }
@keyframes k3-intro-zoom { from { transform: scale(1.08); } to { transform: scale(1); } }
/* Ohne JS blendet das Intro nach vier Sekunden von selbst aus */
html.k3-intro #k3-intro { animation: k3-intro-out .6s ease 4s both; }
@keyframes k3-intro-out { to { opacity: 0; visibility: hidden; } }
html.k3-intro-done .nav-logo .logo .logo-frame, html.k3-intro-done .nav-logo .logo .logo-k,
html.k3-intro-done .nav-logo .logo .logo-arms, html.k3-intro-done .nav-logo .logo .logo-exp { animation: none; stroke-dashoffset: 0; }
html.k3-intro-done .nav-logo .logo .logo-word { animation: none; opacity: 1; }

/* ---------- Vertrauensband: Icon | Wert / Zeile, Karte in der vierten Kachel ---------- */
.trust .trust-item { grid-template-columns: 1fr; align-content: start; row-gap: 14px; }
.trust .trust-text { display: grid; gap: 6px; min-width: 0; }
.trust .trust-big { hyphens: manual; }
.trust .trust-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--green-soft); color: var(--green); transition: background-color .25s, color .25s; }
.trust .trust-ico .icon { width: 24px; height: 24px; }
.trust a.trust-item:hover .trust-ico { background: var(--green); color: var(--ink-950); }
.trust .trust-ico--google { background: #fff; }
.trust a.trust-item:hover .trust-ico--google { background: #fff; }
.trust .trust-ico--google .icon { width: 26px; height: 26px; }
.trust .trust-ico--map { width: 66px; height: 84px; background: none; border-radius: 0; }
.trust-map { width: 100%; height: 100%; display: block; overflow: visible; }
.trust-map .tm-de { fill: var(--ink-700); stroke: var(--line-strong); stroke-width: .8; stroke-linejoin: round; }
.trust-map .tm-st { fill: none; stroke: rgba(255, 255, 255, .09); stroke-width: .6; stroke-linejoin: round; }
.trust-map .tm-by { fill: rgba(76, 192, 140, .22); stroke: var(--green); stroke-width: .9; stroke-linejoin: round; }
.trust-map .tm-dot { fill: var(--green-bright); stroke: var(--ink-950); stroke-width: 1; }
.trust-map .tm-ring { fill: none; stroke: var(--green); stroke-width: .8; opacity: 0; transform-box: fill-box; transform-origin: center; animation: tm-pulse 2.6s ease-out infinite; }
.trust-map .tm-ring2 { animation-delay: 1.3s; }
@keyframes tm-pulse { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(3.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .trust-map .tm-ring { animation: none; opacity: .5; transform: scale(1.8); }
  .trust-map .tm-ring2 { display: none; }
}
@media (width <= 480px) {
  .trust .trust-big { font-size: var(--step-1); }
  .trust .trust-label { display: block; }
}

/* ---------- Hero: Kennzahlen unter dem Google-Badge (Florian: „nur die Zahlen, oben“) ---------- */
.hero .hero-stats {
  justify-self: stretch; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 28px); row-gap: 18px; margin-top: 6px; padding-top: 20px;
  border-top: 1px solid var(--line-strong);
}
.hero .hero-stat { display: grid; gap: 7px; align-content: start; min-width: 0; }
.hero .hero-stat-num {
  font-size: clamp(1.5rem, 1.1rem + 1vw, 1.9rem); line-height: 1; font-weight: 600; letter-spacing: -.03em;
  color: var(--white); white-space: nowrap;
}
.hero .hero-stat-num i { font-style: normal; color: var(--green); margin-left: .04em; }
.hero .hero-stat-num small { font-size: .56em; font-weight: 500; letter-spacing: -.01em; color: var(--ink-200); }
.hero .hero-stat-label { color: var(--ink-200); font-size: .78rem; line-height: 1.35; text-wrap: balance; }
/* gestapelt liegt die Reihe über hellen Bildstellen (Holzwand, Lichtkante): Beschriftung weiß statt hellgrau
   plus weicher Schatten, gemessen an der hellsten Stelle mindestens 4,5:1 (hellgrau waren es 3,7:1) */
@media (width <= 1024px) {
  .hero .hero-stat { text-shadow: 0 1px 2px rgba(11, 13, 15, .55), 0 0 16px rgba(11, 13, 15, .6); }
  .hero .hero-stat-label { color: var(--white); }
}
@media (width <= 640px) {
  .hero .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ---------- Ende Hero-Kennzahlen ---------- */
