/* Variante der Startseite «Maschinenblick» (Startseite index.html, seit 15.11.2026)
   Ergänzt css/style.css. Der Baum steht fest hinter der Seite; jeder Abschnitt («Akt») hält seinen
   Text im Fenster fest, solange man durch ihn scrollt. Ohne 3D (kein WebGL, «Bewegung reduzieren»)
   stehen alle Texte normal untereinander auf Farbflächen. */

:root {
  --honey: #D9A23C;
  --honey-hell: #F0C674;
  --minze: #8FD6A0;
  --fa-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --fa-rand: max(1.25rem, calc(50vw - 620px));
  --fa-aus: cubic-bezier(0.23, 1, 0.32, 1);
}

.fable { background: #445A3C; }
.fable main { position: relative; z-index: 1; }
.fable footer { position: relative; z-index: 2; background: var(--cream); }
.fable .bubbles { display: none; } /* Blasen aus main.js: hier nicht nötig */

/* ── Bühne ── */
.fa-buehne { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; pointer-events: none; opacity: 0; transition: opacity 700ms var(--fa-aus); }
html.fa-bereit .fa-buehne { opacity: 1; } /* erst zeigen, wenn das erste Bild gezeichnet ist */
html:not(.fa-3d) .fa-buehne { display: none; }

/* ── Akte: Text bleibt stehen, solange man durch den Abschnitt scrollt ── */
.fa-akt { position: relative; height: 190svh; }
.fa-akt.fa-letzter { height: 115svh; }
.fa-bild {
  position: sticky; top: 64px; height: calc(100svh - 64px);
  display: grid; padding: clamp(1.25rem, 5svh, 3.5rem) var(--fa-rand);
  pointer-events: none;
}
.fa-inhalt { pointer-events: auto; max-width: 34rem; will-change: opacity, transform; }
[data-lage="links"] .fa-inhalt { justify-self: start; align-self: center; }
[data-lage="rechts"] .fa-inhalt { justify-self: end; align-self: center; }
[data-lage="unten"] .fa-inhalt { justify-self: center; align-self: end; }

/* Passt ein Text nicht ins Fenster (Handy), scrollt er normal über dem Baum (Klasse setzt haupt.js) */
.fa-akt.fa-frei { height: auto; }
.fa-akt.fa-frei .fa-bild { position: static; height: auto; padding-block: 62svh 38svh; }
.fa-akt.fa-frei:first-of-type .fa-bild { padding-top: 46svh; }
.fa-akt.fa-frei .fa-inhalt { opacity: 1 !important; transform: none !important; }

/* ── Gemeinsame Bausteine ── */
.fa-knopf {
  display: inline-block; padding: 14px 30px; border: 0; border-radius: 100px; cursor: pointer;
  background: var(--honey); color: var(--ink); font: 400 16px/1.2 var(--body); text-decoration: none;
  transition: background-color 160ms var(--fa-aus), transform 160ms var(--fa-aus);
}
.fa-knopf:active { transform: scale(0.97); }
.fa-knopf:focus-visible, .fa-link:focus-visible, .fa-schalter:focus-visible, .fa-schiene a:focus-visible { outline: 2px solid var(--honey-hell); outline-offset: 3px; }
.fa-knopf-gruen { background: var(--sage); color: var(--cream); }
@media (hover: hover) and (pointer: fine) {
  .fa-knopf:hover { background: var(--honey-hell); }
  .fa-knopf-gruen:hover { background: var(--sage-light); }
}
.fa-link { color: var(--honey-hell); text-underline-offset: 0.2em; }
.fa-link::after { content: ' →'; }
.fa-satz { font-size: 1.0625rem; line-height: 1.6; }

/* ── 1 Einstieg ── */
.fa-einstieg { max-width: 39rem; color: var(--cream); position: relative; isolation: isolate; }
.fa-einstieg::before { /* weicher Schatten hinter dem Text, läuft überall ganz aus */
  content: ''; position: absolute; z-index: -1; inset: -26% -34%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(22, 30, 19, 0.6), rgba(22, 30, 19, 0.4) 40%, rgba(22, 30, 19, 0.12) 75%, rgba(22, 30, 19, 0));
}
#spannung { overflow-x: clip; }
.fa-frage { font: 14px/1.4 var(--fa-mono); color: rgba(247, 244, 238, 0.86); margin-bottom: 0.9rem; }
.fa-frage span { color: var(--minze); }
.fa-zitat { font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 1.7vw, 1.45rem); color: var(--honey-hell); margin-bottom: 1rem; }
.fa-einstieg h1 {
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; line-height: 1.04;
  font-size: clamp(2.5rem, min(5.2vw, 9.5svh), 4.9rem); color: var(--cream); margin-bottom: 1.2rem;
  text-shadow: 0 1px 18px rgba(18, 26, 16, 0.45);
}
.fa-einstieg h1 em { font-style: normal; }
.fa-mensch { color: var(--honey); }
.fa-masch { color: var(--minze); }
.fa-unter { font-size: 1.0625rem; line-height: 1.6; max-width: 32rem; margin-bottom: 1.4rem; text-shadow: 0 1px 12px rgba(18, 26, 16, 0.5); }
.fa-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.4rem; }

