.pm-projects {
  --pm-blue: #2563eb;
  --pm-blue-dark: #0a2540;
  --pm-cyan: #04dbf1;
  --pm-red: #ff004e;
  --pm-gold: #f59e0b;
  --pm-ink: #0a2540;
  --pm-muted: #5e6b7c;
  --pm-line: #dce7f5;
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: 112px 28px;
  background:
    radial-gradient(circle at 4% 12%, rgba(37, 99, 235, .12), transparent 27%),
    radial-gradient(circle at 92% 84%, rgba(4, 219, 241, .1), transparent 25%),
    linear-gradient(180deg, #f7faff 0%, #fff 48%, #f8fbff 100%);
}

.pm-projects::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .32;
  background-image: linear-gradient(rgba(37, 99, 235, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(37, 99, 235, .07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.pm-projects-inner {
  width: min(1340px, 100%);
  margin: 0 auto;
}

.pm-projects-header {
  max-width: 850px;
  margin-bottom: 38px;
}

.pm-projects-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 8px 14px;
  border: 1px solid rgba(37, 99, 235, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  color: var(--pm-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(10, 37, 64, .06);
}

.pm-projects-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pm-cyan);
  box-shadow: 0 0 0 5px rgba(4, 219, 241, .14);
}

.pm-projects-title {
  color: var(--pm-ink);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.025em;
}

.pm-projects-title em {
  color: var(--pm-blue);
  font-style: italic;
}

.pm-projects-lead {
  max-width: 780px;
  margin-top: 20px;
  color: var(--pm-muted);
  font-size: 16px;
  line-height: 1.8;
}

.pm-projects-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 322px;
  gap: 32px;
  align-items: start;
}

.pm-projects-main {
  min-width: 0;
}

.pm-project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 24px;
}

.pm-project-filter {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid var(--pm-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: #41516a;
  font: 700 12px/1 "Outfit", sans-serif;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.pm-project-filter:hover {
  border-color: rgba(37, 99, 235, .45);
  color: var(--pm-blue);
  transform: translateY(-1px);
}

.pm-project-filter[aria-pressed="true"] {
  border-color: var(--pm-blue);
  background: var(--pm-blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .24);
}

.pm-project-filter:focus-visible,
.pm-project-card button:focus-visible,
.pm-project-primary:focus-visible,
.pm-expertise-link:focus-visible,
.pm-project-dialog-close:focus-visible {
  outline: 3px solid var(--pm-cyan);
  outline-offset: 3px;
}

.pm-project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.pm-project-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(191, 208, 230, .74);
  border-radius: 20px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 16px 42px rgba(10, 37, 64, .08);
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease, border-color .25s ease, box-shadow .25s ease;
}

.pm-project-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.pm-project-card:hover {
  border-color: rgba(37, 99, 235, .42);
  box-shadow: 0 24px 62px rgba(10, 37, 64, .14);
  transform: translateY(-4px);
}

.pm-project-media-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #eaf2ff;
  cursor: pointer;
}

.pm-project-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform .45s ease;
}

.pm-project-card:hover .pm-project-media {
  transform: scale(1.035);
}

.pm-project-media-button::after {
  content: "+";
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 50%;
  background: rgba(10, 37, 64, .82);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  backdrop-filter: blur(10px);
  transition: background .2s ease, transform .2s ease;
}

.pm-project-media-button:hover::after {
  background: var(--pm-blue);
  transform: rotate(90deg);
}

.pm-project-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 19px;
}

.pm-project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 12px;
}

.pm-project-category,
.pm-project-demo {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pm-project-category {
  background: #eaf1ff;
  color: var(--pm-blue);
}

.pm-project-demo {
  background: #fff6df;
  color: #965f00;
}

.pm-project-card-title {
  color: var(--pm-ink);
  font-family: "Cormorant Garamond", serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.08;
}

.pm-project-card-description {
  margin-top: 11px;
  color: var(--pm-muted);
  font-size: 12px;
  line-height: 1.7;
}

.pm-project-detail-button {
  align-self: flex-start;
  margin-top: auto;
  padding: 17px 0 0;
  border: 0;
  background: transparent;
  color: var(--pm-blue);
  font: 800 11px/1.3 "Outfit", sans-serif;
  cursor: pointer;
}

.pm-project-detail-button::after {
  content: " →";
}

.pm-project-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
}

.pm-sidebar-card {
  overflow: hidden;
  border: 1px solid rgba(191, 208, 230, .78);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(10, 37, 64, .09);
}

