/*
 * A — grammar marks, the only red on the page. They are drawn, not typed: a clause gets square
 * brackets [ ], a phrase round ones ( ), both as thin red borders; S/V/O hang under their words
 * and a tag hangs over each bracket on a red leader. The renderer's markup (src/render/
 * annotated.js) is shared by the hero lens and the anatomy; each scene sets the scale, the
 * colors of words and the leader length (--leader) and decides which tags it shows.
 */

.sentence .span {
  position: relative;
}

/* A role is one constituent: never split, so its letter has one place to hang from. */
.sentence .span--role {
  white-space: nowrap;
  text-decoration: underline var(--signal);
  text-decoration-thickness: 0.055em;
  text-underline-offset: 0.2em;
  text-decoration-skip-ink: none;
}

/* Brackets: the typed glyph stays in the DOM (aria-hidden) but is not shown; borders draw it. */
.sentence .br {
  display: inline-block;
  position: relative;
  width: 0.22em;
  height: 1.04em;
  vertical-align: -0.2em;
  overflow: hidden;
  color: transparent;
  line-height: 1;
  border: 0 solid var(--signal);
  text-decoration: none;
}

.sentence .span--clause > .br {
  width: 0.2em;
  margin: 0 0.05em 0 0.02em;
  border-width: 0.07em 0 0.07em 0.07em;
}

.sentence .span--clause > .br:last-child {
  margin: 0 0.02em 0 0.05em;
  border-width: 0.07em 0.07em 0.07em 0;
}

.sentence .span--phrase > .br {
  margin: 0 0.01em 0 0;
  border-left-width: 0.07em;
  border-radius: 100% 0 0 100% / 50% 0 0 50%;
}

.sentence .span--phrase > .br:last-child {
  margin: 0 0 0 0.01em;
  border-left-width: 0;
  border-right-width: 0.07em;
  border-radius: 0 100% 100% 0 / 0 50% 50% 0;
}

/* S, V, O: hung under the first word of the constituent. */
.sentence .role-label {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.3em;
  font-family: var(--font-en);
  font-weight: 800;
  font-stretch: 100%;
  font-size: 0.42em;
  font-style: normal;
  line-height: 1;
  letter-spacing: 0;
  color: var(--signal);
  white-space: nowrap;
}

/* Tags: a red leader up from the opening bracket, the name at its top. */
.sentence .note {
  position: absolute;
  bottom: 100%;
  left: 0;
  padding: 0 0 var(--leader, 18px) 6px;
  border-left: 1px solid var(--signal);
  font-family: var(--font-mono);
  font-weight: 400;
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  overflow-wrap: normal;
}

/* The full stop of the motto is the last mark: a red square laid exactly over the period. The
   motto sets the square's size and its pull-back for its own width axis (--dot-*), measured
   from Archivo 800's period with 0.01em to spare on each side. */
.anatomy-motto::after,
.site-footer__motto::after {
  content: "";
  display: inline-block;
  width: var(--dot-w);
  height: var(--dot-h);
  margin-left: var(--dot-x);
  vertical-align: -0.01em;
  background: var(--signal);
}
