/* =========================================================
   PORTFOLIO ROW (Netflix-style) — Version dark fixed
   ========================================================= */

/* -------- 1. Section principale -------- */

.jk-portfolio {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 0 36px;
  background: var(--bg-alt);
  color: var(--text-main);
  overflow: hidden;
}

/* Fond flouté ultra soft contrôlé par JS via --jk-portfolio-bg */
.jk-portfolio::before {
  content: "";
  position: absolute;
  inset: -12%;
  background: var(--bg-alt);
  background-image: var(--jk-portfolio-bg);
  background-size: cover;
  background-position: center;
  filter: grayscale(1) blur(38px);
  opacity: 0;
  mix-blend-mode: normal;
  z-index: 0;
}

.jk-portfolio-head {
  position: relative;
  z-index: 1;
  padding: 0 6vw 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.jk-portfolio-title {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 28px);
  color: inherit;
  opacity: 1;
}

/* -------- 2. Pills = boutons filtres portfolio -------- */

.jk-portfolio-filters {
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.jk-filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid currentColor;
  background: transparent;
  color: currentColor;
  opacity: 0.8;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.jk-filter-pill:hover {
  transform: translateY(-1px);
  opacity: 1;
}

/* Pill active : même logique que les boutons primary */
.jk-filter-pill.is-active {
  background: var(--btn-bg);
  border-color: var(--btn-border);
  color: var(--btn-text);
  opacity: 1;
}

/* -------- 3. Row de cartes (scroll horizontal + snap) -------- */

.jk-tvrow {
  position: relative;
  height: clamp(42vh, 60vh, 68vh);
  max-height: clamp(42vh, 60vh, 68vh);

  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 10px 6vw 10px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 6vw;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;
  -ms-overflow-style: none;

  background: transparent;
  box-shadow: none;
  z-index: 1;
}

.jk-tvrow::-webkit-scrollbar {
  height: 0;
}

/* pas d’infos visibles tant qu’aucun projet n’est actif */
.jk-tvrow:not(.has-active) + .jk-tvinfo {
  opacity: 0;
  pointer-events: none;
  height: 0;
  margin-top: 0;
  transform: translateY(8px);
}

/* -------- 4. Carte projet (poster + layer active 16/9 + carrousel interne) -------- */

.jk-tvcard {
  position: relative;
  flex: 0 0 clamp(140px, 11vw, 190px);
  height: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: visible;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  scroll-snap-align: start;

  opacity: 1;
  --push-x: 0px;

  transform: translateX(var(--push-x));
  transition:
    opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    filter 0.55s ease;
  will-change: opacity, transform, filter;
}

.jk-tvcard__poster {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(32,35,38,.08);
  transition: opacity 0.2s ease;
}

.jk-tvcard__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* couche active (16/9) */
.jk-tvcard__active {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  aspect-ratio: 16 / 9;
  width: auto;

  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  border: 2px solid transparent;
  box-shadow: 0 20px 70px rgba(0,0,0,0.8);
  transform: scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.jk-tvcard__active::before {
  content: "";
  position: absolute;
  inset: -8%;
  background-image: var(--active-bg); /* défini en JS externe */
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.55) saturate(1.1);
  transform: scale(1.1);
  z-index: 0;
  opacity: 0.9;
}

/* Carrousel interne */
.jk-tvcarousel {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.jk-tvcarousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.55s ease;
}

.jk-tvcarousel img.is-active {
  opacity: 1;
}

/* bouton close */
.jk-tvclose {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid currentColor;
  background: transparent;
  color: currentColor;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.jk-tvclose:hover {
  transform: scale(1.06);
  opacity: 1;
}

/* état actif */
.jk-tvcard.is-active {
  opacity: 1;
  z-index: 50;
}

.jk-tvcard.is-active .jk-tvcard__poster {
  opacity: 0;
}

.jk-tvcard.is-active .jk-tvcard__active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  border-color: var(--text-main);
  background: transparent;

  /* largeur du modal conforme, responsive et non agressive */
  width: min(70vw, calc(68vh * 16 / 9));
  max-width: 980px;
}

/* dim les autres cartes quand une est active */
.jk-tvrow.has-active .jk-tvcard:not(.is-active) {
  opacity: 0.45;
  filter: saturate(0.85) brightness(0.75);
}

/* -------- 5. Panel infos (fiche projet) -------- */

.jk-tvinfo {
  width: 100%;
  padding: 24px 6vw 40px;
  background: var(--bg-main);
  color: var(--text-main);
  position: relative;
  z-index: 2;
}

.jk-tvinfo__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: inherit;
}

