/* мини-лого: багровая улыбка в меню и перед заголовками разделов */

:root {
  --smile-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 32'%3E%3Cg fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M4 5Q32 34 60 5'/%3E%3Cpath d='M17.5 10.4L16 19'/%3E%3Cpath d='M32 15.8V27.4'/%3E%3Cpath d='M46.5 10.4L48 19'/%3E%3C/g%3E%3C/svg%3E");
}

nav .brand {
  display: inline-flex;
  align-items: center;
  gap: .5em;
}

.brand-smile {
  display: inline-block;
  width: 1.55em;
  height: .8em;
  flex: none;
  color: var(--accent-hi, #c0402f);
  filter: drop-shadow(0 0 6px rgba(192, 64, 47, .45));
}

.brand-smile svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: logo-ignite 1.45s steps(1, end) 1.95s both;
}

/* на первом заходе ждём, пока раздвинется занавес; дальше зажигаем сразу */
html.curtain-seen .brand-smile svg {
  animation-delay: .15s;
}

@keyframes logo-ignite {
  0% { opacity: 0; filter: brightness(.55); }
  8% { opacity: .8; filter: brightness(1.3); }
  13% { opacity: .12; filter: brightness(.7); }
  22% { opacity: .95; filter: brightness(1.35); }
  28% { opacity: .3; filter: brightness(.8); }
  38% { opacity: 1; filter: brightness(1.2); }
  45% { opacity: .5; filter: brightness(.9); }
  54%, 100% { opacity: 1; filter: brightness(1); }
}

html.night .brand-smile {
  filter: drop-shadow(0 0 8px rgba(210, 74, 54, .6));
}

/* тот же знак вместо ромба перед заголовками разделов: лого, а не ещё один неон */
h2::before {
  content: "";
  display: inline-block;
  width: 1.35em;
  height: .68em;
  margin-right: .45em;
  vertical-align: -.02em;
  font-size: 1em;
  background: var(--accent);
  -webkit-mask: var(--smile-mark) center / contain no-repeat;
  mask: var(--smile-mark) center / contain no-repeat;
}

/* тонкая неоновая черта под заголовком: цвет наследуется от h2, поэтому DBD остаётся золотым */
h2::after {
  content: "";
  display: block;
  width: 2.8em;
  height: 1px;
  margin-top: .5em;
  border-radius: 1px;
  background: linear-gradient(90deg, currentColor, transparent);
  box-shadow: 0 0 9px currentColor;
  opacity: .5;
  pointer-events: none;
}

/* у центрированного заголовка DBD черта тоже по центру */
.dbd-bridge-copy h2::after {
  margin-left: auto;
  margin-right: auto;
}

/* активный пункт меню: тонкая трубка под ссылкой */
nav a.link {
  position: relative;
}

nav a.link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 1px;
  border-radius: 1px;
  background: var(--accent-hi, #c0402f);
  box-shadow: 0 0 8px var(--accent-hi, #c0402f);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

nav a.link.on::after {
  opacity: .6;
}

nav a.link:hover::after {
  opacity: .35;
}

@media (max-width: 560px) {
  .brand-smile {
    width: 1.35em;
    height: .7em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-smile svg {
    animation: none;
    opacity: 1;
    filter: none;
  }

  nav a.link::after {
    transition: none;
  }
}
