/* ============================================================
   Portfolio Widgets — Shared Stylesheet
   Scoped under .pfw-* prefix to avoid theme conflicts
   ============================================================ */

:root {
  --pfw-bg:             #0f172a;
  --pfw-text-primary:   #f8fafc;
  --pfw-text-secondary: #94a3b8;
  --pfw-accent-1:       #3b82f6;
  --pfw-accent-2:       #8b5cf6;
  --pfw-glass-bg:       rgba(30, 41, 59, 0.7);
  --pfw-glass-border:   rgba(255, 255, 255, 0.1);
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes pfw-gradient-xy {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}
@keyframes pfw-float {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-20px); }
  100% { transform: translateY(0px); }
}

/* ── Shared Section ─────────────────────────────────────────── */
.pfw-section {
  background-color: var(--pfw-bg);
  color: var(--pfw-text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  padding: 5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.pfw-section *, .pfw-section *::before, .pfw-section *::after {
  box-sizing: border-box;
}

.pfw-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ── Glass Panel ────────────────────────────────────────────── */
.pfw-glass {
  background: var(--pfw-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--pfw-glass-border);
  border-radius: 1.5rem;
  padding: 3rem 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  margin: 0 auto;
}

/* ── Section Title ──────────────────────────────────────────── */
.pfw-section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin: 0 0 3rem;
  color: var(--pfw-text-primary) !important;
  position: relative;
}
.pfw-section-title::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 4px;
  background: linear-gradient(90deg, var(--pfw-accent-1), var(--pfw-accent-2));
  border-radius: 2px;
}

/* ── Scroll Fade-up Animation ───────────────────────────────── */
.pfw-fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.pfw-fade-up.pfw-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   HERO WIDGET
   ============================================================ */
.pfw-hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.pfw-hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  animation: pfw-float 8s ease-in-out infinite;
}
.pfw-hero .pfw-container {
  position: relative;
  z-index: 1;
}
.pfw-hero-title {
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 1.5rem;
  text-align: center;
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pfw-gradient-xy 5s ease infinite;
}
.pfw-hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--pfw-text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
  line-height: 1.7;
}
.pfw-cta-btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff !important;
  background: linear-gradient(135deg, var(--pfw-accent-1) 0%, var(--pfw-accent-2) 100%);
  border-radius: 9999px;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 10px 20px -10px rgba(139, 92, 246, 0.5);
}
.pfw-cta-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 20px 25px -5px rgba(139, 92, 246, 0.45);
  color: #fff !important;
}

/* ============================================================
   SKILLS WIDGET
   ============================================================ */
.pfw-skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}
.pfw-skill-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--pfw-glass-border);
  padding: 0.7rem 1.4rem;
  border-radius: 9999px;
  font-weight: 500;
  color: var(--pfw-text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  cursor: default;
}
.pfw-skill-badge:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   PROJECTS WIDGET
   ============================================================ */
.pfw-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.pfw-project-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: block;
  text-decoration: none;
}
.pfw-project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #1e293b;
}
.pfw-project-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}
.pfw-project-card:hover .pfw-project-img {
  transform: scale(1.08);
}
.pfw-project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem;
}
.pfw-project-card:hover .pfw-project-overlay {
  opacity: 1;
}
.pfw-project-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--pfw-text-primary) !important;
  transform: translateY(18px);
  transition: transform 0.4s ease;
}
.pfw-project-desc {
  font-size: 0.9rem;
  color: var(--pfw-text-secondary);
  margin: 0;
  transform: translateY(18px);
  transition: transform 0.4s ease 0.08s;
}
.pfw-project-card:hover .pfw-project-title,
.pfw-project-card:hover .pfw-project-desc {
  transform: translateY(0);
}

/* ============================================================
   CONTACT WIDGET
   ============================================================ */
.pfw-contact .pfw-glass {
  max-width: 640px;
}
.pfw-contact-email {
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--pfw-text-primary) !important;
  text-decoration: none;
  display: inline-block;
  margin: 1.5rem 0;
  position: relative;
}
.pfw-contact-email::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--pfw-accent-1);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s ease;
}
.pfw-contact-email:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
.pfw-social-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.pfw-social-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--pfw-glass-border);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--pfw-text-primary) !important;
  text-decoration: none;
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.pfw-social-btn:hover {
  background: var(--pfw-accent-1);
  border-color: var(--pfw-accent-1);
  transform: translateY(-5px) rotate(8deg);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.45);
  color: #fff !important;
}

/* ============================================================
   CASE STUDY WIDGET
   ============================================================ */
.pfw-casestudy .pfw-glass {
  max-width: 1000px;
  padding: 0; /* Let the internal grid handle padding */
  overflow: hidden;
}

.pfw-casestudy-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  min-height: 500px;
}

.pfw-casestudy-image-col {
  position: relative;
  overflow: hidden;
  background: #1e293b;
}

.pfw-casestudy-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.pfw-casestudy-card:hover .pfw-casestudy-img {
  transform: scale(1.05);
}

.pfw-casestudy-content-col {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pfw-casestudy-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  color: var(--pfw-text-primary);
}

.pfw-casestudy-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pfw-casestudy-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.pfw-casestudy-info-item h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--pfw-text-secondary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

.pfw-casestudy-info-item p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--pfw-text-primary);
  margin: 0;
}

.pfw-casestudy-results h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--pfw-text-secondary);
  margin-bottom: 1rem;
}

.pfw-casestudy-results-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.pfw-casestudy-results-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  color: var(--pfw-text-primary);
}

.pfw-result-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pfw-casestudy-footer {
  margin-top: auto;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 991px) {
  .pfw-casestudy-grid {
    grid-template-columns: 1fr;
  }
  .pfw-casestudy-image-col {
    aspect-ratio: 16 / 9;
  }
  .pfw-casestudy-content-col {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .pfw-casestudy-info-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .pfw-section {
    padding: 4rem 1.25rem;
  }
  .pfw-glass {
    padding: 2rem 1.5rem;
  }
  .pfw-hero-title {
    font-size: 2.25rem;
  }
  .pfw-projects-grid {
    grid-template-columns: 1fr;
  }
}

