/* ═══════════════════════════════════════════════════════════
   PAGE-WORKS.CSS — works.php (and shared bits for case.php)
   Featured carousel · discipline filter · bento grid with
   hover "flip-through" peeks · moving wall · CTA
   ═══════════════════════════════════════════════════════════ */

/* overflow-x:hidden turns .page-content into a scroll container, which
   breaks position:sticky (filter bar, chapter nav). clip does not. */
.page-content { overflow-x: clip; }

.wk {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}
@media (min-width: 640px)  { .wk { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .wk { padding-inline: 2rem; } }

.wk-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-gray-500);
}
.wk-script { font-family: var(--font-designer); font-weight: 400; font-size: 1.12em; }
.wk-h2 {
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--color-gray-900);
}

/* ── Intro ─────────────────────────────────────────────── */
.wk-hero {
    text-align: center;
    padding: 1.5rem 0 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}
.wk-title {
    font-size: clamp(2.4rem, 7vw, 4.75rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--color-gray-900);
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}
.wk-title-script {
    position: relative;
    display: inline-block;
    font-family: var(--font-designer);
    font-weight: 400;
    font-size: 1.12em;
    letter-spacing: 0;
}
.wk-title-script > span { position: relative; z-index: 1; }
.wk-title-script svg {
    position: absolute; width: 112%; left: -6%; height: 42%; bottom: 6%; z-index: 0; overflow: visible;
}
/* ── Job-title entry points (links to role.php pages) ── */
.wk-roles { width: 100%; max-width: 62rem; margin-top: 0.35rem; }
.wk-roles-label { font-size: 0.78rem; font-weight: 700; color: var(--color-gray-500); margin-bottom: 0.6rem; }
.wk-roles-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem;
}
.wk-role {
    display: inline-flex; align-items: center; gap: 0.5rem;
    min-height: 2.75rem; padding: 0 0.6rem 0 0.45rem;
    border-radius: 999px; background: #fff;
    border: 1px solid var(--color-gray-200);
    color: var(--color-gray-900); text-decoration: none;
    font-size: 0.86rem; font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, border-color .2s ease, background-color .2s ease, color .2s ease;
}
.wk-role-ico {
    display: inline-grid; place-items: center;
    width: 1.9rem; height: 1.9rem; border-radius: 999px;
    background: var(--color-gray-100); color: var(--color-gray-700);
    transition: background-color .2s ease, color .2s ease;
}
.wk-role-go { color: var(--color-gray-400); font-weight: 800; transition: transform .2s ease, color .2s ease; }
.wk-role:hover, .wk-role:focus-visible { transform: translateY(-2px); border-color: var(--color-gray-900); background: var(--color-gray-900); color: #fff; }
.wk-role:hover .wk-role-ico, .wk-role:focus-visible .wk-role-ico { background: var(--color-yellow); color: var(--color-gray-900); }
.wk-role:hover .wk-role-go, .wk-role:focus-visible .wk-role-go { color: var(--color-yellow); transform: translateX(2px); }
@media (max-width: 520px) {
    .wk-roles-list { display: grid; grid-template-columns: 1fr; gap: 0.45rem; }
    .wk-role { width: 100%; justify-content: flex-start; }
    .wk-role-go { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .wk-role, .wk-role-go { transition: none; } }

.wk-lede {
    max-width: 44rem;
    color: var(--color-gray-600);
    font-size: clamp(0.92rem, 1.6vw, 1.06rem);
    line-height: 1.7;
    font-weight: 500;
}
.wk-counters {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.4rem;
}
.wk-counters li {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.75);
    border: 1px solid var(--color-gray-100);
    box-shadow: var(--shadow-card);
}
.wk-counters strong { font-size: 1.15rem; font-weight: 800; color: var(--color-gray-900); }
.wk-counters span  { font-size: 0.78rem; font-weight: 600; color: var(--color-gray-500); }

/* ── Chips / arrows (shared) ───────────────────────────── */
.wk-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: var(--color-gray-100);
    color: var(--color-gray-700);
    white-space: nowrap;
}
.wk-chip--glass {
    background: rgba(255,255,255,0.18);
    color: #fff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.28);
}
.wk-arrow {
    width: 2.6rem; height: 2.6rem;
    border-radius: 999px;
    border: 1px solid var(--color-gray-200);
    background: #fff;
    color: var(--color-gray-900);
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.wk-arrow:hover { background: var(--color-gray-900); color: #fff; transform: scale(1.06); }
.wk-arrow:disabled { opacity: 0.35; pointer-events: none; }

/* ── Featured carousel ─────────────────────────────────── */
.wk-featured { margin: 0.5rem 0 3.5rem; }
.wk-featured-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
    margin-bottom: 1rem;
}
.wk-featured-nav { display: flex; gap: 0.5rem; }
.wk-featured-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(86%, 1080px);
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0.25rem 0 1rem;
    scrollbar-width: none;
    cursor: grab;
}
.wk-featured-track::-webkit-scrollbar { display: none; }
.wk-featured-track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.wk-slide {
    position: relative;
    display: block;
    scroll-snap-align: start;
    aspect-ratio: 16 / 9;
    border-radius: 1.75rem;
    overflow: hidden;
    background: var(--accent);
    box-shadow: var(--shadow-xl);
    isolation: isolate;
    user-select: none;
}
@media (max-width: 640px) { .wk-slide { aspect-ratio: 4 / 5; border-radius: 1.35rem; } }
.wk-slide img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform 1.2s cubic-bezier(0.22,1,0.36,1);
    pointer-events: none;
}
.wk-slide:hover img { transform: scale(1.07); }
.wk-slide-shade {
    position: absolute; inset: 0; z-index: 1;
    background:
        linear-gradient(to top, color-mix(in srgb, var(--accent) 92%, black) 0%, color-mix(in srgb, var(--accent) 55%, transparent) 32%, transparent 62%),
        linear-gradient(to right, rgba(0,0,0,0.25), transparent 50%);
}
.wk-slide-num {
    position: absolute; top: 1rem; right: 1.25rem; z-index: 2;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 800; letter-spacing: -0.05em; line-height: 1;
    color: rgba(255,255,255,0.0);
    -webkit-text-stroke: 1.5px rgba(255,255,255,0.65);
}
.wk-slide-body {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: clamp(1.1rem, 3vw, 2.25rem);
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.55rem;
    color: #fff;
}
.wk-slide-title {
    font-size: clamp(1.7rem, 4.6vw, 3.6rem);
    font-weight: 800; letter-spacing: -0.035em; line-height: 1;
    text-shadow: 0 6px 30px rgba(0,0,0,0.25);
}
.wk-slide-tag { max-width: 40rem; font-size: clamp(0.85rem, 1.5vw, 1.02rem); font-weight: 500; opacity: 0.92; line-height: 1.5; }
.wk-slide-cta {
    margin-top: 0.35rem;
    font-size: 0.82rem; font-weight: 700;
    padding: 0.55rem 1rem; border-radius: 999px;
    background: #fff; color: var(--color-gray-900);
    transform: translateY(6px); opacity: 0.0;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.wk-slide:hover .wk-slide-cta, .wk-slide:focus-visible .wk-slide-cta { opacity: 1; transform: none; }
@media (hover: none) { .wk-slide-cta { opacity: 1; transform: none; } }
/* Phones: image on top, story panel in the brand colour below, so a
   cover that already carries its own lettering never fights the title. */
@media (max-width: 640px) {
    .wk-slide { aspect-ratio: auto; display: flex; flex-direction: column; }
    .wk-slide img { position: relative; inset: auto; height: auto; aspect-ratio: 4 / 3; transform: none; }
    .wk-slide-shade { display: none; }
    .wk-slide-num { top: 0.75rem; right: 0.9rem; font-size: 2.4rem; }
    .wk-slide-body { position: relative; background: var(--accent); color: var(--ink); flex: 1; gap: 0.45rem; }
    .wk-slide-body .wk-chip--glass { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 35%, transparent); background: color-mix(in srgb, var(--ink) 12%, transparent); }
    .wk-slide-title { font-size: 1.6rem; text-shadow: none; }
    .wk-slide-tag { font-size: 0.85rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
.wk-dots { display: flex; justify-content: center; gap: 0.4rem; margin-top: 0.25rem; }
.wk-dot { width: 0.45rem; height: 0.45rem; border-radius: 999px; background: var(--color-gray-300); transition: width 0.35s ease, background 0.35s ease; }
.wk-dot.is-on { width: 1.6rem; background: var(--color-gray-900); }

/* ── All work: head + filter ───────────────────────────── */
.wk-all { scroll-margin-top: 6rem; }
.wk-all-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 1rem; }
.wk-all-hint { font-size: 0.8rem; color: var(--color-gray-500); font-weight: 500; }

.wk-filter {
    position: sticky;
    top: 5.25rem;
    z-index: 30;
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.5rem;
    margin: 0 -0.5rem 1.25rem;
    border-radius: 999px;
    background: rgba(250,249,247,0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    scrollbar-width: none;
}
.wk-filter::-webkit-scrollbar { display: none; }
.wk-pill {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--color-gray-200);
    background: #fff;
    color: var(--color-gray-700);
    font-size: 0.8rem; font-weight: 700;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.wk-pill:hover { transform: translateY(-1px); border-color: var(--color-gray-400); }
.wk-pill.is-active { background: var(--color-gray-900); border-color: var(--color-gray-900); color: #fff; }
.wk-pill-n {
    font-size: 0.66rem; font-weight: 800;
    min-width: 1.3rem; padding: 0.1rem 0.35rem;
    border-radius: 999px; text-align: center;
    background: var(--color-gray-100); color: var(--color-gray-600);
}
.wk-pill.is-active .wk-pill-n { background: var(--color-yellow); color: var(--color-gray-900); }

/* ── Bento grid ────────────────────────────────────────── */
.wk-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    grid-auto-flow: row dense;
    gap: 1rem;
}
@media (min-width: 640px)  { .wk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .wk-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.15rem; } }

.wk-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 1.5rem;
    background: #fff;
    border: 1px solid var(--color-gray-100);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.22,1,0.36,1), box-shadow 0.5s ease, opacity 0.35s ease;
    min-width: 0;
}
.wk-card:hover { transform: translateY(-6px); box-shadow: 0 26px 50px -18px rgba(0,0,0,0.22); }
.wk-card.is-hidden { display: none; }
.wk-card.is-entering { animation: wkIn 0.55s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes wkIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }

