/* ══ SINGLE PROJECT PAGE ══════════════════════════════ */
.spj-page { position: relative; z-index: 1; }

/* ── Top bar — INLINE (not fixed), below pill navbar ── */
.spj-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 88px 40px 16px;   /* 88px clears the fixed pill navbar */
  max-width: 860px;
  margin: 0 auto;
  box-sizing: border-box;
}
.spj-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono,'Space Mono',monospace);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color:rgba(255,255,255,.55);
  text-decoration: none;
  transition: color .2s;
}
.spj-back:hover { color: #fff; text-decoration: none; }
.spj-casenum {
  font-family: var(--mono,'Space Mono',monospace);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color:rgba(255,255,255,.45);
}

/* ── Body ─────────────────────────────────────────── */
.spj-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}

/* ── HERO ─────────────────────────────────────────── */
.spj-hero {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0d1117;
  aspect-ratio: 16 / 7;
  margin-bottom: 32px;
}
.spj-hero-media { position: absolute; inset: 0; }
.spj-hero-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
  filter: brightness(.55);
  transition: transform .6s ease;
}
.spj-hero:hover .spj-hero-img { transform: scale(1.02); }
.spj-hero-ph {
  width: 100%; height: 100%;
  background: linear-gradient(135deg,#0d1b2a,#1a1020);
}
.spj-hero-grad {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,transparent 25%,rgba(8,11,16,.5) 65%,rgba(8,11,16,.88) 100%);
}
.spj-hero-over {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px 28px;
}
.spj-hero-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(59,130,246,.2);
  border: 1px solid rgba(59,130,246,.38);
  border-radius: 9999px;
  padding: 4px 12px;
  margin-bottom: 10px;
  font-family: var(--mono,'Space Mono',monospace);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #93c5fd;
  backdrop-filter: blur(8px);
  width: fit-content;
}
.spj-cat-dot { width: 5px; height: 5px; border-radius: 50%; background: #3b82f6; flex-shrink: 0; }
.spj-hero-title {
  font-size: clamp(1.7rem,4vw,3rem);
  font-weight: 700;
  letter-spacing: -.03em;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 9px;
}
.spj-hero-exc {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255,255,255,.55);
  max-width: 500px;
}

/* ── Details ──────────────────────────────────────── */
.spj-details {
  padding: 22px 0;
  border-top: 1px solid rgba(255,255,255,.07);
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 52px;
}
.spj-det-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  margin-bottom: 16px;
}
.spj-det {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 20px;
  border-right: 1px solid rgba(255,255,255,.06);
  margin-right: 20px;
}
.spj-det:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.spj-det-l {
  font-family: var(--mono,'Space Mono',monospace);
  font-size: 8px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color:rgba(255,255,255,.45);
}
.spj-det-v { font-size: 14px; font-weight: 600; color: #fff; letter-spacing: -.01em; }
.spj-acc { color: #60a5fa !important; }
.spj-det-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.spj-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.spj-tag {
  font-family: var(--mono,'Space Mono',monospace);
  font-size: 8.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color:rgba(255,255,255,.45);
  padding: 3px 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 4px;
}
.spj-links { display: flex; gap: 8px; }
.spj-lbtn {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono,'Space Mono',monospace);
  font-size: 9px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  padding: 5px 12px; border-radius: 6px;
  text-decoration: none; transition: all .2s;
}
.spj-lbtn:hover { color: #fff; border-color:rgba(255,255,255,.45); text-decoration: none; }

/* ── Sections ─────────────────────────────────────── */
.spj-sec { margin-bottom: 70px; }
.spj-ctr { text-align: center; }
.spj-eye {
  display: flex; align-items: center;
  justify-content: center; gap: 14px;
  font-family: var(--mono,'Space Mono',monospace);
  font-size: 9px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color:rgba(255,255,255,.45); margin-bottom: 26px;
}
.spj-el { flex: 1; height: 1px; background: rgba(255,255,255,.07); max-width: 55px; display: block; }
.spj-h2 {
  font-size: clamp(1.7rem,3.8vw,2.7rem);
  font-weight: 700; letter-spacing: -.03em;
  color: #fff; margin-bottom: 10px; line-height: 1.15;
}
.spj-sub {
  font-size: 14px; color:rgba(255,255,255,.5);
  line-height: 1.7; max-width: 390px; margin: 0 auto 30px;
}

/* ── Process ──────────────────────────────────────── */
.spj-proc {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 44px; max-width: 760px; margin: 0 auto;
}
.spj-psep { background: rgba(255,255,255,.07); }
.spj-pcol { display: flex; flex-direction: column; gap: 12px; }
.spj-plbl {
  font-family: var(--mono,'Space Mono',monospace);
  font-size: 9px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color:rgba(255,255,255,.45); margin: 0;
}
.spj-plbl-row { display: flex; align-items: center; justify-content: space-between; }
.spj-ptxt { font-size: 14px; line-height: 1.75; color: rgba(255,255,255,.44); margin: 0; }

/* ── Tech pills ───────────────────────────────────── */
.spj-tpills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.spj-tpill {
  padding: 8px 20px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9999px;
  font-family: var(--mono,'Space Mono',monospace);
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,.58);
  transition: all .2s;
}
.spj-tpill:hover { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.3); color: #93c5fd; }

/* ── Gallery ──────────────────────────────────────── */
.spj-gal {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  grid-auto-rows: 200px;
  gap: 10px;
  text-align: left;
}
.spj-gi {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #0d1117;
}
.spj-gwide { grid-column: span 2; }
.spj-gi img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .5s ease;
}
.spj-gi:hover img { transform: scale(1.04); }
.spj-glbl {
  position: absolute;
  bottom: 10px; left: 12px;
  font-family: var(--mono,'Space Mono',monospace);
  font-size: 7.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.55);
  background: rgba(0,0,0,.55);
  padding: 3px 8px; border-radius: 4px;
  backdrop-filter: blur(4px);
}

