/* ------------------------------------------------------------------
   Recent Work — cinematic showcase
   A ground-up, editorial reimagining of the home-page work section,
   promoted to sit directly under the hero. Composition:
     · lede      — live eyebrow, oversized display title, stat rail
     · brands    — the partner / talent lockup rail (prestige signal)
     · feature   — one cinemascope hero film (index 01)
     · gallery   — an asymmetric 6-card grid (02–07), wides for scale
     · foot      — closing note + All Works CTA

   Everything is namespaced under .rw. Media reuses the site's proven
   systems verbatim (.hover-play-wrapper + .lazy-video for hover video,
   .parallax-img-small for Ukiyo parallax, .reveal-type / .anim-uni-in-up
   for scroll reveals, .tag for chips) so behaviour comes for free and
   this file is pure art direction.
------------------------------------------------------------------ */

.rw {
  --rw-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --rw-ease-spring: cubic-bezier(0.34, 1.4, 0.44, 1);
  --rw-hairline: rgba(255, 255, 255, 0.12);
  --rw-hairline-strong: rgba(255, 255, 255, 0.2);
  --rw-radius: clamp(2rem, 2.4vw, 3.2rem);
  position: relative;
  isolation: isolate;
  /* clip only the horizontal axis (kills hover-halo overflow) — a full
     `overflow: clip` would also slice the ambient bloom on a hard
     horizontal line where it crosses the section's top edge */
  overflow-x: clip;
}

[color-scheme=light] .rw {
  --rw-hairline: rgba(22, 22, 22, 0.12);
  --rw-hairline-strong: rgba(22, 22, 22, 0.22);
}

/* slow-drifting accent bloom behind the whole section — the ambient
   heartbeat that keeps the composition alive without any JS */
.rw__ambient {
  position: absolute;
  z-index: -1;
  top: -6%;
  left: 50%;
  width: min(130rem, 150%);
  height: 78%;
  transform: translateX(-50%);
  /* A rich, defined olive bloom — but every centre sits mid-element and
     the vertical radii stay under 50%, so the eased, many-stop falloff
     reaches full transparency before it meets an element edge. No
     boundary to clip on any side; the blur just polishes the feather. */
  background:
    radial-gradient(46% 38% at 31% 46%,
      rgba(var(--accent-rgb), 0.26) 0%,
      rgba(var(--accent-rgb), 0.2) 16%,
      rgba(var(--accent-rgb), 0.12) 34%,
      rgba(var(--accent-rgb), 0.055) 54%,
      rgba(var(--accent-rgb), 0.016) 74%,
      transparent 92%),
    radial-gradient(48% 42% at 78% 52%,
      rgba(var(--accent-rgb), 0.14) 0%,
      rgba(var(--accent-rgb), 0.08) 26%,
      rgba(var(--accent-rgb), 0.03) 50%,
      rgba(var(--accent-rgb), 0.008) 72%,
      transparent 90%);
  filter: blur(48px);
  opacity: 0.95;
  pointer-events: none;
  animation: rw-ambient 16s ease-in-out infinite;
}

@keyframes rw-ambient {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.7; }
  50%      { transform: translateX(-51%) scale(1.08); opacity: 0.95; }
}

/* ==================================================================
   Lede
================================================================== */

.rw__head {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "eyebrow"
    "title"
    "side";
  gap: 2.4rem;
}

/* let the eyebrow + title land directly on the header grid so the
   eyebrow can span the top row while title and side share a
   baseline-aligned row below */
.rw__head-main { display: contents; }

.rw__eyebrow { grid-area: eyebrow; justify-self: start; }
.rw__title { grid-area: title; }
.rw__head-side { grid-area: side; }

@media only screen and (min-width: 992px) {
  .rw__head {
    grid-template-columns: 1.35fr 1fr;
    grid-template-areas:
      "eyebrow eyebrow"
      "title   side";
    align-items: start;
    column-gap: 5rem;
    row-gap: 2.8rem;
  }
}

