/* ═══════════════════════════════════════════
   CANVAS-HERO (Redesign 2026)
   Eigenständig: alle Klassen mit „ch-“, Variablen nur innerhalb von .ch
   ═══════════════════════════════════════════ */
.ch {
  --ch-canvas: #0D0D0F;
  --ch-paper: #F4F3F0;
  --ch-b1: #4472C4;
  --ch-b2: #5B8DEF;
  --ch-violet: #8B5CF6;
  --ch-mute: #8A8A90;
  --ch-line: rgba(255, 255, 255, .08);
  --ch-ease: cubic-bezier(.22, 1, .36, 1);
  --ch-nav: 72px;
  /* gleiche Kante wie die alte Navigation (#nav: max(40px, (100% - 1100px) / 2)) */
  --ch-gutter: max(40px, calc((100% - 1100px) / 2));

  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding-top: var(--ch-nav);
  background: var(--ch-canvas); color: var(--ch-paper);
  overflow: hidden;
  isolation: isolate;
  font-family: 'DM Sans', sans-serif;
  text-align: left;
}
.ch *, .ch *::before, .ch *::after { box-sizing: border-box; }
.ch h1, .ch p, .ch ol { margin: 0; }
.ch ol { list-style: none; padding: 0; }
.ch img { display: block; max-width: 100%; }

.ch-grid {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 120px 120px;
  background-position: -1px -1px;
}
.ch-glow {
  position: absolute; z-index: -1; pointer-events: none;
  width: 60vw; height: 60vw; max-width: 900px; max-height: 900px;
  right: 2vw; top: -10vw;
  background: radial-gradient(closest-side, rgba(68, 114, 196, .30), rgba(68, 114, 196, 0));
}
.ch-inner {
  flex: 1;
  width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 57%);
  align-items: center; gap: 24px;
  padding: clamp(24px, 4vh, 56px) var(--ch-gutter) 24px;
}

/* Text */
.ch-text { position: relative; z-index: 2; }
.ch-eyebrow { font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ch-mute); margin-bottom: 18px; }
.ch-title { font-size: clamp(64px, 8.4vw, 124px); font-weight: 500; letter-spacing: -.05em; line-height: .93; margin-left: -.04em; color: var(--ch-paper); }
.ch-line { display: block; }
.ch-dot { color: var(--ch-b2); }
.ch-selected { position: relative; display: inline-block; color: var(--ch-hl, var(--ch-b2)); transition: color .7s var(--ch-ease); }
.ch-word { position: relative; z-index: 1; }
/* Start klein, dann per Ziehpunkt „aufgezogen“ (hero.js) — die ganze Zeile wächst mit, damit keine Lücke entsteht */
/* --s = Skalierung von „sichtbar“ (1 = volle Grösse). Animiert per GPU-Transform statt font-size,
   die Zeilenhöhe wächst über dieselbe Variable mit — dadurch keine Lücke und kein Ruckeln. */
