/* Maschenzähler – dunkel, cineastisch, ruhige Bewegung.
   Aufbau: Schriften · Farben · Grundlagen · Hintergrund · Bausteine · Übersicht · Projekt
           · Dialoge & Formulare · Meldungen · Vorstellungsseite · Ansichtswechsel · Bewegung */

/* ---------- Schriften (OFL, liegen in fonts/) ---------- */

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Farben & Bewegungskurven (dunkel ist Standard) ---------- */

:root {
  color-scheme: dark;
  --bg: #0b090a;
  --bg-raise: #161214;
  --glass: rgb(255 255 255 / 0.045);
  --glass-strong: rgb(255 255 255 / 0.08);
  --glass-hover: rgb(255 255 255 / 0.07);
  --hairline: rgb(255 255 255 / 0.09);
  --hairline-strong: rgb(255 255 255 / 0.17);
  --text: #f6efe8;
  --muted: rgb(246 239 232 / 0.64);
  --faint: rgb(246 239 232 / 0.42);
  --accent: #ec5f86;
  --accent-2: #f0a06c;
  --accent-ink: #1c0c12;
  --gradient: linear-gradient(115deg, #ec5f86 0%, #f0a06c 100%);
  --danger: #ff7a6b;
  --card-bg: linear-gradient(180deg, rgb(255 255 255 / 0.065), rgb(255 255 255 / 0.022));
  --stage-bg: rgb(255 255 255 / 0.02);
  --input-bg: rgb(255 255 255 / 0.04);
  --input-bg-focus: rgb(255 255 255 / 0.07);
  --bar-bg: rgb(11 9 10 / 0.72);
  --dock-bg: rgb(26 21 24 / 0.74);
  --dock-solid: #1a1517;
  --sheet-bg: rgb(22 18 20 / 0.9);
  --toast-bg: rgb(34 28 31 / 0.92);
  --hit-hover: rgb(255 255 255 / 0.018);
  --shadow: 0 12px 32px -14px rgb(0 0 0 / 0.7);
  --shadow-lg: 0 34px 90px -24px rgb(0 0 0 / 0.75);
  --backdrop: rgb(5 3 4 / 0.6);
  --blob-1: rgb(236 95 134 / 0.3);
  --blob-2: rgb(240 160 108 / 0.2);
  --blob-3: rgb(126 84 255 / 0.13);
  --grain-opacity: 0.07;
  --yarn-a: #ec5f86;
  --yarn-b: #f0a06c;
  --yarn-needle: rgb(246 239 232 / 0.5);
  --yarn-knob: #f2cc75;
  --yarn-fill: #151013;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23f6efe8' stroke-opacity='.6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  /* Zählerfarben */
  --c1: #f07a9a;
  --c2: #f0a070;
  --c3: #f2cc75;
  --c4: #8fd3a8;
  --c5: #6fcfd6;
  --c6: #b4a5f7;
  --radius: 28px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-odo: cubic-bezier(0.2, 1.15, 0.35, 1);
  --odo-duration: 0.62s;
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  interpolate-size: allow-keywords;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4eee7;
  --bg-raise: #fbf8f4;
  --glass: rgb(255 255 255 / 0.6);
  --glass-strong: rgb(255 255 255 / 0.85);
  --glass-hover: rgb(255 255 255 / 0.8);
  --hairline: rgb(40 20 25 / 0.1);
  --hairline-strong: rgb(40 20 25 / 0.2);
  --text: #1c1416;
  --muted: rgb(28 20 22 / 0.66);
  --faint: rgb(28 20 22 / 0.46);
  --accent: #c2335e;
  --accent-2: #c7652f;
  --accent-ink: #ffffff;
  --gradient: linear-gradient(115deg, #c2335e 0%, #d4743c 100%);
  --danger: #b42318;
  --card-bg: linear-gradient(180deg, rgb(255 255 255 / 0.92), rgb(255 255 255 / 0.7));
  --stage-bg: rgb(255 255 255 / 0.5);
  --input-bg: rgb(28 20 22 / 0.035);
  --input-bg-focus: rgb(255 255 255 / 0.95);
  --bar-bg: rgb(244 238 231 / 0.78);
  --dock-bg: rgb(255 255 255 / 0.76);
  --dock-solid: #ffffff;
  --sheet-bg: rgb(252 249 245 / 0.94);
  --toast-bg: rgb(255 255 255 / 0.94);
  --hit-hover: rgb(40 20 25 / 0.015);
  --shadow: 0 12px 30px -16px rgb(80 40 30 / 0.28);
  --shadow-lg: 0 34px 80px -28px rgb(80 40 30 / 0.3);
  --backdrop: rgb(40 25 20 / 0.32);
  --blob-1: rgb(236 95 134 / 0.2);
  --blob-2: rgb(240 160 108 / 0.24);
  --blob-3: rgb(126 84 255 / 0.08);
  --grain-opacity: 0.04;
  --yarn-a: #c2335e;
  --yarn-b: #d4743c;
  --yarn-needle: rgb(28 20 22 / 0.32);
  --yarn-knob: #d49a2a;
  --yarn-fill: #fbf7f2;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%231c1416' stroke-opacity='.6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  --c1: #c2335e;
  --c2: #b8612c;
  --c3: #95700f;
  --c4: #2f7d52;
  --c5: #1d7a84;
  --c6: #6650b8;
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    color-scheme: light;
    --bg: #f4eee7;
    --bg-raise: #fbf8f4;
    --glass: rgb(255 255 255 / 0.6);
    --glass-strong: rgb(255 255 255 / 0.85);
    --glass-hover: rgb(255 255 255 / 0.8);
    --hairline: rgb(40 20 25 / 0.1);
    --hairline-strong: rgb(40 20 25 / 0.2);
    --text: #1c1416;
    --muted: rgb(28 20 22 / 0.66);
    --faint: rgb(28 20 22 / 0.46);
    --accent: #c2335e;
    --accent-2: #c7652f;
    --accent-ink: #ffffff;
    --gradient: linear-gradient(115deg, #c2335e 0%, #d4743c 100%);
    --danger: #b42318;
    --card-bg: linear-gradient(180deg, rgb(255 255 255 / 0.92), rgb(255 255 255 / 0.7));
    --stage-bg: rgb(255 255 255 / 0.5);
    --input-bg: rgb(28 20 22 / 0.035);
    --input-bg-focus: rgb(255 255 255 / 0.95);
    --bar-bg: rgb(244 238 231 / 0.78);
    --dock-bg: rgb(255 255 255 / 0.76);
    --dock-solid: #ffffff;
    --sheet-bg: rgb(252 249 245 / 0.94);
    --toast-bg: rgb(255 255 255 / 0.94);
    --hit-hover: rgb(40 20 25 / 0.015);
    --shadow: 0 12px 30px -16px rgb(80 40 30 / 0.28);
    --shadow-lg: 0 34px 80px -28px rgb(80 40 30 / 0.3);
    --backdrop: rgb(40 25 20 / 0.32);
    --blob-1: rgb(236 95 134 / 0.2);
    --blob-2: rgb(240 160 108 / 0.24);
    --blob-3: rgb(126 84 255 / 0.08);
    --grain-opacity: 0.04;
    --yarn-a: #c2335e;
    --yarn-b: #d4743c;
    --yarn-needle: rgb(28 20 22 / 0.32);
    --yarn-knob: #d49a2a;
    --yarn-fill: #fbf7f2;
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%231c1416' stroke-opacity='.6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
    --c1: #c2335e;
    --c2: #b8612c;
    --c3: #95700f;
    --c4: #2f7d52;
    --c5: #1d7a84;
    --c6: #6650b8;
  }
}

/* ---------- Grundlagen ---------- */

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

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

.icon {
  flex: none;
  width: 22px;
  height: 22px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Statische Fassung der Vorstellungsseite (index.html) – nur ohne JavaScript sichtbar */
.js .static-intro {
  display: none;
}

.static-intro {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 1rem;
  line-height: 1.6;
}

.static-intro h1,
.static-intro h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.1;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.86rem;
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.view {
  width: 100%;
}

/* ---------- Hintergrund: treibende Farbschleier und Filmkorn ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  view-transition-name: ambient;
}

.ambient i {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.ambient i:nth-child(1) {
  top: -45vmax;
  left: -35vmax;
  width: 85vmax;
  height: 85vmax;
  background: radial-gradient(closest-side, var(--blob-1), transparent 72%);
  animation: drift-a 42s var(--ease-in-out) infinite alternate;
}

.ambient i:nth-child(2) {
  right: -30vmax;
  bottom: -40vmax;
  width: 75vmax;
  height: 75vmax;
  background: radial-gradient(closest-side, var(--blob-2), transparent 72%);
  animation: drift-b 54s var(--ease-in-out) infinite alternate;
}

.ambient i:nth-child(3) {
  top: 35%;
  left: 30%;
  width: 60vmax;
  height: 60vmax;
  background: radial-gradient(closest-side, var(--blob-3), transparent 70%);
  animation: drift-c 64s var(--ease-in-out) infinite alternate;
}

.ambient::after {
  content: "";
  position: absolute;
  inset: -100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  opacity: var(--grain-opacity);
  animation: grain 1.6s steps(8) infinite;
}

@keyframes drift-a {
  to {
    transform: translate3d(22vmax, 18vmax, 0) scale(1.12);
  }
}

@keyframes drift-b {
  to {
    transform: translate3d(-18vmax, -22vmax, 0) scale(1.18);
  }
}

@keyframes drift-c {
  to {
    transform: translate3d(-24vmax, -12vmax, 0) scale(0.85);
  }
}

@keyframes grain {
  0%,
  100% {
    transform: translate(0, 0);
  }
  12.5% {
    transform: translate(-4%, 3%);
  }
  25% {
    transform: translate(3%, -5%);
  }
  37.5% {
    transform: translate(-6%, -2%);
  }
  50% {
    transform: translate(5%, 4%);
  }
  62.5% {
    transform: translate(-2%, 6%);
  }
  75% {
    transform: translate(6%, -3%);
  }
  87.5% {
    transform: translate(-5%, -6%);
  }
}

/* ---------- Typografie ---------- */

.display {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.015em;
}

.display em,
.wordmark em,
.gradient-text {
  /* Kursive ragen etwas über, damit der Verlauf nicht abgeschnitten wird */
  margin-right: -0.08em;
  padding-right: 0.08em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.display em,
.wordmark em {
  font-style: italic;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 550;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Zeilen, die von unten hereingleiten */
.line {
  display: block;
  overflow: hidden;
  margin-bottom: -0.1em;
  padding: 0 0.14em 0.1em 0;
}

.line > span {
  display: inline-block;
}

/* ---------- Bausteine: Knöpfe ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 20px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--glass);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  transition:
    transform 0.45s var(--ease-spring),
    background-color 0.3s,
    border-color 0.3s,
    box-shadow 0.3s,
    filter 0.3s;
}

.btn:hover {
  border-color: var(--hairline-strong);
  background: var(--glass-hover);
}

.btn:active {
  transform: scale(0.96);
}

.btn .icon {
  width: 19px;
  height: 19px;
  transition: transform 0.45s var(--ease-out);
}

.btn-primary {
  border: 0;
  background: var(--gradient);
  color: var(--accent-ink);
  box-shadow:
    0 14px 34px -14px color-mix(in srgb, var(--accent) 80%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 0.3);
}

.btn-primary:hover {
  background: var(--gradient);
  filter: saturate(1.08) brightness(1.04);
}

/* Lichtreflex, der über den Knopf streicht */
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease-out);
}

.btn-primary:hover::after {
  transform: translateX(120%);
}

.btn-primary:hover .icon:last-child {
  transform: translateX(3px);
}

.btn-ghost {
  background: transparent;
}

.btn-lg {
  min-height: 56px;
  padding: 15px 28px;
  font-size: 1.02rem;
}

.btn-sm {
  min-height: 38px;
  padding: 7px 16px;
  font-size: 0.86rem;
}

.btn-danger {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}

.btn-danger-solid {
  border: 0;
  background: var(--danger);
  color: var(--bg);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.magnetic {
  transition:
    transform 0.6s var(--ease-out),
    filter 0.3s,
    box-shadow 0.3s;
}

.icon-btn {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  transition:
    background-color 0.3s,
    border-color 0.3s,
    transform 0.4s var(--ease-spring);
}

.icon-btn:hover {
  border-color: var(--hairline);
  background: var(--glass-hover);
}

.icon-btn:active {
  transform: scale(0.9);
}

.icon-btn.glass {
  border-color: var(--hairline);
  background: var(--glass);
}

.icon-btn .icon {
  width: 21px;
  height: 21px;
}

/* ---------- Kopfzeile & Marke ---------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: calc(env(safe-area-inset-top) + 10px) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.4s,
    border-color 0.4s;
}

body.is-scrolled .home .appbar,
body.is-scrolled .intro-bar {
  border-bottom-color: var(--hairline);
  background: var(--bar-bg);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
  padding: 4px 10px 4px 4px;
  border-radius: 16px;
  text-decoration: none;
}

.brand img {
  border-radius: 10px;
  box-shadow: 0 8px 20px -8px rgb(0 0 0 / 0.6);
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: -0.01em;
}

/* ---------- Übersicht ---------- */

.home-main {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 4px 18px calc(140px + env(safe-area-inset-bottom));
}

.home-hello {
  padding: 22px 4px 32px;
}

.home-title {
  margin: 12px 0 0;
  font-size: clamp(3.2rem, 14vw, 5.8rem);
}

.home-lead {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.project-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-card {
  position: relative;
  display: grid;
  gap: 20px;
  padding: 22px 22px 16px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--hairline);
  border-radius: 28px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition:
    transform 0.55s var(--ease-spring),
    border-color 0.4s;
}

/* Verlaufsrand beim Darüberfahren */
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: var(--gradient);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.45s;
}

/* Lichtkegel, der dem Mauszeiger folgt */
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgb(255 255 255 / 0.07), transparent 65%);
  opacity: 0;
  transition: opacity 0.45s;
}

.project-card:hover::before,
.project-card:hover::after {
  opacity: 1;
}

.project-card:active {
  transform: scale(0.985);
}

.pc-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.pc-name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 6vw, 2.15rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.pc-arrow {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  color: var(--muted);
  transition:
    transform 0.6s var(--ease-out),
    color 0.3s,
    background-color 0.3s,
    border-color 0.3s;
}

.pc-arrow .icon {
  width: 18px;
  height: 18px;
}

.project-card:hover .pc-arrow {
  border-color: transparent;
  background: var(--gradient);
  color: var(--accent-ink);
  transform: rotate(-45deg);
}

.pc-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
}

