:root{
  --bg:#0b0c10;
  --fg:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.74);

  --line: rgba(255,255,255,.10);
  --glass: rgba(255,255,255,.06);
  --glass2: rgba(255,255,255,.08);
  --shadow: 0 18px 60px rgba(0,0,0,.45);

  /* If you want accent glows in overlay, uncomment and tune:
  --sun1: rgba(255,122,24,.55);
  --sun2: rgba(255,64,129,.40);
  --sun3: rgba(167,82,255,.32);
  */

  --nav-h: 66px; /* keep consistent with your site */
}

*{ box-sizing:border-box; }

body.projects{
  background: var(--bg);
  color: var(--fg);
}

/* Fullscreen background video */
.projects__bg{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: 50% 50%;
  z-index: 0;
  filter: saturate(1.05) contrast(1.05);
}

/* Dark overlay */
.projects__overlay{
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    /* If you want subtle color glows, enable vars above and keep these:
    radial-gradient(900px 650px at 18% 25%, var(--sun1), transparent 60%),
    radial-gradient(950px 700px at 82% 35%, var(--sun2), transparent 62%),
    radial-gradient(900px 650px at 55% 85%, var(--sun3), transparent 65%), */
    linear-gradient(180deg, rgba(11,12,16,.55), rgba(11,12,16,.88));
}

/* Nav over video */
body.projects .nav-wrap{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(to bottom, rgba(11,12,16,.88), rgba(11,12,16,.35));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Main layout */
.projects__main{
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.6rem 0 3rem;
}

/* Header */
.projects__header{
  padding-top: .4rem;
  text-align: center;
}

.projects__title{
  margin: 0 0 .45rem;
  font-size: clamp(2.1rem, 4.6vw, 3.2rem);
  letter-spacing: .3px;
}

.projects__lead{
  margin: 0 auto 1.1rem;
  max-width: 104ch;
  color: rgba(255,255,255,.82);
  line-height: 1.7;
}

/* Filter chips */
.projects__filters{
  display:flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content:center;
  margin: .25rem 0 1.4rem;
}

.chip{
  padding: .55rem .9rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.80);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}

.chip:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}

.chip.is-active{
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.92);
}

/* Grid */
.projects__grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 980px){
  .projects__grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px){
  .projects__grid{ grid-template-columns: 1fr; }
}

/* =========================================================
   CARD — split layout: image top, text bottom (no HTML changes)
   ========================================================= */

.pr-card{
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadow);
  cursor: pointer;
  transform: translateZ(0);
  transition: transform .22s ease, border-color .22s ease, filter .22s ease;

  /* NEW: fixed image height + auto text height */
  --img-h: clamp(170px, 18vw, 220px);
  display: grid;
  grid-template-rows: var(--img-h) auto;

  /* IMPORTANT: remove fixed height behavior */
  min-height: unset;
}

/* Top image area */
.pr-card__img{
  position: relative;              /* no longer absolute */
  inset: auto;
  grid-row: 1;
  grid-column: 1;

  background:
    radial-gradient(650px 420px at 30% 25%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(135deg, rgba(255,122,24,.18), rgba(167,82,255,.14)),
    var(--bg);
  background-image: var(--img);
  background-size: cover;
  background-position: center;
  filter: saturate(1.02) contrast(1.02);
}

/* Shade only over the IMAGE (helps with contrast if image is bright) */
.pr-card__shade{
  position: absolute;
  left: 0;
  right: 0;
  top: 0;

  /* NEW: match the image height */
  height: var(--img-h);

  background:
    linear-gradient(
      to bottom,
      rgba(0,0,0,.20) 0%,
      rgba(0,0,0,.45) 70%,
      rgba(0,0,0,.72) 100%
    );
  pointer-events: none;
}


.pr-card__more{
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .18s ease, transform .18s ease;
  color: rgba(255, 255, 255, 0.449);
  text-align: center;
}

.pr-card:hover .pr-card__more{
  opacity: 1;
  transform: translateY(0);
}

/* Bottom content panel */
.pr-card__content{
  position: relative;
  z-index: 1;
  grid-row: 2;
  grid-column: 1;

  padding: 1.05rem 1.05rem 1.0rem;

  /* real readable panel */
  background:
    linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.38));
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.08);
}

/* kicker/title/body */
.pr-card__kicker{
  font-weight: 700;
  color: rgba(255,255,255,.76);
  font-size: .92rem;
  letter-spacing: .15px;
}

.pr-card__h{
  margin: .45rem 0 .35rem;
  font-size: 1.2rem;
  letter-spacing: .2px;
}

.pr-card__p{
  margin: 0 0 .7rem;
  color: rgba(255,255,255,.80);
  line-height: 1.55;

  /* keeps the card compact */
  max-width: 52ch;
}

/* tags */
.pr-card__tags{
  display:flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.tag{
  font-size: .82rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.82);
}

/* hover lift + subtle glow */
.pr-card:hover{
  transform: translateY(-8px);
  border-color: rgba(24, 255, 255, 0.325);
}

/* Responsive: slightly shorter cards on small screens */
@media (max-width: 620px){
  .pr-card{
    min-height: 320px;
    grid-template-rows: 52% 48%;
  }
  .pr-card__shade{
    height: 52%;
  }
}

/* Reveal animations */
.reveal{
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* Modal */
.pr-modal{
  position: fixed;
  inset: 0;
  z-index: 2000;
  display:none;
}
.pr-modal.is-open{
  display:block;
}

.pr-modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(6px);
}

.pr-modal__panel{
  position: relative;
  width: min(920px, calc(100% - 2rem));
  margin: calc(var(--nav-h) + 1.2rem) auto 1.2rem;
  border-radius: 26px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  box-shadow: 0 26px 110px rgba(0,0,0,.65);
  backdrop-filter: blur(14px);
}

.pr-modal__close{
  position:absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
  color: rgba(255,255,255,.92);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.pr-modal__media{
  height: 260px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
}

.pr-modal__img{
  height:100%;
  width:100%;
  background:
    radial-gradient(650px 420px at 30% 25%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(135deg, rgba(255,122,24,.25), rgba(167,82,255,.22)),
    var(--bg);
  background-size: cover;
  background-position: center;
}

.pr-modal__body{
  padding: 1.25rem 1.25rem 1.35rem;
}

.pr-modal__kicker{
  color: rgba(255,255,255,.78);
  font-weight: 700;
}

.pr-modal__title{
  margin: .35rem 0 .7rem;
  font-size: 1.55rem;
}

.pr-modal__text{
  margin: 0;
  color: rgba(255,255,255,.82);
  line-height: 1.75;
}

/* Footer */
.projects__footer{
  margin-top: 1.25rem;
  text-align:center;
}
.projects__footnote{
  color: rgba(255,255,255,.70);
  font-size: .92rem;
}

/* Motion accessibility */
@media (prefers-reduced-motion: reduce){
  .pr-card,
  .reveal,
  .chip{
    transition: none !important;
  }
}
