/* ===== Page hero (archive heading) ===== */
.page-hero{padding:90px 0 32px;position:relative}
.page-hero__title{font-size:clamp(36px,4.6vw,72px);font-weight:700;letter-spacing:-.028em;line-height:1.02;margin:8px 0 14px;color:var(--text);text-wrap:balance}
.page-hero__lede{font-size:17px;color:var(--muted);max-width:640px;margin:0;line-height:1.55}

/* ===== Filter tabs (underline) ===== */
.work-filter{display:flex;flex-wrap:wrap;column-gap:32px;row-gap:4px;margin-top:28px}
.work-filter__pill{
  position:relative;
  padding:10px 0 14px;
  background:transparent;border:0;
  color:var(--muted);font-size:14px;font-weight:600;letter-spacing:-.01em;
  display:inline-flex;align-items:center;gap:8px;
  transition:color .2s ease;
}
.work-filter__pill::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:2px;border-radius:2px;
  background:linear-gradient(90deg,var(--magenta),var(--amber));
  transform:scaleX(0);transform-origin:left;
  transition:transform .25s ease, opacity .2s ease;opacity:0;
}
.work-filter__pill:hover{color:var(--text)}
.work-filter__pill:hover::after{transform:scaleX(.35);opacity:.55}
.work-filter__pill.is-active{color:var(--text)}
.work-filter__pill.is-active::after{transform:scaleX(1);opacity:1}
.work-filter__count{font-size:11px;font-weight:500;color:rgba(244,242,239,.4);font-variant-numeric:tabular-nums;letter-spacing:0}
.work-filter__pill.is-active .work-filter__count{color:var(--amber)}

/* ===== Filter + sort row (shared: work archive + module archive) ===== */
.filter-group{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:14px;flex-wrap:wrap}
.filter-group .work-filter{margin-top:0}

.filter-sort{display:inline-flex;align-items:center;gap:10px;margin-left:auto;line-height:1}
.filter-sort__label{font-size:11.5px;letter-spacing:.12em;text-transform:uppercase;color:rgba(244,242,239,.45);font-weight:600;white-space:nowrap;line-height:1;display:inline-flex;align-items:center}
.filter-sort__select-wrap{position:relative;display:inline-flex;align-items:center;min-width:200px}
.filter-sort__select{appearance:none;-webkit-appearance:none;background:rgba(244,242,239,.04);border:1px solid var(--line);border-radius:999px;color:var(--text);font-family:inherit;font-size:13.5px;font-weight:600;letter-spacing:-.005em;padding:8px 36px 8px 16px;cursor:pointer;transition:background .18s ease,border-color .18s ease;width:100%}
.filter-sort__select:hover{background:rgba(244,242,239,.07);border-color:rgba(251,121,50,.35)}
.filter-sort__select:focus-visible{outline:2px solid rgba(251,121,50,.55);outline-offset:2px}
.filter-sort__select option{background:#0a0a18;color:var(--text)}
.filter-sort__chev{position:absolute;right:12px;top:50%;transform:translateY(-50%);width:14px;height:14px;color:var(--muted);pointer-events:none;z-index:1}
/* Hide native chevron once Choices wraps the select */
.filter-sort__select-wrap:has(.choices) .filter-sort__chev{display:none}

/* Choices.js dark theme (scoped via .choices--cc-sort) */
/* Use .choices.choices--cc-sort (specificity 0,2,0) to beat default
   .choices{margin-bottom:24px} which loads AFTER work.css. */
.choices.choices--cc-sort{margin:0;min-width:200px;display:inline-flex;align-items:center;line-height:1}
.choices--cc-sort.is-open{z-index:50}
.choices--cc-sort .choices__inner{
  background:rgba(244,242,239,.04);
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--text);
  font-family:inherit;font-size:13.5px;font-weight:600;letter-spacing:-.005em;
  padding:8px 36px 8px 16px;
  min-height:0;
  display:flex;align-items:center;
  width:100%;
  transition:background .18s ease,border-color .18s ease
}
.choices--cc-sort:hover .choices__inner{background:rgba(244,242,239,.07);border-color:rgba(251,121,50,.35)}
/* Keep pill shape even when focused/open — Choices defaults to 4px square */
.choices--cc-sort.is-focused .choices__inner,
.choices--cc-sort.is-open .choices__inner,
.choices--cc-sort.is-open.is-flipped .choices__inner{
  border-color:rgba(251,121,50,.55);
  background:rgba(244,242,239,.07);
  box-shadow:none;
  border-radius:999px
}
.choices--cc-sort .choices__list--single{padding:0;color:var(--text)}
.choices--cc-sort .choices__list--single .choices__item{color:var(--text)}
.choices--cc-sort .choices__placeholder{color:var(--muted);opacity:1}
.choices--cc-sort::after{
  border-color:var(--muted) transparent transparent transparent;
  border-width:5px 4px 0 4px;
  right:14px;margin-top:-2px
}
.choices--cc-sort.is-open::after{border-color:transparent transparent var(--amber) transparent;margin-top:-6px}
.choices--cc-sort .choices__list--dropdown,
.choices--cc-sort .choices__list[aria-expanded]{
  background:#0c0c1c;
  border:1px solid var(--line);
  border-radius:14px;
  margin-top:6px;
  overflow:hidden;
  box-shadow:0 18px 48px rgba(0,0,0,.5)
}
/* The dropdown's nearest stacking-context ancestor (.wrap, z-index:5) ties
   with the .wrap that contains .module-grid below — same z-index, later
   DOM wins → grid intercepts clicks on items 2-5. Lift the whole filter
   section above sibling .wraps so the dropdown can overflow into them. */
