/*
 * MBC Marketing — Layout, Atome, Mockups, Animationen
 * Designsprache: Sodium (docs/design/*). Atome (.btn, .pill, .chip, .card-elevated,
 * .stats/.stat, .section-label) sind aus src/styles/_sodium-atoms.scss übernommen.
 *
 * Bewusste Marketing-Abweichungen (siehe marketing/README.md):
 *  - größere Heading-Skala im Hero/Sektionskopf (App: h1 = 36 px)
 *  - Body 15 px statt 14 px (Lesetext)
 *  - CSS-Animationen in den Mockups (App: nur Pulse + Spin). Alle Animationen
 *    laufen erst, wenn der Block sichtbar ist (.in-view) und respektieren
 *    prefers-reduced-motion (Endzustand statt Bewegung).
 */

/* ============ BASE ============ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topnav-height) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg-2);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img,
svg { display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
strong, b { font-weight: 700; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ============ A11Y ============ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-card);
  color: var(--fg);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform 0.15s;
}
.skip-link:focus,
.skip-link:focus-visible { transform: translateY(0); }

/* ============ ICONS (Carbon-Inline via <use>) ============ */
.ico {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}
.ico-16 { width: 16px; height: 16px; }
.ico-24 { width: 24px; height: 24px; }

/* ============ ATOM: BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--radius);
  border: 2px solid transparent;
  background: transparent;
  color: var(--fg);
  letter-spacing: 0.02em;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
  cursor: pointer;
}
.btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.btn .ico { width: 16px; height: 16px; }

.btn-primary { border-color: var(--accent); color: var(--fg); }
.btn-primary:hover { background: var(--accent); color: var(--on-accent); }
.btn-primary:active { background: var(--accent-active); color: #fff; }

.btn-solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.btn-ghost { border-color: var(--border-2); color: var(--fg-2); }
.btn-ghost:hover { border-color: var(--fg); color: var(--fg); }

.btn-sm { padding: 6px 10px; font-size: 11px; letter-spacing: 0.04em; }
.btn-lg { padding: 14px 20px; font-size: 14px; }

/* ============ ATOM: PILLS ============ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  background: var(--status-offline-bg);
  color: var(--fg-3);
  white-space: nowrap;
}
.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill-online { background: var(--status-online-bg); color: var(--status-online); }
.pill-online::before { animation: pulse 1.6s ease-in-out infinite; }
.pill-info { background: var(--status-info-bg); color: var(--status-info); }
.pill-accent { background: var(--accent-dim); color: var(--accent-active); }

/* ============ ATOM: CHIPS ============ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  background: var(--bg-alt);
  color: var(--fg-3);
  border-radius: var(--radius);
  border: 1px solid transparent;
  white-space: nowrap;
}
[data-theme='dark'] .chip { background: #1f1f1f; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-accent { color: var(--accent-active); background: var(--accent-dim); }
.chip-info { color: var(--status-info); background: var(--status-info-bg); }
.chip-online { color: var(--status-online); background: var(--status-online-bg); }
.chip-warn { color: var(--status-warn); background: var(--status-warn-bg); }
.chip-outline { background: transparent; border-color: var(--border-2); }

/* ============ ATOM: CARDS ============ */
.card-elevated {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head .label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-4);
}
.card-body { padding: 20px; }

/* ============ ATOM: SECTION LABEL ============ */
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-4);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.section-label::before {
  content: '';
  width: 12px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ============ ATOM: STATS ============ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}
