/* ---------- Projects page ---------- */
.projects-page { background: var(--bg); }
.projects-page.modal-open { overflow: hidden; }

/* shared button */
.pj-btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 17px 34px 17px 40px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: none;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--heading);
  cursor: pointer;
  overflow: hidden;
  transition: color .4s ease;
}

.pj-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .55s cubic-bezier(.4,0,.2,1);
}

.pj-btn:hover { color: #fff; }
.pj-btn:hover::before { transform: scaleX(1); }
.pj-btn-arrow { display: flex; transition: transform .4s cubic-bezier(.4,0,.2,1); }
.pj-btn:hover .pj-btn-arrow { transform: translateX(5px); }

.pj-btn-light { border-color: #D9BE85; color: #fff; }
.pj-btn-light::before { background: #D9BE85; }
.pj-btn-light:hover { color: #0D1730; }

/* ---------- Hero ---------- */
.pj-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  contain: paint;
  color: #fff;
  background: #0D1730;
}

.pj-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 12vh;
  background: linear-gradient(to bottom, rgba(245,246,248,0) 0%, rgba(245,246,248,0.45) 55%, var(--bg) 100%);
  pointer-events: none;
  z-index: 2;
}

.pj-wall-wrap {
  position: absolute;
  inset: 0;
  perspective: 1600px;
  z-index: 0;
}

.pj-wall {
  position: absolute;
  left: -25%;
  right: -25%;
  top: 50%;
  display: flex;
  flex-direction: column;
  gap: 22px;
  transform: translateY(-50%) rotateX(24deg) rotateY(-10deg) rotateZ(-8deg);
  transform-style: preserve-3d;
}

.pj-row-track {
  display: flex;
  width: max-content;
  animation: pjMarquee 80s linear infinite;
}

.pj-row-rev .pj-row-track { animation-direction: reverse; animation-duration: 95s; }

.pj-row-track img {
  display: block;
  height: min(48vh, 440px);
  aspect-ratio: 700 / 988;
  margin-right: 22px;
  object-fit: cover;
  border-radius: 3px;
  filter: saturate(.8) brightness(.9);
}

.pj-hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(13,23,48,.97) 0%, rgba(13,23,48,.86) 38%, rgba(13,23,48,.5) 70%, rgba(13,23,48,.62) 100%),
    linear-gradient(to bottom, rgba(13,23,48,.7) 0%, rgba(13,23,48,0) 30%);
}

.pj-hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--nav-h) 48px 15vh;
}

.pj-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #D9BE85;
  opacity: 0;
}

.pj-eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: #D9BE85;
}

.pj-title {
  margin: 22px 0 24px;
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: clamp(44px, min(7.5vw, 15vh), 118px);
  line-height: 1.02;
  letter-spacing: -0.5px;
}

.pj-title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.pj-title .line > span { display: inline-block; transform: translateY(110%); }
.pj-title .accent { font-weight: 400; color: #D9BE85; }

.pj-lead {
  max-width: 480px;
  font-size: 15px;
  line-height: 1.8;
  color: rgba(230,233,238,0.75);
  opacity: 0;
}

.pj-stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  column-gap: clamp(32px, 5vw, 80px);
  margin-top: clamp(28px, 6vh, 56px);
  padding-top: clamp(18px, 3.5vh, 28px);
  border-top: 1px solid rgba(230,233,238,0.14);
  max-width: 920px;
}

.pj-stat { opacity: 0; transform: translateY(24px); }

.pj-stat dt {
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: clamp(32px, min(3.6vw, 8vh), 52px);
  line-height: 1;
}

.pj-stat sup {
  font-size: .45em;
  color: #D9BE85;
  vertical-align: top;
  position: relative;
  top: .2em;
  margin-left: 2px;
}

.pj-stat dd {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(230,233,238,0.58);
}

/* ---------- Flagship ---------- */
.pj-feature {
  position: relative;
  background: var(--bg);
}

.pj-feature-pin {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.pj-feature-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(26% 33% 12% 33% round 4px);
  will-change: clip-path;
}

.pj-feature-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.35);
}

