/* Interaction system — portfolio-interactions skill */

/* ------------------------------ Custom cursor ----------------------------- */

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  aspect-ratio: 1;
  background: var(--bg-cursor);
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-100px, -100px);
  transition: width var(--duration-base) var(--ease-out), height var(--duration-base) var(--ease-out),
    margin var(--duration-base) var(--ease-out), opacity var(--duration-press) linear;
  will-change: transform;
}

.cursor-dot.is-hover {
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
}

/* Drag-hint state: hovering the hero card fan grows the cursor further and
   reveals a left/right arrow pair, signalling the deck can be clicked or
   dragged through. The arrows are solid black on the dot's white circle so
   mix-blend-mode: difference inverts them together and they stay legible
   over any background. */
.cursor-dot.is-drag {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
}

.cursor-arrow {
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  opacity: 0;
  transition: opacity 0.15s ease;
  transform: translateY(-50%);
}

.cursor-arrow--left {
  left: 18%;
  border-right: 7px solid var(--text-primary);
}

.cursor-arrow--right {
  right: 18%;
  border-left: 7px solid var(--text-primary);
}

.cursor-dot.is-drag .cursor-arrow {
  opacity: 1;
}

/* View-hint state: hovering the toolkit gallery buttons grows the cursor
   and shows a small "View" label, making it clear the click has an effect
   (swapping the photo) instead of just an unexplained bigger circle. */
.cursor-dot.is-view {
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
}

.cursor-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.cursor-dot.is-view .cursor-label {
  opacity: 1;
}

body.has-custom-cursor,
body.has-custom-cursor a,
body.has-custom-cursor button {
  cursor: none;
}

/* --------------------------------- Reveal --------------------------------- */

.reveal-mask {
  display: inline-block;
  vertical-align: bottom;
}

.reveal-inner {
  display: inline-block;
  opacity: 0;
  transition: transform var(--duration-reveal-long) var(--ease-out), opacity var(--duration-slow) ease;
}

.reveal.is-visible .reveal-inner {
  transform: translate(0, 0) !important;
  opacity: 1 !important;
}

/* ----------------------------- Nav letter-flip ----------------------------- */

.flip-letter {
  display: inline-block;
  overflow: hidden;
  height: 1em;
  vertical-align: bottom;
}

.flip-letter-inner {
  display: inline-block;
  transition: transform 0.4s var(--ease-out);
}

.flip-letter-inner span {
  display: block;
  height: 1em;
  line-height: 1em;
}

a:hover .flip-letter-inner,
a:focus-visible .flip-letter-inner {
  transform: translateY(-1em);
}

/* ---------------------------------- Ticker --------------------------------- */
/* Shared keyframes for case-study card marquees (homepage ticker removed). */

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* --------------------------------- Motion ---------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .cursor-dot {
    display: none;
  }

  body {
    transition: none;
  }

  .nav {
    transform: none;
    pointer-events: auto;
    transition: none;
  }

  .nav-logo,
  .nav-logo .dot,
  .nav-links a,
  .showcase,
  .showcase-title {
    transition: none;
  }

  .reveal-inner {
    transition: none;
    transform: none !important;
  }

  .card-marquee-track {
    animation: none;
  }

  .flip-letter-inner {
    transition: none;
  }

  .work-stack-item {
    transform: none !important;
  }

  .hero-float {
    opacity: 1 !important;
    transition: none !important;
    transform: none !important;
  }

  .hero-float--top {
    transform: translateX(-50%) translateY(-35%) rotate(8deg) !important;
  }

  .hero-float--right-top {
    transform: translateX(25%) rotate(6.75deg) !important;
  }

  .hero-float--left-top {
    transform: translateX(-15%) rotate(9deg) !important;
  }

  .hero-float--left-bottom {
    transform: rotate(-4deg) !important;
  }

  .hero-float--right-bottom {
    transform: translateX(15%) rotate(-6deg) !important;
  }

  .showcase-frame {
    transform: none !important;
    border-radius: 16px !important;
    width: min(92vw, 1100px) !important;
  }

  .showcase-embed,
  .showcase-poster {
    transition: none;
  }

  .showcase-scrub {
    transition: none;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .work-stack-switch-btn {
    transition: none;
  }

  .media-play {
    transition: none;
  }

  .toolkit-photo-img {
    transition: none;
  }

  .toolkit-desc {
    transition: none;
  }

  .vision-carousel-track {
    transition: none;
  }

  .vision-tile {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }

  .vision-tile-media img,
  .vision-carousel-slide img {
    transition: none !important;
    transform: none !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot {
    display: none;
  }
}

/* ==========================================================================
   Interaction system — motion has a job or it doesn't run
   Rule: nothing moves at rest; motion means "you're pointing at something
   interactive"; entrances play once, in reading order.
   ========================================================================== */

/* --- Card marquees: idle until the card is pointed at ------------------- */
.card-marquee-track {
  animation-play-state: paused;
}

.video-card:hover .card-marquee-track,
.video-card:focus-within .card-marquee-track {
  animation-play-state: running;
}

/* --- Case-study cards: the whole card is a link, the button is a player -- */
.video-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius);
}