.stat {
  background: var(--bg-card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0 -1px -1px 0;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-4);
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  font-feature-settings: 'tnum';
  letter-spacing: -0.01em;
  color: var(--fg);
  line-height: 1.1;
  margin-top: var(--space-xs);
}
.stat-delta {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 2px;
  color: var(--fg-4);
}
.stat.accent::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ============ ATOM: TILE-ICON ============ */
.tile-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--fg-3);
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
[data-theme='dark'] .tile-icon { background: #1f1f1f; }

/* ============ ZAHLEN ============
 * Zielwert steht in --n (inline), Verzögerung in --d. js/app.js zählt beim
 * Einblenden hoch (textContent). Ohne JS rendert der CSS-Counter den Endwert. */
.num { font-feature-settings: 'tnum'; }
@counter-style pad3 {
  system: extends decimal;
  pad: 3 '0';
}
.no-js .num { counter-reset: n var(--n); }
.no-js .num::after { content: counter(n); }
.no-js .num.pad3::after { content: counter(n, pad3); }

/* ============ TOPNAV ============ */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topnav-height);
  background: var(--bg-chrome);
  color: var(--fg-on-dark);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: 0 var(--page-pad-x);
  z-index: 50;
  border-bottom: 1px solid #1a1a1a;
}
.topnav-logo {
  position: relative;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 14px;
  color: var(--accent);
  padding-left: 12px;
  line-height: 1;
}
.topnav-logo::before {
  content: '';
  position: absolute;
  left: 0;
  top: -5px;
  bottom: -5px;
  width: 3px;
  background: var(--accent);
}
.topnav-items {
  display: flex;
  gap: var(--space-xl);
  flex: 1;
  margin-left: var(--space-md);
  height: 100%;
}
.topnav-item {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.topnav-item:hover { color: #fff; }
.topnav-item.active { color: #fff; border-bottom-color: var(--accent); }
.topnav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.topnav .btn-primary { color: #fff; }
.topnav .btn-primary:hover { color: var(--on-accent); }

.topnav-iconbtn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: #bbb;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 0;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.topnav-iconbtn:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.topnav-iconbtn[aria-expanded='true'] { color: #fff; border-color: var(--accent); }
.topnav-iconbtn:focus-visible { outline-color: var(--accent); }

/* Theme-Toggle: zeigt das Icon des Ziel-Themes */
.theme-toggle .ico-sun { display: none; }
[data-theme='dark'] .theme-toggle .ico-sun { display: block; }
[data-theme='dark'] .theme-toggle .ico-moon { display: none; }

.topnav-hamburger { display: none; }

/* ============ AKZENT-PICKER (Popover) ============ */
.accent-picker { position: relative; }
.accent-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 272px;
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border-2);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  z-index: 60;
}
.accent-pop[hidden] { display: none; }
.accent-pop p { font-size: 13px; color: var(--fg-3); }

.swatches { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.swatch {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  background: var(--sw);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.12s, border-color 0.12s;
}
.swatch:hover { transform: translateY(-1px); }
.swatch[aria-checked='true'] { border-color: var(--fg); }
.swatch[aria-checked='true']::after {
  content: '';
  position: absolute;
  inset: 2px;
  border: 2px solid var(--bg-card);
  border-radius: 1px;
}

.custom-accent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  font-size: 13px;
  color: var(--fg-3);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}
.custom-accent input[type='color'] {
  width: 48px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--border-2);
  background: var(--bg-card);
  border-radius: var(--radius);
  cursor: pointer;
}
.custom-accent .mono { font-family: var(--font-mono); font-size: 11px; color: var(--fg-4); }

/* ============ MOBILE DRAWER ============ */
.nav-drawer {
  position: fixed;
  top: var(--topnav-height);
  left: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--bg-chrome);
  color: #fff;
  z-index: 45;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  padding: var(--space-lg) 0 var(--space-xl);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid #1f1f1f;
  visibility: hidden;
}
.nav-drawer.open { transform: none; visibility: visible; }
.drawer-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px var(--space-xl);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bbb;
  border-left: 2px solid transparent;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.drawer-link:hover,