.rw__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.5rem 0.7rem 1.2rem;
  border: 1px solid var(--rw-hairline);
  border-radius: 999px;
  background: rgba(var(--base-rgb), 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font: var(--fw-medium) 1.2rem/1 var(--_font-accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--t-medium);
}

.rw__eyebrow-label { color: var(--t-bright); }
.rw__eyebrow-years { color: var(--t-muted); font-variant-numeric: tabular-nums; }

.rw__eyebrow-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--rw-hairline-strong);
}

/* live pulse — the section's heartbeat */
.rw__live {
  position: relative;
  width: 0.7rem;
  height: 0.7rem;
  flex: none;
}

.rw__live::before,
.rw__live::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
}

.rw__live::before { animation: rw-ping 2.6s cubic-bezier(0, 0, 0.2, 1) infinite; }
.rw__live::after {
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.85);
  animation: rw-breathe 2.6s ease-in-out infinite;
}

@keyframes rw-ping {
  0%        { transform: scale(1); opacity: 0.85; }
  75%, 100% { transform: scale(3); opacity: 0; }
}
@keyframes rw-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(0.72); }
}

.rw__title {
  margin: 0;
  font: var(--fw-bold) clamp(4.2rem, 7.2vw, 8.6rem)/0.95 var(--_font-default);
  letter-spacing: -0.03em;
  color: var(--t-bright);
}

.rw__head-side {
  display: flex;
  flex-direction: column;
  gap: 2.8rem;
}

.rw__lede {
  margin: 0;
  max-width: 42rem;
  font: var(--fw-regular) clamp(1.6rem, 1.6vw, 1.9rem)/1.5 var(--_font-default);
  color: var(--t-medium);
}

/* stat rail --------------------------------------------------------- */

.rw__stats {
  display: flex;
  align-items: flex-start;
  gap: clamp(1.4rem, 2vw, 2.4rem);
}

.rw__stat {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rw__stat-num {
  font: var(--fw-bold) clamp(2.8rem, 3.4vw, 3.8rem)/1 var(--_font-accent);
  letter-spacing: -0.02em;
  color: var(--t-bright);
  font-variant-numeric: tabular-nums;
  /* slow highlight sweep keeps the figures feeling live */
  background: linear-gradient(100deg, currentColor 0 40%, rgba(var(--accent-rgb), 0.95) 50%, currentColor 60% 100%);
  background-size: 240% 100%;
  background-position: 120% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rw-stat-sheen 6.5s ease-in-out infinite;
}

.rw__stat:nth-of-type(2) .rw__stat-num { animation-delay: 0.6s; }
.rw__stat:nth-of-type(3) .rw__stat-num { animation-delay: 1.2s; }

.rw__stat-num i {
  font-style: normal;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

@keyframes rw-stat-sheen {
  0%, 70%, 100% { background-position: 120% 0; }
  85%           { background-position: -20% 0; }
}

.rw__stat-label {
  font: var(--fw-regular) 1.2rem/1.3 var(--_font-accent);
  letter-spacing: 0.05em;
  color: var(--t-muted);
}

.rw__stat-rule {
  align-self: stretch;
  width: 1px;
  margin-top: 0.4rem;
  background: linear-gradient(to bottom, var(--rw-hairline-strong), transparent);
}

/* ==================================================================
   Brand partnership rail
================================================================== */

.rw__brands {
  display: flex;
  align-items: center;
  gap: clamp(1.6rem, 3vw, 3.6rem);
  margin-top: clamp(3.6rem, 5vw, 5.6rem);
  padding: 2rem 0;
  border-top: 1px solid var(--rw-hairline);
  border-bottom: 1px solid var(--rw-hairline);
}

.rw__brands-label {
  flex: none;
  font: var(--fw-regular) 1.15rem/1 var(--_font-accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t-muted);
}

.rw__brands-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(1.6rem, 3vw, 3.4rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rw__brand {
  position: relative;
  font: var(--fw-medium) clamp(1.6rem, 2vw, 2.2rem)/1 var(--_font-default);
  letter-spacing: 0.01em;
  color: var(--t-medium);
  white-space: nowrap;
  opacity: 0.72;
  transition: opacity 0.4s var(--rw-ease-out), color 0.4s var(--rw-ease-out);
}

.no-touch .rw__brands:hover .rw__brand { opacity: 0.42; }
.no-touch .rw__brands:hover .rw__brand:hover,
.rw__brand:hover {
  opacity: 1;
  color: var(--t-bright);
}

/* ==================================================================
   Shared media shell
================================================================== */

.rw__media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--rw-radius);
  background: rgba(var(--base-rgb), 0.6);
}

.rw__media > img,
.rw__media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rw__media > video { z-index: 1; }

/* legibility scrim under overlaid content */
.rw__media-scrim,
.rw__card .rw__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
}