.pc-stat {
  display: grid;
  gap: 4px;
}

.pc-stat b {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  font-weight: 400;
  line-height: 1;
}

.pc-stat .of {
  color: var(--faint);
  font-size: 0.5em;
}

.pc-stat small {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pc-stat small::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cc);
  box-shadow: 0 0 10px var(--cc);
}

.pc-more {
  align-self: center;
  color: var(--faint);
  font-size: 0.9rem;
}

.pc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 13px;
  border-top: 1px solid var(--hairline);
  color: var(--faint);
  font-size: 0.8rem;
}

.pc-reminders {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pc-reminders .icon {
  width: 14px;
  height: 14px;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 0 12px 40px;
  text-align: center;
}

.empty-art {
  width: min(250px, 62vw);
}

.empty h2 {
  font-size: clamp(2.5rem, 10vw, 3.6rem);
}

.empty p {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
}

.fab {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 17px 28px 17px 22px;
  overflow: hidden;
  isolation: isolate;
  border: 0;
  border-radius: 999px;
  background: var(--gradient);
  color: var(--accent-ink);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  box-shadow:
    0 20px 44px -16px color-mix(in srgb, var(--accent) 85%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 0.35);
  transform: translateX(-50%);
  transition:
    transform 0.5s var(--ease-spring),
    filter 0.3s;
}

.fab::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease-out);
}

