/* ============================================================
   SPACEMAN TECHNOLOGIES — Projects Section v2 (Elevated Edition)
   ============================================================ */

#projects {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(12, 16, 38, 0.44) 35%, rgba(6, 9, 22, 0.58) 100%);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.12), 0 -20px 40px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

#projects::before {
  content: '';
  position: absolute;
  top: 20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.14) 0%, transparent 70%);
  pointer-events: none;
}

#projects::after {
  content: '';
  position: absolute;
  bottom: 10%;
  right: -10%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* ── HEADER ──────────────────────────────────────────────────── */
.projects-header {
  text-align: center;
  margin-bottom: var(--sp-80);
  position: relative;
  z-index: 2;
}

.projects-header h2 {
  font-family: var(--font-playfair);
  font-size: clamp(32px, 4vw, var(--text-heading));
  font-weight: var(--fw-regular);
  color: var(--color-pure-white);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-16);
}

.projects-header p {
  font-family: var(--font-source);
  font-size: var(--text-body);
  color: var(--color-fog);
  max-width: 600px;
  margin: 0 auto;
  font-style: italic;
  line-height: 1.7;
}


/* ── PROJECTS GRID ───────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-bottom: var(--sp-56);
  position: relative;
  z-index: 2;
}

/* ── PROJECT CARD ────────────────────────────────────────────── */
.project-card {
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* Multi-color gradient border that lights up on hover */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1.5px;
  background: linear-gradient(135deg, #00f0ff 0%, #38bdf8 30%, #a855f7 68%, #ffd166 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 2;
}

.project-card:hover {
  transform: translateY(-7px);
  border-color: transparent;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(0, 240, 255, 0.55),
    0 0 60px rgba(168, 85, 247, 0.38),
    0 0 90px rgba(255, 209, 102, 0.2),
    inset 0 0 20px rgba(0, 240, 255, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.project-card:hover::before {
  opacity: 1;
}

/* Browser top bar */
.project-browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(5, 7, 16, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.browser-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red    { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #27c93f; }

.browser-url {
  font-family: var(--font-source);
  font-size: 11px;
  color: var(--color-steel);
  letter-spacing: 0.05em;
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 10px;
  border-radius: 4px;
  flex: 1;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Media wrap */
.project-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #020409;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: block;
}

.project-card:hover .project-img {
  transform: scale(1.06);
}

/* Overlay gradient inside media */
.project-media-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 14, 28, 0.9) 0%, rgba(10, 14, 28, 0.2) 60%, transparent 100%);
  pointer-events: none;
}

/* Card details / info below image */
.project-info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.project-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.project-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-source);
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-lagoon-teal);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 4px;
  padding: 3px 8px;
}

.project-badge--live {
  color: #27c93f;
  background: rgba(39, 201, 63, 0.1);
  border-color: rgba(39, 201, 63, 0.4);
}

.project-badge--ai {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.4);
}

.project-tech-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.project-tech-tags span {
  font-family: var(--font-source);
  font-size: 11px;
  color: var(--color-ash-gray);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 3px;
}

.project-title {
  font-family: var(--font-source);
  font-size: 21px;
  font-weight: var(--fw-bold);
  color: var(--color-pure-white);
  line-height: 1.3;
}

.project-desc {
  font-family: var(--font-source);
  font-size: 14px;
  color: var(--color-fog);
  line-height: 1.6;
  text-align: justify;
  text-justify: auto;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-wrap: pretty;
  word-spacing: -0.01em;
}

.project-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-project-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--color-lagoon-teal);
  font-family: var(--font-source);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-project-preview:hover {
  background: var(--color-lagoon-teal-dim);
  border-color: var(--color-lagoon-teal);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
  transform: translateX(2px);
}

/* ── MODAL LIGHTBOX ──────────────────────────────────────────── */
.project-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 12, 0.88);
  backdrop-filter: blur(16px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.project-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.project-modal-content {
  position: relative;
  background: rgba(10, 14, 30, 0.96);
  border: 1px solid transparent;
  box-shadow: 
    0 30px 90px rgba(0, 0, 0, 0.85),
    0 0 35px rgba(0, 240, 255, 0.45),
    0 0 70px rgba(168, 85, 247, 0.35),
    0 0 100px rgba(255, 209, 102, 0.2),
    inset 0 0 25px rgba(0, 240, 255, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Chromatic border frame around the project modal window */
.project-modal-content::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1.5px;
  background: linear-gradient(135deg, #00f0ff 0%, #38bdf8 30%, #a855f7 68%, #ffd166 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 15;
}

.project-modal.active .project-modal-content {
  transform: scale(1) translateY(0);
}

.project-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-pure-white);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-base);
}

.project-modal-close:hover {
  background: rgba(255, 95, 86, 0.3);
  border-color: #ff5f56;
  transform: rotate(90deg);
}

.project-modal-img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 7px 7px 0 0;
  display: block;
}

.project-modal-body {
  padding: 32px;
}

.project-modal-title {
  font-family: var(--font-playfair);
  font-size: 28px;
  color: var(--color-pure-white);
  margin-bottom: 12px;
}

.project-modal-desc {
  font-family: var(--font-source);
  font-size: 15px;
  color: var(--color-ash-gray);
  line-height: 1.7;
  margin-bottom: 24px;
  text-align: justify;
  text-justify: auto;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-wrap: pretty;
  word-spacing: -0.01em;
}

/* ── CTA ─────────────────────────────────────────────────────── */
.projects-cta {
  text-align: center;
  position: relative;
  z-index: 2;
  margin-top: var(--sp-24);
}

#projects-contact-cta {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
  transition: all var(--transition-base);
}

#projects-contact-cta:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18) 0%, rgba(168, 85, 247, 0.18) 100%);
  border-color: #00f0ff;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.35), 0 0 50px rgba(168, 85, 247, 0.2);
  transform: translateY(-2px);
  color: #ffffff;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  .projects-grid { grid-template-columns: 1fr; gap: 24px; }
  .project-info { padding: 18px; }
}

@media (max-width: 580px) {
  .projects-header h2 { font-size: 28px; }
  .projects-header p { font-size: 14px; }
  .project-title { font-size: 18px; }
  .project-desc { font-size: 13px; }
  .project-modal-content { max-height: 94vh; }
  .project-modal-body { padding: 20px 16px; }
  .project-modal-title { font-size: 22px; }
  .project-modal-desc { font-size: 14px; }
}
