/* CM MainWorks case study. Colours are Connor's own (brand v2): navy #16264A, gold #D9A441,
   chalk #F5EFE4, ink #1A2238, steel tint #D7E6F5. The street is the site's own hero drawing,
   ported live from its concept.css, every rule scoped to .cmw-street so nothing leaks. */

.cmw { --cm-navy: #16264a; --cm-gold: #d9a441; --cm-chalk: #f5efe4; --cm-ink: #1a2238; --cm-tsteel: #d7e6f5; }

/* ---------- hero pops ---------- */
.cmw-van-pop { display: block; border-radius: 12px; overflow: hidden; background: #eee; box-shadow: 0 2px 3px rgb(0 0 0 / 0.12), 0 22px 40px -12px rgb(22 38 74 / 0.4); }
.cmw-van-pop img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cmw-badge-pop { display: grid; place-items: center; aspect-ratio: 1; border-radius: 22%; background: var(--cm-chalk); box-shadow: 0 2px 3px rgb(0 0 0 / 0.1), 0 18px 34px -12px rgb(22 38 74 / 0.4); }
.cmw-badge-pop img { width: 74%; }
.cmw-chip { display: grid; gap: 0.35em; justify-items: start; padding: 0.95em 1.2em 1em; border-radius: 1em; background: var(--cm-navy); color: #fff; font-family: "Bricolage Grotesque", var(--font); white-space: nowrap; }
.cmw-chip strong { display: flex; align-items: center; gap: 0.45em; font-size: clamp(15px, 1.3vw, 19px); font-weight: 700; letter-spacing: -0.02em; }
.cmw-chip strong i { display: grid; place-items: center; width: 1.25em; height: 1.25em; border-radius: 50%; background: var(--cm-gold); }
.cmw-chip strong svg { width: 62%; }
.cmw-chip span { font-size: clamp(11px, 0.85vw, 13px); color: rgb(255 255 255 / 0.72); }

/* ---------- the street: the site's hero, live ---------- */
.cmw-hero { border-radius: clamp(16px, 2vw, 26px); overflow: hidden; border: 1px solid rgb(22 38 74 / 0.1); background: #fff; }
.cmw-hero__bar { display: flex; align-items: center; gap: 7px; padding: 11px 16px; border-bottom: 1px solid rgb(22 38 74 / 0.08); background: #fff; }
.cmw-hero__bar i { width: 10px; height: 10px; border-radius: 50%; background: #dcdde0; }
.cmw-hero__bar span { margin: 0 auto; padding: 4px 14px; border-radius: 99px; background: #f2f3f5; font-size: 12px; color: #6b6f78; }
.cmw-hero__bar button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid rgb(22 38 74 / 0.14); border-radius: 99px; background: #fff; font: 600 12.5px/1 var(--font); color: var(--cm-navy); cursor: pointer; }
.cmw-hero__bar button:hover { border-color: var(--cm-gold); }
.cmw-hero__bar button svg { width: 13px; height: 13px; }
.cmw-hero__sky {
  /* the site's own sky: pale steel under the nav, feathered to white before the street */
  background: linear-gradient(180deg, color-mix(in srgb, var(--cm-tsteel) 70%, #fff) 0, color-mix(in srgb, var(--cm-tsteel) 45%, #fff) 100px, #fff 330px);
  padding-top: clamp(22px, 3.4vw, 46px);
  font-family: "Bricolage Grotesque", var(--font); color: var(--cm-ink);
}
.cmw-hero__text { padding: 0 clamp(18px, 4vw, 56px); max-width: 640px; }
.cmw-hero__h { font-size: clamp(30px, 3.6vw, 54px); font-weight: 700; letter-spacing: -0.045em; line-height: 0.98; }
.cmw-hero__h u { text-decoration: none; background: linear-gradient(var(--cm-gold), var(--cm-gold)) 0 92% / 100% 0.09em no-repeat; padding-bottom: 0.06em; }
.cmw-hero__lede { margin-top: 12px; max-width: 40ch; color: #5f6575; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.5; }
.cmw-street { position: relative; width: 100%; aspect-ratio: 1600 / 440; margin-top: clamp(4px, 1.4vw, 18px); }
.cmw-street > svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.cmw-hero__cap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 14px; color: var(--grey-5); }
@media (max-width: 720px) {
  /* phones: the street keeps its height and crops its ends, centred on the house, as on the site */
  .cmw-street { aspect-ratio: auto; height: 230px; }
  .cmw-hero__bar span { display: none; }
  .cmw-hero__bar button { margin-left: auto; }
}

.cmw-street {
  --ink: #1a2238; --ink-2: #5f6575; --ink-3: #9a9ea8; --navy: #16264a;
  --gold: #d9a441; --t-gold: #f7e3b5; --t-oak: #f1dec6; --t-steel: #d7e6f5;
  --b1: color-mix(in srgb, var(--t-steel) 45%, #fff); --b2: color-mix(in srgb, var(--t-steel) 80%, #fff);
  --grey: color-mix(in srgb, var(--ink-3) 7%, #fff); --line: color-mix(in srgb, var(--ink-3) 24%, #fff);
  --lw: 1.8;
}
@media (max-width: 720px) { .cmw-street { --lw: 1.3; } }
.cmw-street svg * { vector-effect: non-scaling-stroke; }
.cmw-street :is(.k, .kf, .kg, .kd, .kgl, .kg-gold, .kb1, .kb2, .kroof, .kdoor, .kdingy, .kplank, .ktarp, .khole, .tk-c) {
  stroke: var(--ink); stroke-width: var(--lw); stroke-linecap: round; stroke-linejoin: round;
}
.cmw-street .k { fill: none; }
.cmw-street .thin { stroke-width: calc(var(--lw) * .6); }
.cmw-street .kf { fill: #fff; }
.cmw-street :is(.kg, .kroof) { fill: var(--grey); }
.cmw-street .kd { fill: var(--ink); }
.cmw-street .kgl { fill: var(--t-gold); }
.cmw-street :is(.kg-gold, .kdoor) { fill: var(--gold); }
.cmw-street .kb1 { fill: var(--b1); }
.cmw-street .kb2 { fill: var(--b2); }
.cmw-street .sh { fill: var(--b2); fill-opacity: .72; stroke: none; }
.cmw-street .far { fill: color-mix(in srgb, var(--b1) 70%, #fff); stroke: none; }
.cmw-street .farw { stroke: #fff; stroke-width: 2.2; }
.cmw-street .rd { fill: color-mix(in srgb, var(--b1) 40%, #fff); }
.cmw-street .kerb { fill: none; stroke: var(--b2); stroke-width: 1; }
.cmw-street .collar { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; }
.cmw-street .vh-steam { fill: none; stroke: var(--ink-3); stroke-width: calc(var(--lw) * .65); stroke-linecap: round; }
.cmw-street .kw { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.cmw-street .kdingy { fill: var(--line); }
.cmw-street .kplank { fill: var(--t-oak); }
.cmw-street .ktarp { fill: var(--t-steel); }
.cmw-street .khole { fill: var(--ink-2); }
.cmw-street .khatch { fill: none; stroke: var(--ink-3); stroke-width: 1; stroke-linecap: round; }
.cmw-street .ktape { fill: none; stroke: var(--ink-2); stroke-width: 3; stroke-linecap: round; opacity: .7; }
.cmw-street .vb { fill: none; stroke: color-mix(in srgb, var(--t-steel) 80%, var(--ink-3)); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.cmw-street .vb .vh-cloud path { fill: #fff; }
.cmw-street .pv { fill: var(--b1); }
.cmw-street .road { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 26 22; }
.cmw-street .tk-c { fill: var(--gold); }
.cmw-street .tk-v { fill: none; stroke: var(--ink); stroke-width: calc(var(--lw) * 1.3); stroke-linecap: round; stroke-linejoin: round; }
.cmw-street .vh-spark { fill: var(--gold); }
.cmw-street .vh-stripe { fill: var(--gold); }
.cmw-street .vh-tel { font: 700 11px "Bricolage Grotesque", var(--font); fill: var(--navy); letter-spacing: .02em; }
.cmw-street .puff { fill: #fff; stroke: var(--ink-3); stroke-width: calc(var(--lw) * .65); }

/* life in the scene runs only while the van drives, then the street goes still (as on the site) */
@media (prefers-reduced-motion: no-preference) {
  .cmw-street .vh-cloud { animation: cmw-drift 38s linear infinite alternate; }
  .cmw-street .vh-cloud.c2 { animation-duration: 46s; animation-direction: alternate-reverse; }
  .cmw-street .vh-cloud.c3 { animation-duration: 54s; }
  .cmw-street .vh-birds { animation: cmw-bob 3.2s ease-in-out infinite; }
  .cmw-street .puff { transform-box: fill-box; transform-origin: center; animation: cmw-puff 1.1s ease-out infinite; }
  .cmw-street .puff.p2 { animation-delay: .35s; }
  .cmw-street .puff.p3 { animation-delay: .7s; }
  .cmw-street .vh-steam { animation: cmw-steam 2.4s ease-in-out infinite; }
  .cmw-street :is(.vh-cloud, .vh-birds, .vh-steam, .puff) { animation-play-state: paused; }
  .cmw-street.is-live :is(.vh-cloud, .vh-birds, .vh-steam), .cmw-street .is-driving .puff { animation-play-state: running; }
}
@keyframes cmw-drift { to { transform: translateX(60px); } }
@keyframes cmw-bob { 50% { transform: translateY(-6px); } }
@keyframes cmw-puff { 0% { opacity: 0; transform: translateX(0) scale(.4); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateX(-26px) scale(1.25); } }
@keyframes cmw-steam { 0%, 100% { opacity: .35; transform: translateY(1px); } 50% { opacity: 1; transform: translateY(-2px); } }

/* ---------- the logo ---------- */
.cmw-logo { display: grid; grid-template-columns: 1.55fr 1fr; gap: clamp(10px, 1.2vw, 16px); }
.cmw-logo figure { margin: 0; position: relative; border-radius: clamp(14px, 1.6vw, 22px); overflow: hidden; }
.cmw-logo figcaption { position: absolute; left: 18px; bottom: 14px; font-size: 13px; font-weight: 500; }
.cmw-logo__main { display: grid; place-items: center; min-height: 340px; background: var(--cm-chalk); }
.cmw-logo__main img { width: min(72%, 560px); }
.cmw-logo__main figcaption { color: #6d6a63; }
.cmw-logo__film { background: var(--cm-navy); aspect-ratio: 1; }
.cmw-logo__film video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cmw-logo__film figcaption { color: rgb(255 255 255 / 0.7); }
.cmw-logo__trades { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 16px); }
.cmw-logo__trade { margin: 0; display: grid; justify-items: center; gap: 10px; padding: clamp(18px, 2.2vw, 30px) 10px 16px; border-radius: clamp(14px, 1.6vw, 22px); background: #f6f6f4; }
.cmw-logo__trade img { width: min(70%, 120px); }
.cmw-logo__trade span { font-size: 13.5px; font-weight: 500; color: var(--grey-7); }
@media (max-width: 760px) {
  .cmw-logo { grid-template-columns: 1fr; }
  .cmw-logo__main { grid-row: auto; min-height: 220px; }
  .cmw-logo__film { aspect-ratio: 1; }
  .cmw-logo__trades { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cmw-logo__trade:first-child { grid-column: span 3; }
}

/* ---------- the kit: a few real mockups, justified rows (as on PATCH) ---------- */
.cmw-kit { display: grid; gap: clamp(10px, 1.2vw, 16px); }
.cmw-kit__row { display: flex; gap: clamp(10px, 1.2vw, 16px); }
.cmw-tile { flex: var(--a) 1 0; min-width: 0; margin: 0; aspect-ratio: var(--a); position: relative; overflow: hidden; border-radius: clamp(14px, 1.6vw, 22px); background: #f1f1ef; cursor: zoom-in; }
.cmw-tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: scale 1.1s var(--ease-out); }
.cmw-tile:hover img { scale: 1.04; }
.cmw-tile figcaption { position: absolute; left: 14px; bottom: 12px; padding: 5px 11px; border-radius: 99px; background: rgb(255 255 255 / 0.88); font-size: 12.5px; font-weight: 500; color: #222; }
@media (max-width: 700px) {
  .cmw-kit__row { flex-direction: column; }
  .cmw-tile { flex: none; width: 100%; aspect-ratio: 4 / 3; }
  .cmw-tile--wide { aspect-ratio: var(--a); }
}

/* ---------- type specimen in Connor's font ---------- */
.cmw .specimen__aa, .cmw .cmw-type { font-family: "Bricolage Grotesque", var(--font); }
.cmw-type { font-size: clamp(26px, 3vw, 40px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--cm-ink); }
.cmw-type em { font-style: normal; background: linear-gradient(var(--cm-gold), var(--cm-gold)) 0 94% / 100% 0.09em no-repeat; }
.cmw .specimen__weights span { font-family: "Bricolage Grotesque", var(--font); }

/* the phone panel in Connor's pale sky, not black (John, 10 Nov) */
.cmw .parade { background: color-mix(in srgb, var(--cm-tsteel) 55%, #fff); }
.cmw .parade__caption { color: #5f6575; }

/* type panel in Connor's chalk, navy type (John, 10 Nov: not black) */
.cmw .specimen { background: var(--cm-chalk); color: var(--cm-navy); }
.cmw .specimen__aa { color: var(--cm-navy); font-weight: 700; }
.cmw .specimen__weights { grid-template-columns: repeat(4, 1fr); }
.cmw .specimen__weights span { background: #fff; color: var(--cm-navy); }

/* ---------- Up close: real pieces of his site (2x captures) breaking out of his colours, as on Birth-hood ---------- */
.cmw-breakout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); align-items: end; padding-top: clamp(10px, 2vw, 30px); }
.cmw-break { position: relative; margin: 0; display: grid; grid-template-rows: auto auto; align-content: end; gap: 18px; isolation: isolate; }
.cmw-break--wide { margin-top: clamp(28px, 4vw, 56px); }
.cmw-break__panel { grid-area: 1 / 1; align-self: end; height: clamp(260px, 24vw, 340px); border-radius: clamp(18px, 2vw, 28px); z-index: -1; }
.cmw-break__panel--navy { background: var(--cm-navy); }
.cmw-break__panel--sky { background: color-mix(in srgb, var(--cm-tsteel) 75%, #fff); }
.cmw-break__panel--chalk { background: var(--cm-chalk); height: clamp(150px, 14vw, 200px); }
.cmw-break figcaption { display: grid; gap: 4px; padding-inline: 4px; }
.cmw-break figcaption b { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.cmw-break figcaption span { font-size: 15px; color: var(--grey-7); }
.cmw-break img { display: block; width: 100%; height: auto; }
.cmw-break__stack { grid-area: 1 / 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 4% 9%; align-items: end; }
.cmw-break__card, .cmw-break__quote, .cmw-break__ba, .cmw-break__steps {
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 4px rgb(22 38 74 / 0.08), 0 30px 50px -24px rgb(10 20 50 / 0.55);
  transition: rotate 0.6s var(--ease-out), translate 0.6s var(--ease-out);
}
.cmw-break__card { margin-inline: -3%; padding: 8% 7% 5%; background: #f7f7f6; translate: 0 var(--y, 0); rotate: var(--r, 0deg); }
.cmw-break__card:nth-child(2) { z-index: 2; }
.cmw-break__card:hover { rotate: 0deg; translate: 0 calc(var(--y, 0px) - 18px); z-index: 3; }
.cmw-break__pair { grid-area: 1 / 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); padding: 0 5% 9%; }
.cmw-break__quote { grid-row: 1; grid-column: 1 / span 9; rotate: -4deg; align-self: start; margin-bottom: 36%; z-index: 1; }
.cmw-break__ba { grid-row: 1; grid-column: 5 / -1; rotate: 5deg; align-self: end; z-index: 2; border-radius: 14px; }
.cmw-break__quote:hover { rotate: -1deg; z-index: 3; }
.cmw-break__ba:hover { rotate: 2deg; }
.cmw-break__steps { grid-area: 1 / 1; align-self: end; margin: 0 6% 5%; padding: 3% 3.5%; background: #f6f8fb; rotate: -1deg; }
@media (max-width: 860px) {
  .cmw-breakout { grid-template-columns: 1fr; gap: 40px; }
  .cmw-break__card { padding: 6% 5% 4%; }
}

/* the hero text centred over the street in the case study (John, 10 Nov) */
.cmw-hero__text { margin-inline: auto; text-align: center; }
.cmw-hero__lede { margin-inline: auto; }

/* ---------- the fourth phone: opens his menu and taps Recent work (cm-mainworks.js) ---------- */
.cmw-menu-phone .screen { position: relative; overflow: hidden; background: #fff; }
.cmw-ph { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 390 / 844; }
.cmw-ph img, .cmw-ph__page img { display: block; width: 100%; }
.cmw-ph__menu { position: absolute; inset: 0; opacity: 0; }
.cmw-ph__tap { position: absolute; left: 89.5%; top: 3.9%; width: 15%; aspect-ratio: 1; margin: -7.5% 0 0 -7.5%; border-radius: 50%; background: rgb(22 38 74 / 0.22); box-shadow: 0 0 0 2px rgb(255 255 255 / 0.9); opacity: 0; pointer-events: none; }
.cmw-ph__page { position: absolute; inset: 0; overflow: hidden; background: #fff; opacity: 0; }
@media (min-width: 801px) { .cmw .parade .phone { width: clamp(140px, 13.5vw, 210px); } }

/* Quote card in full top left, a live before and after slider bottom right (John, 10 Nov) */
.cmw-break__pair { display: block; position: relative; grid-area: 1 / 1; aspect-ratio: 1 / 0.8; margin: 0 6% 7%; padding: 0; }
.cmw-break__pair .cmw-break__quote { position: absolute; left: -2%; bottom: 0; top: auto; width: 50%; margin: 0; rotate: -3deg; z-index: 2; box-shadow: 0 2px 4px rgb(22 38 74 / 0.1), 0 26px 40px -18px rgb(10 20 50 / 0.6); }
.cmw-break__pair .cmw-break__ba { position: absolute; right: 0; top: 0; bottom: auto; width: 88%; margin: 0; rotate: 2deg; z-index: 1; }
.cmw-ba { aspect-ratio: 1000 / 663; overflow: hidden; touch-action: pan-y; }
.cmw-ba > img, .cmw-ba__before img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmw-ba__before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cmw-ba__tag { position: absolute; top: 5%; padding: 4px 10px; border-radius: 99px; background: rgb(255 255 255 / 0.9); font: 600 12px/1.2 "Bricolage Grotesque", var(--font); color: #1a2238; pointer-events: none; }
.cmw-ba__tag--l { left: 4%; } .cmw-ba__tag--r { right: 4%; }
.cmw-ba__line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.cmw-ba__line i { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 4px 14px rgb(0 0 0 / 0.25); }
.cmw-ba__line svg { width: 20px; fill: none; stroke: #1a2238; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cmw-ba__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.cmw-ba:focus-within .cmw-ba__line i { outline: 2px solid #d9a441; outline-offset: 2px; }
@media (max-width: 860px) { .cmw-break__pair { aspect-ratio: 1 / 0.86; margin-inline: 5%; } .cmw-break__pair .cmw-break__quote { width: 56%; } }

/* the page's highlighter in Connor's gold, as each case study has its own (body[data-pen] in case.css) */
body.cmw { --project-pen: #f2c96d; }

/* phones: the steps as his phone shows them (stacked), a narrower card, and clear space after each caption */
@media (max-width: 700px) {
  .cmw-break__steps { margin: 0 12% 7%; padding: 5% 6%; rotate: -1.5deg; }
  .cmw-break__panel--chalk { height: clamp(240px, 78vw, 360px); }
  .cmw-breakout { gap: 64px; }
  .cmw-break--wide { margin-top: 64px; }
}