.drawer-link.active { color: #fff; border-left-color: var(--accent); background: #141414; }
.drawer-link .ico { width: 16px; height: 16px; color: #8a8a8a; }
.drawer-link.active .ico,
.drawer-link:hover .ico { color: var(--accent); }
.drawer-foot {
  margin-top: auto;
  padding: var(--space-xl) var(--space-xl) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  border-top: 1px solid #1f1f1f;
}
.drawer-foot .section-label { color: #8a8a8a; }
.drawer-foot .btn-primary { color: #fff; justify-content: center; }
.drawer-foot .btn-primary:hover { color: var(--on-accent); }

.drawer-backdrop {
  position: fixed;
  inset: var(--topnav-height) 0 0 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 44;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

/* ============ LAYOUT ============ */
main { padding-top: var(--topnav-height); }

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--page-pad-x);
}

.section { padding: var(--section-pad) 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
[data-theme='dark'] .section-alt { background: #0f0f0f; }

.section-head { max-width: 760px; margin-bottom: var(--space-3xl); }
.section-head h2 {
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--fg);
  margin-top: var(--space-md);
}
.lead {
  margin-top: var(--space-lg);
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-3);
}
.lead a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* ============ HERO ============ */
.hero {
  position: relative;
  padding: calc(var(--section-pad) * 0.85) 0 var(--section-pad);
  overflow: clip;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.45;
  -webkit-mask-image: radial-gradient(ellipse at 72% 45%, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse at 72% 45%, #000 20%, transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 10fr);
  gap: var(--space-3xl);
  align-items: center;
}
.hero-crumb {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-4);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.hero-crumb .sep { color: var(--fg-5); }
.hero-crumb .cur { color: var(--accent-active); }
.hero h1 {
  font-size: clamp(40px, 5.8vw, 72px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--fg);
  margin-top: var(--space-lg);
}
.hero h1 em {
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.12em;
}
.hero .lead { font-size: 18px; max-width: 560px; margin-top: var(--space-xl); }
.hero-actions {
  margin-top: var(--space-2xl);
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.hero-chips { margin-top: var(--space-xl); }
.hero-note {
  margin-top: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-4);
}
.hero-visual { position: relative; }
.hero-visual .mock { max-width: 580px; margin-left: auto; }

/* ============ STATS-BAND ============ */
.stats-band { padding: 0 0 var(--section-pad); }

/* ============ MOCK (Mini-App-Fenster) ============ */
.mock {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 11px;
  line-height: 1.3;
  color: var(--fg-2);
  position: relative;
  min-width: 0;
}
.mock-bar {
  height: 32px;
  background: var(--bg-chrome);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
}
.mock-logo {
  position: relative;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding-left: 8px;
  line-height: 1;
}
.mock-logo::before {
  content: '';
  position: absolute;
  left: 0;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--accent);
}
.mock-nav { display: flex; gap: 12px; height: 100%; }
.mock-nav i {
  display: inline-flex;
  align-items: center;
  font-style: normal;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8a8a;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.mock-nav i.on { color: #fff; border-bottom-color: var(--accent); }
.mock-bar .m-avatar {
  margin-left: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: #1a1a1a;
}
.mock-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mock-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.mock-crumb {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.mock-crumb b { color: var(--accent-active); font-weight: 700; }
.mock-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-top: 2px;
}
.mock-sub { font-size: 9.5px; color: var(--fg-3); margin-top: 2px; }

.m-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.m-stat {
  padding: 8px 10px;
  border-right: 1px solid var(--border);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-card);
  min-width: 0;
}
.m-stat:last-child { border-right: 0; }
.m-stat.accent::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}
.m-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--fg);
  font-feature-settings: 'tnum';
  line-height: 1.1;
  white-space: nowrap;
}
.m-value.ok { color: var(--status-online); }
.m-value.acc { color: var(--accent-active); }
.m-delta {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--fg-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  min-width: 0;
}
.m-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}
.m-card-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.m-rows { display: flex; flex-direction: column; position: relative; }
.m-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.m-row:last-child { border-bottom: 0; }
.m-row .ico { width: 12px; height: 12px; color: var(--fg-3); }
.m-name {
  font-weight: 600;
  color: var(--fg);
  font-size: 11px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--fg-4);
  white-space: nowrap;
}
.m-meta.neg { color: var(--fg-2); }
.m-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.m-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  background: var(--status-offline-bg);
  color: var(--fg-3);
  white-space: nowrap;
  line-height: 1.2;
}
.m-pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.m-pill.online { background: var(--status-online-bg); color: var(--status-online); }
.m-pill.online::before { animation: pulse 1.6s ease-in-out infinite; }
.m-pill.warn { background: var(--status-warn-bg); color: var(--status-warn); }
.m-pill.info { background: var(--status-info-bg); color: var(--status-info); }
.m-pill.accent { background: var(--accent-dim); color: var(--accent-active); }
.m-pill.plain::before { display: none; }

.m-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--fg-3);
  white-space: nowrap;
  line-height: 1.3;
}
[data-theme='dark'] .m-chip { background: #1f1f1f; }
.m-chip .ico { width: 10px; height: 10px; color: currentColor; }
.m-chip.tag-accent { background: var(--accent-dim); color: var(--accent-active); }
.m-chip.tag-info { background: var(--status-info-bg); color: var(--status-info); }
.m-chip.tag-warn { background: var(--status-warn-bg); color: var(--status-warn); }
.m-chip.tag-online { background: var(--status-online-bg); color: var(--status-online); }

.m-progress {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.m-progress > i {
  display: block;
  height: 100%;
  background: var(--accent);
  width: var(--w, 60%);
  transform-origin: left center;
}
.m-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  font-size: 9.5px;
}
.m-kv dt { color: var(--fg-3); }
.m-kv dd { margin: 0; font-family: var(--font-mono); color: var(--fg); text-align: right; }

.m-section-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-4);
  display: flex;
  align-items: center;
  gap: 6px;
}
.m-section-label::before { content: ''; width: 10px; height: 1px; background: var(--accent); }

