/* _src/css/extra/rust-book.css */
.rb-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 4rem 2rem;
  background:
    linear-gradient(
      135deg,
      #2b2b2b 0%,
      #151515 100%);
  border-radius: 20px;
  color: #fff;
  margin-top: 2rem;
  margin-bottom: 4rem;
  max-width: 1200px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}
.rb-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      circle,
      rgba(232, 94, 84, 0.15) 0%,
      transparent 60%);
  animation: rotateGlow 25s linear infinite;
  pointer-events: none;
}
@keyframes rotateGlow {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.rb-hero-img {
  max-width: 280px;
  width: 100%;
  margin-bottom: 2rem;
  position: relative;
  z-index: 10;
  animation: floatBook 6s ease-in-out infinite;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.8));
}
@keyframes floatBook {
  0% {
    transform: translateY(0px) rotate(-2deg);
  }
  50% {
    transform: translateY(-20px) rotate(2deg);
  }
  100% {
    transform: translateY(0px) rotate(-2deg);
  }
}
.rb-hero-text {
  position: relative;
  z-index: 10;
  max-width: 650px;
}
.rb-hero-text h1 {
  font-size: 3.5rem;
  color: #ffffff;
  margin-bottom: 1rem;
  border: none;
  font-family: "Fjalla One", sans-serif;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  line-height: 1.1;
}
.rb-hero-text p {
  font-size: 1.3rem;
  color: #cccccc;
  line-height: 1.6;
  font-weight: 300;
}
.walking-crab-container {
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 100%;
  height: 100px;
  pointer-events: none;
  overflow: visible;
  z-index: 15;
}
.crab-wrapper {
  position: absolute;
  bottom: 0px;
  left: 2%;
  width: 100px;
  height: 100px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}
