:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --ink: #142022;
  --muted: #5f6f73;
  --line: #c8d4d7;
  --accent: #0d7468;
  --accent-2: #8d3434;
  --accent-3: #335f9b;
  --warm: #a06415;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
a {
  font: inherit;
}

.shell {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.7rem;
  font-size: 3rem;
  line-height: 1;
}

.lead,
.muted {
  color: var(--muted);
}

.status-pill,
button,
.module-link {
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.topbar-actions {
  display: grid;
  justify-items: end;
  gap: 0.55rem;
}

.love-note {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: fit-content;
  margin-top: 0.85rem;
  border: 1px solid #efc4c4;
  border-radius: 999px;
  padding: 0.38rem 0.52rem 0.38rem 0.78rem;
  color: #8d3434;
  background: linear-gradient(90deg, #fff8f8, #fff);
  box-shadow: 0 8px 22px rgba(141, 52, 52, 0.08);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.love-text {
  line-height: 1;
}

.pig-family {
  display: inline-flex;
  align-items: end;
  gap: 0.12rem;
}

.running-pig {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 46px;
  height: 36px;
  transform-origin: 50% 80%;
  animation: pig-bounce 0.78s ease-in-out infinite;
}

.side-pig-right {
  animation-delay: 0.12s;
}

.mini-pig {
  width: 34px;
  height: 27px;
  margin-left: -0.3rem;
  transform-origin: 50% 85%;
  animation-delay: 0.18s;
  animation-duration: 0.72s;
}

.heart-pig {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.side-pig {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.heart-pig:focus-visible {
  outline: 2px solid #8d3434;
  outline-offset: 3px;
}

.side-pig:focus-visible {
  outline: 2px solid #8d3434;
  outline-offset: 3px;
}

.heart-burst {
  position: absolute;
  left: 50%;
  top: -8px;
  width: 1px;
  height: 1px;
  pointer-events: none;
  transform: translateX(-50%);
}

.heart-burst span {
  position: absolute;
  width: 8px;
  height: 8px;
  opacity: 0;
  transform: translate(-50%, 0) rotate(45deg) scale(0.5);
}

.heart-burst span::before,
.heart-burst span::after {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d94d6a;
  content: "";
}

.heart-burst span::before {
  left: -4px;
}

.heart-burst span::after {
  top: -4px;
}

.heart-burst span:nth-child(1) {
  left: -8px;
}

.heart-burst span:nth-child(2) {
  left: 2px;
}

.heart-burst span:nth-child(3) {
  left: 12px;
}

.pop-hearts .heart-burst span {
  animation: heart-pop 0.95s ease-out forwards;
}

.pop-hearts .heart-burst span:nth-child(2) {
  animation-delay: 0.08s;
}

.pop-hearts .heart-burst span:nth-child(3) {
  animation-delay: 0.16s;
}

.mini-pig .pig-face {
  left: 4px;
  top: 5px;
  width: 27px;
  height: 19px;
  border-width: 1.5px;
}

.mini-pig .pig-ear {
  top: 1px;
  width: 9px;
  height: 9px;
  border-width: 1.5px;
}

.mini-pig .pig-ear-left {
  left: 6px;
}

.mini-pig .pig-ear-right {
  right: 6px;
}

.mini-pig .pig-eye {
  top: 5px;
  width: 3px;
  height: 3px;
}

.mini-pig .pig-eye-left {
  left: 7px;
}

.mini-pig .pig-eye-right {
  right: 7px;
}

.mini-pig .pig-nose {
  bottom: 3px;
  width: 11px;
  height: 7px;
  gap: 2px;
}

.mini-pig .pig-nose span {
  width: 2px;
  height: 3px;
}

.mini-pig .pig-leg {
  bottom: 1px;
  width: 5px;
  height: 5px;
}

.mini-pig .pig-leg-left {
  left: 9px;
}

.mini-pig .pig-leg-right {
  right: 9px;
}

.mini-pig .pig-shadow {
  left: 7px;
  right: 7px;
  height: 4px;
}

.pig-shadow {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 5px;
  border-radius: 50%;
  background: rgba(141, 52, 52, 0.18);
  animation: pig-shadow 0.78s ease-in-out infinite;
}

.pig-face {
  position: absolute;
  left: 5px;
  top: 6px;
  width: 36px;
  height: 25px;
  border: 2px solid #8d3434;
  border-radius: 50% 50% 45% 45%;
  background: #f6a7b8;
  box-shadow: inset -5px -3px 0 rgba(255, 255, 255, 0.22);
}

.pig-ear {
  position: absolute;
  top: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid #8d3434;
  background: #f6a7b8;
  transform: rotate(45deg);
}

.pig-ear-left {
  left: 7px;
}

.pig-ear-right {
  right: 7px;
}

.pig-eye {
  position: absolute;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #142022;
}

.pig-eye-left {
  left: 9px;
}

.pig-eye-right {
  right: 9px;
}

.pig-nose {
  position: absolute;
  left: 50%;
  bottom: 4px;
  display: flex;
  gap: 3px;
  width: 14px;
  height: 9px;
  align-items: center;
  justify-content: center;
  border: 1px solid #8d3434;
  border-radius: 999px;
  background: #ffd0da;
  transform: translateX(-50%);
}

.pig-nose span {
  width: 3px;
  height: 4px;
  border-radius: 50%;
  background: #8d3434;
}

.pig-leg {
  position: absolute;
  bottom: 2px;
  width: 7px;
  height: 7px;
  border-radius: 0 0 4px 4px;
  background: #8d3434;
  animation: pig-run 0.35s ease-in-out infinite alternate;
}

.pig-leg-left {
  left: 12px;
}

.pig-leg-right {
  right: 12px;
  animation-delay: 0.18s;
}

.pig-hair,
.pig-bow,
.pig-brow,
.pig-glasses,
.pig-lash {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pig-hair {
  left: 17px;
  top: 2px;
  width: 12px;
  height: 7px;
  border-radius: 10px 10px 2px 2px;
  background: #523423;
  transform: rotate(-8deg);
}

.pig-brow {
  top: 4px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: #523423;
}

.pig-brow-left {
  left: 7px;
  transform: rotate(-18deg);
}

.pig-brow-right {
  right: 7px;
  transform: rotate(18deg);
}

.pig-bow {
  right: 7px;
  top: 0;
  width: 16px;
  height: 10px;
}

.pig-bow::before,
.pig-bow::after {
  position: absolute;
  top: 1px;
  width: 8px;
  height: 8px;
  border-radius: 8px 8px 2px 8px;
  background: #d94d6a;
  content: "";
}

.pig-bow::before {
  left: 0;
  transform: rotate(38deg);
}

.pig-bow::after {
  right: 0;
  transform: rotate(-38deg);
}

.pig-glasses {
  left: 6px;
  top: 5px;
  width: 24px;
  height: 9px;
  border-left: 2px solid #142022;
  border-right: 2px solid #142022;
}

.pig-glasses::before,
.pig-glasses::after {
  position: absolute;
  top: 0;
  width: 9px;
  height: 8px;
  border: 1.5px solid #142022;
  border-radius: 50%;
  content: "";
}

.pig-glasses::before {
  left: 0;
}

.pig-glasses::after {
  right: 0;
}

.pig-lash {
  right: 6px;
  top: 5px;
  width: 8px;
  height: 5px;
  border-top: 2px solid #142022;
  border-radius: 50%;
  transform: rotate(-8deg);
}

.is-worker .pig-hair,
.is-worker .pig-brow {
  opacity: 1;
}

.is-worker .pig-eye {
  height: 3px;
  border-radius: 999px;
  transform: rotate(-8deg);
}

.is-worker .pig-face {
  background: #f3a0ad;
}

.is-wink .pig-bow,
.is-wink .pig-glasses {
  opacity: 1;
}

.is-wink .pig-eye-right {
  height: 2px;
  border-radius: 999px;
  transform: rotate(-12deg);
}

.is-wink .pig-lash {
  opacity: 1;
  animation: wink-lash 0.9s ease-in-out infinite;
}

.is-wink .pig-face {
  background: #f8a9c0;
}

@keyframes pig-bounce {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateX(7px) translateY(-5px) rotate(4deg);
  }
}

@keyframes pig-run {
  from {
    transform: translateY(0) rotate(-12deg);
  }
  to {
    transform: translateY(-3px) rotate(12deg);
  }
}

@keyframes pig-shadow {
  0%,
  100% {
    opacity: 0.2;
    transform: scaleX(1);
  }
  50% {
    opacity: 0.1;
    transform: scaleX(0.72);
  }
}

@keyframes heart-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) rotate(45deg) scale(0.4);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--heart-x, -50%), -36px) rotate(45deg) scale(1);
  }
}

@keyframes wink-lash {
  0%,
  100% {
    transform: rotate(-8deg) translateY(0);
  }
  50% {
    transform: rotate(-18deg) translateY(-1px);
  }
}

.heart-burst span:nth-child(1) {
  --heart-x: -18px;
}

.heart-burst span:nth-child(2) {
  --heart-x: -50%;
}

.heart-burst span:nth-child(3) {
  --heart-x: 12px;
}

.overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.overview article,
.module-card,
.notes {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: var(--surface);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin: 1rem 0;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.module-card {
  display: grid;
  gap: 0.7rem;
}

.module-card h3 {
  margin-bottom: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  color: var(--accent-3);
  background: #f8fbfb;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-ready {
  color: var(--accent);
}

.status-integration {
  color: var(--warm);
}

.status-scaffold,
.status-extension-point {
  color: var(--accent-2);
}

.health-healthy {
  color: var(--accent);
}

.health-unreachable {
  color: var(--accent-2);
}

.health-unknown,
.health-not {
  color: var(--muted);
}

code {
  color: var(--accent-3);
}

@media (max-width: 800px) {
  .topbar,
  .overview {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-items: start;
  }

  h1 {
    font-size: 2.1rem;
  }
}
