:root {
  --stage-w: 1366;
  --stage-h: 768;
  --scale: 1;
  --green: #b7d651;
  --green-soft: #cce868;
  --green-strong: #9cb63d;
  --line: rgba(190, 219, 85, .95);
  --white: #f8faf2;
  --glass: rgba(0,0,0,.72);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #030507; color: var(--white); }
body { overflow: hidden; }
.stage-shell {
  width: 100vw;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #020304;
}
.stage-fit {
  width: calc(1366px * var(--scale));
  height: calc(768px * var(--scale));
  position: relative;
  flex: 0 0 auto;
}
.anatomy-stage {
  position: relative;
  width: 1366px;
  height: 768px;
  overflow: hidden;
  transform: scale(var(--scale));
  transform-origin: top left;
}
.anatomy-stage__bg {
  position: absolute;
  inset: 0;
  background: url('./assets/anatomia-bg.png') center center / cover no-repeat;
}
.navbar {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 8px;
  height: 58px;
  z-index: 20;
  display: grid;
  grid-template-columns: 220px 1fr 120px;
  align-items: center;
  padding: 0 28px;
  border: 1px solid rgba(190, 219, 85, .4);
  border-radius: 23px;
  background: rgba(0,0,0,.44);
  backdrop-filter: blur(6px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
}
.brand__logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.05);
}
.brand__text {
  display: grid;
  gap: 1px;
  line-height: .9;
  font-size: 16px;
  font-weight: 800;
}
.brand__text strong { font-size: 1.18em; letter-spacing: .02em; }
.menu {
  justify-self: center;
  display: flex;
  gap: 48px;
  align-items: center;
  white-space: nowrap;
}
.menu__link {
  position: relative;
  height: 58px;
  display: inline-flex;
  align-items: center;
  color: rgba(255,255,255,.86);
  text-decoration: none;
  font-size: 15px;
  font-weight: 650;
}
.menu__link:hover,
.menu__link.is-active { color: #fff; }
.menu__link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 13px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--green);
  transform: translateX(-50%);
  transition: width .18s ease;
}
.menu__link:hover::after,
.menu__link.is-active::after { width: 54px; }
.sound-pill {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}
.sound-pill img { width: 31px; height: 31px; object-fit: contain; }
.anatomy-copy {
  position: absolute;
  left: 22px;
  top: 144px;
  width: 260px;
  z-index: 11;
}
.anatomy-copy h1 {
  margin: 0;
  color: var(--green-soft);
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}
.anatomy-copy p {
  margin: 12px 0 0;
  font-size: 14px;
  color: rgba(255,255,255,.98);
}
.sidebar-card {
  position: absolute;
  left: 20px;
  top: 238px;
  width: 210px;
  min-height: 350px;
  padding: 18px 0 14px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.68);
  z-index: 12;
}
.sidebar-card h2 {
  margin: 0;
  padding: 0 20px 14px;
  color: var(--green-soft);
  font-size: 14px;
  font-weight: 900;
}
.sidebar-nav { display: grid; }
.sidebar-item {
  display: grid;
  gap: 4px;
  padding: 11px 20px;
  color: #fff;
  text-decoration: none;
}
.sidebar-item__title {
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
}
.sidebar-item__text {
  font-size: 11px;
  line-height: 1.18;
  color: rgba(255,255,255,.95);
}
.sidebar-item:hover,
.sidebar-item.is-active {
  background: linear-gradient(90deg, rgba(144,169,45,.24), rgba(144,169,45,.42));
}
.anatomy-bird {
  position: absolute;
  z-index: 10;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.18));
  transform-origin: center center;
}
.detail-card {
  position: absolute;
  right: 32px;
  bottom: 176px;
  width: 345px;
  min-height: 164px;
  padding: 22px 26px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.74);
  z-index: 13;
}
.detail-card h2 {
  margin: 0 0 20px;
  color: var(--green-soft);
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}
.detail-card p {
  margin: 0;
  color: rgba(255,255,255,.97);
  font-size: 14px;
  line-height: 1.42;
}
.detail-card__small {
  margin-top: 14px !important;
  padding-top: 10px;
  border-top: 1px solid rgba(190, 219, 85, .24);
  font-size: 12px !important;
  color: rgba(255,255,255,.94);
}
.detail-card__small strong {
  display: inline-block;
  margin-right: 5px;
  color: var(--green-soft);
}
.detail-arrow {
  position: absolute;
  z-index: 12;
  width: 252px;
  height: auto;
  object-fit: contain;
  opacity: .98;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(183, 214, 81, .12));
  transform-origin: center center;
}
.view-overview .anatomy-bird {
  width: 530px;
  left: 420px;
  top: 123px;
}
.view-ojos .anatomy-bird,
.view-pico .anatomy-bird,
.view-pecho .anatomy-bird,
.view-patas .anatomy-bird,
.view-cresta .anatomy-bird,
.view-alas .anatomy-bird,
.view-garras .anatomy-bird { transform: scaleX(-1); }
.view-ojos .anatomy-bird {
  width: 468px;
  left: 404px;
  top: 118px;
}
.view-ojos .detail-card { right: 28px; bottom: 187px; width: 345px; }
.view-ojos .detail-arrow { left: 740px; top: 360px; width:280px ; transform: rotate(30deg); }