/* ── 2 Was die KI kann: Tafel im Stil der Maschinensicht ── */
.fa-terminal {
  max-width: 30rem; color: var(--cream);
  background: rgba(9, 15, 11, 0.74); border: 1px solid rgba(143, 214, 160, 0.3); border-radius: 6px;
  padding: clamp(1.25rem, 2.4vw, 2rem); box-shadow: 0 0 0 1px rgba(143, 214, 160, 0.06), 0 24px 60px -30px #000;
}
.fa-kennung { font: 11.5px/1 var(--fa-mono); letter-spacing: 0.1em; color: var(--minze); margin-bottom: 1rem; }
.fa-kennung::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--minze); margin-right: 0.55em; box-shadow: 0 0 8px var(--minze); }
.fa-terminal h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.45rem, 2.2vw, 1.85rem); line-height: 1.16; margin-bottom: 1.1rem; }
.fa-kann { list-style: none; font: 14.5px/1.9 var(--fa-mono); margin-bottom: 1.1rem; }
.fa-kann li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem; border-bottom: 1px dashed rgba(143, 214, 160, 0.18); }
.fa-kann b { color: var(--minze); font-weight: 400; white-space: nowrap; margin-left: auto; }
.fa-kann .fa-offen span { color: var(--honey-hell); }
.fa-kann .fa-offen b { color: var(--honey-hell); }
.fa-fragst { margin-bottom: 0.35rem; }
.fa-fragen { list-style: none; display: grid; gap: 0.35rem; margin-bottom: 1.1rem; }
.fa-fragen li { padding-left: 1.1rem; position: relative; line-height: 1.45; }
.fa-fragen li::before { content: '›'; position: absolute; left: 0; color: var(--honey); }
.fa-terminal .fa-satz { font: 14px/1.6 var(--fa-mono); color: rgba(247, 244, 238, 0.92); border-top: 1px dashed rgba(143, 214, 160, 0.25); padding-top: 0.9rem; }