.fab:hover {
  filter: saturate(1.08) brightness(1.04);
}

.fab:hover::after {
  transform: translateX(120%);
}

.fab:active {
  transform: translateX(-50%) scale(0.96);
}

.fab .icon {
  transition: transform 0.6s var(--ease-out);
}

.fab:hover .icon {
  transform: rotate(90deg);
}

/* ---------- Projekt ---------- */

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
}

.project .appbar {
  position: relative;
}

.project-title {
  flex: 1;
  min-width: 0;
  margin: 0 2px;
}

.title-btn {
  display: block;
  max-width: 100%;
  padding: 4px 8px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: none;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 6vw, 2.15rem);
  line-height: 1.15;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-btn:hover {
  background: var(--glass-hover);
}

.banners {
  display: grid;
  gap: 10px;
  padding: 0 16px;
}

.banners:not(:empty) {
  padding-bottom: 10px;
}

.banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 8px 12px 12px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 22px;
  background: var(--sheet-bg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  animation: banner-in 0.8s var(--ease-out);
}

.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: var(--gradient);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* einmaliger Lichtreflex */
.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.1) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: sweep 1.6s var(--ease-out) 0.35s;
}

.banner.leaving {
  animation: banner-out 0.38s var(--ease-in-out) forwards;
}

.banner-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: var(--gradient);
  color: var(--accent-ink);
  box-shadow: 0 10px 26px -10px var(--accent);
}

.banner-icon .icon {
  width: 21px;
  height: 21px;
  transform-origin: 50% 10%;
  animation: bell-ring 1.2s var(--ease-out) 0.3s;
}

.banner-target .banner-icon {
  background: linear-gradient(115deg, var(--c4), var(--c5));
  box-shadow: 0 10px 26px -10px var(--c4);
}

.banner-text {
  display: grid;
  flex: 1;
  gap: 1px;
  min-width: 0;
}

.banner-text strong {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.banner-text span {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.counters {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 6px 16px 14px;
  overflow: auto;
  scrollbar-width: none;
}

.counters::-webkit-scrollbar {
  display: none;
}

.counter {
  --cc: var(--c1);
  position: relative;
  display: grid;
  flex: 1 1 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 176px;
  padding: 8px 8px 24px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgb(255 255 255 / 0.06);
  container-type: size;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition:
    transform 0.55s var(--ease-spring),
    border-color 0.6s,
    box-shadow 0.6s;
}

.counter:has(.counter-hit:active) {
  transform: scale(0.985);
  transition-duration: 0.15s;
}

.counter.is-focused {
  border-color: color-mix(in srgb, var(--cc) 45%, var(--hairline));
  box-shadow:
    0 26px 60px -30px color-mix(in srgb, var(--cc) 60%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 0.07);
}

.counter-glow,
.demo-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(58% 62% at 50% 54%, color-mix(in srgb, var(--cc) 17%, transparent), transparent 72%);
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.8s var(--ease-out);
}

.counter.is-focused .counter-glow,
.counter:hover .counter-glow,
.demo-glow {
  opacity: 1;
}

.counter-glow::after,
.demo-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(46% 52% at 50% 54%, color-mix(in srgb, var(--cc) 38%, transparent), transparent 72%);
  opacity: 0;
}

.counter-glow.flash::after,
.demo-glow.flash::after {
  animation: glow-flash 0.9s var(--ease-out);
}

