/* ==========================================================================
   Sarah Sabah — Additive Elevation Layer (elevated.css)
   STRICT CONTRACT: ZERO changes to font-family, font-size, line-height,
   letter-spacing, word-spacing, kerning, or layout proportions from styles.css.
   ========================================================================== */

:root {
  --el-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --el-ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --el-ease-curtain: cubic-bezier(0.77, 0, 0.175, 1);
}

/* Hide browser scrollbars cleanly while keeping 100% native macOS scrolling */
html {
  scrollbar-width: none;
  scroll-behavior: auto;
}
html::-webkit-scrollbar { display: none; }

/* Seamless transparent topbar while over the hero (fixes mobile beige bar too) */
.topbar.on-hero,
.topbar.scrolled.on-hero {
  background: transparent;
  border-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ==========================================================================
   1. Animated Reload / Entrance Curtain
   ========================================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: auto;
}
.preloader[hidden] { display: none; }
.preloader.is-parting { pointer-events: none; }

.preloader-curtain {
  position: absolute;
  left: 0;
  right: 0;
  height: 51%;
  background: #1e251b;
  transform: translate3d(0, 0, 0);
  transition: transform .78s var(--el-ease-curtain);
  will-change: transform;
}
.preloader-curtain-top { top: 0; }
.preloader-curtain-bottom { bottom: 0; }
.preloader.is-parting .preloader-curtain-top { transform: translate3d(0, -104%, 0); }
.preloader.is-parting .preloader-curtain-bottom { transform: translate3d(0, 104%, 0); }

.preloader-glow {
  position: absolute;
  inset: -14%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 42% 32% at 50% 48%, rgba(244, 119, 24, .22), transparent 68%),
    radial-gradient(ellipse 68% 52% at 50% 52%, rgba(119, 120, 36, .18), transparent 74%);
  transition: opacity .45s var(--el-ease-out), transform .7s var(--el-ease-out);
}
.preloader.is-parting .preloader-glow {
  opacity: 0;
  transform: scale(1.1);
}

.preloader-seam {
  position: absolute;
  left: 6vw;
  right: 6vw;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 119, 24, .82) 22%, rgba(246, 239, 223, .92) 50%, rgba(244, 119, 24, .82) 78%, transparent);
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  pointer-events: none;
  transition: transform .42s var(--el-ease-curtain), opacity .28s ease;
}
.preloader.is-seam-flash .preloader-seam { transform: scaleX(1); opacity: .9; }
.preloader.is-parting .preloader-seam { transform: scaleX(1.06); opacity: 0; transition-duration: .26s; }

.preloader-stage {
  position: relative;
  z-index: 2;
  width: min(520px, 84vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.4rem, 3vh, 2.2rem);
  color: var(--paper-light);
  transition: opacity .3s var(--el-ease-out), transform .46s var(--el-ease-out);
}
.preloader.is-parting .preloader-stage {
  opacity: 0;
  transform: translate3d(0, -14px, 0) scale(.97);
}

.preloader-kicker {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(246, 239, 223, .8);
}
.preloader-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--rust);
}

.preloader-mark-wrap {
  position: relative;
  width: clamp(220px, 34vw, 350px);
  min-height: clamp(96px, 16vh, 152px);
  display: grid;
  place-items: center;
}
.preloader-mark {
  width: 100%;
  height: auto;
  object-fit: contain;
  clip-path: inset(0 100% 0 0);
  transform: translate3d(0, 6px, 0) scale(.97);
  filter: drop-shadow(0 12px 34px rgba(244, 119, 24, .34));
  animation: elMarkDraw .68s var(--el-ease-expo) .04s forwards;
}
@keyframes elMarkDraw {
  to { clip-path: inset(0 0% 0 0); transform: translate3d(0, 0, 0) scale(1); }
}

