/* Shared motion for The Rishika Show. Durations match the existing --ease curve. */
:root {
  --motion-ease: cubic-bezier(.2, .75, .25, 1);
  --motion-rise: .85s;
  --motion-image: .45s;
  --motion-cross: 1.1s;
  --motion-ken: 11s;
}

@keyframes trs-fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

@keyframes trs-rise {
  from { transform: translateY(108%); }
  to { transform: none; }
}

@keyframes trs-blur-clear {
  from { filter: blur(8px); }
  to { filter: blur(0); }
}

@keyframes trs-kenburns {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.06) translate3d(-1.15%, -0.7%, 0); }
}

@keyframes trs-kenburns-alt {
  from { transform: scale(1.03) translate3d(1%, 0, 0); }
  to { transform: scale(1.06) translate3d(-1%, -0.8%, 0); }
}

@keyframes trs-filter-slide {
  from { opacity: .4; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

[data-enter] {
  animation: trs-fade-up .9s var(--motion-ease) both;
}
[data-enter="1"] { animation-delay: .04s; }
[data-enter="2"] { animation-delay: .16s; }
[data-enter="3"] { animation-delay: .28s; }
[data-enter="4"] { animation-delay: .4s; }

.line-reveal .line {
  display: block;
  overflow: hidden;
  padding-bottom: .14em;
  margin-bottom: -.14em;
}
.line-reveal .line > span {
  display: block;
  animation: trs-rise 1s var(--motion-ease) both;
}
.line-reveal .line:nth-child(1) > span { animation-delay: .08s; }
.line-reveal .line:nth-child(2) > span { animation-delay: .22s; }

/* Ken Burns — banners, host portraits, storytelling stills */
[data-kenburns] {
  animation: trs-kenburns var(--motion-ken) ease-in-out infinite alternate;
  transform-origin: center center;
}
[data-kenburns="alt"] { animation-name: trs-kenburns-alt; }
[data-kenburns="intro"] {
  animation:
    trs-blur-clear 1.1s var(--motion-ease) both,
    trs-kenburns 12s ease-in-out 1.1s infinite alternate;
}

.page-hero .page-hero-photo {
  top: -8%;
  right: 0;
  bottom: auto;
  left: 0;
  width: 100%;
  height: 118%;
}

.hero-layer--current > .hero-photo { transform-origin: 50% 45%; }

/* Crossfade strips sharpen as each frame becomes active */
.visual-strip--fade .visual-frame img {
  filter: blur(8px);
  transition: opacity var(--motion-cross) ease-in-out, filter 1s ease-in-out;
}
.visual-strip--fade .visual-frame img.is-active { filter: blur(0); }

/* Host and featured stills sharpen when they enter */
.host-art[data-reveal] > img,
.host-portrait[data-reveal] > img,
.latest-visual[data-reveal] img {
  filter: blur(8px);
  transition: filter 1.05s var(--motion-ease), transform var(--motion-image) var(--motion-ease);
}
.host-art.is-visible > img,
.host-portrait.is-visible > img,
.latest-visual.is-visible img { filter: blur(0); }

.latest-visual img { transform: scale(1.03); }
.latest-visual.is-visible:hover img,
.latest-visual.is-visible:focus-visible img { transform: scale(1.06); }

/* Episode category change — short horizontal settle, not a carousel */
#episode-catalogue.is-sliding { animation: trs-filter-slide .6s var(--motion-ease); }

.visual-strip .ken-frame {
  overflow: hidden;
  height: 150px;
}
.visual-strip .ken-frame img {
  width: 100%;
  height: 115%;
  object-fit: cover;
}
.ken-frame:nth-child(2) [data-kenburns] { animation-delay: -3.6s; }
.ken-frame:nth-child(3) [data-kenburns] { animation-delay: -7s; }
.ken-frame:hover [data-kenburns] { animation-play-state: paused; }

/* Studio layout/colours live in page CSS; keep content above section overlays */
.studio .shell {
  position: relative;
  z-index: 2;
}

/* Scroll reveals keep each component's own hover transition */
.guest-card[data-reveal],
.short-tile[data-reveal],
.short-card[data-reveal],
.watched-row[data-reveal],
.topic[data-reveal],
.social-link[data-reveal],
.episode[data-reveal],
.bento-card[data-reveal],
.work-card[data-reveal],
.chair-card[data-reveal] {
  transition:
    opacity var(--motion-rise) var(--motion-ease),
    transform var(--motion-rise) var(--motion-ease),
    color .35s,
    background .35s,
    padding .3s var(--motion-ease),
    border-color .35s;
}

.guest-card.is-visible:hover,
.guest-card.is-visible:focus-visible { transform: translateY(-4px); }
.short-tile.is-visible:hover,
.short-tile.is-visible:focus-visible,
.short-card.is-visible:hover,
.short-card.is-visible:focus-visible { transform: translateY(-6px); }
.bento-card.is-visible:hover,
.bento-card.is-visible:focus-visible { transform: translateY(-6px); }

.guest-avatar img,
.short-tile img,
.short-card img,
.episode-media img {
  transition: transform var(--motion-image) var(--motion-ease), opacity .45s;
}
.guest-card:hover .guest-avatar img,
.guest-card:focus-visible .guest-avatar img,
.short-tile:hover img,
.short-tile:focus-visible img,
.short-card:hover img,
.short-card:focus-visible img,
.episode:hover .episode-media img,
.episode:focus-visible .episode-media img { transform: scale(1.06); }

.topic::before,
.work-card::before {
  transform: scale(1.03);
  transition: transform .5s var(--motion-ease), opacity .35s;
}
.topic:hover::before,
.topic:focus-visible::before,
.work-card:hover::before { transform: scale(1.08); }

.chair-avatar { transition: transform .4s var(--motion-ease), background .28s, color .28s; }
.chair-card:hover .chair-avatar,
.chair-card:focus-visible .chair-avatar { transform: scale(1.06); }

.feature-wave i { animation-play-state: paused; }
.feature-card:hover .feature-wave i,
.feature-card.is-playing .feature-wave i { animation-play-state: running; }

.episode-media {
  position: relative;
  width: 72px;
  height: 48px;
  overflow: hidden;
  border-radius: 4px;
}
.episode-media .episode-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 0;
}
.guest-duration { position: relative; z-index: 1; }

.play-pip {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 250, 242, .94);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.86);
  transition: opacity .35s var(--motion-ease), transform .4s var(--motion-ease);
  pointer-events: none;
}
.play-pip::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #11100f;
}
.latest-visual .play-pip { width: 54px; height: 54px; }
.latest-visual .play-pip::before { border-width: 8px 0 8px 13px; }
.guest-card:hover .play-pip,
.guest-card:focus-visible .play-pip,
.episode:hover .play-pip,
.episode:focus-visible .play-pip,
.short-card:hover .play-pip,
.short-card:focus-visible .play-pip,
.short-tile:hover .play-pip,
.short-tile:focus-visible .play-pip,
.latest-visual:hover .play-pip,
.latest-visual:focus-visible .play-pip {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (hover: none) {
  .play-pip {
    opacity: .94;
    transform: translate(-50%, -50%) scale(1);
  }
  .guest-avatar .play-pip,
  .episode-media .play-pip {
    top: auto;
    left: 4px;
    bottom: 4px;
    width: 18px;
    height: 18px;
    transform: none;
  }
  .guest-avatar .play-pip::before,
  .episode-media .play-pip::before {
    border-width: 3px 0 3px 5px;
    margin-left: 1px;
  }
}

/* Ambient loops rest when their section is off-screen or the tab is hidden */
[data-waveform="live"] i { animation-play-state: paused; }
[data-waveform="live"].is-live i { animation-play-state: running; }

.motion-paused [data-kenburns],
.motion-paused .hero-orbit,
.motion-paused .sound-disc,
.motion-paused .signal-track,
.motion-paused .hero-frequency i,
.motion-paused .hero-bars i,
.motion-paused .hero-rings,
.motion-paused .wave i,
body.is-doc-hidden .hero-orbit,
body.is-doc-hidden .sound-disc,
body.is-doc-hidden .signal-track,
body.is-doc-hidden .hero-frequency i,
body.is-doc-hidden .hero-bars i,
body.is-doc-hidden .hero-rings,
body.is-doc-hidden .wave i,
body.is-doc-hidden .feature-track,
body.is-doc-hidden [data-kenburns] {
  animation-play-state: paused;
}

@media (max-width: 1050px) {
  .visual-strip .ken-frame { height: 120px; }
}

@media (max-width: 700px) {
  .visual-strip .ken-frame,
  .visual-strip .ken-frame:last-child { height: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-enter],
  .line-reveal .line > span,
  [data-kenburns],
  .page-hero .page-hero-photo,
  #episode-catalogue.is-sliding {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    translate: none !important;
  }
  .visual-strip--fade .visual-frame img,
  .host-art img,
  .host-portrait img,
  .latest-visual img,
  .studio-media img,
  .feature-track,
  .signal-track {
    filter: none !important;
    transform: none !important;
    animation: none !important;
  }
  .play-pip {
    opacity: .94;
    transform: translate(-50%, -50%);
  }
}