/* Die ganze Karte ist der +1-Knopf. */
.counter-hit {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  touch-action: manipulation;
  transition: background-color 0.3s;
}

.counter-hit:hover {
  background: var(--hit-hover);
}

.counter-hit:focus-visible {
  outline: 2px solid var(--cc);
  outline-offset: -6px;
}

.tap-ring {
  position: absolute;
  z-index: 1;
  overflow: visible;
  fill: none;
  stroke: var(--cc);
  stroke-width: 1.5;
  opacity: 0;
  pointer-events: none;
  animation: tap-ring 0.9s var(--ease-out) forwards;
}

.spark {
  position: absolute;
  z-index: 3;
  width: 8px;
  height: 8px;
  margin: -4px;
  border-radius: 50%;
  background: var(--cc);
  box-shadow: 0 0 12px var(--cc);
  opacity: 0;
  pointer-events: none;
  animation: spark 1.15s var(--ease-out) forwards;
}

.counter-head,
.counter-body,
.counter-hint {
  position: relative;
  z-index: 2;
  min-width: 0;
  pointer-events: none;
}

.counter-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0 0 16px;
}

.counter-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cc);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cc) 16%, transparent);
}

.counter.is-focused .counter-dot {
  animation: dot-pulse 2.6s var(--ease-in-out) infinite;
}

.counter-name {
  flex: 0 1 auto;
  min-width: 3em;
  overflow: hidden;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 3px 9px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 550;
}

.chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip .icon {
  width: 12px;
  height: 12px;
}

/* In schmalen Zählern (Querformat, viele Zähler) hat der Name Vorrang. */
@container (max-width: 340px) {
  .chip span {
    display: none;
  }
}

.counter-edit {
  margin-left: auto;
  color: var(--muted);
  pointer-events: auto;
}

.counter-body {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 66px;
  align-items: center;
  min-height: 0;
}

.counter-minus {
  display: grid;
  justify-self: center;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--glass);
  color: var(--text);
  pointer-events: auto;
  touch-action: manipulation;
  transition:
    transform 0.4s var(--ease-spring),
    background-color 0.3s,
    border-color 0.3s;
}

.counter-minus:hover {
  border-color: var(--hairline-strong);
  background: var(--glass-hover);
}

.counter-minus:active {
  transform: scale(0.86);
}

.counter-center {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
}

.counter-value {
  font-family: var(--font-serif);
  font-size: 4.5rem;
  /* Wächst mit der Karte: in der Höhe bleibt Platz für Kopf, Hinweis und Untertitel (132px),
     in der Breite für den Minus-Knopf. Ein- und zweistellig gleich groß (--len = Stellen). */
  font-size: clamp(3rem, min(100cqh - 132px, calc((100cqw - 150px) / (max(var(--len, 2), 2) * 0.5))), 15rem);
  font-weight: 400;
  line-height: 1;
}

.counter-caption {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
}

.counter-caption:empty {
  display: none;
}

.counter-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2px 20px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.counter-hint:empty {
  display: none;
}

.counter-hint .icon {
  width: 15px;
  height: 15px;
  color: var(--cc);
}

.counter-hint span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.counter-hint b {
  color: var(--text);
  font-weight: 600;
}

.counter-progress {
  position: absolute;
  z-index: 2;
  right: 26px;
  bottom: 12px;
  left: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--hairline);
  pointer-events: none;
}

.counter-progress > span,
.demo-progress > span {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cc) 8%, transparent), var(--cc));
  transition: width 0.8s var(--ease-out);
}

.counter-progress > span::after,
.demo-progress > span::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -4px;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--cc);
  box-shadow: 0 0 14px 2px color-mix(in srgb, var(--cc) 70%, transparent);
}

/* Rollende Ziffern */
.odo {
  display: inline-flex;
  margin-block: -0.16em;
}

.odo-cell {
  position: relative;
  display: block;
  width: 0.5em;
  height: 1.32em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 17%, #000 83%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 17%, #000 83%, transparent 100%);
}

.odo-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.odo-strip > span {
  display: block;
  height: 1.32em;
  line-height: 1.32em;
  text-align: center;
}

.odo.odo-in-up {
  animation: odo-in-up 0.6s var(--ease-out);
}

.odo.odo-in-down {
  animation: odo-in-down 0.6s var(--ease-out);
}

/* ---------- Werkzeug-Dock ---------- */

.dock {
  position: relative;
  z-index: 4;
  display: flex;
  gap: 4px;
  width: min(100% - 24px, 520px);
  margin: 0 auto calc(12px + env(safe-area-inset-bottom));
  padding: 6px;
  border: 1px solid var(--hairline);
  border-radius: 26px;
  background: var(--dock-bg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.tool {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 9px 4px 8px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 550;
  letter-spacing: 0.02em;
  transition:
    color 0.3s,
    background-color 0.3s,
    transform 0.4s var(--ease-spring);
}

.tool-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool:hover {
  background: var(--glass);
  color: var(--text);
}

.tool:active {
  transform: scale(0.93);
}

.tool[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--text);
}

.tool[aria-pressed="true"] .icon {
  color: var(--accent);
}

.tool:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.tool .eq {
  display: none;
}

.tool.live .icon {
  display: none;
}

.tool.live .eq {
  display: flex;
}

.eq {
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 22px;
}

.eq i {
  width: 3px;
  height: 30%;
  border-radius: 3px;
  background: var(--accent);
  animation: eq 1s var(--ease-in-out) infinite;
}

.eq i:nth-child(2) {
  animation-delay: -0.35s;
}

.eq i:nth-child(3) {
  animation-delay: -0.7s;
}

.eq i:nth-child(4) {
  animation-delay: -0.15s;
}

.eq i:nth-child(5) {
  animation-delay: -0.55s;
}

.eq i:nth-child(6) {
  animation-delay: -0.9s;
}

.eq i:nth-child(7) {
  animation-delay: -0.25s;
}

.badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gradient);
  color: var(--accent-ink);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--dock-solid);
}

/* gewünscht, aber vom Browser abgelehnt */
.tool.is-blocked::after {
  content: "";
  position: absolute;
  top: 7px;
  left: calc(50% + 9px);
  width: 9px;
  height: 9px;
  border: 2px solid var(--dock-solid);
  border-radius: 50%;
  background: var(--c3);
}

/* ---------- Dialoge ---------- */

dialog {
  width: min(560px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 30px;
  background: var(--sheet-bg);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(18px) scale(0.97);
}

/* Einblenden per Keyframes statt @starting-style: Der Endzustand ist immer sichtbar,
   auch wo ältere Safari-Versionen die Animation falsch oder gar nicht ausführen. */
dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 1;
  transform: none;
  animation:
    dlg-fade-in 0.35s var(--ease-out),
    dlg-rise 0.55s var(--ease-out);
}

