/* ══════════════════════════════════════════════════════════════
   Polish: gemeinsames Design-System für Helium Start und Insights.
   Wird nach styles.css geladen und überschreibt dessen Tokens.
   ══════════════════════════════════════════════════════════════ */

:root {
    --font-display: "Bricolage Grotesque", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
    --font-body:    "Instrument Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;

    /* Bewegung: ein Satz Kurven für alles */
    --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in:    cubic-bezier(0.4, 0, 1, 1);
    --ease-micro: cubic-bezier(0.2, 0, 0, 1);

    --accent:       #60a5fa;
    --accent-soft:  color-mix(in srgb, var(--accent) 16%, transparent);
    --accent-mid:   color-mix(in srgb, var(--accent) 30%, transparent);
    --accent-line:  color-mix(in srgb, var(--accent) 50%, transparent);

    --muted: #b9c4d6;
    --faint: #8b97ad;
    --surface-pop: #171d33;
}

/* Die Akzentfarbe folgt der Tageszeit (Helium Start setzt data-phase) */
body[data-phase="morning"] { --accent: #fbbf24; }
body[data-phase="day"]     { --accent: #60a5fa; }
body[data-phase="evening"] { --accent: #f472b6; }
body[data-phase="night"]   { --accent: #818cf8; }

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, .silo-title, .kpi-value, .modal-heading { font-family: var(--font-display); letter-spacing: -0.015em; }
::selection { background: var(--accent-mid); }

/* ── Fokus: einheitlich und gut sichtbar ──────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible { outline: none; }

.skip-link {
    position: fixed; top: 10px; left: 10px; z-index: 100; padding: 10px 14px; border-radius: 10px;
    background: var(--surface-pop); color: var(--text); border: 1px solid var(--accent-line);
    transform: translateY(-160%); transition: transform 0.3s var(--ease-out); text-decoration: none; font-size: 0.88rem;
}
.skip-link:focus { transform: none; }

/* ── Buttons: sie antworten immer (Hover, Press, Fokus) ───────── */
.btn-primary, .btn-secondary, .btn-danger, .pill-btn, .icon-btn, .preset {
    transition: background 0.15s var(--ease-micro), border-color 0.15s var(--ease-micro),
                transform 0.15s var(--ease-micro), color 0.15s var(--ease-micro), box-shadow 0.15s var(--ease-micro);
}
.btn-primary:active, .btn-secondary:active, .btn-danger:active, .pill-btn:active, .icon-btn:active, .preset:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: #0b1020; }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 82%, white); box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
kbd {
    font-family: var(--font-body); font-size: 0.7rem; line-height: 1; padding: 3px 6px; border-radius: 5px;
    background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border); border-bottom-width: 2px; color: var(--muted);
}

/* ── Dialoge: wachsen aus dem Kontext, verschwinden animiert ──── */
dialog { transform-origin: 50% 30%; }
dialog[open] { animation: dlg-in 0.4s var(--ease-out) both; }
dialog[open]::backdrop { animation: fade-in 0.3s var(--ease-out) both; }
dialog.closing { animation: dlg-out 0.22s var(--ease-in) both; }
dialog.closing::backdrop { animation: fade-out 0.22s var(--ease-in) both; }
@keyframes dlg-in  { from { opacity: 0; transform: translateY(18px) scale(0.965); } to { opacity: 1; transform: none; } }
@keyframes dlg-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
.link-modal { background: var(--surface-pop); border-color: var(--border); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.link-modal::backdrop { background: rgba(3, 6, 18, 0.62); backdrop-filter: blur(6px); }
.modal-heading { font-size: 1.15rem; }

/* ── Toast: Hinweise im Hintergrund, nicht für Wichtiges ──────── */
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 28px) scale(0.97); opacity: 0; pointer-events: none;
    background: var(--surface-pop); color: var(--text); border: 1px solid var(--border); border-radius: 14px;
    padding: 11px 14px; font-size: 0.86rem; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    display: flex; align-items: center; gap: 12px; max-width: min(92vw, 540px); z-index: 90;
    transition: opacity 0.3s var(--ease-out), transform 0.4s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.toast button {
    border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--text);
    border-radius: 9px; padding: 5px 11px; font: inherit; font-size: 0.8rem; cursor: pointer; white-space: nowrap;
}
.toast button:hover { background: var(--accent-mid); }

/* ── Tooltip statt title-Attribut ─────────────────────────────── */
.tip {
    position: fixed; z-index: 95; pointer-events: none; max-width: 280px; padding: 7px 10px; border-radius: 9px;
    background: var(--surface-pop); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    font-size: 0.78rem; line-height: 1.4; opacity: 0; transform: translateY(4px);
    transition: opacity 0.15s var(--ease-micro), transform 0.15s var(--ease-micro);
}
.tip.show { opacity: 1; transform: none; }

/* ── Konfetti-Teilchen ────────────────────────────────────────── */
.confetti { position: fixed; z-index: 120; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; }

/* ── Leere Zustände ───────────────────────────────────────────── */
.empty-state {
    grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; text-align: center;
    padding: 44px 20px; border: 1px dashed var(--border); border-radius: 16px; background: var(--panel);
}
.empty-state .es-icon { font-size: 2rem; color: var(--accent); animation: float 3.2s ease-in-out infinite; }
.empty-state h3 { font-size: 1.05rem; }
.empty-state p { color: var(--muted); font-size: 0.88rem; max-width: 44ch; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ── Reduzierte Bewegung ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