.crab-flipper {
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.walking-crab {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  pointer-events: none;
  transform-origin: center center;
  position: absolute;
  bottom: 0px;
  left: 0px;
}
.crab-img-stand,
.crab-img-walk {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.1s;
  -webkit-user-drag: none;
}
.crab-speech-bubble {
  position: absolute;
  bottom: 115px;
  background: #e85e54;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 30px;
  font-family: "Fjalla One", sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow:
    0 10px 25px rgba(232, 94, 84, 0.4),
    0 5px 10px rgba(0, 0, 0, 0.2),
    inset 0 2px 8px rgba(255, 255, 255, 0.4);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease-out,
    transform 0.3s ease-out,
    visibility 0.3s;
  z-index: 20;
}
.crab-speech-bubble.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.crab-speech-bubble.bubble-extend-left {
  right: -20px;
  left: auto;
}
.crab-speech-bubble.bubble-extend-right {
  left: -20px;
  right: auto;
}
.crab-speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -12px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 14px solid #e85e54;
  filter: drop-shadow(0 4px 4px rgba(232, 94, 84, 0.3));
}
.crab-speech-bubble.bubble-extend-left::after {
  right: 58px;
  left: auto;
}
.crab-speech-bubble.bubble-extend-right::after {
  left: 58px;
  right: auto;
}
.crab-think-bubble {
  position: absolute;
  bottom: 215px;
  background: rgba(255, 255, 255, 0.85);
  color: #555555;
  padding: 12px 22px;
  border-radius: 30px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  font-style: italic;
  white-space: nowrap;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), inset 0 2px 6px rgba(0, 0, 0, 0.05);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.5) rotate(5deg);
  transition:
    opacity 0.35s ease-out,
    transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    visibility 0.45s;
  z-index: 20;
}
.crab-think-bubble.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1) rotate(0deg);
  animation: bubble-wobble-think 3.5s ease-in-out infinite 0.45s;
}
@keyframes bubble-wobble-think {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  50% {
    transform: translateY(-6px) scale(1.01) rotate(1.5deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
}
.crab-think-bubble.bubble-extend-left {
  right: -30px;
  left: auto;
}
.crab-think-bubble.bubble-extend-right {
  left: -30px;
  right: auto;
}
.crab-think-bubble::after,
.crab-think-bubble::before {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.crab-think-bubble::after {
  bottom: -15px;
  width: 14px;
  height: 14px;
}
.crab-think-bubble::before {
  bottom: -35px;
  width: 8px;
  height: 8px;
}
.crab-think-bubble.bubble-extend-left::after {
  right: 55px;
  left: auto;
}
.crab-think-bubble.bubble-extend-left::before {
  right: 62px;
  left: auto;
}
.crab-think-bubble.bubble-extend-right::after {
  left: 55px;
  right: auto;
}
.crab-think-bubble.bubble-extend-right::before {
  left: 62px;
  right: auto;
}
.crab-knocked-over {
  animation: crab-jump-fall 0.6s ease-in-out forwards, crab-rocking-increasing var(--rock-duration, 5s) ease-in-out 0.6s forwards !important;
}
.crab-knocked-over .crab-img-walk,
.crab-recover .crab-img-walk {
  opacity: 1 !important;
}
.crab-recover {
  animation: crab-flip-back 0.4s ease-in forwards !important;
}
@keyframes crab-jump-fall {
  0% {
    bottom: 0px;
    transform: rotate(0deg);
  }
  45% {
    bottom: 50px;
    transform: rotate(90deg);
  }
  100% {
    bottom: 0px;
    transform: rotate(180deg);
  }
}
@keyframes crab-rocking-increasing {
  0% {
    transform: rotate(180deg);
  }
  7% {
    transform: rotate(175deg);
  }
  14% {
    transform: rotate(186deg);
  }
  21% {
    transform: rotate(168deg);
  }
  28% {
    transform: rotate(195deg);
  }
  35% {
    transform: rotate(158deg);
  }
  42% {
    transform: rotate(208deg);
  }
  49% {
    transform: rotate(145deg);
  }
  56% {
    transform: rotate(222deg);
  }
  63% {
    transform: rotate(130deg);
  }
  70% {
    transform: rotate(235deg);
  }
  77% {
    transform: rotate(110deg);
  }
  85% {
    transform: rotate(250deg);
  }
  92% {
    transform: rotate(90deg);
  }
  100% {
    transform: rotate(270deg);
  }
}
@keyframes crab-flip-back {
  0% {
    bottom: 0px;
    transform: rotate(270deg);
  }
  100% {
    bottom: 0px;
    transform: rotate(360deg);
  }
}
.rb-story {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  margin-bottom: 5rem;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}
.rb-step {
  display: flex;
  position: relative;
  padding: 3rem;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  border-left: 8px solid #e85e54;
}
.rb-step:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1);
}
.rb-step.rb-reverse {
  border-left: none;
  border-right: 8px solid #e85e54;
  text-align: right;
  align-items: flex-end;
}
.rb-step.rb-reverse .rb-step-content {
  margin-left: auto;
}
.rb-step-content {
  max-width: 85%;
}
.rb-step-content h2 {
  font-size: 2.2rem;
  color: #2c3e50;
  margin-top: 0;
  border-bottom: none;
  margin-bottom: 1.2rem;
}
.rb-step-content p {
  font-size: 1.15rem;
  color: #555;
  line-height: 1.8;
  margin-bottom: 0;
}
.rb-highlights {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
  text-align: left;
}
.rb-highlights li {
  margin-bottom: 2rem;
  font-size: 1.15rem;
  color: #444;
  position: relative;
  padding-left: 60px;
  line-height: 1.6;
  min-height: 80px;
}
.rb-highlights li strong {
  color: #e85e54;
}
.rb-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 60px;
  height: 50px;
  background-image: url(/public/img/projects/rustacean-orig.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: top center;
}
@media (max-width: 768px) {
  .rb-hero-text h1 {
    font-size: 2.5rem;
  }
  .rb-step,
  .rb-step.rb-reverse {
    padding: 2rem;
    border-left: 6px solid #e85e54;
    border-right: none;
    text-align: left;
    align-items: flex-start;
  }
  .rb-step-content {
    max-width: 100%;
  }
  .rb-highlights li {
    padding-left: 85px;
    min-height: 65px;
  }
  .rb-highlights li::before {
    width: 65px;
    height: 65px;
  }
}
.rb-downloads-wrap {
  display: flex;
  justify-content: center;
  margin: 4rem auto 8rem;
  max-width: 900px;
}
.rb-downloads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
}
.rb-dl-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #e85e54;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  text-decoration: none !important;
  color: #fff;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 10px 25px rgba(232, 94, 84, 0.3);
  position: relative;
  overflow: hidden;
}
a.rb-dl-card {
  border-bottom: none;
}
a.rb-dl-card:hover {
  background: #ef6b62;
  border-bottom: none;
}
.rb-dl-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(232, 94, 84, 0.45);
  color: #fff;
}
.rb-dl-text {
  flex: 1;
  text-align: left;
}
.rb-dl-title {
  font-family: "Fjalla One", sans-serif;
  font-size: 2rem;
  margin-bottom: 0.2rem;
  color: #fff;
  line-height: 1.1;
}
.rb-dl-desc {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
  line-height: 1.3;
}
.rb-dl-action {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1.5rem;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.rb-dl-card:hover .rb-dl-action {
  background: rgba(255, 255, 255, 0.3);
}
.rb-dl-icon-svg {
  width: 34px;
  height: 34px;
  display: block;
  margin: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}
@media (max-width: 768px) {
  .rb-downloads {
    grid-template-columns: 1fr;
    padding: 0 2rem;
  }
}
