/* ─────────────────────────────────────────────────────────────
   Projects page. Builds on css/home.css (shared type, short hero,
   reveals, CTA box) and the --nz-* tokens from css/layout.css.
   The whole <main> is one cursor-glow area (data-glow), so no section edge cuts the glow.
   ───────────────────────────────────────────────────────────── */

/* ── Filters: a green pill slides under the active category ── */
.nz-filters { position: relative; display: inline-flex; flex-wrap: wrap; gap: 4px; justify-self: start; padding: 6px; border-radius: 999px; border: 1px solid var(--nz-line); background: var(--nz-surface); box-shadow: var(--nz-shadow-sm); }
.nz-filters__pill { position: absolute; left: 0; top: 6px; bottom: 6px; border-radius: 999px; background: var(--nz-green); box-shadow: var(--nz-shadow-green); transition: transform 0.55s var(--nz-spring), width 0.55s var(--nz-spring); }
.nz-filters button { position: relative; z-index: 1; display: inline-flex; align-items: center; padding: 11px 20px; border: 0; border-radius: 999px; background: none; color: var(--nz-ink-2); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: color 0.35s; }
@media (hover: hover) { .nz-filters button:hover { color: var(--nz-ink); } }
.nz-filters button[aria-pressed="true"] { color: var(--nz-ink-on-green); }

/* ── Case list: the list fades out, swaps and fades back in when the filter changes ── */
.nz-cases { display: grid; gap: clamp(110px, 13vw, 180px); transition: opacity 0.35s, transform 0.45s var(--nz-ease); }
.nz-cases.is-switching { opacity: 0; transform: translateY(16px); }
.nz-case { display: grid; gap: clamp(36px, 4vw, 56px); scroll-margin-top: 110px; }
.nz-case[hidden] { display: none; }
.nz-case__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px clamp(36px, 6vw, 96px); align-items: end; }
.nz-case__id { display: grid; gap: 18px; justify-items: start; }
.nz-case__client { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--nz-ink-3); }
.nz-case__client b { width: 9px; height: 9px; margin-right: 4px; border-radius: 2px; background: var(--nz-green); transform: rotate(45deg); box-shadow: 0 0 10px rgba(0, 192, 127, 0.6); }
.nz-case__client > span:not([data-i18n]) { color: var(--nz-line); } /* the "·" separator only */
.nz-case__title { display: grid; gap: 10px; font-size: clamp(38px, 4.8vw, 66px); font-weight: 700; line-height: 1.02; letter-spacing: -0.04em; }
.nz-case__title small { display: block; font-size: clamp(17px, 1.5vw, 21px); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; color: var(--nz-green-soft); }
.nz-case__facts { display: grid; gap: 20px; justify-items: start; }
.nz-case__lead { font-size: clamp(17px, 1.4vw, 19px); line-height: 1.6; color: var(--nz-ink); }
.nz-case__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 6px; }

/* ── Carousel: horizontal scroll with snapping; one slide fills the width, several show a peek of the next ── */
.nz-car { display: grid; gap: 18px; }
.nz-car__track { position: relative; display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; cursor: grab; }
.nz-car__track::-webkit-scrollbar { display: none; }
.nz-car__track.is-drag { scroll-snap-type: none; cursor: grabbing; }
.nz-car__track.is-drag .nz-car__shot { pointer-events: none; }
.nz-car__track:focus-visible { outline: 2px solid var(--nz-green-soft); outline-offset: 6px; border-radius: 28px; }
.nz-car__slide { flex: 0 0 86%; display: grid; gap: 14px; margin: 0; scroll-snap-align: start; }
.nz-car.is-single .nz-car__slide { flex-basis: 100%; }
.nz-car__shot {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--nz-line);
    border-radius: 28px;
    overflow: hidden;
    background: var(--nz-surface);
    box-shadow: var(--nz-card-shadow);
    cursor: zoom-in;
}
.nz-car__shot img { display: block; width: 100%; height: auto; transition: transform 0.9s var(--nz-ease); }
@media (hover: hover) { .nz-car__shot:hover img { transform: scale(1.025); } }
.nz-car__shot:focus-visible { outline: 2px solid var(--nz-green-soft); outline-offset: 4px; }
.nz-car__slide figcaption { padding-left: 4px; color: var(--nz-ink-3); font-size: 14px; }
.nz-car__nav { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.nz-car.is-single .nz-car__nav { display: none; }
.nz-car__count { margin-right: auto; color: var(--nz-ink-3); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nz-car__count b { color: var(--nz-green-soft); }
.nz-car__btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--nz-line); background: var(--nz-surface); color: var(--nz-ink); cursor: pointer; transition: background-color 0.3s, color 0.3s, border-color 0.3s, opacity 0.3s; }
@media (hover: hover) { .nz-car__btn:hover:not(:disabled) { background: var(--nz-green); border-color: var(--nz-green); color: var(--nz-ink-on-green); } }
.nz-car__btn:disabled { opacity: 0.35; cursor: default; }