.jk-tvinfo__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
}

.jk-tvinfo__tags .pill {
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  color: currentColor;
  font-size: 13px;
  padding: 6px 14px;
  opacity: 0.9;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.jk-tvinfo__tags .pill:hover {
  transform: translateY(-1px);
  opacity: 1;
}

/* Logo(s) et croix décorative */

.jk-tvinfo__logos {
  display: flex;
  align-items: center;
  gap: 30px;
  min-height: 90px;
}

.jk-logo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.jk-logo-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.78;
  text-align: center;
  color: inherit;
}

.jk-logo-img {
  height: 90px;
  width: auto;
  opacity: 0.96;
  filter: brightness(0) drop-shadow(0 1px 2px rgba(0,0,0,.08));
  transition: opacity 0.2s ease;
}

.jk-logo-x {
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  opacity: 0.8;
  color: inherit;
}

/* Meta année / rôle */

.jk-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: inherit;
  opacity: 0.78;
}

.jk-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  transition: opacity 0.2s ease;
}

/* -------- Responsive fiche projet -------- */

@media (max-width: 900px) {
  .jk-tvinfo__grid {
    flex-direction: column;
    max-width: none;
  }

  .jk-tvinfo__right {
    flex: 1 1 auto;
    max-width: none;
    max-height: none;
    overflow: visible;
  }
}

/* ===== ANIMATIONS PREMIUM FILTRAGE ===== */

.jk-tvcard.is-filtered-out {
  opacity: 0;
  transform: translateX(90px) scale(0.88);
  filter: blur(2px);
  pointer-events: none;
}

.jk-tvcard.is-filter-entering {
  opacity: 0;
  transform: translateX(-40px) scale(0.96);
  filter: blur(3px);
}

/* (Fade-in / scroll assist restent gérés par le JS + style.css) */
/* =========================================================
   V6.2 — PORTFOLIO EDITORIAL POLISH
   ========================================================= */
.jk-portfolio {
  justify-content: center;
  padding: clamp(72px, 9vh, 112px) 0 clamp(52px, 7vh, 88px);
  background: #f2f3f3;
}

.jk-portfolio::before { display: none; }

.jk-portfolio-head {
  padding: 0 6vw 24px;
  align-items: flex-end;
}

.jk-portfolio-title {
  max-width: 620px;
  font-size: clamp(34px, 4.2vw, 64px);
  line-height: .96;
  letter-spacing: -.045em;
  font-weight: 650;
  color: #202326;
}