.m-spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 26px;
  min-width: 0;
}
.m-spark i {
  flex: 1;
  background: var(--accent);
  height: var(--h, 50%);
  transform-origin: bottom center;
  border-radius: 1px;
}
.m-spark.dim i { background: var(--fg-5); }

/* Hero-Mock: wandernde Auswahl in der Liste */
.hero-list .m-sel {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 30px;
  background: var(--bg-alt);
  border-left: 2px solid var(--accent);
  pointer-events: none;
}
[data-theme='dark'] .hero-list .m-sel { background: #1a1a1a; }
.hero-list .m-row { z-index: 1; }
.in-view .hero-list .m-sel { animation: hero-select 10s steps(1, end) infinite; }
.in-view .m-spark i { animation: spark 2.2s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -0.37s); }
.in-view .m-spark.once i { animation: grow-y 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 0.06s); }
.in-view .m-progress > i { animation: grow-x 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--d, 0.3s); }

/* Generische Einblend-Sequenzen: Verzögerung je Element über --d */
.in-view .a-pop { animation: pop 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--d, 0s); }
.in-view .a-fade { animation: fade-in 0.4s ease both; animation-delay: var(--d, 0s); }
.in-view .a-slide { animation: slide-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--d, 0s); }
.in-view .a-grow-y { animation: grow-y 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--d, 0s); transform-origin: bottom center; }
.in-view .a-grow-x { animation: grow-x 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--d, 0s); transform-origin: left center; }
.in-view .a-hide { animation: hold-hide 1s linear both; animation-duration: var(--d, 1s); }

/* ---- Gym-Mock ---- */
.m-set {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 16px;
  gap: 6px;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--fg-2);
}
.m-set:last-child { border-bottom: 0; }
.m-set.head { color: var(--fg-4); font-size: 8px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; height: 24px; background: var(--bg-alt); }
[data-theme='dark'] .m-set.head { background: #1a1a1a; }
.m-set .idx { color: var(--fg-4); }
.m-set .pr { display: inline-flex; align-items: center; gap: 3px; color: var(--accent-active); font-weight: 700; }
.m-set .pr .ico { width: 10px; height: 10px; }
.m-set.open { color: var(--fg-4); }
.m-check {
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--on-accent);
}
.m-check .ico { width: 10px; height: 10px; }
.m-check.todo { background: transparent; border-color: var(--border-strong); color: transparent; }
.in-view .m-check.a-check { animation: check-in 0.01s linear both; animation-delay: var(--d, 0s); }

.m-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}
.m-ring { width: 48px; height: 48px; flex-shrink: 0; }
.m-ring circle { fill: none; stroke-width: 4; }
.m-ring .track { stroke: var(--border); }
.m-ring .fill {
  stroke: var(--accent);
  stroke-linecap: butt;
  stroke-dasharray: 125.6;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: center;
}
.in-view .m-ring .fill { animation: ring-drain 9s linear infinite; }
.m-timer-val { font-size: 16px; font-weight: 700; color: var(--fg); font-feature-settings: 'tnum'; line-height: 1.1; }