.view-pico .anatomy-bird {
  width: 650px;
  left: 270px;
  top: 170px;
}
.view-pico .detail-card { right: 18px; bottom: 158px; width: 360px; }
.view-pico .detail-arrow { left: 600px; top: 356px; width: 400px; transform: rotate(6deg); }

.view-pecho .anatomy-bird {
  width: 468px;
  left: 414px;
  top: 145px;
}
.view-pecho .detail-card { right: 28px; bottom: 187px; width: 356px; }
.view-pecho .detail-arrow { left: 732px; top: 414px; width: 250px; transform: rotate(5deg); }

.view-patas .anatomy-bird {
  width: 420px;
  left: 463px;
  top: 111px;
}
.view-patas .detail-card { right: 28px; bottom: 187px; width: 350px; }
.view-patas .detail-arrow { left: 740px; top: 490px; width: 250px; transform: rotate(-25deg); }

.view-cresta .anatomy-bird {
  width: 656px;
  left: 324px;
  top: 170px;
}
.view-cresta .detail-card { right: 28px; bottom: 206px; width: 330px; min-height: 120px; }
.view-cresta .detail-arrow { left: 660px; top: 320px; width: 370px; transform: rotate(18deg); }

.view-alas .anatomy-bird {
  width: 650px;
  left: 300px;
  top: 170px;
}
.view-alas .detail-card { right: 18px; bottom: 146px; width: 374px; min-height: 220px; }
.view-alas .detail-arrow { left: 750px; top: 418px; width: 235px; transform: rotate(16deg); }

.view-garras .anatomy-bird {
  width: 420px;
  left: 463px;
  top: 111px;
}
.view-garras .detail-card { right: 28px; bottom: 180px; width: 362px; min-height: 170px; }
.view-garras .detail-arrow { left: 750px; top: 510px; width: 220px; transform: rotate(-10deg); }

@media (max-width: 520px) {
  .stage-shell {
    overflow: auto;
    justify-content: flex-start;
    align-items: flex-start;
  }
}


/* Audio interactivo del header */
.sound-pill {
  cursor: pointer;
  user-select: none;
  padding: 4px 7px;
  border-radius: 999px;
  transition: transform .18s ease, filter .18s ease, background .18s ease;
}
.sound-pill:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
  background: rgba(190, 219, 85, .08);
}
.sound-pill.is-playing {
  background: rgba(190, 219, 85, .12);
  text-shadow: 0 0 12px rgba(190, 219, 85, .45);
}
.sound-pill.is-playing img {
  animation: soundPulse .78s ease-in-out infinite alternate;
}
@keyframes soundPulse {
  from { transform: scale(.94); opacity: .78; }
  to { transform: scale(1.12); opacity: 1; }
}


/* Modelo 3D interactivo en la vista general de Anatomía */
.anatomy-model {
  position: absolute;
  z-index: 10;
  left: 278px;
  top: 64px;
  width: 760px;
  height: 650px;
  --poster-color: transparent;
  background: transparent;
  outline: none;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .22));
}
.anatomy-model::part(default-progress-bar) {
  background-color: var(--green-soft);
}
.model-hint {
  position: absolute;
  z-index: 14;
  left: 454px;
  bottom: 82px;
  margin: 0;
  padding: 7px 14px;
  border: 1px solid rgba(190, 219, 85, .42);
  border-radius: 999px;
  background: rgba(0, 0, 0, .42);
  color: rgba(255, 255, 255, .86);
  font-size: 12px;
  line-height: 1;
  backdrop-filter: blur(5px);
}

.model-controls {
  position: absolute;
  z-index: 15;
  left: 422px;
  bottom: 118px;
  display: grid;
  grid-template-columns: repeat(4, 42px) repeat(2, 86px);
  gap: 8px;
  align-items: center;
}
.model-control {
  height: 38px;
  border: 1px solid rgba(190, 219, 85, .54);
  border-radius: 999px;
  background: rgba(0, 0, 0, .54);
  color: var(--white);
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.model-control:hover,
.model-control:focus-visible {
  transform: translateY(-1px);
  border-color: var(--green-soft);
  background: rgba(156, 182, 61, .32);
  outline: none;
}
.model-control--wide {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
