/* ═══════════════════════════════════════════════════════════════
   TENNERI · Projects page
   Loads after ../style.css and reuses its theme tokens
═══════════════════════════════════════════════════════════════ */

/* No film strip on this page */
body[data-page="projects"] { padding-right: 0 !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Nav sits over the dark showcase until it becomes the pill */
body[data-page="projects"] nav:not(.scrolled) .n-links a:not(.n-cta) { color: rgba(242,237,228,0.72); }
body[data-page="projects"] nav:not(.scrolled) .n-links a:not(.n-cta):hover { color: #f2ede4; }
body[data-page="projects"] nav:not(.scrolled) .n-logo-name { color: #f2ede4; }
body[data-page="projects"] nav:not(.scrolled) .n-ham span { background: #f2ede4; }
body[data-page="projects"] .n-links a[aria-current="page"]:not(.n-cta) { color: var(--gold-lt) !important; }

/* ═══════════════ SHOWCASE ═══════════════ */
.pj-show {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: #04060e;
  color: #f2ede4;
  isolation: isolate;
}
.pj-cards { position: absolute; inset: 0; }

.pj-card {
  position: absolute; left: 0; top: 0;
  padding: 0; margin: 0; border: 0;
  background: #0c1020;
  color: inherit; font: inherit; text-align: left;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  transform-origin: center center;
}
.pj-card.is-active { pointer-events: none; box-shadow: none; }
.pj-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.pj-card { container-type: size; }
.pj-card-media { position: absolute; inset: 0; background: #04060e; overflow: hidden; }

/* The screenshot (or video) sits in its own frame inside the card */
.pj-card-shot {
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  container-type: size;
  overflow: hidden;
  /* Fit the full width of the screenshot, anchored to the top */
  background-size: 100% auto;
  background-position: center top;
  background-repeat: no-repeat;
  transition: transform 0.6s var(--ease);
}
.pj-card:not(.is-active):hover .pj-card-shot { transform: scale(1.06); }

/* Feathered edges so the framed screenshot melts into the background */
.pj-card-shot::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity 0.8s ease;
  background:
    linear-gradient(90deg, #04060e 0%, rgba(4,6,14,0) 28%),
    linear-gradient(180deg, #04060e 0%, rgba(4,6,14,0) 16%),
    linear-gradient(0deg, #04060e 0%, rgba(4,6,14,0) 18%),
    linear-gradient(270deg, rgba(4,6,14,0.6) 0%, rgba(4,6,14,0) 8%);
}

/* Frame size and position are driven by projects.js so they move with the card */
@media (min-width: 820px) {
  .pj-card.is-full .pj-card-shot::after { opacity: 1; }
}

/* Video (ROSe): cover its frame at any size */
.pj-card-shot iframe {
  position: absolute; top: 50%; left: 50%;
  width: max(100cqw, 177.78cqh);
  height: max(100cqh, 56.25cqw);
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

.pj-card-shade {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4,6,14,0.94) 0%, rgba(4,6,14,0.78) 32%, rgba(4,6,14,0.3) 60%, rgba(4,6,14,0.35) 100%),
    linear-gradient(0deg, rgba(4,6,14,0.85) 0%, rgba(4,6,14,0) 42%),
    linear-gradient(180deg, rgba(4,6,14,0.55) 0%, rgba(4,6,14,0) 22%);
}

.pj-card-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 14px 12px;
  background: linear-gradient(0deg, rgba(4,6,14,0.92) 20%, rgba(4,6,14,0));
  display: flex; flex-direction: column; gap: 4px;
  pointer-events: none;
}
.pj-card-bar { width: 22px; height: 3px; border-radius: 9px; background: var(--gold); margin-bottom: 4px; }
.pj-card-kicker {
  font-family: var(--f-m); font-size: 0.64rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(242,237,228,0.72);
}
.pj-card-title { font-family: var(--f-d); font-size: 1.32rem; line-height: 1.1; color: #f2ede4; }
.pj-card-title em { font-style: italic; color: var(--gold-lt); }

/* Details panel */
.pj-details {
  position: absolute; z-index: 50;
  left: clamp(24px, 5vw, 72px);
  top: 120px;
  width: min(46vw, 620px);
}
.pj-eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--f-m); font-size: 0.62rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: rgba(242,237,228,0.55);
  margin-bottom: 22px;
}
.pj-eyebrow::before { content: ''; width: 26px; height: 1px; background: var(--gold); flex-shrink: 0; }
.pj-mask { overflow: hidden; }
.pj-kicker {
  font-family: var(--f-m); font-size: 0.84rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold-lt);
  padding-bottom: 14px;
}
.pj-t1, .pj-t2 {
  font-family: var(--f-d); font-weight: 300;
  font-size: clamp(2.8rem, 5.8vw, 6rem);
  line-height: 1.02; letter-spacing: -0.025em;
  white-space: nowrap;
  padding-bottom: 0.08em;
}
.pj-t2 { font-style: italic; color: var(--gold-lt); }
.pj-desc {
  margin-top: 18px;
  font-size: 1.18rem; line-height: 1.7;
  color: rgba(242,237,228,0.85);
  max-width: 46ch;
}
.pj-cta { margin-top: 28px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pj-tag {
  font-family: var(--f-m); font-size: 0.74rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(242,237,228,0.72);
}

/* Pager */
.pj-pager { position: absolute; z-index: 50; left: 0; top: 0; display: flex; align-items: center; gap: 14px; }
.pj-arrow, .pj-pause {
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(242,237,228,0.3);
  color: #f2ede4;
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.pj-arrow { width: 48px; height: 48px; }
.pj-arrow svg { width: 20px; height: 20px; }
.pj-arrow:hover, .pj-pause:hover { border-color: var(--gold); background: rgba(212,168,67,0.14); }
.pj-arrow:active { transform: scale(0.94); }
.pj-pause { width: 34px; height: 34px; border-color: rgba(242,237,228,0.2); color: rgba(242,237,228,0.7); }
.pj-pause svg { width: 13px; height: 13px; }
.pj-pause .pj-ico-play { display: none; }
.pj-pause[aria-pressed="true"] .pj-ico-play { display: block; }
.pj-pause[aria-pressed="true"] .pj-ico-pause { display: none; }
.pj-arrow:focus-visible, .pj-pause:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.pj-progress { width: clamp(110px, 16vw, 260px); height: 2px; background: rgba(242,237,228,0.2); position: relative; margin-left: 6px; }
.pj-progress-fill { position: absolute; inset: 0; background: var(--gold); transform-origin: left center; transform: scaleX(0); }
.pj-count { display: flex; align-items: baseline; gap: 6px; color: #f2ede4; }
.pj-num-mask { display: inline-block; overflow: hidden; height: 2.3rem; }
.pj-num { display: inline-block; font-family: var(--f-d); font-size: 2.3rem; line-height: 2.3rem; font-weight: 400; }
.pj-total { font-family: var(--f-m); font-size: 0.76rem; letter-spacing: 0.1em; color: rgba(242,237,228,0.6); }

/* Scroll hint (matches the home page) */
.pj-scroll-hint {
  position: absolute; z-index: 55;
  left: clamp(24px, 5vw, 72px); bottom: 104px;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--f-m); font-size: 0.62rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(242,237,228,0.62);
  text-decoration: none;
  transition: color 0.25s ease;
}
.pj-scroll-hint::before {
  content: ''; width: 1px; height: 36px;
  background: linear-gradient(180deg, transparent, var(--gold));
}
.pj-scroll-hint:hover { color: var(--gold-lt); }
.pj-scroll-hint:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
@media (max-height: 760px) { .pj-scroll-hint { display: none; } }
@media (max-width: 819px) { .pj-scroll-hint { display: none; } }

/* Countdown line + intro curtain */
.pj-timer {
  position: absolute; z-index: 60; left: 0; right: 0; top: 0; height: 3px;
  background: var(--gold); transform-origin: left center; transform: scaleX(0);
}
.pj-cover { position: absolute; inset: 0; z-index: 70; background: var(--gold); pointer-events: none; }

/* Phones: one card at a time, details along the bottom */
@media (max-width: 819px) {
  .pj-details { top: auto !important; bottom: 108px; left: 20px; width: calc(100% - 40px); }
  .pj-eyebrow { margin-bottom: 14px; }
  .pj-t1, .pj-t2 { font-size: clamp(2.3rem, 11vw, 3.4rem); }
  .pj-desc { font-size: 0.95rem; margin-top: 12px; }
  .pj-cta { margin-top: 20px; }
  .pj-progress { display: none; }
  .pj-arrow { width: 44px; height: 44px; }
  .pj-card { box-shadow: none; }
  .pj-card-shade {
    background:
      linear-gradient(0deg, rgba(4,6,14,0.96) 0%, rgba(4,6,14,0.82) 48%, rgba(4,6,14,0.35) 100%);
  }
}

/* ═══════════════ CASE STUDIES ═══════════════ */
.pj-more { background: var(--void); border-top: 1px solid var(--rule); transition: background 0.8s ease; }
.pj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
/* Five cases: two large up top, three below */
@media (min-width: 981px) {
  .pj-grid { grid-template-columns: repeat(6, 1fr); }
  .pj-grid .pj-case { grid-column: span 2; }
  .pj-grid .pj-case:nth-child(-n+2) { grid-column: span 3; }
}
@media (min-width: 640px) and (max-width: 980px) {
  .pj-grid { grid-template-columns: repeat(2, 1fr); }
  .pj-grid .pj-case:last-child:nth-child(odd) { grid-column: span 2; }
}
.pj-case {
  display: flex; flex-direction: column;
  padding: 0; text-align: left; font: inherit; color: inherit;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.45s var(--ease), border-color 0.3s ease, box-shadow 0.45s ease, background 0.6s ease;
}
.pj-case:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  box-shadow: 0 18px 44px rgba(0,0,0,0.14);
}
.pj-case:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.pj-case-thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: #0c1020;
}
.pj-case-thumb-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  transition: transform 0.7s var(--ease);
}
.pj-case:hover .pj-case-thumb-img { transform: scale(1.05); }
.pj-case-play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(4,6,14,0.45);
  opacity: 0; transition: opacity 0.3s ease;
}
.pj-case:hover .pj-case-play, .pj-case:focus-visible .pj-case-play { opacity: 1; }
.pj-case-play span {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(212,168,67,0.2);
  border: 1.5px solid rgba(212,168,67,0.7);
  color: #f2ede4; font-size: 0.85rem;
}
.pj-case-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-family: var(--f-m); font-size: 0.66rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold-lt);
  background: rgba(4,6,14,0.82);
  border: 1px solid rgba(212,168,67,0.3);
  padding: 4px 10px; border-radius: 3px;
}
.pj-case-body { padding: 22px 22px 20px; display: flex; flex-direction: column; flex: 1; }
.pj-case-title {
  font-family: var(--f-d); font-size: 1.65rem; font-weight: 400;
  line-height: 1.15; color: var(--ink); margin-bottom: 10px;
}
.pj-case-title em { font-style: italic; color: var(--gold-lt); }
[data-theme="light"] .pj-case-title em { color: var(--navy); }
.pj-case-desc { font-size: 1.05rem; line-height: 1.65; color: var(--body); flex: 1; }
.pj-case-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--f-m); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold);
}
.pj-case-foot span:last-child { transition: transform 0.25s ease; }
.pj-case:hover .pj-case-foot span:last-child { transform: translateX(4px); }

