/* ==========================================================================
   EmergingX — Work page (Phase 2)
   Builds on theme.css tokens; reuses .ex-section / .ex-stack / .ex-status
   from home.css, which this page also loads.
   ========================================================================== */

/* ---------- hero -------------------------------------------------------- */
.ex-work-hero {
  position: relative;
  padding: clamp(132px, 15vw, 196px) 0 clamp(48px, 6vw, 76px);
  border-bottom: 1px solid var(--ex-line);
  overflow: hidden;
  isolation: isolate;
}
.ex-work-hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(78% 120% at 12% 0%, var(--ex-accent-soft), transparent 62%),
    var(--ex-bg);
}
/* The grid is a separate layer so it can be inverted for the light theme on
   its own — the artwork is white lines, invisible on a light ground. */
.ex-work-hero-bg::before {
  content: "";
  position: absolute; inset: 0;
  background: url("../../../images/bg/grid-fade.png") top center/1200px auto repeat-x;
  opacity: .5;
}
:root[data-theme="light"] .ex-work-hero-bg::before { filter: invert(1); opacity: .45; }
.ex-work-title {
  font-size: clamp(33px, 5vw, 62px);
  line-height: 1.05; letter-spacing: -0.038em; margin: 0 0 20px; max-width: 20ch;
}
.ex-work-lead {
  color: var(--ex-text-muted); max-width: 62ch; margin: 0;
  font-size: clamp(16px, 1.4vw, 18.5px);
}

.ex-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.ex-jump a {
  font-family: var(--ex-mono); font-size: 12px; letter-spacing: .02em;
  color: var(--ex-text-muted);
  border: 1px solid var(--ex-line); border-radius: 999px;
  padding: 7px 14px; background: var(--ex-surface);
  transition: border-color .2s var(--ex-ease), color .2s var(--ex-ease), background-color .2s var(--ex-ease);
}
.ex-jump a:hover { color: var(--ex-text-strong); border-color: var(--ex-accent); background: var(--ex-surface-hover); }

/* ---------- case studies ------------------------------------------------ */
.ex-case {
  padding: clamp(34px, 4vw, 52px);
  border: 1px solid var(--ex-line);
  border-radius: var(--ex-radius-lg);
  background: var(--ex-surface);
  scroll-margin-top: 96px;
}
.ex-case + .ex-case { margin-top: clamp(22px, 3vw, 34px); }

.ex-case-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding-bottom: 26px; margin-bottom: 30px;
  border-bottom: 1px solid var(--ex-line);
}
.ex-case-title {
  font-size: clamp(28px, 3.2vw, 42px); letter-spacing: -0.035em; margin: 0 0 6px;
}
.ex-case-kicker { color: var(--ex-accent); font-size: 15.5px; margin: 0; font-weight: 500; }

.ex-case-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 34px);
  margin-bottom: clamp(28px, 3.4vw, 42px);
}
.ex-case-label {
  font-family: var(--ex-mono); font-size: 11px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--ex-text-muted);
  margin: 0 0 11px; font-weight: 500;
}
.ex-case-col p { color: var(--ex-text); font-size: 15.4px; margin: 0; }

.ex-case-detail {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 44px);
  padding-top: clamp(26px, 3vw, 34px);
  border-top: 1px solid var(--ex-line);
}
.ex-case-detail .ex-product-points li { font-size: 14.6px; }
.ex-case-detail .ex-product-points strong { color: var(--ex-text-strong); font-weight: 600; }

/* ---------- client work ------------------------------------------------- */
.ex-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.ex-filter {
  font-family: var(--ex-mono); font-size: 12px; letter-spacing: .02em;
  color: var(--ex-text-muted);
  background: var(--ex-surface); border: 1px solid var(--ex-line);
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
  transition: color .2s var(--ex-ease), border-color .2s var(--ex-ease), background-color .2s var(--ex-ease);
}
.ex-filter:hover { color: var(--ex-text-strong); border-color: var(--ex-line-strong); }
.ex-filter.is-active {
  color: var(--ex-accent-ink); background: var(--ex-grad);
  border-color: transparent;
  box-shadow: 0 6px 20px -10px var(--ex-accent-glow);
}

