/* Portfolio /projects showcase. Loaded after portfolio.css. Haiti blue / red / gold accents, no purple. */

.pfx-hero,
.pfx-project,
.pfx-hack,
.pfx-cta {
  --pfx-blue: #00209f;
  --pfx-blue-bright: #3d6bff;
  --pfx-red: #d21034;
  --pfx-gold: #f5c518;
  --pfx-night: #050b1a;
  --pfx-ink: #0b1220;
  --pfx-muted: #5f6b7a;
  position: relative;
  z-index: 1;
}

/* ---------- hero ---------- */

.pfx-hero {
  overflow: hidden;
  padding: clamp(5rem, 11vw, 8.5rem) 0 clamp(3.5rem, 7vw, 5.5rem);
  color: #fff;
  background: linear-gradient(170deg, #0a1633 0%, var(--pfx-night) 70%);
}

.pfx-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pfx-blue) 0 50%, var(--pfx-red) 50% 100%);
}

.pfx-hero__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(45% 55% at 82% 18%, rgba(61, 107, 255, 0.32), transparent 70%),
    radial-gradient(35% 45% at 8% 100%, rgba(0, 32, 159, 0.55), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: auto, auto, 64px 64px, 64px 64px;
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}

.pfx-hero__inner {
  position: relative;
}

.pfx-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.4rem;
  font-family: var(--pf-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.pfx-kicker__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--pfx-blue-bright) 50%, var(--pfx-red) 50%);
  box-shadow: 0 0 0 4px rgba(245, 197, 24, 0.16);
}

.pfx-hero__title {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(2.6rem, 6.6vw, 5.4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  color: #fff;
}

.pfx-hero__title em {
  font-style: normal;
  font-weight: 400;
  color: var(--pfx-gold);
}

.pfx-hero__lead {
  max-width: 42rem;
  margin: 1.6rem 0 0;
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
}

.pfx-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 46rem;
  margin: 2.75rem 0 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
}

.pfx-stats > div {
  padding: 1.1rem 1.3rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.pfx-stats > div:first-child {
  border-left: 0;
}

.pfx-stats dt {
  font-family: var(--pf-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.pfx-stats dd {
  margin: 0.35rem 0 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
}

.pfx-stats .pfx-stats__text {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
}

.pfx-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.6rem;
}

.pfx-index a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem 0.55rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.pfx-index a span {
  display: inline-grid;
  place-items: center;
  min-width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-family: var(--pf-mono);
  font-size: 0.75rem;
}

.pfx-index a:hover,
.pfx-index a:focus-visible {
  border-color: var(--pfx-gold);
  background: rgba(245, 197, 24, 0.08);
}

/* stacked project covers on wide screens */
.pfx-deck {
  display: none;
}

@media (min-width: 1200px) {
  .pfx-hero__inner {
    padding-right: 420px;
  }

  .pfx-hero__title {
    font-size: clamp(3rem, 4.6vw, 4.6rem);
  }

  .pfx-deck {
    position: absolute;
    top: 50%;
    right: max(2rem, calc((100vw - 1200px) / 2));
    display: block;
    width: 340px;
    height: 420px;
    transform: translateY(-46%);
    pointer-events: none;
  }

  .pfx-deck__card {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    overflow: hidden;
    background: #0a1633;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  }

  .pfx-deck__card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .pfx-deck__card--1 {
    z-index: 3;
    transform: rotate(-4deg);
  }

  .pfx-deck__card--2 {
    z-index: 2;
    opacity: 0.85;
    transform: translate(46px, -26px) rotate(6deg);
  }

  .pfx-deck__card--3 {
    z-index: 1;
    opacity: 0.6;
    transform: translate(-40px, 30px) rotate(-12deg);
  }

  .pfx-deck__card--1::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 4px;
    background: linear-gradient(90deg, var(--pfx-blue) 0 50%, var(--pfx-red) 50% 100%);
  }
}

/* ---------- project showcases ---------- */

.pfx-project {
  padding: clamp(4rem, 8vw, 7rem) 0;
  scroll-margin-top: 70px;
  background: #fff;
}

.pfx-project:nth-child(even) {
  background: #f3f5fa;
}

.pfx-project__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.pfx-project__media {
  min-width: 0;
}

.pfx-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: clamp(1rem, 3vw, 2rem);
  border: 0;
  border-radius: 28px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--pfx-night);
  box-shadow: 0 40px 90px -40px rgba(5, 11, 26, 0.55);
  isolation: isolate;
}

.pfx-stage__blur {
  position: absolute;
  inset: -12%;
  z-index: -1;
  background-position: center;
  background-size: cover;
  filter: blur(38px) saturate(1.2);
  opacity: 0.55;
  transform: scale(1.1);
}

.pfx-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(80% 70% at 50% 50%, transparent 30%, rgba(5, 11, 26, 0.55) 100%);
}

.pfx-stage img {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.pfx-stage:hover img,
.pfx-stage:focus-visible img {
  transform: scale(1.025);
}

.pfx-stage__zoom {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--pfx-ink);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.pfx-stage:hover .pfx-stage__zoom,
.pfx-stage:focus-visible .pfx-stage__zoom {
  opacity: 1;
  transform: none;
}

.pfx-shots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.pfx-shot {
  display: block;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 3 / 4;
  background: var(--pfx-night);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.pfx-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.pfx-shot:hover,
.pfx-shot:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px -18px rgba(5, 11, 26, 0.5);
}

.pfx-project__copy {
  min-width: 0;
}

.pfx-project__num {
  margin: 0 0 0.8rem;
  font-family: var(--pf-mono);
  font-size: 0.85rem;
  color: var(--pfx-muted);
}

.pfx-project__num span {
  color: var(--pfx-red);
  font-weight: 600;
}

.pfx-project__title {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--pfx-ink);
}

