/**
 * PORTFOLIO PROJECT PAGE — EXCLUSIVE STYLES
 * Hero: left panel (title + gallery) | right: device mockup centered
 * Mobile: device → title → gallery → "Sobre o Projeto"
 */

/* ══════════════════════════════════════════════════════════════
   HERO — full-screen split stage
══════════════════════════════════════════════════════════════ */

.project-hero {
  position: relative;
  min-height: 100vh;
  background: #000;
  overflow: hidden;
  /* grain */
  isolation: isolate;
}

.project-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}

/* ── Vignette overlay ─────────────────────────────────────── */
.project-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,
      rgba(0,0,0,0.92) 0%,
      rgba(0,0,0,0.75) 38%,
      rgba(0,0,0,0.25) 62%,
      rgba(0,0,0,0.05) 100%),
    radial-gradient(ellipse 120% 80% at 50% 50%,
      transparent 35%,
      rgba(0,0,0,0.4) 100%);
  z-index: 3;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════
   LEFT PANEL — breadcrumb + title + gallery
══════════════════════════════════════════════════════════════ */

.project-hero-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 46%;
  height: 100%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  padding: 5.5rem 2.5rem 3rem clamp(1.5rem, 4vw, 4rem);
}

/* ── Breadcrumb ─────────────────────────────────────────── */
.project-breadcrumb { margin-bottom: 1.5rem; }

.project-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  transition: color .2s, background .2s, transform .2s;
}

.project-breadcrumb a:hover {
  color: #fff;
  background: rgba(255,255,255,0.13);
  transform: translateX(-4px);
}

/* ── Title block ────────────────────────────────────────── */
.project-hero-text { margin-bottom: 2rem; }

.project-title {
  font-size: clamp(2.6rem, 5.5vw, 5.5rem);
  font-weight: 900;
  line-height: 0.9;
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 40px rgba(0,0,0,0.6);
}

.project-subtitle {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: rgba(255,255,255,0.45);
  margin: 0 0 0.9rem;
  font-weight: 400;
  line-height: 1.5;
}

.project-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.project-category,
.project-duration {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  backdrop-filter: blur(6px);
}

/* ══════════════════════════════════════════════════════════════
   GALLERY STRIP — inside left panel
══════════════════════════════════════════════════════════════ */

.project-gallery {
  flex: 1;               /* fills remaining height in left panel */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.75rem;
  min-height: 0;         /* allow flex child to shrink */
  padding-bottom: 0.5rem;
}

/* scrollable track */
.gallery-track {
  display: flex;
  gap: 10px;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  /* hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track.dragging { cursor: grabbing; scroll-snap-type: none; }

/* individual item */
.gallery-item {
  flex-shrink: 0;
  width: clamp(400px, 18vw, 600px);
  height: clamp(18rem, 13vw, 145px);
  border-radius: 8px;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid rgba(255,255,255,0.1);
  /* staggered appear */
  opacity: 0;
  transform: translateY(10px);
  animation: galleryItemIn 0.45s cubic-bezier(0.16,1,0.3,1) forwards;
  animation-delay: calc(var(--i) * 0.07s + 0.3s);
}

@keyframes galleryItemIn {
  to { opacity: 1; transform: translateY(0); }
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.75) saturate(0.85);
  transition: filter 0.35s, transform 0.35s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none;
}

.gallery-track:not(.dragging) .gallery-item:hover img {
  filter: brightness(1) saturate(1.05);
  transform: scale(1.05);
}

/* dot indicators */
.gallery-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.gallery-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s, width 0.25s;
}

.gallery-dot.active {
  background: #fff;
  width: 16px;
  border-radius: 3px;
  transform: none;
}

/* ══════════════════════════════════════════════════════════════
   DEVICE MOCKUP WRAPPER — centered on right side
══════════════════════════════════════════════════════════════ */

