/*
 * Styles for work.html. Theme tokens (--bg, --fg, --accent, --cta, ...) and the
 * shared header/footer classes come from css/index.css, loaded first.
 */

.wk-main {
    color: var(--fg);
    background: var(--bg);
    font-family: Lato, system-ui, sans-serif;
    padding-top: 69px
}

/* ---- Page header ---- */
.wk-head {
    max-width: 1760px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: clamp(48px, 7vw, 96px) clamp(20px, 4.5vw, 80px) clamp(28px, 3vw, 44px);
    display: flex;
    flex-direction: column;
    gap: 28px
}

.wk-back {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color .2s, gap .3s
}

.wk-back:hover {
    color: var(--fg);
    gap: 12px
}

.wk-head__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px 40px
}

.wk-title {
    margin: 0;
    font-family: Syne, Poppins, sans-serif;
    font-weight: 800;
    font-size: clamp(40px, 7.8vw, 112px);
    line-height: .92;
    letter-spacing: -.045em;
    color: var(--fg)
}

.wk-title__outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--fg)
}

.wk-title__dot {
    color: var(--accent)
}

.wk-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 8px
}

.wk-filter {
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--fg);
    font: 700 14px Lato, system-ui, sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: background .3s, color .3s, border-color .3s
}

.wk-filter:hover {
    border-color: var(--fg)
}

.wk-filter--on {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg)
}

.wk-filter__count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    opacity: .7
}

/* ---- Bento grid ----
 * 12 columns; each tile spans --c columns and --r rows (set inline from
 * js/work.js). grid-auto-flow: dense backfills any gaps. */
.bento {
    max-width: 1760px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 0 clamp(20px, 4.5vw, 80px) clamp(64px, 8vw, 120px);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: clamp(96px, 8.4vw, 136px);
    grid-auto-flow: dense;
    gap: clamp(14px, 1.4vw, 20px)
}

.bento-tile {
    grid-column: span var(--c, 4);
    grid-row: span var(--r, 3);
    min-width: 0;
    border-radius: 26px;
    animation: bento-in .7s cubic-bezier(.2, .7, .2, 1) both
}

@keyframes bento-in {
    from {
        opacity: 0;
        transform: translateY(18px)
    }
}

/* Project tile: full cover (never cropped — covers have text baked in) on a
 * blurred copy of itself, with a name bar underneath. */
.bento-project {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--fg);
    transition: transform .5s cubic-bezier(.2, .7, .2, 1), border-color .4s, box-shadow .5s
}

.bento-project:hover,
.bento-project:focus-visible {
    color: var(--fg);
    transform: translateY(-4px);
    border-color: color-mix(in oklab, var(--cta) 55%, var(--line));
    box-shadow: 0 30px 60px -34px color-mix(in oklab, var(--cta) 70%, transparent)
}

.bento-project__media {
    position: relative;
    flex-grow: 1;
    min-height: 0;
    box-sizing: border-box;
    padding: var(--pad, 28px 28px 16px);
    overflow: hidden;
    background: var(--soft);
    display: flex;
    align-items: center;
    justify-content: center
}

.bento-project__backdrop {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    max-width: none;
    object-fit: cover;
    filter: blur(40px) saturate(1.3);
    opacity: .65
}

.bento-project__cover {
    position: relative;
    display: block;
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0 26px 50px -24px rgba(0, 0, 0, .6);
    transition: transform .9s cubic-bezier(.2, .7, .2, 1)
}

.bento-project:hover .bento-project__cover {
    transform: scale(1.05)
}

.bento-project__kind {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 11px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--bg) 78%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--fg)
}

.bento-project__bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 20px 24px
}

.bento-project__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0
}

.bento-project__name {
    font-family: Syne, Poppins, sans-serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.bento-project__name--lg {
    font-size: clamp(22px, 2vw, 28px)
}

.bento-project__name--sm {
    font-size: 19px
}

.bento-project__sub {
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.bento-project__arrow {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cta);
    color: var(--oncta);
    display: grid;
    place-items: center;
    transition: transform .45s cubic-bezier(.2, .7, .2, 1)
}

.bento-project:hover .bento-project__arrow,
.bento-project:focus-visible .bento-project__arrow {
    transform: rotate(45deg)
}

/* Stat + contact tiles */
.bento-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase
}

.bento-stat,
.bento-cta {
    box-sizing: border-box;
    padding: clamp(22px, 2.2vw, 30px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px
}

.bento-stat {
    background: var(--accent);
    color: var(--onaccent)
}

.bento-stat__row {
    display: flex;
    justify-content: space-between;
    gap: 12px
}

.bento-stat__item {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.bento-stat__num {
    font-family: Syne, Poppins, sans-serif;
    font-weight: 800;
    font-size: clamp(34px, 3vw, 44px);
    line-height: 1;
    letter-spacing: -.04em
}

.bento-stat__label {
    font-size: 14px;
    font-weight: 700
}

.bento-cta {
    background: var(--cta);
    color: var(--oncta)
}

.bento-cta__title {
    font-family: Syne, Poppins, sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 2.2vw, 32px);
    line-height: 1.05;
    letter-spacing: -.03em
}

.bento-cta__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.bento-cta__mail,
.bento-cta__mail:hover {
    color: var(--oncta);
    font-size: 15px;
    font-weight: 700
}

.bento-cta__btn {
    padding: 13px 20px;
    border-radius: 999px;
    background: var(--oncta);
    color: var(--cta);
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    transition: transform .3s
}

.bento-cta__btn:hover {
    color: var(--cta);
    transform: translateX(4px)
}

/* Tablet: an even two-up grid, tiles sized by their cover instead of by rows. */
@media (max-width: 1099px) {
    .bento {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: auto
    }

    .bento-tile {
        grid-column: auto;
        grid-row: auto
    }

    .bento-project__media {
        flex-grow: 0;
        aspect-ratio: 16 / 10;
        padding: 22px 22px 12px
    }

    .bento-stat,
    .bento-cta {
        grid-column: 1 / -1
    }

    .bento-project__name,
    .bento-project__name--lg,
    .bento-project__name--sm {
        font-size: 22px;
        white-space: normal
    }
}

/* Phone: one column. */
@media (max-width: 639px) {
    .bento {
        grid-template-columns: minmax(0, 1fr)
    }

    .bento-stat__num {
        font-size: 32px
    }
}

@media (prefers-reduced-motion: reduce) {
    .bento-tile {
        animation: none
    }
}

/* Current page in the shared header nav */
.wk-nav-current {
    color: var(--fg);
    background: var(--soft)
}
