/* Paragon layer on top of the reference build: logo masks, flame motion, new footer. */
:root {
  --pg-red: #ee323b;
  --pg-ink: #12110e;
  --pg-cream: #fafbf8;
  --pg-beige: #ddd9d4;
  --pg-ease: cubic-bezier(0.19, 1, 0.22, 1);
}

/* ---------- logos: hide the reference marks, paint ours in currentColor ---------- */
svg.icon-wordmark > *,
svg.icon-mark > *,
svg.PageTransition-logo > * {
  visibility: hidden !important;
}
svg.icon-wordmark,
svg.icon-mark,
svg.PageTransition-logo {
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}
svg.icon-wordmark {
  -webkit-mask-image: url(/brand/paragon-wordmark.svg);
  mask-image: url(/brand/paragon-wordmark.svg);
  -webkit-mask-position: left center;
  mask-position: left center;
}
svg.icon-mark,
svg.PageTransition-logo {
  -webkit-mask-image: url(/brand/paragon-flame.svg);
  mask-image: url(/brand/paragon-flame.svg);
  -webkit-mask-position: center;
  mask-position: center;
}

/* ---------- loader: the flame ignites from its base and breathes; the page name sits BELOW it ---------- */
:root { --pg-lift: clamp(3.4rem, 4.8vw, 6rem); }
svg.PageTransition-logo {
  -webkit-mask-size: 52%;
  mask-size: 52%;
  top: calc(50% - var(--pg-lift)) !important;
  transform-origin: 50% 74%;
  clip-path: inset(100% 0 0 0);
}
svg.PageTransition-logo.pg-lit {
  animation:
    pg-ignite 700ms var(--pg-ease) forwards,
    pg-breathe 3.2s ease-in-out 700ms infinite;
}
.PageTransition-title {
  margin-top: calc(var(--pg-lift) * 2.3) !important;
  margin-bottom: 0 !important;
  text-align: center;
}
.PageTransition-logoWrapper::after {
  /* warm glow behind the flame */
  content: "";
  position: absolute;
  left: 50%;
  top: calc(50% - var(--pg-lift));
  width: 22rem;
  height: 22rem;
  translate: -50% -42%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  background: radial-gradient(closest-side, rgba(255, 214, 196, 0.5), rgba(255, 214, 196, 0));
}
.PageTransition-logoWrapper.pg-glow::after {
  opacity: 1;
}
@keyframes pg-ignite {
  0% {
    clip-path: inset(100% 0 0 0);
    transform: scale(0.6, 0.4);
  }
  60% {
    clip-path: inset(0 0 0 0);
    transform: scale(1.02, 1.06);
  }
  100% {
    clip-path: inset(0 0 0 0);
    transform: scale(1, 1);
  }
}
/* a slow upward breath: no skew, no jitter */
@keyframes pg-breathe {
  0%,
  100% {
    transform: scale(1, 1);
  }
  50% {
    transform: scale(1.02, 1.045);
  }
}

/* ---------- home swirl: the flame never spins; it breathes ---------- */
.HomeSwirlTitles-logo {
  rotate: none !important;
}
/* round 4: no breathing either. A CSS animation on top of the scroll-scrubbed scale made the flame
   shimmer on phones; on a phone it is also a faint watermark so the swirl lines stay readable. */
.HomeSwirlTitles-logo svg.icon-mark {
  animation: none;
}
@media (width < 64em) {
  .HomeSwirlTitles-logo { opacity: 0.2 !important; }
}

/* ---------- footer: the reference signup + footer are replaced by ours ---------- */
.SignupFormWrapper,
footer.TheFooter {
  display: none !important;
}

