/* ---- Stash: Layout ---- */
#tab-stash {
    padding: 0 24px 100px;
}

.stash-wrap {
    width: 100%;
    max-width: 1040px;
    margin-top: 0;
    padding-top: 100px;
}

/* ---- Stash: Hero (staggered) ---- */
.stash-hero {
    text-align: center;
    margin-bottom: 52px;
}

.stash-hero [data-stash-hero] {
    opacity: 0;
    animation: stashHeroReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stash-hero .stash-badge { animation-delay: 0.05s; }
.stash-hero .stash-title { animation-delay: 0.18s; }
.stash-hero .stash-sub { animation-delay: 0.35s; }

@keyframes stashHeroReveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stash-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 4px;
    color: var(--accent);
    margin-bottom: 16px;
    padding: 8px 18px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 100px;
    box-shadow: 0 0 24px -4px rgba(59, 130, 246, 0.12);
}

.stash-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 7vw, 3.5rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 12px;
    letter-spacing: -1.5px;
    line-height: 1.05;
    text-shadow: 0 0 60px rgba(59, 130, 246, 0.2);
}

.stash-sub {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
    font-weight: 500;
}

/* ---- Stash: Category pills ---- */
.stash-cats {
    position: relative;
    display: flex;
    gap: 4px;
    margin-bottom: 48px;
    padding: 8px;
    background: rgba(12, 12, 16, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.stash-cats-pill {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 8px;
    width: 64px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.28) 0%, rgba(59, 130, 246, 0.12) 100%);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 50px;
    box-shadow: 0 2px 14px rgba(59, 130, 246, 0.25);
    transition: left 0.5s var(--ease-snap), width 0.45s var(--ease-snap);
    pointer-events: none;
    z-index: 0;
}

.stash-cat-btn {
    position: relative;
    z-index: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s var(--ease-snap);
}

.stash-cat-btn:hover {
    color: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
}

.stash-cat-btn.active {
    color: white;
    font-weight: 600;
}

/* ---- Stash: Grid ---- */
.stash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

/* ---- Stash: Script cards (per-category accent + animations) ---- */
.script-card {
    --stash-accent: 59, 130, 246;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.45s var(--ease-snap), border-color 0.35s ease, box-shadow 0.45s ease, background 0.35s ease;
    animation: stashCardIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.script-card--utility { --stash-accent: 59, 130, 246; }
.script-card--visual { --stash-accent: 139, 92, 246; }
.script-card--performance { --stash-accent: 16, 185, 129; }

.script-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 0%, transparent 42%, rgba(255, 255, 255, 0.035) 50%, transparent 58%, transparent 100%);
    background-size: 200% 100%;
    background-position: 200% 0;
    opacity: 0;
    transition: opacity 0.4s ease, background-position 0s 0.4s;
    pointer-events: none;
    z-index: 0;
}

.script-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(var(--stash-accent), 0.3);
    transform: translateY(-8px);
    box-shadow:
        0 24px 48px -16px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 40px -12px rgba(var(--stash-accent), 0.2);
}

.script-card:hover::before {
    opacity: 1;
    background-position: -100% 0;
    transition: opacity 0.4s ease, background-position 0.55s var(--ease-snap);
}

.script-card:active {
    transform: translateY(-4px);
    transition-duration: 0.15s;
}

@keyframes stashCardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Stagger applied via inline style in JS */
.script-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.script-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.3;
    transition: color 0.25s ease;
}

.script-card:hover .script-title {
    color: rgba(255, 255, 255, 0.98);
}

.script-tag {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(var(--stash-accent), 0.12);
    border: 1px solid rgba(var(--stash-accent), 0.25);
    color: rgb(var(--stash-accent));
    flex-shrink: 0;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s var(--ease-snap);
}

.script-card:hover .script-tag {
    background: rgba(var(--stash-accent), 0.2);
    border-color: rgba(var(--stash-accent), 0.4);
    transform: scale(1.02);
}

.script-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 18px;
    flex-grow: 1;
    position: relative;
    z-index: 1;
    transition: color 0.25s ease;
}

.script-card:hover .script-desc {
    color: rgba(255, 255, 255, 0.8);
}

/* ---- Code block ---- */
.code-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 18px;
    margin-bottom: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #94a3b8;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: 130px;
    position: relative;
    z-index: 1;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.script-card:hover .code-container {
    border-color: rgba(var(--stash-accent), 0.15);
    box-shadow: 0 0 20px -8px rgba(var(--stash-accent), 0.1);
}

.code-preview {
    white-space: pre;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.script-card:hover .code-preview {
    opacity: 1;
}

/* ---- Copy button ---- */
.copy-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.92);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.35s var(--ease-snap);
    position: relative;
    z-index: 1;
}

.copy-btn:hover {
    background: rgba(var(--stash-accent), 0.12);
    border-color: rgba(var(--stash-accent), 0.35);
    color: white;
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0) scale(0.98);
}

.copy-btn.copied {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
    box-shadow: 0 0 24px -6px rgba(16, 185, 129, 0.35);
}

.copy-btn.copied span {
    animation: stashCopyPop 0.45s var(--ease-snap);
}

@keyframes stashCopyPop {
    0% { transform: scale(1); }
    45% { transform: scale(1.12); }
    100% { transform: scale(1); }
}