/* ---- Finanz-Mock ---- */
.m-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 70px;
  padding: 0 2px;
  border-bottom: 1px solid var(--border);
}
.m-bars i {
  flex: 1;
  background: var(--fg-5);
  height: var(--h, 50%);
  transform-origin: bottom center;
  position: relative;
}
.m-bars i.cur { background: var(--accent); }
.m-bars-x {
  display: flex;
  gap: 6px;
  padding: 4px 2px 0;
}
.m-bars-x span {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: var(--fg-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.m-bars-x span.cur { color: var(--accent-active); font-weight: 700; }

/* ---- Lager-Mock ---- */
.m-tree { display: flex; flex-direction: column; padding: 4px 0; }
.m-node {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  padding-left: calc(10px + var(--lvl, 0) * 14px);
  font-size: 10.5px;
  color: var(--fg-2);
  position: relative;
}
.m-node .ico { width: 11px; height: 11px; color: var(--fg-4); }
.m-node .cnt { margin-left: auto; font-family: var(--font-mono); font-size: 8.5px; color: var(--fg-4); }
.m-node.sel { background: var(--bg-alt); color: var(--fg); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
[data-theme='dark'] .m-node.sel { background: #1a1a1a; }
.m-qr {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  position: relative;
  color: var(--fg);
  overflow: hidden;
  border: 1px solid var(--border);
  padding: 4px;
  background: var(--bg-card);
}
.m-qr .ico { width: 100%; height: 100%; }
.m-qr::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  opacity: 0.9;
}
.in-view .m-qr::after { animation: scanline 2.4s ease-in-out infinite; }
.m-item-hero {
  display: flex;
  gap: 10px;
  align-items: center;
}
.m-item-hero > div { min-width: 0; flex: 1; }
.m-item-hero .m-title { font-size: 12px; font-weight: 700; color: var(--fg); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-item-hero .m-meta { white-space: normal; }
.m-split { display: flex; flex-direction: column; gap: 4px; }
.m-split-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
}
.m-split-row .bar { flex: 1; height: 4px; background: var(--border); border-radius: var(--radius); overflow: hidden; }
.m-split-row .bar i { display: block; height: 100%; width: var(--w); background: var(--accent); transform-origin: left center; }
.m-split-row .qty { font-family: var(--font-mono); font-size: 9px; color: var(--fg); width: 36px; text-align: right; }
.m-split-row .loc { color: var(--fg-3); width: 64px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Grow-Mock ---- */
.m-phases { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); padding: 6px 0 2px; }
.m-phases::before {
  content: '';
  position: absolute;
  left: calc(100% / 12);
  right: calc(100% / 12);
  top: 11px;
  height: 1px;
  background: var(--border);
}
.m-phases .line {
  position: absolute;
  left: calc(100% / 12);
  /* Breite = (aktuelle Phase - 1) * 2 / 12 der Gesamtbreite, inline über --w */
  width: var(--w, 50%);
  top: 11px;
  height: 1px;
  background: var(--accent);
  transform-origin: left center;
}
.in-view .m-phases .line { animation: grow-x 1.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.m-phase { display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; min-width: 0; }
.m-phase .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  position: relative;
  z-index: 1;
}
.m-phase.done .dot { background: var(--accent); border-color: var(--accent); }
.m-phase.cur .dot { background: var(--bg-card); border: 2px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.in-view .m-phase.cur .dot { animation: pulse 1.6s ease-in-out infinite; }
.m-phase span {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.m-phase.cur span { color: var(--fg); font-weight: 700; }
.m-plant {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-active);
  background: var(--accent-dim);
  border-radius: var(--radius);
}
.m-plant .ico { width: 34px; height: 34px; transform-origin: bottom center; }
.in-view .m-plant .ico { animation: sprout 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: 0.2s; }
.m-meter { display: flex; flex-direction: column; gap: 3px; }
.m-meter-row { display: flex; align-items: center; gap: 8px; font-size: 9.5px; }
.m-meter-row .k { color: var(--fg-3); width: 44px; }
.m-meter-row .bar { flex: 1; height: 4px; background: var(--border); border-radius: var(--radius); overflow: hidden; }
.m-meter-row .bar i { display: block; height: 100%; width: var(--w, 50%); background: var(--accent); transform-origin: left center; }
.m-meter-row .v { font-family: var(--font-mono); font-size: 9px; color: var(--fg); width: 44px; text-align: right; }
.in-view .m-meter-row .bar i.live { animation: meter 3.2s ease-in-out infinite alternate; }

/* ---- IoT-Mock ---- */
.m-dev { display: grid; grid-template-columns: 14px minmax(0, 1fr) 72px auto; gap: 8px; align-items: center; height: 34px; padding: 0 10px; border-bottom: 1px solid var(--border); }
.m-dev:last-child { border-bottom: 0; }
.m-dev .ico { width: 12px; height: 12px; color: var(--fg-3); }
.m-dev .m-spark { height: 18px; }
.m-dev .m-name { font-family: var(--font-mono); font-weight: 500; font-size: 10px; }
.m-dev .m-pill.flip { position: relative; }
.m-dev .swap { position: relative; display: inline-grid; }
.m-dev .swap > * { grid-area: 1 / 1; }
.m-dev .swap .was { opacity: 0; }
.in-view .m-dev .swap .was { animation: hold-hide 2.6s linear both; }
.in-view .m-dev .swap .now { animation: fade-in 0.3s ease both; animation-delay: 2.6s; }
.m-dev .m-spark.offline i { background: var(--fg-5); }

/* ---- Trade-Mock ---- */
.m-lesson { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-bottom: 1px solid var(--border); font-size: 10.5px; }
.m-lesson:last-child { border-bottom: 0; }
.m-lesson .no { font-family: var(--font-mono); font-size: 9px; color: var(--fg-4); width: 14px; }
.m-lesson .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg); font-weight: 600; }
.m-lesson .swap { display: inline-grid; width: 14px; height: 14px; }
.m-lesson .swap > * { grid-area: 1 / 1; width: 14px; height: 14px; }
.m-lesson .swap .was { opacity: 0; color: var(--fg-4); }
.m-lesson .swap .now { color: var(--accent-active); }
.in-view .m-lesson .swap .was { animation: hold-hide 1.6s linear both; }
.in-view .m-lesson .swap .now { animation: pop 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: 1.6s; }
.m-lesson .done { color: var(--status-online); width: 14px; height: 14px; }
.m-candles {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 78px;
  padding: 6px 4px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.m-candles::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px dashed var(--border);
}
.m-candle {
  flex: 1;
  position: relative;
  height: 100%;
  min-width: 0;
}
.m-candle i {
  position: absolute;
  left: 50%;
  width: 60%;
  transform: translateX(-50%);
  bottom: var(--b, 20%);
  height: var(--hh, 20%);
  background: var(--status-online);
  transform-origin: bottom center;
}
.m-candle i::before {
  content: '';
  position: absolute;
  left: 50%;
  width: 1px;
  top: -5px;
  bottom: -5px;
  background: inherit;
  transform: translateX(-50%);
}
.m-candle.down i { background: var(--status-error); }
.in-view .m-candle i { animation: candle 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(0.9s + var(--i, 0) * 0.14s); }
.m-price { display: flex; justify-content: space-between; padding-top: 5px; font-family: var(--font-mono); font-size: 8.5px; color: var(--fg-4); }
.m-price b { color: var(--status-online); font-weight: 700; }

/* ---- Kegeln-Mock ---- */
.m-score { display: grid; grid-template-columns: 20px minmax(0, 1fr) 48px; gap: 8px; align-items: center; height: 30px; padding: 0 10px; border-bottom: 1px solid var(--border); }
.m-score:last-child { border-bottom: 0; }
.m-score .rank { font-family: var(--font-mono); font-size: 9px; color: var(--fg-4); }
.m-score .m-name { font-size: 10.5px; }
.m-score .pts { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--fg); text-align: right; }
.m-score.lead .pts { color: var(--accent-active); }
.m-pins {
  display: grid;
  grid-template-columns: repeat(3, 14px);
  grid-template-rows: repeat(3, 14px);
  gap: 7px;
  transform: rotate(45deg);
  margin: 14px auto 12px;
  width: max-content;
}
.m-pins i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--fg-3);
  background: var(--bg-card);
  grid-area: var(--r) / var(--c);
}
.m-pins i.down { background: var(--accent); border-color: var(--accent); }
.in-view .m-pins i.down { animation: topple 0.01s linear both; animation-delay: var(--d, 0s); }
.m-sync { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.m-sync .swap { display: inline-grid; }
.m-sync .swap > * { grid-area: 1 / 1; }
.m-sync .s1 { opacity: 0; }
.m-sync .s2 { opacity: 0; }
.in-view .m-sync .s1 { animation: hold-hide 2.8s linear both; }
.in-view .m-sync .s2 { animation: window 4s linear both; }
.in-view .m-sync .s3 { animation: fade-in 0.3s ease both; animation-delay: 4s; }
.in-view .m-sync .s2 .ico { animation: spin 0.9s linear infinite; }
.m-sync .ico { width: 12px; height: 12px; }

/* ============ KEYFRAMES ============ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(0.92); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-8px); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }
/* Halte-/Fenster-Kurven linear mit 99.9%-Stufe: steps(1, end) laeuft in Chrome bei
 * Delays wie 2.3s auf einen Endfortschritt von 0.999... und bleibt im Startzustand haengen. */
@keyframes hold-hide { 0%, 99.9% { opacity: 1; } 100% { opacity: 0; } }
@keyframes window { 0%, 69.9% { opacity: 0; } 70%, 99.9% { opacity: 1; } 100% { opacity: 0; } }
@keyframes check-in {
  from { background: transparent; border-color: var(--border-strong); color: transparent; }
}
@keyframes spark { from { transform: scaleY(0.25); } }
@keyframes hero-select {
  0%, 100% { transform: translateY(0); }
  20% { transform: translateY(30px); }
  40% { transform: translateY(60px); }
  60% { transform: translateY(90px); }
  80% { transform: translateY(120px); }
}
@keyframes ring-drain {
  0%, 30% { stroke-dashoffset: 0; }
  90%, 100% { stroke-dashoffset: 125.6; }
}
@keyframes scanline {
  0% { transform: translateY(0); }
  100% { transform: translateY(56px); }
}
@keyframes sprout { from { transform: scale(0.45); opacity: 0.4; } }
@keyframes meter { from { transform: scaleX(0.82); } }
@keyframes candle { from { transform: translateX(-50%) scaleY(0); } to { transform: translateX(-50%) scaleY(1); } }
@keyframes topple { from { background: var(--bg-card); border-color: var(--fg-3); } }

/* ============ ALLTAG (Timeline) ============ */
.alltag-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 64px;
  align-items: start;
}
.timeline { position: relative; display: grid; gap: var(--space-2xl); }
.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--border);
}
.moment {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--space-xl);
}
.moment-dot {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-3);
  position: relative;
  z-index: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.moment.in-view .moment-dot { border-color: var(--accent); color: var(--accent-active); background: var(--accent-dim); }