.rw__media-scrim {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.12) 42%, transparent 66%);
}

.rw__card .rw__media::after {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 40%);
  opacity: 0.9;
}

/* diagonal gloss sweep on hover */
.rw__gloss {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.16) 46%, rgba(255, 255, 255, 0.04) 54%, transparent 70%);
  background-size: 240% 100%;
  background-position: 130% 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.no-touch .rw__feature:hover .rw__gloss,
.no-touch .rw__card:hover .rw__gloss {
  opacity: 1;
  animation: rw-gloss 1.15s var(--rw-ease-out);
}

@keyframes rw-gloss {
  from { background-position: 130% 0; }
  to   { background-position: -30% 0; }
}

/* ghost index numeral */
.rw__index {
  position: absolute;
  z-index: 4;
  top: clamp(1.2rem, 2vw, 2.2rem);
  left: clamp(1.4rem, 2.2vw, 2.6rem);
  font: var(--fw-bold) clamp(3.2rem, 4vw, 4.6rem)/0.8 var(--_font-accent);
  letter-spacing: -0.03em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.62);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  animation: rw-float 7s ease-in-out infinite;
}

@keyframes rw-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-0.5rem); }
}

.rw__index--feature { font-size: clamp(4.4rem, 6vw, 7rem); }

.no-touch .rw__feature:hover .rw__index,
.no-touch .rw__card:hover .rw__index {
  -webkit-text-stroke-color: rgba(var(--accent-rgb), 0.9);
}