@property --s { syntax: '<number>'; inherits: true; initial-value: 1; }
.ch-line--sel { --s: 1; height: calc(.93em * var(--s)); }
/* Übergang für --s zusätzlich zu den Aufbau-Übergängen (sonst überschreibt .ch.is-revealing [data-anim] die transition) */
#hero.ch .ch-line--sel {
  transition: opacity .8s var(--ch-ease), transform 1s var(--ch-ease), --s 1.25s cubic-bezier(.65, 0, .35, 1);
  transition-delay: calc(var(--base, 0ms) + var(--i, 0) * 90ms), calc(var(--base, 0ms) + var(--i, 0) * 90ms), 0s;
}
#hero.ch-word-small .ch-line--sel, #hero.ch-measure .ch-line--sel {
  transition: opacity .8s var(--ch-ease), transform 1s var(--ch-ease);
  transition-delay: calc(var(--base, 0ms) + var(--i, 0) * 90ms);
}
.ch.ch-word-small .ch-line--sel { --s: .62; }
.ch.ch-measure .ch-line--sel { --s: 1 !important; }
.ch-line--sel .ch-selected { transform: scale(var(--s)); transform-origin: 0 0; will-change: transform; }
.ch-line--sel .ch-selection { border-width: calc(1.5px / var(--s)); }
.ch-line--sel .ch-selection i { scale: calc(1 / var(--s)); }
.ch-selection i { transition: background-color .3s, transform .3s; }
.ch-word-resizing .ch-selection i:nth-child(2) { background: var(--ch-hl, var(--ch-b2)); transform: scale(1.35); }
.ch-selection {
  /* Rückfall; hero.js setzt die exakten Werte aus den Glyphenmassen */
  position: absolute; inset: .085em -.035em .1em -.035em;
  border: 1.5px solid var(--ch-hl, var(--ch-b2)); background: color-mix(in srgb, var(--ch-hl, var(--ch-b2)) 12%, transparent); pointer-events: none;
  transition: border-color .7s var(--ch-ease), background-color .7s var(--ch-ease);
}
.ch-selection i { border-color: var(--ch-hl, var(--ch-b2)) !important; }
.ch-selection i, .ch-frame i { position: absolute; width: 10px; height: 10px; background: #fff; border: 1.5px solid var(--ch-b2); }
.ch-selection i:nth-child(1) { left: -6px; top: -6px; }
.ch-selection i:nth-child(2) { right: -6px; top: -6px; }
.ch-selection i:nth-child(3) { left: -6px; bottom: -6px; }
.ch-selection i:nth-child(4) { right: -6px; bottom: -6px; }
.ch-sub { max-width: 440px; margin-top: 36px; font-size: 18px; line-height: 1.55; font-weight: 400; color: rgba(244, 243, 240, .7); }
.ch-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.ch-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 24px; border-radius: 999px;
  font-size: 15px; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: transform .25s var(--ch-ease), background-color .25s, border-color .25s, box-shadow .25s;
}
.ch-btn:hover { transform: translateY(-2px); }
.ch-btn--blue { background: var(--ch-b2); color: #fff; }
.ch-btn--blue:hover { background: #6d9bf5; box-shadow: 0 10px 30px -10px rgba(91, 141, 239, .7); }
.ch-btn--ghost { border: 1px solid rgba(255, 255, 255, .22); color: var(--ch-paper); }
.ch-btn--ghost:hover { border-color: rgba(255, 255, 255, .5); }

/* Cursor */
.ch-cursor { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; --c: var(--ch-b2); }
.ch-cursor svg { width: 20px; height: 22px; display: block; }
.ch-cursor path { fill: var(--c); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }
.ch-cursor span { position: absolute; left: 14px; top: 20px; padding: 4px 8px; border-radius: 6px; background: var(--c); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; }

/* Canvas: Masse in Design-Pixeln (820 × 780) über Container-Query-Einheiten */
.ch-canvas {
  position: relative;
  container-type: inline-size;
  width: min(100%, calc((100vh - var(--ch-nav) - 170px) * 1.051));
  aspect-ratio: 820 / 780;
  justify-self: end;
}
.ch-canvas > * { --u: calc(100cqw / 820); }
.ch-guides { position: absolute; inset: 0; pointer-events: none; }
.ch-guide { position: absolute; display: block; }
.ch-guide--h { left: -100vw; right: -100vw; height: 1px; top: calc(var(--y) * var(--u)); background: repeating-linear-gradient(to right, rgba(91, 141, 239, .55) 0 6px, transparent 6px 12px); transform-origin: left; }
.ch-guide--v { top: -100vh; bottom: -100vh; width: 1px; left: calc(var(--x) * var(--u)); background: repeating-linear-gradient(to bottom, rgba(91, 141, 239, .55) 0 6px, transparent 6px 12px); transform-origin: top; }

.ch-artboard { position: absolute; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); width: calc(var(--w) * var(--u)); pointer-events: none; }
.ch-artboard-label {
  position: absolute; left: 0; right: 0; bottom: 100%;
  display: flex; justify-content: space-between; gap: 8px; padding-bottom: 7px;
  font-family: 'Space Mono', monospace; font-size: max(9px, calc(10 * var(--u))); letter-spacing: .02em;
  color: rgba(244, 243, 240, .65); white-space: nowrap;
}
.ch-artboard-label span { overflow: hidden; text-overflow: ellipsis; }
.ch-artboard-label em { font-style: normal; color: var(--ch-mute); }
.ch-artboard-img { display: block; height: calc(var(--h) * var(--u)); border-radius: 4px; overflow: hidden; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.ch-artboard-img img { width: 100%; height: 100%; object-fit: cover; }

.ch-portrait { position: absolute; left: calc(240 * var(--u)); top: calc(80 * var(--u)); width: calc(300 * var(--u)); height: calc(400 * var(--u)); z-index: 2; }
.ch-portrait img { width: 100%; height: 100%; object-fit: cover; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.ch-portrait-label { position: absolute; left: 0; right: 0; bottom: 100%; display: flex; justify-content: space-between; padding-bottom: 7px; font-family: 'Space Mono', monospace; font-size: max(9px, calc(10 * var(--u))); color: var(--ch-b2); white-space: nowrap; }
.ch-frame { position: absolute; inset: 0; border: 1.5px solid var(--ch-b2); pointer-events: none; }
.ch-frame i:nth-child(1) { left: -5.5px; top: -5.5px; }
.ch-frame i:nth-child(2) { left: calc(50% - 5px); top: -5.5px; }
.ch-frame i:nth-child(3) { right: -5.5px; top: -5.5px; }
.ch-frame i:nth-child(4) { left: -5.5px; top: calc(50% - 5px); }
.ch-frame i:nth-child(5) { right: -5.5px; top: calc(50% - 5px); }
.ch-frame i:nth-child(6) { left: -5.5px; bottom: -5.5px; }
.ch-frame i:nth-child(7) { left: calc(50% - 5px); bottom: -5.5px; }
.ch-frame i:nth-child(8) { right: -5.5px; bottom: -5.5px; }
.ch-dim { position: absolute; left: 50%; top: calc(100% + 12px); transform: translateX(-50%); padding: 3px 6px; border-radius: 4px; background: var(--ch-b2); color: #fff; font-family: 'Space Mono', monospace; font-size: max(9px, calc(10 * var(--u))); white-space: nowrap; }

.ch-panel {
  position: absolute; z-index: 3; padding: calc(16 * var(--u));
  border-radius: 12px; background: rgba(22, 22, 25, .9); border: 1px solid var(--ch-line);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-family: 'Space Mono', monospace; font-size: max(9px, calc(10 * var(--u)));
}
.ch-panel-title { font-size: .9em; letter-spacing: .14em; text-transform: uppercase; color: var(--ch-mute); margin-bottom: 1em; }
.ch-panel--values { left: auto; right: calc(592 * var(--u)); top: calc(170 * var(--u)); /* rechte Kante 12 Design-px vor dem Foto */ width: calc(168 * var(--u)); min-width: 132px; }
.ch-panel-row { display: flex; justify-content: space-between; margin-bottom: .9em; }
.ch-panel-row span { color: var(--ch-mute); }
.ch-panel-row b, .ch-panel-hex b { font-weight: 400; }
.ch-panel-hex { display: flex; align-items: center; gap: 8px; font-size: 1.1em; }
.ch-panel-hex i { width: 12px; height: 12px; border-radius: 3px; background: var(--ch-b2); transition: background-color .7s var(--ch-ease); }
.ch-panel--swatches { left: calc(580 * var(--u)); top: calc(228 * var(--u)); width: calc(200 * var(--u)); min-width: 150px; }
.ch-swatches { display: flex; gap: calc(8 * var(--u)); margin-bottom: 1.1em; }
.ch-swatches i { width: calc(22 * var(--u)); height: calc(22 * var(--u)); min-width: 14px; min-height: 14px; border-radius: 5px; outline: 1px solid rgba(255, 255, 255, .12); }
.ch-swatches i { transition: outline-color .3s, transform .3s var(--ch-ease); }
.ch-swatches i.is-active { outline: 2px solid #fff; outline-offset: 1px; transform: scale(1.12); }
.ch-panel-name { letter-spacing: .14em; color: rgba(244, 243, 240, .8); }


/* Status „Verfügbar“ im Rahmen-Label über dem Porträt */
.ch-portrait-label { align-items: flex-end; }
.ch-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px; border-radius: 999px;
  background: rgba(61, 220, 151, .12); border: 1px solid rgba(61, 220, 151, .35);
  color: #3DDC97; letter-spacing: .06em; text-transform: uppercase;
}
.ch-status i { width: 6px; height: 6px; border-radius: 50%; background: #3DDC97; animation: chPulse 2.4s infinite; }
@keyframes chPulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .55); } 70% { box-shadow: 0 0 0 7px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }

/* Leichtes Schweben der Projekt-Bilder und Panels (läuft dauerhaft, unabhängig von Parallax/Aufbau) */
@keyframes chFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 calc(-7 * var(--u)); } }
.ch-artboard > * { animation: chFloat 6.5s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -1.6s); }
.ch-panel { animation: chFloat 7.5s ease-in-out infinite; }
.ch-panel--swatches { animation-delay: -3.2s; }