.pj-feature-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(13,23,48,.9) 0%, rgba(13,23,48,.62) 42%, rgba(13,23,48,.08) 100%),
    linear-gradient(to top, rgba(13,23,48,.5) 0%, rgba(13,23,48,0) 40%);
  opacity: 0;
}

.pj-feature-intro {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(74% + 18px);
  text-align: center;
}

.pj-feature-intro .section-eyebrow { margin-bottom: 8px; }

.pj-feature-intro-line {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--body);
}

/* Fills the pin and centres in the space below the header, so it can't run off the bottom. */
.pj-feature-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--nav-h) 48px 28px;
  color: #fff;
  pointer-events: none;
}

.pj-feature-content > * { max-width: 640px; }
.pj-feature-content.is-live { pointer-events: auto; }

.pj-feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: #D9BE85;
  opacity: 0;
}

.pj-feature-tag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #D9BE85;
  box-shadow: 0 0 0 0 rgba(217,190,133,.6);
  animation: pjPulse 2.2s ease-out infinite;
}

.pj-feature-name {
  margin: 14px 0 18px;
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: clamp(48px, min(8vw, 14vh), 124px);
  line-height: .98;
  letter-spacing: -1px;
}

.pj-feature-name .pj-split { display: block; width: fit-content; }

.pj-split {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .08em;
}
.pj-split:last-child { font-weight: 400; }

.pj-char {
  display: inline-block;
  will-change: transform, opacity;
}

.pj-feature-desc {
  font-size: 15px;
  line-height: 1.8;
  color: rgba(230,233,238,0.8);
  max-width: 500px;
  opacity: 0;
}

.pj-feature-specs {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  column-gap: clamp(24px, 3vw, 48px);
  margin: clamp(18px, 4vh, 34px) 0 clamp(20px, 4.5vh, 38px);
}

.pj-feature-specs > div {
  padding-top: 14px;
  border-top: 1px solid rgba(217,190,133,0.4);
  opacity: 0;
}

.pj-feature-specs dt {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(230,233,238,0.55);
  margin-bottom: 6px;
}

.pj-feature-specs dd { font-size: 16px; }

.pj-feature-content .pj-btn { opacity: 0; }

/* Short laptop and browser windows: tighten the stack so it all fits. */
@media (max-height: 720px) {
  .pj-feature-content { padding-top: 76px; padding-bottom: 20px; }
  .pj-feature-name { margin: 8px 0 10px; font-size: clamp(40px, min(8vw, 12.5vh), 124px); }
  .pj-feature-desc { font-size: 14px; line-height: 1.6; }
  .pj-feature-specs { margin: 12px 0 16px; }
  .pj-feature-specs > div { padding-top: 10px; }
  .pj-feature-specs dd { font-size: 15px; }
  .pj-feature-content .pj-btn { padding: 13px 28px 13px 32px; }
}

@media (max-height: 540px) {
  .pj-feature-desc { display: none; }
}

/* ---------- Portfolio index ---------- */
.pj-index {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 150px 48px 100px;
}

.pj-index-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px 40px;
  margin-bottom: 64px;
}

.pj-index-head > div > *,
.pj-index-lead { opacity: 0; transform: translateY(30px); }

.pj-index-lead {
  max-width: 360px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--body);
}

.pj-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: clamp(20px, 2.4vw, 40px);
  row-gap: 76px;
  align-items: start;
  padding-bottom: 60px;
}

.pj-card { position: relative; }
.pj-card.is-hidden { display: none; }
.pj-card.is-offset { margin-top: 90px; }

.pj-card-hit {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  background: none;
  cursor: pointer;
}

.pj-card-media {
  position: relative;
  aspect-ratio: 700 / 988;
  overflow: hidden;
  background: var(--surface);
  clip-path: inset(0 0 0 0 round 3px);
  transition: clip-path .9s cubic-bezier(.2,.7,.2,1);
}

.pj-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(13,23,48,.78) 0%, rgba(13,23,48,0) 45%);
  opacity: 0;
  transition: opacity .7s ease;
}