/* Closing band */
.pj-end { background: var(--surface-2); border-top: 1px solid var(--rule); transition: background 0.8s ease; }
.pj-end-inner { text-align: center; max-width: 760px; }
.pj-end-inner .build-lead { max-width: 52ch; margin: 16px auto 0; }
.pj-end-actions { margin-top: 32px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.pj-end-call {
  display: inline-block; margin-top: 22px;
  font-family: var(--f-m); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  border-bottom: 1px solid var(--rule); padding-bottom: 1px;
  transition: color .2s, border-color .2s;
}
.pj-end-call:hover { color: var(--gold); border-color: var(--gold); }

/* ═══════════════ MODAL ═══════════════ */
.pj-modal {
  display: none; position: fixed; inset: 0; z-index: 800;
  background: rgba(2,3,5,0.9); backdrop-filter: blur(10px);
  overflow-y: auto; padding: 40px 20px;
}
.pj-modal.open { display: block; }
.pj-modal-box {
  max-width: 900px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
}
.pj-modal-head {
  padding: 26px 30px 20px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  border-bottom: 1px solid var(--rule);
}
.pj-modal-kicker {
  display: block; margin-bottom: 8px;
  font-family: var(--f-m); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold);
}
.pj-modal-title {
  font-family: var(--f-d); font-weight: 300;
  font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.15; color: var(--ink);
}
.pj-modal-title em { font-style: italic; color: var(--gold-lt); }
[data-theme="light"] .pj-modal-title em { color: var(--navy); }
.pj-modal-close {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%; border: 1px solid var(--rule);
  color: var(--muted); font-size: 1.1rem;
  display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s;
}
.pj-modal-close:hover { color: var(--ink); border-color: var(--gold); }
.pj-modal-video { position: relative; padding-top: 56.25%; background: #000; }
.pj-modal-video video, .pj-modal-video iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover;
}
.pj-modal-body { padding: 32px 30px 34px; }
.pj-modal-body:empty { display: none; }
.pj-modal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 28px; }
.pj-modal-label {
  display: block; margin-bottom: 10px;
  font-family: var(--f-m); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold);
}
.pj-modal-text { font-size: 1.04rem; line-height: 1.8; color: var(--body); }
.pj-modal-list { list-style: none; margin-top: 4px; }
.pj-modal-list li {
  display: flex; gap: 12px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--rule);
  font-size: 0.93rem; line-height: 1.65; color: var(--body);
}
.pj-modal-list li:last-child { border-bottom: 0; }
.pj-modal-list li::before { content: '→'; color: var(--gold); font-family: var(--f-m); font-size: 0.7rem; flex-shrink: 0; }
.pj-modal-goal {
  margin-top: 26px; padding: 18px 22px;
  border-left: 3px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  border-radius: 0 8px 8px 0;
}
.pj-modal-goal p { font-size: 1rem; line-height: 1.7; color: var(--ink); }

@media (max-width: 700px) {
  .pj-modal { padding: 16px 10px; }
  .pj-modal-cols { grid-template-columns: 1fr; gap: 22px; }
  .pj-modal-head { padding: 20px 18px 16px; }
  .pj-modal-body { padding: 22px 18px 26px; }
}

/* Nav toggle over the dark showcase */
body[data-page="projects"] nav:not(.scrolled) .theme-toggle--nav { color: var(--gold-lt); border-color: rgba(212,168,67,0.55); }
