/* =========================================================
   Work index and case study pages
   ========================================================= */

/* ---------- Work hero ---------- */
.work-hero { position: relative; padding: 28px 0 8px; overflow: hidden; }
.work-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 24px; align-items: center; }
.work-hero h1 { font-size: clamp(38px, 4vw, 60px); line-height: 1.06; font-weight: 800; letter-spacing: -.03em; max-width: 16ch; }
.work-lead { margin-top: 20px; font-size: 18px; color: #1E293B; max-width: 60ch; }
.work-hero-art { margin: -40px -40px -60px 0; pointer-events: none; }
.work-hero-art img { width: 100%; height: auto; max-width: 680px; margin-left: auto; filter: drop-shadow(0 30px 50px rgba(124, 58, 237, .18)); animation: float 9s ease-in-out infinite; }

/* ---------- Featured cases ---------- */
.work-section { position: relative; }
.work-cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.work-cases .case-foot { flex-wrap: wrap; margin-top: 18px; }
.work-cases .case > p { min-height: 2.9em; }
.work-cases .case-metric { gap: 12px; padding-right: 16px; }
.work-cases .case-metric p { white-space: nowrap; }
.work-cases .svc-link { gap: 8px; white-space: nowrap; }

/* ---------- Live projects ---------- */
.work-deco { position: absolute; right: -80px; top: -40px; width: 460px; opacity: .7; pointer-events: none; }
.live-list { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.live-list li { grid-column: span 4; }
.live-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px 16px 16px; border-radius: 20px; background: rgba(255, 255, 255, .55); }
.live-tile { flex: none; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 14px; background: linear-gradient(140deg, #C4B5FD 0%, #8B5CF6 55%, #6366F1 100%); box-shadow: inset 0 2px 6px rgba(255, 255, 255, .5), 0 10px 20px -8px rgba(124, 58, 237, .55); color: #fff; font-family: var(--font-head); font-size: 30px; font-weight: 700; }
.live-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.live-info strong { font-family: var(--font-head); font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.live-cat { padding: 3px 12px; border-radius: 999px; background: rgba(255, 255, 255, .8); border: 1px solid rgba(124, 58, 237, .2); font-size: 14px; color: var(--ink); white-space: nowrap; }
.live-link { flex: none; display: inline-flex; align-items: center; gap: 6px; padding-left: 18px; border-left: 1px solid rgba(15, 23, 42, .12); font-weight: 600; font-size: 15px; color: var(--violet); white-space: nowrap; }
.live-link .icon { width: 18px; height: 18px; transition: transform .2s; }
.live-link:hover .icon { transform: translate(2px, -2px); }

/* ---------- Case study hero ---------- */
.cs-hero { position: relative; padding: 28px 0 12px; overflow: hidden; }
.cs-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.cs-chip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px; border-radius: 14px; background: rgba(255, 255, 255, .7); border: 1px solid var(--glass-border); box-shadow: 0 8px 20px -10px rgba(124, 58, 237, .4); font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--ink); }
.cs-chip .icon { width: 24px; height: 24px; color: var(--violet); }
.cs-hero h1 { margin-top: 18px; font-size: clamp(36px, 3.8vw, 58px); line-height: 1.06; font-weight: 800; letter-spacing: -.03em; }
.cs-hero h1 em { display: block; }
.cs-lead { margin-top: 16px; font-size: 19px; line-height: 1.45; color: #1E293B; max-width: 46ch; }
.cs-facts { display: grid; grid-template-columns: repeat(3, auto); margin-top: 24px; padding: 14px 8px; border-radius: 20px; }
.cs-facts li { display: flex; align-items: center; gap: 12px; padding: 4px 14px; font-size: 15px; line-height: 1.25; color: var(--ink); }
.cs-facts li + li { border-left: 1px solid rgba(15, 23, 42, .12); }
.cs-facts img { flex: none; width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(124, 58, 237, .22)); }
.cs-facts strong { display: block; font-family: var(--font-head); font-size: 16.5px; font-weight: 700; }
.cs-hero-art { margin: -30px -30px -20px 0; }
.cs-hero-art img { width: 100%; height: auto; max-width: 760px; margin-left: auto; filter: drop-shadow(0 30px 50px rgba(124, 58, 237, .18)); }

/* ---------- Result band ---------- */
.cs-band-wrap { padding: 20px 0 8px; }
.cs-band { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 28px; padding: 18px 40px; border-radius: 26px; }
.cs-metric { display: flex; align-items: center; gap: 22px; padding-right: 40px; border-right: 1px solid rgba(15, 23, 42, .12); }
.cs-metric img { width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 12px 20px rgba(124, 58, 237, .25)); }
.cs-metric p { font-family: var(--font-head); font-size: 24px; font-weight: 600; line-height: 1.1; color: var(--ink); }
.cs-metric strong { display: block; font-size: clamp(48px, 4.4vw, 68px); font-weight: 800; line-height: 1; letter-spacing: -.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cs-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, auto)); justify-content: space-around; gap: 16px 40px; }
.cs-highlights li { display: flex; align-items: center; gap: 16px; font-size: clamp(17px, 1.4vw, 21px); font-weight: 500; color: var(--ink); line-height: 1.3; }
.cs-check { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(140deg, #C4B5FD, #8B5CF6 60%, #6366F1); box-shadow: 0 8px 16px -6px rgba(124, 58, 237, .55); color: #fff; }
.cs-check .icon { width: 22px; height: 22px; stroke-width: 3; }

/* ---------- Challenge + built ---------- */
.cs-story { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 24px; align-items: stretch; }
.cs-challenge, .cs-built { padding: 26px 30px 30px; border-radius: 26px; background: rgba(255, 255, 255, .5); }
.cs-title { font-size: clamp(26px, 2.4vw, 36px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; }
.cs-challenge > p:last-child { font-size: 18px; line-height: 1.5; color: #1E293B; }
.cs-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cs-features li { display: flex; align-items: center; gap: 16px; padding: 14px 18px 14px 14px; border-radius: 18px; background: rgba(255, 255, 255, .65); border: 1px solid var(--glass-border); box-shadow: 0 10px 24px -16px rgba(76, 29, 149, .4); }
.cs-features img { flex: none; width: 72px; height: 72px; object-fit: contain; padding-right: 14px; box-sizing: content-box; border-right: 1px solid rgba(124, 58, 237, .25); }
.cs-features h3 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.cs-features p { font-size: 15px; line-height: 1.4; color: #1E293B; }

/* ---------- Stack + next ---------- */
.cs-bottom { padding: 16px 0 8px; }
.cs-bottom-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.cs-stack { display: flex; align-items: center; gap: 28px; padding: 16px 26px; border-radius: 22px; }
.cs-stack .eyebrow { margin: 0; flex: none; }
.cs-stack .tech-pills { margin: 0; }
.cs-next { display: flex; align-items: center; gap: 18px; padding: 16px 28px 16px 20px; border-radius: 22px; color: var(--ink); background: linear-gradient(100deg, rgba(255, 255, 255, .75), rgba(196, 181, 253, .45)); transition: transform .2s ease, box-shadow .2s ease; }
.cs-next:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.cs-next img { flex: none; width: 64px; height: 64px; object-fit: contain; }
.cs-next span { flex: 1; min-width: 0; font-size: 14.5px; color: #1E293B; line-height: 1.35; }
.cs-next strong { display: block; font-family: var(--font-head); font-size: clamp(22px, 1.9vw, 28px); font-weight: 800; color: var(--ink); }
.cs-next > .icon { flex: none; width: 30px; height: 30px; color: var(--violet); transition: transform .2s; }
.cs-next:hover > .icon { transform: translateX(4px); }

/* ---------- Small laptops ---------- */
@media (max-width: 1440px) {
    .live-info strong { font-size: 17.5px; }
    .live-link { padding-left: 14px; }
    .cs-stack { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 1200px) {
    .live-list li, .live-list li:nth-child(n+5) { grid-column: span 6; }
    .cs-features { grid-template-columns: 1fr; }
    .cs-facts { grid-template-columns: 1fr; gap: 8px; }
    .cs-facts li + li { border-left: 0; border-top: 1px solid rgba(15, 23, 42, .1); padding-top: 10px; }
}

/* ---------- Tablets ---------- */
@media (max-width: 1024px) {
    .work-hero-grid, .cs-hero-grid { grid-template-columns: 1fr; }
    .work-hero-art, .cs-hero-art { margin: 0 auto; max-width: 620px; }
    .work-hero-art img, .cs-hero-art img { margin: 0 auto; }
    .work-hero h1 { max-width: 20ch; }
    .cs-facts { grid-template-columns: repeat(3, auto); gap: 0; }
    .cs-facts li + li { border-top: 0; padding-top: 4px; border-left: 1px solid rgba(15, 23, 42, .12); }
    .work-cases { grid-template-columns: 1fr 1fr; }
    .work-cases .case:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 10px); }
    .cs-band { grid-template-columns: 1fr; padding: 20px 28px; }
    .cs-metric { padding: 0 0 16px; border-right: 0; border-bottom: 1px solid rgba(124, 58, 237, .2); }
    .cs-highlights { justify-content: start; }
    .cs-story, .cs-bottom-grid { grid-template-columns: 1fr; }
    .cs-features { grid-template-columns: 1fr 1fr; }
}

/* ---------- Phones ---------- */
@media (max-width: 720px) {
    /* main.css hides the 2nd crumb on service pages; on these pages it is "Work", so keep it. */
    .work-hero .crumbs li:nth-child(2), .cs-hero .crumbs li:nth-child(2) { display: inline-flex; }
    .cs-hero .crumbs ol { flex-wrap: wrap; white-space: normal; }

    .work-hero { padding-top: 20px; }
    .work-hero h1 { font-size: clamp(34px, 10vw, 44px); }
    .work-lead { font-size: 16.5px; margin-top: 14px; }
    .work-hero-art { margin: 0 -16px -10px; }

    .work-cases { grid-template-columns: 1fr; gap: 16px; margin-top: 18px; }
    .work-cases .case:last-child:nth-child(odd) { width: auto; justify-self: stretch; }
    .work-cases .case > p { min-height: 0; }
    .work-cases .case-metric { padding-right: 16px; border-right: 1px solid rgba(15, 23, 42, .12); }

    .work-deco { width: 300px; right: -100px; }
    .live-list { grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
    .live-list li, .live-list li:nth-child(n+5), .live-list li:last-child { grid-column: auto; }
    .live-card { gap: 14px; padding: 10px 14px 10px 10px; border-radius: 16px; }
    .live-tile { width: 50px; height: 50px; font-size: 26px; border-radius: 12px; }
    .live-info { gap: 4px; }
    .live-info strong { font-size: 17px; }
    .live-cat { font-size: 13.5px; padding: 2px 10px; }

    .cs-hero { padding-top: 20px; }
    .cs-chip { font-size: 15.5px; padding: 7px 14px; }
    .cs-hero h1 { font-size: clamp(34px, 10vw, 44px); }
    .cs-lead { font-size: 16.5px; }
    .cs-facts { grid-template-columns: 1fr; gap: 10px; padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .cs-facts li, .cs-facts li + li { padding: 10px 14px; border: 1px solid var(--glass-border); border-radius: 16px; background: rgba(255, 255, 255, .6); box-shadow: 0 10px 24px -16px rgba(76, 29, 149, .4); }
    .cs-facts img { width: 46px; height: 46px; padding-right: 14px; box-sizing: content-box; border-right: 1px solid rgba(124, 58, 237, .3); }
    .cs-hero-art { margin: 6px -16px 0; }

    .cs-band { padding: 18px 18px; gap: 14px; }
    .cs-metric { gap: 14px; }
    .cs-metric img { width: 86px; height: 86px; }
    .cs-metric p { font-size: 22px; }
    .cs-highlights { grid-template-columns: 1fr; gap: 0; }
    .cs-highlights li { padding: 10px 0; font-size: 17px; }
    .cs-highlights li + li { border-top: 1px solid rgba(124, 58, 237, .15); }
    .cs-check { width: 34px; height: 34px; }

    .cs-challenge, .cs-built { padding: 20px 16px 20px; border-radius: 22px; }
    .cs-title { font-size: 28px; }
    .cs-challenge > p:last-child { font-size: 16.5px; }
    .cs-features { grid-template-columns: 1fr; gap: 10px; }
    .cs-features li { padding: 10px 14px 10px 10px; gap: 12px; border-radius: 16px; }
    .cs-features img { width: 54px; height: 54px; padding-right: 10px; }
    .cs-features h3 { font-size: 17px; }
    .cs-features p { font-size: 14px; }

    .cs-stack { padding: 14px 16px; }
    .cs-stack .tech-pills { gap: 8px; }
    .cs-stack .tech-pills .pill { padding: 9px 14px; font-size: 15px; }
    .cs-next { padding: 14px 18px 14px 14px; }
    .cs-next img { width: 52px; height: 52px; }
}

/* Case cards: same image height whether the art is a framed screenshot or a device composite. */
.work-cases .case-img img { aspect-ratio: 3 / 2; object-fit: contain; }
.cs-live { margin-top: 18px; }
.cs-live .icon { color: var(--violet); }