.video-meta {
  pointer-events: none; /* clicks fall through to the stretched link */
}

.video-play {
  z-index: 3;
}

.showcase-show-all {
  z-index: 4;
}

.toolkit-item:focus-visible,
.media-play:focus-visible,
.media-mute:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 4px;
  border-radius: var(--radius);
}

/* --- In-place video playback --------------------------------------------- */
.video-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  background: var(--bg-video);
  border-radius: var(--radius);
  pointer-events: none; /* the play/pause button owns control */
}

/* While playing, everything that isn't the video steps aside */
.video-card.is-playing .video-frame::after,
.video-card.is-playing .video-meta,
.video-card.is-playing .card-marquee {
  opacity: 0;
  transition: opacity var(--duration-reveal) ease;
}

.video-frame::after,
.video-meta,
.card-marquee {
  transition: opacity var(--duration-reveal) ease;
}

/* The pause control fades out during playback, returns on intent */
.video-card.is-playing .video-play {
  opacity: 0;
  transition: opacity var(--duration-base) ease;
}

.video-card.is-playing .video-frame:hover .video-play,
.video-card.is-playing .video-play:focus-visible {
  opacity: 1;
}

/* --- Sticky-note testimonials -------------------------------------------- */
.sticky-note {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
  min-height: var(--min-height-sticky);
  padding: var(--pad-sticky);
  background: var(--bg-sticky-note);
  border: 1px solid var(--border-sticky);
  border-radius: var(--radius-sticky-note);
  box-shadow: var(--shadow-sticky-note);
  text-align: left;
  transform: none;
}

.sticky-note-mark {
  position: absolute;
  top: clamp(18px, 3vw, 28px);
  left: clamp(22px, 3vw, 34px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sticky-mark);
  line-height: 1;
  color: var(--text-sticky-mark-color);
  pointer-events: none;
}

.sticky-note-quote {
  position: relative;
  z-index: 1;
  margin: clamp(36px, 5vw, 56px) 0 0;
  flex: 1 1 auto;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: var(--text-sticky-quote);
  line-height: 1.55;
  letter-spacing: var(--tracking-normal);
  color: var(--text-inverse);
}

.sticky-note-quote p {
  margin: 0;
}

.sticky-note-quote p + p {
  margin-top: 1em;
}

.sticky-note-footer {
  display: flex;
  align-items: center;
  gap: var(--gap-sticky-header);
  margin-top: auto;
}

.sticky-note-photo {
  flex-shrink: 0;
  width: var(--size-sticky-photo);
  height: var(--size-sticky-photo);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.16);
}

.sticky-note-attrib {
  margin: 0;
  font-family: var(--font-ui);
  line-height: 1.35;
}

.sticky-note-name {
  font-weight: 700;
  font-size: var(--text-attrib);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-inverse);
}

.sticky-note-role {
  margin-left: 10px;
  font-weight: 400;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

/* --- Nav scroll-spy: orientation without decoration ----------------------- */
.nav-links a.is-current {
  color: var(--text-primary);
  box-shadow: 0 2px 0 0 var(--text-primary);
}

/* --- "Copied" toast on Let's Talk ----------------------------------------- */
.copy-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--bg-toast);
  color: var(--text-inverse);
  font-family: var(--font-ui);
  font-size: var(--text-attrib);
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) ease, transform var(--duration-base) var(--ease-out);
  z-index: var(--z-toast);
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --- Reduced motion for everything added above ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  .card-marquee-track {
    animation: none;
  }

  .copy-toast {
    transition: opacity 0.15s ease;
    transform: translate(-50%, 0);
  }

  .sticky-note {
    transform: none;
  }

  .trust-card-cta {
    transition: none;
  }

  .testimonials-rail.is-dragging {
    cursor: grab;
  }
}