.preloader-meter {
  width: min(320px, 72vw);
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.preloader-bar {
  width: 100%;
  height: 1.5px;
  background: rgba(246, 239, 223, .22);
  overflow: hidden;
}
.preloader-bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--olive-light), var(--rust) 72%, var(--paper-light));
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}
.preloader-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(246, 239, 223, .78);
}
.preloader-count {
  font-family: var(--serif);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--paper-light);
}

/* Chapter label centered inside existing .page-wipe */
.page-wipe-label {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: var(--paper-light);
  font: 400 clamp(2.2rem, 5vw, 4.8rem)/.9 "Maragsa", var(--serif);
  letter-spacing: -.025em;
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: opacity .24s var(--el-ease-out), transform .32s var(--el-ease-out);
  pointer-events: none;
}
body.is-transitioning .page-wipe-label {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: .12s;
}

/* ==========================================================================
   2. 120fps WebGL Liquid-Silk Home Background (Zero SVG Mask Flicker!)
   ========================================================================== */
.hero-silk-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity .5s var(--el-ease-out);
  pointer-events: none;
}
html.has-webgl-silk .hero-silk-canvas { opacity: 1; }
/* Let the live 120fps WebGL silk shine directly through the STATIC transparent SVG letter cutouts */
html.has-webgl-silk .hero-pattern-reveal { opacity: 0 !important; }
html.has-webgl-silk .hero-media::after { opacity: .28; }

/* Subtle GPU scroll parallax readiness on Selected Work full-bleed plates (zero layout change) */
.project-visual > img {
  will-change: transform;
}

/* Eliminate expensive per-frame full-viewport blur repainting on hero veils */
.hero-green-layers span { filter: none !important; }

/* Subtle breathing scroll cue bottom-left of hero */
.hero-scroll-cue {
  position: absolute;
  z-index: 8;
  left: 4.8vw;
  bottom: 4.2vh;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  color: rgba(246, 239, 223, .76);
  opacity: var(--hero-cue-opacity, 1);
}
.hero-scroll-label {
  font-size: 7.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .24em;
}
.hero-scroll-line {
  position: relative;
  width: 44px;
  height: 1px;
  background: rgba(246, 239, 223, .26);
  overflow: hidden;
}
.hero-scroll-line i {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--rust), var(--paper-light));
  transform: translateX(-100%);
  animation: elScrollLine 2.4s var(--el-ease-out) infinite;
}
@keyframes elScrollLine {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   3. GPU-Light Cursor Orb & Zero-DOM-Churn Canvas Dust
   ========================================================================== */
.ambient-dust {
  position: fixed;
  inset: 0;
  z-index: 108;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Keep her exact warm amber-olive glow orb, without heavy blur(12px/18px) pseudo-elements */
.cursor-orb,
body.cursor-hover .cursor-orb,
body.cursor-glass .cursor-orb {
  filter: none !important;
  box-shadow: none !important;
  width: 112px;
  height: 112px;
  background:
    radial-gradient(circle at 38% 36%, rgba(255, 241, 196, .58) 0%, rgba(255, 214, 152, .2) 18%, transparent 45%),
    radial-gradient(circle at 56% 52%, rgba(244, 119, 24, .38) 0%, rgba(244, 119, 24, .12) 36%, transparent 70%),
    radial-gradient(circle at 42% 64%, rgba(151, 151, 68, .32) 0%, transparent 72%);
  transition: opacity .28s var(--el-ease-out);
}
.cursor-orb::before,
.cursor-orb::after { display: none !important; }
body.cursor-lensed .cursor-orb { opacity: .18 !important; }

/* ==========================================================================
   4. Capabilities — Zero-Flash Pre-Mounted Crossfade & Scrub Filament
   ========================================================================== */
.journey-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.045);
  transition: opacity .38s var(--el-ease-out), transform .75s var(--el-ease-expo);
}
.journey-image img.is-active {
  opacity: 1;
  transform: scale(1);
}
.journey-nav-track {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1.5px;
  pointer-events: none;
}
.journey-nav-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--rust), #ffb36b);
  box-shadow: 0 0 12px rgba(244, 119, 24, .65);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}
