/* ───────────────────────────────────────────────────────────────
   Projects page styles + project image helpers
   ─────────────────────────────────────────────────────────────── */

/* image wrapper that holds a real photo */
.proj-img-photo {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
  background: var(--bg-soft);
}
.proj-img-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
}
.proj-card:hover .proj-img-photo img { transform: scale(1.04); }

/* short caption under home proj card */
.proj-short {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  line-height: 1.45;
  margin-top: 4px;
  max-width: 36ch;
  text-wrap: pretty;
}
.proj-meta { gap: 6px; }

/* ── PROJECTS PAGE HERO ── */
.proj-page { padding-top: 0; }

.proj-page-hero {
  padding: 140px 0 48px;
  background:
    radial-gradient(70% 60% at 30% 30%, var(--brand-50) 0%, transparent 70%),
    var(--bg);
}
.proj-page-hero h1 { margin-top: 14px; }

.proj-page-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1px solid var(--border-soft);
  max-width: 700px;
}
.proj-page-stats .num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 650;
  color: var(--brand-700);
  letter-spacing: -0.03em;
  line-height: 1;
}
.proj-page-stats .lbl {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 6px;
  max-width: 18ch;
}

/* ── PROJECTS FILTER ── */
.proj-filter {
  padding: 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.92);
  position: sticky;
  top: 64px;
  z-index: 50;
  backdrop-filter: blur(12px);
}
[data-theme="dark"] .proj-filter { background: rgba(11,16,32,0.92); }
.proj-filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 16px 0;
  scrollbar-width: none;
}
.proj-filter-row::-webkit-scrollbar { display: none; }
.proj-chip {
  padding: 9px 16px;
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-700);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.15s;
  flex-shrink: 0;
}
.proj-chip:hover { color: var(--brand-700); background: var(--brand-50); }
.proj-chip.is-active {
  background: var(--brand-700);
  color: #fff;
  border-color: var(--brand-700);
}

/* ── PROJECTS LIST — alternating editorial layout ── */
.proj-list { padding-top: var(--gap-2xl); }
.proj-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--gap-2xl);
  align-items: start;
  padding: var(--gap-2xl) 0;
  border-bottom: 1px solid var(--border-soft);
}
.proj-row:first-child { padding-top: 0; }
.proj-row:last-child { border-bottom: 0; }
.proj-row-flip { direction: rtl; }
.proj-row-flip > * { direction: ltr; }

.proj-row-visual {
  position: relative;
  cursor: pointer;
}
.proj-row-img {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.3s;
}
.proj-row-visual:hover .proj-row-img { box-shadow: var(--shadow-lg); }
.proj-row-visual:hover .proj-img-photo img { transform: scale(1.04); }
.proj-row-num {
  position: absolute;
  top: -28px;
  left: -16px;
  font-family: var(--font-display);
  font-size: 120px;
  font-weight: 650;
  color: var(--brand-100);
  letter-spacing: -0.04em;
  line-height: 1;
  z-index: -1;
  pointer-events: none;
}
.proj-row-flip .proj-row-num {
  left: auto;
  right: -16px;
}
[data-theme="dark"] .proj-row-num { color: var(--brand-100); opacity: 0.4; }

.proj-row-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.proj-row-meta h2 { font-size: clamp(28px, 2.8vw, 40px); margin: 4px 0 0; }
.proj-row-meta .btn { align-self: flex-start; margin-top: 8px; }

.proj-row-specs {
  margin-top: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.proj-spec {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  font-size: 14px;
  padding: 4px 0;
}
.proj-spec-l {
  color: var(--ink-500);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding-top: 2px;
}
.proj-spec-v {
  color: var(--ink-900);
  font-weight: 500;
}

@media (max-width: 960px) {
  .proj-row { grid-template-columns: 1fr; gap: var(--gap-lg); }
  .proj-row-flip { direction: ltr; }
  .proj-row-num { font-size: 80px; top: -16px; left: -8px; }
  .proj-row-flip .proj-row-num { left: auto; right: -8px; }
  .proj-spec { grid-template-columns: 140px 1fr; }
}

/* ── DETAIL OVERLAY ── */
.proj-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 40, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.proj-detail {
  background: var(--surface);
  border-radius: var(--radius-xl);
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: var(--shadow-lg);
}
.proj-detail-gallery {
  max-width: 1240px;
  grid-template-columns: 1.3fr 1fr;
}
.proj-detail-stage {
  position: relative;
  background: #0A1228;
  border-top-left-radius: var(--radius-xl);
  border-bottom-left-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 480px;
}
.proj-detail-img {
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  min-height: 480px;
  border-radius: 0;
  position: relative;
  overflow: hidden;
}
.proj-detail-img.proj-img-photo img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

/* nav buttons inside stage */
.proj-detail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  border: none;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 3;
  transition: all 0.15s;
}
.proj-detail-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.06);
}
.proj-detail-prev { left: 16px; }
.proj-detail-next { right: 16px; }
.proj-detail-counter {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  z-index: 3;
  backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}

.proj-detail-body {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 90vh;
}
.proj-detail-body h2 { margin: 6px 0 8px; }
.proj-detail-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-700);
}
.proj-detail-x {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-700);
  transition: all 0.15s;
}
.proj-detail-x:hover {
  background: var(--ink-900);
  color: #fff;
  border-color: var(--ink-900);
}

.proj-detail-specs {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.proj-detail-spec {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
}

/* gallery thumb strip */
.proj-detail-thumbs {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}
.proj-detail-thumbs-lbl {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-500);
  margin-bottom: 10px;
}
.proj-detail-thumbs-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 6px;
}
.proj-detail-thumb {
  appearance: none;
  border: 2px solid transparent;
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1;
  transition: all 0.15s;
}
.proj-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.proj-detail-thumb:hover { transform: scale(1.05); }
.proj-detail-thumb.is-active {
  border-color: var(--brand-700);
  box-shadow: 0 0 0 1px var(--brand-700);
}

.proj-detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* badge on the project row indicating gallery */
.proj-row-gallery-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.95);
  color: var(--ink-900);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  z-index: 2;
}
.proj-row-gallery-badge svg { opacity: 0.7; }

@media (max-width: 960px) {
  .proj-detail, .proj-detail-gallery {
    grid-template-columns: 1fr;
    max-height: 95vh;
  }
  .proj-detail-stage, .proj-detail-img {
    aspect-ratio: 16 / 9;
    min-height: auto;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .proj-detail-body { padding: 28px; }
  .proj-detail-spec { grid-template-columns: 130px 1fr; }
  .proj-detail-nav { width: 36px; height: 36px; }
}
