/* ═══ Projects Page ═══ */

#projects-hero {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 40px 60px;
  position: relative;
  overflow: hidden;/* ── Card action row ─────────────────────────────── */
.proj-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Demo link button */
.proj-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid rgba(212,175,55,0.28);
  background: rgba(212,175,55,0.07);
  color: #D4AF37;
  font-size: 0.83rem;
  font-family: 'Assistant', sans-serif;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
  flex: 1;
  justify-content: center;
}

.proj-link:hover {
  background: rgba(212,175,55,0.16);
  border-color: rgba(212,175,55,0.55);
  color: #F5E6A3;
  transform: translateY(-1px);
}

/* Info button */
.proj-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted, #8892a4);
  font-size: 0.83rem;
  font-family: 'Assistant', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
  flex: 1;
  justify-content: center;
}

.proj-info-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.20);
  color: #fff;
  transform: translateY(-1px);
}

.proj-info-btn-icon {
  font-size: 0.72rem;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
}

.proj-info-btn:hover .proj-info-btn-icon {
  opacity: 1;
  transform: rotate(90deg);
}

/* ═══ Project Info Modal — Premium Redesign ═══ */

#piModal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#piModal.pi-open {
  opacity: 1;
  pointer-events: all;
}

#piModal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 3, 6, 0.92);
  backdrop-filter: blur(14px);
  cursor: pointer;
}

#piModal-window {
  position: relative;
  z-index: 1;
  width: 94vw;
  max-width: 1080px;
  max-height: 88vh;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: #0b0e14;
  border: 1px solid rgba(212,175,55,0.16);
  box-shadow:
    0 50px 120px rgba(0,0,0,0.85),
    0 0 0 1px rgba(212,175,55,0.06),
    inset 0 1px 0 rgba(255,255,255,0.04);
  transform: translateY(30px) scale(0.96);
  transition: transform 0.42s cubic-bezier(0.34,1.56,0.64,1);
}

#piModal.pi-open #piModal-window {
  transform: translateY(0) scale(1);
}

#piModal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  background: rgba(10,10,14,0.75);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.55);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  backdrop-filter: blur(6px);
}

#piModal-close:hover {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.40);
  color: #fff;
}

/* ── Gallery panel ─────────────────────────────── */
#piModal-gallery {
  position: relative;
  background: #070910;
  overflow: hidden;
  min-height: 400px;
}

/* Subtle gold gradient overlay at bottom */
#piModal-gallery::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(7,9,16,0.85), transparent);
  pointer-events: none;
  z-index: 2;
}

#piModal-slides-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#piModal-slides {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.65,0,0.35,1);
  will-change: transform;
}

#piModal-slides img {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

#piModal-slides .pi-slide-placeholder {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0d1117, #070910);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  opacity: 0.2;
}

/* Arrows */
.pi-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(7,9,16,0.70);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212,175,55,0.20);
  color: rgba(255,255,255,0.80);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
  z-index: 5;
}

.pi-arrow:hover {
  background: rgba(212,175,55,0.20);
  border-color: rgba(212,175,55,0.50);
  color: #F5E6A3;
  transform: translateY(-50%) scale(1.08);
}

.pi-arrow-prev { left: 14px; }
.pi-arrow-next { right: 14px; }

/* Dots */
#piModal-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 6;
}

.pi-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.25s, width 0.25s;
}

.pi-dot.pi-dot-active {
  background: #D4AF37;
  transform: scale(1.4);
  width: 18px;
  border-radius: 4px;
}

/* ── Content panel ─────────────────────────────── */
#piModal-content {
  padding: 32px 28px 32px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  direction: rtl;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,55,0.20) transparent;
  background: linear-gradient(180deg, #0e111a 0%, #0b0e14 100%);
}

#piModal-content::-webkit-scrollbar { width: 4px; }
#piModal-content::-webkit-scrollbar-thumb {
  background: rgba(212,175,55,0.20);
  border-radius: 4px;
}