/* ─── Zusammenspiel mit dem alten Intro ───
   Während das Intro läuft, wartet der Hero; danach baut er sich gestaffelt auf. */
body.intro-active .ch [data-anim] { opacity: 0; transform: translateY(40px); }
body.intro-active .ch [data-anim="panel"] { transform: translateY(16px) scale(.97); }
body.intro-active .ch .ch-cursor, body.intro-active .ch-glow { opacity: 0; }
body.intro-active .ch-guide--h { transform: scaleX(0); }
body.intro-active .ch-guide--v { transform: scaleY(0); }
.ch.is-revealing [data-anim] { transition: opacity .8s var(--ch-ease), transform 1s var(--ch-ease); transition-delay: calc(var(--base, 0ms) + var(--i, 0) * 90ms); }
.ch.is-revealing .ch-guide { transition: transform 1.1s var(--ch-ease) .1s; }
.ch.is-revealing .ch-glow { transition: opacity 1.2s .7s; }
.ch .ch-eyebrow { --base: 100ms; }
.ch [data-anim="line"] { --base: 150ms; }
.ch [data-anim="portrait"] { --base: 250ms; }
.ch [data-anim="panel"] { --base: 420ms; }
.ch [data-anim="fade"] { --base: 450ms; }
.ch [data-anim="artboard"] { --base: 520ms; }

