/* ============ PROJECT DECK (featured-project case-study modal) ============
   Markup + data live in projects.js. Slides per project, evidence-board
   captions, cut-rail progress. Matches the drop-list modal's glass language. */

.pdeck {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0px, 2vw, 28px);
}

/* the hidden attribute must ALWAYS win over display:flex above */
.pdeck[hidden] { display: none !important; }

.pdeck-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 6, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.pdeck-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1060px, 96vw);
  height: min(700px, 92dvh);
  background: rgba(19, 19, 21, 0.86);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
}

/* signature hairline: red -> bronze -> out */
.pdeck-hairline {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-deep) 34%, var(--bronze) 62%, transparent 92%);
  z-index: 3;
}

/* ---------- head ---------- */
.pdeck-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(20px, 3.4vw, 38px) 14px;
}

.pdeck-crumb {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdeck-crumb .slash { color: var(--red); }
.pdeck-crumb b { color: var(--ink); font-weight: 600; }

.pdeck-x {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 20px; line-height: 1;
  color: var(--ink-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.pdeck-x:hover { color: var(--ink); border-color: var(--red); transform: rotate(90deg); }

/* ---------- stage ---------- */
.pdeck-stage {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px clamp(20px, 3.4vw, 38px) 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.pslide { display: grid; gap: clamp(18px, 2.6vw, 34px); }

.pslide .tag { margin-bottom: 0; }

.pslide-title {
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 10px 0 0;
}
.pslide-title em { font-style: normal; color: var(--red); }

.pslide-body { max-width: 62ch; }
.pslide-body p {
  color: var(--ink-dim);
  font-size: clamp(14.5px, 1.15vw, 16.5px);
  line-height: 1.65;
  margin: 0 0 14px;
}
.pslide-body p:last-child { margin-bottom: 0; }
.pslide-body strong { color: var(--ink); font-weight: 600; }

/* inline links: brand red, lifted underline, room to breathe */
.pslide-body a,
.pcap a {
  color: var(--red);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(225, 30, 36, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  margin-inline: 0.09em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.pslide-body a:hover,
.pcap a:hover {
  color: var(--ink);
  text-decoration-color: var(--red);
}

/* feature: media + copy split */
.pslide-feature {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
}
.pslide-feature .pmedia { order: 2; }

.pmedia {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: var(--rad);
  overflow: hidden;
  background: var(--bg-2);
}
.pmedia img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: cover;
}

/* evidence-board style caption */
.pcap {
  position: absolute;
  left: 12px; bottom: 12px;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(11, 11, 12, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--rad-sm);
}
.pcap::before {
  content: "";
  display: inline-block;
  width: 14px; height: 1px;
  background: var(--red);
  vertical-align: middle;
  margin-right: 8px;
}

/* gallery grid */
.pgallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 14px;
}
.pgallery .pmedia img { aspect-ratio: 4 / 3; max-height: 340px; }

/* pair: two tall portrait images side by side */
.ppair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 780px;
}
.ppair .pmedia img {
  aspect-ratio: 3 / 4;
  max-height: 470px;
  width: 100%;
  object-fit: cover;
}

/* stats: big display numerals like .numbers */
.pstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px 26px;
  padding: 22px 0 4px;
  border-top: 1px solid var(--line-soft);
}
.pstats > div { min-width: 0; }
.pstats dt {
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.06;
  color: var(--bronze);
  text-transform: uppercase;
}
.pstats dt.is-red { color: var(--red); }
.pstats dd {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 8px 0 0;
}

/* optional CTA row */
.pslide-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- foot ---------- */
.pdeck-foot {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 26px);
  padding: 16px clamp(20px, 3.4vw, 38px);
  border-top: 1px solid var(--line-soft);
  background: rgba(11, 11, 12, 0.5);
}

.pdeck-nav {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  color: var(--ink);
  font-size: 17px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.pdeck-nav:hover { border-color: var(--red); }
.pdeck-nav.is-jump { border-color: var(--red); color: var(--red); }
.pdeck-nav.is-jump:hover { background: var(--red); color: #fff; }

/* cut-rail progress ticks (echoes the bench HUD) */
.pdeck-rail {
  flex: 1;
  display: flex;
  gap: 7px;
  align-items: center;
}
.pdeck-rail i {
  flex: 1;
  max-width: 44px;
  height: 2px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 2px;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.pdeck-rail i.is-on {
  background: var(--red);
  box-shadow: 0 0 8px rgba(225, 30, 36, 0.55);
}

.pdeck-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
  white-space: nowrap;
}
.pdeck-count b { color: var(--ink); font-weight: 600; }

/* clickable cards */
.proj[data-project] { cursor: pointer; }

/* ---------- mobile sheet ---------- */
@media (max-width: 720px) {
  .pdeck { padding: 0; align-items: stretch; }
  .pdeck-dialog {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border-left: 0; border-right: 0; border-bottom: 0;
  }
  .pslide-feature { grid-template-columns: 1fr; }
  .pslide-feature .pmedia { order: 0; }
  .pmedia img { max-height: 40dvh; }
  .pslide-title { font-size: clamp(28px, 9vw, 38px); }
  .pdeck-rail i { max-width: none; }
}