.moment-time {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-4);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  min-height: 40px;
}
.moment-time .cur { color: var(--accent-active); }
.moment h3 {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--fg);
  margin-top: var(--space-xs);
}
.moment p { margin-top: var(--space-sm); color: var(--fg-3); max-width: 600px; }
.moment .chips { margin-top: var(--space-md); }

.alltag-aside { position: sticky; top: calc(var(--topnav-height) + 24px); }
.alltag-aside .card-body { display: flex; flex-direction: column; gap: var(--space-lg); }
.day-stat {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}
.day-stat:last-child { border-bottom: 0; padding-bottom: 0; }
.day-stat .k { font-size: 13px; color: var(--fg-2); font-weight: 600; }
.day-stat .k small { display: block; font-weight: 400; font-size: 12px; color: var(--fg-4); margin-top: 1px; }
.day-stat .v { font-size: 22px; font-weight: 700; color: var(--fg); font-feature-settings: 'tnum'; white-space: nowrap; }
.day-stat .v small { font-size: 12px; font-weight: 400; color: var(--fg-4); margin-left: 3px; }

/* ============ BEREICHE (Showcases) ============ */
.showcases { display: grid; gap: calc(var(--section-pad) * 0.85); margin-top: var(--space-xl); }
.showcase {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-xl) var(--space-3xl);
  align-items: center;
}
.showcase.flip .showcase-text { order: 2; }
.showcase-text h3 {
  font-size: clamp(24px, 2.7vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--fg);
  margin-top: var(--space-md);
}
.showcase-text .label-row { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.showcase-text > p { margin-top: var(--space-lg); color: var(--fg-3); font-size: 16px; }
.feature-list { margin-top: var(--space-xl); display: grid; gap: var(--space-md); }
.feature-list li {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-3);
}
.feature-list .ico { width: 16px; height: 16px; color: var(--accent-active); margin-top: 3px; }
.feature-list b { color: var(--fg); font-weight: 600; }
.showcase-link { margin-top: var(--space-xl); display: inline-flex; }
.showcase-mock { min-width: 0; }