dialog::backdrop {
  background: rgb(0 0 0 / 0);
}

dialog[open]::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: dlg-backdrop-in 0.45s;
}

/* Ausblenden nur, wo Browser das Schließen sicher bis zum Ende animieren (overlay = Chromium).
   Sonst schließt der Dialog ohne Animation – ältere Safari-Versionen ließen ihn sonst unsichtbar hängen. */
@supports (overlay: auto) {
  dialog {
    transition:
      opacity 0.35s var(--ease-out),
      transform 0.55s var(--ease-out),
      overlay 0.55s allow-discrete,
      display 0.55s allow-discrete;
  }

  dialog::backdrop {
    transition:
      background-color 0.45s,
      backdrop-filter 0.45s,
      overlay 0.45s allow-discrete,
      display 0.45s allow-discrete;
  }
}

@keyframes dlg-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes dlg-rise {
  from {
    transform: translateY(18px) scale(0.97);
  }
}

@keyframes dlg-sheet-up {
  from {
    transform: translateY(100%);
  }
}

@keyframes dlg-backdrop-in {
  from {
    background: rgb(0 0 0 / 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
  }
}

dialog.confirm {
  width: min(440px, calc(100vw - 32px));
}

dialog.confirm p {
  margin: 4px 0 6px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 640px) {
  dialog.sheet {
    width: 100%;
    max-height: 92dvh;
    margin: auto 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    border-bottom: 0;
    border-radius: 30px 30px 0 0;
    transform: translateY(100%);
  }

  dialog.sheet[open] {
    transform: none;
    animation:
      dlg-fade-in 0.35s var(--ease-out),
      dlg-sheet-up 0.55s var(--ease-out);
  }

  dialog.sheet .dlg::before {
    content: "";
    flex: none;
    align-self: center;
    width: 42px;
    height: 4px;
    margin-top: 10px;
    border-radius: 4px;
    background: var(--hairline-strong);
  }
}

.dlg {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.dlg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 12px 6px 24px;
}

.dlg-head h2 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 1.95rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dlg-body {
  min-height: 0;
  padding: 10px 24px;
  overflow-y: auto;
}

.dlg-body > p:first-child {
  margin-top: 0;
}

.dlg-body h3 {
  margin: 28px 0 8px;
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.dlg-body h3:first-child {
  margin-top: 6px;
}

.dlg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 24px;
}

.dlg-actions .spacer {
  flex: 1;
}

/* ---------- Formulare ---------- */

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.field > label:not(.choice),
.field > .label,
.field > legend {
  padding: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field > legend {
  margin-bottom: 8px;
}

.hint {
  color: var(--faint);
  font-size: 0.8rem;
  line-height: 1.45;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background-color: var(--input-bg);
  font-size: 1rem;
  transition:
    border-color 0.25s,
    box-shadow 0.25s,
    background-color 0.25s;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

select {
  padding-right: 42px;
  background-image: var(--select-arrow);
  background-position: right 16px center;
  background-repeat: no-repeat;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background-color: var(--input-bg-focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
  outline: none;
}

textarea {
  min-height: 42vh;
  line-height: 1.6;
  resize: vertical;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

details.adv {
  margin: 4px 0 8px;
  padding: 2px 16px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: var(--input-bg);
}

details.adv summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

details.adv summary::-webkit-details-marker {
  display: none;
}

details.adv summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.45s var(--ease-out);
}

details.adv[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

details.adv::details-content {
  block-size: 0;
  overflow: hidden;
  transition:
    block-size 0.55s var(--ease-out),
    content-visibility 0.55s allow-discrete;
}

details.adv[open]::details-content {
  block-size: auto;
}

.choices {
  gap: 10px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 16px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: var(--input-bg);
  cursor: pointer;
  transition:
    border-color 0.3s,
    background-color 0.3s,
    transform 0.4s var(--ease-spring);
}

.choice:active {
  transform: scale(0.985);
}

.choice:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, var(--input-bg));
}

.choice input {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  border: 1.5px solid var(--hairline-strong);
  border-radius: 50%;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.3s;
}

.choice input::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gradient);
  transform: scale(0);
  transition: transform 0.45s var(--ease-spring);
}

.choice input:checked {
  border-color: var(--accent);
}

.choice input:checked::before {
  transform: scale(1);
}

.choice span {
  display: grid;
  gap: 2px;
}

.choice b {
  font-weight: 600;
}

.choice small {
  color: var(--muted);
}

/* Segment-Schalter mit gleitendem Reiter */
.seg {
  --n: 2;
  --idx: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  padding: 4px;
  isolation: isolate;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--input-bg);
}

.seg::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / var(--n));
  border-radius: 12px;
  background: var(--glass-strong);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgb(255 255 255 / 0.08);
  transform: translateX(calc(100% * var(--idx)));
  transition: transform 0.55s var(--ease-out);
}

.seg:has(label:nth-child(2) input:checked) {
  --idx: 1;
}

.seg:has(label:nth-child(3) input:checked) {
  --idx: 2;
}

.seg label {
  position: relative;
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg span {
  display: block;
  padding: 10px 8px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: color 0.3s;
}

.seg input:checked + span {
  color: var(--text);
}

.seg input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
}

.switch span {
  display: grid;
  gap: 2px;
}

.switch b {
  font-weight: 550;
}

.switch small {
  color: var(--faint);
  font-size: 0.8rem;
}

.switch input {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  margin: 0;
  border-radius: 999px;
  background: var(--hairline-strong);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 0.3s;
}

.switch input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.35);
  transition: transform 0.5s var(--ease-spring);
}

.switch input:checked {
  background: var(--gradient);
}

.switch input:checked::before {
  transform: translateX(20px);
}

.menu {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 15px 14px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  font-size: 1.02rem;
  text-align: left;
  transition:
    background-color 0.25s,
    transform 0.4s var(--ease-spring);
}

.menu-item .icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.menu-item:hover {
  background: var(--glass-hover);
}

.menu-item:active {
  transform: scale(0.98);
}

.menu-item.danger,
.menu-item.danger .icon {
  color: var(--danger);
}

.rem-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rem-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 6px 12px 18px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: var(--input-bg);
}

