/* Small base styles shared by every page (Tailwind handles the rest). */
html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  overscroll-behavior: none;
}

::-webkit-scrollbar {
  display: none;
}
.animated-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 9px 27px;
  border: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  line-height: 18px;
  background-color: #efefef;
  border-radius: 100px;
  font-weight: 600;
  color: #b60a48;
  box-shadow: 0 0 0 2px #ffffff;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.animated-button svg {
  position: absolute;
  width: 16px;
  fill: #b60a48;
  z-index: 9;
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.animated-button .arr-1 {
  right: 16px;
}

.animated-button .arr-2 {
  left: -25%;
}

.animated-button .circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background-color: #f9dadd;
  border-radius: 50%;
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.animated-button .text {
  position: relative;
  z-index: 1;
  transform: translateX(-12px);
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.animated-button:hover {
  box-shadow: 0 0 0 12px transparent;
  color: #b60a48;
  border-radius: 12px;
}

.animated-button:hover .arr-1 {
  right: -25%;
}

.animated-button:hover .arr-2 {
  left: 12px;
}

.animated-button:hover .text {
  transform: translateX(8px);
}

.animated-button:hover svg {
  fill: #b60a48;
}

.animated-button:active {
  scale: 0.95;
  box-shadow: 0 0 0 4px #a72549;
}

.animated-button:hover .circle {
  width: 220px;
  height: 220px;
  opacity: 1;
}

/* Blob character page (the-blob.html). */

.blob-hero-art {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 55%, rgba(242, 230, 106, 0.45) 0 55%, transparent 56%);
}

.blob-hero-art img {
  width: 62%;
  filter: drop-shadow(0 18px 18px rgba(232, 80, 28, 0.18));
}

.blob-bob {
  animation: blob-bob 3.2s ease-in-out infinite;
}

.blob-mood:hover img {
  animation: blob-wiggle 0.5s ease-in-out;
}

.blob-timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f2e66a;
  border: 2px solid #fbf8ff;
}

@keyframes blob-bob {
  50% {
    transform: translateY(-12px) rotate(-2deg);
  }
}

@keyframes blob-wiggle {
  25% {
    transform: rotate(-4deg);
  }

  75% {
    transform: rotate(4deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .blob-bob,
  .blob-mood:hover img {
    animation: none;
  }
}

/* The Musical Grad Book Box page (book-box.html). */
.photo-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 24px;
  border: 2px dashed #e2bec2;
  border-radius: 0.75rem;
  background: #f5f2fb;
  color: #5a4043;
  font-size: 14px;
  text-align: center;
}

/* Pinout map on book-box.html (wires are drawn by book-box.js). */
.pinout {
  --w-pos: #c81d25;  /* power + : red */
  --w-gnd: #2b2b2f;  /* GND : black */
  --w-3v3: #a6760c;  /* 3V3 -> LV : gold */
  --w-g16: #0061a2;  /* GPIO16 -> DFPlayer TX : blue */
  --w-g17: #1d8a52;  /* GPIO17 -> DFPlayer RX : green */
  --w-g4: #7a3fcf;   /* GPIO4 -> reed : purple */
  --w-spk1: #c2410c; /* speaker + : orange */
  --w-spk2: #0e8a8a; /* speaker - : teal */
}

.pinout .ms {
  font-family: "Material Symbols Outlined";
  font-size: 18px;
  line-height: 1;
}

.pinout-wrap {
  position: relative;
}

.pinout .diagram {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(260px, 340px) minmax(150px, 220px);
  grid-template-areas:
    "batt . ls"
    "reed esp df"
    ". . spk";
  gap: 34px 76px;
  align-items: center;
  justify-content: center;
  padding: 20px 4px 24px;
}

.pinout #card-batt { grid-area: batt; }
.pinout #card-ls { grid-area: ls; }
.pinout #card-reed { grid-area: reed; }
.pinout #card-df { grid-area: df; }
.pinout #card-spk { grid-area: spk; }

.pinout .cmp {
  position: relative;
  padding: 16px 18px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.pinout .cmp.hub {
  box-shadow: 0 0 0 2px #ffd9dd, 0 8px 24px rgba(182, 10, 72, 0.08);
}

.pinout .cmp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pinout .ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.pinout .ic.pink { background: #ffd9dd; color: #b60a48; }
.pinout .ic.blue { background: #d1e4ff; color: #0061a2; }
.pinout .ic.yellow { background: #f2e66a; color: #4e4800; }
.pinout .ic.dark { background: #303036; color: #ffffff; }

.pinout .cmp h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.pinout .tag {
  display: block;
  margin-top: 1px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: #5a4043;
}

.pinout .hub-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 0 12px;
  text-align: center;
}

.pinout .hub-cols {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.pinout .hub-col {
  flex: 1;
  min-width: 0;
  max-width: 160px;
}

.pinout .hub-col-label {
  margin: 0 0 5px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: #5a4043;
}

.pinout .pinrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2.5px 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
}

.pinout .pinrow.edge-right {
  flex-direction: row-reverse;
  text-align: right;
}

.pinout .pindot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2bec2;
  transition: transform 0.15s;
}

.pinout .pinrow.used .pindot {
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 2px #ffffff;
}

.pinout .pinrow:not(.used) .plabel { color: #e2bec2; font-size: 11.5px; }
.pinout .pinrow.used .plabel { color: #1b1b21; font-weight: 500; }
.pinout .pinrow.wire-active .pindot { transform: scale(1.35); }

.pinout #wires {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: visible;
  pointer-events: none;
}

.pinout #wires path.line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.15s;
}

.pinout #wires path.hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  pointer-events: stroke;
  cursor: pointer;
}

.pinout .dim { opacity: 0.1 !important; }

.pinout .rel-label {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  padding: 3px 9px;
  border-radius: 99px;
  background: #303036;
  color: #ffffff;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}

.pinout .rel-label.show { opacity: 1; }

.pinout .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.pinout .legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #e2bec2;
  border-radius: 99px;
  background: #ffffff;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pinout .legend li .sw {
  flex: none;
  width: 12px;
  height: 3px;
  border-radius: 2px;
}

.pinout .legend li:hover,
.pinout .legend li.on {
  border-color: #ffd9dd;
  background: #ffd9dd;
  color: #400013;
}

@media (max-width: 860px) {
  .pinout .diagram {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px 0 24px 66px;
  }

  .pinout .hub-cols { flex-direction: column; gap: 14px; }
  .pinout .hub-col { max-width: none; }
  .pinout .pinrow.edge-right { flex-direction: row; text-align: left; }
}

/* Part names on book-box.html that jump to their card in the pinout map. */
.part-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline dotted #b60a48;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.part-link:hover {
  color: #b60a48;
}

.pinout .cmp {
  scroll-margin-top: 96px;
}

.pinout .cmp:target {
  animation: part-flash 1.6s ease-out;
}

@keyframes part-flash {
  0%,
  40% {
    box-shadow: 0 0 0 3px #b60a48, 0 8px 24px rgba(182, 10, 72, 0.18);
  }
}
