:root {
  color-scheme: light dark; /* Browser-UI passt sich an */
}

/* Dark Theme (Default) */
[data-theme="dark"] {
  --bg: #0f0f13;
  --fg: #eaeaf0;
  --muted: #a6a8ad;
  --card: #1a1a22;
  --border: #2a2a33;
  --brand: #38bdf8;   /* Türkis */
  --accent: #a78bfa;  /* Lila */
}

/* Light Theme */
[data-theme="light"] {
  --bg: #f7f7fb;
  --fg: #0b0b0d;
  --muted: #4b5563;
  --card: #ffffff;
  --border: #e5e7eb;
  --brand: #0ea5e9;
  --accent: #7c3aed;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; font:16px/1.6 system-ui,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial; background:var(--bg); color:var(--fg); }

.container { max-width:1100px; margin:0 auto; padding:1.5rem; }

h1,h2,h3 { font-weight:600; line-height:1.2; }
h1 { font-size:2.4rem; margin:.5rem 0 1rem; }
h2 { font-size:1.8rem; margin:1.5rem 0 1rem; }
h3 { font-size:1.3rem; margin:.8rem 0 .4rem; }
p { margin:.4rem 0 1rem; }

a { color:var(--brand); text-decoration:none; }
a:hover { text-decoration:underline; }

/* Header & Nav */
.site-header { background:var(--card); border-bottom:1px solid var(--border); position:relative; z-index:10; }
.site-header .brand { font-weight:700; font-size:1.3rem; color:var(--fg); text-decoration:none; }
.site-header .tag { color:var(--muted); margin-left:.6rem; font-size:.9rem; }

.nav { background:var(--card); border-bottom:1px solid var(--border); }
.nav a { color:var(--muted); margin-right:1.2rem; padding:.8rem 0; display:inline-block; }
.nav a.active, .nav a:hover { color:var(--fg); }

/* Hero */
.hero { text-align:center; padding:3rem 1rem; }
.hero p { color:var(--muted); margin-bottom:1.5rem; }
.cta { display:flex; justify-content:center; gap:1rem; flex-wrap:wrap; }

/* Buttons */
.btn { background:var(--brand); border:0; padding:.7rem 1.2rem; border-radius:.8rem; color:#001018; font-weight:600; cursor:pointer; text-decoration:none; transition:.2s; }
.btn:hover { transform:translateY(-2px); box-shadow:0 4px 12px rgba(56,189,248,.4); }
.btn.ghost { background:transparent; border:1px solid var(--brand); color:var(--brand); }
.btn.ghost:hover { background:rgba(56,189,248,.1); }
.btn.small { padding:.45rem .7rem; font-size:.9rem; }

/* Stats */
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:1rem; margin-top:2rem; }
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.2rem;
  border-radius: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform .2s, box-shadow .2s;
}
.stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(167,139,250,.3);
}
.stat strong { font-size:1.5rem; display:block; margin-bottom:.3rem; }



/* Cards */
.cards { display:grid; gap:1.2rem; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); align-items: stretch; }
.card { background:var(--card); border:1px solid var(--border); padding:1.2rem; border-radius:1rem; transition:.2s; display:flex; flex-direction:column; gap:.8rem; min-height:100%; }
.card:hover { transform:translateY(-3px); box-shadow:0 4px 16px rgba(167,139,250,.3); }
.card h3 { margin:.2rem 0 .2rem; line-height:1.25; }
.card p { margin:0 0 .4rem; }
.tags { list-style:none; display:flex; flex-wrap:wrap; gap:.4rem; padding:0; margin:.2rem 0 .4rem; }
.tag { font-size:.9rem; color:var(--muted); border:1px solid var(--border); padding:.15rem .55rem; border-radius:.5rem; }

/* Timeline */
.timeline { list-style:none; padding:0; margin:1.5rem 0; border-left:2px solid var(--border); }
.timeline li { padding:0 0 1rem 1rem; position:relative; }
.timeline li::before { content:""; position:absolute; left:-7px; top:.4rem; width:.7rem; height:.7rem; border-radius:50%; background:var(--brand); }
.timeline .t-head { font-weight:600; margin-bottom:.3rem; }

/* Forms */
form { display:grid; gap:1rem; margin-top:1rem; }
input,textarea { background: color-mix(in srgb, var(--card) 90%, var(--bg)); border:1px solid var(--border); color:var(--fg); padding:.6rem .8rem; border-radius:.6rem; }
input:focus,textarea:focus { border-color:var(--brand); outline:none; }

/* Notices */
.notice { margin-top:1rem; padding:.7rem 1rem; border-radius:.6rem; font-weight:500; }
.notice.success { background:#0d2a20; border:1px solid #1f604a; color:#8ef0c1; }
.notice.error { background:#2a0f0f; border:1px solid #602020; color:#f29a9a; }

/* Footer */
.site-footer { border-top:1px solid var(--border); padding:1.2rem 0; color:var(--muted); font-size:.9rem; text-align:center; }

.card .btn { margin-top:auto; align-self:flex-start; }

/* --- Stat accents (farbige Ränder) --- */
.stat--brand  { border-color: var(--brand); }
.stat--accent { border-color: var(--accent); }
.stat--muted  { border-color: var(--border); }

/* --- Testimonials --- */
.testimonials { padding: 1rem 0 2rem; }
.testimonials h2 { text-align:center; margin:.5rem 0 1rem; }
.t-grid { display:grid; gap:1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.t-card { background: var(--card); border:1px solid var(--border); border-radius:1rem; padding:1rem 1.2rem; margin:0; }
.t-card cite { display:block; margin-top:.6rem; color: var(--muted); font-style: normal; }

/* (Optional) Emoji etwas größer in .stat-Beschriftung */
.stat span { display:block; margin-top:.2rem; opacity:.9; }

/* --- Stat: loading indicator (HTMX) --- */
.stat.htmx-request { position: relative; }
.stat.htmx-request::after {
  content: "";
  position: absolute;
  top: 12px; right: 12px;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.stat.htmx-request > * { opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Testimonials: Sprechblasen-Style --- */
.t-card.t-bubble { position: relative; border-radius: 1rem; }

/* Removed .t-card.t-bubble::after and ::before rules to remove tail */

.t-card.t-bubble {
  background: color-mix(in srgb, var(--card) 92%, var(--brand));
  font-style: italic; 
  transition: transform .2s, box-shadow .2s; 
}
.t-card.t-bubble:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 6px 18px rgba(167,139,250,.25); 
}

/* 2. Karte: Pfeil rechts */
.t-grid .t-card.t-bubble:nth-child(2)::after { left:auto; right:24px; }
.t-grid .t-card.t-bubble:nth-child(2)::before { left:auto; right:25px; }

/* 3. Karte: Pfeil mittig */
.t-grid .t-card.t-bubble:nth-child(3)::after { left:50%; transform:translateX(-50%); }
.t-grid .t-card.t-bubble:nth-child(3)::before { left:50%; transform:translateX(-50%); }

/* Zitattext von cite bleibt normal */
.t-card.t-bubble cite { font-style: normal; }