/* Case study pages (src/pages/case-studies-*.html) and the Case Studies card grid.
   Builds on assets/css/ad-specs.css (.ms-band, .ms-grid, .ms-head, reveal + count-up from ad-specs.js). */

/* ---------- summary: room between the "at a glance" box and the text under it ---------- */
.ms-answer + .ms-prose { margin-top: 34px; }

/* ---------- cover + report button + report viewer ---------- */
.cs-cover { overflow: hidden; border-radius: 14px; box-shadow: 0 22px 60px rgba(0, 0, 0, .14); aspect-ratio: 16 / 10; background: #3b1c0b; }
.cs-cover .ccv { display: block; width: 100%; height: 100%; }
.cs-report-btn { margin-top: 26px; text-align: center; }
.cs-modal { position: fixed; inset: 0; margin: auto; width: min(92vw, 860px); max-height: 92vh; padding: 0; border: 0; border-radius: 12px; background: #111; overflow: auto; }
.cs-modal::backdrop { background: rgba(10, 6, 3, .78); }
.cs-modal img { display: block; width: 100%; height: auto; }
.cs-modal__close { position: sticky; top: 10px; float: right; z-index: 2; width: 42px; height: 42px; margin: 10px 10px -52px 0; border: 0; border-radius: 50%; background: #8D441F; cursor: pointer; }
.cs-modal__close::before, .cs-modal__close::after { content: ""; position: absolute; left: 12px; top: 20px; width: 18px; height: 2px; background: #fff; transform: rotate(45deg); }
.cs-modal__close::after { transform: rotate(-45deg); }
.cs-modal__close:hover { background: #EC7225; }

/* ---------- headline numbers ---------- */
.cs-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.cs-stats li { flex: 0 0 calc((100% - 48px) / 4); padding: 26px 22px 22px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
  transition: transform .4s ease, border-color .4s ease; }
.cs-stats li:hover { transform: translateY(-4px); border-color: #EE9723; }
.cs-stats li { display: flex; flex-direction: column; }
.cs-stats span.cs-stats__icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 0 16px; border-radius: 50%;
  background: rgba(238, 151, 35, .12); border: 1px solid rgba(238, 151, 35, .35); color: #EE9723; transition: background-color .4s ease, color .4s ease; }
.cs-stats__icon svg { width: 24px; height: 24px; }
.cs-stats li:hover .cs-stats__icon { background: #EE9723; color: #fff; }
.cs-stats b { display: block; font: 700 clamp(28px, 2.6vw, 38px)/1.1 "Outfit", sans-serif; color: #EE9723; }
.cs-stats span { display: block; margin-top: 8px; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, .75); }

/* ---------- the campaign on screen: two real photos side by side ---------- */
.cs-photos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.cs-photos .ms-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.cs-photos > div:nth-child(2) { margin-top: 56px; }
@media (max-width: 900px) { .cs-photos { grid-template-columns: minmax(0, 1fr); gap: 40px; } .cs-photos > div:nth-child(2) { margin-top: 0; } }

/* ---------- panels ---------- */
.cs-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.cs-panel { padding: 32px 32px 28px; border-radius: 12px; background: #fff; border: 1px solid #f0e8e0; box-shadow: 0 18px 50px rgba(0, 0, 0, .07); }
.cs-panel__title { margin: 0 0 22px; font: 600 19px/1.3 "Outfit", sans-serif; color: #080A0B; }
.cs-panel__note { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid #f0ebe6; font-size: 15px; line-height: 1.6; color: #5e5e5e; }

/* horizontal bars */
.cs-hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.cs-hbars li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 82px; align-items: center; gap: 14px; }
.cs-hbars__label { font: 600 15px/1.25 "Outfit", sans-serif; color: #080A0B; }
.cs-hbars__label small { display: block; font: 400 12.5px/1.4 "DM Sans", sans-serif; color: #6b6b6b; }
.cs-hbars__track { height: 14px; border-radius: 7px; background: #f3ece5; overflow: hidden; }
.cs-hbars__track i { display: block; height: 100%; width: var(--w); border-radius: 7px; background: #C9642E; transform-origin: left; transition: transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.cs-hbars li.is-top .cs-hbars__track i { background: #EC7225; }
.cs-hbars b { font: 700 16px/1 "Outfit", sans-serif; color: #8D441F; text-align: right; }
.cs-hbars--age li { grid-template-columns: 80px minmax(0, 1fr) 82px; }
.ms-js [data-ms-in]:not(.is-in) .cs-hbars__track i { transform: scaleX(0); }

/* day columns */
.cs-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; height: 190px; align-items: end; }
.cs-days span { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }
.cs-days i { display: block; height: var(--h); border-radius: 6px 6px 2px 2px; background: #C9642E; transform-origin: bottom; transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.cs-days span.is-top i { background: #EC7225; }
.cs-days small { margin-top: 8px; font: 600 12.5px/1 "DM Sans", sans-serif; letter-spacing: .5px; text-transform: uppercase; color: #5e5e5e; }
.ms-js [data-ms-in]:not(.is-in) .cs-days i { transform: scaleY(0); }
.cs-days span:nth-child(2) i { transition-delay: .08s; } .cs-days span:nth-child(3) i { transition-delay: .16s; }
.cs-days span:nth-child(4) i { transition-delay: .24s; } .cs-days span:nth-child(5) i { transition-delay: .32s; }
.cs-days span:nth-child(6) i { transition-delay: .4s; } .cs-days span:nth-child(7) i { transition-delay: .48s; }

/* gender donut */
.cs-gender { display: flex; flex-direction: column; }
.cs-gender__row { flex: 1; display: grid; grid-template-columns: 1fr minmax(0, 200px) 1fr; align-items: center; gap: 18px; }
.cs-gender__side { text-align: right; }
.cs-gender__side--m { text-align: left; }
.cs-gender__side b { display: block; font: 600 15px/1.2 "Outfit", sans-serif; letter-spacing: 1px; text-transform: uppercase; color: #080A0B; }
.cs-gender__side span { display: block; margin-top: 6px; font: 700 24px/1.1 "Outfit", sans-serif; color: #8D441F; }
.cs-gender__side small { display: block; margin-top: 4px; font-size: 15px; color: #6b6b6b; }
.cs-donut { display: block; width: 100%; height: auto; transform: rotate(-90deg); }
.cs-donut circle { fill: none; stroke-width: 6; }
.cs-donut__f { stroke: #e6ded6; }
.cs-donut__m { stroke: #EC7225; stroke-dasharray: var(--p) 100; transition: stroke-dasharray 1.3s cubic-bezier(.2, .7, .2, 1); }
.ms-js .cs-gender:not(.is-in) .cs-donut__m { stroke-dasharray: 0 100; }

.cs-callout { margin-top: 22px; padding: 16px 18px; border-left: 4px solid #EC7225; border-radius: 0 10px 10px 0; background: #FAF6F2; }
.cs-callout b { display: block; font: 600 16.5px/1.4 "Outfit", sans-serif; color: #080A0B; }
.cs-callout span { display: block; margin-top: 6px; font-size: 14px; line-height: 1.55; color: #5e5e5e; }

/* ---------- what it means ---------- */
.cs-means { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.cs-mean { padding: 32px 26px 28px; border-radius: 10px; background: #FAF6F2; border: 1px solid transparent; transition: transform .4s ease, border-color .4s ease, background-color .4s ease; }
.cs-mean:hover { transform: translateY(-6px); border-color: #EC7225; background: #fff; }
.cs-mean__icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 20px; border-radius: 50%; background: #fff; color: #8D441F; border: 2px solid #EE9723; }
.cs-mean__icon svg { width: 26px; height: 26px; }
.cs-mean h3 { margin: 0 0 10px; font: 700 20px/1.3 "Outfit", sans-serif; color: #080A0B; }
.cs-mean p { margin: 0; font-size: 15.5px; line-height: 1.65; color: #6b6b6b; }

/* ---------- bottom line ---------- */
.cs-bottom__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.cs-bottom__lead p { margin: 0 0 16px; font-size: 18px; line-height: 1.65; color: rgba(255, 255, 255, .8); }
.cs-bottom__lead .cs-bottom__tag { margin: 0; font: 700 22px/1.35 "Outfit", sans-serif; color: #EE9723; text-transform: uppercase; letter-spacing: .5px; }
.cs-bottom__tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cs-bottom__tiles li { position: relative; overflow: hidden; padding: 26px 22px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
  transition: transform .4s ease, border-color .4s ease, background-color .4s ease; }
.cs-bottom__tiles li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #EE9723; transform: scaleY(0); transform-origin: bottom; transition: transform .4s ease; }
.cs-bottom__tiles li:hover { transform: translateY(-4px); border-color: #EE9723; background: rgba(238, 151, 35, .08); }
.cs-bottom__tiles li:hover::before { transform: scaleY(1); }
.cs-bottom__tiles b { display: block; font: 700 28px/1.15 "Outfit", sans-serif; color: #fff; transition: color .4s ease; }
.cs-bottom__tiles li:hover b { color: #EE9723; }
.cs-bottom__tiles span { display: block; margin-top: 8px; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, .7); }

/* ---------- Case Studies card grid ---------- */
.cs-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.cs-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; background: #fff; border: 1px solid #f0e8e0; box-shadow: 0 18px 50px rgba(0, 0, 0, .07);
  text-decoration: none; color: inherit; transition: transform .4s ease, box-shadow .4s ease, border-color .4s ease; }
.cs-card:hover { transform: translateY(-6px); border-color: #EC7225; box-shadow: 0 26px 60px rgba(0, 0, 0, .14); }
.cs-card__img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #1A1A1A; }
.cs-card__img img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; transition: transform .8s ease; }
.cs-card:hover .cs-card__img img { transform: scale(1.05); }
.cs-card__tag { position: absolute; left: 18px; top: 18px; padding: 7px 12px; border-radius: 4px; background: #8D441F; color: #fff; font: 700 12px/1 "DM Sans", sans-serif; letter-spacing: 1px; text-transform: uppercase; }
.cs-card__body { flex: 1; display: flex; flex-direction: column; padding: 28px 30px 30px; }
.cs-card__title { margin: 0 0 10px; font: 700 24px/1.3 "Outfit", sans-serif; color: #080A0B; }
.cs-card__text { margin: 0 0 20px; font-size: 15.5px; line-height: 1.7; color: #6b6b6b; }
.cs-card__nums { list-style: none; margin: 0 0 24px; padding: 18px 0 0; border-top: 1px solid #f0ebe6; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cs-card__nums b { display: block; font: 700 21px/1.1 "Outfit", sans-serif; color: #8D441F; }
.cs-card__nums span { display: block; margin-top: 4px; font-size: 12.5px; letter-spacing: .5px; text-transform: uppercase; color: #6b6b6b; }
.cs-card__go { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font: 700 14px/1 "DM Sans", sans-serif; text-transform: uppercase; color: #8D441F; }
.cs-card__go::after { content: "\2192"; transition: transform .4s ease; }
.cs-card:hover .cs-card__go::after { transform: translateX(5px); }
/* drawn cover (scratchpad case-cover.js): same scene for every study, sky/skyline/message/stat differ */
.cs-card__img .ccv { display: block; width: 100%; height: 100%; }
.ccv-client { font: 700 15px "DM Sans", sans-serif; letter-spacing: 2px; text-transform: uppercase; fill: #EE9723; text-anchor: middle; }
.ccv-head { font: 700 30px "Outfit", sans-serif; fill: #fff; text-anchor: middle; }
.ccv-sec { font: 600 10px "DM Sans", sans-serif; fill: rgba(255, 255, 255, .7); }
.ccv-stat { font: 700 38px "Outfit", sans-serif; fill: #8D441F; }
.ccv-statl { font: 600 15px "DM Sans", sans-serif; letter-spacing: 1.5px; text-transform: uppercase; fill: #5e5e5e; }
.ccv-lane { stroke: #EE9723; stroke-width: 4; stroke-dasharray: 14 16; animation: ccv-lane .9s linear infinite; }
@keyframes ccv-lane { to { stroke-dashoffset: -30; } }
.ccv-prog { transform-box: fill-box; transform-origin: left; animation: ccv-prog 6s linear infinite; }
@keyframes ccv-prog { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.ccv-glow { animation: ccv-glow 6s ease-in-out infinite; }
@keyframes ccv-glow { 0%, 100% { opacity: 0; } 50% { opacity: .12; } }
.ccv-car { transform-box: fill-box; transform-origin: center; animation: ccv-car 7s ease-in-out infinite; }
@keyframes ccv-car { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(.86); } }
.ccv-sun { animation: ccv-sun 5s ease-in-out infinite; }
@keyframes ccv-sun { 50% { opacity: .82; } }
/* card scene (street view) */
.ccs-head { font: 700 25px "Outfit", sans-serif; fill: #fff; text-anchor: middle; }
.ccs-client { font: 700 12px "DM Sans", sans-serif; letter-spacing: 2px; text-transform: uppercase; fill: #EE9723; text-anchor: end; }
.ccs-now { font: 600 12px "DM Sans", sans-serif; letter-spacing: 1px; text-transform: uppercase; fill: rgba(255, 255, 255, .7); }
.ccs-lane { stroke: #EE9723; stroke-width: 5; stroke-dasharray: 44 34; animation: ccs-lane 1.1s linear infinite; }
@keyframes ccs-lane { to { stroke-dashoffset: 78; } }
.ccs-bus { animation: sv-bob 1.4s ease-in-out infinite; }
@keyframes sv-bob { 50% { transform: translateY(-2px); } }
.ccs-spin { animation: ccs-spin .6s linear infinite; }
@keyframes ccs-spin { to { transform: rotate(-360deg); } }
.ccs-glow { animation: ccs-glow 3s ease-in-out infinite; }
@keyframes ccs-glow { 0%, 100% { opacity: .55; } 50% { opacity: .9; } }
.ccs-signal { animation: ccs-signal 1.2s linear infinite; }
@keyframes ccs-signal { to { stroke-dashoffset: -24; } }
.ccs-live { animation: ccs-live 1.4s ease-in-out infinite; }
@keyframes ccs-live { 50% { opacity: .25; } }
.cs-card .ccs-callout { transition: transform .5s ease; }
.cs-card:hover .ccs-callout { transform: translateY(-6px); }
@media (prefers-reduced-motion: reduce) { .ccs-lane, .ccs-bus, .ccs-spin, .ccs-glow, .ccs-signal, .ccs-live { animation: none; } }
.ccv-chip { transition: transform .5s ease; }
.cs-card:hover .ccv-chip { transform: translate(64px, 322px); }
@media (prefers-reduced-motion: reduce) { .ccv-lane, .ccv-prog, .ccv-glow, .ccv-car, .ccv-sun { animation: none; } }

/* one study: a single wide card, image beside the text */
.cs-list--single { grid-template-columns: minmax(0, 1fr); max-width: 1040px; margin: 0 auto; }
.cs-list--single .cs-card { flex-direction: row; }
.cs-list--single .cs-card__img { flex: 0 0 52%; aspect-ratio: 16 / 10; align-self: center; }
.cs-list--single .cs-card__body { padding: 40px 40px 38px; justify-content: center; }
.cs-list--single .cs-card__title { font-size: 30px; }
.cs-list--single .cs-card__go { margin-top: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .cs-means { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .cs-stats li { flex-basis: calc((100% - 16px) / 2); }
  .cs-list--single .cs-card { flex-direction: column; }
  .cs-list--single .cs-card__img { flex: none; min-height: 0; aspect-ratio: 16 / 10; align-self: stretch; width: 100%; }
  .cs-list--single .cs-card__body { padding: 28px 30px 30px; }
  .cs-pair, .cs-bottom__grid, .cs-list { grid-template-columns: minmax(0, 1fr); }
  .cs-bottom__grid { gap: 36px; }
}
@media (max-width: 575px) {
  .cs-stats { gap: 10px; }
  .cs-stats li { flex-basis: calc((100% - 10px) / 2); padding: 18px 16px 16px; }
  .cs-panel { padding: 24px 18px 20px; }
  .cs-hbars li { grid-template-columns: 92px minmax(0, 1fr) 62px; gap: 10px; }
  .cs-hbars--age li { grid-template-columns: 66px minmax(0, 1fr) 62px; gap: 10px; }
  .cs-hbars__label small { white-space: nowrap; font-size: 11.5px; }
  .cs-list--single .cs-card__title { font-size: 24px; }
  .cs-hbars b { font-size: 14px; }
  .cs-days { gap: 6px; height: 150px; }
  .cs-days small { font-size: 11px; }
  .cs-gender__row { grid-template-columns: 1fr minmax(0, 120px) 1fr; gap: 10px; }
  .cs-gender__side span { font-size: 19px; }
  .cs-means { grid-template-columns: minmax(0, 1fr); }
  .cs-bottom__tiles b { font-size: 22px; }
  .cs-card__body { padding: 22px 20px 24px; }
  .cs-card__tag { left: 12px; top: 12px; padding: 5px 9px; font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-hbars__track i, .cs-days i, .cs-donut__m { transition: none; }
  .ms-js [data-ms-in]:not(.is-in) .cs-hbars__track i, .ms-js [data-ms-in]:not(.is-in) .cs-days i { transform: none; }
  .ms-js .cs-gender:not(.is-in) .cs-donut__m { stroke-dasharray: var(--p) 100; }
}
