/* Projects: project cards in the node gallery, and the project page that opens over them */

/* ---------- card ---------- */

.pj .ng-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.pj-card-logo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
}

.pj-card-logo img {
  display: block;
  width: auto !important;
  height: 18px !important;
}

.pj-card-logo b {
  display: block;
  font: 400 19px/1 Anton, var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.ng-card-hint--pill {
  width: auto;
  height: auto;
  padding: 9px 14px;
  border-radius: 999px;
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- project page ---------- */

.pj-detail {
  --pj-ease: var(--ease);
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--pj-bg);
  color: var(--pj-fg);
  opacity: 0;
  transition: opacity 0.45s var(--pj-ease);
}

.pj-detail[hidden] {
  display: none;
}

.pj-detail.is-visible {
  opacity: 1;
}

.pj-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pj-article {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(56px, 9vh, 96px) clamp(20px, 5vw, 64px) 72px;
  font-family: var(--font-mono);
}

/* staggered entrance with an easy ease */
.pj-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--pj-ease), transform 0.8s var(--pj-ease);
  transition-delay: calc(0.12s + var(--i, 0) * 0.07s);
}

.pj-detail.is-visible .pj-in {
  opacity: 1;
  transform: none;
}

.pj-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: clamp(28px, 5vh, 48px);
}

.pj-brand {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 22px);
}

.pj-brand:empty {
  display: none;
}

.pj-logo {
  display: block;
  width: min(360px, 62vw);
  height: auto;
}

.pj-mark {
  display: block;
  width: auto;
  height: clamp(64px, 9vw, 96px);
}

.pj-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* no logo image: the project name is the wordmark */
.pj-title.is-visible {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  margin: 0;
  font: 400 clamp(44px, 7vw, 84px)/0.95 Anton, var(--font-mono);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pj-title--sans.is-visible {
  font: 700 clamp(38px, 5.6vw, 64px)/1 'DM Sans', system-ui, sans-serif;
  letter-spacing: -0.02em;
  text-transform: none;
}

.pj-dates {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pj-accent);
}

.pj-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.pj-summary {
  margin: 0 0 22px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.45;
}

.pj-bullets {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.pj-bullets li {
  position: relative;
  padding-left: 22px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--pj-muted);
}

.pj-bullets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  background: var(--pj-accent);
}

.pj-closing {
  margin: 0 0 28px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.pj-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 6px;
  background: var(--pj-accent);
  color: var(--pj-bg);
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.5s var(--pj-ease), box-shadow 0.5s var(--pj-ease), opacity 0.7s var(--pj-ease);
}

.pj-cta:hover,
.pj-cta:focus-visible {
  box-shadow: 0 10px 30px color-mix(in srgb, var(--pj-accent) 35%, transparent);
}

.pj-detail.is-visible .pj-cta:hover,
.pj-detail.is-visible .pj-cta:focus-visible {
  transform: translateY(-2px);
}

.pj-cta:focus-visible {
  outline: 2px solid var(--pj-fg);
  outline-offset: 3px;
}

.pj-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pj-cta--ghost {
  background: transparent;
  color: var(--pj-fg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pj-fg) 35%, transparent);
}

.pj-cta--ghost:hover,
.pj-cta--ghost:focus-visible {
  box-shadow: inset 0 0 0 1px var(--pj-fg);
}

/* demo video: thumbnail + play button until clicked, then the YouTube player */
.pj-video {
  margin-top: clamp(40px, 7vh, 72px);
}

.pj-video h3 {
  margin: 0 0 18px;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pj-muted);
}

.pj-video-frame {
  position: relative;
  display: block;
  width: 100%;
  max-width: 980px;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  box-shadow: 0 30px 80px var(--pj-shadow, rgba(0, 0, 0, 0.5)), 0 0 0 1px color-mix(in srgb, var(--pj-fg) 12%, transparent);
}

.pj-video-frame img,
.pj-video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.pj-video-frame img {
  transition: transform 0.9s var(--pj-ease), filter 0.9s var(--pj-ease);
}

.pj-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--pj-accent);
  transform: translate(-50%, -50%);
  box-shadow: 0 10px 40px color-mix(in srgb, var(--pj-accent) 45%, transparent);
  transition: transform 0.6s var(--pj-ease);
}

.pj-play::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 25px;
  border-style: solid;
  border-width: 13px 0 13px 21px;
  border-color: transparent transparent transparent var(--pj-bg);
}

.pj-video-frame:not(.is-playing):hover img,
.pj-video-frame:focus-visible img {
  transform: scale(1.03);
  filter: brightness(0.85);
}

.pj-video-frame:hover .pj-play,
.pj-video-frame:focus-visible .pj-play {
  transform: translate(-50%, -50%) scale(1.08);
}

.pj-video-frame:focus-visible {
  outline: 2px solid var(--pj-fg);
  outline-offset: 4px;
}

.pj-hero {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 80px var(--pj-shadow, rgba(0, 0, 0, 0.5)), 0 0 0 1px color-mix(in srgb, var(--pj-fg) 12%, transparent);
}

.pj-hero img {
  display: block;
  width: 100%;
  height: auto;
}

.pj-panel {
  margin-top: clamp(40px, 7vh, 72px);
}

.pj-panel h3 {
  margin: 0 0 18px;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pj-muted);
}

.pj-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.pj-panel li {
  display: grid;
  gap: 10px;
}

.pj-panel img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  filter: grayscale(0.2);
  transition: transform 0.6s var(--pj-ease), filter 0.6s var(--pj-ease);
}

.pj-panel li:hover img {
  transform: translateY(-4px);
  filter: none;
}

.pj-panel span {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pj-muted);
}

.pj-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--pj-fg) 30%, transparent);
  background: color-mix(in srgb, var(--pj-bg) 70%, transparent);
  color: var(--pj-fg);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.35s var(--pj-ease), border-color 0.35s var(--pj-ease);
}

.pj-close:hover,
.pj-close:focus-visible {
  border-color: var(--pj-fg);
  background: color-mix(in srgb, var(--pj-fg) 12%, transparent);
}

@media (max-width: 860px) {
  .pj-grid {
    grid-template-columns: 1fr;
  }
  .pj-hero {
    order: -1;
  }
  .pj-panel ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .pj-in {
    transition-duration: 0.01s;
    transition-delay: 0s;
  }
}
