/* Dipha – Variante A3: Übergang im Startscreen in drei Fassungen zum Vergleich
   ?sortier=box     farbige Boxen sammeln die Karten ein (Stand vom 09.11. mittags)
   ?sortier=ordner  Aktenmappen: Karten stecken zwischen Rückwand und Vorderklappe (Standard)
   ?sortier=tetris  Karten werden zu Blöcken, fallen in ihre Station und verschmelzen zur Box
   Die Fassung setzt main.js als data-sortier auf <html>. Bewegung nur über transform und opacity. */

/* ---------- KI-Satz als eigener Absatz unter dem Lead ---------- */
.hero-ki { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--ink); font-size: var(--fs-lead); }
.hero-ki .dot { width: 7px; height: 7px; }
@media (prefers-reduced-motion: no-preference) {
  .hero-ki { animation: auftritt 1.1s var(--ease) .58s both; }
}
@media (max-width: 699px) { .hero-ki { font-size: 15.5px; margin-top: 10px; gap: 9px; } }

/* Ebenen für Ordner und Tetris sind in der Box-Fassung aus */
.kiste > .k-schacht, .kiste > .k-flaeche { position: absolute; inset: 0; border-radius: inherit; display: none; pointer-events: none; }
.klappen { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: none; }

/* =====================================================================
   Fassung „ordner“: Rückwand mit Reiter unter den Karten, Vorderklappe darüber
   ===================================================================== */
[data-sortier="ordner"] .klappen { display: block; }
[data-sortier="ordner"] .kiste {
  --tab: 22px;
  --ruecken: color-mix(in srgb, var(--c) 74%, var(--surface));
  display: block; padding: 0; background: none; border-radius: 0; box-shadow: none;
}
/* Rückwand: Innenseite der Mappe, nach unten etwas dunkler (liegt im Schatten der Klappe) */
[data-sortier="ordner"] .kiste::before {
  content: ""; position: absolute; left: 0; right: 0; top: var(--tab); bottom: 0;
  border-radius: 0 14px 14px 14px;
  background: linear-gradient(180deg, var(--ruecken) 0%, color-mix(in srgb, var(--ruecken) 88%, var(--ink)) 100%);
  box-shadow: inset 0 0 0 1px rgba(30,28,25,.05), 0 26px 50px -34px rgba(30,28,25,.5);
}
/* Reiter mit Stationsname */
[data-sortier="ordner"] .kiste .k-kopf {
  position: absolute; left: 0; top: 0; height: calc(var(--tab) + 1px); padding: 1px 14px 0 13px;
  display: flex; align-items: center; border-radius: 9px 9px 0 0;
  background: var(--ruecken); box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  font-size: var(--fs-label); letter-spacing: .12em; white-space: nowrap;
}
[data-sortier="ordner"] .kiste .k-kopf::after {
  content: ""; position: absolute; left: 100%; bottom: 1px; width: 12px; height: 12px;
  background: radial-gradient(circle at 100% 0, transparent 11.5px, var(--ruecken) 12px);
}
[data-sortier="ordner"] .kiste .k-liste { display: none; }

