/* V2 interactive additions layered on top of style.css */

.brand .mark {
  width: 56px;
  height: 56px;
  overflow: visible;
}

.brand .mark img {
  object-fit: contain;
  padding: 2px;
}

.interactive-hero {
  position: relative;
  width: 100%;
}

.interactive-copy {
  max-width: 78ch;
}

.v2-title {
  font-size: clamp(3rem, 17vw, 10rem);
  line-height: 0.95;
  margin-bottom: clamp(0.75rem, 2.5vw, 1.6rem);
}

.interactive-copy p {
  font-size: clamp(1rem, 2.1vw, 2rem);
  line-height: 1.35;
}

.interactive-stage {
  position: relative;
  width: min(100%, 920px);
  margin: 0.5rem auto 0;
  border: none;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: none;
  overflow: visible;
  padding: 16px;
}

.interaction-prompt {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 0.92rem;
  color: #111827;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  box-shadow: var(--shadow);
  animation: prompt-float 2.8s ease-in-out infinite;
  pointer-events: none;
}

.interaction-prompt::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
}

.interaction-prompt.is-dismissed {
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.thought-bubble {
  --bubble-origin-x: 50%;
  position: absolute;
  left: 50%;
  top: 54px;
  width: min(760px, calc(100% - 28px));
  z-index: 4;
  margin: 0;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: radial-gradient(circle at 32% 18%, #ffffff 0%, #ffffff 42%, #f6f8ff 100%);
  box-shadow: var(--shadow);
  text-align: left;
  padding: 14px 16px 16px;
  transform-origin: var(--bubble-origin-x) top;
  opacity: 0;
  transform: translate(-50%, -10px) scale(0.965);
  filter: blur(0.7px);
  pointer-events: none;
  transition: opacity 0.56s cubic-bezier(0.22, 0.7, 0.22, 1), transform 0.68s cubic-bezier(0.22, 0.7, 0.22, 1), filter 0.68s cubic-bezier(0.22, 0.7, 0.22, 1);
  will-change: transform, opacity, filter;
}

.thought-bubble.is-open {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.thought-bubble.is-closing {
  opacity: 0;
  transform: translate(-50%, -8px) scale(0.97);
  filter: blur(0.65px);
  pointer-events: none;
}

.thought-bubble[hidden] {
  display: none;
}

.bubble-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.bubble-label {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 700;
}

.bubble-close {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff;
  cursor: pointer;
}

.bubble-content h2,
.bubble-content h3,
.bubble-content h4 {
  margin: 0.5rem 0;
}

.bubble-content {
  max-height: min(34vh, 250px);
  overflow: auto;
  padding-right: 4px;
}

.bubble-content p {
  margin: 0.5rem 0;
  text-align: left;
}

.bubble-content ul {
  margin: 0.4rem 0 0.7rem;
  padding-left: 1.2rem;
}

.bubble-content a {
  color: #1f2937;
  text-decoration: underline;
}

.interactive-svg {
  width: 100%;
  transform-origin: center top;
  padding-top: 10px;
  overflow: hidden;
  border-radius: 14px;
  transition: transform 0.78s cubic-bezier(0.22, 0.7, 0.22, 1), opacity 0.78s cubic-bezier(0.22, 0.7, 0.22, 1), filter 0.78s cubic-bezier(0.22, 0.7, 0.22, 1);
}

.interactive-stage.has-bubble .interactive-svg {
  transform: translateY(64px) scale(0.82);
  opacity: 0.72;
  filter: saturate(0.9) brightness(0.95);
}

.interactive-svg svg {
  display: block;
  width: 100%;
  height: auto;
}

.interactive-svg svg path:not(.pea-hotspot) {
  pointer-events: none;
}

.pea-hotspot {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition: filter 0.16s ease, stroke 0.16s ease, transform 0.16s ease;
  animation: pea-idle 2.5s ease-in-out infinite;
}

.interactive-stage.intro-running .pea-hotspot {
  animation: none;
}

#pea-policy {
  animation-delay: 0.1s;
}

#pea-ecology {
  animation-delay: 0.35s;
}

#pea-agriculture {
  animation-delay: 0.6s;
}

#pea-social {
  animation-delay: 0.85s;
}