/* ─── Responsive ─── */
/* Kleinere Canvas (z. B. Laptop-Höhe): Kategorie-Kürzel weglassen, damit sich die Labels nicht berühren */
@container (max-width: 720px) {
  .ch-artboard-label em { display: none; }
}

@media (max-width: 900px) {
  .ch { --ch-gutter: 24px; }
  .ch-inner { grid-template-columns: 1fr; gap: 64px; padding-top: 40px; }
  .ch-canvas { width: 100%; justify-self: stretch; }
  .ch-sub { font-size: 16px; }
}
@media (max-width: 640px) {
  .ch { --ch-nav: 64px; }
  .ch-title { font-size: clamp(56px, 18.5vw, 80px); }
  .ch-canvas { aspect-ratio: 820 / 700; }
  .ch-panel--swatches, .ch-artboard-label, .ch-portrait-label span:last-child, .ch-artboard--s3, .ch-artboard--s4 { display: none; }
  .ch-portrait { left: calc(210 * var(--u)); top: calc(50 * var(--u)); width: calc(400 * var(--u)); height: calc(533 * var(--u)); }
  .ch-guide.ch-g1 { --y: 50 !important; } .ch-guide.ch-g2 { --y: 583 !important; } .ch-guide.ch-g3 { --x: 210 !important; } .ch-guide.ch-g4 { --x: 610 !important; }
  .ch-artboard--s1 { --x: 560 !important; --y: 70 !important; --w: 240 !important; --h: 180 !important; }
  .ch-artboard--s2 { --x: 20 !important; --y: 400 !important; --w: 270 !important; --h: 203 !important; }
  .ch-panel--values { min-width: 0; width: auto; padding: 8px 10px; left: calc(560 * var(--u)); right: auto; top: calc(500 * var(--u)); }
  .ch-panel--values .ch-panel-title, .ch-panel--values .ch-panel-row { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ch *, .ch *::before, .ch *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
