/* BF Case Studies. Every value is copied from sections/BF Case Studies.dc.html (its <style> blocks and inline styles).
   Where the design's two phone blocks disagree, the values here are the ones the design renders (checked in a browser).
   One intentional difference: the tablet testimonial panel grows to fit its quote (see the tablet block).
   The card grid's fp-rise animation is defined nowhere in the design, so it never runs there and is left out. */

.fp-cs { position: relative; max-width: 1280px; margin: 0 auto; padding: 40px 24px 60px; }

.bf-cs-head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-bottom: 48px; }
.bf-cs-titles { position: relative; max-width: 720px; }
.bf-cs-headline { position: relative; }
.bf-cs-headline .bf-glitch { left: -70px; top: -6px; width: 160px; height: 40px; }
.bf-cs-headline .bf-glitch span:nth-child(1) { top: 0; left: 0; width: 120px; background: rgba(255,255,255,0.25); }
.bf-cs-headline .bf-glitch span:nth-child(2) { top: 11px; left: 30px; width: 90px; background: rgba(255,255,255,0.5); }
.bf-cs-headline .bf-glitch span:nth-child(3) { top: 22px; left: 10px; width: 140px; background: rgba(255,255,255,0.18); }
.bf-cs-all { padding-bottom: 6px; }

/* Featured testimonial */
.bf-feat-quote { position: relative; display: grid; grid-template-columns: 460px minmax(0, 1fr); gap: 18px; margin-bottom: 18px; align-items: stretch; height: 420px; }
.bf-feat-quote > div { border-radius: 6px !important; }
.bf-feat-img { position: relative; width: 460px; height: 420px; overflow: hidden; border: 1px solid rgba(255,255,255,0.14); }
.bf-feat-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.4) contrast(1.05); }
.bf-feat-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(1,21,33,0.55), rgba(1,21,33,0) 55%); pointer-events: none; }
.bf-feat-copy { position: relative; height: 420px; min-width: 0; padding: 44px 48px; display: flex; flex-direction: column; justify-content: center; border: 1px solid rgba(255,255,255,0.14); background: #04202F; overflow: hidden; }
.bf-feat-copy .bf-glitch { right: 30px; top: 30px; width: 160px; height: 40px; }
.bf-feat-copy .bf-glitch span:nth-child(1) { top: 0; left: 0; width: 120px; background: #8DC63F; }
.bf-feat-copy .bf-glitch span:nth-child(2) { top: 11px; left: 30px; width: 90px; background: rgba(255,255,255,0.35); }
.bf-feat-copy .bf-glitch span:nth-child(3) { top: 22px; left: 10px; width: 140px; background: #29ABE2; }
.bf-feat-copy .bf-eyebrow { margin-bottom: 20px; }
.bf-feat-text { font-size: 26px; line-height: 1.35; font-weight: 700; color: #FFFFFF; margin: 0; max-width: 780px; letter-spacing: -0.005em; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.bf-feat-meta { display: flex; flex-direction: column; align-items: stretch; gap: 22px; margin-top: 28px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,0.12); }
.bf-feat-name { font-size: 15px; font-weight: 800; color: #FFFFFF; }
.bf-feat-role { color: #A9C2D2; }
.bf-feat-links { display: flex; flex-wrap: wrap; gap: 10px 32px; align-items: center; width: 100%; }
.bf-feat-links .fp-blink { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bf-feat-links .fp-blink[hidden] { display: none; } /* testimonial with no case study */
.bf-feat-next { cursor: pointer; margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.25); background: transparent; color: rgba(255,255,255,0.6); display: flex; align-items: center; justify-content: center; padding: 0; flex: none; transition: border-color .3s ease, color .3s ease; }
.bf-feat-next:hover { border-color: #8DC63F; color: #8DC63F; }

/* Case study cards */
.fp-cs-grid { display: grid; grid-template-columns: 1fr; }
.fp-cs-grid > *, .fp-cs-cards > * { min-width: 0; }
.fp-cs-cards { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(270px, auto); gap: 18px; }
.fp-cs-cards > a { text-decoration: none; position: relative; overflow: hidden; background: #072B40; min-height: 224px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 6px !important; border: 1px solid rgba(255,255,255,0.14); box-shadow: none !important; transition: border-color .35s ease !important; }
.fp-cs-cards > a:hover { border-color: rgba(141,198,63,0.6) !important; box-shadow: none !important; }
.fp-cs-cards > a > img:first-child { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.35) contrast(1.08); transition: filter .5s ease, transform .8s cubic-bezier(.22,.61,.36,1); }
.fp-cs-cards > a:hover > img:first-child { filter: grayscale(0) contrast(1); transform: scale(1.03); }
.fp-cs-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(1,21,33,0.97) 0%, rgba(1,21,33,0.74) 32%, rgba(1,21,33,0.14) 62%), linear-gradient(180deg, rgba(1,21,33,0.82) 0%, rgba(1,21,33,0.2) 30%, rgba(1,21,33,0) 44%); }
.fp-cs-logo { position: relative; pointer-events: none; padding: 20px 22px 0; display: flex; justify-content: flex-start; }
.fp-cs-logo img { display: block; height: 36px; max-width: 62%; object-fit: contain; object-position: left; }
.fp-cs-logo img.is-large { height: 48px; }
.fp-cs-logo img.is-white { filter: brightness(0) invert(1); }
.fp-cs-body { position: relative; pointer-events: none; margin-top: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.fp-cs-body p { font-size: 14.5px; line-height: 1.5; font-weight: 600; color: #FFFFFF; margin: 0; }
.fp-cs-more { font-size: 13.5px; font-weight: 700; color: #A5D45E; }
.fp-cs-more span { font-size: 12px; }
.fp-cs-cards > a:focus-visible, .bf-feat-next:focus-visible { outline: 2px solid #8DC63F; outline-offset: 4px; }

/* Testimonial modal */
.fp-testi-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(1,21,33,0.86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: bf-in .3s ease both; }
.fp-testi-backdrop[hidden] { display: none; }
.fp-testi-modal { position: relative; width: min(960px, 100%); height: 475px; background: #04202F; border: 1px solid rgba(255,255,255,0.16); overflow: hidden; display: grid; grid-template-columns: 340px 1fr; border-radius: 6px !important; scrollbar-width: thin; scrollbar-color: #8DC63F rgba(1,21,33,0.08); }
.fp-testi-modal::-webkit-scrollbar { width: 8px; }
.fp-testi-modal::-webkit-scrollbar-track { background: rgba(1,21,33,0.06); border-radius: 8px; }
.fp-testi-modal::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #0096E1, #8DC63F); border-radius: 8px; }
.fp-testi-modal::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #0086cb, #7cb534); }
.fp-testi-modal > .bf-glitch { right: 90px; top: 34px; width: 160px; height: 40px; z-index: 2; }
.fp-testi-modal > .bf-glitch span:nth-child(1) { top: 0; left: 0; width: 120px; background: #8DC63F; }
.fp-testi-modal > .bf-glitch span:nth-child(2) { top: 11px; left: 30px; width: 90px; background: rgba(255,255,255,0.35); }
.fp-testi-modal > .bf-glitch span:nth-child(3) { top: 22px; left: 10px; width: 140px; background: #29ABE2; }
.fp-testi-close { position: absolute; top: 18px; right: 18px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.3); background: rgba(1,21,33,0.6); color: #FFFFFF; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; transition: border-color .3s, color .3s; }
.fp-testi-close:hover { border-color: #8DC63F; color: #8DC63F; }
.fp-testi-close span { display: block; transform: translateY(-1px); position: relative; top: 1.5px; }
.bf-modal-img { position: relative; overflow: hidden; border-right: 1px solid rgba(255,255,255,0.12); border-radius: 6px 0 0 6px !important; }
.bf-modal-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.4) contrast(1.05); }
.bf-modal-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(1,21,33,0.92), rgba(1,21,33,0.1) 55%); pointer-events: none; }
.bf-modal-who { position: absolute; left: 26px; right: 26px; bottom: 26px; }
.bf-modal-name { font-size: 17px; font-weight: 800; color: #FFFFFF; line-height: 1.2; }
.bf-modal-title { color: #A9C2D2; margin-top: 4px; }
.bf-modal-company { color: #8DC63F; font-weight: 700; margin-top: 2px; }
.bf-modal-body { position: relative; padding: 48px 52px 40px; display: flex; flex-direction: column; min-height: 0; }
.bf-modal-body .bf-eyebrow { margin-bottom: 18px; }
.bf-modal-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-right: 16px; scrollbar-width: thin; scrollbar-color: #8DC63F rgba(255,255,255,0.08); }
.bf-modal-scroll p { font-size: 21px; line-height: 1.55; font-weight: 600; color: #FFFFFF; margin: 0; }
.bf-modal-nav { display: flex; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.12); }
.bf-modal-nav button { cursor: pointer; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.25); background: transparent; color: rgba(255,255,255,0.7); display: flex; align-items: center; justify-content: center; font-family: inherit; }
.bf-modal-nav button:hover { border-color: #8DC63F; color: #8DC63F; }
.fp-testi-modal button:focus-visible { outline: 2px solid #8DC63F; outline-offset: 3px; }

@media (min-width: 768px) and (max-width: 1023px) {
	#case-studies { padding: 0 32px 100px !important; }
	/* Deliberate change from the design: its fixed 360px height crushed the quote to one clipped line.
	   360px is kept as the minimum; the panel grows to fit the quote's four lines. */
	.bf-feat-quote { grid-template-columns: 300px minmax(0, 1fr) !important; height: auto !important; min-height: 360px; }
	.bf-feat-img { width: 300px !important; height: auto !important; min-height: 360px; }
	.bf-feat-copy { height: auto !important; min-height: 360px; padding: 34px 32px !important; }
	.bf-feat-text { font-size: 21px !important; }
	.fp-cs-cards { grid-template-columns: 1fr 1fr !important; }
	.fp-cs-cards > a:nth-child(3) { display: none !important; }
	.bf-modal { height: 440px !important; }
}

@media (max-width: 767px) {
	#case-studies { padding: 0 20px 80px !important; }
	#case-studies h2 { font-size: clamp(28px, 7.6vw, 34px) !important; }
	.fp-cs-grid { grid-template-columns: 1fr !important; gap: 44px !important; }
	.fp-cs-cards { grid-template-columns: 1fr !important; grid-auto-rows: minmax(220px, auto) !important; gap: 12px !important; }
	.fp-cs-cards > a { grid-column: auto !important; }
	.fp-cs-cards > a:nth-child(3), .fp-cs-cards > a:nth-child(4) { display: none !important; }
	.bf-cs-head { gap: 22px !important; margin-bottom: 30px !important; }
	.bf-feat-quote { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; height: auto !important; gap: 12px !important; }
	.bf-feat-img { width: 100% !important; max-width: 100% !important; height: 260px !important; }
	.bf-feat-copy { width: auto !important; height: auto !important; padding: 26px 22px !important; }
	.bf-feat-text { font-size: 18px !important; -webkit-line-clamp: 6 !important; }
	.fp-testi-modal { height: auto !important; max-height: 90vh !important; overflow-y: auto !important; scrollbar-color: #8DC63F rgba(1, 21, 33, 1) !important; }
	.bf-modal { grid-template-columns: 1fr !important; height: auto !important; max-height: 90vh !important; }
	.bf-modal-img { height: 200px !important; border-right: 0 !important; border-bottom: 1px solid rgba(255,255,255,0.12); border-radius: 6px 6px 0 0 !important; }
	.bf-modal-body { padding: 28px 22px 24px !important; max-height: calc(90vh - 200px); }
	.bf-modal-scroll p { font-size: 17px !important; }
}
