.m img, .m video { display: block; width: 100%; height: auto; border-radius: 0; }
.sec { padding: 72px 40px; }
.m .eyebrow { padding: 0; margin-bottom: 12px; font-size: 16px; line-height: 22px; }
.m .statement { font-size: 36px; line-height: 43px; max-width: 980px; }
.copy { font-size: 16px; line-height: 22px; color: var(--ink-2); }
.copy p + p { margin-top: 18px; }
.m h2 + .copy, .m h3 + .copy { margin-top: 16px; }
.m .sub { margin-top: 0; }
.split { display: grid; grid-template-columns: minmax(0, 892.5fr) minmax(0, 547.5fr); align-items: start; margin-inline: -40px; }
.split > :first-child { padding: 0 20px 0 40px; }
.split > :last-child { padding: 0 40px 0 20px; }
.split > figure { margin: 0; min-width: 0; }
.split > img { width: 100%; box-sizing: border-box; background-clip: content-box; }
.text-side { position: sticky; top: 90px; }
@media (min-width: 901px) {
  .split:not(.hero-split) { grid-template-columns: minmax(0, 547.5fr) minmax(0, 892.5fr); }
  .split:not(.hero-split) > :first-child { grid-area: 1 / 2; padding: 0 40px 0 20px; }
  .split:not(.hero-split) > :last-child { grid-area: 1 / 1; padding: 0 20px 0 40px; }
  .split:not(.hero-split) > .loop { padding: 0; }
  .split:has(> .loop) { align-items: center; }   /* centred in its column, needs no gutter */
}
.cap { margin-bottom: 10px; font-family: var(--serif); font-size: 16px; line-height: 22px; color: var(--accent); }