/* view cue */
.rw__cue {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font: var(--fw-medium) 1.3rem/1 var(--_font-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.rw__cue i {
  font-size: 1.4rem;
  transition: transform 0.45s var(--rw-ease-spring);
}

.no-touch .rw__feature:hover .rw__cue i,
.no-touch .rw__card:hover .rw__cue i {
  transform: translate(0.35rem, -0.35rem);
}

/* brand eyebrow + tags */
.rw__brandtag {
  display: inline-block;
  font: var(--fw-medium) 1.25rem/1 var(--_font-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.rw__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ==================================================================
   Featured film
================================================================== */

.rw__feature {
  position: relative;
  display: block;
  margin-top: clamp(3.6rem, 5vw, 5.6rem);
  text-decoration: none;
  border-radius: var(--rw-radius);
  transition: transform 0.6s var(--rw-ease-out);
}

.rw__feature .rw__media {
  aspect-ratio: 16 / 10;
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.28),
    0 40px 90px -50px rgba(0, 0, 0, 0.9);
  transition: box-shadow 0.6s var(--rw-ease-out);
}

@media only screen and (min-width: 768px)  { .rw__feature .rw__media { aspect-ratio: 2 / 1; } }
@media only screen and (min-width: 1200px) { .rw__feature .rw__media { aspect-ratio: 2.35 / 1; } }

/* accent halo, awake on hover */
.rw__feature::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -2rem;
  border-radius: calc(var(--rw-radius) + 1rem);
  background: radial-gradient(60% 60% at 50% 70%, rgba(var(--accent-rgb), 0.3), transparent 72%);
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.6s var(--rw-ease-out), transform 0.6s var(--rw-ease-out);
  pointer-events: none;
}

.no-touch .rw__feature:hover { transform: translateY(-0.6rem); }
.no-touch .rw__feature:hover::before { opacity: 1; transform: scale(1); }
.no-touch .rw__feature:hover .rw__media {
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.55),
    0 50px 100px -46px rgba(0, 0, 0, 0.95);
}

.rw__flag {
  position: absolute;
  z-index: 4;
  top: clamp(1.4rem, 2vw, 2.4rem);
  right: clamp(1.4rem, 2.2vw, 2.6rem);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 999px;
  background: rgba(var(--base-rgb), 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font: var(--fw-medium) 1.1rem/1 var(--_font-accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  pointer-events: none;
}

.rw__flag-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.9);
  animation: rw-breathe 2.6s ease-in-out infinite;
}

.rw__overlay {
  position: absolute;
  z-index: 4;
  left: 0;
  bottom: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding: clamp(2rem, 4vw, 4.4rem);
  pointer-events: none;
}

.rw__feature-title {
  margin: 0;
  max-width: 24ch;
  font: var(--fw-medium) clamp(2.4rem, 3.6vw, 4.4rem)/1.05 var(--_font-default);
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

.rw__overlay .rw__cue {
  margin-top: 0.4rem;
  color: #fff;
}

.rw__overlay .rw__cue i { color: var(--accent); }

/* ==================================================================
   Gallery grid
================================================================== */

.rw__grid {
  display: grid;
  /* minmax(0, …) so the media's intrinsic size can't blow the tracks out
     past their fair share (plain 1fr uses an auto minimum) */
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 2.6vw, 3rem);
  margin-top: clamp(3rem, 4vw, 5rem);
}

/* Compact, denser gallery so several projects read in a single view.
   Two columns from tablet, three from desktop; the lead (01) and the
   closing wide card span two tracks for an asymmetric-but-tidy fill. */
@media only screen and (min-width: 600px) {
  .rw__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(1.6rem, 2vw, 2.4rem);
  }
  .rw__card--lead { grid-column: 1 / -1; }
}

@media only screen and (min-width: 1100px) {
  .rw__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rw__card--lead,
  .rw__card--wide { grid-column: span 2; }
}

.rw__card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.rw__card .rw__media {
  aspect-ratio: 16 / 10;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.6s var(--rw-ease-out), transform 0.6s var(--rw-ease-out);
}

/* full-width lead on tablet reads as a cinematic banner */
@media only screen and (min-width: 600px) and (max-width: 1099px) {
  .rw__card--lead .rw__media { aspect-ratio: 2.4 / 1; }
}

/* two-track spans on desktop stay short so the grid stays compact */
@media only screen and (min-width: 1100px) {
  .rw__card--lead .rw__media,
  .rw__card--wide .rw__media { aspect-ratio: 2.3 / 1; }
}

/* accent halo behind card media */
.rw__card .rw__media::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1.4rem;
  border-radius: inherit;
  background: radial-gradient(60% 60% at 50% 60%, rgba(var(--accent-rgb), 0.26), transparent 72%);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s var(--rw-ease-out), transform 0.6s var(--rw-ease-out);
  pointer-events: none;
}

.no-touch .rw__card:hover .rw__media {
  transform: translateY(-0.6rem);
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.5),
    0 34px 64px -30px rgba(0, 0, 0, 0.75);
}

.no-touch .rw__card:hover .rw__media::before { opacity: 1; transform: scale(1); }

/* tags overlaid on the card media */
.rw__card .rw__tags {
  position: absolute;
  z-index: 4;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: clamp(1.6rem, 2.2vw, 2.4rem);
  pointer-events: none;
}

.rw__card-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.5rem 0.4rem 0;
}

.rw__card-title {
  margin: 0;
  font: var(--fw-medium) clamp(1.6rem, 1.7vw, 2.1rem)/1.25 var(--_font-default);
  letter-spacing: -0.01em;
  color: var(--t-bright);
  /* animated underline reveal on hover */
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.5s var(--rw-ease-out);
  padding-bottom: 0.2rem;
}

