/* Startseite – übernommen aus respect-design/index.src.html */
  :root {
    --red: #e01515;         /* Logo-Rot, hell – einziger Farbakzent */
    --red-deep: #b00000;    /* Logo-Rot, dunkel */
    --red-ink: #7a0000;     /* Konturen des Fadens */
    --ink: #171717;
    --charcoal: #1e1e1e;
    --graphite: #525252;
    --steel: #737373;
    --silver: #a3a3a3;
    --fog: #f0f0f0;
    --mist: #f5f5f5;
    --canvas: #ffffff;
    --white: #ffffff;
    --wash: #fef3c7;
    --hair: rgba(0, 0, 0, .08);
    --shadow-card: 0 1px 1px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.05), 0 8px 16px rgba(0,0,0,.05);
    --shadow-btn: 0 1px 2px rgba(0,0,0,.06);
    --max: 1100px;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    position: relative;
    background: var(--canvas);
    color: var(--graphite);
    /* Fliesstext: Verdana Pro Light (Gewicht 300). Ohne Verdana Pro: normales Verdana, das kein Light kennt. */
    font-family: "Verdana Pro", "Verdana Pro Light", Verdana, Geneva, "DejaVu Sans", sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
  }
  img, svg { display: block; max-width: 100%; }
  a { color: inherit; text-decoration: none; }
  h1, h2, h3, p { margin: 0; }

  .wrap { width: min(var(--max), 100% - 48px); margin-inline: auto; }

  /* Text liegt über dem Faden, Flächen darunter */
  .above { position: relative; z-index: 2; }

  /* ---------- Faden ---------- */
  #thread {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
  }
  #mpath { fill: none; stroke-linejoin: round; }
  /* das gedrehte Seil aus dem Logo: abwechselnd helle und dunkle Stränge mit schwarzer Kontur */

  /* ---------- Header ---------- */
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    padding: 20px 24px 0;
    width: min(1200px, 100%);
    margin-inline: auto;
  }
  .nav { display: flex; align-items: center; gap: 4px; }
  .nav-left { justify-content: flex-end; }
  .nav-right { justify-content: flex-start; }
  /* Aufklappmenü */
  .has-menu { position: relative; }
  .nav-item {
    display: inline-flex; align-items: center; gap: 6px;
    font: inherit; font-size: 13px; font-weight: 300; line-height: 30px;
    color: var(--ink); background: none; border: 0; padding: 0 10px; border-radius: 9999px;
    cursor: pointer; transition: background .15s;
    animation: fade-down .6s ease .37s both;
  }
  .nav-item svg { flex: none; transition: transform .2s; }
  .has-menu:hover .nav-item, .has-menu.open .nav-item, .nav-item:hover { background: var(--mist); }
  .has-menu:hover .nav-item svg, .has-menu.open .nav-item svg { transform: rotate(180deg); }
  .menu {
    position: absolute; top: 100%; left: 0; z-index: 30;
    min-width: 178px; margin: 0; padding: 6px; list-style: none;
    background: var(--white); border-radius: 12px;
    box-shadow: 0 0 0 1px var(--hair), 0 4px 10px rgba(0, 0, 0, .06), 0 14px 30px rgba(0, 0, 0, .08);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .16s, transform .16s, visibility 0s .16s;
  }
  .menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }   /* Brücke für den Mauszeiger */
  .has-menu:hover .menu, .has-menu:focus-within .menu, .has-menu.open .menu {
    opacity: 1; visibility: visible; transform: translateY(6px); transition-delay: 0s;
  }
  .nav .menu a { display: block; padding: 0 10px; line-height: 32px; border-radius: 8px; white-space: nowrap; animation: none; }
  .nav .menu a:hover, .nav .menu a:focus-visible { background: var(--mist); }
  .nav .menu .sep { height: 1px; margin: 5px 4px; background: var(--fog); }
  .nav a {
    font-size: 13px;
    font-weight: 300;
    line-height: 30px;
    color: var(--ink);
    padding: 0 10px;
    border-radius: 9999px;
    transition: background .15s;
  }
  .nav a:hover { background: var(--mist); }
  .nav a.pill { background: var(--white); box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(0, 0, 0, .06); margin-left: 4px; }
  .nav a.pill:hover { background: var(--mist); }
  .logo { width: clamp(210px, 25vw, 310px); }
    .logo img { width: 100%; height: auto; }

  /* ---------- Megamenü «Projekte»: Kategorien als Spalten, darunter ihre Projekte ----------
     Wird von build.py in die Startseite und in alle Unterseiten eingesetzt. Die Inhalte erzeugt build.py
     aus den Kategorie-Seiten (src/flachs.html usw.), neue Projekte erscheinen also automatisch. */
  .menu.mega {
    width: min(780px, calc(100vw - 16px)); min-width: 0; padding: 8px; border-radius: 18px;
    max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain;
  }
  .menu.mega::before { top: calc(-1 * var(--bridge, 14px)); height: var(--bridge, 14px); }   /* Brücke für den Mauszeiger */
  .mega-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 2px; }
  /* Kopf und Projektliste teilen sich die Zeilen aller Spalten: die Listen beginnen auf einer Linie */
  .mega-col { display: grid; grid-row: span 2; grid-template-rows: subgrid; align-content: start; padding: 4px; border-radius: 12px; }
  .mega-col + .mega-col { box-shadow: -1px 0 0 var(--fog); border-radius: 0; }
  .nav .menu.mega a { display: block; white-space: normal; animation: none; border-radius: 10px; transition: background .15s, color .15s; }
  .nav .menu.mega a:hover, .nav .menu.mega a:focus-visible { background: var(--mist); }
  .nav .menu.mega .mega-head { padding: 10px 10px 12px; line-height: 1.4; }
  .mega-head b { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
  .mega-head b small { font-size: 11px; font-weight: 300; letter-spacing: 0; color: var(--silver); }
  .mega-head span { display: block; margin-top: 3px; font-size: 12px; font-weight: 300; color: var(--steel); }
  .mega-col ul { margin: 0; padding: 0; list-style: none; }
  .nav .menu.mega .mega-col li a { position: relative; padding: 7px 10px 7px 24px; font-size: 13px; line-height: 1.35; color: var(--graphite); }
  .mega-col li a::before {   /* kleiner Fadenknoten vor jedem Projekt */
    content: ""; position: absolute; left: 11px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
    border-radius: 50%; box-shadow: 0 0 0 1.5px var(--silver); transition: box-shadow .15s, background .15s;
  }
  .nav .menu.mega .mega-col li a:hover { color: var(--ink); }
  .mega-col li a:hover::before { background: var(--red); box-shadow: 0 0 0 1.5px var(--red); }
  @media (max-width: 860px) {
    .mega-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 6px; }
    .mega-col + .mega-col { box-shadow: none; }
    .mega-col:nth-child(even) { box-shadow: -1px 0 0 var(--fog); border-radius: 0; }
  }


  /* ---------- Mitlaufende Navigation: schwebende Insel ---------- */
  .sticky-nav {
    position: fixed; top: 10px; left: 50%; z-index: 40;
    width: max-content; max-width: calc(100% - 16px);
    background: var(--white);
    border-radius: 9999px;
    box-shadow: 0 0 0 1px var(--hair), 0 2px 6px rgba(0, 0, 0, .06), 0 12px 28px rgba(0, 0, 0, .10);
    transform: translate(-50%, -150%) scale(.6); opacity: 0;
    transition: transform .28s cubic-bezier(.5, 0, .9, .4), opacity .2s;
  }
  .sticky-nav.show {
    transform: translate(-50%, 0) scale(1); opacity: 1;
    transition: transform .6s cubic-bezier(.2, 1.35, .35, 1), opacity .25s;   /* federt leicht nach */
  }
  .sticky-inner { display: flex; align-items: center; gap: 18px; padding: 7px 12px 7px 18px; }   /* Logo links, Links rechts daneben */
  .s-logo { flex: none; display: block; }
  .s-logo img { height: 40px; width: auto; }   /* etwas grösser als die Links */
  .sticky-nav .nav { gap: 2px; }
  .sticky-nav .nav a, .sticky-nav .nav-item { animation: none; font-size: 12px; line-height: 28px; padding: 0 9px; }
  .sticky-nav .nav a.pill { margin-left: 2px; }
  .menu.menu-right { left: auto; right: 0; }
  .sticky-nav .has-menu:hover .menu, .sticky-nav .has-menu:focus-within .menu, .sticky-nav .has-menu.open .menu { transform: translateY(12px); }
  .sticky-nav .menu::before { top: -14px; height: 14px; }
  /* Logo und Links rücken beim Hereinfahren kurz nach */
  .sticky-nav .s-logo, .sticky-nav .nav { opacity: 0; transition: opacity .15s; }
  .sticky-nav.show .s-logo, .sticky-nav.show .nav { opacity: 1; transition: opacity .35s ease .18s; }

  /* ---------- Buttons ---------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: -.1px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-btn);
    transition: background .15s, transform .1s, box-shadow .15s;
    cursor: pointer;
  }
  .btn:active { transform: scale(.98); }
  .btn-primary { background: var(--ink); color: var(--white); }
  .btn-primary:hover { background: #2e2e2e; }
  .btn-ghost, .btn-white { background: var(--white); color: var(--ink); border-color: transparent; box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(0, 0, 0, .06); }
  .btn-ghost:hover, .btn-white:hover { background: var(--mist); }

  /* ---------- Typo ---------- */
  .display {
    font-weight: 600;
    font-size: clamp(32px, 4.1vw, 48px);
    line-height: 1.06;
    letter-spacing: -.04em;
    margin-inline: auto;
    letter-spacing: -.031em;
    color: var(--ink);
  }
  .h2 {
    font-weight: 600;
    font-size: clamp(22px, 2.3vw, 27px);
    line-height: 1.2;
    letter-spacing: -.035em;
    color: var(--ink);
  }
  .lead { font-size: clamp(15px, 1.4vw, 18px); line-height: 1.5; max-width: 31em; letter-spacing: -.2px; color: var(--ink); text-wrap: balance; }

  /* ---------- Hero ---------- */
  .hero {
    min-height: calc(100vh - 150px);
    min-height: calc(100svh - 150px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 90px 0 90px;
  }
  .hero .lead { margin: 22px auto 0; }
  .ball { width: clamp(100px, 10.5vw, 136px); margin: 0 auto 30px; animation: ball-in 1s cubic-bezier(.2, 1.4, .3, 1) .3s both; }
  .ball img { display: block; width: 100%; height: auto; }
  @keyframes ball-in { from { opacity: 0; transform: translateY(-40px) scale(.3) rotate(-200deg); } }

  /* ---------- Auftritt beim Laden ---------- */
  /* Logo senkt sich ein, die Navigation folgt, die Überschrift steigt Wort für Wort aus ihrer Zeile,
     dann erscheint der Text. */
  .logo { animation: logo-in .9s cubic-bezier(.2, .9, .25, 1.15) both; }
  .nav a { animation: fade-down .6s ease both; }
  .nav-left .nav-item { animation-delay: .25s; }
  .nav-left > a { animation-delay: .33s; }
  .nav-right > a { animation-delay: .45s; }
  .display .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding: .06em .04em .16em; margin: -.06em -.04em -.16em; }
  .display .w > span {
    display: inline-block;
    transform-origin: 0 100%;   /* dreht um die linke untere Ecke: der erste Buchstabe bleibt verdeckt */
    animation: word-up 1s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: calc(.7s + var(--n) * .07s);
  }
  .hero .lead { animation: lead-in 1s cubic-bezier(.2, .9, .3, 1) 1.3s both; }
  .scroll-hint { animation: fade-down .8s ease 1.9s both; }
  @keyframes logo-in { from { opacity: 0; transform: translateY(-14px) scale(.9); } }
  @keyframes fade-down { from { opacity: 0; transform: translateY(-8px); } }
  @keyframes word-up { from { transform: translateY(160%) rotate(7deg); } }
  @keyframes lead-in { from { opacity: 0; transform: translateY(18px); filter: blur(8px); } }
  .scroll-hint {
    margin: 64px auto 0;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 300;
    color: var(--steel);
  }
  .scroll-hint i {
    width: 22px; height: 36px; border: 1px solid var(--silver); border-radius: 12px; position: relative;
  }
  .scroll-hint i::after {
    content: ""; position: absolute; left: 50%; top: 6px; width: 4px; height: 4px; margin-left: -2px;
    background: var(--red); border-radius: 50%;
    animation: hint 1.6s ease-in-out infinite;
  }
  @keyframes hint { 0% { transform: translateY(0); opacity: 1; } 80%,100% { transform: translateY(16px); opacity: 0; } }

  /* ---------- Sektionen ---------- */
  section { padding: 112px 0; }

  .story-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
  }
  .story-copy p + p { margin-top: 12px; }
  .story-copy p { max-width: 27em; font-size: 15px; line-height: 1.55; letter-spacing: -.2px; color: var(--ink); }
  .story-copy .h2 { margin-bottom: 12px; }
  .facts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; padding: 0; list-style: none; }
  .facts li {
    border: 1px solid var(--hair); border-radius: 9999px;
    padding: 6px 14px; background: var(--white); box-shadow: var(--shadow-btn);
    font-weight: 500; color: var(--graphite); font-size: 14px;
  }
  .facts b { color: var(--ink); font-weight: 600; }

  /* Der Kreis, den der Faden zieht */
  .yarn-art { --p: 0; --g: 0; width: min(100%, 440px); aspect-ratio: 1; margin-inline: auto; position: relative; }
  .yarn-art::before {
    content: ""; position: absolute; inset: 10%; border-radius: 47% 53% 51% 49% / 52% 47% 53% 48%;
  }
  .yarn-art::before {
    background: var(--white);
    opacity: calc(var(--p) * 1.5);
    /* wächst zusammen mit der Garnschlaufe, vom Knoten aus */
    transform-origin: var(--ox, 50%) var(--oy, 50%);
    transform: scale(calc(.24 + .76 * var(--g)));
  }
  .yarn-art .photo {
    position: absolute; inset: 0;
    background: center / cover no-repeat;
    opacity: calc(var(--g) * 5);        /* erscheint, sobald die Schlaufe zu wachsen beginnt */
    clip-path: circle(0);               /* bis das Skript die Schlaufenform setzt */
  }
  /* Galerie im Kreis */
  .gallery {
    display: flex;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;      /* kein "Zurück" des Browsers beim seitlichen Wischen */
    scrollbar-width: none;
    cursor: grab;
    outline: none;
  }
  .gallery::-webkit-scrollbar { display: none; }
  .gallery.dragging { scroll-snap-type: none; cursor: grabbing; }
  .gallery .slide.placeholder { display: grid; place-items: center; background: var(--mist); color: var(--steel); text-align: center; }
  .gallery .slide.placeholder span { font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--graphite); }
  .gallery .slide.placeholder small { display: block; margin-top: 4px; font-size: 12px; font-weight: 300; letter-spacing: 0; color: var(--steel); }
  .gallery .slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; background: center / cover no-repeat; }
  /* Bedienleiste in der Textspalte, über dem Titel, links: Pfeil, Punkte, Pfeil */
  .copy-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 20px; }
  .copy .copy-actions .btn { margin-top: 0; }   /* sonst schiebt der Abstand der Text-Buttons ihn aus der Mitte */
  .gal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
  .gal-btn {
    width: 30px; height: 30px; padding: 0;
    display: grid; place-items: center;
    border: 0; border-radius: 50%;
    background: var(--white); color: var(--ink);
    box-shadow: 0 0 0 1px var(--hair), 0 1px 3px rgba(0, 0, 0, .1);
    cursor: pointer;
    transition: transform .15s, background .15s;
  }
  .gal-btn:hover { transform: scale(1.1); background: var(--mist); }
  .gal-btn:active { transform: scale(.95); }
  .gal-dots { display: flex; gap: 7px; padding: 6px 4px; }
  .gal-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--silver); opacity: .6; cursor: pointer; transition: background .2s, transform .2s, opacity .2s; }
  .gal-dots button[aria-current="true"] { background: var(--ink); opacity: 1; transform: scale(1.3); }
  .gallery:focus-visible { box-shadow: inset 0 0 0 3px var(--ink); }

  /* Zeilen: Bild und Text, abwechselnd links / rechts */
  .row.flip .yarn-art { order: 2; }
  .copy { position: relative; z-index: 2; }
  .copy .btn { margin-top: 20px; }

  .posts {
    margin-top: 24px;
    background: var(--white); border: 1px solid var(--hair); border-radius: 12px; box-shadow: var(--shadow-card);
  }
  .post:first-child { border-radius: 11px 11px 0 0; }
  .post:last-child { border-radius: 0 0 11px 11px; }
  .post {
    display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center;
    padding: 14px 16px;
    transition: background .15s;
  }
  .post + .post { border-top: 1px solid var(--fog); }
  .post:hover { background: var(--mist); }
  .post .num {
    width: 44px; height: 44px; border-radius: 8px; background: var(--mist);
    display: grid; place-items: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 600; font-size: 12px; color: var(--steel);
    transition: background .15s;
  }
  .post .num svg { width: 30px; height: auto; }
  .post:hover .num { background: var(--wash); color: var(--ink); }
  .post h3 { font-size: 16px; font-weight: 500; color: var(--ink); line-height: 1.35; letter-spacing: -.2px; }
  .post p { font-size: 14px; color: var(--steel); margin-top: 2px; max-width: none; }
  .post .arrow { font-weight: 500; font-size: 16px; color: var(--silver); transition: transform .15s, color .15s; }
  .post:hover .arrow { color: var(--ink); transform: translateX(3px); }

  /* Inhalt entsteht aus dem Kreis: --sx / --sy zeigen von jedem Element zur Kreismitte (per JS gesetzt) */
  .js .copy > *, .js .copy .post {
    opacity: 0;
    filter: blur(6px);
    transform: translate(var(--sx, 0px), var(--sy, 0px)) scale(.06);
    transition: opacity .3s ease-in, transform .4s cubic-bezier(.6, 0, .8, .4), filter .3s;
  }
  .js .copy .posts { transform: none; filter: none; }
  .js .arrived .copy > *, .js .arrived .copy .post {
    opacity: 1; filter: none; transform: none;
    transition: opacity .35s ease, transform .95s cubic-bezier(.2, 1.3, .3, 1), filter .5s ease;
    transition-delay: calc(var(--i, 0) * 85ms);
  }
  .measure .copy > *, .measure .copy .post { transform: none !important; transition: none !important; }

  .last { padding-bottom: 72px; }

  /* ---------- Fusszeile (wie bei Campsite: Logo links, Linkspalten rechts) ---------- */
  .site-footer { margin-top: 56px; border-top: 1px solid var(--fog); padding: 56px 0 64px; text-align: left; font-size: 13px; color: var(--graphite); }
  .footer-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
  .footer-brand img { height: 38px; width: auto; }
  .footer-brand p { margin: 14px 0 0; max-width: 20em; line-height: 1.5; color: var(--steel); }
  .footer-col h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0; line-height: 1.4; color: var(--ink); }
  .footer-col a { display: block; width: fit-content; padding: 5px 0; color: var(--graphite); transition: color .15s; }
  .footer-col a:hover { color: var(--ink); }
  .footer-note { margin-top: 44px; color: var(--silver); }
  @media (max-width: 860px) {
    .site-footer { padding: 40px 0 48px; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
    .footer-brand { grid-column: 1 / -1; }
  }


  @media (max-width: 860px) {
    .site-header { grid-template-areas: "logo logo" "l r"; grid-template-columns: auto auto; justify-content: center; gap: 6px; }
    .logo { grid-area: logo; justify-self: center; }
    .nav-left, .nav-right { justify-content: center; }
    .hero { padding-top: 70px; }
    .sticky-inner { padding: 6px 6px 6px 11px; gap: 6px; }
    .s-logo img { height: 28px; }
    .sticky-nav .nav { gap: 0; }
    .sticky-nav .nav a, .sticky-nav .nav-item { font-size: 11px; line-height: 26px; padding: 0 4px; gap: 3px; }
    .sticky-nav .nav a.pill { margin-left: 0; padding: 0 6px; }
    section { padding: 96px 0; }
    .story-grid { grid-template-columns: 1fr; gap: 40px; }
    .row.flip .yarn-art { order: 0; }
    .yarn-art { width: min(100%, 280px); }
    .post .arrow { display: none; }
    .post { grid-template-columns: 44px 1fr; }
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js .copy > *, .js .copy .post { opacity: 1; filter: none; transform: none; transition: none; }
    .scroll-hint i::after { animation: none; }
    .sticky-nav, .sticky-nav .s-logo, .sticky-nav .nav { transition: none !important; }
    .logo, .ball, .nav a, .nav-item, .display .w > span, .hero .lead, .scroll-hint { animation: none; }
  }
