/**
 * Portfolio page layout lock + scoped hero/footer curtains.
 * Loaded LAST after style.css / portfolio-atlas.css.
 *
 * Hero curtain: sticky .pf-hero.nh-curtain-banner; opaque .nh-curtain-panel
 * sections (ethos, atlas) scroll over it. Atlas remains solid dark.
 *
 * Footer curtain: desktop footer-reveal sized to measured footer height only
 * (not the global 100vh + 150px dead zone).
 */

/* ---- Scroll + sticky prerequisites ---- */
html.pf-page {
  overflow-x: visible !important;
  overflow-y: scroll !important;
  height: auto !important;
  scroll-padding-top: 110px;
}

html.pf-page body,
html.pf-page body.portfolio-page {
  overflow-x: visible !important;
  overflow-y: visible !important;
  height: auto !important;
  min-height: 100% !important;
  margin: 0 !important;
  background: #0a0a0c !important;
  position: relative !important;
}

html.pf-page body.portfolio-page #wrapper.footer-reveal-content,
html.pf-page body.portfolio-page #wrapper {
  position: relative !important;
  z-index: 10 !important;
  overflow: visible !important;
  overflow-x: visible !important;
  height: auto !important;
  min-height: 0 !important;
  transform: none !important;
  background: #0a0a0c !important;
  margin-bottom: 0 !important;
}

