/* ===== Works page ===== */

/* ── Stats strip ── */
.wk-stats {
    background: #0c0d0f;
    border-top: 1px solid #161616;
    border-bottom: 1px solid #161616;
}
.wk-stat {
    padding: 26px 0;
    text-align: center;
    border-right: 1px solid #161616;
}
.wk-stat:last-child { border-right: none; }
.wk-stat__num {
    font-size: clamp(1.4rem, 2.2vw, 1.9rem);
    font-weight: 700;
    color: #e8e8e8;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 6px;
}
.wk-stat__label {
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #333;
}

/* ── Section ── */
.wk-section {
    background: #0c0d0f;
    padding: 100px 0 120px;
}
@media (max-width: 767px) { .wk-section { padding: 68px 0 80px; } }

/* ── Section head ── */
.wk-sec__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--base-color);
    display: block;
    margin-bottom: 18px;
}
.wk-sec__title {
    font-size: clamp(2.6rem, 5.5vw, 4.8rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.04em;
    line-height: 1.0;
    margin: 0;
}
.wk-sec__title em {
    font-style: italic;
    font-weight: 300;
    color: rgba(255,255,255,0.3);
}
.wk-sec__lead {
    font-size: 15px;
    color: var(--medium-gray);
    line-height: 2;
    letter-spacing: 0.04em;
    margin: 0;
}
.wk-sec__rule {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 52px 0 48px;
}

/* ── Filter ── */
.wk-filter {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.wk-filter--full {
    margin-top: 44px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 20px;
}
#worksGrid [data-cat] {
    transition: opacity 0.25s ease;
}
.wk-filter__btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.35);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    padding: 10px 22px;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    line-height: 1;
}
.wk-filter__btn:hover {
    color: rgba(255,255,255,0.75);
    border-color: rgba(255,255,255,0.3);
}
.wk-filter__btn.active {
    background: var(--base-color);
    border-color: var(--base-color);
    color: #111;
}

/* ── Card ── */
.wk-card {
    background: #111113;
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: default;
    transition: border-color 0.3s ease,
                box-shadow 0.35s ease;
}
.wk-card:hover {
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* Gold bottom bar on hover */
.wk-card::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--base-color);
    transform: scaleX(0);
    transform-origin: var(--wk-card-origin, left);
    transition: transform 0.55s cubic-bezier(0.76, 0, 0.24, 1);
}
.wk-card:hover::after { transform: scaleX(1); }

/* Image wrap */
.wk-card__img-wrap {
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.wk-card__img-wrap--land { aspect-ratio: 16 / 9; }
.wk-card__img-wrap--sq   { aspect-ratio: 4 / 3; }
.wk-card__img-wrap--wide { aspect-ratio: 21 / 9; }

/* ── Swipe carousel ── */
.wk-swipe {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.wk-swipe__track {
    display: flex;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.wk-swipe__slide {
    flex-shrink: 0;
    position: relative;
    height: 100%;
    overflow: hidden;
    width: 100%; /* JS が setWidths() を呼ぶ前・1枚のみの場合のフォールバック */
}
.wk-swipe__slide img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    pointer-events: none;
    transition: transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.5s ease;
    filter: brightness(0.82);
}
.wk-card:hover .wk-swipe__slide img {
    transform: scale(1.06);
    filter: brightness(0.95);
}
.wk-swipe__dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 3;
}
.wk-swipe__dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: background 0.25s, transform 0.25s;
    cursor: pointer;
}
.wk-swipe__dot.is-active {
    background: var(--base-color);
    transform: scale(1.3);
}
.wk-swipe__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    width: 30px; height: 30px;
    font-size: 14px;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.22s, background 0.22s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    padding: 0;
    line-height: 1;
}
.wk-card__img-wrap:hover .wk-swipe__btn { opacity: 1; }
.wk-swipe__btn:hover { background: rgba(0,0,0,0.7); color: #fff; }
.wk-swipe__btn--prev { left: 10px; }
.wk-swipe__btn--next { right: 10px; }

/* Number tag */
.wk-card__num {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgba(255,255,255,0.25);
    z-index: 2;
    line-height: 1;
}

/* Category badge */
.wk-card__badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 10px 6px;
    line-height: 1;
    z-index: 2;
    writing-mode: vertical-rl;
}
.wk-card__badge--dev { background: rgba(203,163,115,0.15); color: var(--base-color); }
.wk-card__badge--bro { background: rgba(203,163,115,0.15); color: var(--base-color); }

/* Card body */
.wk-card__body {
    padding: 20px 22px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wk-card__cat {
    display: inline-block;
    align-self: flex-start;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--base-color);
    border: 1px solid rgba(203,163,115,0.4);
    padding: 4px 8px;
    line-height: 1;
    margin-bottom: 12px;
}
.wk-card__cat--bro { color: var(--base-color); }

.wk-card__name {
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    font-weight: 700;
    color: #c8c8c8;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0 0 16px;
    transition: color 0.25s ease;
    flex: 1;
}
.wk-card:hover .wk-card__name { color: #fff; }

.wk-card__divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin-bottom: 16px;
}

.wk-card__specs {
    display: flex;
    gap: 28px;
}
.wk-card__spec {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.wk-card__spec-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #444;
}
.wk-card__spec-val {
    font-size: 14px;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.06em;
}

/* Wide card (col-12) body layout */
.wk-card--wide .wk-card__body {
    flex-direction: row;
    align-items: center;
    gap: 40px;
    padding: 22px 28px;
}
.wk-card--wide .wk-card__name { margin-bottom: 0; flex: 1; }
.wk-card--wide .wk-card__divider { display: none; }
.wk-card--wide .wk-card__specs { flex-shrink: 0; }
@media (max-width: 767px) {
    .wk-card--wide .wk-card__body {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .wk-card--wide .wk-card__name { margin-bottom: 4px; }
}

/* hero parallax bg */
#wkHero { min-height: 50vh; }
#wkHero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1;
}
#wkHero .left-panel,
#wkHero .container { position: relative; z-index: 2; }
.wk-hero-bg {
    position: absolute;
    top: -200px;
    bottom: -200px;
    left: 0;
    right: 0;
    background-image: url(../img/works/works_header.jpg);
    background-size: cover;
    background-position: center center;
    z-index: 0;
    will-change: transform;
}
@media (max-width: 767px) {
    .wk-hero-bg { top: -60px; bottom: -60px; }
    #wkHero .row {
        min-height: 50vh;
        align-items: center !important;
        padding-top: 80px;
        padding-bottom: 40px;
    }
}