.pfx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}

.pfx-tags li {
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(0, 32, 159, 0.2);
  border-radius: 999px;
  background: rgba(0, 32, 159, 0.05);
  font-family: var(--pf-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pfx-blue);
}

.pfx-project__text {
  margin-top: 1.4rem;
  font-size: 1.06rem;
  line-height: 1.75;
  color: #3a4453;
}

.pfx-project__text p {
  margin: 0;
}

.pfx-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 2rem;
}

.pfx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.1rem;
  padding: 0 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.pfx-btn--primary {
  background: var(--pfx-red);
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(210, 16, 52, 0.75);
}

.pfx-btn--primary:hover,
.pfx-btn--primary:focus-visible {
  background: #b80d2c;
  transform: translateY(-2px);
}

.pfx-btn--ghost {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.pfx-btn--ghost:hover,
.pfx-btn--ghost:focus-visible {
  border-color: var(--pfx-gold);
  color: var(--pfx-gold);
}

.pfx-store {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.1rem;
  padding: 0 1.1rem;
  border-radius: 14px;
  background: var(--pfx-ink);
  color: #fff;
  text-decoration: none;
  transition: transform 0.25s ease;
}

.pfx-store span {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.1;
}

.pfx-store small {
  font-size: 0.66rem;
  font-weight: 400;
  opacity: 0.7;
}

.pfx-store:hover,
.pfx-store:focus-visible {
  transform: translateY(-2px);
}

/* ---------- hackathon projects ---------- */

.pfx-hack {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
  scroll-margin-top: 70px;
  background: #fff;
  border-top: 1px solid #e6e9f0;
}

.pfx-hack::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: 7rem;
  height: 3px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--pfx-blue) 0 50%, var(--pfx-red) 50% 100%);
}

.pfx-hack__head {
  max-width: 44rem;
  margin: 0 auto clamp(2.2rem, 4vw, 3.2rem);
  text-align: center;
}

.pfx-kicker--dark {
  color: var(--pfx-blue);
}

.pfx-hack__title {
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--pfx-ink);
}

.pfx-hack__lead {
  margin: 1rem auto 0;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--pfx-muted);
}

.pfx-hack__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem;
}

.pfx-hcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e3e7ef;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 48px -36px rgba(5, 11, 26, 0.45);
  scroll-margin-top: 80px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.pfx-hcard:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 32, 159, 0.28);
  box-shadow: 0 30px 60px -36px rgba(0, 32, 159, 0.45);
}

.pfx-hcard__media {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #e3e7ef;
  background: var(--pfx-night);
  cursor: zoom-in;
  overflow: hidden;
}

.pfx-hcard__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s ease;
}

.pfx-hcard:hover .pfx-hcard__media img,
.pfx-hcard__media:focus-visible img {
  transform: scale(1.04);
}

.pfx-hcard__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.4rem 1.5rem 1.6rem;
}

.pfx-hcard__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.8rem;
  font-family: var(--pf-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pfx-hcard__num {
  color: var(--pfx-red);
}

.pfx-hcard__event {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(245, 197, 24, 0.18);
  color: #6b5200;
}

.pfx-hcard__title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--pfx-ink);
}

.pfx-hcard__text {
  flex: 1;
  margin: 0.7rem 0 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: #3a4453;
}

.pfx-hcard__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.pfx-btn--sm {
  min-height: 2.6rem;
  padding: 0 1.1rem;
  font-size: 0.92rem;
}

.pfx-btn--line {
  border-color: #d5dbe7;
  color: var(--pfx-ink);
  background: #fff;
}

.pfx-btn--line:hover,
.pfx-btn--line:focus-visible {
  border-color: var(--pfx-blue);
  color: var(--pfx-blue);
  transform: translateY(-2px);
}

/* ---------- closing CTA ---------- */

.pfx-cta {
  overflow: hidden;
  padding: clamp(4.5rem, 9vw, 7rem) 0;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(50% 70% at 50% 0%, rgba(61, 107, 255, 0.3), transparent 70%),
    var(--pfx-night);
}

.pfx-cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pfx-cta h2 {
  max-width: 20ch;
  margin: 0;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #fff;
}

.pfx-cta h2 em {
  font-style: normal;
  font-weight: 400;
  color: var(--pfx-gold);
}

.pfx-cta p:not(.pfx-kicker) {
  max-width: 34rem;
  margin: 1rem 0 0;
  color: rgba(255, 255, 255, 0.7);
}

.pfx-actions--center {
  justify-content: center;
}

/* ---------- layout ---------- */

@media (min-width: 960px) {
  .pfx-project__inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }

  .pfx-project--flip .pfx-project__media {
    order: 2;
  }
}

@media (min-width: 720px) {
  .pfx-hack__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .pfx-hack__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pfx-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .pfx-stats > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .pfx-stats > div:first-child {
    border-top: 0;
  }

  .pfx-stats dd {
    margin: 0;
    text-align: right;
    font-size: 1.4rem;
  }

  .pfx-stage {
    border-radius: 22px;
  }

  .pfx-shots {
    gap: 0.5rem;
  }

  .pfx-shot {
    border-radius: 12px;
  }

  .pfx-actions .pfx-btn {
    width: 100%;
  }

  .pfx-hcard__actions .pfx-btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pfx-stage img,
  .pfx-shot,
  .pfx-btn,
  .pfx-store,
  .pfx-hcard,
  .pfx-hcard__media img {
    transition: none;
  }

  .pfx-hcard:hover,
  .pfx-hcard:hover .pfx-hcard__media img {
    transform: none;
  }
}
