/* =========================
   Endura — Projects Page
   Hero + White Gallery (grid background)
   ========================= */

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body{
  margin: 0;
  background: #000;
  color: #f5f7ff;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.45;
}

a{ color: inherit; text-decoration: none; }
img{ display:block; max-width:100%; }

:root{
  --blue2: #2e77b7;

  --padX: clamp(14px, 2.1vw, 26px);
  --padTop: max(10px, env(safe-area-inset-top));
  --logoH: clamp(86px, 5.8vw, 112px);
}

/* =========================
   HERO (normal system)
   ========================= */

.pageHero{
  position: relative;
  height: clamp(440px, 62vh, 780px);
  overflow: clip;
  isolation: isolate;
  background: #000;
}

.pageHero__bg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.06) saturate(1.04) brightness(1.06);
  transform: scale(1.02);
  z-index: -3;
}

.pageHero__scrim{
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 520px at 18% 22%, rgba(46,119,183,0.10), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.35) 22%, rgba(0,0,0,0.00) 46%),
    radial-gradient(1100px 700px at 50% 120%, rgba(0,0,0,0.42), transparent 62%),
    linear-gradient(180deg, rgba(0,0,0,0.00) 62%, rgba(0,0,0,0.34) 100%);
}

.pageHero__grain{
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

/* HUD / NAV */
.hud{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: var(--padTop) var(--padX) 0;
  z-index: 10;
}

.hud__inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand{
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.brand__logo{
  height: var(--logoH);
  width: auto;
  max-width: min(520px, 56vw);
  border-radius: 6px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 14px 34px rgba(0,0,0,0.42);
}

.nav{
  display: flex;
  align-items: center;
  gap: 22px;
}
/* Desktop nav group */
.nav__links{
  display: flex;
  align-items: center;
  gap: 22px;
}

/* Mobile menu toggle (hidden on desktop) */
.nav__toggle{
  display: none;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 12px;

  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.34);
  color: rgba(255,255,255,0.92);

  cursor: pointer;
  user-select: none;

  box-shadow: 0 18px 55px rgba(0,0,0,0.45);
}

.nav__toggleIcon{
  width: 16px;
  height: 10px;
  position: relative;
  display: block;
}

.nav__toggleIcon::before,
.nav__toggleIcon::after{
  content:"";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  transition: transform 170ms ease, top 170ms ease, bottom 170ms ease;
}

.nav__toggleIcon::before{ top: 0; }
.nav__toggleIcon::after{ bottom: 0; }

.nav__toggleLabel{
  font-weight: 880;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}


.nav__link{
  position: relative;
  padding: 12px 0;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.82rem;
  color: rgba(245,247,255,0.90);
}

.nav__link:hover{ color: rgba(245,247,255,0.98); }

.nav__link::after{
  content:"";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(46,119,183,0.95), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 170ms ease;
  opacity: 0.95;
}

.nav__link:hover::after{ transform: scaleX(1); }

.nav__link--active{ color: rgba(255,255,255,0.96); }
.nav__link--active::after{ transform: scaleX(1); }

/* Button */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.28);

  color: #f5f7ff;
  font-weight: 880;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 18px 46px rgba(0,0,0,0.35);

  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
  user-select: none;
}

.btn:hover{
  transform: translateY(-1px);
  background: rgba(0,0,0,0.38);
  border-color: rgba(255,255,255,0.22);
}

