/* Shared Featured and Video carousel presentation. */
@property --carousel-page-width {
  syntax:"<length>";
  inherits:true;
  initial-value:0px;
}
.portfolio-page-content:has(.ds-carousel-section) {
  container-type:inline-size;
  /* Project shadows may cross bands without widening the mobile viewport. */
  overflow-x:clip;
}
.site-main:has(.ds-carousel-section) {
  --carousel-page-width:100cqw;
  --carousel-band-padding:clamp(24px,4vw,52px);
}
.ds-carousel-section {
  --carousel-bleed:calc((100% - var(--carousel-page-width)) / 2);
  --carousel-edge-padding:calc(var(--carousel-band-padding) + var(--surface-wave-height,0px));
  position:relative;
  isolation:isolate;
  padding-block:calc(var(--carousel-leading-gap,0px) + var(--carousel-edge-padding)) var(--carousel-edge-padding);
}
.ds-carousel-section::before,
.rv-carousels > .ds-carousel-section + .ds-carousel-section::after {
  content:"";
  position:absolute;
  inset-inline:var(--carousel-bleed) calc(var(--carousel-bleed) - var(--page-content-gutter,0px));
  pointer-events:none;
}
.ds-carousel-section::before {
  inset-block:var(--carousel-leading-gap,0px) calc(-1 * var(--surface-seam-overlap));
  z-index:-1;
  background:var(--carousel-background,#f5f5f2);
}
.rv-carousels > .ds-carousel-section + .ds-carousel-section::after {
  /* Keep the preceding color under the whole band. Its opaque surface
     takes over past the wave, without a backing edge at the trough. */
  inset-block:calc(-1 * var(--surface-seam-overlap)) 0;
  z-index:-2;
  background:var(--carousel-prev-background);
}
.ds-carousel-section > :is(.ds-section-head,.rv-carousel-flavor) {color:var(--carousel-ink,#111)}
[data-carousel-scope=featured] {
  --carousel-background:var(--featured-carousel-bg);
  --carousel-ink:var(--featured-carousel-ink);
  --surface-wave-length:var(--featured-carousel-wave-length);
  --surface-wave-height:var(--featured-carousel-wave-height);
}
[data-carousel-scope=videoClient] {
  --carousel-background:var(--video-client-carousel-bg);
  --carousel-ink:var(--video-client-carousel-ink);
  --surface-wave-length:var(--video-client-carousel-wave-length);
  --surface-wave-height:var(--video-client-carousel-wave-height);
}
[data-carousel-scope=videoEssays] {
  --carousel-background:var(--video-essays-carousel-bg);
  --carousel-ink:var(--video-essays-carousel-ink);
  --surface-wave-length:var(--video-essays-carousel-wave-length);
  --surface-wave-height:var(--video-essays-carousel-wave-height);
}
[data-carousel-scope=videoShort] {
  --carousel-background:var(--video-short-carousel-bg);
  --carousel-ink:var(--video-short-carousel-ink);
  --surface-wave-length:var(--video-short-carousel-wave-length);
  --surface-wave-height:var(--video-short-carousel-wave-height);
}
[data-carousel-scope=videoPromos] {
  --carousel-background:var(--video-promos-carousel-bg);
  --carousel-ink:var(--video-promos-carousel-ink);
  --surface-wave-length:var(--video-promos-carousel-wave-length);
  --surface-wave-height:var(--video-promos-carousel-wave-height);
}
[data-carousel-scope=videoGaming] {
  --carousel-background:var(--video-gaming-carousel-bg);
  --carousel-ink:var(--video-gaming-carousel-ink);
  --surface-wave-length:var(--video-gaming-carousel-wave-length);
  --surface-wave-height:var(--video-gaming-carousel-wave-height);
}

:is(#dan-landing-home,.ds-carousel-section) .ds-gallery{display:flex;gap:10px;width:100%;height:320px}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery > .ds-panel{position:relative;display:block;min-width:0;flex:1 1 0;overflow:hidden;border-radius:var(--gallery-radius,16px);isolation:isolate;background:transparent;transition:flex-grow .6s linear(0,.292893 5%,.5 10%,.646447 15%,.75 20%,.823223 25%,.875 30%,.911612 35%,.9375 40%,.955806 45%,.96875 50%,.977903 55%,.984375 60%,.988951 65%,.992188 70%,.994476 75%,.996094 80%,.997238 85%,.998047 90%,.998619 95%,1);color:var(--dan-paper,#f5f5f2)}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery > .ds-panel[data-focused=true]{flex-grow:4.333333}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery-image {
  position:absolute;
  left:min(0px,calc((100% - var(--media-width,0px)) / 2));
  top:0;
  width:max(100%,var(--media-width,0px));
  max-width:none;
  height:var(--gallery-media-height,100%);
  object-fit:cover;
  filter:none;
}
:is(#dan-landing-home,.ds-carousel-section) .ds-caption{position:absolute;left:20px;right:16px;bottom:20px;display:flex;align-items:center;gap:12px;opacity:0;transform:translateY(8px);transition:opacity .3s,transform .6s cubic-bezier(.16,1,.3,1);z-index:3;pointer-events:none}
:is(#dan-landing-home,.ds-carousel-section) .ds-caption > span {
  flex:1;
  min-inline-size:0;
  border-inline-start:3px solid var(--dan-paper,#f5f5f2);
  padding-inline-start:12px;
  overflow-wrap:anywhere;
}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery > .ds-panel[data-caption-visible=true] .ds-caption{opacity:1;transform:translateY(0)}
:is(#dan-landing-home,.ds-carousel-section) .ds-caption small{display:block;text-transform:uppercase;font-size:9px;letter-spacing:.08em;line-height:1.4;margin-bottom:4px;opacity:.8}
:is(#dan-landing-home,.ds-carousel-section) .ds-caption strong{display:block;font-weight:500;font-size:20px;line-height:1.2;letter-spacing:-.02em}
:is(#dan-landing-home,.ds-carousel-section) .ds-caption > i {
  flex:none;
  font-size:22px;
  font-style:normal;
  line-height:1;
}

:is(#dan-landing-home,.ds-carousel-section) .ds-section-head {
  margin:0 0 var(--featured-heading-gap,25px);
  --section-heading-size:calc(var(--featured-heading-size,40) * (0.5px + 0.05cqi));
  --section-compact-heading-size:max(min(var(--section-heading-size),14px),calc(var(--section-heading-size) * var(--site-title-scale,1)));
  font-size:calc(var(--section-compact-heading-size) * var(--featured-scroll-scale,1));
  font-weight:var(--featured-heading-weight,700);
  line-height:1.1;
  letter-spacing:-.04em;
  overflow-wrap:anywhere;
}
:is(#dan-landing-home,.ds-carousel-section) .ds-section-head:has(+ .rv-carousel-flavor:not([hidden])) {margin-block-end:8px}
:is(#dan-landing-home,.ds-carousel-section) .ds-section-head .ds-featured-phrase {
  vertical-align:baseline;
  max-width:100%;
}
:is(#dan-landing-home,.ds-carousel-section) .ds-featured-phrase .ds-rotate-entry {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  max-width:var(--featured-phrase-limit,100%);
}
:is(#dan-landing-home,.ds-carousel-section) .ds-featured-phrase :is(.ds-rotate-word,.ds-rotate-piece) {max-width:100%;white-space:pre-wrap}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery > .ds-panel {grid-column:auto; min-height:0; margin:0; height:100%; aspect-ratio:auto; box-shadow:none; transform:none}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery > .ds-panel .ds-gallery-image {
  border-radius:0;transform:var(--featured-image-transform,none);
  transition:transform var(--portfolio-thumbnail-motion);
}
:is(#dan-landing-home,.ds-carousel-section) .ds-panel:focus-visible {--featured-image-transform:scale(var(--portfolio-thumbnail-zoom))}
@media (hover:hover) and (pointer:fine){
  :is(#dan-landing-home,.ds-carousel-section) .ds-panel:hover {--featured-image-transform:scale(var(--portfolio-thumbnail-zoom))}
}
:is(#dan-landing-home,.ds-carousel-section) .ds-caption .rd-work-title {font-size:20px;line-height:1.2;letter-spacing:-.02em;font-weight:500}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery > .ds-panel .ds-caption {text-shadow:none}

/* Text is laid out at its final expanded width, never the animated card width. */
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery {height:auto;gap:0 var(--gallery-gap,10px);overflow-anchor:none}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery[data-layout=horizontal] {flex-wrap:wrap}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery[data-layout=horizontal] > .ds-panel {height:var(--gallery-height,320px)}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery-controls {order:1;flex:0 0 100%;min-width:0}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery[data-layout=horizontal] > .rdp-project-shelf {order:2;flex:0 0 100%}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery > .ds-panel {transition-duration:var(--gallery-duration,600ms)}
/* The card clips the assembled thumbnail. Filtered copies need no second rounded clip. */
:is(#dan-landing-home,.ds-carousel-section) .ds-panel > .portfolio-blur {border-radius:0}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery > .ds-panel::after {display:none}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery .ds-caption {left:var(--caption-inset,20px);right:auto;width:var(--caption-width,500px);bottom:20px;transition:opacity 180ms ease,transform var(--gallery-duration,600ms) cubic-bezier(.16,1,.3,1)}
:is(#dan-landing-home,.ds-carousel-section) .ds-caption .rd-work-title {font-size:max(min(var(--caption-title-size,20px),13px),calc(var(--caption-title-size,20px) * var(--site-title-scale,1)))}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery .ds-panel-gradient {position:absolute;inset:0;z-index:3;pointer-events:none;opacity:0;background:var(--caption-shade,linear-gradient(to top,rgba(0,0,0,.78),transparent 130px));transition:opacity 180ms ease}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery > .ds-panel[data-caption-visible=true] .ds-panel-gradient {opacity:1}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery .ds-caption {z-index:4}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery.is-switching-layout > .ds-panel {transition:none!important}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery[data-layout=vertical] {flex-direction:column;--gallery-media-height:var(--mobile-expanded,320px)}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery[data-layout=vertical] > .ds-panel {
  flex:none;order:var(--featured-card-order);height:var(--featured-card-extent);min-height:0;
  transition-property:height;transition-timing-function:cubic-bezier(.16,1,.3,1);
}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery[data-layout=vertical] > .ds-panel:not(:first-of-type) {margin-block-start:var(--gallery-gap,10px)}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery[data-layout=vertical] > .rdp-project-shelf {order:var(--featured-shelf-order)}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery[data-layout=vertical] .ds-gallery-controls {display:none}
/* Frame the center 9:16 content just inside YouTube's matte boundary.
   HQ posters put that same 16:9 canvas inside a 4:3 image. */
:is(#dan-landing-home,.ds-carousel-section) .ds-panel[data-video-portrait=true] {
  --portrait-content-coverage:.99;
}
:is(#dan-landing-home,.ds-carousel-section) .ds-panel[data-video-portrait=true]:has(> .ds-gallery-image[src$="/hqdefault.jpg"]) {
  --portrait-content-coverage:calc(.75 * .99);
}
/* Source and filtered copies use the same centered crop. */
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery > .ds-panel[data-video-portrait=true] .ds-gallery-image {
  inset-block:0;
  margin-block:auto;
  height:auto;
  min-height:calc(var(--gallery-media-height,100%) / var(--portrait-content-coverage));
  aspect-ratio:calc(9 * var(--portrait-content-coverage)) / 16;
}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery[data-layout=vertical] .ds-caption {bottom:12px}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery[data-layout=vertical] .ds-panel[data-focused=false] {
  --caption-title-size:var(--compact-title-size,14px);
}

:is(#dan-landing-home,.ds-carousel-section) .ds-gallery-dots {
  --dot-ink:#fff;
  --gallery-dot-gap:12px;
  position:relative;z-index:16;display:flex;width:max-content;max-width:100%;margin:var(--gallery-dot-gap) auto 0;
  align-items:center;justify-content:center;padding:4px;border-radius:99px;background:#111;color:#fff;touch-action:none;
}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery-dots button {display:grid;place-items:center;width:24px;height:24px;margin:0;padding:0;border:0;border-radius:50%;background:transparent;color:inherit}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery-dots button::after {content:'';width:6px;height:6px;border-radius:50%;background:#929292}
:is(#dan-landing-home,.ds-carousel-section) .ds-gallery-dots button:focus-visible {outline:none}
@media(prefers-reduced-motion:reduce){
  :is(#dan-landing-home,.ds-carousel-section) .ds-gallery :is(.ds-panel,.ds-gallery-image,.ds-caption,.ds-panel-gradient) {transition:none}
}

:is(#featured-work,.ds-carousel-section) .ds-panel[data-youtube-id]::before {
  content: '▶';
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(58px, 5vw, 76px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding-left: .15em;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 50%;
  background: rgba(17,17,17,.54);
  color: #fff;
  font-size: clamp(19px, 1.8vw, 26px);
  line-height: 1;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 180ms cubic-bezier(.2,.7,.2,1), background 180ms ease, color 180ms ease;
  pointer-events: none;
}

:is(#featured-work,.ds-carousel-section) .ds-panel[data-youtube-id]:hover::before,
:is(#featured-work,.ds-carousel-section) .ds-panel[data-youtube-id]:focus-visible::before {
  transform: translate(-50%, -50%) scale(1.08);
  background: #fff;
  color: #111;
}


/* Keep the play affordance on a settled thumbnail, never an inactive strip. */
:is(#featured-work,.ds-carousel-section) .ds-panel[data-youtube-id][data-focused=false]::before {display:none}
@media(prefers-reduced-motion:reduce){
  :is(#featured-work,.ds-carousel-section) .ds-panel[data-youtube-id]::before {transition:none}
}

.portfolio-inline-video.is-portrait {
  width:min(100%,420px);
  margin-inline:auto;
  aspect-ratio:9/16;
}