.work-filter-section{position:relative;z-index:10}
.choices--cc-sort .choices__list[role="listbox"]{padding:0}
.choices--cc-sort .choices__list--dropdown .choices__item,
.choices--cc-sort .choices__list[aria-expanded] .choices__item{
  color:var(--text);
  font-size:13.5px;font-weight:500;
  padding:10px 16px
}
.choices--cc-sort .choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices--cc-sort .choices__list[aria-expanded] .choices__item--selectable.is-highlighted{
  background:rgba(251,121,50,.14);
  color:var(--text)
}
.choices--cc-sort .choices__list--dropdown .choices__item--selectable[aria-selected="true"],
.choices--cc-sort .choices__list[aria-expanded] .choices__item--selectable[aria-selected="true"]{
  background:rgba(251,121,50,.08);
  color:var(--amber)
}
.choices--cc-sort .choices__list[role="listbox"] > .choices__item:first-child{border-top-left-radius:13px;border-top-right-radius:13px}
.choices--cc-sort .choices__list[role="listbox"] > .choices__item:last-child{border-bottom-left-radius:13px;border-bottom-right-radius:13px}

@media (max-width:600px){
  .filter-group{flex-direction:column;align-items:stretch;gap:12px}
  .filter-sort{margin-left:0;justify-content:space-between}
}

/* ===== PORTFOLIO grid (shared: home section + /cases/ archive) ===== */
.portfolio{padding:96px 0 80px;background:var(--bg);position:relative}
.pf-inner{max-width:none;margin:0 auto;padding:0;width:100%}
.pf-head{display:flex;flex-direction:column;align-items:center;text-align:center;gap:0;margin:0 auto 56px;max-width:820px;padding:0 24px}
.pf-head .pf-left{max-width:none;display:flex;flex-direction:column;align-items:center}
.pf-head .sec-tag{margin-bottom:18px;justify-content:center}
.pf-head h2{font-size:clamp(40px,4.6vw,76px);font-weight:700;letter-spacing:-.028em;line-height:1.02;margin:0 0 16px;text-wrap:balance;color:var(--text)}
.pf-head h2 em{font-style:normal;background:linear-gradient(120deg,var(--magenta),var(--amber));-webkit-background-clip:text;background-clip:text;color:transparent}
.pf-head p{font-size:17px;color:var(--muted);max-width:620px;margin:0 auto;line-height:1.55}