.journey-nav button::before { display: none; }

/* Remove expensive blur on journey-stage::before */
.journey-stage::before { filter: none !important; }

/* ==========================================================================
   5. Floating Archive Hover Preview, Signature Reveal & Lightbox
   ========================================================================== */
.archive-hover-preview {
  position: fixed;
  z-index: 106;
  left: 0;
  top: 0;
  width: clamp(220px, 20vw, 300px);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-400px, -400px, 0) scale(.94);
  transition: opacity .22s var(--el-ease-out);
  will-change: transform, opacity;
}
.archive-hover-preview.is-visible { opacity: 1; }
.archive-hover-frame {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--olive-deep);
  box-shadow: 0 24px 60px rgba(24, 31, 22, .32);
}
.archive-hover-caption {
  display: block;
  margin-top: .5rem;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 1px 10px rgba(233, 226, 208, .92);
}

.case-study-gallery figure[data-lightbox],
.archive-item-hero[data-lightbox] { cursor: zoom-in; }

/* Subtle ink-flow reveal on About signature without altering font/size */
.signature span {
  display: inline-block;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.15s var(--el-ease-expo) .2s;
}
.about-copy.in-view .signature span { clip-path: inset(0 0% 0 0); }

/* Editorial Full-Screen Image Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: flex;
  flex-direction: column;
  color: var(--paper-light);
  opacity: 0;
  transition: opacity .24s var(--el-ease-out);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 30, 22, .93);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.lightbox-chrome {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 4vw;
}
.lightbox-counter {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .1em;
  color: rgba(246, 239, 223, .74);
}
.lightbox-close {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: 9px 16px;
  border-radius: 99px;
  border: 1px solid rgba(246, 239, 223, .32);
  background: rgba(246, 239, 223, .06);
  color: var(--paper-light);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .15s ease;
}
.lightbox-close i { font-style: normal; font-size: 15px; line-height: 1; }
.lightbox-close:active { transform: scale(.96); }

.lightbox-stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2vw;
  padding: 0 3vw 3rem;
  min-height: 0;
}
.lightbox-figure {
  margin: 0;
  max-width: 82vw;
  max-height: 78vh;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  transform: scale(.95);
  transition: transform .3s var(--el-ease-expo);
}
.lightbox.is-open .lightbox-figure { transform: scale(1); }
.lightbox-figure img {
  width: auto;
  height: auto;
  max-width: 80vw;
  max-height: 70vh;
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .45);
}
.lightbox-figure figcaption {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(246, 239, 223, .78);
  text-align: center;
}
.lightbox-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(246, 239, 223, .28);
  background: rgba(246, 239, 223, .06);
  color: var(--paper-light);
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: background-color .2s ease, color .2s ease, opacity .2s ease, transform .15s ease;
}
.lightbox-nav[hidden] { opacity: 0; pointer-events: none; display: grid; }

@media (hover: hover) and (pointer: fine) {
  .lightbox-close:hover,
  .lightbox-nav:hover { background: var(--paper-light); color: var(--ink); }
}

@media (max-width: 800px) {
  .ambient-dust,
  .archive-hover-preview { display: none !important; }
  .hero-scroll-cue { left: 5vw; bottom: 3.5vh; }
  .lightbox-stage { grid-template-columns: 1fr; padding: 0 4vw 2rem; }
  .lightbox-nav { position: fixed; bottom: 1.5rem; z-index: 4; }
  .lightbox-prev { left: 4vw; }
  .lightbox-next { right: 4vw; }
  .lightbox-figure img { max-width: 92vw; max-height: 64vh; }
}

@media (prefers-reduced-motion: reduce) {
  .preloader,
  .hero-silk-canvas,
  .ambient-dust,
  .archive-hover-preview { display: none !important; }
  .hero-scroll-line i { animation: none !important; }
  .signature span { clip-path: none !important; }
}