/* Category chip */
#piModal-category {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #D4AF37;
  text-transform: uppercase;
  padding: 4px 12px;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.18);
  border-radius: 50px;
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 14px;
}

#piModal-title {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin: 0 0 12px;
}

#piModal-desc {
  font-size: 0.88rem;
  color: rgba(200,208,220,0.75);
  line-height: 1.78;
  margin: 0 0 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
}

/* Sections */
.pi-section {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.055);
}

.pi-section:last-of-type {
  border-bottom: none;
}

.pi-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: rgba(160,170,190,0.70);
  text-transform: uppercase;
  margin-bottom: 10px;
}

#piModal-problem {
  font-size: 0.86rem;
  color: rgba(200,208,220,0.72);
  line-height: 1.75;
  margin: 0;
}

#piModal-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

#piModal-features li {
  font-size: 0.85rem;
  color: rgba(220,228,240,0.88);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.55;
}

#piModal-features li::before {
  content: '▸';
  color: #D4AF37;
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 0.75rem;
}

#piModal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pi-tech-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  background: rgba(212,175,55,0.07);
  border: 1px solid rgba(212,175,55,0.18);
  color: rgba(212,175,55,0.90);
  letter-spacing: 0.3px;
}

/* CTA */
.pi-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  padding: 13px 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(212,175,55,0.20), rgba(212,175,55,0.09));
  border: 1px solid rgba(212,175,55,0.38);
  color: #F5E6A3;
  font-size: 0.93rem;
  font-family: 'Assistant', sans-serif;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  align-self: stretch;
  letter-spacing: 0.3px;
}

.pi-cta-btn:hover {
  background: linear-gradient(135deg, rgba(212,175,55,0.33), rgba(212,175,55,0.16));
  border-color: rgba(212,175,55,0.65);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(212,175,55,0.15);
}

/* ═══ Responsive ═══ */

@media (max-width: 900px) {
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  #all-projects { padding: 20px 24px 60px; }
}

@media (max-width: 760px) {
  #piModal-window {
    grid-template-columns: 1fr;
    grid-template-rows: 240px 1fr;
    max-height: 94dvh;
    border-radius: 18px 18px 0 0;
    align-self: flex-end;
    width: 100vw;
    max-width: 100vw;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  #piModal { align-items: flex-end; }

  #piModal-content {
    padding: 22px 18px 28px;
  }

  .proj-actions { flex-direction: column; }
}

@media (max-width: 560px) {
  .proj-grid { grid-template-columns: 1fr; }
  #projects-hero { padding: 120px 24px 40px; }
}
  text-align: center;
}

#all-projects {
  padding: 20px 40px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

#projects-cta {
  padding: 40px 24px 100px;
}

/* Grid */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 40px;
}

/* Card */
.proj-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.proj-card:hover {
  transform: translateY(-6px);
  border-color: rgba(212,175,55,0.35);
}

/* Image */
.proj-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg3);
}

.proj-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.proj-card:hover .proj-img {
  transform: scale(1.04);
}

/* Placeholder when no image */
.proj-img-wrap:not(:has(img[src])),
.proj-img[src=""] {
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
}

.proj-img-overlay {
  position: absolute;
  bottom: 10px;
  right: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 10;
}

.proj-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(8,8,8,0.80);
  backdrop-filter: blur(6px);
  border: 1px solid var(--glass-border);
  color: var(--blue);
}

/* Body */
.proj-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.proj-category {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--blue);
  text-transform: uppercase;
}

.proj-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.proj-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

/* Stats */
.proj-stats {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  flex-wrap: wrap;
}

.proj-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.proj-stat-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--green);
}

.proj-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Tab visibility */
.proj-tab-content { display: block; }
.proj-tab-hidden  { display: none; }

/* ── Demo link button (single merged definition) ─────── */
/* FIX: was defined twice with conflicting rules — merged into one */
.proj-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid rgba(212,175,55,0.20);
  background: rgba(212,175,55,0.06);
  color: var(--blue);
  font-size: 0.85rem;
  font-family: 'Assistant', sans-serif;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.proj-link:hover {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.45);
  color: #F5E6A3;
}

