/* ===========================
   Design Tokens & Basis
   =========================== */
:root{
  --fs-1: clamp(1.00em, 0.88em + 0.8vw, 1.30em); /* Titel & Lauftext */
  --fs-2: clamp(0.48em, 0.44em + 0.3vw, 0.60em); /* Detailtexte (Kacheln/Projekte) */
  --fs-3: clamp(0.36em, 0.34em + 0.2vw, 0.44em); /* Fuss */
  --lh-1: 1.35;
}

html{
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

body{
  margin: 0;
  font-family: Arial, sans-serif;
  color: #fff;

  background: linear-gradient(120deg, #8A2387 0%, #E94057 50%, #F27121 100%);
  background-size: 300% 300%;
  animation: subtleShift 5s ease-in-out infinite alternate;

  font-size: 2em;
  line-height: var(--lh-1);

  display: flex;
  justify-content: center;

  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Auswahl-Farbe */
::selection{ color:#000; }
::-moz-selection{ color:#000; }

@keyframes subtleShift{
  0%{ background-position: 0% 50% }
  100%{ background-position: 100% 50% }
}

h1, h2, p, li,
#quicklinks,
.intro-headline,
.content-block h1{
  line-height: var(--lh-1);
}

p, h2, li{
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

/* ===========================
   Links – global konsistent
   =========================== */
a{
  color: #fff;
  text-decoration-line: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

a:hover,
a:active{
  color: #000;
}

a:focus-visible{
  outline: 2px dashed #000;
  outline-offset: 3px;
}

/* Pfeil bei externen Links */
a[target="_blank"]::after{
  content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 10 10"><path d="M2 8 L8 2 M4 2 H8 V6" stroke="%23ffffff" stroke-width="1.4" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  display: inline-block;
  margin-left: .1em;
  vertical-align: .05em;
  transform: translateY(-.1em);
}

/* Schwarze Pfeile nur innerhalb des Bereichs "Aktivitäten" */
#projekte a[target="_blank"]::after{
  content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 10 10"><path d="M2 8 L8 2 M4 2 H8 V6" stroke="%23000000" stroke-width="1.4" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>');
}

a[target="_blank"][data-noicon]::after{ content: none !important; }
a[target="_blank"][data-noicon]:hover::after{ filter: none !important; }

/* Pfeil Hover-Farbe schwarz */
a[target="_blank"]:hover::after{
  filter: brightness(0) invert(0);
}

/* ===========================
   Layout
   =========================== */
.container{
  position: relative;
  z-index: 1;
  max-width: 1000px;
  padding: 20px 80px;
}

/* Typografie-Gruppen */
h1{ color:#000; font-size: var(--fs-1); }
h2{ color:#fff; font-weight: normal; font-size: var(--fs-1); }

.content{
  font-size: var(--fs-1);
  color: #fff;
}

.content .label{
  font-size: var(--fs-1);
  font-weight: bold;
  letter-spacing: .02em;
}

/* Absatzabstände im Content */
.content p{ margin: .2em 0 .6em; }
.content ul{ margin: .2em 0 .8em 1.2em; padding: 0; }
.content li{ margin: .1em 0; }

/* ===========================
   Header & Galerie
   =========================== */
#header{
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* FIX: war "left" (ungültig) */
  text-align: left;
  margin-bottom: .5em;
}

#gallery{
  width: 250px;
  height: 250px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  margin-bottom: .3em;
}

/* Bild-Strip / Hover-PNG – Breite wird via JS gesetzt */
#gallery img{
  position: relative;
  transition: opacity 1s ease-in-out;
  pointer-events: none;

  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.intro-headline{
  margin: 0;
  font-size: var(--fs-1);
  color: #000;
}

/* Quicklinks */
#quicklinks{
  margin-top: 1.2em;
  font-size: var(--fs-1);
  color: #fff;
}

#quicklinks a.inline-toggle.active{
  color: #000 !important;
  text-decoration: none !important;
  -webkit-text-decoration: none !important;
  border-bottom: none !important;
}

/* ===========================
   Content-Blöcke (Inline)
   =========================== */
.content-block{
  position: relative;
  display: none;
  opacity: 0;
  transition: opacity 300ms ease;
  margin: 0;
  padding-top: .9em;
  border-top: none;
}

/* Zickzack-Trenner */
.content-block::before{
  content: "";
  display: block;
  height: 8px;
  margin-bottom: .6em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8' viewBox='0 0 16 8'%3E%3Cpath d='M0 8 L4 0 L8 8 L12 0 L16 8' stroke='%23FFFFFF' stroke-opacity='0.55' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 16px 8px;
}

/* Close-Button */
.content-block .close-btn{
  position: absolute;
  top: 1em;
  right: 0;
  background: transparent;
  border: 0;
  color: #000;
  font-size: 1.5em;
  line-height: 1;
  cursor: pointer;
  opacity: .7;
  padding: .1em .2em;
  z-index: 1;
}

.content-block .close-btn:hover,
.content-block .close-btn:focus{
  opacity: 1;
  outline: none;
}

.content-block:not(.fade-in) .close-btn{ display:none; }

.content-block h1{
  margin: .2em 0 .3em;
  font-size: var(--fs-1);
  color: #000;
  font-weight: bold;
}

.fade-in{
  display: block !important;
  opacity: 1 !important;
}

/* ===========================
   Angebots-Kacheln
   =========================== */
.content .offer-grid{
  display: grid;
  gap: 1em;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  justify-content: center;
  align-items: start;
  margin-top: 1em;
}

.content .offer-card{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  min-height: 300px;
  max-width: 400px;
  padding: .4em .9em .9em;

  border: 1px solid rgba(255,255,255,.35);
  border-radius: .3em;
  background: transparent;

  cursor: pointer;
  overflow: visible;
  box-sizing: border-box;

  transition: border-color .3s ease, transform .2s ease;
}

.content .offer-card:hover{
  border-color: rgba(255,255,255,.6);
  transform: translateY(-2px);
}

.content .offer-card:active{ transform: translateY(0); }

.content .offer-content{
  position: static !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  gap: .3em;
  width: 100%;
  height: auto;
  text-align: center;
  box-sizing: border-box;
}

.content .offer-icon{
  font-size: .8em;
  line-height: 1;
  user-select: none;
  margin-bottom: .15em;
  opacity: .85;
}

.content .offer-title,
.content .offer-text{
  color: #fff;
  font-size: calc(var(--fs-2) * 1.2);
  line-height: 1.35em;
  margin: 0;
  text-align: center;
  word-break: break-word;
}

.content .offer-title{ color:#000; }
.content .offer-text{ max-width: 95%; }

/* ===========================
   Arbeiten – Matrix & Detail-Panel (Variante B)
   =========================== */
.arbeiten-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: .6em;
}

/* Jede Kachel */
.arbeit-item {
  min-width: 0;
}

.arbeit-tile {
  display: block;
  position: relative;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
  border-radius: 3px;
  aspect-ratio: 4 / 3;
  background: rgba(0,0,0,.2);
  border: none;
  padding: 0;
}

.arbeit-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .25s ease, transform .35s ease;
}

.arbeit-tile:hover img {
  opacity: .7;
  transform: scale(1.03);
}

/* Overlay auf allen Kacheln – immer leicht eingefärbt */
.arbeit-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(138,35,135,0.2);
  transition: background .25s ease;
  pointer-events: none;
}

.arbeit-tile:hover::after {
  background: rgba(138,35,135,0.38);
}

/* Aktive Kachel: noch intensiver */
.arbeit-tile[aria-expanded="true"]::after {
  background: rgba(138,35,135,0.52) !important;
}

.arbeit-tile[aria-expanded="true"] img {
  opacity: .7;
}

.arbeit-tile[aria-expanded="true"] {
  outline: 2px solid rgba(255,255,255,.9);
  outline-offset: 0;
}

/* Titel zentriert auf dem Bild – gleiche Grösse wie Fusszeile */
.arbeit-titel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: .4em .6em;
  font-size: clamp(12px, 1.5vw, 17px);
  color: #fff;
  line-height: 1.35;
  background: linear-gradient(transparent 40%, rgba(0,0,0,.45) 100%);
  pointer-events: none;
  hyphens: auto;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

/* Detail-Panel: lebt ausserhalb des Grids, wird per JS nach der Zeile eingehängt */
.arbeit-detail-panel {
  grid-column: 1 / -1;
  position: relative;
  margin-top: 0;
  padding: 1em 0 .8em;
  border-top: none;
  border-bottom: none;
}

.arbeit-detail-panel[hidden] {
  display: none;
}

/* Pfeil der auf aktive Kachel zeigt */
.arbeit-detail-arrow {
  position: absolute;
  top: -7px;
  width: 13px;
  height: 13px;
  background: transparent;
  border-left: 2px solid rgba(255,255,255,1);
  border-top: 2px solid rgba(255,255,255,1);
  transform: translateX(-50%) rotate(45deg);
  pointer-events: none;
  z-index: 2;
}

/* Bild + Text nebeneinander */
.arbeit-detail-inner {
  display: grid;
  grid-template-columns: 43% 1fr;
  gap: 1.2em;
  align-items: start;
}

.arbeit-detail-bild {
  position: relative;
}

.arbeit-detail-bild img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 3px;
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
}

.arbeit-credit {
  display: block;
  font-size: clamp(12px, 1.5vw, 17px);
  color: rgba(255,255,255,.6);
  margin-top: .3em;
  line-height: 1.3;
}

.arbeit-detail-text {
  display: flex;
  flex-direction: column;
  gap: .2em;
}

.arbeit-detail-text p {
  margin: 0 0 .4em;
  font-size: calc(var(--fs-2) * 1.2);
  color: #fff;
  line-height: var(--lh-1);
}

.arbeit-detail-text p:last-child {
  margin-bottom: 0;
}

/* Links im Detail: weiss, halbe Unterstreiche-Dicke, hover schwarz */
.arbeit-detail-text a {
  color: #fff;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.arbeit-detail-text a:hover,
.arbeit-detail-text a:active {
  color: #000;
}

/* Externer-Link-Pfeil im Detail: weiss, hover schwarz */
.arbeit-detail-text a[target="_blank"]::after {
  content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 10 10"><path d="M2 8 L8 2 M4 2 H8 V6" stroke="%23ffffff" stroke-width="1.4" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>') !important;
  filter: none !important;
}

.arbeit-detail-text a[target="_blank"]:hover::after,
.arbeit-detail-text a[target="_blank"]:active::after {
  content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 10 10"><path d="M2 8 L8 2 M4 2 H8 V6" stroke="%23000000" stroke-width="1.4" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>') !important;
  filter: none !important;
}

.arbeit-jahr {
  font-weight: normal;
  color: rgba(255,255,255,.75);
  font-size: clamp(12px, 1.5vw, 17px);
}

/* Mobile: 2 Spalten, Detail stackt vertikal */
@media (max-width: 768px) {
  .arbeiten-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .arbeit-titel {
    font-size: clamp(12px, 1.5vw, 17px);
  }

  .arbeit-detail-inner {
    grid-template-columns: 1fr;
    gap: .8em;
  }

  .arbeit-detail-bild img {
    aspect-ratio: 16 / 9;
  }

  .arbeit-detail-text p {
    font-size: calc(var(--fs-1) * 0.75);
  }

  .arbeit-credit {
    font-size: clamp(12px, 1.5vw, 17px);
  }
}

/* ===========================
   Footer
   =========================== */
#footer{
  border-top: 1px solid #fff;
  margin: 5em 0 1em;
  padding: 1em 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  font-size: var(--fs-2);
  color: #fff;
  font-weight: normal;
  line-height: 1.3em;
}

#footer a{
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

#footer a:hover,
#footer a:active{
  text-decoration-thickness: 1px;
}