/* ── 3 Was nur wir können ── */
.fa-wende { max-width: 54rem; text-align: center; color: var(--cream); position: relative; isolation: isolate; }
.fa-wende::before { /* dunkles Band über die ganze Breite, läuft nach oben aus: Text bleibt vor dem Laub lesbar */
  content: ''; position: absolute; z-index: -1; inset: -5rem -50vw -6rem; pointer-events: none;
  background: linear-gradient(to top, rgba(18, 27, 15, 0.82), rgba(18, 27, 15, 0.62) 45%, rgba(18, 27, 15, 0.3) 75%, rgba(18, 27, 15, 0));
}
#wir-koennen { overflow-x: clip; }
.fa-faehig {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.1em 0.9em;
  font-family: var(--serif); font-style: italic; line-height: 1.2;
  font-size: clamp(1.6rem, min(3.4vw, 6svh), 3rem); margin-bottom: 0.9rem;
  text-shadow: 0 1px 16px rgba(18, 26, 16, 0.6);
}
.fa-faehig li:nth-child(odd) { color: var(--honey-hell); }
.fa-wende .fa-satz { max-width: 34rem; margin-inline: auto; text-shadow: 0 1px 12px rgba(18, 26, 16, 0.7); }

/* ── 4 Zwei Türen ── */
.fa-tueren { max-width: 62rem; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.fa-tuer {
  display: flex; flex-direction: column; color: var(--cream);
  background: rgba(34, 44, 30, 0.82); border-radius: 14px; padding: clamp(1.1rem, 2vw, 1.7rem);
  border-top: 2px solid var(--honey);
}
.fa-tuer:nth-child(2) { border-top-color: var(--minze); }
.fa-tuer h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.15; margin-bottom: 0.5rem; }
.fa-tuer p { font-size: 1rem; line-height: 1.55; margin-bottom: 0.9rem; }
.fa-tuer .fa-link { margin-top: auto; align-self: flex-start; }

/* ── 5 Sprechstunde ── */
.fa-karte {
  max-width: 44rem; display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: clamp(1.1rem, 2.4vw, 2rem); align-items: start;
  background: rgba(247, 244, 238, 0.95); color: var(--ink); border-radius: 16px; padding: clamp(1.2rem, 2.6vw, 2.2rem);
  box-shadow: 0 30px 70px -30px rgba(30, 35, 24, 0.5);
}
.fa-portrait { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; }
.fa-karte h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 2.3vw, 2rem); line-height: 1.12; margin-bottom: 0.7rem; }
.fa-karte p { font-size: 1rem; line-height: 1.6; color: var(--ink-soft); margin-bottom: 0.9rem; }
.fa-mitbringe { font-size: 0.9rem !important; }
.fa-mitbringe span { display: block; font-family: var(--serif); font-style: italic; color: var(--sage); font-size: 1rem; }

/* ── 6 Wurzeln ── */
.fa-wurzeln { max-width: 31rem; color: var(--cream); }
.fa-wurzeln h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 3.2vw, 2.7rem); line-height: 1.1; margin-bottom: 1rem; text-shadow: 0 1px 14px rgba(20, 14, 8, 0.6); }
.fa-wurzeln ul { list-style: none; background: rgba(40, 31, 22, 0.66); border-radius: 14px; padding: 0.4rem 1.2rem; }
.fa-wurzeln li + li { border-top: 1px solid rgba(247, 244, 238, 0.14); }
.fa-wurzeln a { display: block; padding: 0.7rem 0; color: var(--cream); text-decoration: none; }
.fa-wurzeln b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.15rem; color: var(--honey-hell); transition: translate 200ms var(--fa-aus); }
.fa-wurzeln span { display: block; font-size: 0.95rem; line-height: 1.45; color: rgba(247, 244, 238, 0.9); }
@media (hover: hover) and (pointer: fine) { .fa-wurzeln a:hover b { translate: 6px 0; } }

