/* Cohabit case study. Breakpoints are the same as the rest of the site:
   Desktop 1440+ | Laptop 1025-1439 | Tablet 700-1024 | Phone 699 and below */
.page{color:var(--ink)}

/* floating section nav, stays visible while you scroll */
/* The page is a size container so the floating nav can scale with the header image (cqw = 1% of page width).
   The empty band above the COHABIT letters is ~5.5% of the page width tall, and the nav is sized to stay inside it. */
.page{container-type:inline-size;container-name:page}
.pillwrap{position:sticky;top:max(5px,.8cqw);z-index:15;height:0;display:flex;justify-content:center;pointer-events:none}
.pill{position:relative;pointer-events:auto;align-self:flex-start;display:flex;gap:max(16px,2.2cqw);padding:max(6px,.95cqw) max(12px,1.7cqw);background:#fff;border-radius:max(10px,1.1cqw);box-shadow:0 4px 20px rgba(25,10,100,.16);max-width:calc(100% - 24px);overflow-x:auto;scrollbar-width:none}
.pill::-webkit-scrollbar{display:none}
.pill a{position:relative;z-index:1;flex:none;color:var(--ink);text-decoration:none;font-weight:500;font-size:max(12px,1.4cqw);line-height:1.2;padding:2px 0}
.pill a:hover{color:var(--pillhover,#4A3FD0)}
/* progress fill: grows to the current section, shrinks back when you scroll up, goes solid on the last one */
.pill .fill{position:absolute;left:0;top:0;bottom:0;width:0;background:var(--fill,#C6DDF7);transition:width .35s ease,background-color .3s ease}
.pill .fill.full{background:var(--fillfull,#5B9CF5)}

.cs-hero img{display:block;width:100%;height:auto;background:var(--herobg,#C6E5FF)}

.cs-body{max-width:1240px;margin:0 auto;padding:0 var(--pad)}
.cs-label{margin:20px 0 0;width:min(335px,100%);padding-bottom:6px;border-bottom:3px solid var(--ink);font-size:24px;line-height:1.2;font-weight:400}
.cs h1{margin:22px 0 0;font:500 clamp(28px,3.5vw,46px)/1.2 var(--display);letter-spacing:-.015em}
.cs-facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(8px,2.4cqw,28px);margin:clamp(24px,2.8cqw,40px) 0 0;padding-left:clamp(0px,2.4cqw,24px)}
.cs-facts h3{margin:0 0 6px;font:500 clamp(16px,2.4cqw,30px)/1.2 var(--display)}
.cs-more{display:grid;grid-template-columns:repeat(2,1fr);gap:28px;margin-top:88px;padding-top:36px!important;border-top:1px solid var(--line)}
.cs-k{display:block;margin-bottom:10px;font-size:14px;color:var(--muted)}
.cs-more a{display:block;font-size:17px;line-height:31px;color:var(--ink)}
.cs-facts ul{list-style:none;margin:0;padding:0}
.cs-facts li{font-size:clamp(12px,1.75cqw,20px);line-height:1.8;overflow-wrap:anywhere}
.cs h2{margin:0 0 24px;font:500 clamp(30px,3vw,42px)/1.15 var(--display);letter-spacing:-.01em}
.cs-overview{margin-top:56px}
.cs-overview p{margin:0;font-size:clamp(17px,1.5vw,21px);line-height:1.65}
.cs-overview strong{font-weight:700}
.cs-sec{margin-top:88px;padding:64px 0 0;min-height:60vh;border-top:1px solid var(--line)}
.cs-sec p{margin:0;color:var(--muted)}
.cs-end{height:96px}

/* When the page is too narrow to fit a readable nav inside the empty band above the image,
   the nav becomes a full-width bar above the image, so it never covers the COHABIT letters. */
@container page (max-width:679px){
  .pillwrap{top:0;height:auto;display:block;background:#fff;border-bottom:1px solid var(--line)}
  .pill{gap:0;padding:0 0 0 54px;border-radius:0;box-shadow:none;max-width:none;width:100%}
  .pill a{flex:1 0 auto;text-align:center;padding:14px clamp(4px,1.4vw,10px);font-size:clamp(11px,3vw,14px)}
}

/* Tablet */
@media (max-width:1024px){
  .cs-overview{margin-top:48px}.cs-sec{margin-top:72px}
}
/* Phone */
@media (max-width:699px){
  .cs-facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 16px;margin-top:36px;padding-left:0}
  .cs-facts h3{font-size:25px}.cs-facts li{font-size:18px;line-height:30px}
  .cs-label{margin-top:16px;font-size:20px}
  .cs h1{margin-top:16px}
  .cs-overview{margin-top:40px}.cs-sec{margin-top:56px}
  .cs-sec{padding-top:44px}
}

/* images are display-only: not clickable, draggable, or selectable */
img,video:not([controls]){pointer-events:none;-webkit-user-drag:none;user-select:none}
.cs-more a{overflow-wrap:anywhere}

/* home button, top left of every project page and the resume */
.homebtn{position:fixed;top:max(10px,env(safe-area-inset-top,0px));left:max(12px,env(safe-area-inset-left,0px));z-index:40;display:grid;place-items:center;width:44px;height:44px;border-radius:12px;background:#fff;color:var(--ink,#111);border:1px solid rgba(0,0,0,.1);box-shadow:none;transition:transform .15s,border-color .2s}
.homebtn:hover{transform:scale(1.06);border-color:rgba(0,0,0,.3)}

/* AUTOSOL contract switcher */
.cs-switch{display:inline-flex;gap:4px;padding:4px;margin:28px 0 24px;border:1px solid var(--line);border-radius:14px;background:#fff;max-width:100%}
.cs-switch a{display:flex;flex-direction:column;gap:2px;padding:10px 20px;border-radius:10px;text-decoration:none;color:var(--muted);font-weight:700;font-size:15px;line-height:1.2;transition:background .2s,color .2s}
.cs-switch small{font-weight:500;font-size:13px}
.cs-switch a[aria-current]{background:var(--ink);color:#fff}
.cs-switch a:not([aria-current]):hover{background:var(--tint,#F2F2F2);color:var(--ink)}
@container page (max-width:679px){.cs-switch{display:flex}.cs-switch a{flex:1;padding:9px 12px;font-size:14px}}

/* no hanging single words in titles */
.cs-body h1{text-wrap:balance}
.cs-body .lead,.cs-overview p{text-wrap:pretty}

/* section jumps from the nav: land below the floating bar, not under it */
.cs section[id],.cs .cs-overview[id]{scroll-margin-top:clamp(88px,7cqw,120px)}
@container page (max-width:679px){.cs section[id],.cs .cs-overview[id]{scroll-margin-top:76px}}
/* the sections above already set their own offset below the floating bar; site.css's page-wide offset was adding a second one */
html:has(.page.cs){scroll-padding-top:0}
