/* ==============================
   WILA GLASS FOLDER SLIDER
================================ */

.wila-gf {
    --wgf-scale: 1;
    --wgf-gap: 32px;
    --wgf-side: 24px;
    --wgf-blur: 22px;
    --wgf-tint-1: rgba(255, 255, 255, 0.16);
    --wgf-tint-2: rgba(255, 255, 255, 0.5);
    --wgf-tint-3: rgba(252, 252, 252, 0.93);
    --wgf-shadow: rgba(0, 0, 0, 0.55);
    --wgf-ink: #141416;
    --wgf-ink-soft: rgba(20, 20, 22, 0.55);
    --wgf-sheet-1: #ffffff;
    --wgf-sheet-2: #f2f2f0;

    width: 100%;
    -webkit-font-smoothing: antialiased;
}

.wila-gf,
.wila-gf * {
    box-sizing: border-box;
}

/* ---------- Viewport / track ---------- */

.wila-gf__viewport {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 40px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wila-gf__viewport::-webkit-scrollbar {
    display: none;
}

.wila-gf__viewport:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: -2px;
}

.wila-gf__track {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--wgf-gap);
    padding: 0 max(var(--wgf-side), calc((60% - 340px * var(--wgf-scale)) / 2));
}

.wila-gf-align-start .wila-gf__track {
    padding: 0 var(--wgf-side);
}

/* ---------- Folder ---------- */

.wila-gf-folder {
    --gf-px: 0;
    --gf-py: 0;
    --gf-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --gf-spring: cubic-bezier(0.34, 1.36, 0.5, 1);
    --gf-hinge: 0deg;
    --gf-lift: 42px;
    --gf-spread: 0px;
    --gf-fan: 0deg;
    --gf-stack: 15px;

    position: relative;
    flex: 0 0 auto;
    width: calc(340px * var(--wgf-scale));
    height: calc(326px * var(--wgf-scale));
    scroll-snap-align: center;
    isolation: isolate;
    user-select: none;
    -webkit-user-select: none;
}

.wila-gf-align-start .wila-gf-folder {
    scroll-snap-align: start;
    scroll-margin-left: var(--wgf-side);
}

/* Fixed-size artwork scaled to the chosen card size */

.wila-gf-folder__scaler {
    position: absolute;
    left: 0;
    top: 0;
    width: 340px;
    height: 326px;
    transform: scale(var(--wgf-scale));
    transform-origin: 0 0;
}

@media (hover: hover) {
    .wila-gf-folder:hover {
        --gf-hinge: -11deg;
        --gf-lift: -34px;
        --gf-spread: 8px;
        --gf-fan: 1.4deg;
        --gf-stack: 10px;
    }
}

.wila-gf-folder.is-open {
    --gf-hinge: -24deg;
    --gf-lift: -96px;
    --gf-spread: 40px;
    --gf-fan: 5deg;
    --gf-stack: 30px;
}

.wila-gf-folder__stage {
    position: absolute;
    left: 0;
    top: 0;
    width: 340px;
    height: 272px;
    transform: translateY(54px);
}

.wila-gf-folder__tilt {
    position: absolute;
    inset: 0;
    transform: perspective(1400px) rotateX(calc(var(--gf-py) * -3deg)) rotateY(calc(var(--gf-px) * 4deg));
    transition: transform 0.9s var(--gf-ease);
}

.wila-gf-folder__shadow {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: -6px;
    height: 60px;
    border-radius: 40px;
    background: var(--wgf-shadow);
    filter: blur(22px);
    transform: translateX(calc(var(--gf-px) * -8px));
    transition: transform 0.9s var(--gf-ease);
}

/* ---------- Back panel ---------- */

.wila-gf-folder__back {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #f3f3f4 0%, #e3e3e6 100%);
    clip-path: path("M0 56A22 22 0 0 1 22 34L146 34C170 34 172 0 198 0L318 0A22 22 0 0 1 340 22L340 250A22 22 0 0 1 318 272L22 272A22 22 0 0 1 0 250Z");
}

.wila-gf-folder__art {
    position: absolute;
    left: -12px;
    top: -12px;
    width: calc(100% + 24px);
    max-width: none;
    height: calc(100% + 24px);
    object-fit: cover;
    transform: translate(calc(var(--gf-px) * -7px), calc(var(--gf-py) * -6px)) scale(1.02);
    transition: transform 1.1s var(--gf-ease);
}

.wila-gf-folder__sheen {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 22%),
        radial-gradient(120% 80% at 80% 0%, rgba(255, 255, 255, 0.16), transparent 60%);
    pointer-events: none;
}