/* ── 7 Ankommen ── */
.fa-ankunft { max-width: 33rem; color: var(--ink); background: rgba(247, 244, 238, 0.88); border-radius: 16px; padding: clamp(1.2rem, 2.6vw, 2rem); }
.fa-ankunft label { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.15; margin-bottom: 0.8rem; }
.fa-idee-zeile { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.fa-idee-zeile input {
  flex: 1 1 14rem; min-width: 0; padding: 13px 16px; border-radius: 12px; border: 1.5px solid rgba(74, 103, 65, 0.45);
  background: #fff; font: 400 16px/1.3 var(--body); color: var(--ink);
}
.fa-idee-zeile input:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
.fa-idee-hinweis { font-size: 0.875rem; color: var(--ink-soft); margin-top: 0.5rem; }
.fk-idee-status { font-size: 0.9rem; color: var(--sage); min-height: 1.4em; }
.fk-idee-status a { color: var(--sage); }
.fa-code {
  margin: 0.9rem 0; padding: 0.9rem 1.1rem; border-radius: 10px; background: var(--ink); color: var(--honey-hell);
  font: 13.5px/1.7 var(--fa-mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.fa-schlusszitat { font-family: var(--serif); font-style: italic; font-size: 1.15rem; line-height: 1.4; color: var(--ink); margin-bottom: 0.7rem; }
.fa-oder { font-size: 0.95rem; color: var(--ink-soft); }
.fa-ankunft .fa-link { color: var(--sage); font-weight: 400; }
.fa-karte-aktion { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.4rem; }
.fa-zweit { color: var(--sage); text-underline-offset: 0.2em; font-size: 1rem; }
@media (hover: hover) and (pointer: fine) { .fa-zweit:hover { color: var(--ink); } }

/* ── Fortschritt am rechten Rand ── */
.fable .fa-schiene {
  /* style.css gestaltet «nav» als Kopfzeile: hier alles zurücksetzen */
  position: fixed; top: 50%; right: clamp(10px, 1.6vw, 26px); left: auto; translate: 0 -50%; z-index: 3;
  display: flex; flex-direction: column; gap: 14px; height: auto; padding: 0; background: none; border: 0; animation: none;
  /* Farben der Punkte: auf dunklen Abschnitten Naturweiss, der aktive Honiggold wie die Knöpfe;
     auf hellen Abschnitten (html[data-fa-ton="hell"], setzt haupt.js) dunkel, der aktive Salbei */
  --punkt: rgba(247, 244, 238, 0.42); --punkt-da: var(--honey); --punkt-text: var(--cream);
}
html[data-fa-ton="hell"] .fa-schiene { --punkt: rgba(30, 35, 24, 0.28); --punkt-da: var(--sage); --punkt-text: var(--ink); }
.fa-schiene a { position: relative; display: block; width: 12px; height: 12px; }
.fa-schiene a::before {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--punkt);
  transition: inset 200ms var(--fa-aus), background-color 200ms var(--fa-aus);
}
.fa-schiene a.fa-da::before { inset: 0; background: var(--punkt-da); }
.fa-schiene span {
  position: absolute; right: 22px; top: 50%; translate: 6px -50%; white-space: nowrap; pointer-events: none;
  font: 11.5px/1 var(--fa-mono); color: var(--punkt-text); opacity: 0; transition: opacity 180ms var(--fa-aus), translate 180ms var(--fa-aus);
}
@media (hover: hover) and (pointer: fine) { .fa-schiene a:hover span { opacity: 0.9; translate: 0 -50%; } .fa-schiene a:not(.fa-da):hover::before { background: var(--punkt-text); } }
html:not(.fa-3d) .fa-schiene { display: none; }

/* ── Schalter «Maschinenblick» und Anzeige ── */
.fa-schalter {
  position: fixed; left: clamp(12px, 1.8vw, 28px); bottom: clamp(12px, 2.4svh, 24px); z-index: 3;
  display: none; align-items: center; gap: 0.55rem; padding: 9px 15px 9px 11px; border-radius: 100px; cursor: pointer;
  background: rgba(14, 20, 15, 0.72); color: var(--cream); border: 1px solid rgba(143, 214, 160, 0.35);
  font: 12.5px/1 var(--fa-mono); letter-spacing: 0.03em;
  transition: background-color 160ms var(--fa-aus), border-color 160ms var(--fa-aus), transform 160ms var(--fa-aus), opacity 200ms var(--fa-aus);
}
html.fa-3d .fa-schalter { display: inline-flex; }
html.fa-ende .fa-schalter { opacity: 0; pointer-events: none; } /* am Seitenende: Platz für die Fusszeile */
.fa-schalter:active { transform: scale(0.97); }
.fa-schalter-auge { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--honey-hell); position: relative; }
.fa-schalter-auge::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--honey-hell); scale: 0; transition: scale 200ms var(--fa-aus); }
.fa-schalter[aria-pressed="true"] { background: rgba(143, 214, 160, 0.16); border-color: var(--minze); }
.fa-schalter[aria-pressed="true"] .fa-schalter-auge { border-color: var(--minze); }
.fa-schalter[aria-pressed="true"] .fa-schalter-auge::after { background: var(--minze); scale: 1; }