.btn--primary{
  border-color: rgba(46,119,183,0.55);
  background: linear-gradient(180deg, rgba(46,119,183,0.98), rgba(11,63,123,0.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -18px 28px rgba(0,0,0,0.22),
    0 18px 52px rgba(0,0,0,0.46);
}

.btn__arrow{
  font-weight: 950;
  transform: translateY(-1px);
  transition: transform 140ms ease;
}

.btn:hover .btn__arrow{
  transform: translateY(-1px) translateX(2px);
}

/* Title lockup */
.pageHero__content{
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  text-align: center;

  /* keep below HUD */
  padding:
    calc(var(--padTop) + var(--logoH) + 42px)
    var(--padX)
    clamp(34px, 8vh, 86px);
}

.pageHero__stack{
  width: min(980px, 92vw);
}

.pageHero__eyebrow{
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 760;
  color: rgba(245,247,255,0.70);
}

.pageHero__title{
  margin: 0;
  text-transform: uppercase;
  font-weight: 950;
  letter-spacing: -0.015em;
  line-height: 0.96;
  font-size: clamp(2.0rem, 4.2vw, 3.2rem);
  color: rgba(255,255,255,0.96);
  text-shadow: 0 26px 88px rgba(0,0,0,0.62);
}

.pageHero__line{ display:block; }
.pageHero__accent{ color: rgba(46,119,183,0.92); }

.pageHero__mark{
  margin: 18px auto 14px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.mark__dot{
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(46,119,183,0.78);
  box-shadow: 0 0 0 8px rgba(46,119,183,0.12);
}

.mark__line{
  height: 2px;
  width: min(180px, 44vw);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(46,119,183,0.85), rgba(46,119,183,0.10), transparent);
  opacity: 0.95;
}

.pageHero__sub{
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 740;
  font-size: 0.76rem;
  color: rgba(245,247,255,0.64);
}

/* =========================
   GALLERY (white w/ grid)
   ========================= */

.gallery{
  position: relative;
  background: linear-gradient(180deg, #f5f7fb 0%, #eef2f6 100%);
  color: #0b0f14;
  padding: clamp(70px, 7vw, 110px) 0;
  border-top: 1px solid rgba(11,15,20,0.06);
}

.gallery::before{
  content:"";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(46,119,183,0.10), transparent 60%),
    linear-gradient(90deg, rgba(11,15,20,0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(11,15,20,0.05) 1px, transparent 1px);
  background-size: auto, 84px 84px, 84px 84px;
  opacity: 1;
}

.gallery__inner{
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--padX);
}

.gallery__head{
  margin-bottom: clamp(16px, 2.4vw, 24px);
}

.gallery__title{
  margin: 0 0 8px;
  text-transform: uppercase;
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 0.98;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  color: rgba(11,15,20,0.96);
}

.gallery__sub{
  margin: 0;
  color: rgba(11,15,20,0.70);
  font-size: 1.02rem;
}

/* Grid */
.galleryGrid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 16px);
}

.tile{
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;

  border-radius: 16px;
  overflow: hidden;

  /* crisp edge */
  outline: 1px solid rgba(11,15,20,0.10);
  box-shadow:
    0 22px 70px rgba(11,15,20,0.12);
  transform: translateZ(0);
}

.tile::after{
  content:"";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.00) 0%, rgba(11,15,20,0.10) 100%);
  opacity: 0.55;
}

.tile img{
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 220ms ease, filter 220ms ease;
  filter: contrast(1.02) saturate(1.02);
}

.tile:hover{
  outline-color: rgba(46,119,183,0.28);
}

.tile:hover img{
  transform: scale(1.06);
  filter: contrast(1.06) saturate(1.04);
}

.tile:focus-visible{
  outline: 3px solid rgba(46,119,183,0.55);
  outline-offset: 3px;
}

/* Responsive grid */
@media (max-width: 1100px){
  .galleryGrid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px){
  .galleryGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 360px){
  .galleryGrid{ grid-template-columns: 1fr; }
}

/* =========================
   LIGHTBOX
   ========================= */

body.is-locked{
  overflow: hidden;
}

.lightbox{
  position: fixed;
  inset: 0;
  z-index: 999;
}

.lightbox__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox__panel{
  position: absolute;
  inset: clamp(18px, 3vw, 34px);
  display: grid;
  place-items: center;
  border-radius: 18px;
  overflow: hidden;

  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.38);
  box-shadow: 0 70px 220px rgba(0,0,0,0.72);
}

