/* ──────────────────────────────────────────────────────────────────
   Track F — Loading + Error states
   Spec: docs/superpowers/specs/2026-05-11-track-f-loading-error-states-design.md

   Three sections:
   1. Skeleton primitives (shimmer animation + shape variants)
   2. Inline error card (Tier 2 — per-section with retry)
   3. Fullscreen blocker (Tier 3 — offline/auth/server)
   ────────────────────────────────────────────────────────────────── */

/* ─── Section 1: Skeleton primitives ───────────────────────────── */
@keyframes fym-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.fym-skel {
    background: linear-gradient(
        90deg,
        color-mix(in oklch, var(--surface) 100%, var(--muted) 6%) 25%,
        color-mix(in oklch, var(--surface) 100%, var(--muted) 14%) 50%,
        color-mix(in oklch, var(--surface) 100%, var(--muted) 6%) 75%
    );
    background-size: 200% 100%;
    animation: fym-shimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
}

.fym-skel--pill   { width: 60px;  height: 18px; border-radius: 99px; display: inline-block; }
.fym-skel--circle { width: 36px;  height: 36px; border-radius: 50%; display: inline-block; }
.fym-skel--bar    { height: 12px; border-radius: 3px; display: block; }
.fym-skel--bar-lg { height: 24px; border-radius: 4px; display: block; }
.fym-skel--card   { border-radius: 12px; min-height: 120px; }
.fym-skel--tile   { border-radius: 14px; aspect-ratio: 1; }

.fym-skel-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.fym-skel-list-item:last-child { border-bottom: 0; }

.fym-skel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

/* ─── Section 2: Inline error card (Tier 2) ─────────────────────── */
.fym-err-inline {
    background: color-mix(in oklch, var(--loss) 12%, var(--surface));
    border: 1px solid color-mix(in oklch, var(--loss) 40%, var(--border));
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    color: var(--text);
    margin: 8px 0;
}
.fym-err-inline__icon {
    font-size: 24px;
    opacity: 0.7;
    margin-bottom: 8px;
}
.fym-err-inline__title {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.fym-err-inline__hint {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
}
.fym-err-inline__retry {
    margin-top: 12px;
    background: var(--loss);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    cursor: pointer;
}
.fym-err-inline__retry:hover { filter: brightness(1.1); }

/* ─── Section 3: Fullscreen blocker (Tier 3) ────────────────────── */
.fym-err-blocker {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}
.fym-err-blocker[data-open="true"] {
    opacity: 1;
    pointer-events: auto;
}
.fym-err-blocker__icon {
    font-size: 56px;
    opacity: 0.7;
    margin-bottom: 16px;
}
.fym-err-blocker__title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}
.fym-err-blocker__msg {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
    max-width: 320px;
    line-height: 1.5;
}
.fym-err-blocker__retry {
    margin-top: 24px;
    background: var(--accent);
    color: var(--bg);
    border: 0;
    border-radius: 99px;
    padding: 12px 28px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    cursor: pointer;
}

/* ─── Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .fym-skel {
        animation: none;
        background: color-mix(in oklch, var(--surface) 100%, var(--muted) 10%);
    }
    .fym-err-blocker { transition: none; }
}
