/* Award direction pages opened from the golden-ball "Explore more" links.
   Positions follow the 2500×1480 Winner Badges templates.
   The wall is three layers: a still base, a shadow mask, and a small sun.
   One sweep of that light takes 20.4s — five times the 4.07s reference clip.

   AWARD-LIGHT-001 M1: light-rig host.
   - Desktop: the stage is --lu-al-R (0.80) of the old stage, centred. The rest of the overlay is the
     dark surround, which the GPU floor canvas fills with caustics. The surround never closes the overlay.
   - Mounts (created by lu_award_direction.js inside .lu-ad-stage):
       canvas.lu-al-floor  z 0   floor + card surface; also holds the still fallback image
       canvas.lu-al-light  z 1   shafts, motes, light on the frames and trophies (pointer-events: none)
     Stack inside the stage: floor 0 < frames/badges/trophies (auto, tree order) < light 1 < type 2 < close/nav 5.
   - State lives on #lu-award-direction[data-light]: live | still | off (see the JS header).
     off = legacy image wall, still = static image, live = GPU light.
   - Phone: one canvas pair spans the scrolling stage; the rig reads the .lu-ad-panel rects. No surround. */

.lu-award-direction {
  --lu-al-R: 0.80;
  --lu-ad-ink: #ffffff;
  --lu-ad-red: #ed1c24;
  --lu-ad-font: "LU Kozuka Gothic", "Kozuka Gothic Pr6N", "Kozuka Gothic Pro", "Noto Sans JP", "Segoe UI", sans-serif;
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050a08;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.lu-award-direction.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.45s ease, visibility 0s linear 0s;
}

.lu-ad-stage {
  position: relative;
  width: min(100vw, calc(100vh * 2500 / 1480));
  height: min(100vh, calc(100vw * 1480 / 2500));
  container-type: size;
  overflow: hidden;
  background: #1c2818;
  color: var(--lu-ad-ink);
  font-family: var(--lu-ad-font);
}

/* Wide layout: the stage keeps its 2500x1480 shape at R of the old size. */
@media (min-width: 821px) {
  .lu-ad-stage {
    width: calc(var(--lu-al-R) * min(100vw, 100vh * 2500 / 1480));
    height: calc(var(--lu-al-R) * min(100vh, 100vw * 1480 / 2500));
  }
}

/* ---- light mounts. Hidden until a light state turns them on. The rig overrides the
   size and position inline; these defaults centre a viewport-sized layer on the stage. ---- */
.lu-al-floor,
.lu-al-light {
  position: absolute;
  left: calc(50% - 50vw);
  top: calc(50% - 50vh);
  width: 100vw;
  height: 100vh;
  display: none;
  pointer-events: none;
}

.lu-al-floor {
  background-color: #050a08;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* ---- wall: base, then the masked shadow, then the directional sun ---- */
.lu-ad-sky,
.lu-ad-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lu-ad-sky { z-index: 0; }
.lu-ad-light { z-index: 2; }

.lu-ad-base,
.lu-ad-shadow,
.lu-ad-sun {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.lu-ad-shadow {
  mix-blend-mode: multiply;
  animation: lu-ad-drift 20.4s ease-in-out infinite alternate;
}

.lu-ad-sun {
  mix-blend-mode: screen;
  animation: lu-ad-drift 20.4s ease-in-out infinite alternate;
}

@keyframes lu-ad-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(8%, 12%, 0); }
}

/* ---- slides sit on the wall; type sits above the moving light ---- */
.lu-ad-slides {
  position: absolute;
  inset: 0;
  z-index: 3;
}

/* On the wide layout the panels disappear and their children position on the slide. */
.lu-ad-panel { display: contents; }
.lu-ad-panel-bg { display: none; }

.lu-ad-slide,
.lu-ad-copy {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(4%);
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.55s;
}

.lu-ad-slide.is-on,
.lu-ad-copy.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

.lu-ad-copy,
.lu-ad-copy.is-on { pointer-events: none; }

.lu-ad-frame,
.lu-ad-badge,
.lu-ad-trophy,
.lu-ad-medal {
  position: absolute;
}