/* ── Impact ───────────────────────────────────────── */
.spj-metrics {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 20px; max-width: 580px; margin: 0 auto;
}
.spj-met {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 24px 16px;
  background: rgba(17,21,32,.6);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
}
.spj-msl { font-family: var(--mono,'Space Mono',monospace); font-size: 7.5px; font-weight: 700; letter-spacing: .2em; color:rgba(255,255,255,.45); text-transform: uppercase; }
.spj-mv  { font-size: 2.1rem; font-weight: 700; color: #fff; letter-spacing: -.03em; line-height: 1; }
.spj-ml  { font-family: var(--mono,'Space Mono',monospace); font-size: 8px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color:rgba(255,255,255,.45); text-align: center; }

/* ── Responsive (top section) ────────────────────── */
@media (max-width:768px) {
  .spj-topbar { padding: 88px 20px 14px; }
  .spj-body { padding: 0 20px; }
  .spj-det-grid { grid-template-columns: repeat(2,1fr); gap: 18px; }
  .spj-det { border-right: none; margin-right: 0; padding-right: 0; }
  .spj-proc { grid-template-columns: 1fr; gap: 24px; }
  .spj-psep { display: none; }
  .spj-gal { grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; }
  .spj-gwide { grid-column: span 2; }
  .spj-metrics { grid-template-columns: repeat(3,1fr); max-width: 100%; gap: 10px; }
  .spj-met { padding: 16px 8px; gap: 5px; }
  .spj-mv  { font-size: 1.4rem; }
  .spj-msl { font-size: 6.5px; }
  .spj-ml  { font-size: 7px; letter-spacing: .08em; }
}
@media (max-width:380px) {
  .spj-metrics { gap: 8px; }
  .spj-met { padding: 14px 6px; }
  .spj-mv  { font-size: 1.2rem; }
}

/* ── Light theme (top section) ───────────────────── */
body.pa-light .spj-topbar    { background: rgba(245,246,250,.9); border-bottom-color: rgba(0,0,0,.08); backdrop-filter: blur(16px); }
body.pa-light .spj-back      { color: rgba(0,0,0,.6); }
body.pa-light .spj-back:hover{ color: #111827; }
body.pa-light .spj-casenum   { color: rgba(0,0,0,.5); }
body.pa-light .spj-hero      { background: #e5e7eb; }
body.pa-light .spj-hero-img  { filter: brightness(.65); }
body.pa-light .spj-details   { border-color: rgba(0,0,0,.1); }
body.pa-light .spj-det-l     { color: rgba(0,0,0,.5); }
body.pa-light .spj-det-v     { color: #111827; }
body.pa-light .spj-det       { border-right-color: rgba(0,0,0,.08); }
body.pa-light .spj-tag       { color: rgba(0,0,0,.55); background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.08); }
body.pa-light .spj-lbtn      { color: rgba(0,0,0,.45); background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.1); }
body.pa-light .spj-lbtn:hover{ color: #111827; border-color: rgba(0,0,0,.2); }
body.pa-light .spj-eye       { color: rgba(0,0,0,.5); }
body.pa-light .spj-el        { background: rgba(0,0,0,.09); }
body.pa-light .spj-h2        { color: #111827; }
body.pa-light .spj-sub       { color: rgba(0,0,0,.42); }
body.pa-light .spj-psep      { background: rgba(0,0,0,.08); }
body.pa-light .spj-plbl      { color: rgba(0,0,0,.5); }
body.pa-light .spj-ptxt      { color: rgba(0,0,0,.5); }
body.pa-light .spj-tpill     { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.1); color: rgba(0,0,0,.55); }
body.pa-light .spj-tpill:hover{ background: rgba(37,99,235,.08); border-color: rgba(37,99,235,.25); color: #2563eb; }
body.pa-light .spj-gi        { background: #e5e7eb; }
body.pa-light .spj-met       { background: #ffffff; border-color: rgba(0,0,0,.08); box-shadow: 0 2px 10px rgba(0,0,0,.04); }
body.pa-light .spj-msl       { color: rgba(0,0,0,.5); }
body.pa-light .spj-mv        { color: #111827; }
body.pa-light .spj-ml        { color: rgba(0,0,0,.5); }

/* ════════════════════════════════════════════════════════
   PREV / NEXT NAV — single line, side-by-side
════════════════════════════════════════════════════════ */
.spj-nav {
  position: relative;
  display: flex;                 /* flex, not grid → always one row */
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;
  margin-top: 64px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.spj-nav-single { justify-content: flex-start; }
.spj-nav-single .spj-ni { flex: 1 1 100%; }

.spj-ni {
  position: relative;
  isolation: isolate;
  flex: 1 1 50%;               /* each takes half, side-by-side */
  min-width: 0;
  display: flex;
  align-items: center;
  height: 110px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
@media (min-width: 600px) { .spj-ni { height: 150px; } }

/* Background cover image */
.spj-ni-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: .4;
  filter: grayscale(1);
  transition: transform .7s cubic-bezier(.16,1,.3,1), opacity .7s, filter .7s;
}
.spj-ni:hover .spj-ni-img {
  transform: scale(1.05);
  opacity: .6;
  filter: grayscale(0);
}

/* Gradient overlay */
.spj-nov { position: absolute; inset: 0; z-index: -1; }
.spj-nov-l { background: linear-gradient(to right, rgba(0,0,0,.85), rgba(0,0,0,.5) 60%, transparent); }
.spj-nov-r { background: linear-gradient(to left,  rgba(0,0,0,.85), rgba(0,0,0,.5) 60%, transparent); }

.spj-nprev { border-right: 1px solid rgba(255,255,255,.08); }

/* Diagonal cut between prev/next — desktop only */
@media (min-width: 600px) {
  .spj-nprev {
    clip-path: polygon(0 0, 100% 0, calc(100% - 40px) 100%, 0 100%);
    border-right: none;
  }
  .spj-nnext {
    clip-path: polygon(40px 0, 100% 0, 100% 100%, 0 100%);
    margin-left: -40px;
  }
  .spj-nav-single .spj-nprev,
  .spj-nav-single .spj-nnext {
    clip-path: none;
    margin-left: 0;
  }
}

/* Content area */
.spj-nc {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
@media (min-width: 600px) { .spj-nc { padding: 0 28px; } }
.spj-nc-r { align-items: flex-end; text-align: right; }

/* Direction label */
.spj-nd {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono,'Space Mono',monospace);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: #3b82f6;
}
.spj-nd svg { transition: transform .4s cubic-bezier(.16,1,.3,1); flex-shrink: 0; }
.spj-nprev:hover .spj-nd svg { transform: translateX(-5px); }
.spj-nnext:hover .spj-nd svg { transform: translateX(5px); }

/* Project title — clamp so it never wraps to break layout */
.spj-nt {
  font-family: var(--display,'Space Grotesk',sans-serif);
  font-size: clamp(.95rem, 2.4vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.15;
  color: #fff;
  transition: transform .4s cubic-bezier(.16,1,.3,1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.spj-nprev:hover .spj-nt { transform: translateX(-3px); }
.spj-nnext:hover .spj-nt { transform: translateX(3px); }

/* Category */
.spj-ncat {
  font-family: var(--mono,'Space Mono',monospace);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: rgba(255,255,255,.5);
  white-space: nowrap;
}

/* Mobile — still single line, just tighter */
@media (max-width: 480px) {
  .spj-ni { height: 92px; }
  .spj-nc { padding: 0 12px; }
  .spj-nd { font-size: 8px; letter-spacing: .16em; }
  .spj-nt { font-size: .85rem; }
  .spj-ncat { display: none; }  /* hide category if very tight */
}

/* Light theme */
body.pa-light .spj-nav  { border-top-color: rgba(0,0,0,.08); }
body.pa-light .spj-nprev{ border-right-color: rgba(0,0,0,.08); }
body.pa-light .spj-nd   { color: #2563eb; }
body.pa-light .spj-nt   { color: #111827; }
body.pa-light .spj-ncat { color: rgba(0,0,0,.45); }
body.pa-light .spj-nov-l{ background: linear-gradient(to right, rgba(255,255,255,.85), rgba(255,255,255,.5) 60%, transparent); }
body.pa-light .spj-nov-r{ background: linear-gradient(to left,  rgba(255,255,255,.85), rgba(255,255,255,.5) 60%, transparent); }