/* ── Websites: the home's site cards (.nz-sites, 2 or 3 per row); here the image opens the viewer
   and the name links to the case page ── */
.nz-sites--zoom .nz-site__shot { width: 100%; padding: 0; background: var(--nz-surface); box-shadow: var(--nz-card-shadow); cursor: zoom-in; }
@media (hover: hover) { .nz-sites--zoom .nz-site__shot:hover img { transform: scale(1.04); } }
.nz-sites--zoom .nz-site__shot:focus-visible { outline: 2px solid var(--nz-green-soft); outline-offset: 4px; }
.nz-sites--zoom .nz-site__go { transform: scale(0.8); }
@media (hover: hover) { .nz-sites--zoom .nz-site__shot:hover .nz-site__go { opacity: 1; transform: scale(1); } }
.nz-sites--zoom .nz-site__info { justify-self: start; transition: color 0.3s; }
@media (hover: hover) { .nz-sites--zoom .nz-site__info:hover b { color: var(--nz-green-soft); } }
.nz-sites--zoom .nz-site { gap: 16px; }
.nz-sites--zoom .nz-site__info b { font-size: 19px; }
.nz-sites--zoom .nz-site__info small { font-size: 14px; }

/* ── Image viewer: blurred page behind, the image grows out of the clicked thumbnail ── */
html.nz-lb-open { overflow: hidden; }
.nz-lb {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: clamp(60px, 7vw, 96px) clamp(16px, 7vw, 110px);
    background: rgba(2, 12, 8, 0.62);
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
    opacity: 0;
    transition: opacity 0.38s;
}
.nz-lb[hidden] { display: none; }
.nz-lb.is-open { opacity: 1; }
.nz-lb__stage { display: grid; justify-items: center; gap: 14px; width: 100%; height: 100%; margin: 0; align-content: center; }
.nz-lb__stage img { display: block; max-width: 100%; max-height: calc(100vh - 2 * clamp(60px, 7vw, 96px) - 40px); width: auto; height: auto; border-radius: 18px; box-shadow: 0 40px 90px -30px rgba(var(--nz-k), calc(0.9 * var(--nz-ka))); }
.nz-lb__stage figcaption { display: flex; justify-content: center; gap: 16px; max-width: 100%; color: var(--nz-ink-2); font-size: 15px; text-align: center; }
.nz-lb__stage figcaption b { color: var(--nz-green-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nz-lb__close, .nz-lb__nav { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid rgba(var(--nz-w), 0.14); border-radius: 50%; background: rgba(7, 19, 14, 0.85); color: var(--nz-ink); font-size: 17px; cursor: pointer; transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.4s var(--nz-ease); }
.nz-lb__close { top: 20px; right: 20px; }
.nz-lb__nav { top: 50%; margin-top: -26px; }
.nz-lb__nav--prev { left: clamp(10px, 2vw, 32px); }
.nz-lb__nav--next { right: clamp(10px, 2vw, 32px); }
@media (hover: hover) { .nz-lb__close:hover, .nz-lb__nav:hover { background: var(--nz-green); border-color: var(--nz-green); color: var(--nz-ink-on-green); }
.nz-lb__close:hover { transform: rotate(90deg); } }
.nz-lb.is-single .nz-lb__nav { display: none; }

/* ── Responsive ── */
@media (max-width: 960px) {
    .nz-case__head { grid-template-columns: minmax(0, 1fr); }
    .nz-car__slide { flex-basis: 90%; }
}
@media (max-width: 640px) {
    .nz-filters { display: flex; justify-self: stretch; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .nz-filters button { padding: 10px 15px; font-size: 14px; white-space: nowrap; }
    .nz-car__shot { border-radius: 18px; }
    .nz-lb { padding: 64px 12px 72px; }
    .nz-lb__nav { top: auto; bottom: 14px; margin: 0; }
    .nz-lb__nav--prev { left: calc(50% - 62px); }
    .nz-lb__nav--next { right: calc(50% - 62px); }
    .nz-lb__stage img { max-height: calc(100vh - 200px); }
}
/* short screens (phones in landscape): the image takes almost the whole height */
@media (max-height: 520px) {
    .nz-lb { padding: 14px 76px; }
    .nz-lb__stage { gap: 8px; }
    .nz-lb__stage img { max-height: calc(100vh - 56px); }
    .nz-lb__close { top: 12px; right: 12px; width: 44px; height: 44px; }
    .nz-lb__nav { top: 50%; bottom: auto; margin-top: -24px; width: 48px; height: 48px; }
    .nz-lb__nav--prev { left: 14px; }
    .nz-lb__nav--next { right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .nz-projects *, .nz-projects *::before, .nz-projects *::after, .nz-lb, .nz-lb * { animation: none !important; transition: none !important; }
}

/* Press feedback */
.nz-filters button:active, .nz-car__btn:active, .nz-car__shot:active, .nz-lb__close:active, .nz-lb__nav:active { scale: 0.97; }