.device-mockup-wrapper {
  position: absolute;
  top: 50%;
  /* push to the right half */
  left: 62%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* Mover mais para a direita quando for horizontal */
.device-mockup-wrapper:has(.device-mockup--horizontal) {
  left: 71%;
}
@media screen and (max-width: 768px) {
  .device-mockup-wrapper:has(.device-mockup--horizontal) {
    left: 0;
  }
}
/* ── VERTICAL (phone 9:16) ─────────────────────────────── */
.device-mockup--vertical {
  width: clamp(200px, 22vw, 310px);
  background: linear-gradient(160deg, #1c1c1e 0%, #0a0a0a 100%);
  border-radius: 44px;
  padding: 13px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 0 0 13px #111,
    0 0 0 14px rgba(255,255,255,0.04),
    0 40px 80px rgba(0,0,0,0.7),
    0 10px 30px rgba(0,0,0,0.5);
  animation: float-device 7s ease-in-out infinite;
}

.device-mockup--vertical::before {
  content: '';
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 88px; height: 26px;
  background: #000;
  border-radius: 18px;
  z-index: 10;
  pointer-events: none;
}

.device-mockup--vertical::after {
  content: '';
  position: absolute;
  top: 19px; left: 50%;
  transform: translateX(-50%) translateX(26px);
  width: 8px; height: 8px;
  background: radial-gradient(circle, #2a5bbd, #1a3d8a);
  border-radius: 50%;
  z-index: 11;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(74,144,226,0.4);
}

.device-mockup--vertical .device-screen {
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  padding-top: 177.78%; /* 9:16 */
  background: #000;
}

/* ── HORIZONTAL (cinema 16:9) ──────────────────────────── */
.device-mockup--horizontal {
  width: clamp(420px, 48vw, 800px);
  background: linear-gradient(160deg, #141414 0%, #080808 100%);
  border-radius: 16px;
  padding: 16px 16px 42px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 0 11px #0d0d0d,
    0 0 0 12px rgba(255,255,255,0.03),
    0 40px 80px rgba(0,0,0,0.7),
    0 10px 30px rgba(0,0,0,0.4);
  animation: float-device 8s ease-in-out infinite;
  animation-delay: -2s;
}

.device-mockup--horizontal::before {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 50px; height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  pointer-events: none;
}

.device-mockup--horizontal::after {
  content: '⬤';
  position: absolute;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: rgba(255,255,255,0.1);
  pointer-events: none;
}

.device-mockup--horizontal .device-screen {
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
}

/* viewfinder corners */
.device-mockup--horizontal .device-screen::before,
.device-mockup--horizontal .device-screen::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  z-index: 10;
  pointer-events: none;
}
.device-mockup--horizontal .device-screen::before {
  top: 7px; left: 7px;
  border-top: 2px solid rgba(255,255,255,0.28);
  border-left: 2px solid rgba(255,255,255,0.28);
}
.device-mockup--horizontal .device-screen::after {
  bottom: 7px; right: 7px;
  border-bottom: 2px solid rgba(255,255,255,0.28);
  border-right: 2px solid rgba(255,255,255,0.28);
}

/* shared iframe */
.device-screen iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
  pointer-events: auto;
  z-index: 1;
}

/* shared float animation */
@keyframes float-device {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.device-mockup--vertical:hover,
.device-mockup--horizontal:hover { animation-play-state: paused; }

/* ══════════════════════════════════════════════════════════════
   PROJECT DETAILS SECTION
══════════════════════════════════════════════════════════════ */

.project-details {
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.015) 0%, transparent 50%),
    var(--color-background);
  position: relative;
}

.project-details::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.project-details-grid {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xl);
  align-items: start;
}

.project-info h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin-bottom: var(--spacing-md);
  color: var(--color-primary);
  font-weight: 700;
  position: relative;
  padding-bottom: var(--spacing-sm);
}

.project-info h2::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 50px; height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.55), transparent);
  border-radius: 1px;
}

.project-description {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--color-text);
  margin-bottom: var(--spacing-xl);
}

.project-services, .project-tech { margin-bottom: var(--spacing-xl); }

.project-services h3, .project-tech h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: var(--spacing-sm);
  color: var(--color-primary);
}

.services-list {
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.services-list li {
  color: var(--color-text);
  font-size: 0.97rem;
  padding: 0.65rem 1rem;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid rgba(255,255,255,0.14);
  border-radius: 3px;
  transition: background .18s, border-color .18s, transform .18s;
}
.services-list li:hover {
  background: rgba(255,255,255,0.055);
  border-left-color: rgba(255,255,255,0.5);
  transform: translateX(4px);
}

.tech-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tech-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.68);
  transition: background .18s, border-color .18s, transform .18s, box-shadow .18s;
  cursor: default;
}
.tech-item:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
/* 
/* ══════════════════════════════════════════════════════════════
   RELATED PROJECTS
══════════════════════════════════════════════════════════════ */

