/* Shared shell, loaded last on every page: one header position, one footer, one palette.
   Tokens follow the Figma design system, board "08 Refined foundations" (one ink, one paper). */
:root{--mj-ink:#190615;--mj-paper:#EEF4F9;--mj-raised:#FFFFFF;--mj-muted:#6A5866;--mj-line:#C8D3DF;--mj-on-ink:#EEF4F9;--mj-placeholder:#E2EBF4}
html{overflow-x:clip}

/* Header: same resting and sticky position everywhere (DS / Header: sticky top 12px) */
body{padding-top:12px!important}
body>header.portfolio-header{top:12px!important;margin-top:0!important}

/* Footer: full-bleed ink band with one large call to talk */
body>footer.site-footer{--ink:var(--mj-on-ink);--muted:var(--mj-on-ink);display:block!important;box-sizing:border-box;width:auto!important;max-width:none!important;margin:clamp(72px,9vw,140px) calc(50% - 50vw) 0!important;padding:clamp(56px,7vw,104px) 0 28px!important;border:0!important;background:var(--mj-ink)!important;color:var(--mj-on-ink)!important;font:400 16px/1.4 var(--font,Arial,Helvetica,sans-serif)!important;letter-spacing:0!important;text-align:left!important}
body.strategy-editorial>footer.site-footer{border-top:1px solid rgba(238,244,249,.22)!important}
/* Homepage ends on the burgundy practice band: no paper gap, just a thin line before the footer */
body[data-route="home"]>footer.site-footer{margin-top:0!important;border-top:1px solid rgba(238,244,249,.22)!important}
/* footer text starts on the same content edge as the page and the header links */
body>footer.site-footer .site-footer-inner{box-sizing:border-box;width:var(--site-w);margin:0 auto;padding:0}
body>footer.site-footer p{margin:0;color:var(--mj-on-ink)!important}
body>footer.site-footer .site-footer-kicker{font-size:14px;line-height:20px;color:var(--mj-on-ink)!important}
body>footer.site-footer .site-footer-lead{margin-top:clamp(22px,3vw,40px);font-size:var(--t-53,54px);line-height:1;letter-spacing:-.045em}
body>footer.site-footer .site-footer-cta{display:inline-flex;align-items:baseline;gap:.18em;margin-top:.12em;font-size:var(--t-53,54px);line-height:1.05;letter-spacing:-.045em;color:var(--mj-on-ink)!important;text-decoration:underline;text-decoration-thickness:max(2px,.04em);text-underline-offset:.12em;transition:opacity .2s ease}
body>footer.site-footer .site-footer-cta:hover{opacity:.78}
body>footer.site-footer .site-footer-meta{display:flex;flex-wrap:wrap;justify-content:space-between;gap:14px 30px;margin-top:clamp(56px,8vw,112px);padding-top:20px;border-top:1px solid rgba(238,244,249,.22);font-size:14px;line-height:20px}
body>footer.site-footer .site-footer-meta nav{position:static!important;display:flex!important;flex-wrap:wrap;justify-content:flex-start!important;gap:8px 30px!important;width:auto!important;margin:0!important;padding:0!important;background:none!important;box-shadow:none!important}
body>footer.site-footer .site-footer-meta a{padding:0!important;color:var(--mj-on-ink)!important;text-decoration:none}
body>footer.site-footer .site-footer-meta a:hover{text-decoration:underline;text-underline-offset:4px}
body>footer.site-footer a:focus-visible{outline:2px solid var(--mj-on-ink);outline-offset:5px;border-radius:4px}
@media(max-width:760px){body>footer.site-footer .site-footer-meta{flex-direction:column}}

/* Lab landing: same intro and hover list as Case Studies / Strategy, paintings as a plain grid */
[data-page="lab"]{padding-top:25px!important}
[data-page="lab"] .lab-cover-grid .case-cover .strategy-overlay small{white-space:nowrap}
[data-page="lab"] .paintings-section{margin-top:clamp(96px,12vw,180px)}
[data-page="lab"] .painting-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(20px,2.4vw,36px);overflow:visible!important;padding:0!important;margin-top:clamp(32px,4vw,56px)}
[data-page="lab"] .painting-grid>article{width:auto!important;min-width:0;flex:none!important;margin:0}
[data-page="lab"] .painting-grid .portfolio-image{height:auto!important;aspect-ratio:4/3;min-height:0!important;background:var(--mj-placeholder);border-radius:16px;overflow:hidden}
[data-page="lab"] .painting-grid .portfolio-image img{width:100%;height:100%;object-fit:cover}
[data-page="lab"] .painting-grid figcaption{display:none}
[data-page="lab"] .painting-grid .painting-title{margin:12px 0 0;font-size:14px;line-height:20px;font-weight:400;color:var(--mj-muted)}
@media(max-width:760px){[data-page="lab"] .painting-grid{grid-template-columns:1fr}[data-page="lab"] .lab-cover-grid .case-cover .strategy-overlay small{white-space:normal}}


