/* Project pages (tools/build-projects.js). Classes start with pj-.
   Same colours and shapes as the rest of the site. Desktop is on the 1180px grid; phone rules are at the end. */

/* The logos carry width and height in the HTML (so space is kept while they load); keep their shape */
.brand img, .footer img { height: auto; }
.footer a[href^="tel:"] { white-space: nowrap; }

/* ===== Opening scene ===== */
.pj-hero { height: auto; padding-bottom: 150px; }
.pj-hero .wrap { display: grid; grid-template-columns: 450px minmax(0, 1fr); align-items: center; gap: 50px; padding: 158px 63px 0; }
.pj-hero .hero-copy { position: relative; top: auto; right: auto; width: auto; }
.pj-hero .eyebrow { font-size: 19px; line-height: 1.8; }
.pj-hero .hero-copy h1 { margin: 6px 0 12px; font-size: 48px; line-height: 1.55; }
.pj-hero .hero-copy h1 .pj-latin { font-family: Poppins, Alexandria, sans-serif; font-size: 17px; font-weight: 500; color: #d9c4f2; text-align: right; white-space: normal; }
.pj-hero .lead { font-size: 15px; line-height: 2.2; margin-bottom: 28px; }
.pj-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.pj-actions .btn-light { width: auto; height: 56px; padding: 0 30px; font-size: 14.5px; }
.pj-ghost { display: inline-flex; align-items: center; height: 56px; padding: 0 26px; border: 1px solid rgba(235, 205, 255, .6); border-radius: 99px; font-size: 14px; font-weight: 600; transition: background .25s, translate .25s; }
.pj-ghost:hover { background: rgba(255, 255, 255, .1); translate: 0 -3px; }

.pj-hero .hero-art { position: relative; top: auto; left: auto; width: auto; height: auto; }
.pj-frame { overflow: hidden; aspect-ratio: 16 / 9; border: 5px solid rgba(255, 255, 255, .92); border-radius: 22px; background: #1d0731; box-shadow: 0 30px 55px rgba(10, 0, 24, .55), 0 0 45px rgba(157, 71, 235, .45); }
.pj-frame img { width: 100%; height: 100%; object-fit: cover; }
.anim .pj-art .pj-frame { animation: pj-in 1.1s cubic-bezier(.2, .9, .25, 1) .35s backwards, hover-float 7s ease-in-out 1.5s infinite; }
@keyframes pj-in { from { opacity: 0; translate: -70px 60px; rotate: -6deg; } }

/* List page: three screens fanned out */
.pj-fan { min-height: 360px; }
.pj-fan .pj-frame { position: absolute; width: 400px; }
.pj-fan .pj-frame:nth-child(1) { right: 0; top: 0; rotate: 4deg; z-index: 1; }
.pj-fan .pj-frame:nth-child(2) { left: 0; top: 76px; rotate: -6deg; z-index: 2; }
.pj-fan .pj-frame:nth-child(3) { right: 60px; top: 158px; rotate: 2deg; z-index: 3; }
.anim .pj-fan .pj-frame { animation: pj-in 1.1s cubic-bezier(.2, .9, .25, 1) .35s backwards, float 6s ease-in-out 1.5s infinite; }
.anim .pj-fan .pj-frame:nth-child(2) { animation-delay: .55s, 2.4s; }
.anim .pj-fan .pj-frame:nth-child(3) { animation-delay: .75s, 3.3s; }
.pj-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: linear-gradient(transparent, #f4eefb); }
.anim .hero.pj-hero::after { height: 70px; background: linear-gradient(transparent, #f4eefb); }

/* ===== Project facts, overlapping the opening scene ===== */
.pj-facts { position: relative; z-index: 3; margin-top: -92px; }
.pj-facts dl { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 40px; padding: 28px 10px; border-radius: 28px; color: #fff; text-align: center; background: radial-gradient(ellipse at 100% 40%, #9b35d4, transparent 45%), linear-gradient(90deg, #35104f, #290a43 55%, #571892); box-shadow: 0 18px 36px rgba(60, 15, 105, .28); }
.pj-facts dl > div { padding: 0 16px; }
.pj-facts dl > div + div { border-right: 1px solid rgba(190, 135, 240, .35); }
.pj-facts dt { font-size: 12px; font-weight: 300; color: #d3b6ee; }
.pj-facts dd { margin-top: 5px; font-size: 14.5px; font-weight: 600; line-height: 1.8; }

.pj-section { padding: 58px 0 6px; }
.pj-section:last-of-type { padding-bottom: 30px; }
.pj-section .s-head { margin-bottom: 28px; }

/* ===== Screenshot gallery ===== */
.pj-gallery { max-width: 940px; margin: 0 auto; }
.pj-slides { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: 24px; box-shadow: 0 22px 44px rgba(70, 20, 120, .22); }
.pj-slides::-webkit-scrollbar { display: none; }
.pj-slides figure { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 24px; background: #1d0731; }
.pj-slides img { width: 100%; height: 100%; object-fit: cover; }
.pj-thumbs { display: flex; justify-content: center; gap: 14px; margin-top: 16px; }
.pj-thumbs button { width: 150px; padding: 0; overflow: hidden; aspect-ratio: 16 / 9; border: 3px solid #fff; border-radius: 12px; background: #1d0731; box-shadow: 0 8px 18px rgba(70, 20, 120, .16); cursor: pointer; opacity: .6; transition: opacity .3s, translate .3s, border-color .3s; }
.pj-thumbs button:hover { translate: 0 -4px; opacity: 1; }
.pj-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--violet); }
.pj-thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Before and after ===== */
.pj-story .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 0 60px; }
.pj-block { position: relative; overflow: hidden; padding: 30px 30px 24px; border-radius: 28px; }
.pj-before { background: #fff; box-shadow: 0 14px 32px rgba(96, 40, 150, .12); }
.pj-after { color: #fff; background: radial-gradient(ellipse at 100% 0, rgba(155, 53, 212, .75), transparent 55%), linear-gradient(150deg, #35104f, #290a43 55%, #4d1580); box-shadow: 0 18px 38px rgba(60, 15, 105, .3); }
.pj-num { position: absolute; left: 22px; top: 8px; font: 800 62px Poppins, sans-serif; color: var(--violet); opacity: .13; }
.pj-after .pj-num { color: #fff; }
.pj-block h2 { margin-bottom: 16px; font-size: 21px; line-height: 1.8; }
.pj-block ul { list-style: none; }
.pj-block li { position: relative; padding: 10px 34px 10px 0; font-size: 13.5px; line-height: 2.1; }
.pj-block li + li { border-top: 1px solid rgba(150, 90, 200, .2); }
.pj-block li::before { position: absolute; right: 0; top: 15px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700; }
.pj-before li::before { content: "!"; color: var(--violet); background: #f0e5fb; }
.pj-after li::before { content: "✓"; color: #2c0c4a; background: #d9adff; }
.pj-results { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; list-style: none; text-align: center; }
.pj-results li { padding: 20px 14px; border: 1px solid #fff; border-radius: 22px; background: linear-gradient(135deg, #fdfbff, #f0e7fa); box-shadow: 0 12px 26px rgba(96, 40, 150, .13); }
.pj-results b { display: block; font-size: 36px; font-weight: 800; color: var(--violet); }
.pj-results small { display: block; font-size: 12.5px; line-height: 1.9; color: #4a2c66; }

/* ===== Work steps ===== */
.pj-steps { position: relative; max-width: 780px; margin: 0 auto; list-style: none; }
.pj-steps::before, .pj-steps::after { content: ""; position: absolute; top: 24px; bottom: 24px; right: 23px; width: 3px; border-radius: 3px; background: #e2cbf8; }
.pj-steps::after { background: linear-gradient(#a52fd0, #5a1596); transform-origin: top; scale: 1 var(--fill, 0); }
.pj-steps li { position: relative; display: flex; align-items: flex-start; gap: 20px; padding-bottom: 18px; }
.pj-steps li > span { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 49px; height: 49px; border: 3px solid #e2cbf8; border-radius: 50%; font: 700 14px Poppins, sans-serif; color: var(--violet); background: #fff; transition: background .35s, color .35s, border-color .35s, scale .35s; }
.pj-steps li.reached > span { color: #fff; border-color: #a52fd0; background: var(--violet); scale: 1.06; }
.pj-steps li > div { flex: 1; min-width: 0; padding: 16px 22px; border-radius: 20px; background: #fff; box-shadow: 0 10px 24px rgba(96, 40, 150, .11); }
.pj-steps h3 { font-size: 16px; line-height: 1.8; }
.pj-steps p { font-size: 13px; line-height: 2.2; color: #4a2c66; }

/* ===== Technologies ===== */
.pj-tech { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 0 16px; list-style: none; }
.pj-tech li { padding: 11px 24px; border-radius: 99px; font-size: 13.5px; font-weight: 600; color: #fff; background: linear-gradient(90deg, #a52fd0, #641aa6); box-shadow: 0 8px 18px rgba(120, 35, 180, .25); }

/* ===== Previous, next and other projects ===== */
.pj-around { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin: 0 60px 50px; }
.pj-around > a { padding: 16px 24px; border-radius: 22px; background: #fff; box-shadow: 0 12px 26px rgba(96, 40, 150, .13); transition: translate .3s, box-shadow .3s; }
.pj-around > a:hover { translate: 0 -5px; box-shadow: 0 20px 36px rgba(96, 40, 150, .24); }
.pj-around a[rel="next"] { text-align: left; }
.pj-around small { display: block; font-size: 11.5px; color: #6c4a8c; }
.pj-around b { display: block; font-size: 16px; line-height: 1.8; }
.pj-around .pj-all { padding: 12px 24px; border: 2px solid var(--violet); border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--violet); background: transparent; box-shadow: none; }

.pj-grid { display: grid; grid-template-columns: repeat(3, 340px); justify-content: center; gap: 24px; }
.pj-card { display: block; overflow: hidden; border-radius: 22px; background: #fff; box-shadow: 0 16px 34px rgba(80, 25, 135, .16); transition: transform .3s, box-shadow .3s; }
.pj-card[hidden] { display: none; }
.pj-card:hover, .pj-card:focus-visible { transform: translateY(-7px); box-shadow: 0 28px 46px rgba(80, 25, 135, .28); }
.pj-card.show { animation: pj-show .55s ease backwards; }
@keyframes pj-show { from { opacity: 0; scale: .85; } }
.pj-card-shot { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #1d0731; }
.pj-card-shot img { width: 100%; height: 100%; object-fit: cover; transition: scale .8s; }
.pj-card:hover img { scale: 1.07; }
.pj-card-body { display: block; padding: 14px 18px 18px; }
.pj-card-body small { display: block; font-size: 11.5px; font-weight: 600; color: var(--violet); }
.pj-card-body h2, .pj-card-body h3 { font-size: 18px; line-height: 1.9; }
.pj-card-body em { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12.5px; font-style: normal; font-weight: 600; color: var(--violet); }
.pj-card-body em svg { width: 15px; height: 15px; transition: translate .25s; }
.pj-card:hover em svg { translate: -6px 0; }

.pj-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 30px; padding: 0 14px; }
.pj-filters button { padding: 11px 24px; border: 1px solid #dcc2f5; border-radius: 99px; font: 600 13.5px Alexandria, sans-serif; color: var(--ink); background: #fff; cursor: pointer; transition: background .25s, color .25s, translate .25s; }
.pj-filters button:hover { translate: 0 -3px; }
.pj-filters button[aria-pressed="true"] { border-color: transparent; color: #fff; background: linear-gradient(90deg, #a52fd0, #641aa6); }

.pj-more { margin-top: 30px; text-align: center; }
.pj-more a { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--violet); }
.pj-more a:hover { text-decoration: underline; }
.pj-more svg { width: 17px; height: 17px; }

/* ===== Phones and small tablets ===== */
@media (max-width: 899px) {
  .pj-hero { padding-bottom: 118px; }
  .pj-hero .wrap { display: block; padding: 0; }
  .pj-hero .hero-copy { padding: 14px 22px 0; text-align: center; }
  .pj-hero .eyebrow { font-size: 15px; }
  .pj-hero .hero-copy h1 { font-size: clamp(28px, 8.6vw, 44px); }
  .pj-hero .hero-copy h1 span { white-space: normal; }
  .pj-hero .hero-copy h1 .pj-latin { font-size: 14px; text-align: center; }
  .pj-hero .lead { max-width: 560px; margin: 0 auto 20px; font-size: 13.5px; }
  .pj-actions { justify-content: center; gap: 10px; }
  .pj-actions .btn-light, .pj-ghost { height: 50px; padding: 0 22px; font-size: 13px; }
  .pj-hero .hero-art { width: auto; max-width: 620px; margin: 28px auto 0; padding: 0 20px; transform: none; }
  .pj-frame { border-width: 3px; border-radius: 16px; }
  .pj-hero .pj-fan { height: calc(min(100vw, 560px) * .62); min-height: 0; max-width: 560px; padding: 0; }
  .pj-fan .pj-frame { width: 62%; }
  .pj-fan .pj-frame:nth-child(1) { right: 6%; }
  .pj-fan .pj-frame:nth-child(2) { left: 6%; top: 17%; }
  .pj-fan .pj-frame:nth-child(3) { right: 16%; top: 40%; }

  .pj-facts { margin-top: -78px; }
  .pj-facts dl { grid-template-columns: 1fr 1fr; row-gap: 16px; margin: 0 14px; padding: 20px 4px; border-radius: 22px; }
  .pj-facts dl > div { min-width: 0; padding: 0 9px; }
  .pj-facts dl > div:nth-child(3) { border-right: 0; }
  .pj-facts dd { font-size: 12.5px; overflow-wrap: anywhere; }

  .pj-section { padding: 42px 0 4px; }
  .pj-gallery { padding: 0 14px; }
  .pj-slides { gap: 10px; border-radius: 16px; }
  .pj-slides figure { border-radius: 16px; }
  .pj-thumbs { gap: 8px; margin-top: 12px; }
  .pj-thumbs button { flex: 1; width: auto; max-width: 130px; min-width: 0; border-width: 2px; border-radius: 9px; }

  .pj-story .wrap { grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 600px; padding: 0 14px; }
  .pj-block { padding: 20px 18px 14px; border-radius: 22px; }
  .pj-num { font-size: 46px; left: 16px; }
  .pj-block h2 { padding-left: 50px; font-size: 17.5px; }
  .pj-block li { padding-right: 32px; font-size: 13px; }
  .pj-results { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .pj-results li { padding: 14px 5px; border-radius: 16px; }
  .pj-results b { font-size: clamp(20px, 6.6vw, 32px); }
  .pj-results small { font-size: clamp(10px, 2.9vw, 12px); }

  .pj-steps { max-width: 600px; margin: 0 auto; padding: 0 14px; }
  .pj-steps::before, .pj-steps::after { right: 32px; }
  .pj-steps li { gap: 10px; padding-bottom: 12px; }
  .pj-steps li > span { width: 39px; height: 39px; font-size: 12px; }
  .pj-steps li > div { padding: 12px 14px; border-radius: 16px; }
  .pj-steps h3 { font-size: 14px; }
  .pj-steps p { font-size: 12.5px; }

  .pj-tech { gap: 8px; }
  .pj-tech li { padding: 9px 17px; font-size: 12.5px; }

  .pj-around { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; max-width: 600px; margin: 0 auto 38px; padding: 0 14px; }
  .pj-around > a { padding: 12px 14px; border-radius: 16px; }
  .pj-around b { font-size: 13.5px; }
  .pj-around .pj-all { grid-row: 2; grid-column: 1 / -1; justify-self: center; }

  .pj-grid { grid-template-columns: minmax(0, 440px); gap: 16px; padding: 0 16px; }
  .pj-filters { gap: 8px; margin-bottom: 20px; }
  .pj-filters button { padding: 9px 16px; font-size: 12.5px; }
}
@media (min-width: 560px) and (max-width: 899px) {
  .pj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; margin: 0 auto; }
}
