/* ============================================================================
   project-detail.css — /projects/<slug>/
   Reading-first layout. Same restraint as projects.css: neutral surfaces,
   one emerald accent, hairline rules instead of boxes wherever possible.
   ========================================================================= */

.pd { padding-top: calc(var(--header-height) + 2rem); }

/* ==================== HERO ==================== */
.pd-hero { padding: 1rem 0 3rem; }

.pd__back {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono-font);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted-text);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: var(--transition-fast);
}
.pd__back:hover { color: var(--antique-gold); }

.pd__award {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono-font);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--antique-gold);
  margin-bottom: 1rem;
}

.pd__title {
  font-family: var(--serif-font);
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  font-weight: var(--font-regular);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ivory-text);
  margin-bottom: 0.9rem;
}

.pd__tagline {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--muted-text);
  max-width: 58ch;
  margin-bottom: 2.5rem;
}

.pd__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  padding: 1.5rem 0;
  border-top: var(--border-subtle);
  border-bottom: var(--border-subtle);
  margin-bottom: 2rem;
}

.pd__meta dt {
  font-family: var(--mono-font);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--subtle-text);
  margin-bottom: 0.35rem;
}

.pd__meta dd { font-size: 0.92rem; color: var(--parchment-text); }

.pd__links { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.pd__nolink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--muted-text);
  font-style: italic;
}

/* ==================== AT A GLANCE ==================== */
.pd-glance { padding: 1rem 0 3.5rem; }

.pd-glance__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--muted-graphite);
  border: 1px solid var(--muted-graphite);
  border-radius: var(--radius-medium);
  overflow: hidden;
}

.glance {
  background: var(--deep-charcoal);
  padding: 1.6rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.glance__v {
  font-family: var(--serif-font);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--antique-gold);
  font-weight: var(--font-medium);
}

.glance__l {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted-text);
}

/* ==================== BODY ==================== */
.pd-body { padding-bottom: 4rem; }

.pd-body__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 4rem;
  align-items: start;
}

.pd__lede {
  font-family: var(--serif-font);
  font-size: 1.28rem;
  line-height: 1.6;
  color: var(--ivory-text);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: var(--border-subtle);
}

.pd__h2 {
  font-family: var(--serif-font);
  font-size: 1.4rem;
  font-weight: var(--font-medium);
  color: var(--ivory-text);
  margin: 2.5rem 0 0.9rem;
}
.pd-prose > .pd__h2:first-of-type { margin-top: 0; }

.pd-prose p {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--parchment-text);
  max-width: 68ch;
}

.pd__list { list-style: none; margin-top: 0.5rem; }

.pd__list li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.9rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--parchment-text);
  max-width: 68ch;
}

.pd__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 6px;
  height: 1px;
  background: var(--antique-gold);
}

/* Sidebar */
.pd-aside {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  padding-left: 2rem;
  border-left: var(--border-subtle);
}

.pd-aside__h {
  font-family: var(--mono-font);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--subtle-text);
  margin-bottom: 1rem;
}

.pd-aside__stack { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }

.pd-aside__stack li {
  font-family: var(--mono-font);
  font-size: 0.8rem;
  color: var(--muted-text);
}

/* ==================== GALLERY ==================== */
.pd-gallery { padding: 3.5rem 0; border-top: var(--border-subtle); }

.pd-gallery__grid { display: grid; gap: 1.5rem; margin-top: 1.75rem; }
.pd-gallery__grid--multi { grid-template-columns: repeat(2, 1fr); }

.shot {
  background: var(--rich-black);
  border: var(--border-subtle);
  border-radius: var(--radius-medium);
  overflow: hidden;
  display: flex;
  justify-content: center;
  padding: 1.75rem;
}

.shot img { width: 100%; height: auto; display: block; border-radius: var(--radius-small); }
.shot--phone img { max-width: 300px; margin-inline: auto; }

/* ==================== ENGINEERING NOTES ==================== */
.pd-notes { padding: 3.5rem 0; border-top: var(--border-subtle); }

.pd-notes__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.note {
  background: var(--deep-charcoal);
  border: var(--border-subtle);
  border-radius: var(--radius-medium);
  padding: 1.6rem;
}

.note h3 {
  font-family: var(--serif-font);
  font-size: 1.08rem;
  font-weight: var(--font-medium);
  color: var(--ivory-text);
  margin-bottom: 0.65rem;
}

.note p { font-size: 0.93rem; line-height: 1.75; color: var(--muted-text); }

/* ==================== ASK ==================== */
.pd-ask {
  margin-top: 3rem;
  padding: 4.5rem 0;
  background: var(--deep-charcoal);
  border-top: var(--border-subtle);
}

.pd-ask__inner { max-width: 620px; margin-inline: auto; text-align: center; }

.pd-ask h2 {
  font-family: var(--serif-font);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--font-regular);
  color: var(--ivory-text);
  margin-bottom: 1rem;
}

.pd-ask p { color: var(--muted-text); line-height: 1.8; margin-bottom: 2rem; }

.pd-ask__actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* ==================== PAGER ==================== */
.pd-pager {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 3rem 0 5rem;
}

.pd-pager__link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-decoration: none;
  max-width: 45%;
  transition: var(--transition-fast);
}

.pd-pager__link span {
  font-family: var(--mono-font);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--subtle-text);
}

.pd-pager__link strong {
  font-family: var(--serif-font);
  font-size: 1.1rem;
  font-weight: var(--font-medium);
  color: var(--parchment-text);
  transition: var(--transition-fast);
}