/* Phones: Case Studies / Strategy / Lab rows get a reserved thumbnail column (from the design-system branch) */
@media(max-width:760px){
  .case-cover-grid:not(.bands) .case-cover{
    grid-template-columns:minmax(0,1fr) clamp(96px,30vw,180px)!important;
    grid-template-rows:auto auto;
    column-gap:16px!important;row-gap:6px;
    align-items:start;
    padding:16px 0!important
  }
  .case-cover-grid:not(.bands) .case-cover .strategy-overlay h2{grid-column:1;grid-row:1;opacity:1!important}
  .case-cover-grid:not(.bands) .case-cover .strategy-overlay small{
    grid-column:1;grid-row:2;text-align:left!important;font-size:14px!important;line-height:1.4!important
  }
  .case-cover-grid:not(.bands) .case-cover figure{
    position:static!important;grid-column:2;grid-row:1/span 2;align-self:center;
    width:100%!important;left:auto!important;top:auto!important;margin:0!important;
    transform:none!important;opacity:1!important;box-shadow:none!important;
    border-radius:10px;pointer-events:none
  }
  .case-cover-grid:hover .case-cover h2{opacity:1!important}
}

/* Footer lead and Let's talk: two steps below the old size on the Figma --t scale (86 -> 54, 68 -> 42, 42 -> 26) */
@media(max-width:1100px){body>footer.site-footer :is(.site-footer-lead,.site-footer-cta){font-size:var(--t-42,42px)}}
@media(max-width:760px){body>footer.site-footer :is(.site-footer-lead,.site-footer-cta){font-size:var(--t-26,26px)}}

/* Strategy project pages: the same previous / all / next pager as the case studies */
.strategy-pager{display:grid;grid-template-columns:1fr auto 1fr;align-items:end;gap:24px;margin-top:clamp(60px,8vw,110px);padding:28px 0 8px;border-top:1px solid var(--mj-line);clear:both}
.strategy-pager a{color:var(--mj-ink)!important;text-decoration:none}
.strategy-pager span{display:block;font:500 12px/1.4 var(--font);letter-spacing:.09em;text-transform:uppercase;color:var(--mj-muted)!important;margin-bottom:8px}
.strategy-pager strong{display:block;font:500 clamp(22px,2.6vw,38px)/1.1 var(--font);letter-spacing:-.03em}
.strategy-pager strong i{font-style:normal;display:inline-block;transition:transform .25s ease}
.strategy-pager .next{text-align:right}
.strategy-pager .all{align-self:center;font:500 14px/1 var(--font);padding:12px 20px;border:1px solid var(--mj-ink);border-radius:999px;transition:background .25s ease,color .25s ease}
@media(hover:hover){.strategy-pager .prev:hover strong i{transform:translateX(-6px)}.strategy-pager .next:hover strong i{transform:translateX(6px)}.strategy-pager .all:hover{background:var(--mj-ink);color:var(--mj-paper)!important}}
body.strategy-editorial .strategy-pager{border-top-color:rgba(238,244,249,.22)}
body.strategy-editorial .strategy-pager :is(a,span,strong){color:var(--mj-on-ink)!important}
body.strategy-editorial .strategy-pager .all{border-color:var(--mj-on-ink)}
@media(hover:hover){body.strategy-editorial .strategy-pager .all:hover{background:var(--mj-on-ink);color:var(--mj-ink)!important}}
@media(max-width:760px){.strategy-pager{grid-template-columns:1fr 1fr}.strategy-pager .all{grid-column:1/-1;grid-row:2;justify-self:center}}