.pf-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:0;width:100%}
.pf-card{
  position:relative;display:block;text-decoration:none;
  height:min(25vw,50vh);
  background:#0a0a14;
  overflow:hidden;isolation:isolate
}
.pf-photo{
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;display:block;
  filter:grayscale(.22) contrast(1.02) brightness(.92);
  transition:transform 1.1s cubic-bezier(.2,.7,.2,1), filter .5s ease;
  will-change:transform
}
.pf-card:hover .pf-photo{transform:scale(1.06);filter:grayscale(0) contrast(1) brightness(1)}
.pf-overlay{
  position:absolute;inset:0;z-index:2;
  display:flex;flex-direction:column;justify-content:flex-end;
  padding:clamp(22px,2.2vw,36px) clamp(24px,2.4vw,38px);
  background:linear-gradient(180deg, rgba(7,7,16,0) 0%, rgba(7,7,16,0) 40%, rgba(7,7,16,.58) 75%, rgba(7,7,16,.93) 100%);
  transition:background .4s ease
}
.pf-card:hover .pf-overlay{background:linear-gradient(180deg, rgba(7,7,16,.12) 0%, rgba(7,7,16,.42) 40%, rgba(7,7,16,.75) 72%, rgba(7,7,16,.94) 100%)}
.pf-num{display:inline-flex;align-items:center;gap:14px;font-size:12.5px;font-weight:700;letter-spacing:.18em;color:var(--amber);font-variant-numeric:tabular-nums;margin-bottom:14px}
.pf-num::after{content:"";display:inline-block;width:32px;height:1px;background:var(--amber);opacity:.6}
.pf-title{font-size:clamp(22px,1.9vw,34px);font-weight:600;letter-spacing:-.022em;line-height:1.05;margin:0 0 10px;color:#fff;text-wrap:balance}
.pf-tag{font-size:12.5px;letter-spacing:.12em;text-transform:uppercase;color:rgba(244,242,239,.72);font-weight:600}
.pf-cta{
  display:inline-flex;align-items:center;gap:10px;
  margin-top:22px;align-self:flex-start;
  font-size:13.5px;letter-spacing:.08em;font-weight:700;text-transform:uppercase;
  color:#fff;opacity:0;transform:translateY(10px);
  transition:opacity .4s ease, transform .4s ease
}
.pf-cta::after{content:"";display:inline-block;width:28px;height:1px;background:#fff;transition:width .4s ease}
.pf-card:hover .pf-cta{opacity:1;transform:translateY(0)}
.pf-card:hover .pf-cta::after{width:44px}
.pf-foot{display:flex;justify-content:center;margin-top:56px;padding:0 24px}
.pf-all{
  display:inline-flex;align-items:center;gap:12px;
  padding:18px 32px;border-radius:999px;
  background:transparent;color:var(--text);
  border:1px solid var(--line);
  font-size:15.5px;font-weight:600;
  transition:all .3s ease
}
.pf-all:hover{background:rgba(244,242,239,.06);border-color:rgba(251,121,50,.45)}
.pf-all svg{width:16px;height:16px}

/* Archive grid — slightly tighter cards than home */
.portfolio--archive{padding:48px 0 96px}
.pf-grid--archive{grid-template-columns:repeat(3,1fr);gap:24px}
.pf-photo--empty{background:linear-gradient(135deg,#1a1535 0%,#0a0a18 100%);position:absolute;inset:0}

/* ===== Archive card — stacked layout (image on top, text below) =====
   Different design from the home/.pf-grid hero overlay cards: archive cards
   show full screenshots without a dark gradient overlay, so card cover crops
   can include the brand/header strip without title-text legibility issues.
   No transform/opacity hover effects — those cause iOS "ghost tap" delays
   where the first touch only renders the hover state. */
.pf-grid--archive .pf-card{
  position:relative;
  height:auto;min-height:0;
  display:flex;flex-direction:column;
  background:rgba(244,242,239,.03);
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  transition:border-color .25s ease, background .25s ease
}
@media (hover:hover){
  .pf-grid--archive .pf-card:hover{border-color:rgba(251,121,50,.4);background:rgba(244,242,239,.05)}
}
.pf-grid--archive .pf-photo,
.pf-grid--archive .pf-photo--empty{
  position:relative;inset:auto;
  width:100%;height:auto;
  aspect-ratio:16/10;
  object-fit:cover;
  filter:none;
  transition:none;
  border-radius:0
}
.pf-grid--archive .pf-overlay{
  position:relative;inset:auto;
  display:flex;flex-direction:column;
  flex:1;
  padding:24px 26px 26px;
  background:transparent;
  transition:none
}
.pf-grid--archive .pf-tag{flex:1}
.pf-grid--archive .pf-card:hover .pf-photo,
.pf-grid--archive .pf-card:hover .pf-overlay{background:transparent;transform:none;filter:none}
.pf-grid--archive .pf-num{margin-bottom:14px;font-size:12px}
.pf-grid--archive .pf-title{font-size:clamp(20px,1.4vw,24px);margin:0 0 12px;color:var(--text);line-height:1.2}
.pf-grid--archive .pf-tag{
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;
  overflow:hidden;text-overflow:ellipsis;
  color:var(--muted);text-transform:none;letter-spacing:-.005em;font-weight:500;font-size:14.5px;line-height:1.55;
  margin:0
}
.pf-grid--archive .pf-cta{
  opacity:1;transform:none;
  margin-top:auto;padding-top:18px;
  color:var(--amber)
}
.pf-grid--archive .pf-cta::after{background:var(--amber);width:28px;transition:width .25s ease}
@media (hover:hover){
  .pf-grid--archive .pf-card:hover .pf-cta::after{width:44px}
}

/* Portfolio responsive (shared) */
@media (max-width:1024px){
  .pf-grid{grid-template-columns:1fr 1fr}
  .pf-card{height:min(31.25vw,50vh)}
}
@media (max-width:960px){
  .portfolio{padding:64px 0 56px}
  .pf-overlay{padding:24px 26px}
  .pf-title{font-size:clamp(22px,3.4vw,30px)}
}
@media (max-width:900px){
  .pf-grid{grid-template-columns:repeat(2,1fr)}
  .pf-card{height:min(46vw,60vh)}
}
@media (max-width:600px){
  /* Home portfolio .pf-grid (non-archive) keeps overlay style — only enforce
     single column + tighter padding here. Archive cards already stacked above. */
  .pf-grid:not(.pf-grid--archive){grid-template-columns:1fr}
  .pf-grid--archive{grid-template-columns:1fr;gap:18px;padding:0 18px}
  .pf-grid--archive .pf-overlay{padding:20px 22px 24px}
  .pf-grid--archive .pf-title{font-size:20px}
  .pf-head{padding:0 18px;margin-bottom:36px}
  .pf-head h2{font-size:clamp(30px,7.5vw,44px)}
  .pf-head p{font-size:15px}
  .pf-foot{margin-top:36px;padding:0 18px}
  .pf-all{padding:14px 22px;font-size:14.5px}
}
@media (max-width:380px){
  .pf-grid--archive .pf-overlay{padding:18px 18px 22px}
  .pf-grid--archive .pf-title{font-size:19px}
}

/* "Завантажити ще" button — replaces numbered pagination on /cases/, /modules/, /journal/ */
.load-more-wrap{display:flex;justify-content:center;margin:56px 0 0;padding:0 18px}
.load-more{
  appearance:none;background:transparent;color:var(--text);
  border:1px solid var(--line);border-radius:999px;
  padding:14px 32px;font-family:inherit;font-size:15px;font-weight:600;letter-spacing:-.005em;
  cursor:pointer;display:inline-flex;align-items:center;gap:10px;
  transition:background .2s ease, border-color .2s ease, color .2s ease;
}
.load-more:hover{background:rgba(244,242,239,.06);border-color:rgba(251,121,50,.45);color:var(--amber-soft)}
.load-more:focus-visible{outline:2px solid rgba(251,121,50,.55);outline-offset:3px}
.load-more.is-loading{opacity:.7;cursor:wait}
.load-more.is-loading::after{
  content:'';display:inline-block;width:14px;height:14px;
  border:2px solid currentColor;border-top-color:transparent;
  border-radius:50%;animation:load-more-spin .8s linear infinite;
}
@keyframes load-more-spin{to{transform:rotate(360deg)}}

/* Pagination */
.work-pagination{margin:64px auto 0;display:flex;justify-content:center}
.work-pagination .nav-links{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.work-pagination a.page-numbers,
.work-pagination span.page-numbers{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:44px;height:44px;padding:0 14px;border-radius:12px;
  background:rgba(244,242,239,.04);border:1px solid var(--line);
  color:var(--text);font-size:14.5px;font-weight:600;line-height:1;
  transition:background .2s ease, border-color .2s ease, color .2s ease;
}
.work-pagination a.page-numbers.prev,
.work-pagination a.page-numbers.next{padding:0;font-size:18px}
.work-pagination a.page-numbers:hover{background:rgba(244,242,239,.08);border-color:rgba(244,242,239,.25)}
.work-pagination span.page-numbers.current{
  background:var(--text);color:var(--bg);border-color:transparent;
}

/* Empty state */
.empty-state{text-align:center;padding:80px 24px;max-width:520px;margin:0 auto}
.empty-state h2{font-size:clamp(28px,3vw,40px);font-weight:700;letter-spacing:-.024em;margin:0 0 12px;color:var(--text)}
.empty-state p{font-size:16px;color:var(--muted);margin:0 0 28px;line-height:1.6}

/* ===== Single case ===== */
.case-hero{position:relative;padding:0;overflow:hidden;isolation:isolate}
.case-hero__media{position:relative;width:100%;height:min(72vh,720px);min-height:480px;overflow:hidden}
.case-hero__img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.case-hero__shade{position:absolute;inset:0;background:linear-gradient(180deg,rgba(7,7,16,.35) 0%,rgba(7,7,16,.55) 55%,rgba(7,7,16,.96) 100%);pointer-events:none}
.case-hero__inner{position:relative;margin-top:-160px;padding-bottom:48px;z-index:2;max-width:1100px}
.case:not(:has(.case-hero__media)) .case-hero__inner{margin-top:0;padding-top:90px;padding-bottom:48px}
.case-hero__title{font-size:clamp(28px,3.4vw,52px);font-weight:700;letter-spacing:-.02em;line-height:1.08;margin:14px 0 18px;color:var(--text);text-wrap:balance}
.case-hero__lede{font-size:20px;color:var(--muted);max-width:760px;margin:0;line-height:1.55}

/* Flex layout when case has mobile preview: text on the left, iPhone on the right.
   The whole row is wider than the standard `.wrap` (centered up to 1480px) so the
   phone fits naturally beside the title. Negative margin-top pulls the entire row
   up so both columns overlap the hero image — same trick the original solo .inner
   used, but applied to the layout parent so both children move together. */
.case-hero__layout--with-phone{
  position:relative;z-index:2;
  display:flex;align-items:flex-end;
  gap:clamp(24px,3vw,56px);
  max-width:1480px;margin:-380px auto 0;
  padding:0 clamp(24px,4vw,56px) 48px;
}
.case-hero__layout--with-phone .case-hero__inner{
  flex:1 1 auto;
  margin:0;
  padding:0;
  max-width:760px;
  align-self:flex-end;
}
.case-hero__phone{flex:0 0 280px;pointer-events:none;align-self:flex-end}
.case-hero__phone-frame{
  width:100%;padding:12px;
  border-radius:42px;
  background:linear-gradient(155deg,#1a1a22 0%,#0d0d14 100%);
  box-shadow:0 30px 70px -10px rgba(0,0,0,.65), 0 0 0 2px rgba(244,242,239,.08), inset 0 0 0 1px rgba(244,242,239,.06);
  position:relative;
}
.case-hero__phone-frame img{display:block;width:100%;height:auto;border-radius:32px}

@media (max-width:1100px){
  .case-hero__layout--with-phone{gap:24px}
  .case-hero__phone{flex:0 0 220px;margin-bottom:32px}
  .case-hero__phone-frame{padding:9px;border-radius:34px}
  .case-hero__phone-frame img{border-radius:26px}
}
@media (max-width:780px){
  .case-hero__layout--with-phone{flex-direction:column;align-items:stretch;gap:0}
  .case-hero__phone{display:none}
}

/* Intro: meta + results */
.case-intro{padding:56px 0 24px}
.case-intro__grid{display:grid;grid-template-columns:1fr 1fr;gap:60px;align-items:start;max-width:1100px}
.case-meta{margin:0;display:grid;grid-template-columns:1fr 1fr;gap:24px 40px}
.case-meta dt{font-size:11.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);font-weight:600;margin-bottom:6px}
.case-meta dd{margin:0;font-size:16.5px;font-weight:500;letter-spacing:-.01em;color:var(--text)}
.case-meta dd a{color:var(--amber-soft);text-decoration:underline;text-decoration-color:rgba(255,185,133,.4);text-underline-offset:3px}
.case-meta dd a:hover{color:var(--amber)}

.case-results{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.case-results__item{
  padding:24px 22px;border-radius:18px;
  background:linear-gradient(135deg,rgba(168,59,207,.14),rgba(251,121,50,.08));
  border:1px solid var(--line);
}
.case-results__value{display:block;font-size:clamp(28px,3vw,44px);font-weight:800;letter-spacing:-.03em;line-height:1;
  background:linear-gradient(135deg,var(--amber-soft),var(--magenta));-webkit-background-clip:text;background-clip:text;color:transparent;font-feature-settings:"tnum"}
.case-results__label{display:block;margin-top:10px;font-size:13px;color:var(--muted);letter-spacing:.04em}

/* Prose */
.case-body{padding:48px 0 80px}
.case-prose > :first-child{margin-top:0}
.case-body__inner{max-width:1480px;margin-left:auto;margin-right:auto;padding-left:clamp(24px,4vw,56px);padding-right:clamp(24px,4vw,56px)}
.case-prose h2{font-size:clamp(26px,2.6vw,36px);font-weight:700;letter-spacing:-.02em;line-height:1.15;margin:40px 0 14px;color:var(--text)}
.case-prose h3{font-size:clamp(20px,1.8vw,24px);font-weight:600;letter-spacing:-.015em;margin:28px 0 10px;color:var(--text)}
.case-prose p{font-size:17px;color:var(--text);line-height:1.6;margin:0 0 18px;opacity:.9}
.case-prose a{color:var(--amber-soft);text-decoration:underline;text-decoration-color:rgba(255,185,133,.4);text-underline-offset:3px}
.case-prose a:hover{color:var(--amber)}
.case-prose ul,.case-prose ol{font-size:17px;color:var(--text);line-height:1.6;padding-left:22px;margin:0 0 22px;opacity:.9}
.case-prose li{margin-bottom:8px}
.case-prose blockquote{margin:32px 0;padding:24px 28px;border-left:3px solid var(--amber);background:rgba(251,121,50,.06);border-radius:0 16px 16px 0;font-size:18px;line-height:1.6;color:var(--text)}
.case-prose img,.case-prose figure{border-radius:16px;overflow:hidden;margin:32px 0;max-width:100%}
.case-prose figure{display:block;background:rgba(244,242,239,.03);border:1px solid var(--line)}
.case-prose figure img{display:block;width:100%;height:auto;margin:0;border-radius:0;border:0}
/* Tables in prose (e.g. comparison tables in blog posts) */
.case-prose table{width:100%;border-collapse:collapse;margin:28px 0;font-size:15.5px;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.case-prose th,.case-prose td{padding:13px 18px;border-bottom:1px solid var(--line);text-align:left;line-height:1.5;color:var(--text);vertical-align:top}
.case-prose th + th,.case-prose td + td{border-left:1px solid var(--line)}
.case-prose thead th{font-weight:700;background:rgba(244,242,239,.05);letter-spacing:.01em}
.case-prose tbody tr:last-child td{border-bottom:0}
.case-prose tbody tr:nth-child(even){background:rgba(244,242,239,.02)}
/* Portrait mobile screenshots (skargart-08-mobile-390x844 etc.) — don't upscale beyond device width */
.case-prose figure:has(> img[src*="mobile-390"]){max-width:380px;margin-left:auto;margin-right:auto}
.case-prose figcaption{font-size:13px;color:var(--muted);padding:10px 16px 14px;line-height:1.5;text-align:center}

/* Side-by-side: figure + heading/text in two columns */
.case-prose .figure-row{display:grid;grid-template-columns:1fr 1fr;gap:32px;align-items:center;margin:40px 0}
.case-prose .figure-row figure{margin:0}
.case-prose .figure-row .figure-row__text > :first-child{margin-top:0}

/* iPhone mockup wrapper for mobile screenshots */
.case-prose .iphone-mockup{
  display:block;margin:0 auto;
  width:280px;padding:14px;
  border-radius:46px;
  background:linear-gradient(155deg,#1a1a22 0%,#0d0d14 100%);
  box-shadow:0 30px 60px -20px rgba(0,0,0,.7), 0 0 0 2px rgba(244,242,239,.08), inset 0 0 0 1px rgba(244,242,239,.06);
  position:relative;
}
.case-prose .iphone-mockup::before{
  content:"";position:absolute;top:24px;left:50%;transform:translateX(-50%);
  width:100px;height:28px;background:#0a0a10;border-radius:14px;z-index:3;
}
.case-prose .iphone-mockup img{
  display:block;width:100%;height:auto;
  border-radius:32px;margin:0;
  border:0;
}

/* Hero-row: text column on the left, iPhone mockup on the right.
   Text column is intentionally narrower than the available space so
   the line length stays comfortable; both columns are vertically centered
   so the iPhone's larger height doesn't leave a visual gap under the text. */
.case-prose .hero-row{
  position:relative;display:grid;
  grid-template-columns:minmax(0,1fr) 320px;
  gap:56px;align-items:center;
  margin:32px 0 48px;
}
.case-prose .hero-row figure{margin:0}
.case-prose .hero-row > p,
.case-prose .hero-row > div:not(.iphone-mockup){max-width:560px;font-size:18px;line-height:1.65}
.case-prose .hero-row .iphone-mockup{margin:0;align-self:center;justify-self:end;width:320px}

@media (max-width:780px){
  .case-prose .figure-row,.case-prose .hero-row{grid-template-columns:1fr;gap:24px}
  .case-prose .hero-row .iphone-mockup{justify-self:center}
  .case-prose .iphone-mockup{width:240px;padding:11px;border-radius:38px}
  .case-prose .iphone-mockup img{border-radius:26px}
  .case-prose .iphone-mockup::before{top:20px;width:80px;height:22px}
}

.case-prose code{background:rgba(244,242,239,.08);padding:2px 7px;border-radius:6px;font-size:.92em;font-family:'JetBrains Mono',ui-monospace,monospace;color:var(--amber-soft)}
.case-prose pre{background:#0a0a18;border:1px solid var(--line);border-radius:14px;padding:20px 22px;overflow-x:auto;margin:24px 0}
.case-prose pre code{background:transparent;padding:0;color:var(--text);font-size:14px}

/* Next/prev nav */
/* ===== Breadcrumbs ===== */
.breadcrumbs{padding:20px 0 0;position:relative;z-index:3}
.breadcrumbs .wrap{padding-right:0}
.breadcrumbs__list{margin:0;padding:0;list-style:none;display:flex;flex-wrap:nowrap;align-items:center;gap:8px;font-size:13px;letter-spacing:-.005em;line-height:1.4;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch}
.breadcrumbs__list::-webkit-scrollbar{display:none;width:0;height:0}
.breadcrumbs__item{display:inline-flex;align-items:center;gap:8px;color:var(--muted);flex-shrink:0;white-space:nowrap}
.breadcrumbs__item + .breadcrumbs__item::before{content:"";display:inline-block;width:5px;height:5px;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:rotate(-45deg);opacity:.6;flex-shrink:0}
.breadcrumbs__item a{color:var(--muted);text-decoration:none;transition:color .2s ease;white-space:nowrap}
.breadcrumbs__item a:hover{color:var(--amber-soft)}
.breadcrumbs__item--current{color:var(--text);white-space:nowrap}

.case .breadcrumbs{padding-top:24px;padding-bottom:8px}

@media (max-width:700px){
  .breadcrumbs{padding-top:16px}
  .breadcrumbs__list{font-size:12.5px;gap:6px}
}

/* ===== Action bar in hero ===== */
.case-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:28px}
.case-actions__btn{display:inline-flex;align-items:center;gap:10px;padding:14px 22px;border-radius:999px;font-size:15px;font-weight:600;letter-spacing:-.005em;line-height:1;border:1px solid transparent;transition:all .25s ease;text-decoration:none}
.case-actions__btn svg{width:16px;height:16px;flex-shrink:0;transition:transform .25s ease}
.case-actions__btn--primary{background:linear-gradient(120deg,var(--magenta),var(--amber));color:#fff;box-shadow:0 10px 30px -10px rgba(251,121,50,.45)}
.case-actions__btn--primary:hover{transform:translateY(-2px);box-shadow:0 16px 38px -12px rgba(251,121,50,.6)}
.case-actions__btn--primary:hover svg{transform:translateX(3px)}
.case-actions__btn--ghost{background:rgba(244,242,239,.04);color:var(--text);border-color:var(--line)}
.case-actions__btn--ghost:hover{background:rgba(244,242,239,.08);border-color:rgba(251,121,50,.45);color:var(--amber-soft)}
.case-actions__btn--ghost:hover svg{transform:translate(2px,-2px)}

/* ===== Gallery of screenshots ===== */
.case-gallery{padding:24px 0 80px}
.case-gallery__inner{max-width:1100px;display:flex;flex-direction:column;gap:32px}
.case-gallery__item{margin:0;border-radius:18px;overflow:hidden;background:rgba(244,242,239,.03);border:1px solid var(--line)}
.case-gallery__item img{display:block;width:100%;height:auto}

/* ===== Related cases ===== */
.case-related{padding:64px 0 0;border-top:1px solid var(--line)}
.case-related .pf-head{margin-bottom:40px}
.case-related .pf-head h2{font-size:clamp(32px,3.4vw,52px)}

/* ===== Responsive ===== */
@media (max-width:1024px){
  .pf-grid--archive{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:900px){
  .case-intro__grid{grid-template-columns:1fr;gap:32px}
  .case-hero__inner{margin-top:-110px;padding-bottom:32px}
  .case-hero__media{height:min(60vh,520px);min-height:360px}
  .case-hero__lede{font-size:17px}
  .work-filter{margin-top:20px}
}
@media (max-width:700px){
  .case-meta{grid-template-columns:1fr;gap:18px}
  .case-results{grid-template-columns:1fr}
  .case-actions{margin-top:22px}
  .case-actions__btn{width:100%;justify-content:center}
  .case-body{padding:20px 0 56px}
  .case-gallery{padding:8px 0 56px}
  .case-gallery__inner{gap:20px}
  .case-related{padding:48px 0 0}
  .page-hero{padding:60px 0 24px}
}
@media (max-width:600px){
  .pf-grid--archive{grid-template-columns:1fr}
  .case-hero__inner{margin-top:-80px;padding-bottom:24px}
  .case-hero__media{height:min(48vh,400px);min-height:280px}
  .case-hero__lede{font-size:15px;line-height:1.5}
  .case-body__inner .case-prose p,.case-prose ul,.case-prose ol{font-size:16px}
}

/* ===== Tech-stack chips in hero ===== */
.case-stack-chips{display:flex;flex-wrap:wrap;gap:8px;margin:22px 0 0;padding:0;list-style:none}
.case-stack-chips li{margin:0;padding:0;list-style:none}
.case-stack-chips a{
  display:inline-flex;align-items:center;
  padding:7px 14px;border-radius:999px;
  background:rgba(244,242,239,.06);border:1px solid var(--line);
  font-size:12.5px;font-weight:600;letter-spacing:.02em;color:var(--text);
  text-decoration:none;line-height:1;
  transition:background .2s ease,border-color .2s ease,color .2s ease,transform .2s ease;
}
.case-stack-chips a:hover{background:rgba(251,121,50,.1);border-color:rgba(251,121,50,.45);color:var(--amber-soft);transform:translateY(-1px)}

/* ===== TOC sidebar (auto-generated by case-page.js) ===== */
.case-page-grid{display:grid;grid-template-columns:240px minmax(0,1fr);gap:48px;align-items:start}
/* Safety net: if a case has no H2/H3 at all, JS keeps TOC hidden — collapse grid so body fills the width. */
.case-page-grid:has(.case-toc[hidden]){grid-template-columns:minmax(0,1fr)}
@media (max-width:1100px){.case-page-grid{grid-template-columns:1fr}}
.case-page-grid__main{min-width:0}
.case-toc{position:sticky;top:96px;align-self:start;max-height:calc(100vh - 120px);overflow-y:auto;scrollbar-width:thin}
.case-toc__inner{padding:18px 18px 22px;border-radius:14px;background:rgba(244,242,239,.03);border:1px solid var(--line)}
.case-toc__heading{display:block;font-size:11.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);font-weight:700;margin-bottom:14px}
.case-toc__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px;counter-reset:toc}
.case-toc__list li{position:relative}
.case-toc__list a{
  display:block;
  padding:8px 12px 8px 14px;border-left:2px solid transparent;
  font-size:13.5px;line-height:1.4;color:var(--muted);text-decoration:none;
  transition:color .2s ease,border-color .2s ease,background .2s ease;border-radius:0 6px 6px 0;
}
.case-toc__list a:hover{color:var(--text);background:rgba(244,242,239,.04)}
.case-toc__list li.is-active > a{color:var(--amber-soft);border-left-color:var(--amber);background:rgba(251,121,50,.06);font-weight:600}
.case-toc__list li.toc-h3 > a{padding-left:26px;font-size:12.5px;color:rgba(177,177,177,.85)}
.case-toc__list li.toc-h3.is-active > a{color:var(--amber-soft)}
@media (max-width:1100px){.case-toc{display:none}}

/* TOC mobile toggle pill + drawer */
.case-toc__mobile-toggle{
  display:none;align-items:center;gap:8px;
  padding:10px 16px;border-radius:999px;
  background:rgba(244,242,239,.05);border:1px solid var(--line);color:var(--text);
  font-size:13px;font-weight:600;letter-spacing:-.005em;cursor:pointer;
  margin:0 0 20px;
  transition:background .2s ease,border-color .2s ease;
}
.case-toc__mobile-toggle:hover{background:rgba(244,242,239,.08);border-color:rgba(251,121,50,.45)}
.case-toc__mobile-toggle svg{width:16px;height:16px;flex-shrink:0}
@media (max-width:1100px){.case-toc__mobile-toggle:not([hidden]){display:inline-flex}}
/* On mobile the .case-toc gets repositioned as a drawer when toggled open */
@media (max-width:1100px){
  .case-toc.is-mobile-open{
    display:block;position:fixed;left:16px;right:16px;top:88px;z-index:55;
    max-height:calc(100vh - 120px);overflow-y:auto;
    border-radius:18px;
    background:linear-gradient(180deg,#11111a,#0a0a14);
    box-shadow:0 30px 70px -10px rgba(0,0,0,.7), 0 0 0 1px rgba(244,242,239,.08);
    animation:tocFadeIn .25s ease;
  }
}
@keyframes tocFadeIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}

/* ===== Sticky bottom CTA (visible after scrolling past hero) ===== */
.case-sticky-cta{
  position:fixed;left:0;right:0;bottom:20px;z-index:45;
  display:flex;justify-content:center;pointer-events:none;
  padding:0 16px;
  opacity:0;transform:translateY(20px);
  transition:opacity .35s ease, transform .35s cubic-bezier(.2,.7,.2,1);
}
.case-sticky-cta.is-visible{opacity:1;transform:none}
.case-sticky-cta__btn{
  pointer-events:auto;display:inline-flex;align-items:center;gap:10px;
  padding:14px 24px;border-radius:999px;
  background:linear-gradient(120deg,var(--magenta),var(--amber));color:#fff;
  font-size:14.5px;font-weight:600;letter-spacing:-.005em;line-height:1;
  text-decoration:none;
  box-shadow:0 16px 40px -10px rgba(251,121,50,.55), 0 0 0 1px rgba(255,255,255,.08);
  transition:transform .25s ease, box-shadow .25s ease;
}
.case-sticky-cta__btn svg{width:16px;height:16px;flex-shrink:0;transition:transform .25s ease}
.case-sticky-cta__btn:hover{transform:translateY(-2px);box-shadow:0 22px 50px -12px rgba(251,121,50,.7)}
.case-sticky-cta__btn:hover svg{transform:translateX(3px)}
@media (max-width:600px){.case-sticky-cta{bottom:14px;padding:0 12px}.case-sticky-cta__btn{padding:12px 18px;font-size:13.5px;width:100%;justify-content:center}}

/* ===== Mobile hero phone preview =====
   On mobile, when a case has a mobile-preview screenshot we drop the wide desktop hero image
   entirely and promote the phone mockup to the top of the hero — it's the more meaningful
   visual for users browsing on the same form factor. Text follows below. */
@media (max-width:780px){
  .case-hero--with-phone .case-hero__media{display:none}
  .case-hero--with-phone .case-hero__layout--with-phone{
    margin-top:0;
    padding-top:32px;
  }
  .case-hero__layout--with-phone .case-hero__phone{
    display:block;
    order:-1;
    flex:0 0 auto;
    margin:0 auto 20px;
    width:min(260px,68vw);
  }
}