/* Feature-Reihe: vier Kacheln unter Text + Mockup, ueber beide Spalten */
.feature-row {
  grid-column: 1 / -1;
  order: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-sm);
}
.feature-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
  transition: border-color 0.15s;
}
.feature-tile:hover { border-color: var(--fg); }
.feature-tile:hover .tile-icon { background: var(--accent-dim); color: var(--accent-active); }
/* Kopfzeile: Icon-Kachel (28 px, wie .tile-icon in .detail-meta) neben dem Titel */
.feature-tile-head { display: flex; align-items: center; gap: var(--space-md); min-width: 0; }
.feature-tile .tile-icon { width: 28px; height: 28px; }
.feature-tile .tile-icon .ico { width: 16px; height: 16px; }
.feature-tile strong { font-size: 14px; font-weight: 700; color: var(--fg); letter-spacing: -0.005em; line-height: 1.25; min-width: 0; }
.feature-tile p { font-size: 13px; line-height: 1.5; color: var(--fg-3); }

/* ============ MEHR-GRID + PLATTFORM-GRID ============ */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
}
.tile-grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.tile-card {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: border-color 0.15s;
  min-width: 0;
}
.tile-card:hover { border-color: var(--fg); }
.tile-card:hover .tile-icon { background: var(--accent-dim); color: var(--accent-active); }
.tile-card h3 { font-size: 17px; font-weight: 700; color: var(--fg); letter-spacing: -0.01em; }
.tile-card p { font-size: 14px; color: var(--fg-3); line-height: 1.55; }
.tile-card .chips { margin-top: auto; padding-top: var(--space-sm); }
.tile-card .tile-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }

.more-head { margin-top: calc(var(--section-pad) * 0.85); margin-bottom: var(--space-xl); display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-lg); flex-wrap: wrap; }
.more-head h3 { font-size: 24px; font-weight: 700; color: var(--fg); letter-spacing: -0.015em; margin-top: var(--space-sm); }
.more-head p { color: var(--fg-3); font-size: 14px; max-width: 520px; }

/* Plattform: interaktive Farbkarte */
.theme-demo .swatches { margin-top: var(--space-xs); }
.theme-demo .demo-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; }
.theme-demo .btn .ico { width: 16px; height: 16px; }
.demo-preview {
  margin-top: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg);
}
.demo-preview .m-progress { flex: 1; }
.demo-preview .m-progress > i { animation: none; width: 64%; }

/* ============ CTA ============ */
.cta {
  text-align: center;
  padding: clamp(48px, 7vw, 88px) var(--space-xl);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  background: var(--bg-card);
  position: relative;
  overflow: clip;
}
.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 50%, #000 10%, transparent 70%);
  pointer-events: none;
}
.cta > * { position: relative; }
.cta .section-label { justify-content: center; }
.cta .section-label::before { display: none; }
.cta h2 {
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--fg);
  margin-top: var(--space-md);
}
.cta .lead { max-width: 560px; margin-left: auto; margin-right: auto; }
.cta-actions {
  margin-top: var(--space-2xl);
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0;
  font-size: 13px;
  color: var(--fg-4);
}
.footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: var(--space-lg); }
.footer-brand .topnav-logo { color: var(--accent-active); }
.footer-links { display: flex; gap: var(--space-xl); flex-wrap: wrap; }
.footer-links a {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  transition: color 0.12s;
}
.footer-links a:hover { color: var(--fg); }

/* ============ REVEAL (Einblenden beim Scrollen) ============ */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  transition-delay: var(--rd, 0s);
}
.reveal.in-view { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-2xl); }
  .hero-visual .mock { margin-left: 0; max-width: 640px; }
  .hero::before {
    -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%);
    mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%);
  }
  .alltag-grid { grid-template-columns: 1fr; gap: var(--space-2xl); }
  .alltag-aside { position: static; }
}

@media (max-width: 900px) {
  .showcase { grid-template-columns: 1fr; gap: var(--space-xl); }
  .showcase.flip .showcase-text { order: 0; }
  .showcase-mock { max-width: 640px; }
  .feature-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .feature-row { grid-template-columns: 1fr; gap: var(--space-md); }
}

@media (max-width: 768px) {
  .topnav { gap: var(--space-md); }
  .topnav-items { display: none; }
  .topnav-hamburger { display: inline-flex; }
  .topnav-logo { font-size: 13px; }
  .hero h1 { font-size: clamp(34px, 10vw, 48px); }
  .hero .lead { font-size: 16px; }
  .moment { grid-template-columns: 32px minmax(0, 1fr); gap: var(--space-lg); }
  .moment-dot { width: 32px; height: 32px; }
  .moment-dot .ico { width: 16px; height: 16px; }
  .moment-time { min-height: 32px; }
  .moment h3 { font-size: 19px; }
  .timeline::before { left: 16px; }
  .section-head { margin-bottom: var(--space-2xl); }
  .footer .wrap { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .topnav-app { display: none; }
  .btn-lg { padding: 12px 16px; font-size: 13px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .mock-body { padding: 10px; }
  .m-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .m-grid-2 { grid-template-columns: 1fr; }
  .m-dev { grid-template-columns: 14px minmax(0, 1fr) 56px auto; }
  .cta { padding-left: var(--space-lg); padding-right: var(--space-lg); }
  .cta-actions .btn { flex: 1 1 100%; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  /* Sequenz-Elemente stehen dann sofort im Endzustand */
  .m-dev .swap .was,
  .m-lesson .swap .was,
  .m-sync .s1,
  .m-sync .s2 { display: none; }
}

/* ============ PRINT ============ */
@media print {
  .topnav, .nav-drawer, .drawer-backdrop, .skip-link, .hero::before, .cta::before { display: none !important; }
  main { padding-top: 0; }
  .section { padding: 24px 0; break-inside: avoid; }
  .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { animation: none !important; }
}