/* ── "פרטים נוספים" button ───────────────────────────── */
.proj-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted, #8892a4);
  font-size: 0.85rem;
  font-family: 'Assistant', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
}

.proj-info-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.22);
  color: #fff;
  transform: translateY(-1px);
}

.proj-info-btn-icon {
  font-size: 0.75rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.proj-info-btn:hover .proj-info-btn-icon {
  opacity: 1;
}

@media (max-width: 480px) {
  .proj-info-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ═══ Project Demo Modal (iframe) ═══ */

#projectModal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#projectModal.pm-open {
  opacity: 1;
  pointer-events: all;
}

#projectModal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 4, 0.88);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

/* App Window */
#projectModal-window {
  position: relative;
  z-index: 1;
  width: 92vw;
  max-width: 1100px;
  height: 88vh;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg2, #0d1117);
  border: 1px solid rgba(212,175,55,0.12);
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,175,55,0.05);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#projectModal.pm-open #projectModal-window {
  transform: translateY(0) scale(1);
}

/* Title Bar */
#projectModal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 44px;
  background: rgba(212,175,55,0.03);
  border-bottom: 1px solid rgba(212,175,55,0.08);
  flex-shrink: 0;
}

#projectModal-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

#projectModal-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(212,175,55,0.15);
}

#projectModal-dots span:nth-child(1) { background: #ff5f57; }
#projectModal-dots span:nth-child(2) { background: #febc2e; }
#projectModal-dots span:nth-child(3) { background: #28c840; }

#projectModal-title {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #8892a4);
  letter-spacing: 0.5px;
}

#projectModal-close {
  background: none;
  border: none;
  color: var(--text-muted, #8892a4);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
  flex-shrink: 0;
}

#projectModal-close:hover {
  background: rgba(212,175,55,0.08);
  color: var(--text, #fff);
}

/* Spinner */
#projectModal-spinner {
  position: absolute;
  inset: 44px 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg2, #0d1117);
  z-index: 2;
  transition: opacity 0.3s ease;
}

#projectModal-spinner p {
  font-size: 0.85rem;
  color: var(--text-muted, #8892a4);
}

.pm-spinner-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(212,175,55,0.10);
  border-top-color: var(--blue, #D4AF37);
  animation: pm-spin 0.8s linear infinite;
}

@keyframes pm-spin {
  to { transform: rotate(360deg); }
}

#projectModal-spinner.pm-hidden {
  opacity: 0;
  pointer-events: none;
}

/* iFrame */
#projectModal-iframe {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
  background: transparent;
}

@media (max-width: 600px) {
  #projectModal-window {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
}

/* ═══ Project Info Modal ═══ */

#piModal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#piModal.pi-open {
  opacity: 1;
  pointer-events: all;
}

#piModal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4,4,4,0.90);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

#piModal-window {
  position: relative;
  z-index: 1;
  width: 94vw;
  max-width: 1060px;
  max-height: 90vh;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg2, #0d1117);
  border: 1px solid rgba(212,175,55,0.14);
  box-shadow: 0 40px 100px rgba(0,0,0,0.75), 0 0 0 1px rgba(212,175,55,0.06);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.38s cubic-bezier(0.34,1.56,0.64,1);
}

#piModal.pi-open #piModal-window {
  transform: translateY(0) scale(1);
}

#piModal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  background: rgba(220,50,50,0.18);
  border: 1px solid rgba(220,50,50,0.45);
  color: #ff6b6b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

#piModal-close:hover {
  background: rgba(220,50,50,0.35);
  border-color: rgba(220,50,50,0.75);
  color: #fff;
}

/* Gallery */
#piModal-gallery {
  position: relative;
  background: var(--bg3, #080b10);
  overflow: hidden;
  min-height: 360px;
}

#piModal-slides-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#piModal-slides {
  display: flex;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.65,0,0.35,1);
  will-change: transform;
}

#piModal-slides img {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

#piModal-slides .pi-slide-placeholder {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg2, #0d1117), var(--bg3, #080b10));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  opacity: 0.3;
}

