/* ---------- Portfolio page + case study ---------- */
:root { --accent: #ff4a12; --mono: "JetBrains Mono", ui-monospace, monospace; }

/* ================= Title ================= */
.phero { padding: 17rem 2.4rem 5rem; }
.phero__in {
  max-width: 160rem; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2.4rem 6rem;
}
.phero__title {
  margin: 0 0 0 -0.05em;
  font-size: clamp(5.4rem, 11vw, 30rem);
  font-weight: 500; line-height: 0.92; letter-spacing: -0.06em;
  animation: wrise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
.phero__lead {
  margin: 0 0 1.2vw; max-width: 38rem;
  font-size: clamp(1.7rem, 1.28vw, 2.8rem); font-weight: 500; line-height: 1.22; letter-spacing: -0.03em; color: #cfcfcf;
  animation: wrise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}
@keyframes wrise { from { opacity: 0; transform: translateY(1.8rem); } to { opacity: 1; transform: none; } }

/* ================= Filter + list ================= */
.pf { padding: 3rem 2.4rem 14rem; }
.pf__in { max-width: 160rem; margin: 0 auto; }
.pf__label { margin: 0 0 2.4rem; text-align: center; font: 500 1.2rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: #8a8a8a; }
.pf__filter { position: relative; margin-bottom: 6rem; }
.pf__toggle { display: none; }   /* phones only: the list of industries folds into this button */
.pf__tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.pf__tab {
  display: inline-flex; align-items: center; gap: 0.8rem;
  height: 4.6rem; padding: 0 2.4rem;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 62.4375rem;
  font-size: 1.5rem; font-weight: 500; color: #fff;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.pf__tab sup { position: static; font-size: 1.1rem; font-weight: 500; color: #8a8a8a; transition: color 0.25s ease; }
.pf__tab:hover { border-color: #fff; }
.pf__tab:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.pf__tab.is-active { background: #fff; color: #0a0a0a; border-color: #fff; }
.pf__tab.is-active sup { color: #6b6b6b; }

.pf__list { display: grid; gap: 2.4rem; }

.pf__empty { margin: 4rem 0 0; text-align: center; font-size: 1.6rem; color: #8a8a8a; }
.pf__empty[hidden] { display: none; }

.pcard {
  position: relative;
  display: grid; grid-template-columns: 20rem minmax(0, 1fr) minmax(0, 1.15fr); gap: 5rem; align-items: center;
  padding: 5rem;
  background: #0d0d0d; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 2.4rem;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.pcard:hover { border-color: rgba(255, 255, 255, 0.32); background: #111; }
.pcard[hidden] { display: none; }
.pcard.is-in { animation: wrise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.pcard__cat { margin: 0 0 1.6rem; font: 500 1.2rem/1.2 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: #8a8a8a; }
.pcard__cat span { color: var(--accent); }
.pcard__sub { margin: 0; font-size: 2.2rem; font-weight: 500; line-height: 1.1; letter-spacing: -0.04em; text-wrap: balance; }
.pcard__title { margin: 0; font-size: clamp(2.8rem, 3vw, 7rem); font-weight: 500; line-height: 1.02; letter-spacing: -0.05em; text-wrap: balance; }
.pcard__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* the whole card is the link */
.pcard__link:focus-visible { outline: none; }
.pcard:has(.pcard__link:focus-visible) { outline: 2px solid #fff; outline-offset: 4px; }
.pcard__desc { margin: 2.2rem 0 0; max-width: 56rem; font-size: clamp(1.5rem, 1.05vw, 2.2rem); line-height: 1.5; color: #b0b0b0; text-wrap: pretty; }
.pcard__more { display: inline-flex; align-items: center; gap: 1rem; margin-top: 3rem; font-size: 1.5rem; font-weight: 500; transition: gap 0.25s ease; }
.pcard:hover .pcard__more { gap: 1.5rem; }
.pcard__shot { overflow: hidden; border-radius: 1.4rem; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 2.4rem 6rem rgba(0, 0, 0, 0.5); }
.pcard__shot img { display: block; width: 100%; height: auto; transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.pcard:hover .pcard__shot img { transform: scale(1.03); }

/* ================= Case study ================= */
.phero--cs { padding-bottom: 4rem; }
.phero--cs .phero__in { display: block; }
.phero__title--cs { font-size: clamp(3.6rem, 6.2vw, 17rem); line-height: 0.98; letter-spacing: -0.055em; max-width: 120rem; text-wrap: balance; margin-bottom: 2.4rem; }
.phero--cs .phero__lead { margin: 0; max-width: none; }
.cs__back { display: inline-flex; align-items: center; gap: 0.9rem; margin-bottom: 4rem; font-size: 1.4rem; font-weight: 500; color: #a5a5a5; transition: color 0.2s ease; }
.cs__back:hover { color: #fff; }
.cs__cat { margin: 0 0 2rem; font: 500 1.2rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }

.cs { padding: 2rem 2.4rem 12rem; }
.cs__in { max-width: 160rem; margin: 0 auto; }
/* the paragraph and the picture sit side by side, the same width */
.cs__top { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 6rem; align-items: center; margin-bottom: 8rem; }
.cs__shot { margin: 0; overflow: hidden; border-radius: 1.4rem; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 2.4rem 6rem rgba(0, 0, 0, 0.5); }
.cs__shot img { display: block; width: 100%; height: auto; }
.cs__zoom { display: block; width: 100%; padding: 0; cursor: zoom-in; }
.cs__zoom:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cs__shot { transition: border-color 0.25s ease; }
.cs__shot:hover { border-color: rgba(255, 255, 255, 0.4); }

/* the picture opened larger, over the page */
.lbox { width: min(94vw, 150rem, calc(92vh * var(--r, 1.95))); max-width: none; max-height: 92vh; padding: 0; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 1.4rem; background: #000; overflow: hidden; }
.lbox--sm { width: min(94vw, 98rem, calc(92vh * var(--r, 1.43))); }   /* a smaller picture: do not stretch it far past its own size */
.lbox::backdrop { background: rgba(0, 0, 0, 0.82); backdrop-filter: blur(6px); }
.lbox[open] { animation: lzoom 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
.lbox img { display: block; width: 100%; height: auto; max-height: 92vh; object-fit: contain; }
.lbox__close { position: absolute; top: 1rem; right: 1rem; z-index: 2; width: 3.4rem; height: 3.4rem; border-radius: 50%; background: rgba(0, 0, 0, 0.7); border: 1px solid rgba(255, 255, 255, 0.35); font-size: 2.2rem; line-height: 1; color: #fff; transition: background 0.2s ease; }
.lbox__close:hover { background: #000; }
@keyframes lzoom { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@media (max-width: 1199px) { .lbox, .lbox--sm { width: 96vw; border-radius: 0.8rem; } .lbox__close { width: 2.4rem; height: 2.4rem; font-size: 1.4rem; top: 0.5rem; right: 0.5rem; } }
.cs__intro { margin: 0; font-size: clamp(1.9rem, 1.9vw, 4rem); font-weight: 500; line-height: 1.24; letter-spacing: -0.035em; text-wrap: pretty; }
.cs__row { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 4rem 6rem; padding: 5rem 0; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.cs__h { margin: 0; font-size: clamp(3rem, 3.4vw, 7rem); font-weight: 400; line-height: 1.05; letter-spacing: -0.045em; text-wrap: balance; }
.cs__k { display: block; margin-bottom: 1.8rem; font: 500 1.2rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #8a8a8a; }
.cs__p { margin: 0 0 2.4rem; font-size: clamp(1.6rem, 1.15vw, 2.4rem); line-height: 1.45; color: #cfcfcf; }
/* numbered rows with a thin line between them */
.cs__list { counter-reset: n; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.cs__list li { counter-increment: n; position: relative; padding: 2.4rem 0 2.4rem 6rem; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: clamp(1.5rem, 1.15vw, 2.4rem); line-height: 1.5; color: #e2e2e2; text-wrap: pretty; }
.cs__list li::before { content: "0" counter(n); position: absolute; left: 0; top: 2.75rem; font: 400 1.2rem/1 var(--mono); letter-spacing: 0.04em; color: #6f6f6f; }
.cs__list li:nth-child(n+10)::before { content: counter(n); }
.cs__cta { display: flex; flex-direction: column; align-items: center; gap: 4rem; padding-top: 9rem; border-top: 1px solid rgba(255, 255, 255, 0.14); text-align: center; }
.cs__ctah { margin: 0; max-width: 90rem; font-size: clamp(3rem, 4.6vw, 10rem); font-weight: 500; line-height: 1; letter-spacing: -0.055em; text-wrap: balance; }
.cs__cta .btn { height: 6.4rem; padding: 0 5.6rem; font-size: 1.8rem; }

/* ---- more content blocks for the longer case studies ---- */
.cs__body > .cs__p:last-child { margin-bottom: 0; }
.cs__body > .cs__p + .cs__list { margin-top: 3.4rem; }
.cs__group + .cs__group { margin-top: 5rem; }
.cs__sub { margin: 0 0 2rem; font: 500 1.2rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #8a8a8a; }
.cs__list li b { font-weight: 500; color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cs__tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cs__tbl th, .cs__tbl td { padding: 2.2rem 2rem 2.2rem 0; border-top: 1px solid rgba(255, 255, 255, 0.14); text-align: left; vertical-align: top; font-size: clamp(1.5rem, 1.15vw, 2.4rem); line-height: 1.45; font-weight: 400; }
.cs__tbl thead th { padding-top: 0; padding-bottom: 1.8rem; border-top: 0; font: 500 1.2rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #8a8a8a; }
.cs__tbl thead th:last-child { color: #fff; }
.cs__tbl tbody th { width: 24%; font-weight: 500; color: #fff; }
.cs__tbl td { color: #8a8a8a; }
.cs__tbl td:last-child { color: #fff; padding-right: 0; }
.cs__tbl tbody tr:last-child > * { border-bottom: 1px solid rgba(255, 255, 255, 0.14); }

/* space kept for a picture that is not here yet */
.shot-empty { display: grid; place-items: center; aspect-ratio: 1916 / 983; background: #0d0d0d; border-style: dashed; border-color: rgba(255, 255, 255, 0.2); box-shadow: none; }
.shot-empty span { font: 500 1.2rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: #6f6f6f; }
.cs__shot.shot-empty:hover { border-color: rgba(255, 255, 255, 0.2); }

/* ---- Below 1200px the root size is a plain 16px, so sizes here are smaller than above ---- */
@media (max-width: 1199px) {
  .phero { padding: 9.5rem 1.6rem 2.4rem; }
  .phero__in { gap: 1.4rem 3rem; }
  .phero__title { font-size: clamp(4.4rem, 15vw, 11rem); }
  .phero__lead { font-size: 1.15rem; margin-bottom: 0.4rem; max-width: 26rem; }
  .pf { padding: 1.5rem 1.6rem 6rem; }
  .pf__label { font-size: 0.8rem; margin-bottom: 1.4rem; }
  .pf__filter { margin-bottom: 2.6rem; }
  .pf__tabs { gap: 0.6rem; }
  .pf__tab { height: 2.75rem; padding: 0 1.3rem; font-size: 0.95rem; gap: 0.5rem; }
  .pf__tab sup { font-size: 0.7rem; }
  .pcard { grid-template-columns: 1fr; gap: 1.8rem; padding: 1.6rem; border-radius: 1.4rem; }
  .pcard__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.2rem; }
  .pcard__cat { margin: 0; font-size: 0.75rem; }
  .pcard__sub { font-size: 1.1rem; }
  .pcard__title { font-size: clamp(1.9rem, 5vw, 3.8rem); }
  .pcard__desc { font-size: 1rem; margin-top: 1.1rem; }
  .pcard__more { font-size: 0.95rem; margin-top: 1.5rem; }
  .pcard__shot { order: -1; border-radius: 0.8rem; }

  .phero--cs { padding-bottom: 1.6rem; }
  .phero__title--cs { font-size: clamp(2.3rem, 7.6vw, 5rem); margin-bottom: 1.2rem; }
  .cs__back { font-size: 0.85rem; margin-bottom: 2rem; }
  .cs__cat { font-size: 0.75rem; margin-bottom: 1.1rem; }
  .cs { padding: 0.5rem 1.6rem 5rem; }
  .cs__shot { border-radius: 0.9rem; }
  .cs__top { grid-template-columns: 1fr; gap: 1.8rem; margin-bottom: 2.6rem; }
  .cs__shot { order: -1; }
  .cs__intro { font-size: 1.2rem; }
  .cs__row { grid-template-columns: 1fr; gap: 1.4rem; padding: 2.2rem 0; }
  .cs__h { font-size: 2rem; }
  .cs__k { font-size: 0.75rem; margin-bottom: 0.9rem; }
  .cs__p { font-size: 1rem; margin-bottom: 1.2rem; }
  .cs__list li { padding: 1.2rem 0 1.2rem 2.6rem; font-size: 1rem; }
  .cs__list li::before { top: 1.45rem; font-size: 0.75rem; }
  .cs__body > .cs__p + .cs__list { margin-top: 1.8rem; }
  .cs__group + .cs__group { margin-top: 2.6rem; }
  .cs__sub { font-size: 0.75rem; margin-bottom: 1rem; }
  .cs__tbl th, .cs__tbl td { padding: 1rem 0.8rem 1rem 0; font-size: 0.85rem; }
  .cs__tbl thead th { font-size: 0.65rem; padding-bottom: 0.9rem; }
  .cs__tbl tbody th { width: 28%; }
  .shot-empty span { font-size: 0.7rem; }
  .cs__cta { padding-top: 3.6rem; gap: 2rem; }
  .cs__cta .btn { height: 3.4rem; padding: 0 2.6rem; font-size: 1.05rem; }
  .cs__ctah { font-size: 2.2rem; }
}
@media (max-width: 640px) {
  .pcard { padding: 1rem; gap: 1.4rem; }
  .pcard__meta, .pcard__main { padding: 0 0.4rem; }
}
/* ---- Phones: the industries open from one button, like the header menu ---- */
@media (max-width: 820px) {
  .pf__filter { max-width: 30rem; margin-left: auto; margin-right: auto; }
  .pf__toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    height: 3.2rem; padding: 0 1.4rem 0 1.5rem;
    background: var(--pill); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 62.4375rem;
    font-size: 1rem; font-weight: 500; color: #fff;
  }
  .pf__cur { display: inline-flex; align-items: center; gap: 0.5rem; }   /* the number sits level with the word, not raised */
  .pf__toggle sup { position: static; margin: 0; font-size: 0.8rem; line-height: 1; vertical-align: baseline; color: #8a8a8a; }
  .pf__toggle .chevron { transition: transform 0.2s ease; }
  .pf__filter.is-open .pf__toggle .chevron { transform: rotate(180deg); }
  .pf__tabs {
    position: absolute; z-index: 20; top: calc(100% + 0.6rem); left: 0; right: 0;
    flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; gap: 0.15rem;
    padding: 0.6rem; background: var(--pill); border-radius: 1.5rem; box-shadow: 0 0.875rem 2.5rem rgba(0, 0, 0, 0.55);
    opacity: 0; visibility: hidden; transform: translateY(-0.5rem);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .pf__filter.is-open .pf__tabs { opacity: 1; visibility: visible; transform: none; }
  .pf__tab { width: 100%; justify-content: space-between; border-color: transparent; border-radius: 1rem; padding: 0 1.1rem; height: 2.7rem; }
  .pf__tab:hover { background: rgba(255, 255, 255, 0.08); border-color: transparent; }
  .pf__tab.is-active:hover { background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  .phero__title, .phero__lead, .pcard.is-in { animation: none; }
  .pcard__shot img, .pcard__more { transition: none; }
  .lbox[open] { animation: none; }
}
