/* Logo loader: desktop draw/open/name/close (5.7 s); mobile <=700px logo-only (files-2) */
html[data-seen="1"] .ll {
  display: none;
}

html:not([data-seen="1"]) body {
  overflow: hidden;
}

.ll {
  --ll-bg: #0f0e0c;
  --ll-ink: #efeae0;
  --ll-spread: 1400px;
  --z: 1.06;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--ll-bg);
  color: var(--ll-ink);
  cursor: pointer;
}

.ll .sv-d {
  width: min(88vw, 520px);
  max-height: min(46vh, 340px);
  height: auto;
  overflow: visible;
  transform: scale(var(--z));
  transform-origin: center center;
  animation: ll-zoom 3.4s 1.7s forwards;
}

.ll .sv-m {
  display: none;
}

.ll .sv-d .s {
  fill: none;
  stroke: currentColor;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ll-draw var(--d) cubic-bezier(0.65, 0, 0.35, 1) var(--t) forwards;
}

.ll .sv-d .L {
  animation: ll-oL 3.4s 1.7s forwards;
}

.ll .sv-d .R {
  animation: ll-oR 3.4s 1.7s forwards;
}

.ll .sv-d .nm {
  animation: ll-nm 3.4s 1.7s forwards;
}

.ll .sv-d .nm-tf text {
  fill: currentColor;
  font-family: "Noto Sans Tifinagh", "Segoe UI Historic", sans-serif;
  font-size: 148px;
  font-weight: 400;
  fill-opacity: 0;
  animation: ll-tf-in 0.5s 2.45s ease forwards;
}

.ll.out {
  animation: ll-out 0.45s ease forwards;
  pointer-events: none;
}

@keyframes ll-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes ll-tf-in {
  from {
    fill-opacity: 0;
    filter: blur(4px);
  }
  to {
    fill-opacity: 1;
    filter: blur(0);
  }
}

@keyframes ll-zoom {
  0% {
    transform: scale(var(--z));
    animation-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
  }
  20.6%,
  79.4% {
    transform: scale(1);
    animation-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
  }
  100% {
    transform: scale(var(--z));
  }
}

@keyframes ll-oL {
  0% {
    transform: translateX(0);
    animation-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
  }
  20.6%,
  79.4% {
    transform: translateX(calc(-1 * var(--ll-spread)));
    animation-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes ll-oR {
  0% {
    transform: translateX(0);
    animation-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
  }
  20.6%,
  79.4% {
    transform: translateX(var(--ll-spread));
    animation-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes ll-nm {
  0%,
  76% {
    opacity: 1;
  }
  81%,
  100% {
    opacity: 0;
  }
}

@keyframes ll-out {
  to {
    opacity: 0;
    transform: translateY(-12px);
  }
}

/* Mobile: logo only, slam / shake / knock (from files-2) */
@media (max-width: 700px) {
  .ll .sv-d {
    display: none;
  }

  .ll .sv-m {
    display: block;
    width: min(72vw, 300px);
    max-height: min(38vh, 260px);
    height: auto;
    overflow: visible;
    animation: ll-shake 2.4s forwards;
  }

  .ll::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    mix-blend-mode: difference;
    opacity: 0;
    pointer-events: none;
    animation: ll-flash 0.28s 0.6s forwards;
  }
}

.ll .sv-m .p {
  fill: none;
  stroke: currentColor;
}

.ll .sv-m .L {
  animation: ll-slL 0.45s 0.15s cubic-bezier(0.8, 0, 1, 0.6) both;
}

.ll .sv-m .R {
  animation: ll-slR 0.45s 0.15s cubic-bezier(0.8, 0, 1, 0.6) both;
}

.ll .sv-m .rg {
  transform-box: fill-box;
  transform-origin: center;
  animation: ll-knock 0.5s 0.6s ease-out;
}

@keyframes ll-slL {
  from {
    transform: translateX(-1500px);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes ll-slR {
  from {
    transform: translateX(1500px);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes ll-knock {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes ll-flash {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes ll-shake {
  0%,
  25% {
    transform: translate(0, 0) scale(1);
  }
  29% {
    transform: translate(-14px, 6px);
  }
  33% {
    transform: translate(12px, -8px);
  }
  37% {
    transform: translate(-8px, 5px);
  }
  41% {
    transform: translate(5px, -3px);
  }
  46%,
  70% {
    transform: translate(0, 0) scale(1);
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  76% {
    transform: translate(0, 0) scale(1.07);
  }
  84%,
  100% {
    transform: translate(0, 0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ll .sv-d .s {
    animation: none;
    stroke-dashoffset: 0;
  }

  .ll .sv-d,
  .ll .sv-d .L,
  .ll .sv-d .R {
    animation: none;
  }

  .ll .sv-d .nm {
    display: none;
  }

  .ll .sv-m,
  .ll .sv-m .L,
  .ll .sv-m .R,
  .ll .sv-m .rg,
  .ll::after {
    animation: none;
  }
}