/* Arrows */
.pi-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(8,8,8,0.65);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(212,175,55,0.18);
  color: rgba(255,255,255,0.85);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  z-index: 5;
  line-height: 1;
}

.pi-arrow:hover {
  background: rgba(212,175,55,0.22);
  border-color: rgba(212,175,55,0.45);
  color: #F5E6A3;
}

.pi-arrow-prev { left: 12px; }
.pi-arrow-next { right: 12px; }

/* Dots */
#piModal-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 5;
}

.pi-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.25s;
}

.pi-dot.pi-dot-active {
  background: var(--blue, #D4AF37);
  transform: scale(1.35);
}

/* Content panel */
#piModal-content {
  padding: 36px 32px 36px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  direction: rtl;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,55,0.25) transparent;
}

#piModal-content::-webkit-scrollbar { width: 5px; }
#piModal-content::-webkit-scrollbar-thumb {
  background: rgba(212,175,55,0.25);
  border-radius: 4px;
}

#piModal-category {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--blue, #D4AF37);
  text-transform: uppercase;
}

#piModal-title {
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 800;
  color: var(--text, #fff);
  line-height: 1.35;
  margin: 0;
}

#piModal-desc {
  font-size: 0.9rem;
  color: var(--text-muted, #8892a4);
  line-height: 1.75;
  margin: 0;
}

.pi-section {
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.pi-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted, #8892a4);
  text-transform: uppercase;
  margin-bottom: 10px;
}

#piModal-problem {
  font-size: 0.88rem;
  color: var(--text-muted, #8892a4);
  line-height: 1.7;
  margin: 0;
}

#piModal-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#piModal-features li {
  font-size: 0.87rem;
  color: var(--text, #e8eaf0);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.55;
}

#piModal-features li::before {
  content: '▸';
  color: var(--blue, #D4AF37);
  flex-shrink: 0;
  margin-top: 1px;
}

#piModal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pi-tech-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.20);
  color: var(--blue, #D4AF37);
  letter-spacing: 0.4px;
}

.pi-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(212,175,55,0.18), rgba(212,175,55,0.08));
  border: 1px solid rgba(212,175,55,0.35);
  color: #F5E6A3;
  font-size: 0.95rem;
  font-family: 'Assistant', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  align-self: flex-start;
}

.pi-cta-btn:hover {
  background: linear-gradient(135deg, rgba(212,175,55,0.30), rgba(212,175,55,0.14));
  border-color: rgba(212,175,55,0.60);
  transform: translateY(-2px);
}

/* ═══ Responsive Design ═══ */

@media (max-width: 900px) {
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  #all-projects { padding: 20px 24px 60px; }
}

@media (max-width: 760px) {
  #piModal-window {
    grid-template-columns: 1fr;
    grid-template-rows: 260px 1fr;
    max-height: 92dvh;/* ── Card action row ─────────────────────────────── */
.proj-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.proj-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid rgba(212,175,55,0.28);
  background: rgba(212,175,55,0.07);
  color: #D4AF37;
  font-size: 0.83rem;
  font-family: 'Assistant', sans-serif;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
  flex: 1;
  justify-content: center;
}

.proj-link:hover {
  background: rgba(212,175,55,0.16);
  border-color: rgba(212,175,55,0.55);
  color: #F5E6A3;
  transform: translateY(-1px);
}

.proj-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted, #8892a4);
  font-size: 0.83rem;
  font-family: 'Assistant', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
  flex: 1;
  justify-content: center;
}

.proj-info-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.20);
  color: #fff;
  transform: translateY(-1px);
}

.proj-info-btn-icon {
  font-size: 0.72rem;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
}

.proj-info-btn:hover .proj-info-btn-icon {
  opacity: 1;
  transform: rotate(90deg);
}
    border-radius: 14px 14px 0 0;
    align-self: flex-end;
    width: 100vw;
    max-width: 100vw;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }


  /* ── Card action row ─────────────────────────────── */