.jk-portfolio-title span {
  background: linear-gradient(100deg, #08a8c2 0%, #16c8b4 52%, #a8df35 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.jk-portfolio-filters { padding-bottom: 3px; }
.jk-filter-pill {
  border-color: rgba(32,35,38,.25);
  color: #363a3d;
  background: rgba(255,255,255,.36);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 1;
}
.jk-filter-pill:hover { background: rgba(255,255,255,.78); }
.jk-filter-pill.is-active { background:#202326; border-color:#202326; color:#fff; }

.jk-tvrow {
  height: clamp(430px, 58vh, 660px);
  max-height: none;
  gap: clamp(12px, 1vw, 18px);
  padding: 8px 6vw 18px;
  scroll-behavior: smooth;
}

.jk-tvcard {
  flex-basis: clamp(180px, 20vw, 330px);
  border-radius: 26px;
  transition: opacity .42s ease, transform .55s cubic-bezier(.22,.61,.36,1), filter .42s ease;
}
.jk-tvcard:nth-child(3n+2) { flex-basis: clamp(190px, 22vw, 360px); }
.jk-tvcard:nth-child(4n) { flex-basis: clamp(170px, 18.5vw, 300px); }

.jk-tvcard__poster {
  border-radius: 26px;
  box-shadow: 0 1px 0 rgba(20,24,28,.06), 0 14px 34px rgba(20,24,28,.055);
  transition: transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease, opacity .2s ease;
}
.jk-tvcard:hover .jk-tvcard__poster {
  transform: translateY(-4px);
  box-shadow: 0 1px 0 rgba(20,24,28,.07), 0 22px 50px rgba(20,24,28,.09);
}

.jk-tvcard__active {
  border-radius: 28px;
  border: 1px solid rgba(32,35,38,.07);
  background: rgba(255,255,255,.58);
  box-shadow: 0 28px 80px rgba(20,24,28,.14), 0 2px 8px rgba(20,24,28,.06);
}
.jk-tvcard__active::before {
  filter: blur(34px) brightness(.88) saturate(.85);
  opacity: .28;
}
.jk-tvcard.is-active .jk-tvcard__active {
  border-color: rgba(32,35,38,.07);
  width: min(72vw, calc(66vh * 16 / 9));
}

.jk-tvclose {
  top: 14px; left: 14px;
  width: 34px; height: 34px;
  border: 0;
  background: rgba(247,248,248,.82);
  color: #2c3033;
  font-size: 22px;
  font-weight: 300;
  box-shadow: 0 3px 14px rgba(20,24,28,.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.jk-tvclose:hover { background:#fff; transform:scale(1.05); }

.jk-tvrow.has-active .jk-tvcard:not(.is-active) {
  opacity: .68;
  filter: saturate(.76) brightness(1.04);
}

.jk-tvnav {
  position: relative;
  z-index: 3;
  padding: 2px 6vw 8px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.jk-tvnav__hint {
  margin-right: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(32,35,38,.48);
}
.jk-tvnav__btn {
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(32,35,38,.16);
  background: rgba(255,255,255,.62);
  color: #202326;
  font: 400 20px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.jk-tvnav__btn:hover { transform: translateY(-2px); background:#fff; border-color:rgba(32,35,38,.3); }

.jk-tvinfo {
  margin-top: 10px;
  padding: 34px 6vw 64px;
  background: transparent;
  border-top: 1px solid rgba(32,35,38,.08);
}
.jk-tvinfo__title {
  max-width: 760px;
  font-size: clamp(25px, 2.2vw, 36px);
  line-height: 1.08;
  letter-spacing: -.025em;
  font-weight: 650;
}
.jk-tvinfo__tags { margin: 14px 0 26px; }
.jk-tvinfo__tags .pill { border-color:rgba(32,35,38,.22); font-size:11px; padding:5px 11px; }
.jk-tvinfo__grid {
  display: grid;
  grid-template-columns: minmax(260px, .75fr) minmax(340px, 1.35fr);
  gap: clamp(44px, 7vw, 120px);
  align-items: start;
  max-width: 1180px;
}
.jk-tvinfo__left { min-width:0; }
.jk-tvinfo__right { max-width: 720px; }
.jk-tvinfo__intro {
  margin: 8px 0 0;
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.62;
  color: rgba(32,35,38,.76);
}
.jk-tvinfo__logos { gap:22px; min-height:74px; justify-content:flex-start; }
.jk-logo-col { align-items:flex-start; }
.jk-logo-img {
  height: 66px;
  max-width: 150px;
  object-fit: contain;
  object-position: left center;
  opacity: .62;
  filter: brightness(0);
}
.jk-logo-label { opacity:.46; text-align:left; }
.jk-logo-x { opacity:.28; font-size:18px; }
.jk-tvinfo__meta-lines { display:flex; gap:18px; margin-top:12px; }

@media (max-width: 900px) {
  .jk-portfolio-head { align-items:flex-start; flex-direction:column; }
  .jk-portfolio-title { font-size:clamp(34px,9vw,52px); }
  .jk-tvrow { height: min(58vh, 560px); }
  .jk-tvcard { flex-basis: min(64vw, 280px) !important; border-radius:20px; }
  .jk-tvcard__poster { border-radius:20px; }
  .jk-tvnav__hint { display:none; }
  .jk-tvinfo__grid { display:flex; flex-direction:column; gap:26px; }
}

/* V6.3 — filter reflow + flatter cards */
.jk-tvcard__poster { box-shadow:none !important; }
.jk-tvcard:hover .jk-tvcard__poster { box-shadow:none !important; transform:none; }
.jk-tvcard.is-filtered-out { display:none !important; }
.jk-tvnav.is-not-needed { display:none; }

/* V6.4 — hiérarchie typographique commune aux sections */
.jk-portfolio-title{
  max-width:760px;
  font-size:clamp(42px,4.7vw,72px);
  line-height:.96;
  letter-spacing:-.045em;
  font-weight:600;
}


/* =========================================================
   V6.6 — ONE-SCREEN PORTFOLIO + APPLE-LIKE PROJECT CONTROL
   ========================================================= */
.jk-portfolio{height:calc(100vh - var(--header-h));min-height:0;justify-content:flex-start;padding:clamp(24px,4.2vh,46px) 0 clamp(18px,2.4vh,28px)}
.jk-portfolio-head{flex:0 0 auto;padding:0 6vw clamp(12px,1.8vh,20px)}
.jk-tvrow{flex:0 0 auto;height:clamp(280px,43vh,500px);padding-top:4px;padding-bottom:8px}
.jk-tvcard{flex-basis:clamp(150px,17.2vw,270px)}
.jk-tvcard:nth-child(3n+2){flex-basis:clamp(158px,18.2vw,286px)}
.jk-tvcard:nth-child(4n){flex-basis:clamp(145px,16vw,252px)}

.jk-tvnav--apple{position:relative;z-index:4;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:2px 6vw 7px;min-height:38px}
.jk-tvnav--apple .jk-tvnav__dots{grid-column:1;display:flex;align-items:center;gap:11px;min-width:0;height:30px}
.jk-tvnav__dot{--dot-scale:1;position:relative;width:7px;height:7px;flex:0 0 7px;padding:0;border:0;border-radius:999px;background:rgba(32,35,38,.42);cursor:pointer;transform:scale(var(--dot-scale));transition:width .28s ease,transform .28s ease,opacity .28s ease,background .28s ease;overflow:hidden}
.jk-tvnav__dot.is-active{width:30px;flex-basis:30px;transform:none;background:rgba(32,35,38,.16)}
.jk-tvnav__dot.is-active::after{content:"";position:absolute;inset:0 auto 0 0;width:calc(var(--jk-progress,0) * 100%);border-radius:inherit;background:#202326}
.jk-tvnav__dot.is-near{--dot-scale:1}.jk-tvnav__dot.is-far{--dot-scale:.6;opacity:.72}.jk-tvnav__dot.is-edge{--dot-scale:.22;opacity:.5}.jk-tvnav__dot.is-hidden{display:none}
.jk-tvnav__play{grid-column:3;justify-self:end;width:38px;height:38px;border:0;border-radius:999px;background:rgba(32,35,38,.08);color:#202326;display:grid;place-items:center;cursor:pointer;transition:background .2s ease,transform .2s ease}
.jk-tvnav__play:hover{background:rgba(32,35,38,.14);transform:scale(1.03)}
.jk-tvnav__pause-icon{display:block;width:10px;height:12px;border-left:3px solid currentColor;border-right:3px solid currentColor}
.jk-tvnav__play-icon{display:none;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent;border-left:9px solid currentColor;margin-left:2px}
.jk-tvnav__play.is-paused .jk-tvnav__pause-icon{display:none}.jk-tvnav__play.is-paused .jk-tvnav__play-icon{display:block}

.jk-tvinfo{flex:1 1 auto;min-height:0;margin-top:0;padding:clamp(8px,1.3vh,16px) 6vw clamp(10px,1.8vh,22px);overflow:hidden}
.jk-tvinfo__title{font-size:clamp(21px,1.8vw,30px)}
.jk-tvinfo__tags{margin:7px 0 10px}.jk-tvinfo__tags .pill{padding:3px 9px;font-size:10px}
.jk-tvinfo__grid{grid-template-columns:minmax(220px,.68fr) minmax(320px,1.32fr);gap:clamp(28px,5vw,76px)}
.jk-tvinfo__logos{min-height:50px;gap:16px}.jk-logo-img{height:46px;max-width:125px}.jk-logo-label{font-size:9px}.jk-tvinfo__meta-lines{margin-top:6px}
.jk-tvinfo__intro{margin:2px 0 0;font-size:clamp(13px,.95vw,16px);line-height:1.48;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}

/* Height is the primary constraint: shrink the rail first, never the info text into oblivion. */
@media (min-width:901px) and (max-height:900px){.jk-portfolio{padding:20px 0 14px}.jk-portfolio-head{padding-bottom:10px}.jk-portfolio-title{font-size:clamp(38px,4vw,58px)}.jk-tvrow{height:36vh;min-height:255px}.jk-tvnav--apple{min-height:32px;padding-bottom:4px}.jk-tvinfo{padding-top:6px}.jk-tvinfo__title{font-size:22px}.jk-tvinfo__intro{-webkit-line-clamp:4}}
@media (min-width:901px) and (max-height:760px){.jk-tvrow{height:31vh;min-height:215px}.jk-portfolio-title{font-size:42px}.jk-portfolio-head{padding-bottom:6px}.jk-tvinfo__logos{display:none!important}.jk-tvinfo__tags{margin:5px 0 7px}.jk-tvinfo__intro{-webkit-line-clamp:3}}
@media (max-width:900px){.jk-portfolio{height:auto;min-height:100vh}.jk-tvrow{height:min(54vh,520px)}.jk-tvnav--apple{padding-inline:1.5rem}.jk-tvinfo{overflow:visible}.jk-tvnav--apple .jk-tvnav__dots{gap:9px}}
@media (prefers-reduced-motion:reduce){.jk-tvnav__dot,.jk-tvnav__play{transition:none!important}}


/* =========================================================
   V6.6.4 — Portfolio vertical balance
   Closed: title + rail + controls are centered in the viewport.
   Open: the group rises to make room for the project information.
   ========================================================= */
@media (min-width: 901px) {
  .jk-portfolio {
    /* The section itself already matches the snap viewport. */
    justify-content: center;
    transition: padding .48s cubic-bezier(.22,.61,.36,1);
  }

  /* When no project is open, the hidden info panel must consume no space at all. */
  .jk-portfolio:not(.has-project-open) .jk-tvinfo {
    display: none;
  }

  /* The visible portfolio stack is naturally centered by flex while closed. */
  .jk-portfolio:not(.has-project-open) .jk-portfolio-head,
  .jk-portfolio:not(.has-project-open) .jk-tvrow,
  .jk-portfolio:not(.has-project-open) .jk-tvnav {
    transform: translateY(0);
    transition: transform .48s cubic-bezier(.22,.61,.36,1);
  }

  /*
   * Open state: anchor the stack near the top, keeping enough room for info.
   * We do not scroll the section and we do not alter card proportions.
   */
  .jk-portfolio.has-project-open {
    justify-content: flex-start;
    padding-top: clamp(20px, 3.2vh, 38px);
    padding-bottom: 0;
  }

  .jk-portfolio.has-project-open .jk-portfolio-head,
  .jk-portfolio.has-project-open .jk-tvrow,
  .jk-portfolio.has-project-open .jk-tvnav {
    transform: translateY(0);
  }

  .jk-portfolio.has-project-open .jk-tvrow {
    height: clamp(260px, 42vh, 430px);
    max-height: clamp(260px, 42vh, 430px);
    transition: height .48s cubic-bezier(.22,.61,.36,1),
                max-height .48s cubic-bezier(.22,.61,.36,1);
  }

  .jk-portfolio.has-project-open .jk-tvinfo {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 4px;
    padding-top: clamp(14px, 2vh, 24px);
    padding-bottom: clamp(18px, 2.5vh, 34px);
    overflow: hidden;
  }

  .jk-portfolio.has-project-open .jk-tvinfo__tags {
    margin-top: 8px;
    margin-bottom: clamp(10px, 1.4vh, 18px);
  }

  .jk-portfolio.has-project-open .jk-tvinfo__logos {
    min-height: 54px;
  }

  .jk-portfolio.has-project-open .jk-logo-img {
    height: clamp(44px, 6vh, 62px);
  }
}

/* Short desktop viewports: cards yield height first, never the project text. */
@media (min-width: 901px) and (max-height: 820px) {
  .jk-portfolio:not(.has-project-open) .jk-tvrow {
    height: clamp(300px, 52vh, 430px);
    max-height: clamp(300px, 52vh, 430px);
  }
  .jk-portfolio.has-project-open .jk-tvrow {
    height: clamp(220px, 35vh, 330px);
    max-height: clamp(220px, 35vh, 330px);
  }
  .jk-portfolio.has-project-open .jk-tvinfo__title {
    font-size: clamp(22px, 2vw, 30px);
  }
  .jk-portfolio.has-project-open .jk-tvinfo__intro {
    font-size: clamp(14px, 1vw, 16px);
    line-height: 1.45;
  }
}

/* Mobile keeps its existing flow/scroll behavior. */


/* V6.6.6 — directional project-sheet transition */
@media (min-width:901px) and (prefers-reduced-motion:no-preference){
  .jk-portfolio.has-project-open .jk-tvinfo{
    will-change:transform,opacity,height;
    transition:opacity .22s ease,transform .22s cubic-bezier(.4,0,1,1),height .38s cubic-bezier(.22,.61,.36,1);
  }
  .jk-tvinfo.is-leaving-left{opacity:0;transform:translateX(-26px)}
  .jk-tvinfo.is-leaving-right{opacity:0;transform:translateX(26px)}
  .jk-tvinfo.is-entering-right{opacity:0;transform:translateX(26px);transition:none!important}
  .jk-tvinfo.is-entering-left{opacity:0;transform:translateX(-26px);transition:none!important}
}
