/* ========================================
   PROJECT STYLES — gradient design system
======================================== */

/* ========================================
   SINGLE PROJECT
======================================== */
.single-project {
  background: var(--bg-body);
}

/* ---- Hero ---- */
.sp-hero {
  position: relative;
  overflow: hidden;
  padding: 40px 0 56px;
  background: var(--bg-card);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sp-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 15%, var(--primary-glow), transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(0, 0, 0, 0.04), transparent 45%);
  z-index: 0;
}

.sp-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.sp-back {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 24px;
  transition: var(--transition);
}

.sp-back:hover {
  color: var(--primary);
}

.sp-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.sp-type-tag .type-icon {
  width: 14px;
  height: 14px;
}

.sp-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 5px 12px;
  border-radius: 20px;
}

.sp-hero-year {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.sp-status {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f3f4f6;
  color: var(--text-muted);
}

.sp-status-completed,
.sp-status-maintained {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.sp-status-in_progress {
  background: rgba(0, 0, 0, 0.04);
  color: var(--secondary);
}

.sp-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--text-main);
}

.sp-tagline {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 0 28px;
}

/* ---- Action buttons ---- */
.sp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.sp-btn-primary {
  background: var(--gradient-main);
  color: #fff;
  box-shadow: 0 6px 20px var(--primary-glow);
}

.sp-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px var(--primary-glow);
  color: #fff;
}

.sp-btn-ghost {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.sp-btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.sp-btn-block {
  width: 100%;
  justify-content: center;
}

/* ---- Layout ---- */
.sp-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  padding-top: 56px;
  padding-bottom: 72px;
  align-items: start;
}

.sp-main {
  min-width: 0;
}

.sp-featured-image {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 40px;
}

.sp-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- Metrics band ---- */
.sp-metrics-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  background: var(--gradient-main);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  margin-bottom: 44px;
  box-shadow: 0 14px 40px var(--primary-glow);
}

.sp-metric {
  text-align: center;
  color: #fff;
}

.sp-metric-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.sp-metric-label {
  display: block;
  font-size: 0.76rem;
  opacity: 0.85;
  margin-top: 5px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---- Sections ---- */
.sp-section {
  margin-bottom: 44px;
}

.sp-section h2 {
  font-size: 1.6rem;
  margin: 0 0 18px;
  color: var(--text-main);
  position: relative;
  padding-bottom: 12px;
}

.sp-section h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: var(--gradient-main);
}

.sp-prose {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-main);
}

.sp-prose p {
  margin: 0 0 16px;
}

.sp-prose p:last-child {
  margin-bottom: 0;
}

.sp-prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sp-prose a:hover {
  opacity: 0.8;
}

.sp-prose strong {
  font-weight: 600;
  color: var(--text-main);
}

/* ---- Features ---- */
.sp-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sp-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--text-main);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: var(--bg-card);
  transition: background 0.15s;
}

.sp-features-list li:last-child {
  border-bottom: none;
}

.sp-features-list li:hover {
  background: var(--bg-body);
}

.sp-feature-icon {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--accent);
  display: flex;
}

/* ---- Gallery ---- */
.sp-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.sp-gallery-item {
  position: relative;
  display: block;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 10;
  background: var(--bg-card);
}

.sp-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.sp-gallery-item:hover img {
  transform: scale(1.06);
}

.sp-gallery-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.35);
  color: #fff;
  font-size: 1.4rem;
  opacity: 0;
  transition: var(--transition);
}

.sp-gallery-item:hover .sp-gallery-zoom {
  opacity: 1;
}

/* ---- Video ---- */
.sp-video {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.sp-video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
}

/* ---- Testimonial ---- */
.sp-testimonial {
  position: relative;
  margin: 44px 0;
  padding: 36px 40px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.sp-testimonial blockquote {
  margin: 0 0 16px;
  padding: 0;
  border: none;
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-main);
  font-style: italic;
}

