/* =========================
   PORTFOLIO — HERO
   ========================= */

.page-hero--portfolio{
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 0 !important;
}

.page-hero--portfolio.page-hero--image{
  position: relative;
  padding: 0;
  height: 55dvh;
  min-height: 55dvh;
  display: flex;
  align-items: stretch;
}

@supports not (height: 55dvh){
  .page-hero--portfolio.page-hero--image{ height: 55vh; min-height: 55vh; }
}

.page-hero--portfolio .page-hero-media{ position: absolute; inset: 0; z-index: 0; }

.page-hero--portfolio .page-hero-image{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: saturate(0.98) contrast(1.02);
}

.page-hero--portfolio.page-hero--image .page-hero-media::after{ content: none !important; }

.page-hero--portfolio.page-hero--image::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  backdrop-filter: blur(12px);

  background:
    radial-gradient(circle at 18% 22%, rgba(37, 99, 235, 0.07), transparent 58%),
    radial-gradient(circle at 82% 18%, rgba(56, 189, 248, 0.06), transparent 58%),
    linear-gradient(90deg,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(255, 255, 255, 0.86) 52%,
      rgba(255, 255, 255, 0.42) 100%
    );
}

.hero-accent--portfolio{
  position: absolute;
  inset: -28px -28px auto auto;
  width: clamp(320px, 40vw, 720px);
  height: clamp(320px, 40vw, 720px);
  border-radius: 999px;
  pointer-events: none;
  z-index: 20;
  filter: blur(20px);
  opacity: 0.65;
  background:
    radial-gradient(circle at 30% 25%, rgba(56,189,248,0.22), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(37,99,235,0.16), transparent 55%);
}

.hero-figure--portfolio{
  position: absolute;
  z-index: 1440; /* pod tekstem */
  pointer-events: none;
  display: block;

  height: clamp(520px, 62vh, 980px);
  width: clamp(520px, 52vw, 980px);

  right: clamp(-2.2rem, 1.3vw, 4.2rem);
  bottom: clamp(-6.5rem, -3.2vw, -2.5rem);

  object-fit: contain;
  object-position: right bottom;

  transform: scale(1.08);
  transform-origin: right bottom;
  filter: drop-shadow(0 18px 50px rgba(2,6,23,0.22));
}

.page-hero--portfolio .page-hero-layer{
  position: relative;
  z-index: 60; /* zawsze najwyżej */
  background: transparent;
  padding-top: clamp(3.0rem, 5vw, 4.0rem);
  padding-bottom: clamp(2.2rem, 4vw, 3.0rem);
}

.page-hero--portfolio .page-hero-inner{
  min-height: auto;
  padding-top: clamp(2.2rem, 4vw, 3.0rem);
}

/* =========================
   MOBILE/TABLET — ukryj postać
   ========================= */

/* max-device-width jako “awaryjne”, gdyby na mobile był zły viewport */
@media (max-width: 899.98px), (max-device-width: 899.98px){
  .hero-figure--portfolio{ display: none !important; }

  .page-hero--portfolio.page-hero--image{
    height: auto !important;
    min-height: 0 !important;
  }
}

/* =========================
   PORTFOLIO — SECTION HEAD
   ========================= */

.portfolio-head{
  margin-bottom: clamp(1.2rem, 2vw, 1.6rem);
}

.portfolio-h2{
  margin: 0 0 0.35rem;
  font-size: clamp(1.8rem, 1.4vw + 1.3rem, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.portfolio-sub{
  margin: 0;
  color: var(--color-text-muted);
  font-size: clamp(0.95rem, 0.25vw + 0.92rem, 1.05rem);
  line-height: 1.65;
  max-width: 70ch;
}

/* =========================
   PORTFOLIO — GRID + CARDS
   ========================= */

.work-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.1rem, 1.5vw, 2.2rem);
}

@media (min-width: 900px){
  .work-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.work-grid,
.work-card,
.work-card__header,
.work-card__media,
.work-card__body,
.work-card__link{ min-width: 0; }

.work-card{
  border-radius: clamp(18px, 1.1vw, 28px);
  overflow: hidden;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: 0 14px 40px rgba(2,6,23,0.06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.work-card:hover{
  transform: translateY(-2px);
  border-color: rgba(37,99,235,0.18);
  box-shadow: 0 20px 56px rgba(2,6,23,0.10);
}

.work-card__link{
  display: grid;
  grid-template-rows: auto 1fr;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.work-card__link.is-disabled{ cursor: default; }

.work-card__link:focus-visible{
  outline: 3px solid rgba(37,99,235,0.35);
  outline-offset: 3px;
  border-radius: 22px;
}

/* media */
.work-card__header{ position: relative; }

.work-card__media{
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(2,6,23,0.04);
}

.work-card__media::after{
  content:"";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2,6,23,0.00), rgba(2,6,23,0.22));
}

.work-card__img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 45%;
  transform: scale(1.02);
  transition: transform .35s ease;
}

.work-card:hover .work-card__img{ transform: scale(1.06); }

/* meta overlay */
.work-meta{
  position: absolute;
  right: clamp(10px, 1.0vw, 18px);
  bottom: clamp(10px, 1.0vw, 18px);
  z-index: 2;

  width: clamp(240px, 46%, 380px);
  max-width: calc(100% - 20px);

  border-radius: clamp(16px, 1vw, 20px);
  padding: clamp(12px, 0.8vw, 16px);

  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(15,23,42,0.12);
  backdrop-filter: blur(10px);

  box-shadow: 0 14px 34px rgba(2,6,23,0.14);
  pointer-events: none;
}

.work-meta__title{
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 780;
  color: rgba(15,23,42,0.62);
  margin-bottom: 0.65rem;
}

.work-meta__list{ margin: 0; padding: 0; display: grid; gap: 0.4rem; }

.work-meta__row{
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.6rem;
  align-items: baseline;
}

.work-meta__row dt{
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(15,23,42,0.55);
  font-weight: 720;
}

.work-meta__row dd{
  margin: 0;
  font-size: 0.98rem;
  font-weight: 760;
  color: rgba(15,23,42,0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-meta__cta{
  margin-top: 0.75rem;
  font-weight: 800;
  font-size: 0.98rem;
  color: #1d4ed8;
}

.work-meta__cta.is-muted{ color: rgba(15,23,42,0.60); }

/* body */
.work-card__body{
  padding: clamp(14px, 1.0vw, 22px) clamp(14px, 1.0vw, 24px) clamp(16px, 1.1vw, 24px);
  display: grid;
  gap: 0.6rem;
}

.work-card__title{
  margin: 0;
  font-size: clamp(1.15rem, 0.55vw + 1.05rem, 1.45rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.work-card__desc{
  margin: 0;
  font-size: clamp(0.96rem, 0.2vw + 0.93rem, 1.05rem);
  line-height: 1.7;
  color: rgba(15,23,42,0.70);
}

.work-card__facts{
  margin-top: 0.45rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(15,23,42,0.08);

  display: grid;
  gap: 0.55rem;
}

.work-card__fact{
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 0.8rem;
  align-items: baseline;
}

.work-card__fact dt{
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(15,23,42,0.55);
  font-weight: 720;
}

.work-card__fact dd{
  margin: 0;
  font-size: 0.98rem;
  font-weight: 720;
  color: rgba(15,23,42,0.90);
}

/* mobile: meta pod zdjęciem */
@media (max-width: 640px){
  .work-meta{
    position: static;
    width: auto;
    max-width: none;
    margin: 10px 10px 0;
    pointer-events: none; /* nie blokuj kliku w kartę */
  }
}