/* Element defaults shared by the web UI and the desktop window. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  line-height: var(--line-height);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* One CJK face per language: Chinese and Japanese share code points but not
   glyph shapes. `leptos_i18n` sets `lang` on <html>. */
html:lang(zh) {
  font-family: var(--font-sans-zh);
}

html:lang(ja) {
  font-family: var(--font-sans-ja);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--color-bg);
  /* The glow: a faint pink tint from the top-right corner and a blue one
     from the bottom-left. */
  background-image:
    radial-gradient(ellipse at 85% 0%, var(--color-glow), transparent 55%),
    radial-gradient(ellipse at 0% 100%, var(--color-glow-secondary), transparent 50%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--color-fg);
  font-size: var(--text-md);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

h1 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--line-height-tight);
}

/* Text links are the blue accent; filled buttons are the pink one. */
a {
  color: var(--color-secondary-strong);
  text-decoration-thickness: var(--border-width);
  text-underline-offset: var(--space-1);
}

button,
select,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: var(--focus-width) solid var(--color-primary);
  outline-offset: var(--focus-width);
}

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

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes fade-up {
  from {
    transform: translateY(var(--distance-enter));
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes menu-in {
  from {
    transform: translateY(calc(var(--distance-enter) * -1)) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.enter {
  animation: fade-up var(--duration-enter) ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