.lightbox__img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox__close{
  position: absolute;
  top: 14px;
  right: 14px;

  width: 44px;
  height: 44px;
  border-radius: 12px;

  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.34);
  color: rgba(255,255,255,0.92);

  font-size: 26px;
  line-height: 0;
  cursor: pointer;

  box-shadow: 0 18px 55px rgba(0,0,0,0.45);
}

.lightbox__nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  width: 52px;
  height: 52px;
  border-radius: 999px;

  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.34);
  color: rgba(255,255,255,0.92);

  font-size: 40px;
  line-height: 0;
  cursor: pointer;

  display: grid;
  place-items: center;
  box-shadow: 0 18px 55px rgba(0,0,0,0.45);
}

.lightbox__nav--prev{ left: 14px; }
.lightbox__nav--next{ right: 14px; }

.lightbox__meta{
  position: absolute;
  bottom: 14px;
  left: 14px;

  padding: 10px 12px;
  border-radius: 999px;

  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 820;
  font-size: 0.72rem;

  color: rgba(255,255,255,0.82);
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.12);
}

/* Mobile nav */
@media (max-width: 920px){
  .nav{ gap: 10px; }
  .nav__toggle{ display: inline-flex; }

  .nav__links{
    position: fixed;
    left: var(--padX);
    right: var(--padX);
    top: calc(var(--padTop) + var(--logoH) + 10px);

    padding: 10px;
    display: grid;
    gap: 8px;

    background: rgba(0,0,0,0.72);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;

    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);

    box-shadow: 0 28px 90px rgba(0,0,0,0.65);

    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 1000;

    max-height: calc(100vh - (var(--padTop) + var(--logoH) + 24px));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav__links .nav__link{
    display: block;
    padding: 12px 12px;
    border-radius: 14px;
  }

  .nav__links .nav__link--active{
    background: rgba(46,119,183,0.16);
  }

  .nav__links .nav__link:hover{
    background: rgba(46,119,183,0.14);
  }

  .nav__links .btn{
    width: 100%;
    justify-content: center;
  }

  body.nav-open .nav__links{
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  body.nav-open .nav__toggleIcon::before{ top: 4px; transform: rotate(45deg); }
  body.nav-open .nav__toggleIcon::after{ bottom: 4px; transform: rotate(-45deg); }

  body.nav-open{ overflow: hidden; }
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .nav__link::after,
  .tile img,
  .btn,
  .btn__arrow{
    transition: none;
  }
}


/* =========================
   CONTACT CTA (projects)
   White section + dark panel
   ========================= */

.projectsCta{
  position: relative;
  background: linear-gradient(180deg, #f5f7fb 0%, #eef2f6 100%);
  color: #0b0f14;
  padding: clamp(70px, 7vw, 110px) 0;
  border-top: 1px solid rgba(11,15,20,0.06);
}

.projectsCta::before{
  content:"";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(46,119,183,0.10), transparent 60%),
    linear-gradient(90deg, rgba(11,15,20,0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(11,15,20,0.05) 1px, transparent 1px);
  background-size: auto, 84px 84px, 84px 84px;
  opacity: 1;
}

.projectsCta__inner{
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--padX);
}

.projectsCta__panel{
  position: relative;
  border-radius: 18px;
  overflow: hidden;

  padding: clamp(22px, 3.2vw, 34px);
  display: grid;
  grid-template-columns: 1.15fr auto;
  gap: clamp(18px, 3vw, 44px);
  align-items: center;

  background: linear-gradient(180deg, rgba(0,0,0,0.92) 0%, rgba(9,12,18,0.92) 100%);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 42px 160px rgba(0,0,0,0.30);
  isolation: isolate;
}

.projectsCta__panel::before{
  content:"";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 16% 0%, rgba(46,119,183,0.22), transparent 62%),
    radial-gradient(900px 700px at 110% 120%, rgba(255,255,255,0.06), transparent 60%),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: auto, auto, 84px 84px;
  opacity: 0.85;
  z-index: 0;
}

