/* project-page.css — shared styles for all project detail pages */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

#site-content {
  position: relative;
  z-index: 1;
}

/**/
:root {
  font-size: 15px;
  --bg: #f5f4f0;
  --ink: #0f0e0c;
  --muted: #8a8880;
  --border: #dedad2;
  --white: #ffffff;
  --max: 1020px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}

/* ── BACK BUTTON ── */

/* Always fixed so it never causes layout reflow */
.back-bar {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 100;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  transition: color 0.2s, opacity 0.2s;
}

.back-btn:hover { color: var(--ink); }

.back-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Narrow screens: button fades out as page scrolls so it doesn't
   permanently overlap content. JS below handles the fade. */
.back-bar.scrolled-past {
  opacity: 0;
  pointer-events: none;
}

/* Thin invisible spacer so content doesn't start behind the button area */
.back-spacer {
  height: 3rem;
  display: none;
}

@media (max-width: 1150px) {
  .back-spacer { display: block; }
}

.back-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── PAGE CONTENT ── */
.page-content {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 2rem 2.5rem;
  position: relative;
  z-index: 0;
}

/* Soft background panel that masks the canvas behind content,
   fading out to the sides so animation lines blend back in */
.page-content::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -100px;
  right: -100px;
  background: linear-gradient(to right,
    transparent 0,
    var(--bg) 100px,
    var(--bg) calc(100% - 100px),
    transparent 100%
  );
  z-index: -1;
  pointer-events: none;
}

/* ── PROJECT HEADER ── */
.project-header {
  margin-bottom: 2rem;
}

.project-category {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4a4845;
  margin-bottom: 0.75rem;
}

.project-title {
  font-family: 'Archivo', sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.2rem;
}

.project-summary {
  font-size: 1.1rem;
  font-weight: 400;
  color: #252320;
  border-left: 2px solid var(--border);
  padding-left: 1.2rem;
  line-height: 1.7;
}

.meta-row {
  display: flex;
  gap: 2.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.meta-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.meta-value {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ── CONTENT BLOCKS ── */

/* Text */
.block-text {
  margin-bottom: 1.5rem;
}

.block-text h2 {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

/* Standard text on project pages */
.block-text p {
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.6rem;
}

/* Screenshot */
.block-image {
  margin-bottom: 2.5rem;
}

.block-image-stack .block-image {
  margin-bottom: 1.5rem;
}

.block-image.block-image--natural img,
.block-image.block-image--natural video {
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  display: block;
}

.block-image img {
  width: 100%;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: block;
}

.block-image figcaption {
  font-size: 0.9rem;
  color: #3c3a37;
  margin-top: 0.6rem;
  margin-bottom: -1rem;
  text-align: center;
  letter-spacing: 0.02em;
}

/* Image grid (4-up screenshots, bleeds wider than content) */
.block-image-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.block-image-grid-4 img {
  width: 100%;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: block;
}

@media (max-width: 600px) {
  .block-image-grid-4 {
    grid-template-columns: repeat(2, 1fr);
    margin-left: 0;
    margin-right: 0;
  }
}

/* Image grid (3-up screenshots) */
.block-image-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.block-image-grid-3 img {
  width: 100%;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: block;
}

@media (max-width: 600px) {
  .block-image-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Image grid (5-up screenshots) */
.block-image-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.block-image-grid-5 img {
  width: 100%;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: block;
}

@media (max-width: 600px) {
  .block-image-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Image grid (2-up screenshots) */
.block-image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.block-image-grid img {
  width: 100%;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: block;
}

/* Video embed */
.block-video {
  margin-bottom: 1.5rem;
}

.block-video .video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: #1a1a1a;
}

.block-video .video-wrapper iframe,
.block-video .video-wrapper video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.block-video figcaption {
  font-size: 0.9rem;
  color: #3c3a37;
  margin-top: 0.6rem;
  text-align: center;
}

/* Divider */
.block-divider {
  height: 1px;
  background: var(--border);
  margin: 3rem 0;
}

/* ── FOOTER NAV ── */
.page-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  position: relative;
  z-index: 0;
}

.page-footer::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--max) + 160px);
  background: linear-gradient(to right,
    transparent 0,
    var(--bg) 80px,
    var(--bg) calc(100% - 80px),
    transparent 100%
  );
  z-index: -1;
  pointer-events: none;
}

.footer-nav {
  display: flex;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
}

.footer-slot {
  flex: 1;
}

.footer-slot--center {
  text-align: center;
}