/* ===========================
   Effekt-Layer (Trail)
   =========================== */
#trailLayer{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.trail-dot{
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%,-50%);

  background: radial-gradient(circle, rgba(138,35,135,0.5) 0%, rgba(233,64,87,0) 70%);
  filter: blur(9px);
  animation: fadeOut 3s ease-out forwards;
}

@keyframes fadeOut{
  0%{ opacity:1; transform:translate(-50%,-50%) scale(1) }
  100%{ opacity:0; transform:translate(-50%,-50%) scale(2) }
}

/* Close-Button & Zickzack im Arbeiten-Abschnitt verstecken */
/*#projekte.content-block::before { display: none; }*/
#projekte.content-block::before {
  display: block;
  position: relative;
  z-index: 2;
}
/*#projekte .close-btn { display: none !important; }*/

/* ===========================
   Kund:innen sagen – Chat-Layout
   =========================== */
#kundenstimmen .chat{
  display: flex;
  flex-direction: column;
  gap: .9em;
}

#kundenstimmen .msg{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 85%;
}

#kundenstimmen .msg:nth-child(even){
  align-items: flex-end;
  margin-left: auto;
}

#kundenstimmen .bubble{
  background: rgba(255,255,255,0.95);
  color: #000;
  padding: .9em 1.0em;
  border-radius: 5px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  position: relative;

  font-size: var(--fs-2);
  line-height: var(--lh-1);
}