@media (min-width: 821px) {
  html.pf-page body.portfolio-page.footer-reveal-ready #wrapper.footer-reveal-content,
  html.pf-page body.portfolio-page.footer-reveal-ready #wrapper {
    margin-bottom: calc(var(--footer-reveal-height, 0px) + 32px) !important;
  }

  html.pf-page body.portfolio-page.footer-reveal-ready > .site-footer {
    position: fixed !important;
    z-index: 1 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 820px) {
  html.pf-page body.portfolio-page.footer-reveal-ready > .site-footer {
    position: relative !important;
    inset: auto !important;
    z-index: auto !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

html.pf-page body.portfolio-page main.pf-main {
  display: block !important;
  position: relative !important;
  z-index: 10 !important;
  width: 100% !important;
  height: auto !important;
  overflow: visible !important;
  transform: none !important;
  isolation: auto !important;
}

html.pf-page body.portfolio-page main.pf-main > .estimate,
html.pf-page body.portfolio-page main.pf-main > section.footer-reveal-cta {
  display: block !important;
  position: relative !important;
  float: none !important;
  clear: both !important;
  width: 100% !important;
  z-index: 12 !important;
  transform: none !important;
  background: #0a0a0c !important;
}

/* ---- HERO CURTAIN stack ---- */
html.pf-page .pf-curtain.nh-curtain-stack {
  position: relative !important;
  z-index: 1 !important;
  isolation: isolate !important;
  overflow: visible !important;
  transform: none !important;
  filter: none !important;
  contain: none !important;
  perspective: none !important;
}

html.pf-page .pf-hero.nh-curtain-banner,
html.pf-page .pf-hero.page-hero,
html.pf-page section.pf-hero {
  box-sizing: border-box !important;
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 1 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100svh !important;
  min-height: 100vh !important;
  min-height: 100svh !important;
  max-height: 100vh !important;
  max-height: 100svh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #0a0a0c !important;
  contain: paint !important;
  isolation: isolate !important;
  transform: none !important;
  float: none !important;
}

html.pf-page .pf-curtain .nh-curtain-panel,
html.pf-page .pf-ethos.nh-curtain-panel,
html.pf-page .pf-atlas.nh-curtain-panel {
  position: relative !important;
  z-index: 2 !important;
  display: block !important;
  width: 100% !important;
  float: none !important;
  clear: both !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-top: 0 !important;
  transform: none !important;
}

html.pf-page .pf-hero__wall {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  --wall-gap: 18px;
  --wall-loop: 36s;
  --wall-tilt: -7deg;
  --tide-x: 11px;
  -webkit-mask-image: radial-gradient(ellipse 78% 82% at 50% 50%, #000 38%, rgba(0, 0, 0, 0.62) 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 78% 82% at 50% 50%, #000 38%, rgba(0, 0, 0, 0.62) 72%, transparent 100%);
}

html.pf-page .pf-hero__stage {
  position: absolute !important;
  inset: -24% -15% !important;
  display: flex !important;
  gap: var(--wall-gap) !important;
  transform: rotate(var(--wall-tilt));
  animation: pfHeroTide 18s ease-in-out infinite !important;
  will-change: transform;
  pointer-events: auto !important;
}

html.pf-page .pf-hero__col {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  --sway-x: 4px;
  --sway-y: 13px;
  --sway-tilt: 0.3deg;
  --sway-dir: 1;
  --sway-period: 12s;
  --sway-phase: 0s;
  animation: pfHeroSway var(--sway-period) ease-in-out var(--sway-phase) infinite !important;
  will-change: transform;
}

html.pf-page .pf-hero__col:nth-child(1) { --sway-period: 12s; --sway-phase: -1.5s; }
html.pf-page .pf-hero__col:nth-child(2) { --sway-period: 9s; --sway-phase: -3s; --sway-dir: -1; }
html.pf-page .pf-hero__col:nth-child(3) { --sway-period: 7.2s; --sway-phase: -0.9s; }
html.pf-page .pf-hero__col:nth-child(4) { --sway-period: 18s; --sway-phase: -4.5s; --sway-dir: -1; }
html.pf-page .pf-hero__col:nth-child(5) { --sway-period: 6s; --sway-phase: -2.4s; }
html.pf-page .pf-hero__col:nth-child(6) { --sway-period: 9s; --sway-phase: -6s; --sway-dir: -1; }
html.pf-page .pf-hero__col:nth-child(7) { --sway-period: 12s; --sway-phase: -7.5s; }
html.pf-page .pf-hero__col:nth-child(8) { --sway-period: 7.2s; --sway-phase: -3.6s; --sway-dir: -1; }

html.pf-page .pf-hero__track {
  animation: pfHeroDrift var(--wall-loop) linear infinite !important;
  will-change: transform;
  animation-play-state: running !important;
}

html.pf-page .pf-hero__track--up {
  animation-direction: reverse !important;
}

html.pf-page .pf-hero__set {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--wall-gap) !important;
  padding-bottom: var(--wall-gap) !important;
}

/* Pause wall only when off-screen or user hovers (fine pointer). Never permanently. */
html.pf-page .pf-hero__wall.is-paused .pf-hero__stage,
html.pf-page .pf-hero__wall.is-paused .pf-hero__col,
html.pf-page .pf-hero__wall.is-paused .pf-hero__track {
  animation-play-state: paused !important;
}

html.pf-page .pf-hero__set img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 14px !important;
  background: #17171a !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45) !important;
  /* Keep wall frames clear — avoid muddy dim; wall assets are ~480px decorative tiles */
  filter: none !important;
  object-fit: cover !important;
  object-position: center top !important;
  image-rendering: auto !important;
}

@media (hover: hover) and (pointer: fine) {
  html.pf-page .pf-hero__wall:hover .pf-hero__stage,
  html.pf-page .pf-hero__wall:hover .pf-hero__col,
  html.pf-page .pf-hero__wall:hover .pf-hero__track {
    animation-play-state: paused !important;
  }
}

html.pf-page .pf-hero__shade {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  background:
    radial-gradient(ellipse 78% 66% at 50% 50%,
      rgba(6, 6, 8, 0.9) 0%,
      rgba(6, 6, 8, 0.78) 44%,
      rgba(6, 6, 8, 0.34) 78%,
      rgba(6, 6, 8, 0.14) 100%),
    linear-gradient(180deg,
      rgba(6, 6, 8, 0.8) 0%,
      rgba(6, 6, 8, 0) 24%,
      rgba(6, 6, 8, 0) 72%,
      rgba(6, 6, 8, 0.92) 100%);
}

html.pf-page .pf-hero__copy {
  position: relative !important;
  z-index: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  padding: 100px 0 72px !important;
  text-align: center !important;
}

html.pf-page .pf-hero__kicker {
  margin: 0 0 17px !important;
  color: #726cf4 !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase !important;
}

html.pf-page .pf-hero__copy h1 {
  max-width: 900px !important;
  margin: 0 auto !important;
  font-family: "Playfair Display", Georgia, serif !important;
  font-size: clamp(3.2rem, 7vw, 6.6rem) !important;
  font-weight: 500 !important;
  letter-spacing: -0.055em !important;
  line-height: 0.92 !important;
  color: #fff !important;
}

html.pf-page .pf-hero__copy h1 em {
  color: #726cf4 !important;
  font-style: italic !important;
  font-weight: 500 !important;
}

html.pf-page .pf-hero__note {
  max-width: 650px !important;
  margin: 28px auto 0 !important;
  color: rgba(255, 255, 255, 0.88) !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 14px !important;
  line-height: 1.75 !important;
}

html.pf-page .pf-hero__cta {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  margin-top: 32px !important;
  padding: 0 22px !important;
  border-radius: 999px !important;
  background: #726cf4 !important;
  color: #fff !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  border: 1px solid transparent !important;
  transition: background 160ms ease, transform 160ms ease;
}

html.pf-page .pf-hero__cta:hover {
  background: #5f58dc !important;
  transform: translateY(-1px);
}

@keyframes pfHeroDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, -50%, 0); }
}