.rem-item div {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.rem-item b {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.rem-item small {
  color: var(--muted);
}

.rem-empty {
  padding: 8px 0;
  color: var(--muted);
}

.preview {
  margin: 4px 0 8px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 8%, var(--input-bg));
  font-size: 0.9rem;
  line-height: 1.6;
}

.warn,
.warn-inline {
  color: var(--danger);
}

.warn {
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent);
  border-radius: 14px;
  font-size: 0.88rem;
}

.cmds {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  margin: 8px 0 14px;
}

.cmds dt {
  font-weight: 600;
}

.cmds dd {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 420px) {
  .cmds {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cmds dd {
    margin-bottom: 10px;
  }
}

.version {
  margin-top: 24px;
  color: var(--faint);
}

/* ---------- Meldungen ---------- */

.toast {
  position: fixed;
  inset: auto auto calc(100px + env(safe-area-inset-bottom)) 50%;
  z-index: 20;
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 11px 20px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--toast-bg);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px) scale(0.96);
  transition:
    opacity 0.35s var(--ease-out),
    transform 0.55s var(--ease-out);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ---------- Vorstellungsseite ---------- */

.intro {
  position: relative;
}

.intro-inner {
  width: min(100% - 36px, 1180px);
  margin-inline: auto;
}

.intro-bar {
  position: fixed;
  inset: 0 0 auto;
  /* bündig mit dem Inhalt (.intro-inner) */
  padding-inline: max(18px, env(safe-area-inset-left), calc((100% - 1180px) / 2));
}

.scroll-progress {
  position: fixed;
  z-index: 12;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--gradient);
  transform: scaleX(var(--progress, 0));
  transform-origin: 0 50%;
}

.hero {
  position: relative;
  display: grid;
  align-items: center;
  gap: 24px 56px;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(env(safe-area-inset-top) + 96px) 0 80px;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  animation: fade-up 0.9s var(--ease-out) 0.1s backwards;
}

.hero-eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--gradient);
}

.hero-title {
  margin: 20px 0 28px;
  font-size: clamp(3.6rem, 13.5vw, 8.6rem);
  line-height: 0.9;
  letter-spacing: -0.025em;
}

.intro .line > span {
  animation: line-up 1.15s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 120ms + 250ms);
}

.hero-lead {
  max-width: 33rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.6vw, 1.2rem);
  line-height: 1.65;
  animation: fade-up 1s var(--ease-out) 0.7s backwards;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
  animation: fade-up 1s var(--ease-out) 0.85s backwards;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 32px 0 0;
  padding: 0;
  color: var(--faint);
  font-size: 0.86rem;
  list-style: none;
  animation: fade-up 1s var(--ease-out) 1s backwards;
}

.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-facts .icon {
  width: 16px;
  height: 16px;
}

.hero-stage {
  position: relative;
  justify-self: center;
  width: min(100%, 540px);
  aspect-ratio: 1 / 1.02;
  transform: translateY(calc(var(--scroll, 0px) * -0.08));
}

.hero-art {
  position: absolute;
  inset: 0 10% 12% 0;
  animation: float 9s var(--ease-in-out) infinite alternate;
}

.hero-stage .demo-card {
  position: absolute;
  right: 0;
  bottom: 2%;
  width: min(60%, 300px);
  animation:
    fade-up 1.2s var(--ease-out) 1.1s backwards,
    float 7s var(--ease-in-out) 2s infinite alternate-reverse;
}

.scroll-cue {
  position: absolute;
  bottom: 22px;
  left: 50%;
  display: none;
  width: 26px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--hairline-strong);
  border-radius: 14px;
  background: none;
  transform: translateX(-50%);
}

.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--text);
  animation: cue 1.9s var(--ease-in-out) infinite;
}

@media (min-width: 960px) and (min-height: 720px) {
  .scroll-cue {
    display: block;
  }
}

/* Wollknäuel */
.yarn {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.yarn .draw {
  fill: none;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linecap: round;
  stroke-width: 2;
  animation: draw 1.9s var(--ease-out) forwards;
  animation-delay: calc(var(--d, 0) * 1ms);
}

.yarn .yarn-outline {
  stroke-width: 2.6;
}

.yarn .yarn-thread {
  stroke-width: 2.4;
  animation-duration: 2.6s;
}

.yarn .yarn-needles line {
  stroke: var(--yarn-needle);
  stroke-width: 6;
}

.yarn .knob {
  fill: var(--yarn-knob);
  transform-box: fill-box;
  transform-origin: center;
  animation: pop 0.7s var(--ease-spring) 0.9s backwards;
}

.yarn-body {
  fill: var(--yarn-fill);
}

.yarn-spin {
  transform-box: view-box;
  transform-origin: 200px 210px;
  animation: spin 90s linear infinite;
}

.yarn-cross {
  opacity: 0.45;
}

.yarn-glow {
  transform-box: fill-box;
  transform-origin: center;
  animation: breathe 7s var(--ease-in-out) infinite alternate;
}

/* Vorschau-Karten der Demos */
.demo-card {
  --cc: var(--c1);
  position: relative;
  display: grid;
  gap: 4px;
  padding: 18px 20px 22px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--hairline);
  border-radius: 26px;
  background: var(--card-bg);
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgb(255 255 255 / 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.demo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.demo-head span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-value {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 4px;
  font-family: var(--font-serif);
  font-size: clamp(4.2rem, 12vw, 6rem);
  line-height: 1;
}

.demo-caption {
  color: var(--faint);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
}

.demo-progress {
  height: 2px;
  margin-top: 12px;
  border-radius: 2px;
  background: var(--hairline);
}

.demo-pill {
  position: absolute;
  top: 12px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: var(--gradient);
  color: var(--accent-ink);
  box-shadow: 0 12px 30px -10px var(--accent);
  font-size: 0.78rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px) scale(0.9);
}

.demo-pill .icon {
  width: 15px;
  height: 15px;
}

.demo-pill b {
  margin-right: 6px;
  font-weight: 700;
}

.demo-pill.show {
  animation: pill 3.2s var(--ease-out);
}

.features {
  display: grid;
  gap: clamp(96px, 15vw, 180px);
  padding: 60px 0 160px;
}

.feature {
  display: grid;
  align-items: center;
  gap: 36px;
}

@media (min-width: 960px) {
  .feature {
    grid-template-columns: 1fr 1fr;
    gap: 88px;
  }

  .feature:nth-child(even) .feature-copy {
    order: 2;
  }
}

.feature-num {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-style: italic;
}

.feature-num span {
  padding-right: 0.08em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.feature-num::after {
  content: "";
  flex: 0 0 64px;
  height: 1px;
  background: var(--gradient);
}

.feature h2 {
  margin: 0 0 24px;
  font-size: clamp(2.7rem, 8vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.feature-text {
  max-width: 36ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.4vw, 1.15rem);
  line-height: 1.7;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(300px, 52vw, 420px);
  padding: 30px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--hairline);
  border-radius: 36px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgb(255 255 255 / 0.05), transparent 60%),
    var(--stage-bg);
  box-shadow: var(--shadow-lg);
}

/* feines Punktraster im Hintergrund der Bühne */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--hairline-strong) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 72%);
  mask-image: radial-gradient(circle at 50% 50%, #000, transparent 72%);
  opacity: 0.6;
}