.pg-footer {
  position: relative;
  overflow: hidden;
  background: var(--pg-ink);
  color: var(--pg-cream);
  font-family: ParagonSans, helvetica, arial, sans-serif;
  padding: clamp(4.8rem, 8vw, 12rem) clamp(1.6rem, 2.4vw, 3.2rem) 0;
}
.pg-footer a {
  color: inherit;
  text-decoration: none;
}
.pg-footer-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 3.2rem;
  padding-bottom: clamp(4.8rem, 7vw, 9.6rem);
}
.pg-footer-eyebrow {
  font-size: 1.2rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pg-red);
  margin-bottom: 2.4rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.pg-footer-eyebrow::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--pg-red);
}
.pg-footer-title {
  font-weight: 500;
  font-size: clamp(3.6rem, 6.4vw, 9.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 14ch;
}
.pg-footer-title em {
  font-style: normal;
  color: var(--pg-red);
}
.pg-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: stretch;
  min-width: 26rem;
}
.pg-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2.4rem;
  padding: 1.8rem 2.2rem;
  border-radius: 0.6rem;
  font-size: 1.6rem;
  font-weight: 500;
  transition:
    background 0.4s var(--pg-ease),
    color 0.4s var(--pg-ease),
    border-color 0.4s var(--pg-ease);
}
.pg-btn svg {
  width: 1.6rem;
  height: 1.6rem;
  transition: transform 0.5s var(--pg-ease);
}
.pg-btn:hover svg {
  transform: translate(0.3rem, -0.3rem);
}
.pg-btn-primary {
  background: var(--pg-red);
  color: var(--pg-ink);
}
.pg-btn-primary:hover {
  background: var(--pg-cream);
}
.pg-btn-ghost {
  border: 1px solid rgba(250, 251, 248, 0.25);
}
.pg-btn-ghost:hover {
  border-color: var(--pg-cream);
}

.pg-footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.2fr;
  gap: 3.2rem;
  border-top: 1px solid rgba(250, 251, 248, 0.18);
  padding: 4rem 0 6.4rem;
}
.pg-col h4 {
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(250, 251, 248, 0.5);
  margin: 0 0 2rem;
}
.pg-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}
.pg-col li a,
.pg-col li span {
  font-size: 1.6rem;
  line-height: 1.3;
  position: relative;
}
.pg-col li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--pg-ease);
}
.pg-col li a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
.pg-col-about p {
  font-size: 1.6rem;
  line-height: 1.35;
  color: rgba(250, 251, 248, 0.72);
  max-width: 32ch;
  margin: 0 0 2.4rem;
}
.pg-badge {
  display: inline-flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.4rem 1rem 1rem;
  border: 1px solid rgba(250, 251, 248, 0.2);
  border-radius: 99rem;
  font-size: 1.3rem;
}
.pg-badge b {
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: var(--pg-red);
  color: var(--pg-ink);
  font-weight: 500;
  font-size: 1.2rem;
}
.pg-contact-big {
  font-size: 2.2rem !important;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.pg-footer-mark {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2vw;
  padding-bottom: 1.6rem;
}
.pg-footer-word {
  flex: 1;
  aspect-ratio: 9386 / 1737;
  background: var(--pg-cream);
  -webkit-mask: url(/brand/paragon-wordmark.svg) left bottom / contain no-repeat;
  mask: url(/brand/paragon-wordmark.svg) left bottom / contain no-repeat;
}
.pg-footer-flame {
  width: 13.4vw;
  aspect-ratio: 1128 / 1555;
  background: var(--pg-red);
  transform-origin: 50% 85%;
  -webkit-mask: url(/brand/paragon-flame.svg) center / contain no-repeat;
  mask: url(/brand/paragon-flame.svg) center / contain no-repeat;
  animation: pg-breathe 4s ease-in-out infinite;
  will-change: transform;
}
.pg-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(250, 251, 248, 0.18);
  padding: 2rem 0 2.4rem;
  font-size: 1.3rem;
  color: rgba(250, 251, 248, 0.55);
}
.pg-footer-bottom nav {
  display: flex;
  gap: 2.4rem;
}
.pg-footer-bottom a:hover {
  color: var(--pg-cream);
}
.pg-social {
  display: flex;
  gap: 0.8rem;
}
.pg-social a {
  width: 3.6rem;
  height: 3.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(250, 251, 248, 0.2);
  transition:
    background 0.4s var(--pg-ease),
    color 0.4s var(--pg-ease);
}
.pg-social a:hover {
  background: var(--pg-cream);
  color: var(--pg-ink);
}
.pg-social svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

/* reveal on scroll */
.pg-footer [data-pg-reveal] {
  opacity: 0;
  transform: translateY(3rem);
  transition:
    opacity 1s var(--pg-ease),
    transform 1.2s var(--pg-ease);
}
.pg-footer .pg-in[data-pg-reveal],
.pg-footer.pg-in [data-pg-reveal] {
  opacity: 1;
  transform: none;
}
.pg-footer-mark[data-pg-reveal] {
  transform: translateY(40%);
  transition-duration: 1.6s;
}