.pj-card-media img {
  position: absolute;
  left: 0;
  top: -8%;
  width: 100%;
  height: 116%;
  object-fit: cover;
  scale: 1;
  transition: scale 1.4s cubic-bezier(.2,.7,.2,1);
}

.pj-status {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(245,246,248,0.92);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--heading);
  transition: transform .9s cubic-bezier(.2,.7,.2,1);
}

.pj-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8A94A6;
}

.pj-status.is-ongoing::before {
  background: var(--accent);
  animation: pjPulseDark 2.2s ease-out infinite;
}

.pj-status.is-upcoming::before {
  background: transparent;
  border: 1px solid var(--accent);
}

.pj-card-peek {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  z-index: 2;
  font-size: 13px;
  letter-spacing: .6px;
  color: #fff;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .8s cubic-bezier(.2,.7,.2,1);
}

.pj-card-body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: start;
  padding-top: 22px;
}

.pj-card-num {
  padding-top: 7px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--accent);
}

.pj-card-name {
  position: relative;
  display: inline-block;
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  font-size: clamp(19px, 1.65vw, 25px);
  line-height: 1.25;
  color: var(--heading);
}

.pj-card-name::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .7s cubic-bezier(.4,0,.2,1);
}

.pj-card-meta {
  margin-top: 9px;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--body);
}

.pj-card-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(20,33,61,0.16);
  border-radius: 50%;
  color: var(--heading);
  transition: background .5s ease, color .5s ease, border-color .5s ease, transform .7s cubic-bezier(.2,.7,.2,1);
}

@media (hover: hover) {
  .pj-card:hover .pj-card-media { clip-path: inset(14px 14px 14px 14px round 2px); }
  .pj-card:hover .pj-card-media::after { opacity: 1; }
  .pj-card:hover .pj-card-media img { scale: 1.09; }
  .pj-card:hover .pj-status { transform: translate(10px, 10px); }
  .pj-card:hover .pj-card-peek { opacity: 1; transform: translateY(0); }
  .pj-card:hover .pj-card-name::after { transform: scaleX(1); }
  .pj-card:hover .pj-card-arrow {
    background: var(--heading);
    border-color: var(--heading);
    color: #fff;
    transform: rotate(45deg);
  }
}

/* ---------- Category band ---------- */
.pj-band {
  padding: 30px 0 150px;
  overflow: hidden;
}

.pj-marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: pjMarquee 45s linear infinite;
}

.pj-marquee-track span {
  padding: 0 44px;
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: clamp(48px, 7vw, 110px);
  line-height: 1.1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(20,33,61,0.22);
  transition: color .6s ease;
}

.pj-marquee-track span:hover { color: var(--heading); }

.pj-marquee-track i {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}

/* ---------- Project detail overlay ---------- */
.pj-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  visibility: hidden;
  pointer-events: none;
}

.pj-modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.pj-modal-media {
  position: relative;
  overflow: hidden;
  background: #0D1730;
}

.pj-modal-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pj-modal-media-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(13,23,48,0) 70%, rgba(13,23,48,.35) 100%);
}

.pj-modal-panel {
  position: relative;
  background: var(--bg);
  overflow: hidden;
  box-shadow: -40px 0 80px -40px rgba(13,23,48,.6);
}

.pj-modal-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(var(--nav-h) + 6px) clamp(32px, 4vw, 64px) 40px;
}

.pj-modal-scroll > * { opacity: 0; }

.pj-modal-close {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 2;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(20,33,61,0.18);
  border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
  transition: background .4s ease, border-color .4s ease, transform .6s cubic-bezier(.2,.7,.2,1);
}

.pj-modal-close span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 1px;
  background: var(--heading);
  transition: background .4s ease;
}

.pj-modal-close span:first-child { transform: translate(-50%, -50%) rotate(45deg); }
.pj-modal-close span:last-child { transform: translate(-50%, -50%) rotate(-45deg); }

.pj-modal-close:hover {
  background: var(--heading);
  border-color: var(--heading);
  transform: rotate(90deg);
}

