/* The wordmark.
 *
 * In the interface the A is the ordinary A from Geologica. The drawn A in
 * a.svg is for the browser-tab icon only: set in a line of type it sits at its
 * own height and pushes whatever is next to it out of place, and getting it to
 * match the font at every size never quite worked.
 *
 * The colon is two suns. The colour of the brand is carried by a mark that is
 * already in the name, so nothing has to be invented to hold it.
 */

.aida-mark {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: var(--tracking-mark);
  line-height: 1;
  color: var(--ink);
}

/* The colon is placed against the capitals, not against a baseline it guesses.
 *
 * It used to be a flex item in a baseline-aligned row, and a box like this has
 * no baseline of its own — the browser synthesises one from the bottom edge of
 * the first dot. That put the top dot's bottom on the baseline and dropped the
 * whole pair a quarter of the cap height, the lower dot falling clean through
 * the baseline.
 *
 * Instead: a box exactly one cap high (Geologica's capitals measure 0.70em, not
 * the 0.72 the mockups assumed), with no in-flow line boxes and overflow hidden
 * — which makes its baseline its own bottom edge. The box bottom then sits on
 * the text baseline, the box covers the capitals, and the dots centre inside it.
 */
.aida-colon {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
  overflow: hidden;
  width: 0.19em;
  height: 0.70em;
  margin: 0 0.13em;
}
.aida-colon i {
  position: absolute;
  left: 0;
  width: 0.19em;
  height: 0.19em;
  border-radius: var(--radius-pill);
  background: var(--mane);
}
/* 0.0275em each side of the middle — the pair sits 0.055em apart. */
.aida-colon i:first-child {
  bottom: calc(50% + 0.0275em);
  background: var(--sun);
}
.aida-colon i:last-child {
  top: calc(50% + 0.0275em);
}

/* Under about 18px the two suns run together and the lighter one washes out.
   One deeper tone reads as a colon; two do not. */
.aida-mark--small .aida-colon i:first-child {
  background: var(--mane);
}

/* On an ink fill. */
.aida-mark--on-dark {
  color: var(--on-dark);
}

/* On a sun fill: the letters go dark (9.7:1) and the colon inverts, because a
   sun dot on sun is not a dot. */
.aida-mark--on-sun {
  color: var(--ink);
}
.aida-mark--on-sun .aida-colon i {
  background: var(--ink);
}
.aida-mark--on-sun .aida-colon i:first-child {
  background: var(--paper);
}

/* The product lockup: AI:DA Academy, on one line.
 *
 * "Academy" stays in Latin in Kazakh and Russian too. Translating it changes
 * the width of the lockup every time someone switches language, and the mark
 * then moves in the corner of every screen. */
.aida-lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 0.34em;
}
.aida-lockup__name {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}
.aida-mark--on-dark + .aida-lockup__name {
  color: var(--on-dark);
}

/* 2.0 — Windows high-contrast. The system repaints backgrounds, and the
   colon is two filled boxes: without this the mark reads "AI DA". The dots
   keep their shape and take the text colour of the system theme. */
@media (forced-colors: active) {
  .aida-colon i,
  .aida-colon i:first-child {
    forced-color-adjust: none;
    background: CanvasText;
  }
}