.related-projects {
  padding: var(--spacing-xxl) 0;
  background: linear-gradient(180deg, var(--color-background) 0%, var(--color-surface) 100%);
  position: relative;
}
.related-projects::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}
.related-projects .section-title { margin-bottom: var(--spacing-xl); }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.related-card {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  display: block;
  text-decoration: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  transition: transform .35s cubic-bezier(0.16,1,0.3,1), border-color .25s, box-shadow .35s;
}
.related-card:hover { transform: translateY(-8px); border-color: rgba(255,255,255,0.18); box-shadow: 0 14px 40px rgba(0,0,0,0.4); }

.related-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(100%) brightness(0.65);
  transition: transform .5s cubic-bezier(0.16,1,0.3,1), filter .4s;
}
.related-card:hover img { transform: scale(1.07); filter: grayscale(0%) brightness(0.92); }

.related-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 1.4rem 1.2rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.45) 55%, transparent 100%);
  color: #fff; z-index: 2;
  transform: translateY(4px); opacity: 0.85;
  transition: opacity .25s, transform .25s;
}
.related-card:hover .related-overlay { opacity: 1; transform: translateY(0); }
.related-name { font-weight: 800; font-size: 1.3rem; margin: 0 0 0.2rem; letter-spacing: .01em; text-transform: uppercase; }
.related-sub  { font-size: 0.75rem; color: rgba(255,255,255,0.5); margin: 0; text-transform: uppercase; letter-spacing: .06em; }

.related-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.related-placeholder-title { font-size: 2.5rem; font-weight: 900; color: #fff; opacity: .1; letter-spacing: .1em; text-transform: uppercase; }

/* ══════════════════════════════════════════════════════════════
   SCROLL REVEAL
══════════════════════════════════════════════════════════════ */

.pp-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s cubic-bezier(0.16,1,0.3,1), transform .65s cubic-bezier(0.16,1,0.3,1);
  transition-delay: var(--reveal-delay, 0s);
}
.pp-reveal.pp-visible { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════════════════════════════
   BACK BUTTON
══════════════════════════════════════════════════════════════ */

.back-to-home {
  position: fixed;
  top: 1.25rem; left: 1.5rem;
  z-index: 100;
}
.back-to-home .btn {
  font-size: 0.72rem;
  letter-spacing: .08em;
  padding: 0.5rem 0.9rem;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(12px);
  color: rgba(255,255,255,0.65);
  transition: color .2s, background .2s, border-color .2s;
}
.back-to-home .btn:hover { color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   Layout: device (top of hero) → title → gallery → details
══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Hero becomes a normal flex column */
  .project-hero {
    min-height: auto;
    display: flex;
    flex-direction: column;
    padding-top: 4.5rem; /* space for fixed back btn */
  }

  /* Override: vignette goes full horizontal on mobile */
  .project-hero-overlay {
    background:
      linear-gradient(to bottom,
        rgba(0,0,0,0.55) 0%,
        rgba(0,0,0,0.1) 40%,
        rgba(0,0,0,0.75) 100%);
  }

  /* Device mockup: exit absolute, stack first */
  .device-mockup-wrapper {
    position: relative;
    top: auto; left: auto;
    transform: none;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 1.5rem 1rem 2rem;
    order: 1;
    z-index: 2;
  }

  .device-mockup--vertical  { width: clamp(170px, 55vw, 260px); }
  .device-mockup--horizontal { width: 90vw; left: 100rem;}

  /* Left panel: exit absolute, stack below device */
  .project-hero-left {
    position: relative;
    width: 100%;
    height: auto;
    order: 2;
    padding: 0 1.25rem 2.5rem;
    background: transparent;
  }

  .project-title { font-size: clamp(2.2rem, 10vw, 3.5rem); }
  .project-hero-text { margin-bottom: 1.5rem; }

  /* Gallery full width on mobile */
  .project-gallery { flex: none; }

  .gallery-item {
    width: clamp(140px, 42vw, 200px);
    height: clamp(95px, 28vw, 140px);
  }

  /* Details grid → single column */
  .project-details-grid { grid-template-columns: 1fr; gap: var(--spacing-lg); }
  .cta-card { position: static; }
  .related-grid { grid-template-columns: 1fr; }
  .project-meta { gap: 0.4rem; }

  .back-to-home { top: 0.75rem; left: 0.75rem; }
}

/* ══════════════════════════════════════════════════════════════
   REDUCED MOTION
══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .gallery-item { opacity: 1; transform: none; }
}