.pd-pager__link:hover strong { color: var(--antique-gold); }
.pd-pager__link--next { text-align: right; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .pd-body__inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .pd-aside {
    position: static;
    padding-left: 0;
    padding-top: 1.75rem;
    border-left: none;
    border-top: var(--border-subtle);
  }
  .pd-aside__stack { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
  .pd-aside__stack li {
    border: var(--border-subtle);
    border-radius: 999px;
    padding: 0.22rem 0.65rem;
  }
  .pd-gallery__grid--multi { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .pd { padding-top: calc(var(--header-height) + 1rem); }
  .pd__meta { gap: 1.25rem 2rem; }
  .shot { padding: 1rem; }
  .pd-pager { flex-direction: column; }
  .pd-pager__link { max-width: 100%; }
  .pd-pager__link--next { text-align: left; }
}

/* ==================== GALLERY (framed) ==================== */
.pd-shots { padding: 3.5rem 0 1rem; border-top: var(--border-subtle); }

.pd-shots__lede {
  color: var(--muted-text);
  font-size: 0.98rem;
  line-height: 1.75;
  max-width: 60ch;
  margin: 0.4rem 0 2.75rem;
}

.pd-shots__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2rem;
}

.shot-fig { margin: 0; display: flex; flex-direction: column; gap: 1rem; }

.shot-fig figcaption {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted-text);
  text-align: center;
  max-width: 30ch;
  margin-inline: auto;
}

.shot-fig figcaption strong {
  display: block;
  color: var(--ivory-text);
  font-weight: var(--font-semi-bold);
  margin-bottom: 0.2rem;
}

@media (max-width: 900px) {
  .pd-shots__grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 1.5rem; }
}

@media (max-width: 560px) {
  .pd-shots__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .device { max-width: 230px; }
}

/* Single / non-phone shots: no hardware frame, just a mounted panel */
.pd-shots__grid--few { grid-template-columns: 1fr; max-width: 880px; }

.shot--flat {
  background: var(--rich-black);
  border: var(--border-subtle);
  border-radius: var(--radius-medium);
  overflow: hidden;
  padding: 1.5rem;
}
.shot--flat img { width: 100%; height: auto; display: block; border-radius: var(--radius-small); }

@media (max-width: 560px) { .shot--flat { padding: 0.9rem; } }

/* ============================================================================
   LIGHTBOX CAROUSEL
   Injected by projects.js. Without JS the gallery links open the image file
   directly, so nothing here is load-bearing for reading the page.
   ========================================================================= */
.shot-link {
  display: block;
  text-decoration: none;
  cursor: zoom-in;
  border-radius: 42px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.shot-link:hover { transform: translateY(-4px); }
.shot-link:focus-visible {
  outline: 2px solid var(--antique-gold);
  outline-offset: 6px;
}
.shot-link .shot--flat { display: block; border-radius: var(--radius-medium); }

.lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 3vw, 2.5rem);
  padding: clamp(1rem, 4vh, 3rem) clamp(0.75rem, 4vw, 3rem);
  background: rgba(6, 8, 10, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lb[hidden] { display: none; }

.js .lb { opacity: 0; transition: opacity 0.22s ease; }
.js .lb.is-open { opacity: 1; }

/* stage */
.lb__stage {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.lb .device {
  max-width: none;
  width: auto;
  padding: 16px;
  border-radius: 58px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.13), 0 30px 70px -20px rgba(0, 0, 0, 0.8);
}
.lb .device__screen {
  height: min(72vh, 760px);
  width: auto;
  border-radius: 44px;
}
/* percentage-based so the side buttons stay proportional when scaled up */
.lb .device::before { top: 17%; height: 13%; left: -3px; width: 4px; border-radius: 3px; }
.lb .device::after  { top: 22%; height: 9%;  right: -3px; width: 4px; border-radius: 3px; }

.lb .shot--flat {
  padding: 0;
  border: var(--border-subtle);
  background: var(--rich-black);
}
.lb .shot--flat img { max-height: min(74vh, 780px); width: auto; border-radius: 0; }

.lb__caption {
  text-align: center;
  max-width: 46ch;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted-text);
}
.lb__caption strong {
  display: block;
  color: var(--ivory-text);
  font-family: var(--serif-font);
  font-size: 1.15rem;
  font-weight: var(--font-medium);
  margin-bottom: 0.3rem;
}

/* controls */
.lb__btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ivory-text);
  font-size: 1.35rem;
  cursor: pointer;
  transition: var(--transition-fast);
}
.lb__btn:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--antique-gold); color: var(--antique-gold); }
.lb__btn:focus-visible { outline: 2px solid var(--antique-gold); outline-offset: 3px; }
.lb__btn[disabled] { opacity: 0.3; cursor: default; }

.lb__close { position: absolute; top: clamp(0.75rem, 3vh, 1.75rem); right: clamp(0.75rem, 3vw, 1.75rem); }

.lb__counter {
  font-family: var(--mono-font);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--subtle-text);
}

@media (max-width: 700px) {
  .lb { gap: 0.4rem; padding: 3.25rem 0.5rem 3rem; }
  .lb__btn { width: 40px; height: 40px; }
  .lb__nav { position: absolute; bottom: clamp(0.75rem, 3vh, 1.5rem); }
  .lb__nav--prev { left: 1.25rem; }
  .lb__nav--next { right: 1.25rem; }
  .lb .device__screen { height: min(62vh, 620px); }
  .lb__caption { font-size: 0.86rem; }
}

@media (prefers-reduced-motion: reduce) {
  .js .lb, .shot-link { transition: none; }
  .shot-link:hover { transform: none; }
}

.pd-shots__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.6rem;
  font-family: var(--mono-font);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--antique-gold);
  white-space: nowrap;
}
