/* ============================================================
   Project case study — /projects/{slug}
   Reading-first layout on the Dala canvas: one measured column,
   violet for structure, saffron for emphasis, no cards.
   ============================================================ */

.case {
    background: #000;
    padding-top: calc(var(--nav-height) + 2.5rem);
    padding-bottom: 90px;
}

.case .container {
    max-width: 820px;
}

/* ---------- Breadcrumbs ---------- */

.case__breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6f6f6f;
    margin-bottom: 2.5rem;
}

.case__breadcrumbs a {
    color: #9a9a9a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.case__breadcrumbs a:hover {
    color: var(--accent);
}

.case__breadcrumbs-current {
    color: #ffffff;
}

/* ---------- Header ---------- */

.case__kicker {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary-bright);
    margin-bottom: 1rem;
}

.case__title {
    font-size: clamp(30px, 4.4vw, 46px);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin-bottom: 1.25rem;
}

.case__lead {
    font-size: 19px;
    font-weight: 300;
    line-height: 1.55;
    color: var(--accent);
    margin-bottom: 2rem;
}

.case__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- Hero image ---------- */

.case__hero {
    margin: 2.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    overflow: hidden;
    background: #050505;
}

.case__hero img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- Fact sheet ----------
   Flex, not grid: with an odd fact count a grid leaves an empty cell that reads
   as a hole in the slab. Here the last row's items stretch, so the block is
   always full whatever the case declares. */

.case__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    margin: 0 0 3.5rem;
}

.case__fact {
    flex: 1 1 320px;
    position: relative;
    background:
        linear-gradient(160deg, rgba(157, 123, 255, 0.05), transparent 55%),
        #050505;
    padding: 1.5rem 1.6rem 1.6rem;
    transition: background-color 0.25s ease;
}

/* Hairline accent above the label — gives the slab structure without adding borders. */
.case__fact::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1.6rem;
    width: 22px;
    height: 2px;
    background: var(--primary-bright);
    box-shadow: 0 0 12px var(--primary-glow);
    opacity: 0.75;
}

.case__fact dt {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8a8a8a;
    margin-bottom: 0.55rem;
}

.case__fact dd {
    margin: 0;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.5;
    color: #ededed;
    text-wrap: pretty;
}

/* ---------- Screenshot slider ----------
   Stands where the hero image used to, straight under the case header. A scroll-snap
   track, so it is a working horizontal gallery with CSS alone; the arrows, dots and
   lightbox are added by case-gallery.js and stay hidden without it. */

.shots {
    margin: 2.5rem 0 3.5rem;
}

.shots__viewport {
    position: relative;
}

.shots__track {
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    scrollbar-width: none;              /* the dots are the affordance */
    border-radius: 20px;
}

.shots__track::-webkit-scrollbar { display: none; }

.shots__track:focus-visible {
    outline: 2px solid var(--primary-bright);
    outline-offset: 6px;
}

.shots__slide {
    flex: 0 0 88%;
    scroll-snap-align: center;
}

/* The frame is a button so a shot opens full screen on click and on Enter/Space. */
.shots__frame {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    overflow: hidden;
    background: #050505;
    cursor: zoom-in;
    transition: border-color 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease;
}

/* <picture> is inline by default, which would leave a descender gap under the image inside the
   frame. The <img> it wraps is styled below and unaffected. */
.shots__frame picture,
.case__hero picture {
    display: block;
}

.shots__frame img {
    display: block;
    width: 100%;
    height: auto;
    /* Screenshots are UI, not photography — keep edges crisp when the browser scales them down. */
    image-rendering: -webkit-optimize-contrast;
}

.shots__frame:hover,
.shots__frame:focus-visible {
    border-color: rgba(157, 123, 255, 0.55);
    box-shadow: 0 0 0 1px rgba(157, 123, 255, 0.2), 0 18px 50px rgba(128, 82, 255, 0.18);
    transform: translateY(-3px);
    outline: none;
}

.shots__caption {
    margin: 0.9rem 0.2rem 0;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.5;
    color: #8a8a8a;
}

/* ---------- Slider controls ---------- */