.proj-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.proj-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid rgba(212,175,55,0.28);
  background: rgba(212,175,55,0.07);
  color: #D4AF37;
  font-size: 0.83rem;
  font-family: 'Assistant', sans-serif;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
  flex: 1;
  justify-content: center;
}

.proj-link:hover {
  background: rgba(212,175,55,0.16);
  border-color: rgba(212,175,55,0.55);
  color: #F5E6A3;
  transform: translateY(-1px);
}

.proj-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted, #8892a4);
  font-size: 0.83rem;
  font-family: 'Assistant', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
  flex: 1;
  justify-content: center;
}

.proj-info-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.20);
  color: #fff;
  transform: translateY(-1px);
}

.proj-info-btn-icon {
  font-size: 0.72rem;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
}

.proj-info-btn:hover .proj-info-btn-icon {
  opacity: 1;
  transform: rotate(90deg);
}

  #piModal {
    align-items: flex-end;
  }

  #piModal-content {
    padding: 24px 20px 32px;
  }
}


/* ══ Card image hover effect ══════════════════════════ */

/* Thumbnails data — set via inline style on .proj-img-wrap */
/* Usage: style="--t1:url(...); --t2:url(...); --t3:url(...);" */

.proj-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg3);
}

/* Main image zoom */
.proj-card:hover .proj-img {
  transform: scale(1.06);
}

/* ── Badge "+N תמונות" ── */
.proj-img-wrap::after {
  content: attr(data-count);
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 10;
  padding: 4px 11px;
  border-radius: 50px;
  background: rgba(8, 8, 12, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212,175,55,0.28);
  color: #D4AF37;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-family: 'Assistant', sans-serif;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

.proj-card:hover .proj-img-wrap::after {
  opacity: 1;
  transform: translateY(0);
}

/* ── Stacked thumbnail previews ── */
/* Three pseudo-elements stacked behind the badge */
/* We use .proj-img-overlay siblings trick via a wrapper span */

/* Each thumbnail is a child span inside proj-img-wrap */
.proj-thumb {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 48px;
  height: 34px;
  border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,0.18);
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    transform 0.32s cubic-bezier(0.34,1.56,0.64,1);
}

.proj-thumb:nth-child(1) {
  transform: translate(0px, 10px) scale(0.82) rotate(-6deg);
  transition-delay: 0.04s;
  z-index: 5;
}
.proj-thumb:nth-child(2) {
  transform: translate(6px, 6px) scale(0.88) rotate(-2deg);
  transition-delay: 0.02s;
  z-index: 6;
}
.proj-thumb:nth-child(3) {
  transform: translate(12px, 2px) scale(0.94) rotate(1deg);
  transition-delay: 0s;
  z-index: 7;
}

.proj-card:hover .proj-thumb:nth-child(1) {
  opacity: 0.70;
  transform: translate(-22px, 8px) scale(0.82) rotate(-8deg);
}
.proj-card:hover .proj-thumb:nth-child(2) {
  opacity: 0.82;
  transform: translate(-10px, 4px) scale(0.88) rotate(-3deg);
}
.proj-card:hover .proj-thumb:nth-child(3) {
  opacity: 0.92;
  transform: translate(0px, 0px) scale(0.94) rotate(1deg);
}

@media (max-width: 560px) {
  .proj-grid { grid-template-columns: 1fr; }
  #projects-hero { padding: 120px 24px 40px; }
}

/* ═══ Lead Form inside piModal ═══ */

.pi-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: rgba(212,175,55,0.75);
  font-size: 0.82rem;
  font-family: 'Assistant', sans-serif;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
  transition: color 0.2s;
}
.pi-back-btn:hover { color: #D4AF37; }

.pi-lead-header {
  text-align: center;
  margin-bottom: 24px;
}
.pi-lead-emoji {
  font-size: 2.4rem;
  margin-bottom: 10px;
  line-height: 1;
}
.pi-lead-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px;
}
.pi-lead-sub {
  font-size: 0.83rem;
  color: rgba(200,210,225,0.65);
  line-height: 1.65;
  margin: 0;
}

