/* Pointer-led editorial details for desktop; touch layouts stay calm and direct. */
@media (hover:hover) and (pointer:fine) and (min-width:701px) {
  /* The Picks cover art and spotlight are authored in homepage-motion.css.
     Only add a restrained card lift here; leave its ::before/::after art intact. */
  #picks .pick-card {
    transform-style: preserve-3d;
    transition: transform .32s cubic-bezier(.2,.8,.2,1), border-color .28s ease, box-shadow .32s ease;
  }
  #picks .pick-card.pointer-lit {
    z-index: 2;
    transform: perspective(900px) rotateX(var(--tilt-x,0deg)) rotateY(var(--tilt-y,0deg)) translateY(-4px);
    border-color: var(--rhino-rust, #c96d52);
    box-shadow: 0 18px 34px -28px rgba(45,37,30,.5);
  }
  #notes .reading-card,
  #builds .lab-card {
    transform-style: preserve-3d;
    transition: transform .34s cubic-bezier(.2,.8,.2,1), border-color .28s ease, box-shadow .34s ease;
  }
  #notes .reading-card.pointer-lit {
    z-index: 2;
    transform: perspective(1000px) rotateX(var(--tilt-x,0deg)) rotateY(var(--tilt-y,0deg)) translateY(-4px);
    box-shadow: 0 18px 40px -30px rgba(11,25,20,.48);
  }
  #notes .reading-card.pointer-lit::after { opacity: 1; }
  #builds .lab-card.pointer-lit {
    z-index: 2;
    transform: perspective(1100px) rotateX(var(--tilt-x,0deg)) rotateY(var(--tilt-y,0deg)) translateY(-5px);
    border-color: color-mix(in oklab, var(--tint) 52%, var(--line));
    box-shadow: var(--shadow-1), 0 22px 48px -30px color-mix(in oklab, var(--tint) 48%, transparent);
  }
}
@media (prefers-reduced-motion:reduce) {
  #picks .pick-card,
  #notes .reading-card,
  #builds .lab-card { transition: none !important; }
}