.pj-modal-close:hover span { background: #fff; }

.pj-modal-tag {
  display: inline-flex;
  padding: 7px 14px;
  border: 1px solid rgba(166,138,78,0.5);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}

.pj-modal-name {
  margin: 22px 0 10px;
  font-family: 'Jost', sans-serif;
  font-weight: 200;
  font-size: clamp(36px, 3.8vw, 58px);
  line-height: 1.05;
  color: var(--heading);
}

.pj-modal-loc {
  font-size: 11px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--accent);
}

.pj-modal-desc {
  margin-top: 22px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--body);
}

.pj-modal-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
  margin: 30px 0;
}

.pj-modal-specs > div {
  padding: 14px 0;
  border-top: 1px solid rgba(20,33,61,0.1);
}

.pj-modal-specs dt {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--body);
  margin-bottom: 5px;
}

.pj-modal-specs dd {
  font-size: 16px;
  color: var(--heading);
}

.pj-modal-label {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--body);
  margin-bottom: 14px;
}

.pj-modal-amen ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pj-modal-amen li {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  color: var(--heading);
}

.pj-modal-brochure { margin-top: 30px; }
.pj-modal-pdf-size { letter-spacing: 1px; text-transform: none; opacity: 0.75; }

.pj-modal-brochure-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pj-brochure-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid rgba(20,33,61,0.22);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--heading);
  transition: background .4s ease, border-color .4s ease, color .4s ease;
}

.pj-brochure-btn:hover {
  background: var(--heading);
  border-color: var(--heading);
  color: #fff;
}

.pj-modal-cta { margin-top: 34px; }

.pj-modal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid rgba(20,33,61,0.1);
}

.pj-modal-nav button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--heading);
  cursor: pointer;
  transition: color .3s ease;
}

.pj-modal-nav button:hover { color: var(--accent); }

.pj-modal-index {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--body);
}

/* ---------- Keyframes ---------- */
@keyframes pjMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes pjPulse {
  0% { box-shadow: 0 0 0 0 rgba(217,190,133,.6); }
  100% { box-shadow: 0 0 0 10px rgba(217,190,133,0); }
}

@keyframes pjPulseDark {
  0% { box-shadow: 0 0 0 0 rgba(166,138,78,.55); }
  100% { box-shadow: 0 0 0 8px rgba(166,138,78,0); }
}

@media (prefers-reduced-motion: reduce) {
  .pj-row-track, .pj-marquee-track { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .pj-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .pj-hero-content { padding: var(--nav-h) 24px 12vh; }
  .pj-wall { transform: translateY(-50%) rotateX(18deg) rotateZ(-8deg); }
  .pj-hero-shade { background: linear-gradient(to bottom, rgba(13,23,48,.85) 0%, rgba(13,23,48,.75) 60%, rgba(13,23,48,.6) 100%); }
  .pj-stats { grid-template-columns: repeat(2, auto); row-gap: 24px; }

  .pj-feature-media { clip-path: inset(28% 10% 16% 10% round 4px); }
  .pj-feature-intro { bottom: calc(72% + 14px); }
  .pj-feature-shade { background: linear-gradient(to bottom, rgba(13,23,48,.55) 0%, rgba(13,23,48,.82) 45%, rgba(13,23,48,.7) 100%); }
  .pj-feature-content { padding: var(--nav-h) 24px 20px; }
  .pj-feature-name { font-size: clamp(44px, 14vw, 80px); }
  .pj-feature-specs { grid-template-columns: repeat(3, auto); row-gap: 16px; }

  .pj-index { padding: 110px 20px 80px; }
  .pj-grid { row-gap: 56px; }
  .pj-card.is-offset { margin-top: 70px; }

  .pj-band { padding-bottom: 100px; }

  .pj-modal { grid-template-columns: 1fr; grid-template-rows: 36vh 1fr; }
  .pj-modal-scroll { padding: 34px 24px 34px; }
  .pj-modal-close { top: calc(-36vh + 20px); right: 20px; }
  .pj-modal-panel { overflow: visible; }
}

@media (max-width: 600px) {
  .pj-grid { grid-template-columns: 1fr; }
  .pj-card.is-offset { margin-top: 0; }
  .pj-modal-specs { grid-template-columns: 1fr; }
}