.footer-slot--right {
  text-align: right;
}

.footer-nav a {
  font-size: 0.85rem;
  color: #4a4845;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover { color: var(--ink); }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .page-content { padding: 2.5rem 1.5rem 4rem; }
  .block-image-grid { grid-template-columns: 1fr; }
  .meta-row { gap: 1.5rem; }
}

/* ── LIGHTBOX ── */

#lightbox-img-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}

#lightbox-caption {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  margin-top: 0.75rem;
  text-align: center;
  width: 100%;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Make all content images look clickable */
.block-image img,
.block-image-grid img,
.block-image-grid-3 img,
.block-image-grid-4 img,
.block-image-grid-5 img {
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.block-image img:hover,
.block-image-grid img:hover,
.block-image-grid-3 img:hover,
.block-image-grid-4 img:hover,
.block-image-grid-5 img:hover {
  opacity: 0.88;
}

/* Overlay backdrop */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 10, 14, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  display: flex;
  animation: lbFadeIn 0.2s ease;
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Wrapper that keeps image and nav buttons in a row */
.lightbox-inner {
  display: flex;
  align-items: stretch;
}

/* The image inside */
.lightbox-overlay img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  cursor: default;
  animation: lbScaleIn 0.2s ease;
  user-select: none;
}

@keyframes lbScaleIn {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* Close button (top-right corner) */
.lightbox-close {
  position: fixed;
  top: 1.2rem;
  right: 1.4rem;
  width: 52px;
  height: 52px;
  border: none;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 1001;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.22);
}

.lightbox-close svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* Prev / next arrow buttons — large transparent hit area */
.lightbox-prev,
.lightbox-next {
  flex-shrink: 0;
  width: 90px;
  height: 96px;
  align-self: center;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  margin: 0;
  padding: 0;
}

/* Visual circle inside the button */
.lightbox-prev .btn-circle,
.lightbox-next .btn-circle {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  opacity: 0.35;
  transition: background 0.15s, opacity 0.15s;
  pointer-events: none;
}

.lightbox-prev:hover .btn-circle,
.lightbox-next:hover .btn-circle {
  background: rgba(255,255,255,0.1);
  opacity: 0.8;
}

.lightbox-prev svg,
.lightbox-next svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── SPLIT (text left, image right) ── */
.block-split {
  display: flex;
  gap: 2rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.block-split .split-text {
  flex: 1;
}

.block-split .split-text h2 {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.block-split .split-text p {
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.6rem;
}

.block-split .split-image {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 3rem;
  width: fit-content;
}

.block-split .split-image img {
  display: block;
  max-height: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.block-split .split-image figcaption {
  font-size: 0.9rem;
  color: #3c3a37;
  margin-top: 0.6rem;
  text-align: center;
  letter-spacing: 0.02em;
  width: 100%;
}

@media (max-width: 600px) {
  .block-split { flex-direction: column; }
}

/* ── CAROUSEL ── */
.block-carousel {
  position: relative;
  margin-bottom: 2.5rem;
}

.carousel-viewport {
  overflow: hidden;
  margin: 0 60px;
}

.carousel-track {
  display: flex;
  gap: 0.5rem;
  transition: transform 0.35s ease;
  will-change: transform;
}

.carousel-item {
  flex: 0 0 100%;
}

.carousel-item img {
  width: 100%;
  height: auto;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: block;
  cursor: zoom-in;
  transition: opacity 0.15s;
}

.carousel-item img:hover {
  opacity: 0.88;
}

.carousel-caption {
  font-size: 0.9rem;
  color: #3c3a37;
  text-align: center;
  letter-spacing: 0.02em;
  margin-top: 0.6rem;
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
}

.carousel-prev { left: 0; }
.carousel-next { right: 0; }

.carousel-prev:disabled,
.carousel-next:disabled {
  opacity: 0.15;
  cursor: default;
}

.carousel-prev .btn-circle,
.carousel-next .btn-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.1);
  opacity: 1;
  transition: opacity 0.15s, background 0.15s;
  pointer-events: none;
}

.carousel-prev:not(:disabled):hover .btn-circle,
.carousel-next:not(:disabled):hover .btn-circle {
  opacity: 1;
}

.carousel-prev svg,
.carousel-next svg {
  width: 36px;
  height: 36px;
  stroke: var(--ink);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 0.75rem;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: #a8a49d;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dot.active {
  background: var(--ink);
  transform: scale(1.35);
}

