/* ═══════════════════════════════════════════════
   PORTFOLIO PAGE SPECIFIC STYLES
   Dynamiq Solutionz Ltd Design System
   ═══════════════════════════════════════════════ */

/* ── Subpage Hero ── */
.page-hero {
  position: relative;
  padding: clamp(140px, 16vw, 190px) 0 clamp(54px, 7vw, 80px);
  background: var(--canvas-alt);
  text-align: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.page-hero .hero-grid-bg {
  position: absolute;
  inset: 0;
  opacity: 0.75;
  background-image:
    linear-gradient(rgba(26, 26, 26, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 26, 26, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.page-hero::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 350px;
  background: radial-gradient(circle, rgba(201, 153, 46, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero .container {
  position: relative;
  z-index: 2;
}

.page-hero .h-xl {
  margin-bottom: 24px;
}

.page-hero .lead {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Filter Bar ── */
.portfolio-filter-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 56px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-strong);
  padding: 10px 14px;
  border-radius: 999px;
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 10px 24px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.35s var(--ease-out);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.filter-btn:hover {
  color: var(--ink);
  background: rgba(26, 26, 26, 0.04);
}

.filter-btn.active {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ── Portfolio Grid ── */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.project-card {
  background: var(--canvas);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 0.4s var(--ease-out), transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  display: flex;
  flex-direction: column;
}

.project-card.hidden {
  display: none !important;
}

.project-card:hover {
  border-color: var(--gold);
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.project-card__media {
  position: relative;
  height: 280px;
  overflow: hidden;
  background: var(--canvas-alt);
}

.project-card__media .parallax-img {
  width: 100%;
  height: 115%;
  object-fit: cover;
  position: relative;
  top: -7.5%;
  transition: transform 0.8s var(--ease-out);
}

.project-card:hover .project-card__media .parallax-img {
  transform: scale(1.06);
}

.project-card__tag {
  position: absolute;
  top: 18px;
  left: 18px;
  background: rgba(26, 26, 26, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 8px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.project-card__body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-card__location {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 8px;
}

.project-card__title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
  color: var(--ink);
}

.project-card__desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 24px;
}

.project-card__footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* ── Before / After Showcase Section ── */
.ba-section {
  background: #111111;
  color: var(--canvas);
  padding: clamp(64px, 8vw, 100px) 0;
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ba-section .eyebrow {
  color: var(--gold-light);
}

.ba-section h2 {
  color: #FFFFFF;
}

.ba-section .lead {
  color: rgba(255, 255, 255, 0.72);
}

.ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 56px;
}

.ba-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3.1;
  background: var(--ink-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ba-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ba-card__badge {
  position: absolute;
  bottom: 24px;
  left: 24px;
  background: rgba(26, 26, 26, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.ba-card__badge.before {
  color: var(--gold-light);
}

/* ── Bottom CTA ── */
.portfolio-cta {
  text-align: center;
}

.portfolio-cta__lead {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 36px;
}

/* ── Responsive Adaptations ── */
@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .portfolio-filter-bar {
    border-radius: 18px;
    padding: 10px 12px;
    max-width: 100%;
  }

  .ba-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .portfolio-filter-bar {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 12px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: 24px;
    padding-right: 24px;
    border-left: none;
    border-right: none;
  }

  .filter-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    font-size: 12px;
  }

  .project-card__media {
    height: 240px;
  }
}
/* ==========================================================================
   CASE STUDY — ZIG-ZAG TIMELINE
   Alternating Desktop Layout / Stacked Mobile Layout
   ========================================================================== */
.case-study-section {
  padding: clamp(64px, 8vw, 110px) 0;
  background: var(--canvas-alt, #F7F7F5);
  border-top: 1px solid var(--border, rgba(26, 26, 26, 0.08));
  overflow: hidden;
}

.case-study-section .sec-head {
  margin-bottom: 4rem;
}

/* ── Spine ── */
.timeline {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 27px; /* Mobile line position */
  width: 2px;
  background: linear-gradient(
    180deg,
    rgba(201, 153, 46, 0.05) 0%,
    var(--gold, #C9992E) 10%,
    var(--gold, #C9992E) 90%,
    rgba(201, 153, 46, 0.05) 100%
  );
  z-index: 0;
}

@media (min-width: 900px) {
  .timeline::before {
    left: 50%; /* Center line on desktop */
    transform: translateX(-50%);
  }
}

/* ── Item Grid ── */
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr; /* Mobile: marker left, content right */
  gap: 1.5rem;
  margin-bottom: 3.5rem;
  z-index: 1;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

@media (min-width: 900px) {
  .timeline-item {
    grid-template-columns: 1fr 60px 1fr; /* Desktop: 3 columns */
    align-items: center;
    gap: 3rem;
    margin-bottom: 5rem;
  }
}

/* ── Marker (Center Dot) ── */
.timeline-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (max-width: 899px) {
  .timeline-marker {
    padding-top: 10px; /* Align dot with mobile card top */
  }
}

.timeline-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--canvas, #ffffff);
  border: 3px solid var(--gold, #C9992E);
  box-shadow: 0 0 0 5px rgba(201, 153, 46, 0.15);
  z-index: 2;
  transition: transform 0.4s ease, background 0.4s ease;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.3);
  background: var(--gold, #C9992E);
}

.timeline-dot--final {
  background: var(--gold, #C9992E);
  box-shadow: 0 0 0 8px rgba(201, 153, 46, 0.25);
}

.timeline-num {
  margin-top: 0.6rem;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold, #C9992E);
}

/* ── Image Card ── */
.media-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 8px 24px rgba(0,0,0,0.06));
  aspect-ratio: 4 / 3;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.timeline-item:hover .media-card {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md, 0 16px 40px rgba(0,0,0,0.12));
}

.timeline-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.timeline-item:hover .timeline-img {
  transform: scale(1.05);
}

.timeline-phase {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
}

.timeline-phase--final {
  background: var(--gold, #C9992E);
  color: #111;
}

/* ── Text Card ── */
.text-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 0;
}

.timeline-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 700;
  color: var(--ink, #1A1A1A);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.timeline-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted, #5c5c5c);
  margin-bottom: 1.25rem;
}

.timeline-meta {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.timeline-meta li {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(201, 153, 46, 0.1);
  color: var(--ink, #1A1A1A);
  border: 1px solid rgba(201, 153, 46, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
}

/* ── Mobile Layout Overrides ── */
@media (max-width: 899px) {
  /* On mobile, force text to go under the image */
  .timeline-item {
    display: flex;
    flex-direction: row;
    gap: 1.25rem;
  }
  
  .timeline-marker {
    flex-shrink: 0;
    width: 56px;
  }

  /* Wrap text and image in a column on the right side */
  .timeline-item::after {
    display: none;
  }
  
  .timeline-item {
    flex-wrap: wrap;
  }
  
  /* We use CSS grid areas to stack them nicely on mobile */
  .timeline-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
    grid-template-areas: 
      "marker image"
      "marker text";
    gap: 1rem;
  }

  .timeline-marker { grid-area: marker; }
  .media-card { grid-area: image; margin-top: 5px; }
  .text-card { grid-area: text; padding-top: 0; }
  
  .media-card {
    aspect-ratio: 16 / 10;
  }
}