.shots__nav {
    position: absolute;
    top: 50%;
    translate: 0 -50%;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(8, 8, 10, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.shots__nav svg { width: 22px; height: 22px; }

.shots__nav--prev { left: 10px; }
.shots__nav--next { right: 10px; }

.shots__nav:hover {
    background: rgba(20, 14, 34, 0.9);
    border-color: var(--primary-bright);
}

.shots__nav:focus-visible {
    outline: 2px solid var(--primary-bright);
    outline-offset: 3px;
}

/* At the ends the button is gone rather than greyed out — nothing to press, nothing shown. */
.shots__nav:disabled {
    opacity: 0;
    pointer-events: none;
}

.shots__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1.4rem;
}

.shots__dot {
    width: 22px;
    height: 3px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: width 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.shots__dot:hover { background: rgba(255, 255, 255, 0.42); }

.shots__dot[aria-selected="true"] {
    width: 42px;
    background: var(--primary-bright);
    box-shadow: 0 0 14px var(--primary-glow);
}

.shots__dot:focus-visible {
    outline: 2px solid var(--primary-bright);
    outline-offset: 4px;
}

/* ---------- Full-screen viewer ---------- */

.shotbox {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}

.shotbox::backdrop {
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.shotbox__stage {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 4vmin;
}

.shotbox__img {
    max-width: min(96vw, 1700px);
    max-height: 84dvh;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.shotbox__caption {
    position: absolute;
    left: 50%;
    bottom: 26px;
    translate: -50% 0;
    max-width: min(90vw, 720px);
    text-align: center;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.5;
    color: #bdbdbd;
}

.shotbox__caption b {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary-bright);
}

.shotbox .shots__nav { position: fixed; }
.shotbox .shots__nav--prev { left: 22px; }
.shotbox .shots__nav--next { right: 22px; }

.shotbox__close {
    position: fixed;
    top: 22px;
    right: 22px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(8, 8, 10, 0.72);
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.shotbox__close:hover {
    background: rgba(20, 14, 34, 0.9);
    border-color: var(--primary-bright);
}

.shotbox__close svg { width: 20px; height: 20px; }

@media (prefers-reduced-motion: reduce) {
    .shots__track { scroll-behavior: auto; }

    .shots__frame,
    .shots__dot,
    .shots__nav {
        transition: none;
    }

    .shots__frame:hover,
    .shots__frame:focus-visible { transform: none; }
}

/* ---------- Body ---------- */

.case__section {
    margin-bottom: 3.5rem;
}

.case__section-title {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #ffffff;
    padding-bottom: 0.9rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.case__block + .case__block {
    margin-top: 2.25rem;
}

.case__block-title {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--primary-bright);
    margin-bottom: 0.75rem;
}

.case__body p {
    font-size: 17px;
    font-weight: 300;
    line-height: 1.72;
    color: #bdbdbd;
}

.case__body p + p {
    margin-top: 1rem;
}

/* ---------- Bullet lists ---------- */

.case__list {
    list-style: none;
    margin: 1.25rem 0;
    padding: 0;
}

.case__list li {
    position: relative;
    padding-left: 1.6rem;
    font-size: 17px;
    font-weight: 300;
    line-height: 1.65;
    color: #bdbdbd;
}

.case__list li + li {
    margin-top: 0.7rem;
}

.case__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-bright);
    box-shadow: 0 0 10px var(--primary-glow);
}

.case__list + p {
    margin-top: 1.25rem;
}

/* ---------- Tech stack ---------- */

.case__stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.case__stack .tag {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    font-size: 13px;
    font-weight: 300;
}

/* ---------- Closing CTA ---------- */

.case__cta {
    padding: 2.25rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 3.5rem;
}

.case__cta-text {
    font-size: 20px;
    font-weight: 300;
    line-height: 1.5;
    color: #ffffff;
    margin-bottom: 1.5rem;
}

/* ---------- More cases ---------- */

.case__more-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6f6f6f;
    margin-bottom: 1rem;
}

.case__more-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.case__more-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.case__more-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 0.25rem;
    text-decoration: none;
    color: #bdbdbd;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.case__more-list a:hover {
    color: #ffffff;
    padding-left: 0.75rem;
}

.case__more-arrow {
    color: var(--primary-bright);
    flex-shrink: 0;
}

/* ---------- Mobile ---------- */

@media (max-width: 768px) {
    .case {
        padding-top: calc(var(--nav-height) + 1.5rem);
        padding-bottom: 56px;
    }

    .case__lead { font-size: 17px; }

    .case__body p,
    .case__list li { font-size: 16px; }

    .case__actions .btn {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
    }

    .case__hero { margin: 2rem 0; }

    .case__facts {
        margin-bottom: 2.5rem;
        border-radius: 18px;
    }

    .case__fact {
        flex-basis: 100%;
        padding: 1.25rem 1.3rem 1.35rem;
    }

    .case__fact::before { left: 1.3rem; }

    .shots { margin: 2rem 0 2.5rem; }

    /* Touch scrolling is the affordance on a phone — the arrows only get in the way. */
    .shots__slide { flex-basis: 92%; }

    .shots__nav { display: none; }

    .shots__caption { font-size: 13px; }

    .shotbox .shots__nav { display: grid; }
    .shotbox .shots__nav--prev { left: 10px; }
    .shotbox .shots__nav--next { right: 10px; }

    .case__section { margin-bottom: 2.5rem; }
}
