/* ==========================================================================
   Aurem — Work section (sticky project stack + colour spotlight + drag reel).
   Uses brand tokens from hero.css (:root --ah-*) and shared components.
   ========================================================================== */

.ah-work {
  z-index: 1;
  isolation: isolate;
  padding-top: clamp(60px, 10vh, 120px);
  /* no overflow:hidden here — it would break position: sticky on the cards */
}

.ah-work__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ah-work__glow {
  position: absolute; left: 50%; top: 2%;
  width: 70vw; height: 70vw; max-width: 1100px; max-height: 1100px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(200, 16, 46, .2), transparent);
  filter: blur(30px);
}
.ah-work > .ah-grain { position: absolute; inset: 0; z-index: 0; opacity: .06; animation: none; }

.ah-work__inner {
  position: relative; z-index: 1;
  max-width: 1680px; margin: 0 auto;
  padding: 0 var(--ah-gutter);
}

/* ---------- Intro ---------- */
.ah-work__intro {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 120px); align-items: end;
  margin-top: clamp(40px, 8vh, 90px);
}
.ah-work__title {
  font-family: var(--ah-display); font-variation-settings: "opsz" 96;
  font-weight: 600; font-size: clamp(2.8rem, 7.4vw, 8.2rem);
  line-height: .95; letter-spacing: -.055em;
}
.ah-work__title em { font-family: var(--ah-serif); font-style: italic; font-weight: 400; font-size: 1.06em; color: var(--ah-blush); letter-spacing: -.02em; }
.ah-work__count {
  font-family: var(--ah-sans); font-size: .16em; font-weight: 700;
  letter-spacing: .06em; color: var(--ah-ember);
  vertical-align: 3.6em; margin-left: .4em;
}
.ah-work__lead { max-width: 26rem; padding-bottom: .8em; font-size: 16px; line-height: 1.65; color: var(--ah-muted); }