/* Vorderklappe: heller als die Rückwand, Griffmulde oben, weicher Schatten nach oben */
.klappe {
  position: absolute; left: 0; top: 0; opacity: 0; transform-origin: 50% 100%; will-change: opacity, transform;
  filter: drop-shadow(0 -5px 7px rgba(30,28,25,.12)) drop-shadow(0 20px 18px rgba(30,28,25,.13));
}
.klappe-blatt {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 0 16px 14px;
  border-radius: 5px 5px 14px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 50%, var(--surface)) 0%, color-mix(in srgb, var(--c) 60%, var(--surface)) 55%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 0 0 1px rgba(30,28,25,.05);
  -webkit-mask: radial-gradient(circle 16px at 50% -8px, transparent 15.5px, #000 16.5px);
          mask: radial-gradient(circle 16px at 50% -8px, transparent 15.5px, #000 16.5px);
  /* offen: Oberkante leicht nach vorn gekippt; beim Einrasten schließt sie mit kurzem Nachschwingen */
  transform-origin: 50% 100%; transform: perspective(3000px) rotateX(var(--auf, -55deg));
  transition: transform .5s cubic-bezier(.4, 0, .6, 1);
}
/* Zuklappen: Deckel schwenkt um die Unterkante hoch über die Blätter und rastet mit kurzem Nachschwingen ein */
.klappe.zu .klappe-blatt { transform: perspective(3000px) rotateX(0deg); transition: transform .62s cubic-bezier(.32, 1.42, .52, 1); }
.klappe .k-liste { font-weight: 500; font-size: 15px; line-height: 1.3; letter-spacing: -.01em; color: var(--ink); }
@media (max-width: 699px) {
  [data-sortier="ordner"] .kiste { --tab: 16px; }
  [data-sortier="ordner"] .kiste::before { border-radius: 0 11px 11px 11px; }
  [data-sortier="ordner"] .kiste .k-kopf { font-size: 8.5px; letter-spacing: .08em; padding: 1px 8px 0 8px; border-radius: 7px 7px 0 0; }
  [data-sortier="ordner"] .kiste .k-kopf::after { width: 9px; height: 9px; background: radial-gradient(circle at 100% 0, transparent 8.5px, var(--ruecken) 9px); }
  .klappe-blatt { padding: 0 9px 8px; border-radius: 4px 4px 11px 11px;
    -webkit-mask: radial-gradient(circle 11px at 50% -6px, transparent 10.5px, #000 11.5px);
            mask: radial-gradient(circle 11px at 50% -6px, transparent 10.5px, #000 11.5px); }
  .klappe .k-liste { font-size: 11.5px; line-height: 1.22; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .klappe-blatt { transition: none; } }

/* Eingesteckte Blätter: gleich groß, gerade, ruhig; je Blatt ein Reiter mit dem Dokumenttyp */
[data-sortier="ordner"] .f-card {
  display: block; width: 200px; height: 80px; padding: 0; border: 0; border-radius: 3px 3px 2px 2px;
  background: linear-gradient(180deg, var(--surface) 0, #F8F6F0 100%);
  box-shadow: 0 0 0 1px rgba(30,28,25,.1), 0 -2px 5px -2px rgba(30,28,25,.1);
  will-change: transform, opacity;
}
[data-sortier="ordner"] .thing > .face:first-child { will-change: transform, opacity; }
[data-sortier="ordner"] .f-card .k-code, [data-sortier="ordner"] .f-card .k-top i { display: none; }
[data-sortier="ordner"] .f-card .k-top {
  position: absolute; left: 0; bottom: calc(100% - 1px); height: 15px; padding: 1px 6px 0;
  display: flex; align-items: center; gap: 0; white-space: nowrap;
  background: var(--surface); border-radius: 4px 4px 0 0;
  box-shadow: 0 0 0 1px rgba(30,28,25,.1); clip-path: inset(-2px -2px 0 -2px);
  font-size: 8.5px; letter-spacing: .08em; line-height: 1; color: var(--ink);
}
@media (max-width: 699px) {
  [data-sortier="ordner"] .f-card { border-radius: 2px; }
  [data-sortier="ordner"] .f-card .k-top { padding: 1px 4px 0; font-size: 6.5px; letter-spacing: .05em; border-radius: 3px 3px 0 0; }
}

/* =====================================================================
   Fassung „tetris“: leerer Schacht je Station, Blöcke fallen hinein und verschmelzen
   ===================================================================== */
[data-sortier="tetris"] .kiste { background: none; box-shadow: none; }
[data-sortier="tetris"] .kiste > .k-schacht, [data-sortier="tetris"] .kiste > .k-flaeche { display: block; }
[data-sortier="tetris"] .k-schacht {
  background: color-mix(in srgb, var(--c) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent);
}
[data-sortier="tetris"] .k-flaeche {
  opacity: 0; will-change: opacity;
  background: color-mix(in srgb, var(--c) 60%, var(--surface));
  box-shadow: inset 0 0 0 1px rgba(30,28,25,.06), 0 26px 50px -34px rgba(30,28,25,.5);
}
[data-sortier="tetris"] .kiste .k-kopf, [data-sortier="tetris"] .kiste .k-liste { position: relative; }
[data-sortier="tetris"] .kiste .k-liste { opacity: 0; will-change: opacity; }
/* Block: Stationsfarbe wie die fertige Box, feine Kante oben, winziges Label */
[data-sortier="tetris"] .f-card {
  width: 100px; height: 40px; padding: 7px 9px; border: 0; border-radius: 4px;
  flex-direction: column; justify-content: flex-start; align-items: flex-start;
  background: color-mix(in srgb, var(--c) 60%, var(--surface));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(30,28,25,.07), inset 0 0 0 1px rgba(30,28,25,.05);
  will-change: transform, opacity;
}
[data-sortier="tetris"] .f-card .k-top { font-size: 9px; letter-spacing: .1em; gap: 0; color: rgba(30,28,25,.72); white-space: nowrap; }
[data-sortier="tetris"] .f-card .k-top i, [data-sortier="tetris"] .f-card .k-code { display: none; }
[data-sortier="tetris"] .thing > .face.paper, [data-sortier="tetris"] .thing > .face:first-child { will-change: transform, opacity; }
@media (max-width: 699px) {
  [data-sortier="tetris"] .f-card { padding: 5px 6px; }
  [data-sortier="tetris"] .f-card .k-top { font-size: 7px; letter-spacing: .05em; }
}

/* Niedrige Fenster: Startscreen-Text etwas kompakter, damit unter dem KI-Absatz Platz für die Stationen bleibt */
@media (min-width: 700px) and (max-height: 820px) {
  .hero h1 { font-size: clamp(54px, min(9.8vw, 14.6vh), 156px); }
  .hero-sub { font-size: clamp(30px, min(3.9vw, 5.6vh), 58px); }
}
@media (min-width: 700px) and (max-height: 820px) {
  .klappe-blatt { padding-bottom: 10px; }
  .klappe .k-liste { font-size: 13.5px; line-height: 1.25; }
}

/* Korrektur 09.11.: Liste auf der Klappe doppelt zu den Reitern, weg */
[data-sortier="ordner"] .klappe .k-liste { display: none; }

/* Korrektur 09.11.: grünes Lämpchen statt Bernstein-Punkt vor „Auf Wunsch arbeitet deine KI mit.“ */
.hero-ki .dot { background: var(--b-gruen); box-shadow: 0 0 0 1px rgba(30,28,25,.12), 0 0 0 0 rgba(74,222,128,.55); }
@media (prefers-reduced-motion: no-preference) {
  .hero-ki .dot { animation: lampe 2.4s ease-in-out infinite; }
  @keyframes lampe { 0%, 100% { box-shadow: 0 0 0 1px rgba(30,28,25,.12), 0 0 0 0 rgba(74,222,128,.5); } 50% { box-shadow: 0 0 0 1px rgba(30,28,25,.12), 0 0 0 6px rgba(74,222,128,0); } }
}

/* Geschlossene Mappe: Reiter sind verdeckt, darum steht klein auf dem Deckel, was drin ist */
/* geschlossen ohne Griffmulde, damit darunter nichts hervorblitzt */
.klappe.zu .klappe-blatt { -webkit-mask: none; mask: none; }
[data-sortier="ordner"] .klappe.zu .k-liste {
  display: block; font-family: "Suisse Mono", ui-monospace, monospace; font-weight: 400;
  font-size: 9px; line-height: 1.6; letter-spacing: .1em; text-transform: uppercase; color: rgba(30,28,25,.62);
  animation: deckel-text .5s ease .35s both;
}
@keyframes deckel-text { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 699px) {
  [data-sortier="ordner"] .klappe.zu .k-liste { font-size: 7px; letter-spacing: .06em; line-height: 1.5; }
}
@media (prefers-reduced-motion: reduce) { [data-sortier="ordner"] .klappe.zu .k-liste { animation: none; } }