/* Summary */
.summary { padding-top: 24px; position: relative; }
.summary::before { content: ""; position: absolute; top: 0; left: 40px; right: 40px; height: 1px; background: var(--rule); }
.summary-left { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.summary ul { margin: 0; padding-left: 18px; list-style: disc; }
.summary li + li { margin-top: 8px; }
.summary li::marker { color: var(--accent); }

/* Findings */
.rail { display: flex; gap: 20px; overflow-x: auto; margin: 32px -40px 0; padding: 0 40px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail figure { flex: none; width: 440px; margin: 0; }
.rail img { aspect-ratio: 5 / 3; object-fit: cover; }
.rail b { display: block; margin-top: 14px; font: 400 20px/28px var(--serif); color: var(--ink); }
.rail p { margin-top: 6px; font-size: 16px; line-height: 22px; color: var(--ink-2); }

/* Pills as a flow */
.pill { display: inline-block; font-size: 12px; line-height: 16px; font-weight: 700; color: var(--tag); border: 1px solid var(--tag-line); border-radius: 12px; padding: 3px 7px; background: var(--bg); white-space: nowrap; transition: background-color .25s, color .25s, border-color .25s; }
.flow { margin: 0; padding: 0; list-style: none; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 0; margin-top: 24px; }
.flow li { display: flex; align-items: center; }
.flow li + li::before { content: ""; width: 22px; height: 1px; background: var(--accent); margin: 0 1px; }
.flow li + li .pill { position: relative; margin-left: 6px; }
.flow li + li .pill::before { content: ""; position: absolute; left: -7px; top: 50%; margin-top: -4px; border: 4px solid transparent; border-left: 5px solid var(--accent); border-right: 0; }
.flow li:last-child .pill { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.flow li:last-child .pill::before { border-left-color: var(--accent); }
.lane + .lane { margin-top: 16px; }
.lane .lane-name { font-family: var(--serif); font-size: 16px; line-height: 22px; color: var(--accent); }
.lane .flow { margin-top: 6px; }

/* Safety loop (Figma "loop"): equal cards, 2px outline on all but "Accident occurs" */
/* 1fr rows in an auto-height grid all take the tallest card's height */
.loop { display: grid; grid-template-columns: 1fr 40px 1fr 40px 1fr; grid-template-rows: 1fr 41px 1fr; align-items: center; width: 100%; max-width: 701px; margin-inline: auto; }
.step { align-self: stretch; padding: 14px; border: 2px solid var(--ink); border-radius: 16px; background: var(--bg); }
.step b { display: block; font: 400 18px/24px var(--serif); color: var(--accent); }
.step strong { display: block; margin-top: 23px; font-size: 14px; line-height: 18px; font-weight: 700; color: var(--ink); }
.step span { display: block; margin-top: 23px; font-size: 14px; line-height: 18px; color: var(--ink-2); }
.step.hot { background: var(--ink); border: 0; padding: 16px; }
.step.hot b { color: var(--accent-2); }
.step.hot strong, .step.hot span { color: var(--bg); }
.arr { display: grid; place-items: center; color: var(--ink); }
.arr.down { grid-column: 5; } .arr.up { grid-column: 1; }
.arr.l { transform: rotate(180deg); } .arr.down svg { transform: rotate(90deg); } .arr.up svg { transform: rotate(-90deg); }


/* Two demos in matching containers */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; }
.duo video { aspect-ratio: 16 / 9; object-fit: cover; }

/* The key idea */
.statement em { font-style: normal; color: var(--accent-2); }

/* Basic player for the story videos: sits on the video */
.story { position: relative; }
.vc { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 8px; }
.vc button { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(32, 32, 32, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background-color .25s, transform .2s var(--ease); }
.vc button:hover { background: rgba(32, 32, 32, .82); }
.vc button:active { transform: scale(.9); }
.vc input { flex: 1; min-width: 0; height: 36px; margin: 0; padding: 0; appearance: none; -webkit-appearance: none; background: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); cursor: pointer; --p: 0%; }
.vc input::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(to right, #fff var(--p), rgba(255,255,255,.3) var(--p)); }
.vc input::-moz-range-track { height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); }
.vc input::-moz-range-progress { height: 3px; border-radius: 2px; background: #fff; }
.vc input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: #fff; }
.vc input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.vc .off { display: none; } .vc [aria-pressed="true"] .on { display: none; } .vc [aria-pressed="true"] .off { display: block; }

/* 49-video has white bands baked in: 6px left, 10px right, 9px top and bottom of 640x248 */
.crop { overflow: hidden; aspect-ratio: 624 / 230; }
.m .crop video { width: 102.564%; max-width: none; margin: -1.442% 0 0 -.9615%; border-radius: 0; }

.features { margin: 10px 0 0; border-top: 1px solid var(--rule); }
.features li { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.features strong { display: block; font-weight: 700; color: var(--ink); }
.copy strong { font-weight: 700; color: var(--ink); }

/* Use cases */
.media-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.media-side figure { margin: 0; min-width: 0; }
.uc-num { font-size: 16px; line-height: 22px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.car { display: flex; gap: 16px; }
.car > figure { margin: 0; min-width: 0; }
.outcome li { padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 16px; line-height: 22px; color: var(--ink-2); }
.outcome { border-top: 1px solid var(--rule); }

/* Previous / next */
.pager { display: flex; justify-content: space-between; gap: 20px; padding: 40px 40px 112px; border-top: 1px solid var(--rule); }
.pager a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 16px; transition: background-color .25s, transform .3s var(--ease); }
.pager a:hover { background: var(--hover); }
.pager a:active { transform: scale(.98); }
.pager img { width: 80px !important; height: 56px !important; object-fit: cover; border-radius: 0 !important; }
.pager small { display: block; font-family: var(--serif); font-size: 14px; line-height: 18px; color: var(--accent); }
.pager b { font: 400 20px/28px var(--serif); color: var(--ink); }
.pager .next { text-align: right; }

.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--bg); box-shadow: 0 6px 20px rgba(0,0,0,.18); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .25s, transform .3s var(--ease), visibility 0s .25s; }
.to-top.on { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .3s var(--ease); }
.to-top:hover { transform: translateY(-2px); }
.to-top:active { transform: scale(.92); }

/* Final outcome beside the title: the work-menu thumbnail, straight, no card (hidden once the page stacks) */
.oc img { display: block; width: 100%; height: auto; }
/* white-background thumbnails get the homepage frame line, drawn over the image edge */
.oc.bd img { border-radius: 16px; outline: 2px solid rgba(37, 37, 37, .16); outline-offset: -2px; }   /* same rounded edge as the homepage covers */

/* Summary: project type, role and outcome side by side from the left, each 260–380px wide; they wrap when space runs out */
.summary.sum3x { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 380px)); justify-content: start; gap: 24px 40px; align-items: start; }
.summary.sum3x::before { left: 0; right: 0; }