/* Lab project pages: the case study template, same opening as case studies (name, then intro) */
.lab-page .lab-opening{display:block;padding-bottom:0}
.lab-page .lab-opening h1{margin:20px 0}
.lab-page .lab-opening p{margin:24px 0 48px}
@media(max-width:1100px){.lab-page .lab-opening p{margin-top:20px}}
.lab-page .lab-takeaway .scroll-story-images{display:none}
.lab-page .lab-credit{margin:clamp(32px,4vw,56px) 0 0;font-size:14px;line-height:1.5;color:var(--mj-muted)}
.lab-page .lab-spec{display:grid;grid-template-columns:auto 1fr;gap:6px 18px;margin:20px 0 0;font-size:14px;line-height:1.5}
.lab-page .lab-spec dt{font-size:12px;letter-spacing:.09em;text-transform:uppercase;color:var(--mj-muted)}
.lab-page .lab-spec dd{margin:0}

.case-page.lab-page>.lab-hero:first-child{position:relative;width:100%;max-width:100%;left:auto;margin:0}
.case-page.lab-page>.lab-hero:first-child .portfolio-image{width:100%;height:var(--case-hero-h);min-height:0;aspect-ratio:auto;border-radius:16px;overflow:hidden}
.case-page.lab-page>.lab-hero:first-child .portfolio-image>img{width:100%;height:100%;object-fit:cover}
.case-page.lab-page>.lab-hero:first-child figcaption{display:none}

/* One info band everywhere: values at the Figma 14px */
.credentials.project-metadata dd{font-size:14px!important;line-height:1.5}

/* 12-column grid (desktop): the info band snaps to columns 1, 4, 7 and 10, so Role lines up with the story images */
@media(min-width:1101px){
  .credentials.project-metadata{grid-template-columns:repeat(12,minmax(0,1fr))!important;column-gap:var(--gutter,24px)!important}
  .credentials.project-metadata>div{grid-column:span 3!important;min-width:0}
}
@media(min-width:761px) and (max-width:1100px){.credentials.project-metadata{grid-template-columns:repeat(2,minmax(0,1fr))!important;column-gap:var(--gutter,24px)!important}}

/* Lab image grids: pairs and 2 x 2 sets on the standard gutter */
.lab-page .lab-grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--gutter,24px);align-items:start}
.lab-page .lab-grid figure{margin:0}
.lab-page .lab-grid-caption{margin:10px 0 0;font-size:14px;line-height:1.5;color:var(--mj-muted)}
@media(max-width:760px){.lab-page .lab-grid-2{gap:12px}}