.stage .demo-card {
  width: min(100%, 300px);
}

.finger {
  position: absolute;
  right: 22%;
  bottom: 22%;
  width: 46px;
  height: 46px;
  border: 1px solid color-mix(in srgb, var(--text) 40%, transparent);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--text) 45%, transparent), color-mix(in srgb, var(--text) 10%, transparent) 62%, transparent 72%);
  box-shadow: 0 10px 26px rgb(0 0 0 / 0.3);
  opacity: 0;
  pointer-events: none;
}

.finger.press {
  animation: finger 1.05s var(--ease-out);
}

.repeat-demo {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 460px;
}

.repeat-demo .demo-card {
  padding: 16px 14px 18px;
}

.repeat-demo .demo-value {
  font-size: clamp(3.2rem, 10vw, 4.6rem);
}

.demo-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
}

.demo-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hairline-strong);
  transition:
    background-color 0.4s,
    box-shadow 0.4s;
}

.demo-dots i.on {
  background: var(--cc);
  box-shadow: 0 0 10px var(--cc);
}

.link-line {
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
  width: 44px;
  height: 44px;
  color: var(--muted);
}

.link-line span {
  position: absolute;
  top: 50%;
  right: -12px;
  left: -12px;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--hairline-strong) 0 6px, transparent 6px 12px);
}

.link-line .icon {
  position: relative;
  box-sizing: content-box;
  width: 18px;
  height: 18px;
  padding: 8px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--bg-raise);
}

.link-line.carry .icon {
  animation: carry 0.9s var(--ease-out);
}

@media (max-width: 520px) {
  .repeat-demo {
    grid-template-columns: 1fr;
    max-width: 260px;
  }

  .link-line {
    justify-self: center;
    transform: rotate(90deg);
  }
}

.reminder-demo {
  display: grid;
  gap: 22px;
  width: 100%;
  max-width: 400px;
}

.countdown {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
  margin: 0;
}

.countdown b {
  display: inline-block;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.countdown b.tick {
  animation: tick 0.55s var(--ease-out);
}

.countdown [data-left] {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Vorschau-Zustand: schon angedeutet, leuchtet bei Reihe 16 auf */
.demo-banner {
  opacity: 0.22;
  filter: blur(2px) saturate(0.4);
  transform: translateY(8px) scale(0.97);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.8s var(--ease-out),
    filter 0.6s;
  animation: none;
}

.demo-banner::after {
  animation: none;
}

.demo-banner .banner-icon .icon {
  animation: none;
}

.demo-banner.show {
  opacity: 1;
  filter: none;
  transform: none;
}

.demo-banner.show::after {
  animation: sweep 1.6s var(--ease-out) 0.3s;
}

.demo-banner.show .banner-icon .icon {
  animation: bell-ring 1.2s var(--ease-out) 0.25s;
}

.voice-demo {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.bubble {
  padding: 10px 20px;
  border-radius: 20px 20px 20px 6px;
  background: var(--gradient);
  color: var(--accent-ink);
  box-shadow: 0 16px 40px -14px var(--accent);
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-style: italic;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
}

.bubble.pop {
  animation: bubble 1.9s var(--ease-out);
}

.eq-big {
  display: flex;
  height: 58px;
  gap: 6px;
}

.eq-big i {
  width: 5px;
  background: var(--gradient);
  animation-duration: 1.15s;
}

.voice-demo .demo-value {
  font-size: clamp(4rem, 12vw, 5.6rem);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 470px;
}

.tile {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px 10px;
  border: 1px solid var(--hairline);
  border-radius: 24px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  animation: float 6s var(--ease-in-out) infinite alternate;
  animation-delay: calc(var(--i, 0) * -2s);
}

.tile .icon {
  box-sizing: content-box;
  width: 28px;
  height: 28px;
  padding: 13px;
  border-radius: 17px;
  background: var(--gradient);
  color: var(--accent-ink);
  box-shadow: 0 14px 30px -12px var(--accent);
}

@media (max-width: 440px) {
  .tiles {
    grid-template-columns: 1fr;
    max-width: 240px;
  }

  .tile {
    grid-template-columns: auto 1fr;
    justify-items: start;
    align-items: center;
    padding: 14px 16px;
    text-align: left;
  }
}

.outro {
  display: grid;
  justify-items: center;
  gap: 32px;
  padding: 30px 0 150px;
  text-align: center;
}

.outro h2 {
  max-width: 13ch;
  font-size: clamp(3rem, 10vw, 6.6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

/* Gestrick: auf der Nadel entsteht Masche für Masche die nächste Reihe */
.swatch {
  display: grid;
  justify-items: center;
  gap: 20px;
  width: min(580px, 100%);
}

.swatch-art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.swatch-row {
  transition:
    transform 0.8s var(--ease-out),
    opacity 0.8s var(--ease-out);
}

.swatch-row path {
  fill: url(#swatch-yarn);
  stroke: rgb(0 0 0 / 0.25);
  stroke-width: 0.7;
}

.st {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  transition:
    transform 0.6s var(--ease-spring),
    opacity 0.35s var(--ease-out);
}

.st.off {
  opacity: 0;
  transform: translateY(-5px) scale(0.2);
}

.st.fresh {
  animation: stitch-glow 0.7s var(--ease-out);
}

.swatch-needle path {
  fill: var(--yarn-needle);
}

.swatch-needle circle {
  fill: var(--yarn-knob);
}

.swatch-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
}

/* nur die Beschriftungen, nicht die Ziffern-Spans der Zählwerke */
.swatch-count > span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.swatch-count b {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1;
}

.swatch-count i {
  width: 4px;
  height: 4px;
  margin: 0 8px;
  border-radius: 50%;
  background: var(--faint);
}

.swatch-count small {
  margin-left: -4px;
  color: var(--faint);
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

@keyframes stitch-glow {
  from {
    filter: brightness(1.9) drop-shadow(0 0 4px var(--yarn-b));
  }
}

.intro-foot {
  padding: 28px 18px calc(30px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  color: var(--faint);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-align: center;
}

/* Einblenden beim Scrollen */
[data-reveal] {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(36px);
  transition:
    opacity 1s var(--ease-out),
    transform 1.3s var(--ease-out),
    filter 1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 130ms);
}

[data-reveal].is-in {
  opacity: 1;
  filter: none;
  transform: none;
}

/* ---------- Eintritt der Ansichten ---------- */

.is-entering .line > span {
  animation: line-up 1.05s var(--ease-out) backwards;
  animation-delay: 0.12s;
}

.is-entering .home-hello .eyebrow {
  animation: fade-up 0.9s var(--ease-out) backwards;
}

.is-entering .home-lead {
  animation: fade-up 0.9s var(--ease-out) 0.25s backwards;
}

.is-entering .pc-item,
.is-entering .empty {
  animation: rise 0.9s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 70ms + 220ms);
}

.is-entering .fab {
  animation: fab-in 1s var(--ease-out) 0.45s backwards;
}

.is-entering .counter {
  animation: rise 0.85s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 80ms + 60ms);
}

.is-entering .dock {
  animation: dock-in 0.9s var(--ease-out) 0.25s backwards;
}

/* nach dem Eintritt, damit sie den Eintritt übersteuern */
.counter.alerting {
  animation: alert-glow 2.4s var(--ease-in-out);
}

.counter.refuse {
  animation: refuse 0.45s var(--ease-out);
}

/* ---------- Querformat ---------- */

@media (orientation: landscape) and (max-height: 520px) {
  .appbar {
    min-height: 52px;
    padding-top: calc(env(safe-area-inset-top) + 4px);
    padding-bottom: 4px;
  }

  .counters {
    flex-direction: row;
  }

  .counter {
    min-width: 240px;
    min-height: 0;
  }
}

/* ---------- Ansichtswechsel (View Transitions) ---------- */

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.6s;
  animation-timing-function: var(--ease-out);
}

html[data-nav="forward"]::view-transition-old(root) {
  animation-name: vt-leave;
}

html[data-nav="forward"]::view-transition-new(root) {
  animation-name: vt-enter;
}

html[data-nav="back"]::view-transition-old(root) {
  animation-name: vt-leave-back;
}

html[data-nav="back"]::view-transition-new(root) {
  animation-name: vt-enter-back;
}

::view-transition-group(project-title) {
  animation-duration: 0.7s;
  animation-timing-function: var(--ease-out);
}

html[data-nav="theme"]::view-transition-old(*) {
  animation: none;
}

html[data-nav="theme"]::view-transition-new(*) {
  animation: theme-reveal 0.9s var(--ease-in-out);
}

/* ---------- Bewegung ---------- */

@keyframes fade-up {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(18px);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(26px) scale(0.985);
  }
}

@keyframes line-up {
  from {
    transform: translateY(110%);
  }
}

@keyframes fab-in {
  from {
    opacity: 0;
    transform: translate(-50%, 40px) scale(0.9);
  }
}

@keyframes dock-in {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
}

@keyframes banner-in {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(-14px) scale(0.97);
  }
}

@keyframes banner-out {
  to {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(-10px) scale(0.97);
  }
}

@keyframes sweep {
  to {
    transform: translateX(100%);
  }
}

@keyframes bell-ring {
  0%,
  100% {
    transform: rotate(0);
  }
  15% {
    transform: rotate(18deg);
  }
  30% {
    transform: rotate(-14deg);
  }
  45% {
    transform: rotate(10deg);
  }
  60% {
    transform: rotate(-6deg);
  }
  75% {
    transform: rotate(3deg);
  }
}

@keyframes glow-flash {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes tap-ring {
  0% {
    opacity: 0.85;
    transform: scale(0.04);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes spark {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(var(--s, 1));
  }
  70% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0);
  }
}

@keyframes dot-pulse {
  50% {
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--cc) 9%, transparent);
  }
}