.ex-work-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}
.ex-work-card {
  background: var(--ex-surface); border: 1px solid var(--ex-line);
  border-radius: var(--ex-radius); padding: clamp(22px, 2.3vw, 30px);
  display: flex; flex-direction: column;
  transition: border-color .28s var(--ex-ease), background-color .28s var(--ex-ease), transform .28s var(--ex-ease);
}
.ex-work-card:hover { border-color: var(--ex-line-strong); background: var(--ex-surface-hover); transform: translateY(-3px); }
.ex-work-card[hidden] { display: none; }
.ex-work-icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ex-accent-soft); color: var(--ex-accent);
  border: 1px solid color-mix(in srgb, var(--ex-accent) 24%, transparent);
  font-size: 16px; margin-bottom: 18px;
}
.ex-work-card h3 { font-size: 19px; letter-spacing: -0.024em; margin: 0 0 11px; }
.ex-work-card p { color: var(--ex-text-muted); font-size: 15px; margin: 0; }
.ex-work-points { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 7px; }
.ex-work-points li { position: relative; padding-left: 18px; font-size: 14px; color: var(--ex-text); }
.ex-work-points li::before {
  content: ""; position: absolute; left: 2px; top: .6em;
  width: 8px; height: 1px; background: var(--ex-accent);
}
.ex-work-card .ex-stack { margin-top: auto; padding-top: 18px; }

.ex-work-empty {
  text-align: center; color: var(--ex-text-muted);
  font-family: var(--ex-mono); font-size: 13px; padding: 40px 0 0;
}

/* ---------- responsive -------------------------------------------------- */
@media (max-width: 991.98px) {
  .ex-case-grid { grid-template-columns: 1fr; }
  .ex-case-detail { grid-template-columns: 1fr; }
  .ex-work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ex-work-grid { grid-template-columns: 1fr; }
  .ex-case { padding: 24px 20px; }
  .ex-case-head { flex-direction: column; gap: 12px; }
}

/* ==========================================================================
   Services & About additions (Phase 3) — same system, page-specific pieces
   ========================================================================== */

/* Cross-link from a practice to the platform that proves it */
.ex-proof-link {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--ex-mono); font-size: 12px; letter-spacing: .02em;
  color: var(--ex-accent-2);
  border: 1px solid color-mix(in srgb, var(--ex-accent-2) 30%, transparent);
  background: color-mix(in srgb, var(--ex-accent-2) 9%, transparent);
  border-radius: 999px; padding: 8px 15px; white-space: nowrap;
  transition: background-color .22s var(--ex-ease), border-color .22s var(--ex-ease), transform .22s var(--ex-ease);
}
.ex-proof-link:hover {
  color: var(--ex-accent-2);
  background: color-mix(in srgb, var(--ex-accent-2) 16%, transparent);
  border-color: color-mix(in srgb, var(--ex-accent-2) 48%, transparent);
  transform: translateX(2px);
}
.ex-proof-link i { font-size: 10px; }

.ex-case-intro {
  color: var(--ex-text);
  font-size: clamp(16px, 1.35vw, 18px);
  max-width: 68ch;
  margin: 0 0 clamp(26px, 3vw, 36px);
}

/* Four-up service detail inside a practice card */
.ex-svc-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.2vw, 28px);
  padding-top: clamp(24px, 3vw, 32px);
  border-top: 1px solid var(--ex-line);
  margin-bottom: 26px;
}
.ex-svc-item h3 {
  font-size: 17px; letter-spacing: -0.022em; margin: 0 0 8px;
  display: flex; align-items: baseline; gap: 9px;
}
.ex-svc-item h3::before {
  content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ex-accent); opacity: .85;
}
.ex-svc-item p { color: var(--ex-text-muted); font-size: 14.8px; margin: 0; }

/* About: long-form prose column */
.ex-prose p {
  color: var(--ex-text); font-size: clamp(16px, 1.35vw, 17.5px);
  margin: 0 0 20px; max-width: 66ch;
}
.ex-prose a { border-bottom: 1px solid color-mix(in srgb, var(--ex-accent) 40%, transparent); }
.ex-prose a:hover { border-bottom-color: var(--ex-accent-2); }

.ex-principles {
  margin-top: clamp(30px, 3.4vw, 42px);
  padding-top: clamp(26px, 3vw, 34px);
  border-top: 1px solid var(--ex-line);
}
.ex-principles ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 15px; }
.ex-principles li {
  position: relative; padding-left: 24px;
  color: var(--ex-text-muted); font-size: 15.3px; max-width: 64ch;
}
.ex-principles li::before {
  content: ""; position: absolute; left: 3px; top: .62em;
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--ex-accent); opacity: .85; transform: rotate(45deg);
}
.ex-principles strong { color: var(--ex-text-strong); font-weight: 600; }

/* About: the stat band sits inside a section rather than a hero */
.ex-section .ex-hero-proof { margin-top: clamp(40px, 4.5vw, 58px); max-width: none; }

@media (max-width: 640px) {
  .ex-svc-grid { grid-template-columns: 1fr; }
}

/* Polish: same chip-hole fix as the homepage cards (see home.css). */
.ex-work-card .ex-stack { margin-top: 16px; padding-top: 0; }
.ex-work-card { gap: 0; }