@media (max-width: 900px) {
  .m { --mp: 24px; }
  .sec { padding: 72px var(--mp); }
  .loop { max-width: 640px; }
  /* Each section reads: label and title, then its image, then the text */
  .split { display: flex; flex-direction: column; align-items: stretch; gap: 16px; margin-inline: calc(-1 * var(--mp)); }
  .split > :first-child, .split > :last-child { padding: 0 var(--mp); }
  .split > * { order: 3; }
  .split > :first-child { order: 2; }
  .split .hdp { display: contents; }
  .split .hd { order: 1; margin: 0; padding: 0 var(--mp); }
  .split .hdp > :not(.hd):not(.hdp) { order: 3; margin-top: 0; padding: 0 var(--mp); }
  .split .hd + .hd { margin-top: -8px; }
  .summary.sum3x { grid-template-columns: 1fr; gap: 24px; }
  .text-side { position: static; }
  .rail { margin: 24px calc(-1 * var(--mp)) 0; padding: 0 var(--mp); } .rail figure { width: 78vw; }
  .duo { grid-template-columns: 1fr; }
  .car { flex-direction: column; } .car > figure { flex: none !important; }
  .pill { white-space: normal; }
  .pager { padding: 32px 24px 96px; }
}
@media (max-width: 560px) {
  .summary-left { grid-template-columns: 1fr; gap: 24px; }
  /* same side margins as the homepage; smaller type and a little more air between paragraphs */
  .m { --mp: 16px; }
  .sec { padding: 64px var(--mp); }
  .pager { padding: 32px 16px 96px; }
  .m .statement { font-size: 22px; line-height: 29px; }
  .m h2 { font-size: 20px; line-height: 27px; }
  .m h3.sub, .m .h3 { font-size: 16px; line-height: 23px; }
  .m .eyebrow, .m .cap { font-size: 13px; line-height: 18px; }
  .m .copy, .m .copy li, .m .features li, .m .outcome li, .summary .copy, .m .rail p, .m .step span { font-size: 14px; line-height: 21px; }
  .m .copy p + p { margin-top: 24px; }
  .split { gap: 20px; }
  /* One column from "Accident occurs" down to "Work as usual"; a line on the left loops back to the top */
  .loop { position: relative; grid-template-columns: 1fr; grid-template-rows: repeat(5, 1fr 38px) 1fr;
    max-width: none; width: auto; }   /* the split already runs edge to edge */
  .loop::before { content: ""; position: absolute; left: 35px; width: 24px;
    top: calc((100% - 190px) / 12 - 1.25px); bottom: calc((100% - 190px) / 12 - 1.25px);
    border: 2.5px solid var(--ink); border-right: 0; border-radius: 9px 0 0 9px; }
  .loop::after { content: ""; position: absolute; left: 47px; top: calc((100% - 190px) / 12 - 5.5px); width: 11px; height: 11px;
    border: solid var(--ink); border-width: 2.5px 2.5px 0 0; border-radius: 1px; transform: rotate(45deg); }
  .split > .loop { padding: 0 25px 0 71px; }
  .loop > .step, .loop > .arr.arr { order: var(--o); grid-column: 1; }
  .arr.l { transform: none; } .arr svg, .arr.down svg, .arr.up svg { transform: rotate(90deg); }
  .arr.back { display: none; }
  .pager img { display: none; }
}

/* Shared by every case study */
.pics { display: grid; gap: 12px; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
.pics figure { margin: 0; min-width: 0; }
.pics.sq img, .pics.sq video { aspect-ratio: 1; object-fit: cover; }
.embed { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--hover); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
/* pushes YouTube's title and bottom bars outside the frame */
.embed iframe.yt { inset: -120px 0 auto; height: calc(100% + 240px); }
.bul { margin: 12px 0; padding-left: 18px; list-style: disc; }
.bul li + li { margin-top: 6px; }
.bul li::marker { color: var(--accent); }
.quote { margin-top: 20px; font: 400 20px/28px var(--serif); color: var(--ink); }
.quote + .copy { margin-top: 6px; }
.flow .pill { white-space: normal; }
.sec .split + .split { margin-top: 56px; }
.sec > figure { margin: 0; }
.m h3.sub { margin: 0; font: 400 20px/28px var(--serif); color: var(--ink); }
.m .copy + h3.sub, .m .features + h3.sub { margin-top: 24px; }
.m h2 + h3.sub { margin-top: 20px; }
.m h3.sub + .features, .m h3.sub + .bul { margin-top: 12px; }
@media (max-width: 560px) { .pics { --n: 2 !important; } }
