/* ==========================================================================
   Single project page — its own layout, same design language.
   Loaded only on /portfolio/item/*
   ========================================================================== */

/* ---------- hero: title overlapping a wide image ---------- */
.pj-hero { position: relative; padding-top: clamp(118px, 15vw, 170px); overflow: hidden; }
.pj-hero::before {
  content: ""; position: absolute; z-index: 0;
  width: 70vw; aspect-ratio: 1; left: -26vw; top: -30vw;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 62%);
  pointer-events: none;
}
.pj-hero .wrap { position: relative; z-index: 1; }

.pj-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-faint); margin-bottom: 22px; }
.pj-crumbs a:hover { color: var(--accent); }
.pj-crumbs span { opacity: 0.5; }

.pj-hero__top { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; }
@media (max-width: 780px) { .pj-hero__top { grid-template-columns: 1fr; align-items: start; } }

.pj-hero h1 { font-size: clamp(34px, 6.4vw, 72px); line-height: 1.02; max-width: 16ch; }
.pj-hero__sub { margin-top: 16px; font-size: clamp(15px, 1.7vw, 18px); color: var(--ink-soft); max-width: 58ch; }

.pj-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pj-tag {
  padding: 6px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-dark);
}
[data-skin="dark"] .pj-tag { color: var(--accent); }

/* Wide cover image, pulled up under the title block.
   No fixed aspect ratio and no cropping: these are curated shots — often
   device mockups — and forcing them into a frame slices the composition.
   The image sets its own height, so it is shown whole and stays centred at
   every width. max-height keeps a very tall image from taking over. */
.pj-cover {
  position: relative; margin-top: clamp(32px, 4.5vw, 56px);
  /* The frame hugs the image and centres itself, so a tall near-square shot
     is scaled down rather than letterboxed inside a wide box. */
  width: fit-content; max-width: 100%; margin-inline: auto;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow-lg);
  line-height: 0;
}
.pj-cover img {
  width: auto; max-width: 100%;
  height: auto; max-height: 72vh;
  display: block;
}

/* ---------- body: sticky spec rail + prose ---------- */
.pj-body { padding-top: clamp(36px, 4.4vw, 60px); }
.pj-layout { display: grid; grid-template-columns: 280px 1fr; gap: clamp(30px, 5vw, 70px); align-items: start; }
@media (max-width: 900px) { .pj-layout { grid-template-columns: 1fr; } }

.pj-rail { position: sticky; top: 104px; display: grid; gap: 2px; }
.pj-rail dl { display: grid; gap: 0; margin: 0; }

/* Below the sticky breakpoint the specs read better as a two-column block
   than as one tall stack. */
@media (max-width: 900px) {
  .pj-rail { position: static; }
  .pj-rail dl { grid-template-columns: 1fr 1fr; gap: 0 22px; }
  .pj-spec { padding: 14px 0; }
  .pj-spec:nth-last-of-type(2):nth-of-type(odd) { border-bottom: 0; }
}
@media (max-width: 420px) { .pj-rail dl { grid-template-columns: 1fr; } }

.pj-spec { padding: 16px 0; border-bottom: 1px solid var(--line); }
.pj-spec:last-of-type { border-bottom: 0; }
.pj-spec dt { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.pj-spec dd { margin: 7px 0 0; font-size: 15.5px; font-weight: 500; }

.pj-prose h2 { font-size: clamp(24px, 3vw, 34px); }
.pj-prose h2 + p { margin-top: 18px; }
.pj-prose p { margin-top: 16px; font-size: clamp(15px, 1.6vw, 17px); color: var(--ink-soft); line-height: 1.8; }
.pj-prose .lead { font-size: clamp(17px, 2vw, 20px); color: var(--ink); line-height: 1.65; }

/* ---------- features: numbered mosaic ---------- */
.pj-features { padding-top: clamp(40px, 5vw, 70px); }
.pj-features__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: clamp(20px, 2.6vw, 32px); }
.pj-features__head h2 { font-size: clamp(26px, 3.4vw, 40px); }
.pj-features__head span { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }

.pj-feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }

.pj-feat {
  position: relative; padding: clamp(24px, 2.8vw, 34px);
  background: var(--bg);
  transition: background-color 0.35s var(--ease);
}
.pj-feat:hover { background: var(--surface); }
.pj-feat::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); transform: scaleY(0); transform-origin: top;
  transition: transform 0.4s var(--ease);
}
.pj-feat:hover::after { transform: scaleY(1); }
.pj-feat__n {
  font-family: var(--font-head); font-size: 13px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--accent); opacity: 0.85;
}
.pj-feat h3 { font-size: 18px; margin-top: 12px; }
.pj-feat p { margin-top: 10px; font-size: 14.5px; color: var(--ink-soft); }

/* ---------- gallery: staggered ---------- */
.pj-gallery { padding-top: clamp(40px, 5vw, 70px); }
.pj-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(18px, 2.4vw, 28px); }
.pj-shot { border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); }
.pj-shot img { width: 100%; height: auto; transition: transform 0.7s var(--ease); }
.pj-shot:hover img { transform: scale(1.04); }
.pj-shot figcaption { padding: 14px 18px; font-size: 13.5px; color: var(--ink-faint); background: var(--surface); }
/* Lift every second tile so the grid doesn't read as a plain table. The
   translate adds no layout height, so the row below pays for it in padding. */
@media (min-width: 900px) {
  .pj-shots { padding-bottom: 34px; }
  .pj-shots > .pj-shot:nth-child(even) { transform: translateY(34px); }
  .pj-shots > .pj-shot:nth-child(even):hover { transform: translateY(30px); }
}

/* ---------- client feedback ---------- */
.pj-voice { padding-top: clamp(40px, 5vw, 70px); }

.pj-voices { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: clamp(18px, 2.4vw, 28px); }

.pj-voice__card {
  position: relative; display: flex; flex-direction: column;
  padding: clamp(28px, 3.4vw, 42px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.pj-voice__card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: transparent; }

.pj-voice__mark {
  font-family: var(--font-head); font-size: clamp(64px, 7vw, 92px); line-height: 0.75;
  color: var(--accent); opacity: 0.2;
}
.pj-voice__card blockquote { margin: 6px 0 0; flex: 1; }
.pj-voice__card blockquote p { font-size: clamp(15px, 1.7vw, 17px); color: var(--ink-soft); line-height: 1.75; }
.pj-voice__card blockquote p + p { margin-top: 12px; }

.pj-voice__stars { display: flex; gap: 3px; margin-top: 20px; color: #f5b301; }

.pj-voice__who { display: flex; align-items: center; gap: 15px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.pj-voice__avatar {
  flex: none; width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent); font-family: var(--font-head); font-weight: 700; font-size: 18px;
}
.pj-voice__avatar img { width: 100%; height: 100%; object-fit: cover; }
.pj-voice__who b { display: block; font-family: var(--font-head); font-size: 16.5px; }
.pj-voice__who small { color: var(--ink-faint); font-size: 13.5px; }

/* A single quote gets the full-width pull-quote treatment instead of a card
   stranded in a one-column grid. */
.pj-voices--single { grid-template-columns: 1fr; }
.pj-voices--single .pj-voice__card {
  align-items: center; text-align: center;
  padding: clamp(34px, 4.6vw, 64px);
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface));
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
}
.pj-voices--single .pj-voice__card blockquote { max-width: 70ch; }
.pj-voices--single .pj-voice__card blockquote p { font-size: clamp(17px, 2.1vw, 22px); color: var(--ink); line-height: 1.6; }
.pj-voices--single .pj-voice__who { justify-content: center; border-top: 0; padding-top: 6px; }

/* ---------- conclusion ---------- */
.pj-outro { padding-top: clamp(44px, 5.4vw, 78px); }
.pj-outro__inner {
  position: relative; padding: clamp(32px, 4.4vw, 60px);
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.pj-outro__inner h2 { font-size: clamp(24px, 3vw, 34px); }
.pj-outro__inner p { margin-top: 16px; font-size: clamp(15px, 1.6vw, 17px); color: var(--ink-soft); line-height: 1.8; max-width: 72ch; }
.pj-outro .btn { margin-top: 28px; }

/* ---------- relevant projects ----------
   Reuses the .works / .work grid from site.css so related work reads
   identically to the portfolio listing. */
.pj-related { margin-top: clamp(44px, 5.4vw, 78px); padding-top: clamp(28px, 3.4vw, 44px); border-top: 1px solid var(--line); }
.pj-related .pj-features__head { align-items: center; }