@keyframes pfHeroSway {
  0%, 50%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  25% {
    transform:
      translate3d(calc(var(--sway-x) * var(--sway-dir)), calc(var(--sway-y) * var(--sway-dir) * -1), 0)
      rotate(calc(var(--sway-tilt) * var(--sway-dir)));
  }
  75% {
    transform:
      translate3d(calc(var(--sway-x) * var(--sway-dir) * -1), calc(var(--sway-y) * var(--sway-dir)), 0)
      rotate(calc(var(--sway-tilt) * var(--sway-dir) * -1));
  }
}

@keyframes pfHeroTide {
  0%, 50%, 100% { transform: rotate(var(--wall-tilt)) translate3d(0, 0, 0); }
  25% {
    transform: rotate(calc(var(--wall-tilt) + 0.5deg)) translate3d(var(--tide-x), 0, 0);
  }
  75% {
    transform: rotate(calc(var(--wall-tilt) - 0.5deg)) translate3d(calc(var(--tide-x) * -1), 0, 0);
  }
}

/* ---- ETHOS ---- */
html.pf-page .pf-ethos {
  position: relative !important;
  z-index: 2 !important;
  isolation: isolate !important;
  overflow: hidden !important;
  transform: none !important;
  margin-bottom: 0 !important;
  background: #f6f5f2 !important;
  padding: 118px 0 124px !important;
  color: #15233c !important;
}

html.pf-page .pf-shell {
  width: min(1180px, calc(100% - 48px)) !important;
  margin: 0 auto !important;
}

html.pf-page .pf-ethos__grid {
  display: grid !important;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr) !important;
  gap: 0 88px !important;
  align-items: start !important;
}

html.pf-page .pf-ethos__eyebrow {
  grid-column: 1 / -1 !important;
  margin: 0 0 34px !important;
  color: #5f58dc !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.28em !important;
  text-transform: uppercase !important;
}

html.pf-page .pf-ethos__title {
  margin: 0 !important;
  font-family: "Playfair Display", Georgia, serif !important;
  font-size: clamp(2.3rem, 4.4vw, 4rem) !important;
  font-weight: 400 !important;
  letter-spacing: -0.035em !important;
  line-height: 1.04 !important;
  color: #15233c !important;
}