#kundenstimmen .msg:nth-child(odd) .bubble::after,
#kundenstimmen .msg:nth-child(even) .bubble::after{
  content: "";
  position: absolute;
  bottom: -10px;
  width: 0;
  height: 0;
  border-top: 10px solid rgba(255,255,255,0.95);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
}

#kundenstimmen .msg:nth-child(odd) .bubble::after{ left: 18px; }
#kundenstimmen .msg:nth-child(even) .bubble::after{ right: 18px; }

#kundenstimmen .who{
  margin-top: .8em;
  font-size: var(--fs-2);
  color: #fff;
  opacity: .9;
}
/* Kund:innen sagen – Basisanimation */
#kundenstimmen .msg{
  opacity: 0;
  transform: translateY(10px);
  animation: ksIn 1000ms ease-out forwards;
}

/* Stagger: bis 20 Nachrichten vorbereitet */
#kundenstimmen .msg:nth-child(1)  { animation-delay: 0ms; }
#kundenstimmen .msg:nth-child(2)  { animation-delay: 800ms; }
#kundenstimmen .msg:nth-child(3)  { animation-delay: 1600ms; }
#kundenstimmen .msg:nth-child(4)  { animation-delay: 2400ms; }


@keyframes ksIn{
  to{ opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce){
  #kundenstimmen .msg{
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ===========================
   Mobile-Anpassungen
   =========================== */
@media (max-width:768px){
  .container{
    padding: 16px 24px;
    height: 100dvh;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  body{ font-size: 1.35em; }

  a{
    text-decoration-thickness: 1.5px;
    text-underline-offset: 5px;
  }

  a[target="_blank"]::after{
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 10 10"><path d="M2 8 L8 2 M4 2 H8 V6" stroke="%23ffffff" stroke-width="1.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  }

  /* Kein Bounce/White-Background beim Ziehen */
  html, body{
    height: 100dvh;
    overflow: auto;
    overscroll-behavior: none;
    background: linear-gradient(120deg, #8A2387 0%, #E94057 50%, #F27121 100%);
    background-size: 300% 300%;
    animation: subtleShift 5s ease-in-out infinite alternate;
  }

  #header{
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .content ul{ margin-left: 1em; }

  /* Schweif länger sichtbar auf Mobile */
  .trail-dot{ animation-duration: 4s; }

  /* Angebotsgrid kompakter */
  .content .offer-grid{
    grid-template-columns: repeat(2, 1fr);
    gap: .8em;
  }

  .content .offer-card{
    min-height: 260px;
    padding: .8em;
  }

  .content .offer-title,
  .content .offer-text{
    font-size: calc(var(--fs-1) * 0.6);
  }

  .offer-title{
    margin: 0;
    font-weight: bold;
  }

  /* Projekte-Styles entfernt – neu via .arbeiten-grid */

  /* Suchfeld leicht kompakter – entfernt */

  /* Kundenstimmen: Abstand bei Bubbles grösser */
  #kundenstimmen .bubble{
    margin-bottom: 15px;
    font-size: calc(var(--fs-1) * 0.75) !important;
    line-height: var(--lh-1) !important;
  }

  #kundenstimmen .who{
    margin-top: 0;
    font-size: calc(var(--fs-1) * 0.75) !important;
  }
}

/* iOS Safari Zoom verhindern – kein Suchfeld mehr */