/* Final component layer: these rules must follow the editorial and mobile art-direction sheets. */
.rhino-pet { z-index: 120; pointer-events: none; }
.rhino-pet-btn {
  width: 112px !important;
  height: 124px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  animation: none !important;
  transition: transform .22s ease !important;
}
.rhino-pet-btn::before, .rhino-pet-btn::after { content: none !important; display: none !important; }
.rhino-pet-btn:hover { border: 0 !important; background: transparent !important; box-shadow: none !important; transform: translateY(-3px) scale(1.03) !important; }
.rhino-pet-btn:focus-visible { outline: 2px dashed var(--accent); outline-offset: 4px; }
.rhino-pet.dragging .rhino-pet-btn { transform: scale(1.06) rotate(2deg) !important; }
.rhino-sapling {
  display: block;
  width: 108px;
  height: 120px;
  max-width: none;
  overflow: visible;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 7px 9px rgba(18,20,26,.32));
  transform-origin: 50% 88%;
  animation: capyIdle 3.8s ease-in-out infinite;
}
.rhino-pet.excited .rhino-pet-btn { animation: none !important; }
.rhino-pet.excited .rhino-sapling { animation: capyHop .58s cubic-bezier(.2,.8,.25,1.15) !important; }
.rhino-pet.twirl .rhino-sapling { animation: rhinoTwirl .78s cubic-bezier(.2,.9,.25,1.1) !important; }
.rhino-pet.squish .rhino-sapling { animation: capySquish .62s ease !important; }
.rhino-pet-label { display: none !important; }
@keyframes capyIdle { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2px) scale(1.012,.992); } }
@keyframes capyHop { 0%,100% { transform: translateY(0) scale(1); } 36% { transform: translateY(-9px) scale(.98,1.035); } 68% { transform: translateY(1px) scale(1.025,.975); } }
@keyframes capySquish { 0%,100% { transform: scale(1); } 38% { transform: scale(1.08,.9); } 70% { transform: scale(.96,1.035); } }
@media (max-width: 700px) {
  #hero-section.hero {
    height: calc(100svh - 68px) !important;
    min-height: 500px !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  #hero-section .editorial-motion {
    z-index: 1;
    display: block !important;
    object-fit: cover;
    object-position: 50% 24%;
    -webkit-transform: translateZ(0);
  }
  #hero-section .editorial-portrait img { z-index: 0; }
  #hero-section .editorial-portrait::after { z-index: 2; }
  #hero-section .editorial-portrait figcaption { z-index: 3; }
  #hero-section .editorial-intro { z-index: 4; }
  .rhino-pet-btn { width: 84px !important; height: 96px !important; }
  .rhino-sapling { width: 82px; height: 92px; }
}
@media (max-width: 380px) {
  .rhino-pet-btn { width: 72px !important; height: 84px !important; }
  .rhino-sapling { width: 70px; height: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .rhino-sapling, .rhino-pet-btn { animation: none !important; transition: none !important; }
}

/* Archive cover balance: lower and slightly scale back the active disk against the computer. */
@media (min-width: 701px) {
  #notes .floppy-disk { top: 52%; left: 50%; width: min(64%, 550px); }
}

/* Capy poses are real character variants; the outer button remains invisible. */
.rhino-pet-btn {
  width: 112px !important;
  height: 124px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.rhino-pet-btn::before, .rhino-pet-btn::after { content: none !important; display: none !important; }
.rhino-pet-btn:hover { border: 0 !important; background: transparent !important; box-shadow: none !important; }
.rhino-sapling {
  width: 108px;
  height: 120px;
  max-width: none;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 7px 9px rgba(18,20,26,.32));
  transform-origin: 50% 88%;
}
.rhino-pet-label { display: none !important; }
.rhino-pet[data-pose="work"] .rhino-sapling { animation: capyWork 1.8s ease-in-out infinite; }
.rhino-pet[data-pose="sleep"] .rhino-sapling { animation: capySleep 3.4s ease-in-out infinite; }
.rhino-pet[data-pose="celebrate"] .rhino-sapling { animation: capyHop .58s cubic-bezier(.2,.8,.25,1.15) 2; }
.rhino-pet[data-pose="celebrate"]::before {
  content: "✦  ·  ✧";
  position: absolute;
  top: -3px;
  left: 50%;
  color: #e9c46a;
  font-size: 17px;
  letter-spacing: 8px;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: capySpark 1s ease-out both;
}
@keyframes capyWork { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(1px) rotate(-2deg); } }
@keyframes capySleep { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(2px) rotate(2deg); } }
@keyframes capyHop { 0%,100% { transform: translateY(0) scale(1); } 36% { transform: translateY(-9px) scale(.98,1.035); } 68% { transform: translateY(1px) scale(1.025,.975); } }
@keyframes capySpark { from { opacity: 0; transform: translate(-50%,8px) scale(.7); } 35% { opacity: 1; } to { opacity: 0; transform: translate(-50%,-10px) scale(1.1); } }
@media (max-width: 700px) {
  .rhino-pet-btn { width: 84px !important; height: 96px !important; }
  .rhino-sapling { width: 82px; height: 92px; }
}
@media (max-width: 380px) {
  .rhino-pet-btn { width: 72px !important; height: 84px !important; }
  .rhino-sapling { width: 70px; height: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .rhino-sapling, .rhino-pet-btn, .rhino-pet[data-pose]::before { animation: none !important; transition: none !important; }
}

/* iPhone Safari fix: homepage-motion.css centers this nested figure with a translate.
   In the full-bleed mobile hero, reset that transform or half the video sits off-canvas. */
@media (max-width: 700px) {
  #hero-section .editorial-portrait {
    position: absolute !important;
    inset: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    translate: none !important;
    margin: 0 !important;
  }
  #hero-section .editorial-motion {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    object-position: 58% 35%;
  }
}

/* More expressive Capy loops and gesture reactions. */
.rhino-pet[data-pose="work"] .rhino-sapling { animation: capyWork 1.8s ease-in-out infinite; }
.rhino-pet[data-pose="sleep"] .rhino-sapling { animation: capySleep 3.4s ease-in-out infinite; }
.rhino-pet[data-pose="celebrate"] .rhino-sapling { animation: capyHop .58s cubic-bezier(.2,.8,.25,1.15) 2; }
.rhino-pet[data-pose="walk"] .rhino-sapling { animation: capyWalk .72s steps(2,end) infinite; }
.rhino-pet[data-pose="think"] .rhino-sapling { animation: capyThink 1.5s ease-in-out infinite; }
.rhino-pet[data-pose="heart"] .rhino-sapling { animation: capyHeart 1.1s ease-in-out infinite; }
.rhino-pet[data-pose="coffee"] .rhino-sapling { animation: capyCoffee 1.9s ease-in-out infinite; }
.rhino-pet.fidget .rhino-sapling { animation: capyFidget .72s cubic-bezier(.2,.8,.2,1); }
.rhino-pet.dragging .rhino-sapling { animation: none !important; }
@keyframes capyWalk { 0%,100% { transform: translateX(-3px) translateY(0); } 50% { transform: translateX(3px) translateY(-2px); } }
@keyframes capyThink { 0%,100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-2px); } }
@keyframes capyHeart { 0%,100% { transform: scale(1); } 38% { transform: scale(1.04); } 68% { transform: scale(.99); } }
@keyframes capyCoffee { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-1.5deg); } }
@keyframes capyFidget { 0%,100% { transform: translateY(0) rotate(0); } 28% { transform: translateY(-4px) rotate(-4deg); } 58% { transform: translateY(1px) rotate(3deg); } 78% { transform: rotate(-1deg); } }

@media (prefers-reduced-motion: reduce) {
  .rhino-pet[data-pose] .rhino-sapling,
  .rhino-pet.fidget .rhino-sapling { animation: none !important; }
}