.wk-card--wide { grid-column: span 1; }
.wk-card--xl   { grid-column: span 1; }
@media (min-width: 640px) {
    .wk-card--wide, .wk-card--xl { grid-column: span 2; }
}
@media (min-width: 1100px) {
    .wk-card--xl { grid-row: span 2; }
}

.wk-card-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: color-mix(in srgb, var(--accent) 22%, #f2f1ef);
}
.wk-card--wide .wk-card-media { aspect-ratio: 16 / 8.2; }
@media (min-width: 1100px) {
    .wk-card--xl { display: flex; }
    .wk-card--xl .wk-card-media { aspect-ratio: auto; flex: 1; min-height: 22rem; }
}
.wk-card-media img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.6s ease, transform 1.4s cubic-bezier(0.22,1,0.36,1);
}
.wk-card-media img.is-on { opacity: 1; transform: scale(1); }
.wk-card:hover .wk-card-media img.is-on { transform: scale(1.05); }
.wk-card-media::after {
    content: '';
    position: absolute; inset: auto 0 0 0; height: 4px;
    background: var(--accent);
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.wk-card:hover .wk-card-media::after { transform: scaleX(1); }
.wk-peek-bar {
    position: absolute; left: 0.75rem; right: 0.75rem; top: 0.75rem; z-index: 2;
    display: flex; gap: 0.3rem;
    opacity: 0; transition: opacity 0.3s ease;
}
.wk-card:hover .wk-peek-bar { opacity: 1; }
.wk-peek-bar i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,0.45); overflow: hidden; position: relative; }
.wk-peek-bar i.is-on { background: #fff; }

.wk-card-info {
    display: flex; flex-direction: column; gap: 0.3rem;
    padding: 0.95rem 1.05rem 1rem;
}
.wk-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.wk-card-year { font-size: 0.72rem; font-weight: 700; color: var(--color-gray-400); }
.wk-card-title {
    font-size: 1.08rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25;
    color: var(--color-gray-900);
    margin-top: 0.2rem;
}
.wk-card--xl .wk-card-title { font-size: clamp(1.25rem, 2vw, 1.6rem); }
.wk-card-client { font-size: 0.8rem; font-weight: 500; color: var(--color-gray-500); line-height: 1.45; }
.wk-card-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.72rem; font-weight: 700; color: var(--color-gray-400);
}
.wk-card-go {
    width: 2rem; height: 2rem; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-gray-100); color: var(--color-gray-900);
    transition: background 0.35s ease, color 0.35s ease, transform 0.35s ease;
}
.wk-card:hover .wk-card-go { background: var(--accent); color: var(--ink); transform: rotate(45deg); }
.wk-empty { text-align: center; color: var(--color-gray-500); padding: 3rem 0; }