/* ---- 12-column pass (desktop): every block starts and ends on a column ---- */
@media(min-width:1101px){
  /* shared helpers */
  .se-main :is(.se-masthead,.se-brief,.se-premise,.se-section-heading,.se-visual,.se-close-grid,.gm-shift,.gm-pair,.gm-tables,.gm-notes,.bp-insight-media),
  .se-main :is(.gm-cols,.gm-steps):not(:has(>:nth-child(5):last-child)),
  .case-page .case-pills,
  .case-pager{display:grid!important;grid-template-columns:repeat(12,minmax(0,1fr))!important;column-gap:var(--gutter,24px)!important}

  /* equal sets: 2 = six columns each, 3 = four, 4 = three, 6 = two */
  :is(.se-main :is(.gm-pair,.gm-tables,.gm-notes,.gm-cols,.gm-steps),.case-page .case-pills)>*{grid-column:span 4}
  :is(.se-main :is(.gm-pair,.gm-tables,.gm-notes,.gm-cols,.gm-steps),.case-page .case-pills)>:first-child:nth-last-child(2),
  :is(.se-main :is(.gm-pair,.gm-tables,.gm-notes,.gm-cols,.gm-steps),.case-page .case-pills)>:first-child:nth-last-child(2)~*{grid-column:span 6}
  :is(.se-main :is(.gm-pair,.gm-tables,.gm-notes,.gm-cols,.gm-steps),.case-page .case-pills)>:first-child:nth-last-child(4),
  :is(.se-main :is(.gm-pair,.gm-tables,.gm-notes,.gm-cols,.gm-steps),.case-page .case-pills)>:first-child:nth-last-child(4)~*{grid-column:span 3}
  :is(.se-main :is(.gm-pair,.gm-tables,.gm-notes,.gm-cols,.gm-steps),.case-page .case-pills)>:first-child:nth-last-child(6),
  :is(.se-main :is(.gm-pair,.gm-tables,.gm-notes,.gm-cols,.gm-steps),.case-page .case-pills)>:first-child:nth-last-child(6)~*{grid-column:span 2}
  .se-main :is(.gm-pair,.gm-tables,.gm-notes,.gm-cols,.gm-steps),.case-page .case-pills{row-gap:32px!important}

  /* opening: headline 1-7, intro 8-12 */
  .se-main .se-masthead>h1{grid-column:1/8}
  .se-main .se-masthead>.se-intro{grid-column:8/13;max-width:none}
  /* brief: label 1-3, text 4-12 (lines up with Role and the case study image column) */
  .se-main .se-brief>.se-kicker{grid-column:1/4}
  .se-main .se-brief>div{grid-column:4/13;max-width:none}
  /* idea: heading 1-6, text 7-12, the rest full width */
  .se-main .se-premise>:first-child{grid-column:1/7}
  .se-main .se-premise>.se-premise-copy{grid-column:7/13}
  .se-main .se-premise>:not(:first-child):not(.se-premise-copy){grid-column:1/-1}
  /* section headings: heading 1-6, note 7-12 */
  .se-main .se-section-heading>h2{grid-column:1/7}
  .se-main .se-section-heading>p:last-child{grid-column:7/13}
  /* visual sections: copy 1-4, image 5-12 */
  .se-main .se-visual>.se-section-heading{grid-column:1/5;display:block!important}
  .se-main .se-visual>figure:not(.gm-rule){grid-column:5/13}
  .se-main .se-visual>:not(.se-section-heading):not(figure:not(.gm-rule)){grid-column:1/-1}
  .se-main .se-close-grid>:first-child{grid-column:1/7}
  .se-main .se-close-grid>:last-child{grid-column:7/13}
  /* from / to */
  .se-main .gm-shift>.gm-from{grid-column:1/7}
  .se-main .gm-shift>.gm-to{grid-column:7/13}
  /* Bourbon: photo pair 1-7 / 8-12, passport and flipbook on columns 2-11 */
  .se-main .bp-insight-media>img:first-of-type{grid-column:1/8}
  .se-main .bp-insight-media>img:nth-of-type(2){grid-column:8/13}
  .se-main .bp-insight-media>figcaption{grid-column:1/-1}
  .se-main :is(.bp-passport,.bp-passport-fig figcaption){max-width:none!important;margin-inline:calc((100% + var(--gutter,24px))/12)!important}
  .strategy-editorial .se-deck-book .lr-book{width:calc(100% - (100% + var(--gutter,24px))/6)!important}

  /* pager: previous 1-5, all 6-7, next 8-12 */
  .case-pager>.prev{grid-column:1/6}
  .case-pager>.all{grid-column:6/8;justify-self:center}
  .case-pager>.next{grid-column:8/13}
}