.pm-sidebar-cta {
  position: relative;
  padding: 27px;
  background:
    radial-gradient(circle at 90% 8%, rgba(4, 219, 241, .28), transparent 32%),
    linear-gradient(145deg, #071b38, #123c79 70%, #1b5bff);
  color: #fff;
}

.pm-sidebar-cta::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -54px;
  width: 142px;
  height: 142px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 20px rgba(255, 255, 255, .04), 0 0 0 40px rgba(255, 255, 255, .025);
  pointer-events: none;
}

.pm-sidebar-eyebrow {
  color: #7cecff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.pm-sidebar-title {
  margin-top: 12px;
  color: #fff;
  font-family: "Cormorant Garamond", serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.05;
}

.pm-sidebar-copy {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  line-height: 1.75;
}

.pm-project-primary {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  padding: 13px 18px;
  border-radius: 8px;
  background: var(--pm-red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(255, 0, 78, .28);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.pm-project-primary:hover {
  background: #e70047;
  box-shadow: 0 16px 36px rgba(255, 0, 78, .38);
  transform: translateY(-2px);
}

.pm-sidebar-note {
  position: relative;
  z-index: 1;
  margin-top: 13px;
  color: rgba(255, 255, 255, .58);
  font-size: 10px;
  line-height: 1.55;
  text-align: center;
}

.pm-expertise-card {
  padding: 24px;
}

.pm-expertise-title {
  color: var(--pm-ink);
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  font-weight: 700;
}

.pm-expertise-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 16px;
}

.pm-expertise-link {
  display: flex;
  min-width: 0;
  min-height: 91px;
  flex-direction: column;
  justify-content: space-between;
  gap: 9px;
  padding: 12px;
  border: 1px solid #e3ebf7;
  border-radius: 13px;
  background: #f8fbff;
  color: var(--pm-ink);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.pm-expertise-link:hover {
  border-color: rgba(37, 99, 235, .45);
  background: #eef4ff;
  transform: translateY(-2px);
}

.pm-expertise-icon {
  font-size: 21px;
  line-height: 1;
}

.pm-project-empty {
  grid-column: 1 / -1;
  padding: 32px;
  border: 1px dashed #b9cbe3;
  border-radius: 18px;
  color: var(--pm-muted);
  text-align: center;
}

.pm-project-dialog {
  width: min(900px, calc(100% - 32px));
  max-height: min(88vh, 760px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: var(--pm-ink);
  box-shadow: 0 36px 100px rgba(4, 18, 40, .42);
}

.pm-project-dialog::backdrop {
  background: rgba(3, 13, 30, .78);
  backdrop-filter: blur(8px);
}

.pm-project-dialog-shell {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  min-height: 480px;
}

.pm-project-dialog-media {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  background: #eaf2ff;
}

.pm-project-dialog-content {
  position: relative;
  padding: 46px 34px 34px;
}

.pm-project-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #dce7f5;
  border-radius: 50%;
  background: #fff;
  color: var(--pm-ink);
  font-size: 22px;
  cursor: pointer;
}

.pm-project-dialog-category {
  color: var(--pm-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.pm-project-dialog-title {
  margin-top: 12px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 700;
  line-height: 1;
}

.pm-project-dialog-description {
  margin-top: 18px;
  color: var(--pm-muted);
  font-size: 13px;
  line-height: 1.75;
}

.pm-project-dialog-services-title {
  margin-top: 24px;
  color: var(--pm-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.pm-project-dialog-services {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
  padding: 0;
  list-style: none;
}

.pm-project-dialog-services li {
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #31578d;
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .pm-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .pm-projects { padding: 90px 24px; }
  .pm-projects-layout { grid-template-columns: 1fr; }
  .pm-project-sidebar { position: static; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .pm-projects { padding: 76px 20px; }
  .pm-projects-header { margin-bottom: 30px; }
  .pm-projects-lead { font-size: 14px; }
  .pm-project-sidebar { grid-template-columns: 1fr; }
  .pm-project-dialog-shell { grid-template-columns: 1fr; }
  .pm-project-dialog-media { min-height: 0; aspect-ratio: 16 / 9; }
  .pm-project-dialog-content { padding: 38px 24px 28px; }
}

@media (max-width: 640px) {
  .pm-projects { padding-inline: 16px; }
  .pm-project-grid { grid-template-columns: 1fr; }
  .pm-project-filters { gap: 7px; }
  .pm-project-filter { min-height: 38px; padding-inline: 12px; font-size: 11px; }
  .pm-sidebar-cta, .pm-expertise-card { padding: 22px; }
  .pm-project-dialog { width: min(100% - 20px, 900px); border-radius: 18px; }
}

@media (max-width: 390px) {
  .pm-expertise-grid { grid-template-columns: 1fr; }
  .pm-expertise-link { min-height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .pm-project-card,
  .pm-project-card *,
  .pm-project-filter,
  .pm-project-primary,
  .pm-expertise-link {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
  .pm-project-card { opacity: 1; transform: none; }
}