/* ── Moving wall ───────────────────────────────────────── */
.wk-wall {
    margin: 4rem calc(50% - 50vw) 1rem;
    display: flex; flex-direction: column; gap: 0.9rem;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.wk-wall-row { overflow: hidden; }
.wk-wall-track {
    display: flex; gap: 0.9rem; width: max-content;
    animation: wkMarquee 90s linear infinite;
}
.wk-wall-row--rev .wk-wall-track { animation-direction: reverse; animation-duration: 110s; }
.wk-wall:hover .wk-wall-track { animation-play-state: paused; }
.wk-wall-item {
    flex: 0 0 auto;
    height: clamp(7rem, 14vw, 11rem);
    aspect-ratio: 4 / 3;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--color-gray-100);
}
.wk-wall-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease, filter 0.6s ease; filter: saturate(0.85); }
.wk-wall-item:hover img { transform: scale(1.08); filter: saturate(1.1); }
@keyframes wkMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── CTA ───────────────────────────────────────────────── */
.wk-cta {
    margin-top: 3.5rem;
    padding: clamp(2rem, 5vw, 3.5rem) 1.25rem;
    text-align: center;
    border-radius: 2rem;
    background: #fff;
    border: 1px solid var(--color-gray-100);
    box-shadow: var(--shadow-card);
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.wk-cta-title {
    max-width: 40rem;
    font-size: clamp(1.4rem, 3.4vw, 2.3rem);
    font-weight: 800; letter-spacing: -0.03em; line-height: 1.2;
}
.wk-cta-btn { height: 3rem; padding: 0 1.75rem; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
    .wk-wall-track { animation: none; }
    .wk-card, .wk-card-media img, .wk-slide img { transition: none; }
}

/* Portrait covers in the featured carousel: whole image, right side, on a blurred bed */
.wk-slide img.wk-slide-blur { filter: blur(34px) saturate(1.2) brightness(0.9); transform: scale(1.15); }
.wk-slide img.wk-slide-whole {
    left: auto; right: 6%; top: 7%; bottom: 7%; height: 86%; width: auto; max-width: 46%;
    object-fit: contain; border-radius: 1rem; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
}
.wk-slide:hover img.wk-slide-whole { transform: scale(1.03); }
@media (max-width: 640px) {
    .wk-slide img.wk-slide-blur { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
    .wk-slide img.wk-slide-whole { position: relative; right: auto; top: auto; bottom: auto; margin: 1rem auto; height: 15rem; max-width: 80%; aspect-ratio: auto; }
    .wk-slide-body { z-index: 2; }
}
/* Portrait covers in grid cards: keep faces and headlines in frame */
.wk-card-media img { object-position: center 30%; }

/* Whole-image frames: overlays stay above the contained image */
.wk-card-media::after { z-index: 2; }
.wk-card-media .wk-peek-bar { z-index: 3; }

/* Hint matches the device: hover on mouse screens, tap on touch screens */
.wk-hint-touch { display: none; }
@media (hover: none) { .wk-hint-hover { display: none; } .wk-hint-touch { display: inline; } }

/* Tablets (2 columns): only the strongest projects take a full row */
@media (min-width: 640px) and (max-width: 1099px) {
    .wk-card--wide { grid-column: span 1; }
    .wk-card--wide .wk-card-media { aspect-ratio: 4 / 3; }
}