.pea-hotspot.is-active {
  filter: saturate(1.15) brightness(1.08);
  stroke: #7fa227;
  transform: translateY(6px) scale(0.985);
  animation: none;
}

.pea-hotspot.is-pressing {
  transform: translateY(10px) scale(0.96);
  animation: none;
}

.pea-hotspot.intro-pop {
  animation: pea-intro 0.6s ease;
}

.pea-hotspot:focus,
.pea-hotspot.is-focused {
  outline: none;
  stroke: #6f8e1f;
  stroke-width: 32;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes pea-idle {
  0% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}

@keyframes pea-intro {
  0% {
    transform: scale(1) translateY(0);
    filter: brightness(1);
  }
  45% {
    transform: scale(1.13) translateY(-9px);
    filter: brightness(1.16) saturate(1.2);
  }
  100% {
    transform: scale(1) translateY(0);
    filter: brightness(1);
  }
}

@keyframes prompt-float {
  0% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
  100% { transform: translateX(-50%) translateY(0); }
}

@media (max-width: 700px) {
  .hero.interactive-hero {
    gap: 14px;
  }

  .card {
    padding: 22px 14px;
    margin-top: 18px;
  }

  .v2-title {
    font-size: clamp(2.6rem, 14vw, 3.4rem);
    letter-spacing: 0.04em;
  }

  .interactive-copy p {
    font-size: 1.1rem;
    line-height: 1.42;
  }

  .interactive-stage {
    padding: 0 8px 8px;
    border-radius: 14px;
  }

  .interaction-prompt {
    font-size: 0.8rem;
    top: -14px;
    padding: 4px 10px;
  }

  .thought-bubble {
    width: calc(100% - 18px);
    top: 0;
    border-radius: 18px;
    padding: 10px 10px 12px;
  }

  .bubble-content {
    max-height: min(40vh, 260px);
    font-size: 0.96rem;
    line-height: 1.4;
  }

  .bubble-head {
    margin-bottom: 4px;
  }

  .bubble-close {
    padding: 3px 8px;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .interaction-prompt,
  .pea-hotspot,
  .thought-bubble,
  .thought-bubble.is-open,
  .thought-bubble.is-closing {
    animation: none;
    transition: none;
  }

  .interactive-stage.has-bubble .interactive-svg {
    transform: none;
  }
}

/* Repositories page */
.repos-card {
  text-align: center;
}

.repos-intro {
  margin-bottom: 1.6rem;
}

.repos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.repo-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px 16px;
  background: #fff;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.repo-card:hover,
.repo-card:focus-visible {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.09);
}

.repo-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
}

.repo-card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.repo-card p {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 860px) {
  .repos-grid {
    grid-template-columns: 1fr;
  }
}

/* Contact page additions */
.contact-headshot {
  width: clamp(120px, 18vw, 170px);
  height: clamp(120px, 18vw, 170px);
  border-radius: 999px;
  object-fit: cover;
  object-position: center 30%;
  border: 3px solid #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  margin: 0 auto 16px;
}

.social-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 16px 0 10px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.social-link-icon {
  width: 18px;
  height: 18px;
}

.bsky-preview {
  width: min(760px, 100%);
  min-width: 0;
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.bsky-preview h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  text-align: center;
}

.bsky-feed {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.bsky-post {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  background: #f8fafc;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.bsky-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.bsky-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  object-fit: cover;
}

.bsky-author {
  min-width: 0;
}

.bsky-author-name {
  font-weight: 700;
  line-height: 1.1;
}

.bsky-author-handle {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bsky-post-text {
  margin: 0 0 8px;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bsky-post-text a {
  color: #2563eb;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bsky-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 10px;
}

.bsky-media-link {
  display: block;
  border: 1px solid #d8dee6;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.bsky-media-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}

.bsky-link-card {
  display: block;
  margin: 8px 0 10px;
  border: 1px solid #cdd5df;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  background: #fff;
}

.bsky-link-card:hover {
  text-decoration: none;
}

.bsky-card-thumb {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.bsky-link-card-body {
  padding: 10px 12px;
}

.bsky-link-card-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.bsky-link-card-desc {
  color: var(--muted);
  font-size: 0.92rem;
}

.bsky-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .bsky-media-grid {
    grid-template-columns: 1fr;
  }
}
