/* Projects index, the per-project pages and the media lightbox.
   Loaded after pages.css, which owns the shared chrome and type.
   Screenshots are hung like the portrait on the about page: an ink frame with
   a woven stitch mat, so the border never sits directly on the artwork. */

body.projects-page,
body.project-page {
  --acc: var(--leaf);
  --acc-soft: var(--stem);
  --card-thumb-h: 168px;
  --shot-h: 440px;
  --mat: 12px;
  --mat-bg: var(--bg);
  --lb-backdrop: rgba(254, 254, 254, 0.94);
  --lift: 0 10px 26px rgba(45, 20, 8, 0.16);
}

/* ===== index ===== */
body.projects-page .title-stitch {
  margin-bottom: 32px;
}
.lede {
  font-size: 13px;
  color: var(--grey-dk);
  margin: -20px 0 34px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
  max-width: 1000px;
}
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border: 2px solid var(--ink);
  background: #fff;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover,
.card:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--ink);
  color: inherit;
  outline: none;
}
.thumb {
  height: var(--card-thumb-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.wordmark-jule {
  margin: 0;
  font-family: "Avenir Next Rounded", Nunito, Quicksand, "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;
  font-weight: 600;
  font-size: 56px;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #e95031;
}
.project-logo .wordmark-jule {
  font-size: 28px;
}
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 20px 16px;
  border-top: 2px solid var(--ink);
}
.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 900;
}
.card p {
  font-size: 13.5px;
  margin: 0;
  line-height: 1.6;
}
.card-open {
  margin-top: auto;
  padding-top: 14px;
  font-size: 11px;
  font-weight: 900;
  color: var(--grey-dk);
  transition: color 0.12s ease;
}
.card:hover .card-open,
.card:focus-visible .card-open {
  color: var(--stem);
}

/* ===== per-project page ===== */
.project-head {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 92ch;
  margin-bottom: 26px;
}
.project-logo {
  width: 84px;
  height: 84px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  background: #fff;
  padding: 9px;
}
.project-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.tagline {
  font-size: 13px;
  color: var(--grey-dk);
  font-style: italic;
  line-height: 1.6;
  margin: 0;
  max-width: 56ch;
}
.project-body p {
  font-size: 14px;
  max-width: 92ch;
}
.axes-table {
  width: 100%;
  max-width: 92ch;
  margin: 0 0 28px;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
}
.axes-table th,
.axes-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px 10px 0;
  border-top: 1.5px solid var(--ink);
}
.axes-table th {
  width: 12ch;
  font-weight: 900;
  white-space: nowrap;
}
.axes-table tr:last-child th,
.axes-table tr:last-child td {
  border-bottom: 1.5px solid var(--ink);
}
.axes-table .ax-vals {
  display: block;
  color: var(--grey-dk);
  font-size: 12px;
  margin-top: 4px;
}
.credit {
  font-size: 12px;
  color: var(--grey-dk);
  margin: -14px 0 24px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.links a {
  display: inline-block;
  font-size: 12px;
  text-decoration: none;
  padding: 6px 13px;
  border: 2px solid var(--ink);
  background: #fff;
  transition: color 0.12s ease, background 0.12s ease;
}
.links a:hover,
.links a:focus-visible {
  background: var(--ink);
  color: var(--petal-bright);
  outline: none;
}

.embed {
  --embed-scale: 0.72;
  --embed-h: min(58vh, 540px);
  max-width: none;
  width: min(100%, 960px);
  height: var(--embed-h);
  margin: 4px 0 36px;
  border: 2px solid var(--ink);
  background: var(--mat-bg);
  overflow: hidden;
}
.embed iframe {
  display: block;
  width: calc(100% / var(--embed-scale));
  height: calc(var(--embed-h) / var(--embed-scale));
  border: 0;
  background: #fff;
  transform: scale(var(--embed-scale));
  transform-origin: top left;
}

/* ===== media: every item is framed, and opens in the lightbox ===== */
.screens {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  padding: 4px 0 0;
}
.shot {
  position: relative;
  flex: none;
  height: var(--shot-h);
  padding: var(--mat);
  font-family: inherit;
  appearance: none;
  border: 2px solid var(--ink);
  background: var(--mat-bg);
  cursor: zoom-in;
  line-height: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.shot:hover,
.shot:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--ink);
  outline: none;
}
.shot img,
.shot video {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
}
.shot.is-inline {
  cursor: default;
}
.shot.is-inline video {
  pointer-events: auto;
}
.shot.is-inline:hover,
.shot.is-inline:focus-visible {
  transform: none;
  box-shadow: none;
}
.shot.is-inline::after {
  content: none;
}
.shot::after {
  content: "\2922";
  position: absolute;
  right: calc(var(--mat) + 6px);
  bottom: calc(var(--mat) + 6px);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 7px;
  color: var(--ink);
  background: rgba(254, 254, 254, 0.94);
  border: 1.5px solid var(--ink);
  opacity: 0;
  transition: opacity 0.12s ease;
}
.shot:hover::after,
.shot:focus-visible::after {
  opacity: 1;
}
.shot.is-video::after {
  content: "\25B6";
  opacity: 0.94;
}

/* ===== lightbox: paper, not a dark room ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 56px clamp(14px, 5vw, 64px);
  background: var(--lb-backdrop);
  backdrop-filter: blur(8px);
}
.lightbox.open {
  display: flex;
  animation: lb-in 0.16s ease both;
}
@keyframes lb-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
body.lb-open {
  overflow: hidden;
}

.lb-stage {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.lb-media {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  padding: var(--mat);
  border: 2px solid var(--ink);
  background: var(--mat-bg);
  box-shadow: var(--lift);
}
.lb-media img,
.lb-media video {
  display: block;
  max-width: min(88vw, 1200px);
  max-height: calc(100vh - 190px);
  width: auto;
  height: auto;
}
.lb-caption {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--ink);
}
.lb-count {
  color: var(--grey-md);
}

.lb-close,
.lb-nav {
  flex: none;
  font-family: inherit;
  font-weight: 900;
  color: var(--ink);
  background: rgba(254, 254, 254, 0.9);
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}
.lb-close:hover,
.lb-nav:hover,
.lb-close:focus-visible,
.lb-nav:focus-visible {
  color: var(--petal-bright);
  background: var(--ink);
  outline: none;
}
.lb-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  font-size: 20px;
  line-height: 1;
}
.lb-nav {
  width: 42px;
  height: 42px;
  font-size: 15px;
  line-height: 1;
}
.lb-nav[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  body.projects-page,
  body.project-page {
    --shot-h: 360px;
  }
}
@media (max-width: 720px) {
  body.projects-page,
  body.project-page {
    --shot-h: 280px;
    --mat: 8px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .lightbox {
    padding: 56px 10px;
  }
  .lb-nav {
    position: absolute;
    bottom: 14px;
  }
  .lb-prev { left: 14px; }
  .lb-next { right: 14px; }
}