.lu-ad-frame img,
.lu-ad-badge img,
.lu-ad-trophy img,
.lu-ad-medal {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.lu-ad-frame img {
  position: absolute;
  inset: 0;
  opacity: 0;
  filter: drop-shadow(0 22px 28px rgba(0, 0, 0, 0.42));
  transition: opacity 0.4s ease;
}

.lu-ad-frame img.is-on { opacity: 1; }

/* The gold Photography certificate art (1008x664) carries transparent padding around
   the frame; crop it so the frame fills the same box as the other certificates. */
.lu-ad-vega-frame img[src$="frame-vega-gold-photo.webp"] {
  inset: auto;
  left: -2.15%;
  top: -0.5%;
  width: 120.3%;
  height: 102.6%;
  max-width: none;
  object-fit: fill;
}

.lu-ad-badge img,
.lu-ad-trophy img,
.lu-ad-medal {
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35));
}

.lu-ad-frame[data-lu-ad-cycle],
.lu-award-direction.is-honor .lu-ad-frame {
  cursor: pointer;
}

.lu-ad-cert-dots {
  position: absolute;
  left: calc(100% + 0.6cqw);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.lu-ad-cert-dots button,
.lu-ad-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
}

.lu-ad-cert-dots button.is-on,
.lu-ad-dots button.is-on { background: #fff; }

.lu-award-direction .lu-ad-title,
.lu-award-direction .lu-ad-blurb,
.lu-award-direction .lu-ad-visit {
  position: absolute;
  margin: 0;
  padding: 0;
  color: #fff !important;
  font-family: Jost, "Segoe UI", sans-serif !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.lu-award-direction .lu-ad-title {
  font-size: 5.15cqh !important;
  line-height: 1 !important;
  white-space: nowrap;
}

.lu-award-direction .lu-ad-title .is-red { color: var(--lu-ad-red) !important; }

.lu-award-direction .lu-ad-blurb {
  font-size: 2.45cqh !important;
  line-height: 1.38 !important;
  font-weight: 400 !important;
}

.lu-award-direction a.lu-ad-visit {
  font-size: 3.55cqh !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
  pointer-events: auto;
}

.lu-award-direction a.lu-ad-visit span {
  display: block;
  white-space: nowrap;
}

.lu-award-direction a.lu-ad-visit:hover,
.lu-award-direction a.lu-ad-visit:focus-visible {
  color: #fff !important;
  text-decoration: underline !important;
  text-underline-offset: 0.16em;
}

.lu-ad-visit:focus-visible,
.lu-ad-close:focus-visible,
.lu-ad-nav:focus-visible,
.lu-ad-dots button:focus-visible,
.lu-ad-cert-dots button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Template slots ---------------------------------------------------------- */
.lu-ad-red-frame { left: 14.35%; top: 12.45%; width: 25.5%; height: 57.5%; }
.lu-ad-red-badge { left: 59.15%; top: 22.2%; width: 10.9%; height: 17.15%; }
.lu-ad-red-title { left: 59.4%; top: 46%; font-size: 5.7cqh !important; }
.lu-ad-red-blurb { left: 59.4%; top: 62.4%; width: 35.32%; }
.lu-ad-red-visit { left: 15.2%; top: 73.78%; width: 40%; }

.lu-ad-vega-frame { left: 8.94%; top: 15.8%; width: 38.2%; height: 49.6%; }
.lu-ad-vega-trophy-l { left: 57.6%; top: 12.16%; width: 12.6%; height: 48.65%; }
.lu-ad-vega-trophy-r { left: 76.6%; top: 12.16%; width: 12.6%; height: 48.65%; }
.lu-ad-w3-frame { left: 8.94%; top: 15.8%; width: 38.2%; height: 49.6%; }
.lu-ad-w3-trophy { left: 61.4%; top: 14.9%; width: 11.2%; height: 47.3%; }
.lu-ad-w3-badge { left: 74%; top: 25.1%; width: 14.9%; height: 25.2%; }
.lu-ad-w3-blurb { left: 60.4%; top: 69.3%; width: 36%; }
/* The Vega trophy art holds the statue and a shield badge side by side; show the statue only. */
.lu-ad-vega-trophy-l,
.lu-ad-vega-trophy-r { overflow: hidden; }
.lu-ad-vega-trophy-l img,
.lu-ad-vega-trophy-r img {
  position: absolute;
  width: 234.2%;
  height: 103.1%;
  left: -15.3%;
  top: -2.4%;
  max-width: none;
  object-fit: fill;
  clip-path: polygon(0 0, 47% 0, 47% 78%, 100% 78%, 100% 100%, 0 100%);
}
.lu-ad-vega-blurb { left: 59.4%; top: 68.1%; width: 36%; }
.lu-ad-vega-visit { left: 16.3%; top: 73.51%; width: 36%; }

.lu-ad-bifa-frame { left: 14.35%; top: 12.45%; width: 25.5%; height: 57.5%; }
.lu-ad-w3-visit { left: 15.2%; top: 73.51%; width: 36%; }
.lu-ad-bifa-badge { left: 61.56%; top: 20%; width: 25.08%; height: 41.01%; }
.lu-ad-bifa-blurb { left: 54.6%; top: 68.18%; width: 39.6%; }
.lu-ad-bifa-visit { left: 15.28%; top: 73.11%; width: 34%; }

.lu-ad-ipa-badge { left: 54%; top: 18%; width: 38%; height: 38%; }
.lu-ad-gma-medal { left: 14%; top: 19%; width: 26%; height: 44%; }
.lu-ad-gma-laurel { left: 50%; top: 24%; width: 44%; height: 34%; }
.lu-ad-gma-blurb { left: 52%; top: 64%; width: 40%; }

.lu-ad-close,
.lu-ad-nav {
  position: absolute;
  z-index: 5;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.lu-ad-close {
  top: 1.6%;
  right: 1.4%;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
}

.lu-ad-nav {
  display: none;
  top: 50%;
  width: 44px;
  height: 64px;
  margin-top: -32px;
  font-size: 34px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.lu-ad-nav-prev { left: 0.6%; }
.lu-ad-nav-next { right: 0.6%; }

.lu-ad-dots {
  display: none;
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 2.2%;
  transform: translateX(-50%);
  gap: 10px;
}

.lu-award-direction.is-honor .lu-ad-nav,
.lu-award-direction.is-honor .lu-ad-dots { display: flex; }

/* ---- light states -------------------------------------------------------------
   still: static image on the floor mount. live: GPU canvases. Both retire the image wall. */
.lu-award-direction[data-light="still"] .lu-ad-sky,
.lu-award-direction[data-light="still"] .lu-ad-light,
.lu-award-direction[data-light="still"] .lu-ad-panel-bg,
.lu-award-direction[data-light="live"] .lu-ad-sky,
.lu-award-direction[data-light="live"] .lu-ad-light,
.lu-award-direction[data-light="live"] .lu-ad-panel-bg { display: none !important; }

.lu-award-direction[data-light="still"] .lu-ad-stage,
.lu-award-direction[data-light="live"] .lu-ad-stage { background: transparent; overflow: visible; }

.lu-award-direction[data-light="still"] .lu-al-floor {
  display: block;
  z-index: 0;
  background-image: url("../img/winner_badges/direction/award-light-still-desktop.webp");
}

.lu-award-direction[data-light="live"] .lu-al-floor,
.lu-award-direction[data-light="live"] .lu-al-light { display: block; }
.lu-award-direction[data-light="live"] .lu-al-floor { z-index: 0; }
.lu-award-direction[data-light="live"] .lu-al-light { z-index: 1; }

/* The slide layer must not form its own stacking context, so the type (z 2) and the light (z 1) order against the frames. */
.lu-award-direction[data-light="still"] .lu-ad-slides,
.lu-award-direction[data-light="live"] .lu-ad-slides { z-index: auto; overflow: hidden; }

.lu-award-direction[data-light="still"] .lu-ad-frame,
.lu-award-direction[data-light="still"] .lu-ad-badge,
.lu-award-direction[data-light="still"] .lu-ad-trophy,
.lu-award-direction[data-light="still"] .lu-ad-medal,
.lu-award-direction[data-light="live"] .lu-ad-frame,
.lu-award-direction[data-light="live"] .lu-ad-badge,
.lu-award-direction[data-light="live"] .lu-ad-trophy,
.lu-award-direction[data-light="live"] .lu-ad-medal { z-index: auto !important; }

/* The GPU casts the object shadows from the sun direction; the straight-down CSS drop shadows would contradict it. */
.lu-award-direction[data-light="live"] .lu-ad-frame img,
.lu-award-direction[data-light="live"] .lu-ad-badge img,
.lu-award-direction[data-light="live"] .lu-ad-trophy img,
.lu-award-direction[data-light="live"] .lu-ad-medal { filter: none; }

.lu-award-direction[data-light="still"] .lu-ad-title,
.lu-award-direction[data-light="still"] .lu-ad-blurb,
.lu-award-direction[data-light="still"] a.lu-ad-visit,
.lu-award-direction[data-light="still"] .lu-ad-cert-dots,
.lu-award-direction[data-light="live"] .lu-ad-title,
.lu-award-direction[data-light="live"] .lu-ad-blurb,
.lu-award-direction[data-light="live"] a.lu-ad-visit,
.lu-award-direction[data-light="live"] .lu-ad-cert-dots { z-index: 2 !important; }

/* Phone: two separate panels. Each one carries its own slice of the wall. */
@media (max-width: 820px) {
  .lu-award-direction { align-items: stretch; justify-content: flex-start; }

  .lu-ad-stage {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    display: block;
    background: #141c16;
  }

  .lu-ad-sky,
  .lu-ad-light { display: none; }

  /* No surround on phone: the stage stays the scrolling viewport in every light state. */
  .lu-award-direction[data-light="still"] .lu-ad-stage,
  .lu-award-direction[data-light="live"] .lu-ad-stage { overflow-x: hidden; overflow-y: auto; }

  /* Phone still: one fixed-size image behind the scrolling panels, not a canvas. */
  .lu-award-direction[data-light="still"] .lu-ad-stage {
    background: #050a08 url("../img/winner_badges/direction/award-light-still-phone.webp") center / cover no-repeat;
  }
  .lu-award-direction[data-light="still"] .lu-al-floor { display: none; }

  .lu-ad-slides {
    position: relative;
    inset: auto;
    display: block;
    height: auto;
    min-height: 100%;
  }

  .lu-ad-slide.is-on {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    width: 100%;
    transform: none;
  }

  .lu-ad-slide:not(.is-on) { display: none; }

  .lu-ad-panel {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    position: relative;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .lu-ad-panel-top { min-height: 52vh; padding: 6.5vh 8vw 4vh; }
  .lu-ad-panel-bot { min-height: 48vh; padding: 5vh 8vw 5vh; }

  .lu-ad-panel-bg {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .lu-ad-panel-bg img {
    position: absolute;
    inset: -12%;
    width: 124%;
    height: 124%;
    object-fit: cover;
    max-width: none;
  }

  .lu-ad-frame,
  .lu-ad-badge,
  .lu-ad-trophy,
  .lu-ad-medal,
  .lu-award-direction .lu-ad-title,
  .lu-award-direction .lu-ad-blurb,
  .lu-award-direction a.lu-ad-visit {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    z-index: 1;
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: auto;
  }

  .lu-ad-frame {
    flex: 0 0 min(49vw, 210px);
    width: min(49vw, 210px) !important;
    height: auto !important;
    aspect-ratio: 820 / 1034;
    margin-bottom: 3.2vh;
  }

  .lu-ad-vega-frame {
    flex-basis: min(88vw, 460px);
    width: min(88vw, 460px) !important;
    aspect-ratio: 1008 / 664;
  }

  .lu-award-direction a.lu-ad-visit {
    flex: 0 0 92%;
    width: 92% !important;
    text-align: center !important;
    font-size: clamp(16px, 4.5vw, 22px) !important;
    line-height: 1.35 !important;
  }

  .lu-award-direction a.lu-ad-visit span { white-space: normal; }

  .lu-ad-badge,
  .lu-ad-medal {
    height: auto !important;
    margin-bottom: 2.2vh;
  }

  .lu-ad-badge img,
  .lu-ad-trophy img {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
  }

  .lu-ad-red-badge { flex-basis: min(34vw, 148px); width: min(34vw, 148px) !important; aspect-ratio: 1; }
  .lu-ad-bifa-badge { flex-basis: min(52vw, 230px); width: min(52vw, 230px) !important; aspect-ratio: 1; }
  .lu-ad-ipa-badge { flex-basis: min(78vw, 340px); width: min(78vw, 340px) !important; aspect-ratio: 1300 / 800; }
  .lu-ad-w3-badge { flex-basis: min(38vw, 160px); width: min(38vw, 160px) !important; aspect-ratio: 1; }
  .lu-ad-w3-frame { flex-basis: min(88vw, 460px); width: min(88vw, 460px) !important; aspect-ratio: 1304 / 1007; }
  .lu-ad-gma-medal { flex-basis: min(52vw, 220px); width: min(52vw, 220px) !important; aspect-ratio: 1; }
  .lu-ad-gma-laurel {
    flex-basis: min(84vw, 380px);
    width: min(84vw, 380px) !important;
    aspect-ratio: 1800 / 1012;
    margin-bottom: 2.4vh;
  }

  .lu-ad-trophy {
    flex: 0 0 38%;
    width: 38% !important;
    height: auto !important;
    aspect-ratio: 1;
    margin: 0 1.5vw 1.5vh;
  }

  .lu-award-direction .lu-ad-title {
    flex: 0 0 100%;
    width: 100% !important;
    margin: 0.4vh 0 1.6vh;
    text-align: center !important;
    font-size: clamp(22px, 6.2vw, 32px) !important;
    white-space: nowrap !important;
  }

  .lu-award-direction .lu-ad-blurb {
    flex: 0 0 86%;
    width: 86% !important;
    margin: 0;
    text-align: center !important;
    font-size: 14.5px !important;
    line-height: 1.5 !important;
  }

  .lu-ad-close,
  .lu-ad-nav,
  .lu-ad-dots { position: fixed; }
}

@media (prefers-reduced-motion: reduce) {
  .lu-ad-shadow,
  .lu-ad-sun,
  .lu-ad-slide,
  .lu-ad-copy,
  .lu-ad-frame img,
  .lu-award-direction {
    animation: none !important;
    transition: none !important;
  }
}

/* First frame of the return from the awards page: the sub-page is already
   up, and the homepage loader stays out of that frame. */
html.lu-ad-returning,
html.lu-ad-returning body {
  background: #141c16;
}

html.lu-ad-returning #lu-home-loader {
  display: none !important;
}

html.lu-ad-returning .lu-award-direction {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: none;
}

html.lu-ad-returning .lu-ad-slide {
  transition: none;
}

html.lu-ad-returning[data-lu-ad-return="red"] .lu-ad-slide[data-ad="red"],
html.lu-ad-returning[data-lu-ad-return="gold"] .lu-ad-slide[data-ad="gold"],
html.lu-ad-returning[data-lu-ad-return="silver"] .lu-ad-slide[data-ad="silver"],
html.lu-ad-returning[data-lu-ad-return="w3"] .lu-ad-slide[data-ad="w3"],
html.lu-ad-returning[data-lu-ad-return="bifa"] .lu-ad-slide[data-ad="bifa"],
html.lu-ad-returning[data-lu-ad-return="ipa"] .lu-ad-slide[data-ad="ipa"],
html.lu-ad-returning[data-lu-ad-return="gma"] .lu-ad-slide[data-ad="gma"] {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (max-width: 820px) {
  html.lu-ad-returning[data-lu-ad-return="red"] .lu-ad-slide[data-ad="red"],
  html.lu-ad-returning[data-lu-ad-return="gold"] .lu-ad-slide[data-ad="gold"],
  html.lu-ad-returning[data-lu-ad-return="silver"] .lu-ad-slide[data-ad="silver"],
  html.lu-ad-returning[data-lu-ad-return="w3"] .lu-ad-slide[data-ad="w3"],
  html.lu-ad-returning[data-lu-ad-return="bifa"] .lu-ad-slide[data-ad="bifa"],
  html.lu-ad-returning[data-lu-ad-return="ipa"] .lu-ad-slide[data-ad="ipa"],
  html.lu-ad-returning[data-lu-ad-return="gma"] .lu-ad-slide[data-ad="gma"] {
    display: flex;
    position: relative;
    inset: auto;
    flex-direction: column;
    min-height: 100%;
    width: 100%;
  }
}
