/* The hero bubble doubles as the theme switch: the sun sets and the moon rises
   (theme.css) when it is clicked. A one-time hint invites the first click. */

.page-hero .sun-bubble--toggle {
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.page-hero .sun-bubble--toggle .sun-bubble__sky {
  transition: filter 260ms ease;
}

.page-hero .sun-bubble--toggle:hover .sun-bubble__sky {
  filter: brightness(1.08) saturate(1.08);
}

.page-hero .sun-bubble--toggle:active .sun-bubble__sky {
  filter: brightness(.96);
}

.page-hero .sun-bubble--toggle:focus-visible {
  outline: 3px solid #8563ab;
  outline-offset: 8px;
}

[data-theme="dark"] .page-hero .sun-bubble--toggle:focus-visible {
  outline-color: #ffd978;
}

/* Hint: a small speech pill to the left of the bubble, pointing at it. The
   bubble is tilted -6deg, so the pill is turned back to read level. */
.page-hero .theme-hint {
  position: absolute;
  top: 22%;
  right: calc(100% + 14px);
  z-index: 4;
  width: max-content;
  max-width: 200px;
  padding: 9px 13px;
  border: 1px solid #e4d8ef;
  border-radius: 12px;
  background: #fffefa;
  color: #42345e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 10px 28px #2c174c24, 0 2px 0 #d9c9ea;
  transform: rotate(6deg);
  pointer-events: none;
  animation: theme-hint-in 420ms cubic-bezier(.22, 1, .36, 1) both, theme-hint-bob 3.2s ease-in-out 900ms infinite;
}

.page-hero .theme-hint::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -6px;
  width: 10px;
  height: 10px;
  border-top: 1px solid #e4d8ef;
  border-right: 1px solid #e4d8ef;
  background: inherit;
  transform: translateY(-50%) rotate(45deg);
}

[data-theme="dark"] .page-hero .theme-hint {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 12px 34px #05030f8a, 0 2px 0 #0a0617;
}

[data-theme="dark"] .page-hero .theme-hint::after {
  border-color: var(--line-strong);
}

@keyframes theme-hint-in {
  from { opacity: 0; transform: rotate(6deg) translateX(8px) scale(.94); }
  to { opacity: 1; transform: rotate(6deg) translateX(0) scale(1); }
}

@keyframes theme-hint-bob {
  0%, 100% { transform: rotate(6deg) translateX(0); }
  50% { transform: rotate(6deg) translateX(-4px); }
}

/* Narrow screens: the bubble sits at the band's edge, so the hint goes below it. */
@media (max-width: 800px) {
  .page-hero .theme-hint {
    top: auto;
    right: 50%;
    bottom: -10px;
    transform: translate(50%, 100%) rotate(6deg);
    animation: theme-hint-in-below 420ms cubic-bezier(.22, 1, .36, 1) both;
  }

  .page-hero .theme-hint::after {
    top: -6px;
    right: 50%;
    border-top: 1px solid #e4d8ef;
    border-right: 0;
    border-left: 1px solid #e4d8ef;
    transform: translateX(50%) rotate(45deg);
  }

  @keyframes theme-hint-in-below {
    from { opacity: 0; transform: translate(50%, 90%) rotate(6deg) scale(.94); }
    to { opacity: 1; transform: translate(50%, 100%) rotate(6deg) scale(1); }
  }
}

/* Phones: the bubble is small and tucked against the band's edge, next to the
   title; there is no room for the hint without covering it. Tapping still works. */
@media (max-width: 600px) {
  .page-hero .theme-hint {
    display: none;
  }
}

.app-shell.motion-disabled .page-hero .theme-hint {
  animation: none;
}