/* ---------- Files behind the glass ---------- */

.wila-gf-folder__files {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    clip-path: inset(-400px -400px 10px -400px);
}

.wila-gf-sheet {
    --gf-depth: 0;
    --gf-dir: 0;
    --gf-jx: calc(var(--gf-spread) * var(--gf-dir));
    --gf-jr: calc(var(--gf-fan) * var(--gf-dir));

    position: absolute;
    left: 34px;
    top: 96px;
    display: block;
    width: 272px;
    height: 184px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    pointer-events: auto;
    text-decoration: none;
    background: linear-gradient(180deg, var(--wgf-sheet-1) 0%, var(--wgf-sheet-2) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 0.5px rgba(0, 0, 0, 0.1),
        0 10px 26px -8px rgba(10, 12, 20, 0.28);
    transform-origin: 50% 100%;
    transform:
        translate(var(--gf-jx), calc(var(--gf-lift) + var(--gf-depth) * var(--gf-stack) * -1))
        rotate(var(--gf-jr));
    transition: transform 0.75s var(--gf-spring), box-shadow 0.4s var(--gf-ease);
}

/* Up to three files fan out behind each other */

.wila-gf-sheet--1 { --gf-depth: 0; --gf-dir: 0; z-index: 3; }
.wila-gf-sheet--2 { --gf-depth: 1; --gf-dir: -1; z-index: 2; }
.wila-gf-sheet--3 { --gf-depth: 2; --gf-dir: 1; z-index: 1; }

.wila-gf-folder.is-open .wila-gf-sheet:hover {
    transform:
        translate(var(--gf-jx), calc(var(--gf-lift) + var(--gf-depth) * var(--gf-stack) * -1 - 18px))
        rotate(var(--gf-jr));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 0.5px rgba(0, 0, 0, 0.1),
        0 22px 40px -12px rgba(10, 12, 20, 0.42);
}

.wila-gf-sheet__head {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 11px;
    z-index: 1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.wila-gf-sheet__name {
    overflow: hidden;
    color: #18181b;
    font-size: 12.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wila-gf-sheet__meta {
    color: rgba(24, 24, 27, 0.5);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    white-space: nowrap;
}

.wila-gf-sheet__lines {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 40px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.wila-gf-sheet__lines i {
    display: block;
    height: 5px;
    border-radius: 3px;
    background: rgba(24, 24, 27, 0.08);
}

.wila-gf-sheet__lines i:first-child {
    height: 9px;
    margin-bottom: 4px;
    background: rgba(24, 24, 27, 0.14);
}

/* ---------- Frosted front glass ---------- */

.wila-gf-folder__front {
    position: absolute;
    left: 0;
    top: 74px;
    z-index: 10;
    width: 340px;
    height: 198px;
    -webkit-backdrop-filter: blur(var(--wgf-blur)) saturate(1.5);
    backdrop-filter: blur(var(--wgf-blur)) saturate(1.5);
    transform-origin: 50% 100%;
    transform: perspective(760px) rotateX(var(--gf-hinge));
    transition: transform 0.8s var(--gf-spring);
    clip-path: path("M0 22A22 22 0 0 1 22 0L118 0C144 0 146 32 172 32L318 32A22 22 0 0 1 340 54L340 176A22 22 0 0 1 318 198L22 198A22 22 0 0 1 0 176Z");
}

.wila-gf-folder__tint {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--wgf-tint-1) 0%, var(--wgf-tint-2) 42%, var(--wgf-tint-3) 100%);
}

.wila-gf-folder__hit {
    position: absolute;
    inset: 0;
    z-index: 1;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
}

.wila-gf-folder__hit:focus-visible {
    outline: 2px solid rgba(20, 20, 22, 0.6);
    outline-offset: -6px;
}

.wila-gf-folder__label {
    position: absolute;
    left: 28px;
    bottom: 32px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--wgf-ink);
    pointer-events: none;
}

.wila-gf-folder__title {
    color: var(--wgf-ink);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.15;
}

.wila-gf-folder__meta {
    color: var(--wgf-ink-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

/* ---------- Arrows ---------- */

.wila-gf__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.wila-gf__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.wila-gf__btn svg {
    width: 20px;
    height: 20px;
}

.wila-gf__btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    transform: scale(1.05);
}

.wila-gf__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.wila-gf__btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .wila-gf-folder__tilt,
    .wila-gf-folder__shadow,
    .wila-gf-folder__art,
    .wila-gf-folder__front,
    .wila-gf-sheet,
    .wila-gf__btn {
        transition: none;
    }
}
