/* =========================================================
   ki-projekte.css — nur fuer /ki-projekte
   Baut auf styles.css auf (Tokens, .card, .btn, .eyebrow,
   .grad-text, .brand-text, .marquee, .reveal). Keine neuen Farben:
   alle Werte sind Tokens oder deren rgba-Varianten aus styles.css.
   Eigene Datei statt styles.css-Erweiterung, damit die anderen Seiten
   kein neues Cache-Busting brauchen.
   ========================================================= */

/* ---------- Hex-Kachel (Icon im Sechseck) ---------- */
.kp-hex {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(135deg, rgba(37,99,235,0.25), rgba(56,189,248,0.08));
  color: var(--brand-glow);
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}
.kp-hex--solid {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
}

/* ---------- Hero ---------- */
.kp-hero {
  position: relative;
  padding: 88px 0 48px;
  overflow: hidden;
  background:
    radial-gradient(55% 50% at 50% -5%, rgba(37,99,235,0.28), transparent 65%),
    radial-gradient(40% 40% at 90% 85%, rgba(29,78,216,0.16), transparent 65%);
}
.kp-hero__inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.kp-hero__h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 5.2vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.kp-hero__h1 > span { display: block; }
.kp-hero__lead { margin: 0; max-width: 72ch; }

.kp-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* ---------- Projektlog-Fenster ---------- */
.kp-log {
  width: 100%;
  margin-top: 14px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(120,150,200,0.16);
  background: linear-gradient(180deg, rgba(17,26,46,0.85), rgba(10,17,34,0.85));
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8), 0 0 80px -20px rgba(37,99,235,0.4);
  text-align: left;
  overflow: hidden;
}
.kp-log__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.kp-log__dots { display: inline-flex; gap: 8px; }
.kp-log__dots i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface-3);
}
.kp-log__title {
  margin-left: 12px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0.06em;
}
.kp-log__neon { color: var(--neon); }
.kp-log__live { white-space: nowrap; }

.kp-log__body { display: flex; }
.kp-log__tabs {
  position: relative;   /* Bezug fuer offsetLeft beim Chip-Scroll */
  flex: 0 0 300px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
}
.kp-tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-2);
  text-align: left;
  transition: background 0.3s, border-color 0.3s;
}
.kp-tab:hover { background: rgba(96,165,250,0.06); }
.kp-tab:focus-visible { outline: 2px solid var(--brand-glow); outline-offset: 2px; }
.kp-tab.is-active {
  background: rgba(37,99,235,0.12);
  border-color: rgba(96,165,250,0.35);
}
.kp-tab__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kp-tab__t { color: var(--text); font-weight: 600; white-space: nowrap; }
.kp-tab__b {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

.kp-log__out {
  flex: 1 1 auto;
  min-width: 0;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.kp-log__lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
}
.kp-log__line {
  display: grid;
  grid-template-columns: 2.6em 7.5em 1fr;
  align-items: baseline;
  animation: kpLineIn 0.5s var(--ease-out) both;
}
.kp-log__line:nth-child(2) { animation-delay: 0.35s; }
.kp-log__line:nth-child(3) { animation-delay: 0.70s; }
.kp-log__line:nth-child(4) { animation-delay: 1.05s; }
.kp-log__line:nth-child(5) { animation-delay: 1.40s; }
.kp-log__nr { color: var(--text-4); }
.kp-log__k  { color: var(--cyan); }
.kp-log__v  { color: var(--text-2); }
.kp-log__v--hi  { color: var(--text); }
.kp-log__v--dim { color: var(--text-3); }
.kp-log__v--status { color: var(--neon-soft); }

.kp-caret {
  display: inline-block;
  width: 8px; height: 16px;
  margin-left: 4px;
  background: var(--cyan);
  vertical-align: -3px;
  animation: kpCaret 1s steps(1) infinite;
}

.kp-log__track {
  margin-top: auto;
  height: 2px;
  border-radius: 2px;
  background: rgba(120,150,200,0.12);
  overflow: hidden;
}
.kp-log__progress {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--cyan));
  transform-origin: left;
  animation-name: kpProgress;
  animation-timing-function: linear;
  animation-fill-mode: both;
}
.kp-log.is-paused .kp-log__progress { animation-play-state: paused; }

@keyframes kpLineIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes kpProgress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes kpCaret {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.kp-marquee {
  width: 100%;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-4);
}