.projectsCta__copy,
.projectsCta__actions{
  position: relative;
  z-index: 1;
}

.projectsCta__eyebrow{
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 760;
  color: rgba(245,247,255,0.70);
}

.projectsCta__title{
  margin: 0 0 10px;
  text-transform: uppercase;
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 0.98;
  font-size: clamp(1.55rem, 2.5vw, 2.1rem);
  color: rgba(255,255,255,0.96);
  text-shadow: 0 26px 88px rgba(0,0,0,0.55);
}

.projectsCta__text{
  margin: 0 0 12px;
  color: rgba(245,247,255,0.78);
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 56ch;
}

.projectsCta__meta{
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 820;
  font-size: 0.74rem;
  color: rgba(245,247,255,0.58);
}

.projectsCta__actions{
  display: grid;
  justify-items: start;
  gap: 10px;
}

.projectsCta__hint{
  margin: 0;
  color: rgba(245,247,255,0.62);
  font-size: 0.95rem;
}

@media (max-width: 920px){
  .projectsCta__panel{
    grid-template-columns: 1fr;
  }
}

/* =========================
   FOOTER
   ========================= */

.footer{
  background: linear-gradient(180deg, #05070a 0%, #000 100%);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 40px 0 28px;
  color: #f5f7ff;
}

.footer__inner{
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--padX);
}

.footer__top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 26px;
  flex-wrap: wrap;
}

.footer__brand{
  max-width: 58ch;
}

.footer__logoLink{
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.footer__logo{
  height: clamp(62px, 4.8vw, 78px);
  width: auto;
  max-width: min(520px, 78vw);

  border-radius: 6px;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 18px 58px rgba(0,0,0,0.60);
}

.footer__tagline{
  margin: 12px 0 6px;
  color: rgba(245,247,255,0.74);
  font-weight: 720;
  letter-spacing: 0.02em;
}

.footer__area{
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 820;
  font-size: 0.74rem;
  color: rgba(245,247,255,0.55);
}

.footer__contact{
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.footer__contactLink{
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 6px 0;
  color: rgba(245,247,255,0.72);
}

.footer__contactLabel{
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 880;
  font-size: 0.72rem;
  color: rgba(245,247,255,0.52);
}

.footer__contactValue{
  font-weight: 760;
  font-size: 0.96rem;
  color: rgba(245,247,255,0.84);
  word-break: break-word;
}

.footer__contactLink::after{
  content:"";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(46,119,183,0.85), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 170ms ease;
  opacity: 0.9;
}

.footer__contactLink:hover{
  color: rgba(245,247,255,0.95);
}

.footer__contactLink:hover .footer__contactValue{
  color: rgba(255,255,255,0.96);
}

.footer__contactLink:hover::after{
  transform: scaleX(1);
}

.footer__nav{
  display: grid;
  gap: 10px;
  justify-items: end;
  min-width: 160px;
}

.footer__link{
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 860;
  font-size: 0.78rem;
  color: rgba(245,247,255,0.72);
  padding: 6px 0;
}

.footer__link::after{
  content:"";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(46,119,183,0.9), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 170ms ease;
  opacity: 0.9;
}

.footer__link:hover{
  color: rgba(245,247,255,0.95);
}

.footer__link:hover::after{
  transform: scaleX(1);
}

.footer__link--cta{
  color: rgba(255,255,255,0.92);
}

.footer__bottom{
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.06);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__copy{
  color: rgba(245,247,255,0.60);
  font-size: 0.92rem;
}

.footer__fine{
  color: rgba(245,247,255,0.44);
  font-size: 0.92rem;
}

@media (max-width: 720px){
  .footer__nav{
    justify-items: start;
  }
}