html.pf-page .pf-ethos__title em {
  font-style: italic !important;
  color: #5f58dc !important;
}

html.pf-page .pf-ethos__body p {
  margin: 0 0 20px !important;
  color: #667085 !important;
  font-size: 15px !important;
  line-height: 1.85 !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
}

html.pf-page .pf-ethos__body p:last-child {
  margin-bottom: 0 !important;
}

/* ---- ATLAS lock: opaque band, never under/over hero ---- */
html.pf-page .pf-atlas,
html.pf-page section.atlas#atlas {
  display: block !important;
  position: relative !important;
  z-index: 2 !important;
  isolation: isolate !important;
  margin: 0 !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  /* Fully opaque — wall/ethos cream must never show through */
  background: #0a0f16 !important;
  background-color: #0a0f16 !important;
  background-image: none !important;
  color: #e8eef7 !important;
  overflow: visible !important;
  contain: none !important;
  /* Content-sized — do NOT force 80vh black void under the rail */
  min-height: 0 !important;
  height: auto !important;
  padding-top: clamp(48px, 6vw, 72px) !important;
  padding-bottom: clamp(48px, 6vw, 72px) !important;
}

/* Kill site `header { position:fixed; white-header }` if markup regressed */
html.pf-page .atlas__head,
html.pf-page header.atlas__head {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: none !important;
  z-index: auto !important;
  transform: none !important;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-bottom: clamp(24px, 3.4vw, 36px) !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  display: grid !important;
  gap: clamp(18px, 2.2vw, 26px) !important;
}

html.pf-page .atlas__masthead > * {
  min-width: 0 !important;
  max-width: none !important;
}

/* White ink on the display title; only the <em> clips a gradient, and it carries
   its own transparent fill so this must not blank the rest of the line. */
html.pf-page .atlas__display {
  margin: 0 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  max-width: none !important;
}

html.pf-page .atlas__lede {
  color: rgba(232, 238, 247, 0.72) !important;
  max-width: 56ch !important;
  font-size: clamp(14.5px, 1.05vw, 16.5px) !important;
  line-height: 1.72 !important;
}

/* Vertical tabs: readable labels, never invisible / collapsed boxes */
html.pf-page .atlas__filters {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 7px !important;
  justify-content: flex-start !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding: 3px 0 5px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  -webkit-overflow-scrolling: touch !important;
}

html.pf-page .atlas__filters::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Chips that read as chips even when inactive. The !important run only exists to
   out-rank site `style.css`, which otherwise collapses these into blank boxes. */
html.pf-page .atlas__filters button {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;
  height: auto !important;
  min-height: 38px !important;
  margin: 0 !important;
  padding: 9px 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.055) !important;
  background-image: none !important;
  color: #dfe6f2 !important;
  -webkit-text-fill-color: currentColor !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.005em !important;
  line-height: 1.2 !important;
  text-transform: none !important;
  text-indent: 0 !important;
  white-space: nowrap !important;
  visibility: visible !important;
  overflow: visible !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

html.pf-page .atlas__filters button > span {
  display: inline-flex !important;
  visibility: visible !important;
  text-transform: none !important;
  -webkit-text-fill-color: currentColor !important;
}

html.pf-page .atlas__filters button:hover {
  color: #fff !important;
  background: rgba(114, 108, 244, 0.16) !important;
  border-color: rgba(114, 108, 244, 0.55) !important;
}