.pi-lead-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pi-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pi-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: rgba(160,170,190,0.70);
  text-transform: uppercase;
}
.pi-field-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: #e8eaf0;
  font-size: 0.88rem;
  font-family: 'Assistant', sans-serif;
  direction: rtl;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}
.pi-field-input::placeholder { color: rgba(255,255,255,0.22); }
.pi-field-input:focus {
  border-color: rgba(212,175,55,0.45);
  background: rgba(212,175,55,0.04);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.08);
}
.pi-field-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
}

.pi-field-error {
  border-color: rgba(255,80,80,0.6) !important;
  animation: pi-shake 0.4s ease;
}
@keyframes pi-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

.pi-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  padding: 13px 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(212,175,55,0.28), rgba(212,175,55,0.12));
  border: 1px solid rgba(212,175,55,0.50);
  color: #F5E6A3;
  font-size: 0.95rem;
  font-family: 'Assistant', sans-serif;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  width: 100%;
}
.pi-submit-btn:hover {
  background: linear-gradient(135deg, rgba(212,175,55,0.42), rgba(212,175,55,0.22));
  border-color: rgba(212,175,55,0.75);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212,175,55,0.18);
}
.pi-submit-btn:active { transform: translateY(0); }

.pi-thanks-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 0;
  gap: 4px;
  min-height: 260px;
}
.pi-thanks-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  animation: pi-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes pi-pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.pi-thanks-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 10px;
}
.pi-thanks-sub {
  font-size: 0.88rem;
  color: rgba(200,210,225,0.70);
  line-height: 1.75;
  margin: 0;
}

.proj-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 3;
}

.proj-img {
  position: relative;
  z-index: 2;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.proj-card:hover .proj-img {
  opacity: 0;
}

/* ═══════════════════════════════════════════════════════
   UX POLISH — projects.css additions. Appended only.
   Tasks: card lift/glow, image lazy, focus states,
          reduced-motion, mobile spacing.
═══════════════════════════════════════════════════════ */

/* ── 1. Project card: add box-shadow to hover lift ─────
   Existing: translateY(-6px) + border-color change.
   Added: subtle gold glow on hover. No layout shift.     */
.proj-card {
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.proj-card:hover {
  box-shadow: 0 12px 40px rgba(212,175,55,0.12), 0 2px 8px rgba(0,0,0,0.4);
}

/* Card: keyboard focus state (when tabbed to) */
.proj-card:focus-visible,
.proj-card:focus-within {
  outline: 2px solid rgba(212,175,55,0.5);
  outline-offset: 2px;
  border-color: rgba(212,175,55,0.4);
  box-shadow: 0 8px 32px rgba(212,175,55,0.10);
}

/* ── 2. Project card image: lazy-load blur-in ──────────
   Images with loading="lazy" start blurred and clear
   once loaded. Applied via the .proj-img selector.
   JS sets img.onload to add .proj-img--loaded class.    */
.proj-img {
  transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
  filter: blur(0);
}
.proj-img.proj-img--loading {
  filter: blur(6px);
  opacity: 0.6;
}
.proj-img.proj-img--loaded {
  filter: blur(0);
  opacity: 1;
}

/* ── 3. proj-link and proj-info-btn focus rings ─────── */
.proj-link:focus-visible,
.proj-info-btn:focus-visible,
.pi-submit-btn:focus-visible,
.pi-cta-btn:focus-visible,
.pi-back-btn:focus-visible {
  outline: 2px solid rgba(212,175,55,0.55);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── 4. Mobile card spacing ─────────────────────────── */
@media (max-width: 560px) {
  .proj-card {
    border-radius: 14px;
  }
  .proj-body {
    padding: 16px;
  }
  .proj-actions {
    gap: 8px;
    padding: 12px 16px;
  }
}

/* ── 5. prefers-reduced-motion ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .proj-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    transform: none !important;
  }
  .proj-card:hover {
    transform: none !important;
  }
  .proj-card:hover .proj-img {
    transform: none !important;
  }
  .proj-img.proj-img--loading {
    filter: none !important;
    transition: opacity 0.2s ease !important;
  }
  .pi-thanks-icon {
    animation: none !important;
  }
  .pi-field-error {
    animation: none !important;
  }
}

/* ── Funnel modal: counteract the global .modal-box { opacity:0 } rule in style.css ── */
#funnelModal.funnel-open .modal-box {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── proj-want-this-link: contextual conversion link on each card ─────
   Minimal styling. Does NOT change card layout — sits below proj-actions.
   Uses existing color variables only.                                    */
.proj-want-this-link {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  padding: 10px 16px 14px;
  opacity: 0.7;
  transition: opacity 0.2s;
  letter-spacing: 0.2px;
}
.proj-want-this-link:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .proj-want-this-link { transition: none; }
}
/* ── Phase 2: Static card enhancements ──────────────────── */

/* Tech tag pills — visible inside each card footer */
.proj-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 0 2px;
}
.proj-tech-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 50px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Features and problem text — visually hidden, readable by crawlers */
.proj-features.sr-only,
.proj-problem.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
/* ═══════════════════════════════════════════════════════════════
   projects-mobile.css
   Mobile-only improvements for the projects page.
   Load AFTER projects.css in projects.html.
   Zero design changes — layout, spacing, and UX only.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Nav: tighter padding on small screens ──────────────── */
@media (max-width: 900px) {
  nav {
    padding: 14px 20px;
  }

  .nav-logo-img {
    height: 56px;
  }
}

/* ── 2. Projects hero: prevent text overflow, reduce padding ── */
@media (max-width: 768px) {
  #projects-hero {
    padding: 110px 20px 48px;
    min-height: auto;
  }

  #projects-hero .section-title {
    font-size: clamp(1.7rem, 7vw, 2.6rem);
    letter-spacing: -0.5px;
  }

  #projects-hero .section-desc {
    font-size: 0.97rem;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  #projects-hero {
    padding: 96px 16px 40px;
  }

  #projects-hero .section-title {
    font-size: clamp(1.5rem, 8vw, 2rem);
  }
}

