/* === Pynenc Docs — Brand & Visual Polish === */

/* ── Hero logo on landing page ── */
.hero-logo {
  display: block;
  margin: 1.5rem auto 1rem;
  height: 90px;
  width: auto;
  filter: drop-shadow(0 4px 14px rgba(192, 64, 32, 0.25));
  animation: hero-pulse 3s ease-in-out infinite;
}

@keyframes hero-pulse {
  0%,
  100% {
    filter: drop-shadow(0 4px 14px rgba(192, 64, 32, 0.25));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 8px 28px rgba(192, 64, 32, 0.45));
    transform: scale(1.04);
  }
}

/* ── Section-divider mini logos ── */
.pynenc-divider {
  display: block;
  margin: 2rem auto;
  height: 32px;
  width: auto;
  opacity: 0.18;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.pynenc-divider:hover {
  opacity: 0.55;
  transform: rotate(15deg) scale(1.15);
}

/* ── Floating accent logos (scroll-triggered via JS) ── */
.pynenc-float {
  position: fixed;
  pointer-events: none;
  opacity: 0;
  z-index: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.pynenc-float.visible {
  opacity: 0.07;
}

.pynenc-float--top-right {
  top: 100px;
  right: -20px;
  height: 120px;
  transform: rotate(20deg) translateX(30px);
}
.pynenc-float--top-right.visible {
  transform: rotate(20deg) translateX(0);
}

.pynenc-float--bottom-left {
  bottom: 80px;
  left: -15px;
  height: 80px;
  transform: rotate(-15deg) translateX(-30px);
}
.pynenc-float--bottom-left.visible {
  transform: rotate(-15deg) translateX(0);
}

.pynenc-float--mid-right {
  top: 50%;
  right: 10px;
  height: 55px;
  transform: rotate(35deg) translateY(20px);
}
.pynenc-float--mid-right.visible {
  transform: rotate(35deg) translateY(0);
}

/* ── Sidebar peek-a-boo logo ── */
.pynenc-peek {
  position: fixed;
  bottom: 30px;
  left: -50px;
  height: 45px;
  width: auto;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}
.pynenc-peek.peeking {
  left: 12px;
  opacity: 0.6;
}
.pynenc-peek.peeking:hover {
  opacity: 1;
  cursor: pointer;
}

/* ── Spinning logo accent near h2 ── */
.pynenc-spin-accent {
  display: inline-block;
  height: 18px;
  width: 18px;
  vertical-align: middle;
  margin-right: 6px;
  opacity: 0;
  animation: spin-in 0.8s ease forwards;
}
.pynenc-spin-accent.visible {
  opacity: 0.35;
}
@keyframes spin-in {
  0% {
    transform: rotate(-180deg) scale(0);
    opacity: 0;
  }
  100% {
    transform: rotate(0deg) scale(1);
    opacity: 0.35;
  }
}

/* ── Scroll-triggered fade-in for content sections ── */
.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Fun bounce for grid cards on appear ── */
.sd-card {
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sd-card:hover {
  border-color: #c04020 !important;
  box-shadow: 0 4px 20px rgba(192, 64, 32, 0.13) !important;
  transform: translateY(-3px);
}

/* ── H2 terracotta underline ── */
article h2 {
  border-bottom: 2px solid var(--color-brand-primary, #c04020);
  padding-bottom: 0.25rem;
}

/* ── Table header subtle warm tint ── */
table thead th {
  background-color: rgba(192, 64, 32, 0.05) !important;
}

/* ── Code block top border accent ── */
div[class*="highlight"] {
  border-top: 3px solid var(--color-brand-primary, #c04020);
  border-radius: 0 0 4px 4px;
}

/* ── Admonition note warm tint ── */
.admonition.note {
  border-left-color: var(--color-brand-primary, #c04020);
}

/* ── Confetti burst on hero logo click (JS adds class) ── */
@keyframes confetti-pop {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.15) rotate(5deg);
  }
  60% {
    transform: scale(0.95) rotate(-3deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}
.hero-logo.pop {
  animation: confetti-pop 0.5s ease;
}

/* ── Lightbox overlay ── */
.pynenc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: zoom-out;
}
.pynenc-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}
.pynenc-lightbox__img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  cursor: default;
  transform: scale(0.92);
  transition: transform 0.25s ease;
}
.pynenc-lightbox.active .pynenc-lightbox__img {
  transform: scale(1);
}
.pynenc-lightbox__close {
  position: absolute;
  top: 18px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.pynenc-lightbox__close:hover,
.pynenc-lightbox__close:focus {
  opacity: 1;
  transform: scale(1.15);
}

/* ── Reduced motion: respect user preferences ── */
@media (prefers-reduced-motion: reduce) {
  .hero-logo,
  .pynenc-float,
  .pynenc-peek,
  .pynenc-spin-accent,
  .scroll-reveal,
  .sd-card {
    animation: none !important;
    transition: none !important;
  }
  .pynenc-float {
    display: none;
  }
  .pynenc-peek {
    display: none;
  }
  .pynenc-lightbox,
  .pynenc-lightbox__img {
    transition: none !important;
  }
}
