/* ===== AFTERWAVE PROJECTS PAGES (portfolio.html + project-details.html) ===== */

.pf-section { padding: 64px 0 0; }
.pf-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.pf-head h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; color: #fff; line-height: 1.15; }
.pf-head p { color: rgba(201,240,247,0.55); max-width: 520px; font-size: 0.95rem; }

/* ---------- Bento grids (8 boxes, 4 top / 4 bottom, all different sizes) ---------- */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 200px;
  gap: 16px;
}
.pf-grid.is-a > :nth-child(1) { grid-column: 1 / 6;  grid-row: 1 / 3; }
.pf-grid.is-a > :nth-child(2) { grid-column: 6 / 10; grid-row: 1; }
.pf-grid.is-a > :nth-child(3) { grid-column: 10 / 13; grid-row: 1 / 3; }
.pf-grid.is-a > :nth-child(4) { grid-column: 6 / 10; grid-row: 2; }

.pf-grid.is-b > :nth-child(1) { grid-column: 1 / 4;  grid-row: 1 / 3; }
.pf-grid.is-b > :nth-child(2) { grid-column: 4 / 8;  grid-row: 1; }
.pf-grid.is-b > :nth-child(3) { grid-column: 8 / 13; grid-row: 1 / 3; }
.pf-grid.is-b > :nth-child(4) { grid-column: 4 / 8;  grid-row: 2; }

.pf-card {
  position: relative;
  display: block;
  min-width: 0;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  background: #151628;
  border: 1px solid rgba(3,181,217,0.14);
  color: #fff;
  text-decoration: none;
}
.pf-media { position: absolute; inset: 0; z-index: -2; display: flex; align-items: center; justify-content: center; }
.pf-media img, .pf-media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.pf-card:hover .pf-media img, .pf-card:hover .pf-media video,
.pf-card:focus-visible .pf-media img, .pf-card:focus-visible .pf-media video { transform: scale(1.05); }

/* placeholder when a file is missing */
.pf-media.is-empty,
.pd-media.is-empty {
  background:
    radial-gradient(circle at 25% 20%, hsl(var(--h, 195) 80% 35% / 0.55), transparent 55%),
    linear-gradient(135deg, hsl(var(--h, 195) 55% 20%), hsl(calc(var(--h, 195) + 40) 50% 10%));
}
.pf-media.is-empty i, .pd-media.is-empty i { font-size: 2rem; color: rgba(255,255,255,0.25); }

.pf-card::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(8,9,22,0.9) 0%, rgba(8,9,22,0.35) 38%, rgba(8,9,22,0) 65%);
}
.pf-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 22px; }
.pf-cat {
  display: inline-block;
  font-size: 0.75rem; font-weight: 600; color: var(--cyan);
  background: rgba(3,181,217,0.14);
  border: 1px solid rgba(3,181,217,0.3);
  padding: 2px 10px; border-radius: 999px; margin-bottom: 6px;
}
.pf-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.1rem, 1.6vw, 1.45rem); line-height: 1.15; }
.pf-go {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--cyan); color: var(--bg-dark);
  opacity: 0; transform: translateY(-6px) scale(0.9);
  transition: opacity 0.25s, transform 0.25s;
}
.pf-card:hover .pf-go, .pf-card:focus-visible .pf-go { opacity: 1; transform: none; }
.pf-card:focus-visible, .pf-nav-btn:focus-visible, .pf-dot:focus-visible, .pd-nav a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
@media (hover: none) { .pf-go { opacity: 1; transform: none; width: 34px; height: 34px; } }

/* ---------- Website mock-up scroller ---------- */
.pf-mock {
  margin-top: 64px;
  padding: 56px 0;
  background: linear-gradient(180deg, rgba(3,181,217,0.06), rgba(3,181,217,0.02));
  border-top: 1px solid rgba(3,181,217,0.1);
  border-bottom: 1px solid rgba(3,181,217,0.1);
}
.pf-nav { display: flex; gap: 10px; }
.pf-nav-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(3,181,217,0.1); border: 1px solid rgba(3,181,217,0.35);
  color: var(--cyan); cursor: pointer; font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}
.pf-nav-btn:hover { background: var(--cyan); color: var(--bg-dark); }