.no-touch .rw__card:hover .rw__card-title { background-size: 100% 1px; }

/* the cue sits under the title; on desktop it fades in on hover, on
   touch it stays visible so the affordance is never lost */
.rw__card-body .rw__cue {
  margin-top: 0.4rem;
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 0.45s var(--rw-ease-out), transform 0.45s var(--rw-ease-out);
}

.no-touch .rw__card:hover .rw__card-body .rw__cue {
  opacity: 1;
  transform: translateY(0);
}

html:not(.no-touch) .rw__card-body .rw__cue,
html:not(.no-touch) .rw__overlay .rw__cue {
  opacity: 1;
  transform: none;
}

/* ==================================================================
   Footer
================================================================== */

.rw__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem 2rem;
  margin-top: clamp(2.4rem, 3vw, 3.4rem);
  padding-top: clamp(1.8rem, 2.2vw, 2.6rem);
  border-top: 1px solid var(--rw-hairline);
}

.rw__foot-note {
  margin: 0;
  max-width: 46rem;
  font: var(--fw-regular) clamp(1.5rem, 1.5vw, 1.8rem)/1.5 var(--_font-default);
  color: var(--t-muted);
}

.rw__foot-cta { flex: none; }

/* The one-line marquee that follows this section only carries a
   `padding-bottom` (its top breathing room used to come from the hero
   that once sat above it). Now that Recent Work butts against it, give
   that specific marquee a matching top pad so it sits equally spaced
   above and below. Scoped with the adjacency selector so the site's
   other marquee instances are untouched. */
.rw + .mxd-section.padding-mtext-pre-grid {
  padding-top: 9.8rem;
}

/* ==================================================================
   Responsive
================================================================== */

@media only screen and (max-width: 991px) {
  .rw__head-side { gap: 2.2rem; }
  .rw__lede { max-width: none; }

  /* Featured film: stack the copy BELOW the poster instead of overlaying
     it. The ad frames carry their own on-image headlines, so overlaid
     text was competing and unreadable. Below 992px the feature now reads
     like a large card — image up top, copy on the clean dark ground. */
  .rw__feature .rw__media-scrim { display: none; }

  .rw__overlay {
    position: static;
    width: 100%;
    padding: 2rem 0.4rem 0;
    gap: 1.2rem;
    pointer-events: auto;
  }

  .rw__feature-title {
    max-width: none;
    color: var(--t-bright);
    text-shadow: none;
  }

  .rw__overlay .rw__cue { color: var(--accent); }
}

@media only screen and (max-width: 767px) {
  .rw__eyebrow { font-size: 1.1rem; letter-spacing: 0.12em; }

  /* brands rail scrolls horizontally rather than wrapping into a tall
     stack — keeps the prestige lockup on one crisp line */
  .rw__brands {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.4rem;
  }
  .rw__brands-list {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .rw__brands-list::-webkit-scrollbar { display: none; }
}

@media only screen and (max-width: 420px) {
  .rw__stats { gap: 1.2rem; }
  .rw__stat-num { font-size: 2.4rem; }
}

/* ==================================================================
   Reduced motion — keep the composition, drop the perpetual motion
================================================================== */

@media (prefers-reduced-motion: reduce) {
  .rw__ambient,
  .rw__live::before,
  .rw__live::after,
  .rw__flag-dot,
  .rw__stat-num,
  .rw__index {
    animation: none !important;
  }

  .rw__live::before { opacity: 0; }

  .rw__stat-num {
    -webkit-text-fill-color: var(--t-bright);
    background: none;
  }
  .rw__stat-num i { -webkit-text-fill-color: var(--accent); }

  .rw__feature,
  .rw__card .rw__media,
  .rw__gloss,
  .rw__cue i,
  .rw__card-title,
  .rw__card-body .rw__cue {
    transition-duration: 0.01s !important;
  }
}