/* ---------- Sticky project stack ---------- */
.ah-stack { position: relative; z-index: 1; margin-top: clamp(40px, 8vh, 90px); }
.ah-proj {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: flex; align-items: center; justify-content: center;
  /* each card sits a little lower so the ones behind peek out */
  padding: calc(84px + var(--i, 0) * 14px) var(--ah-gutter) 28px;
}
.ah-proj__card {
  position: relative;
  width: 100%; max-width: 1560px; height: 100%;
  border-radius: var(--ah-radius-lg);
  overflow: hidden;
  isolation: isolate;
  -webkit-mask-image: linear-gradient(#000, #000); mask-image: linear-gradient(#000, #000);
  background: var(--ah-ink-2);
  border: 1px solid var(--ah-line);
  box-shadow: 0 -30px 80px -30px rgba(0, 0, 0, .8);
  transform-origin: 50% 0%;
  will-change: transform;
}

.ah-proj__media { position: absolute; inset: 0; }
.ah-proj__layer { position: absolute; inset: 0; }
.ah-proj__layer img {
  position: absolute; left: 0; top: -8%;
  width: 100%; height: 116%;
  object-fit: cover;
  will-change: transform;
}
.ah-proj__layer.ah-duo img { filter: grayscale(1) contrast(1.3) brightness(.85); }
.ah-proj__color {
  z-index: 3;
  --r: 0px;
  clip-path: circle(var(--r) at var(--x, 50%) var(--y, 50%));
}
.ah-proj__color img { filter: saturate(1.15) contrast(1.05); }

.ah-proj__shade {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background:
    linear-gradient(to top, rgba(7, 6, 10, .92) 0%, rgba(7, 6, 10, .35) 38%, transparent 60%),
    linear-gradient(to bottom, rgba(7, 6, 10, .6), transparent 22%);
}
/* darkening overlay driven by the stack animation */
.ah-proj__card::after {
  content: ""; position: absolute; inset: 0; z-index: 8; pointer-events: none;
  background: var(--ah-ink);
  opacity: var(--dim, 0);
}

.ah-proj__top, .ah-proj__bottom { position: absolute; left: 0; right: 0; z-index: 6; padding: clamp(20px, 2.6vw, 40px); }
.ah-proj__top { top: 0; display: flex; align-items: center; gap: 16px; }
.ah-proj__idx { font-family: var(--ah-display); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.ah-proj__idx i { font-style: normal; color: var(--ah-muted); font-weight: 500; }
.ah-proj__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.ah-proj__tags span {
  padding: 7px 14px; border-radius: 999px;
  background: rgba(7, 6, 10, .45); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
.ah-proj__year {
  padding: 7px 14px; border-radius: 999px;
  background: var(--ah-ember); color: var(--ah-ink);
  font-size: 12px; font-weight: 700;
}

.ah-proj__bottom { bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.ah-proj__client {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ah-gold);
}
.ah-proj__client::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.ah-proj__title {
  margin-top: 14px; max-width: 16ch;
  font-family: var(--ah-display); font-variation-settings: "opsz" 96;
  font-weight: 600; font-size: clamp(2.2rem, 5vw, 5.4rem);
  line-height: .98; letter-spacing: -.05em;
}
.ah-proj__title em { font-family: var(--ah-serif); font-style: italic; font-weight: 400; color: var(--ah-blush); letter-spacing: -.02em; }
/* one full-card link per project (sits under the text, above the image) */
.ah-proj__link { position: absolute; inset: 0; z-index: 5; }
.ah-proj__link:focus-visible { outline: none; }
.ah-proj__card:has(.ah-proj__link:focus-visible) { outline: 2px solid var(--ah-gold); outline-offset: 4px; }
.ah-proj__top, .ah-proj__bottom { pointer-events: none; }

.ah-proj__results { display: flex; gap: 12px; flex: none; }
.ah-proj__results li {
  min-width: 150px; padding: 16px 18px;
  border-radius: var(--ah-radius-md);
  background: rgba(7, 6, 10, .5); border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.ah-proj__results strong {
  display: block;
  font-family: var(--ah-display); font-weight: 600;
  font-size: clamp(1.8rem, 2.6vw, 2.6rem); line-height: 1; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: var(--ah-text);
}
.ah-proj__results li > span { display: block; margin-top: 8px; font-size: 13px; color: var(--ah-muted); }

/* word masks (shared with services.js style) */
.ah-proj__title .ah-mw { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .04em .1em; margin: 0 -.04em -.1em; }

/* ---------- Drag reel ---------- */
.ah-reel { position: relative; z-index: 1; margin-top: clamp(80px, 14vh, 160px); }
.ah-reel__head {
  max-width: 1680px; margin: 0 auto 28px; padding: 0 var(--ah-gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.ah-reel__hint { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ah-muted); }
.ah-reel__hint span { color: var(--ah-ember); }
.ah-reel__viewport {
  overflow: hidden;
  padding: 20px 0 30px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.ah-reel__viewport.is-grabbing { cursor: grabbing; }
.ah-reel__track { display: flex; gap: 20px; width: max-content; padding-left: var(--ah-gutter); will-change: transform; }
.ah-reel__item { flex: none; width: clamp(220px, 21vw, 340px); display: block; }
.ah-reel__item figure {
  margin: 0; aspect-ratio: 4 / 5;
  border-radius: var(--ah-radius-md);
  transition: border-radius .6s var(--ah-ease);
}
.ah-reel__item img { transition: transform 1s var(--ah-ease); pointer-events: none; -webkit-user-drag: none; }
.ah-reel__item p { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 14px; }
.ah-reel__item strong { font-family: var(--ah-display); font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.ah-reel__item p span { font-size: 13px; color: var(--ah-muted); white-space: nowrap; }
@media (hover: hover) {
  .ah-reel__item:hover figure { border-radius: 999px 999px var(--ah-radius-md) var(--ah-radius-md); }
  .ah-reel__item:hover img { transform: scale(1.08); }
}

.ah-work__all {
  position: relative; z-index: 1;
  display: flex; justify-content: center;
  padding: clamp(50px, 9vh, 100px) var(--ah-gutter) clamp(90px, 14vh, 160px);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .ah-work__intro { grid-template-columns: 1fr; }
  .ah-proj__bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .ah-work__head .ah-label:last-child { display: none; }
  .ah-proj { padding: calc(76px + var(--i, 0) * 10px) 12px 16px; }
  .ah-proj__tags { display: none; }
  .ah-proj__year { margin-left: auto; }
  .ah-proj__title { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  .ah-proj__results li { min-width: 0; padding: 12px 14px; }
  .ah-reel__hint { display: none; }
}