.pf-viewport { position: relative; height: clamp(250px, 31vw, 400px); overflow: hidden; }
.pf-slide {
  position: absolute; top: 0; height: 100%;
  margin: 0;
  border-radius: 18px; overflow: hidden;
  background: #151628;
  border: 1px solid rgba(3,181,217,0.16);
  transition: left 0.9s cubic-bezier(0.65, 0, 0.35, 1), width 0.9s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.5s ease;
}
.pf-slide .pf-media { z-index: 0; }
.pf-slide a { position: absolute; inset: 0; z-index: 2; }
.pf-slide figcaption {
  position: absolute; left: 14px; bottom: 14px; z-index: 1;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: #fff;
  background: rgba(8,9,22,0.65); backdrop-filter: blur(6px);
  padding: 4px 14px; border-radius: 999px;
}
.pf-dots { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
.pf-dot {
  width: 8px; height: 8px; padding: 0; border: none; border-radius: 999px;
  background: rgba(201,240,247,0.25); cursor: pointer;
  transition: width 0.3s, background 0.3s;
}
.pf-dot.active { width: 26px; background: var(--cyan); }

/* ---------- Bottom call to action ---------- */
.pf-cta {
  margin: 64px 0 80px; padding: 40px 32px; text-align: center;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(3,181,217,0.14);
}
.pf-cta h2 { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2rem); color: #fff; margin-bottom: 8px; }
.pf-cta p { color: rgba(201,240,247,0.6); margin-bottom: 22px; }

/* ---------- Project details page ---------- */
.pd-layout {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 40px; align-items: start; padding: 56px 0 0;
}
.pd-media {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden;
  background: #151628; border: 1px solid rgba(3,181,217,0.14);
}
.pd-media img, .pd-media video { width: 100%; height: 100%; object-fit: contain; display: block; }
.pd-block[hidden] { display: none; }
.pd-block { margin-top: 36px; }
.pd-block h2 { font-family: var(--font-display); font-size: 1.5rem; color: #fff; margin-bottom: 10px; }
.pd-block p { color: rgba(201,240,247,0.75); line-height: 1.8; max-width: 70ch; }
.pd-results { list-style: none; display: grid; gap: 10px; }
.pd-results li { display: flex; gap: 12px; align-items: flex-start; color: rgba(201,240,247,0.8); }
.pd-results i { color: var(--cyan); margin-top: 5px; }

.pd-side {
  position: sticky; top: 110px;
  padding: 28px; border-radius: 20px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(3,181,217,0.14);
}
.pd-side h3 { font-family: var(--font-display); font-size: 1.3rem; color: #fff; margin-bottom: 18px; }
.pd-info { display: grid; gap: 16px; margin-bottom: 24px; }
.pd-info dt { font-size: 0.8rem; color: rgba(201,240,247,0.45); margin-bottom: 2px; }
.pd-info dd { color: #fff; font-weight: 500; }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-chips span {
  font-size: 0.8rem; color: var(--cyan);
  background: rgba(3,181,217,0.12); border: 1px solid rgba(3,181,217,0.28);
  padding: 2px 10px; border-radius: 999px;
}
.pd-actions { display: grid; gap: 10px; }
.pd-actions .btn { justify-content: center; width: 100%; }
.pd-actions [hidden] { display: none !important; }

.pd-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.pd-gallery .pd-media { aspect-ratio: 1 / 1; border-radius: 16px; }

.pd-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 56px 0 80px; }
.pd-nav a {
  display: block; padding: 20px 24px; border-radius: 16px; text-decoration: none;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(3,181,217,0.14);
  color: #fff; transition: border-color 0.2s, background 0.2s;
}
.pd-nav a:hover { border-color: var(--cyan); background: rgba(3,181,217,0.06); }
.pd-nav small { display: block; color: rgba(201,240,247,0.5); font-size: 0.8rem; margin-bottom: 2px; }
.pd-nav strong { font-family: var(--font-display); font-size: 1.15rem; }
.pd-nav .next { text-align: right; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 170px; grid-auto-flow: dense; }
  .pf-grid.is-a > :nth-child(n), .pf-grid.is-b > :nth-child(n) { grid-column: auto; grid-row: auto; }
  .pf-grid.is-a > :nth-child(1) { grid-column: 1 / -1; grid-row: span 2; }
  .pf-grid.is-a > :nth-child(3) { grid-row: span 2; }
  .pf-grid.is-b > :nth-child(1) { grid-row: span 2; }
  .pf-grid.is-b > :nth-child(3) { grid-column: 1 / -1; grid-row: span 2; }

  .pd-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .pd-side { position: static; }
  .pd-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .pf-section { padding-top: 48px; }
  .pf-grid { grid-auto-rows: 140px; gap: 12px; }
  .pf-info { padding: 12px 14px; }
  .pf-cat { font-size: 0.68rem; padding: 1px 8px; }
  .pf-mock { padding: 40px 0; margin-top: 48px; }
  .pf-viewport { height: 62vw; min-height: 220px; }
  .pd-nav { grid-template-columns: minmax(0, 1fr); }
  .pd-nav .next { text-align: left; }
  .pd-gallery { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .pf-slide, .pf-media img, .pf-media video, .pf-go { transition: none; }
}