/* ── 3. Tab bar: scrollable on mobile ──────────────────────── */
@media (max-width: 768px) {
  .ps-tabs {
    gap: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 0 16px 4px;
    margin: 28px 0 40px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .ps-tabs::-webkit-scrollbar {
    display: none;
  }

  .ps-tab {
    font-size: 0.88rem;
    padding: 9px 18px;
    flex-shrink: 0;
  }
}

/* ── 4. All-projects section: tighter horizontal padding ────── */
@media (max-width: 768px) {
  #all-projects {
    padding: 16px 16px 60px;
  }
}

/* ── 5. Project grid: 2-col → 1-col breakpoints ─────────────── */
@media (max-width: 900px) {
  .proj-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

@media (max-width: 560px) {
  .proj-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ── 6. Project card body: prevent text overflow ─────────────── */
@media (max-width: 560px) {
  .proj-body {
    padding: 16px 16px 18px;
    gap: 8px;
  }

  .proj-title {
    font-size: 1rem;
  }

  .proj-desc {
    font-size: 0.85rem;
  }

  .proj-stats {
    gap: 12px;
  }

  .proj-stat-num {
    font-size: 1rem;
  }
}

/* ── 7. Card actions: full-width stacked buttons on very small ── */
@media (max-width: 400px) {
  .proj-actions {
    flex-direction: column;
    gap: 8px;
  }

  .proj-link,
  .proj-info-btn {
    flex: unset;
    width: 100%;
    justify-content: center;
  }
}

/* ── 8. Tech tags: wrap properly on small screens ────────────── */
@media (max-width: 560px) {
  .proj-tech {
    gap: 4px;
  }

  .proj-tech-tag {
    font-size: 0.65rem;
    padding: 2px 7px;
  }
}

/* ── 9. CTA section: full-width card, better button sizing ────── */
@media (max-width: 768px) {
  #projects-cta {
    padding: 32px 16px 80px;
  }

  #projects-cta .glass-card {
    padding: 36px 24px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  #projects-cta .section-title {
    font-size: clamp(1.35rem, 5vw, 1.8rem) !important;
  }

  #projects-cta .section-desc {
    font-size: 0.95rem;
    max-width: 100%;
  }

  #projects-cta .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 0.95rem;
  }
}