.sp-testimonial figcaption {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.sp-testimonial figcaption::before {
  content: '— ';
}

/* ---- Awards ---- */
.sp-awards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-awards li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.sp-awards li .sh-icon {
  color: #f59e0b;
  flex-shrink: 0;
}

/* ---- Sticky sidebar ---- */
.sp-sidebar-inner {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sp-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.sp-card-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 16px;
  font-weight: 600;
}

.sp-card-title-sub {
  margin-top: 20px;
}

.sp-info {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
}

.sp-info dt {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sp-info dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  text-align: right;
}

.sp-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sp-tech-chip {
  padding: 4px 11px;
  background: var(--bg-body);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  transition: border-color 0.15s, color 0.15s;
}

.sp-tech-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.sp-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sp-terms a {
  padding: 5px 12px;
  background: var(--bg-body);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.sp-terms a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.sp-card-cta {
  background: var(--gradient-main);
  border: none;
  color: #fff;
  text-align: center;
}

.sp-card-cta h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  color: #fff;
}

.sp-card-cta p {
  margin: 0 0 18px;
  opacity: 0.92;
  font-size: 0.95rem;
}

.sp-card-cta .sp-btn-primary {
  background: #fff;
  color: var(--primary);
}

.sp-card-cta .sp-btn-primary:hover {
  color: var(--primary);
}

/* ---- Prev / Next ---- */
.sp-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 72px;
}

.sp-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 48%;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: var(--transition);
}

.sp-nav-link:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.sp-nav-next {
  text-align: right;
  margin-left: auto;
}

.sp-nav-dir {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

.sp-nav-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ---- Lightbox ---- */
.sp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 20, 0.92);
  backdrop-filter: blur(4px);
  padding: 40px;
}

.sp-lightbox.open {
  display: flex;
}

.sp-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.sp-lightbox-close,
.sp-lightbox-prev,
.sp-lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.sp-lightbox-close:hover,
.sp-lightbox-prev:hover,
.sp-lightbox-next:hover {
  background: rgba(255, 255, 255, 0.25);
}

.sp-lightbox-close {
  top: 24px;
  right: 24px;
}

.sp-lightbox-prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.sp-lightbox-next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .sp-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .sp-sidebar-inner {
    position: static;
  }
}

@media (max-width: 768px) {
  .sp-title {
    font-size: 1.9rem;
  }

  .sp-actions .sp-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .sp-nav-link {
    max-width: 100%;
  }

  .sp-nav {
    flex-direction: column;
  }

  .sp-lightbox-prev,
  .sp-lightbox-next {
    width: 40px;
    height: 40px;
  }
}

/* ========================================
   Archive Page — gradient design system
======================================== */
.project-archive {
  padding: 72px 20px;
  background: var(--bg-body);
}

.project-archive .container {
  max-width: var(--container-width);
  margin: 0 auto;
}

.archive-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 48px;
}

.archive-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  color: var(--text-main);
}

.archive-header p {
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

/* Filter groups */
.project-filter-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.filter-group-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 4px;
}

.filter-btn {
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  transition: var(--transition);
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--gradient-main);
  border-color: transparent;
  color: #fff;
}

/* Project Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 40px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(0, 0, 0, 0.12);
}

.project-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-body);
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.project-card-content {
  padding: 24px;
}

.project-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.project-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.project-type-badge .type-icon {
  width: 14px;
  height: 14px;
}

/* Platform tags (a project can span Mobile + Web + API) */
.project-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}

.platform-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--secondary);
  background: rgba(0, 0, 0, 0.04);
  padding: 3px 9px;
  border-radius: 20px;
}

/* Ownership badges — archive + homepage cards */
.ownership-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 20px;
}
.ownership-personal              { background: #eff6ff; color: #2563eb; }
.ownership-client,
.ownership-freelance             { background: #f0fdf4; color: #16a34a; }
.ownership-open_source           { background: #fdf4ff; color: #7c3aed; }
.ownership-company               { background: #f9fafb; color: #6b7280; }

/* Single-project hero platform tags */
.sp-platform-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--secondary);
  background: rgba(0, 0, 0, 0.04);
  padding: 4px 10px;
  border-radius: 20px;
}

.project-card h3 {
  font-size: 1.25rem;
  margin: 0 0 8px 0;
}

.project-card h3 a {
  color: var(--text-main);
  text-decoration: none;
}

.project-card h3 a:hover {
  color: var(--primary);
}

.project-card-excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.project-card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.project-card-tech span {
  padding: 4px 10px;
  background: var(--bg-body);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.no-projects {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
}