.fa-anzeige {
  position: fixed; left: clamp(12px, 1.8vw, 28px); top: 84px; z-index: 2; pointer-events: none;
  font: 11.5px/1.75 var(--fa-mono); color: rgba(143, 214, 160, 0.92);
  opacity: 0; translate: -8px 0; transition: opacity 320ms var(--fa-aus), translate 320ms var(--fa-aus);
}
.fa-anzeige b { font-weight: 400; color: rgba(247, 244, 238, 0.62); margin-right: 0.5em; }
.fa-anzeige .fa-fehlt { color: var(--honey-hell); }
html.fa-maschine .fa-anzeige { opacity: 1; translate: 0 0; }

/* ── Ohne 3D: Texte untereinander auf Farbflächen ── */
html:not(.fa-3d) .fa-akt { height: auto; }
html:not(.fa-3d) .fa-bild { position: static; height: auto; min-height: 78svh; align-content: center; }
html:not(.fa-3d) .fa-inhalt { opacity: 1 !important; transform: none !important; }
html:not(.fa-3d) #spannung { background: linear-gradient(#445A3C, #465A3E); }
html:not(.fa-3d) #ki-kann { background: linear-gradient(#465A3E, #101812 30%, #101812 70%, #68865A); }
html:not(.fa-3d) #wir-koennen { background: linear-gradient(#68865A, #5C6E50); }
html:not(.fa-3d) #tueren { background: linear-gradient(#5C6E50, #F7F4EE); }
html:not(.fa-3d) #sprechstunde { background: var(--cream); }
html:not(.fa-3d) #wurzeln { background: linear-gradient(#F7F4EE, #46392A 30%, #46392A 70%, #F7F4EE); }
html:not(.fa-3d) #ankommen { background: var(--cream); }

/* ── Handy ── */
@media (max-width: 760px) {
  .fa-inhalt { max-width: none; width: 100%; }
  /* Der Baum steht oben im Fenster, der Text darunter */
  html.fa-3d [data-lage] .fa-inhalt { align-self: end; }
  html.fa-3d .fa-bild { padding-bottom: 1.5rem; }
  /* Schalter und Anzeige als Zeile unter der Kopfzeile */
  .fa-schalter { left: auto; right: 10px; bottom: auto; top: 74px; }
  html.fa-ende .fa-schalter { opacity: 1; pointer-events: auto; }
  .fa-anzeige { left: 10px; background: rgba(9, 15, 11, 0.72); border-radius: 8px; padding: 5px 9px; line-height: 1.5; }
  .fa-anzeige p:nth-child(2), .fa-anzeige p:nth-child(3) { display: none; }
  .fa-tueren { grid-template-columns: minmax(0, 1fr); }
  .fa-karte { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .fa-einstieg::before { inset: -14% -8%; }
  .fa-wurzeln { background: none; }
  .fa-schiene { gap: 11px; right: 6px; }
  .fa-anzeige { font-size: 10px; top: 74px; }
  .fa-schalter { font-size: 11.5px; padding: 8px 12px 8px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .fa-knopf, .fa-schalter, .fa-schiene a::before, .fa-anzeige { transition: none; }
}