/* ── 10. Project Info Modal (piModal): bottom sheet on mobile ── */
@media (max-width: 760px) {
  #piModal {
    align-items: flex-end;
  }

  #piModal-window {
    grid-template-columns: 1fr;
    grid-template-rows: 240px 1fr;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    align-self: flex-end;
    width: 100vw;
    max-width: 100vw;
    border-left: none;
    border-right: none;
    border-bottom: none;
    /* allow inner content scroll, not the window itself */
    overflow: hidden;
  }

  #piModal-gallery {
    min-height: 240px;
  }

  #piModal-content {
    padding: 20px 16px 100px; /* bottom padding for safe area */
    max-height: calc(92dvh - 240px);
    overflow-y: auto;
  }

  /* Close button: slightly larger tap target on mobile */
  #piModal-close {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }

  /* Gallery arrows: bigger tap area */
  .pi-arrow {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }

  /* CTA button: full-width */
  .pi-cta-btn {
    width: 100%;
    padding: 13px 20px;
  }

  /* Lead form inputs: prevent zoom on iOS (font-size must be ≥16px) */
  .pi-field-input {
    font-size: 16px !important;
  }
}

@media (max-width: 480px) {
  #piModal-content {
    padding: 18px 14px 90px;
  }

  #piModal-title {
    font-size: clamp(1.05rem, 5vw, 1.3rem);
  }

  #piModal-desc {
    font-size: 0.85rem;
  }

  .pi-section-label {
    font-size: 0.65rem;
  }

  #piModal-problem,
  #piModal-features li {
    font-size: 0.83rem;
  }

  /* Make dots slightly easier to tap */
  .pi-dot {
    width: 8px;
    height: 8px;
  }
}

/* ── 11. Demo iframe modal: full screen on mobile ────────────── */
@media (max-width: 600px) {
  #projectModal-window {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    max-width: 100vw;
  }

  #projectModal-header {
    height: 48px;
    padding: 0 12px;
  }

  #projectModal-title {
    font-size: 0.75rem;
  }
}

/* ── 12. Funnel modal: full-width, better scroll on mobile ────── */
@media (max-width: 600px) {
  #funnelModal > .modal-box {
    width: 95% !important;
    max-width: 95% !important;
    padding: 28px 18px 24px !important;
    max-height: 92dvh;
    overflow-y: auto;
  }

  /* Prevent iOS input zoom */
  .form-input,
  .form-textarea {
    font-size: 16px !important;
  }

  .choice-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .funnel-actions {
    gap: 10px;
  }

  .btn-next,
  .btn-submit {
    flex: 1;
  }

  .btn-back {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
}

@media (max-width: 380px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 13. Footer: stack links on small screens ─────────────────── */
@media (max-width: 560px) {
  footer {
    padding: 40px 20px 32px;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
  }

  .footer-copy {
    font-size: 0.8rem;
    line-height: 1.6;
  }
}

/* ── 14. Safe area insets for iOS notch / home indicator ──────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #projects-cta {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  #piModal-content {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }

  footer {
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }
}

/* ── 15. Touch: disable hover-only effects that feel broken on touch ── */
@media (hover: none) and (pointer: coarse) {
  .proj-card:hover {
    transform: none;
    box-shadow: none;
  }

  .proj-card:hover .proj-img {
    transform: none;
    opacity: 1;
  }

  .proj-card:hover .proj-thumb {
    opacity: 0;
  }

  .proj-card:hover .proj-img-wrap::after {
    opacity: 0;
  }

  .proj-link:hover,
  .proj-info-btn:hover,
  .pi-cta-btn:hover,
  .pi-submit-btn:hover {
    transform: none;
  }
}