/* ==========================================================================
   Macaw Bytes - Portfolio listing (corporate dark mood)
   Extends home.css tokens via body.page-portfolio
   ========================================================================== */

/* Hero */
.pf-hero {
  position: relative;
  min-height: min(68svh, 580px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(7rem, 14vw, 9.5rem) 0 clamp(3.5rem, 7vw, 5rem);
  overflow: hidden;
  border-bottom: 1px solid var(--home-line);
  background:
    linear-gradient(165deg, #0a1218 0%, #0b0d10 45%, #0c1410 100%);
}

.pf-hero__glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 50% at 12% 20%, rgba(74, 168, 224, 0.28), transparent 62%),
    radial-gradient(ellipse 48% 45% at 90% 18%, rgba(46, 174, 78, 0.22), transparent 60%),
    radial-gradient(ellipse 40% 35% at 48% 95%, rgba(240, 180, 41, 0.12), transparent 55%);
}

.pf-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 52rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pf-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.15rem, 4.8vw, 3.45rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--home-ink);
  margin: 0.65rem auto 1.15rem;
  max-width: 16ch;
}

.pf-hero__lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.65;
  color: var(--home-muted);
  max-width: 42rem;
  margin: 0 auto 1.75rem;
}

.pf-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Grid */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.pf-card {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid var(--home-line);
  background: var(--home-surface);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.pf-card:hover {
  border-color: rgba(74, 168, 224, 0.4);
  transform: translateY(-2px);
}

.pf-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0b0d10;
}

.pf-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.pf-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 60% 50% at 30% 40%, rgba(74, 168, 224, 0.2), transparent 60%),
    radial-gradient(ellipse 50% 45% at 80% 70%, rgba(46, 174, 78, 0.15), transparent 55%),
    #14181e;
}

.pf-card__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(11, 13, 16, 0.55) 100%);
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.pf-card:hover .pf-card__media img {
  transform: scale(1.04);
}

.pf-card:hover .pf-card__shade {
  opacity: 0.9;
}

.pf-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.3rem 1.35rem;
}

.pf-card__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.pf-card__meta {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--home-green);
}

.pf-card__index {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--home-blue);
  opacity: 0.85;
}

body.page-portfolio .home-section .pf-card__title,
.home-section .pf-card__title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin: 0 0 0.5rem;
  max-width: none;
}

.pf-card__title a {
  color: var(--home-ink) !important;
  text-decoration: none;
}

.pf-card__title a:hover {
  color: var(--home-green) !important;
}

.pf-card__desc {
  margin: 0 0 0.95rem;
  color: var(--home-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pf-card__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
}

.pf-metric {
  font-size: 0.75rem;
  color: var(--home-muted);
  border: 1px solid var(--home-line);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  background: rgba(11, 13, 16, 0.45);
}

.pf-metric b {
  color: var(--home-ink);
  font-weight: 600;
}

.pf-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--home-green) !important;
  text-decoration: none;
}

.pf-card__link:hover {
  color: var(--home-accent-hover) !important;
}

.pf-card__link i {
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.pf-card:hover .pf-card__link i {
  transform: translateX(3px);
}

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

  .pf-hero h1 {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .pf-hero {
    min-height: auto;
    padding-top: 6.5rem;
  }

  .pf-hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .pf-grid {
    grid-template-columns: 1fr;
  }

  body.page-portfolio .home-section .pf-card__title,
  .home-section .pf-card__title {
    font-size: 0.95rem;
    max-width: none;
  }

  .pf-card:hover {
    transform: none;
  }

  .pf-card:hover .pf-card__media img {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-card,
  .pf-card__media img,
  .pf-card__shade,
  .pf-card__link i {
    transition: none;
  }

  .pf-card:hover,
  .pf-card:hover .pf-card__media img,
  .pf-card:hover .pf-card__link i {
    transform: none;
  }
}
