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

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html.theme-animate,
  html.theme-animate * {
    transition:
      background-color 0.45s cubic-bezier(0.4, 0, 0.2, 1),
      color 0.45s cubic-bezier(0.4, 0, 0.2, 1),
      border-color 0.45s cubic-bezier(0.4, 0, 0.2, 1),
      outline-color 0.45s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-primary);
  font-size: 1.125rem;
  line-height: 1.75rem;
  text-transform: uppercase;
  color: var(--color-fg);
  background: var(--color-bg);
  zoom: var(--page-zoom);
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
ol,
ul {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: inherit;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
}

h1,
p {
  font-size: var(--text-h1);
  font-weight: 320;
}

h2,
.prose p,
.panel-right p {
  font-size: var(--text-h2);
  font-weight: 350;
}

h3 {
  font-size: var(--text-h3);
  font-weight: 400;
}

h4 {
  font-size: var(--text-h4);
  font-weight: 400;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
  text-transform: inherit;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

::selection {
  background: #5eead4;
  color: var(--color-fg);
}

.link-underline,
.research-intro a,
.info-page p a,
.imprint-page p a,
.bio-panel p a,
.bio-panel li a,
.bio p a,
.contacts .contact-block a {
  text-decoration: none;
  color: var(--color-link);
  /* Repeat the dotted underline on every wrapped line fragment */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  /*
   * Fixed pixel-spaced dots so every link looks identical regardless of width.
   * background-repeat is off and the tile is sized to the full width, so
   * shrinking background-size width clips the dotted line from the right
   * (retract toward the left); growing it lets the dots emerge from the left
   * and slide out to the right.
   */
  background-image: repeating-linear-gradient(
    to right,
    var(--color-link-underline) 0,
    var(--color-link-underline) var(--link-dot-len),
    transparent var(--link-dot-len),
    transparent calc(var(--link-dot-len) + var(--link-dot-gap))
  );
  background-repeat: no-repeat;
  background-position: left bottom 0.04em;
  background-size: 100% var(--link-dot-thickness);
  /* Mouse leave: the dots emerge from the left and slide out to the right */
  transition:
    background-size 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.25s ease;
}

.link-underline:hover,
.research-intro a:hover,
.info-page p a:hover,
.imprint-page p a:hover,
.bio-panel p a:hover,
.bio-panel li a:hover,
.bio p a:hover,
.contacts .contact-block a:hover {
  color: var(--color-fg);
  /* Mouse enter: all dots concentrate into the leftmost dot, then vanish */
  background-size: 0% var(--link-dot-thickness);
  transition:
    background-size 0.45s cubic-bezier(0.65, 0, 0.35, 1),
    color 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
  .link-underline,
  .research-intro a,
  .info-page p a,
  .imprint-page p a,
  .bio-panel p a,
  .bio-panel li a,
  .bio p a,
  .contacts .contact-block a,
  .link-underline:hover,
  .research-intro a:hover,
  .info-page p a:hover,
  .imprint-page p a:hover,
  .bio-panel p a:hover,
  .bio-panel li a:hover,
  .bio p a:hover,
  .contacts .contact-block a:hover {
    background-size: 100% var(--link-dot-thickness);
    transition: color 0.2s ease;
  }
}