html.pf-page .atlas__filters button.is-active,
html.pf-page .atlas__filters button[aria-pressed="true"] {
  background: linear-gradient(135deg, #7d77f7, #5b53d8) !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(114, 108, 244, 0.42) !important;
}

/* The trailing fade is the only hint that the row scrolls, since the scrollbar is
   hidden — and it only appears while the chips actually overrun the row. */
html.pf-page .atlas__filters.is-scrollable {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
}

html.pf-page .atlas__filters.is-scrollable:focus-within {
  -webkit-mask-image: none;
  mask-image: none;
}

@media (max-width: 768px) {
  html.pf-page .atlas__filters button {
    min-height: 40px !important;
  }
}

html.pf-page .atlas__inner {
  background-color: transparent !important;
}

/* Header chrome for dark → light transition */
html.pf-page body.portfolio-page header.logo-navbar {
  background: linear-gradient(180deg, rgba(9, 9, 11, 0.82), rgba(9, 9, 11, 0)) !important;
  border: 0 !important;
  box-shadow: none !important;
}

html.pf-page body.portfolio-page header.logo-navbar .logo-on-dark { display: block !important; }
html.pf-page body.portfolio-page header.logo-navbar .logo-on-light { display: none !important; }
html.pf-page body.portfolio-page header.logo-navbar #navigation > li.nav-item > a { color: #fff !important; }
html.pf-page body.portfolio-page header.logo-navbar #navigation > li.nav-item.active > a {
  background: none !important;
  color: #726cf4 !important;
  -webkit-text-fill-color: #726cf4 !important;
}

html.pf-page body.portfolio-page header.logo-navbar.white-header {
  background: rgba(255, 255, 255, 0.97) !important;
  border-bottom: 1px solid #ecebf4 !important;
}

html.pf-page body.portfolio-page header.logo-navbar.white-header .logo-on-dark { display: none !important; }
html.pf-page body.portfolio-page header.logo-navbar.white-header .logo-on-light { display: block !important; }
html.pf-page body.portfolio-page header.logo-navbar.white-header #navigation > li.nav-item > a { color: #343147 !important; }
html.pf-page body.portfolio-page header.logo-navbar.white-header #navigation > li.nav-item.active > a {
  background: none !important;
  color: #726cf4 !important;
  -webkit-text-fill-color: #726cf4 !important;
}
html.pf-page body.portfolio-page .navbar-toggle.nav-menu { display: none !important; }

/* Responsive */
@media (max-width: 1400px) {
  html.pf-page .pf-hero__col:nth-child(8) { display: none !important; }
}
@media (max-width: 1280px) {
  html.pf-page .pf-hero__col:nth-child(7) { display: none !important; }
}
@media (max-width: 1100px) {
  html.pf-page .pf-hero__col:nth-child(6) { display: none !important; }
}
@media (max-width: 900px) {
  html.pf-page .pf-hero__col:nth-child(5) { display: none !important; }
  html.pf-page .pf-ethos__grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 30px !important;
  }
}
@media (max-width: 767px) {
  html.pf-page .pf-shell { width: calc(100% - 32px) !important; }
  html.pf-page .pf-hero__copy { padding: 86px 0 64px !important; }
  html.pf-page .pf-hero__copy h1 { font-size: clamp(2.6rem, 12vw, 4rem) !important; }
  html.pf-page .pf-hero__wall {
    --wall-gap: 12px;
    --wall-tilt: -6deg;
    --tide-x: 7px;
  }
  html.pf-page .pf-hero__col {
    --sway-x: 3px;
    --sway-y: 9px;
  }
  html.pf-page .pf-hero__stage { inset: -20% -22% !important; }
  html.pf-page .pf-hero__set img { border-radius: 11px !important; }
  html.pf-page .pf-ethos { padding: 78px 0 82px !important; }
  html.pf-page .pf-hero__col:nth-child(4) { display: none !important; }
}

@media (max-width: 560px) {
  html.pf-page .pf-hero__col:nth-child(3) { display: none !important; }
}

/* Soften motion only — do not kill the wall (it's the hero's visual). */
@media (prefers-reduced-motion: reduce) {
  html.pf-page .pf-hero__stage {
    animation: none !important;
  }
  html.pf-page .pf-hero__col {
    animation: none !important;
  }
  /* Keep drift at constant slow velocity — replace with much slower cycle */
  html.pf-page .pf-hero__track {
    animation-duration: 90s !important;
  }
}