/* ---------- Abschnitte ---------- */
.kp-sec { padding: clamp(64px, 9vw, 112px) 0; }
.kp-sec--tight { padding: clamp(32px, 5vw, 56px) 0; }
.kp-sec .container { max-width: calc(1180px + 2 * var(--pad-x)); }
.kp-narrow.container { max-width: calc(880px + 2 * var(--pad-x)); }

.kp-h2 { margin: 18px 0 0; font-size: clamp(32px, 4vw, 52px); line-height: 1.08; }
.kp-h2 > span { display: block; }
.kp-head--center { margin-left: auto; margin-right: auto; text-align: center; }

.kp-grid { display: grid; gap: 20px; }
.kp-grid--240 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kp-grid--320 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

.kp-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.kp-card > * { position: relative; z-index: 1; }
.kp-card--cta {
  border-color: rgba(96,165,250,0.35);
  background: linear-gradient(180deg, rgba(37,99,235,0.12), rgba(255,255,255,0.01));
}
.kp-card__top { display: flex; align-items: center; gap: 14px; }

.kp-nr {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--cyan);
}
.kp-h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.kp-p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.kp-mono, .kp-tech, .kp-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.kp-tech { margin-top: auto; color: var(--cyan); letter-spacing: 0.12em; }
.kp-label { color: var(--cyan); letter-spacing: 0.16em; }
.kp-more {
  align-self: flex-start;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-glow);
  text-decoration: none;
}
.kp-more:hover { color: var(--cyan); }
.kp-more .arrow { display: inline-block; transition: transform 0.4s var(--ease-out); }
.kp-more:hover .arrow { transform: translateX(4px); }

/* Datenschutz */
.kp-split {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: center;
}
.kp-split > * { flex: 1 1 420px; min-width: 0; }
.kp-trust { display: flex; flex-direction: column; gap: 14px; }
.kp-trust__item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
}
.kp-trust__item > div { display: flex; flex-direction: column; gap: 4px; }
.kp-trust__item strong { font-size: 16px; color: var(--text); }
.kp-trust__item span { font-size: 14.5px; line-height: 1.55; color: var(--text-2); }

/* Demo */
.kp-demo {
  border-radius: var(--r-xl);
  border: 1px solid rgba(96,165,250,0.28);
  background-color: rgba(10,17,34,0.9);
  box-shadow: 0 0 80px -20px rgba(37,99,235,0.4);
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
}
.kp-demo__txt {
  flex: 1 1 460px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.kp-demo__txt .kp-p { max-width: 56ch; font-size: 16px; }
.kp-demo__h {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 500;
}

/* FAQ */
.kp-faq { display: flex; flex-direction: column; gap: 12px; }
.kp-faq__item {
  padding: 22px 24px;
  border-radius: var(--r-md);
  border: 1px solid rgba(120,150,200,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
}
.kp-faq__item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.kp-faq__item summary::-webkit-details-marker { display: none; }
.kp-faq__item summary::after {
  content: "+";
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1;
}
.kp-faq__item[open] summary::after { content: "\2212"; }
.kp-faq__item summary:focus-visible {
  outline: 2px solid var(--brand-glow);
  outline-offset: 4px;
  border-radius: 6px;
}
.kp-faq__item p { margin: 14px 0 0; font-size: 15.5px; line-height: 1.65; color: var(--text-2); }

/* Kontakt */
.kp-kontakt {
  padding-bottom: 120px;
  background: radial-gradient(50% 70% at 50% 100%, rgba(37,99,235,0.28), transparent 70%);
}
.kp-kontakt__inner {
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}
.kp-kontakt .kp-mono { letter-spacing: 0.18em; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .kp-hero { padding-top: 104px; }
  .kp-log__body { flex-direction: column; }
  /* Projektliste wird zur horizontal scrollbaren Chip-Leiste */
  .kp-log__tabs {
    flex: none;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
  }
  .kp-tab { flex: 0 0 auto; padding: 10px 12px; }
  .kp-log__out { padding: 22px 20px; min-height: 300px; }
  .kp-split { gap: 40px; }
}
@media (max-width: 600px) {
  .kp-log__lines { font-size: 13px; }
  .kp-log__line { grid-template-columns: 2.2em 1fr; row-gap: 2px; }
  .kp-log__v { grid-column: 2; }
  .kp-log__live { display: none; }
  .kp-btns .btn { white-space: normal; text-align: center; justify-content: center; }
  .kp-demo .btn { width: 100%; justify-content: center; }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .kp-log__line { animation: none; }
  .kp-caret { animation: none; }
  .kp-log__progress { display: none; }
  .kp-marquee .marquee-track { animation: none; }
  .kp-hex, .kp-tab { transition: none; }
}