/* ---- Strategy landing: burgundy ground, light blue type (Figma ink #190615 / paper #EEF4F9 only) ---- */
body[data-route="strategy"]{background:var(--mj-ink)!important}
body[data-route="strategy"] section[data-page="strategy"],
body[data-route="strategy"] section[data-page="strategy"] :is(h1,h2,p,small,span,a){color:var(--mj-on-ink)!important}
body[data-route="strategy"] [data-page="strategy"] .strategy-cover-grid .case-cover,
body[data-route="strategy"] [data-page="strategy"] .strategy-cover-grid .case-cover .strategy-overlay :is(h2,small){color:var(--mj-on-ink)!important}
body[data-route="strategy"] [data-page="strategy"] :is(.case-cover-grid,.case-cover){border-color:rgba(238,244,249,.22)!important}
body[data-route="strategy"]>footer.site-footer{border-top:1px solid rgba(238,244,249,.22)!important}

/* lab images and captions match the case studies */
.lab-page .scroll-story-images .portfolio-image{border-radius:16px;overflow:hidden}
.lab-page .scroll-story-images .portfolio-image>video{display:block;width:100%;height:auto}
/* Leegality lab captions use the Leegality case study caption: Roboto Light */
.lab-workflow .scroll-story-images figcaption{font-family:Roboto,system-ui,sans-serif;font-weight:300}
/* text link under lab story copy: same treatment as the case-study .more link, at the 14px link role */
.lab-page .sticky-story-copy .more{display:inline-block;margin-top:20px;font-size:14px;line-height:1.5;text-decoration:underline;text-underline-offset:4px}
/* homepage hero: small portrait on the right of the top row */
.type-hero-top .hero-portrait{margin-left:auto;flex:none;width:clamp(96px,9vw,150px);aspect-ratio:700/761;border-radius:16px;overflow:hidden}
.type-hero-top .hero-portrait img{display:block;width:100%;height:100%;object-fit:cover}
@media(max-width:760px){.type-hero-top .hero-portrait{align-self:flex-end;margin-left:0;width:84px}}

/* First screen = hero only. Every project hero (case studies, Lab, Strategy) runs from under the header to 24px above the bottom of the window at any size; the image crops to fit instead of letting the title peek in. */
:root{--case-hero-h:max(320px,calc(100svh - 114px))}
@media(max-width:760px){:root{--case-hero-h:max(300px,calc(100svh - 104px))}}
.strategy-editorial .se-main>.se-cover :is(img,video){height:max(300px,calc(100svh - 141px))!important;max-height:none!important;aspect-ratio:auto!important;object-fit:cover!important}
@media(max-width:760px){.strategy-editorial .se-main>.se-cover :is(img,video){height:max(280px,calc(100svh - 152px))!important}}

/* Captions converted to the shared "+ Title / description" label (L77, PRI, Auro, Foundr) */
.case-page figcaption.lbl{display:flex;justify-content:space-between;flex-wrap:wrap;gap:4px 16px;padding-top:12px;margin:0;letter-spacing:.1em;line-height:1.4;text-align:left;color:var(--ink)}
.case-page figcaption.lbl b{font-weight:600}

/* Profile on the MJ system: media radius */
section[data-page="profile"] h1{font-size:86px}
.profile-portrait-photo,.profile-portrait-photo img{border-radius:var(--radius-media,16px)}

/* Labels in narrow cards: let title and description stack instead of pushing past the page (Leegality at 768px) */
.case-page .lbl>span{min-width:0;overflow-wrap:break-word}
@media(max-width:1100px){.case-page .lbl{flex-wrap:wrap}}

/* Profile portrait image trail (profile-trail.js): square life photos follow the cursor over the portrait */
.profile-trail{--trail-size:clamp(112px,10vw,152px);position:fixed;inset:0;pointer-events:none;z-index:40;overflow:hidden}
.profile-trail img{position:absolute;width:var(--trail-size);height:var(--trail-size);object-fit:cover;border-radius:var(--radius-media,16px);transform:translate(-50%,-50%) rotate(var(--r,0deg)) scale(.86);opacity:0;transition:transform .45s var(--ease-out-strong,cubic-bezier(.23,1,.32,1)),opacity .25s ease}
.profile-trail img.in{opacity:1;transform:translate(-50%,-50%) rotate(var(--r,0deg)) scale(1)}
.profile-trail img.out{opacity:0;transform:translate(-50%,-50%) rotate(var(--r,0deg)) scale(.92)}
.profile-portrait[data-trail]{cursor:default}
