/* Intellect Juris — Expertise page
   Section layout follows the supplied Expertise mock (v13); type, colour, buttons and radii come from site.css.
   The pop-up reuses .pp-modal from people.css and the closing CTA reuses .ab-cta from about.css. */

/* ---------- hero ---------- */
.ex-hero { position: relative; isolation: isolate; overflow: hidden; padding: 168px 0 120px; }
.ex-hero__photo { position: absolute; inset: 0 0 0 auto; z-index: -1; width: 56%; overflow: hidden; }
.ex-hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.ex-hero__photo::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, var(--page) 0%, rgba(250, 248, 243, .88) 14%, rgba(250, 248, 243, 0) 55%),
  linear-gradient(0deg, var(--page) 0%, rgba(250, 248, 243, 0) 30%),
  linear-gradient(180deg, var(--page) 0%, rgba(250, 248, 243, 0) 18%); }
.ex-intro { max-width: 720px; }
.ex-intro .ab-h1 { margin: 28px 0 22px; }
.ex-intro .hero__line { display: block; }
.ex-muted { color: var(--bronze); }
.ex-intro .ab-lede { max-width: 46ch; }
.ex-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- four pillars: the stage stays pinned while the tall track scrolls past,
   and expertise.js switches the active pillar with scroll progress ---------- */
.ex-tabs { position: relative; height: 380vh; }
.ex-tabs__stage { position: sticky; top: 0; display: flex; align-items: center; min-height: 100vh; min-height: 100svh; padding: 104px 0 40px; background: var(--page); }
.ex-tabs__stage > .container { width: 100%; }
.ex-tabs__stage .h2 { max-width: none; }
.ex-tabs__stage .h2 .ex-muted { display: block; }
.ex-tabbar { display: flex; justify-content: center; gap: 6px; width: max-content; max-width: 100%; margin: 26px auto 40px; padding: 8px; border-radius: 999px; background: var(--sand); box-shadow: 0 14px 34px -18px rgba(41, 45, 48, .35); }
.ex-tab { display: inline-flex; align-items: center; height: 54px; padding: 0 19px; border-radius: 999px; color: var(--espresso); font-size: .9375rem; font-weight: 500; transition: background-color .35s var(--ease), color .35s var(--ease), padding .35s var(--ease); }
.ex-tab svg { flex: none; width: 26px; height: 26px; }
.ex-tab__label { display: grid; grid-template-columns: 0fr; transition: grid-template-columns .4s var(--ease), margin .4s var(--ease); }
.ex-tab__label i { overflow: hidden; font-style: normal; white-space: nowrap; opacity: 0; transition: opacity .25s; }
.ex-tab:hover { background: rgba(250, 248, 243, .7); }
.ex-tab.is-on { padding: 0 24px 0 20px; background: var(--espresso); color: #fff; }
.ex-tab.is-on .ex-tab__label { grid-template-columns: 1fr; margin-left: 10px; }
.ex-tab.is-on .ex-tab__label i { opacity: 1; transition-delay: .12s; }
.ex-tab:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }

.ex-panels { display: grid; }
.ex-panel { grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 56px; opacity: 0; visibility: hidden; translate: 0 24px; transition: opacity .5s ease, translate .5s var(--ease), visibility 0s .5s; }
.ex-panel.is-on { opacity: 1; visibility: visible; translate: none; transition-delay: 0s; }
.ex-panel__kicker { font-size: .75rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--bronze); }
.ex-panel h3 { margin-top: 16px; font: 400 clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem)/1.2 var(--font-display); letter-spacing: -0.02em; }
.ex-panel h3 span { display: block; font-weight: 500; }
.ex-panel__copy > p:not(.ex-panel__kicker) { max-width: 54ch; margin-top: 18px; color: var(--taupe); }
.ex-panel .ex-btns { margin-top: 30px; }
.ex-panel__frame { padding: 14px; border-radius: 16px; background: var(--sand); }
.ex-panel__frame img { width: 100%; aspect-ratio: 1.35; object-fit: cover; border-radius: var(--radius); }

.ex-cta { padding-top: 48px; }

/* ---------- pillar pop-up (extends .pp-modal) ---------- */
.ex-m-photo img { object-position: center; }
.ex-m-intro p + p { margin-top: 10px; }
.ex-m-grp + .ex-m-grp { margin-top: 24px; }
.ex-m-groups .eyebrow { margin-bottom: 14px; }
.ex-m-list { grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.ex-m-go { align-self: flex-start; gap: 10px; margin-top: 28px; }
.ex-m-go svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.ex-m-go:hover svg { transform: translateX(4px); }

/* ---------- responsive ---------- */
/* short screens: tighter stage so the whole pinned section fits */
@media (max-height: 820px) and (min-width: 641px) {
  .ex-tabs__stage { padding: 88px 0 24px; }
  .ex-tabbar { margin: 18px auto 24px; }
  .ex-panel__frame img { aspect-ratio: auto; height: clamp(220px, calc(100svh - 400px), 460px); }
}
/* phones: same scroll-driven tabs, with the image above the text */
@media (max-width: 640px) {
  .ex-tabs__stage { padding: 84px 0 24px; }
  .ex-tabs__stage .h2 { font-size: clamp(1.625rem, 7vw, 2rem); }
  .ex-tabbar { margin: 18px auto 20px; }
  .ex-panel { grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
  .ex-panel__frame { order: -1; }
  .ex-panel__frame img { aspect-ratio: 16 / 9; }
  .ex-panel h3 { margin-top: 10px; font-size: 1.5rem; }
  .ex-panel__copy > p:not(.ex-panel__kicker) { margin-top: 12px; font-size: .9375rem; }
  .ex-panel .ex-btns { margin-top: 20px; }
}
@media (max-width: 640px) and (max-height: 700px) {
  .ex-tabs__stage { padding-top: 72px; }
  .ex-panel__frame img { aspect-ratio: 2; }
}
/* very short landscape screens and reduced motion: no pinning, the tabs simply switch on tap (matches expertise.js) */
@media (max-height: 500px), (prefers-reduced-motion: reduce) {
  .ex-tabs { height: auto; padding-top: var(--section); }
  .ex-tabs__stage { position: static; min-height: 0; padding: 0; }
  .ex-panels { display: block; }
  .ex-panel { display: none; grid-template-columns: 1fr; gap: 28px; opacity: 1; visibility: visible; translate: none; transition: none; }
  .ex-panel.is-on { display: grid; }
  .ex-panel__frame { order: -1; }
}
@media (max-width: 991px) {
  .ex-hero { padding: 140px 0 88px; }
  .ex-hero__photo { width: 70%; opacity: .55; }
}
@media (max-width: 767px) {
  .ex-hero { padding: 112px 0 40px; }
  .ex-hero__photo { display: none; }
}
@media (max-width: 560px) {
  .ex-tab { height: 48px; padding: 0 14px; }
  .ex-tab.is-on { padding: 0 18px 0 14px; }
  .ex-tab svg { width: 22px; height: 22px; }
  .ex-panel__frame { padding: 10px; border-radius: 12px; }
  .ex-m-list { grid-template-columns: 1fr; }
}