@keyframes alert-glow {
  0%,
  100% {
    box-shadow: var(--shadow);
  }
  20%,
  60% {
    box-shadow:
      0 0 0 1px var(--cc),
      0 0 70px -10px var(--cc);
  }
  40%,
  80% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--cc) 40%, transparent),
      0 0 30px -14px var(--cc);
  }
}

@keyframes refuse {
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(2px);
  }
}

@keyframes odo-in-up {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(0.3em);
  }
}

@keyframes odo-in-down {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(-0.3em);
  }
}

@keyframes eq {
  0%,
  100% {
    height: 25%;
  }
  50% {
    height: 100%;
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pop {
  from {
    transform: scale(0);
  }
}

@keyframes breathe {
  to {
    opacity: 0.75;
    transform: scale(1.08);
  }
}

@keyframes float {
  to {
    transform: translateY(-14px);
  }
}

@keyframes cue {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
  }
  70% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 0;
  }
}

@keyframes pill {
  0% {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.9);
  }
  12%,
  82% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.96);
  }
}

@keyframes finger {
  0% {
    opacity: 0;
    transform: translate(14px, 18px) scale(1.15);
  }
  30% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  45% {
    transform: scale(0.8);
  }
  62% {
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(10px, 12px) scale(1.05);
  }
}

@keyframes carry {
  35% {
    border-color: var(--accent);
    box-shadow: 0 0 26px -4px var(--accent);
    color: var(--accent);
    transform: rotate(180deg) scale(1.2);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes tick {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(40%);
  }
}

@keyframes bubble {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.85);
  }
  15%,
  70% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
}

@keyframes vt-leave {
  to {
    opacity: 0;
    filter: blur(6px);
    transform: translateX(-5%) scale(0.98);
  }
}

@keyframes vt-enter {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateX(6%) scale(1.01);
  }
}

@keyframes vt-leave-back {
  to {
    opacity: 0;
    filter: blur(6px);
    transform: translateX(5%) scale(0.98);
  }
}

@keyframes vt-enter-back {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateX(-6%) scale(1.01);
  }
}

@keyframes theme-reveal {
  from {
    clip-path: circle(0 at var(--reveal-x, 50%) var(--reveal-y, 50%));
  }
  to {
    clip-path: circle(150vmax at var(--reveal-x, 50%) var(--reveal-y, 50%));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-delay: 0ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-delay: 0ms !important;
    transition-duration: 1ms !important;
  }

  .ambient i,
  .ambient::after {
    animation: none !important;
  }

  .hero-stage {
    transform: none;
  }

  [data-reveal] {
    opacity: 1;
    filter: none;
    transform: none;
  }
}