@media (max-width: 1023px) {
  .pg-footer-cta {
    grid-template-columns: 1fr;
  }
  .pg-footer-actions {
    min-width: 0;
  }
  .pg-footer-grid {
    grid-template-columns: 1fr 1fr;
    row-gap: 4.8rem;
  }
  .pg-col-about {
    grid-column: 1 / -1;
  }
}
@media (max-width: 599px) {
  .pg-footer-grid {
    grid-template-columns: 1fr;
  }
  .pg-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pg-footer [data-pg-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .pg-footer-flame,
  .HomeSwirlTitles-logo svg.icon-mark,
  svg.PageTransition-logo.pg-lit {
    animation: none;
    clip-path: none;
  }
}

/* ---------- project cards with a real picture: photo on top, the name as the title ----------
   The reference card is a fixed 1:1 square with a grayscale/contrast filter for logos; photo cards
   grow to fit and keep their colour. */
.PortfolioCard:has(img[src*="/pg/photos/"]) { aspect-ratio: auto !important; height: auto !important; align-self: stretch; }
.PortfolioCard:has(img[src*="/pg/photos/"]) .PortfolioCard-inner {
  display: flex; flex-direction: column; justify-content: flex-start; height: auto !important;
}
.PortfolioCard:has(img[src*="/pg/photos/"]) .PortfolioCard-logo {
  flex: none; width: 100%; height: auto; aspect-ratio: 3 / 2; margin: 0 0 1.2rem; overflow: hidden;
  background: var(--pg-beige);
}
.PortfolioCard .PortfolioCard-img[src*="/pg/photos/"] {
  width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important;
  object-fit: cover; filter: none !important; transform: none !important; scale: 1 !important;
  transition: scale 1.2s var(--pg-ease);
}
.PortfolioCard:hover .PortfolioCard-img[src*="/pg/photos/"] { scale: 1.04 !important; }
@media (width < 64em) { /* the reference hides the logo below 1024px; photo cards always show it on top */
  .PortfolioCard:has(img[src*="/pg/photos/"]) .PortfolioCard-logo { display: block !important; }
}
/* the reference hover slides the logo down and fades the description: photo cards keep their layout */
.PortfolioCard:has(img[src*="/pg/photos/"]):is(:hover, :focus) .PortfolioCard-logo { transform: none !important; }
.PortfolioCard:has(img[src*="/pg/photos/"]):is(:hover, :focus) .PortfolioCard-description { opacity: 1 !important; transform: none !important; }
.PortfolioCard:has(img[src*="/pg/photos/"]) .PortfolioCard-tags { display: none !important; }
.PortfolioCard:has(img[src*="/pg/photos/"]) .PortfolioCard-title {
  display: block !important; position: static !important; width: auto !important; height: auto !important;
  clip: auto !important; overflow: visible !important; margin: 0 1.2rem .6rem; font-size: 1.5rem; line-height: 1.2;
  flex: none !important;
}
.PortfolioCard:has(img[src*="/pg/photos/"]) .PortfolioCard-description {
  height: auto !important; overflow: visible !important; margin: 0 1.2rem 1.6rem;
  flex: none !important; max-height: none !important; -webkit-line-clamp: unset !important;
}

/* ---------- capabilities: a picture under each capability title ---------- */
.pg-cap-photo {
  display: block; width: 100%; max-width: 44rem; aspect-ratio: 4 / 3; object-fit: cover; margin-top: 3.2rem;
  border-radius: .4rem; box-shadow: 0 1.6rem 4rem rgba(18, 17, 14, .18);
}
@media (max-width: 767px) {
  .pg-cap-photo { margin-top: 2rem; aspect-ratio: 3 / 2; }
}
.pg-cap-photo--list { margin: 0 0 2rem; aspect-ratio: 3 / 2; box-shadow: none; }

/* ---------- home approach (Consult / Engineer / Deliver): keep the text clear of the animation ---------- */
@media (width >= 64em) {
  .HomeApproach-rive-container canvas.RivePlayer { translate: 16vw 0; }
  .HomeApproach-body { max-width: 31vw; }
}

/* ---------- round 4: the team page used the reference's mid-grey theme (read as a dark tan) → cream ---------- */
.theme--grey {
  background-color: #fafbf8 !important;
  --color-bg: #fafbf8;
}

/* ---------- round 4: home sector titles on a phone ----------
   The reference draws each title twice (white outside the video, red inside it) and the two copies trail each
   other while scrolling. On a phone: one white title, smaller, sitting fully above the video's top edge. */
@media (width < 64em) {
  .KeyAreas-content.masked .KeyAreas-content-title {
    visibility: hidden !important;
  }
  .KeyAreas-content.unmasked .KeyAreas-content-title {
    font-size: 9.4vw;
    line-height: 0.97;
    /* the reference lifts the title by one font size; lift ours a further 24px so it clears the video edge */
    margin-top: calc(0px - 9.4vw - 24px);
  }
}
