@import url("fonts/title-faces.css?v=3");

/* "5000" — chrome lockup under the title, plus its CRT takeover.
   Texture: "Vintage Car with Chrome" photograph by Jill Clardy (CC BY-SA 2.0,
   via Wikimedia Commons), cropped to the bumper. Type: Bungee / Bungee Shade /
   Bungee Inline by David Jonathan Ross (SIL OFL 1.1). Sparkle mark: Material
   Symbols "auto_awesome" by Google (Apache 2.0). All real, downloaded files. */

/* The header is a centred flex row in the theme; let it wrap so the block
   lands on its own line directly under the existing title. */
.sentinel-main-header {
  flex-wrap: wrap;
}

.five-k-block {
  flex: 0 0 100%;
  width: 100%;
  margin: 0 auto;
}

.five-k {
  --five-k-size: clamp(2.7rem, 13.5vw, 6rem);
  position: relative;
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0.15em auto 0;
  padding: 0.06em 0.1em 0.14em;
  border: 0;
  background: none;
  line-height: 0.98;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.five-k:focus-visible {
  outline: 2px solid rgba(120, 255, 160, 0.7);
  outline-offset: 6px;
  border-radius: 6px;
}

.five-k-layer {
  display: block;
  margin: 0;
  font-family: "Bungee", "Anton", Impact, sans-serif;
  font-size: var(--five-k-size);
  font-weight: 400;
  letter-spacing: 0.015em;
  text-transform: none;
  white-space: nowrap;
  text-align: center;
  transition: opacity 0.18s linear;
}

/* Everything but the face is stacked on top of the face's own box, so the
   Bungee layer family lines up exactly the way it was drawn to. */
.five-k-layer.stacked {
  position: absolute;
  inset: 0.06em 0.1em 0.14em;
  pointer-events: none;
}

/* 1 — the extrusion. Bungee Shade carries the cast-back solid. */
.five-k-shade {
  z-index: 1;
  color: #05100a;
  -webkit-text-fill-color: #05100a;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.75));
}

/* 2 — the face, filled with the chrome photograph. */
.five-k-face {
  position: relative;
  z-index: 2;
  color: transparent;
  background-image: url("assets/chrome-real.jpg");
  background-size: 118% auto;
  background-position: 50% 42%;
  background-repeat: no-repeat;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 1px 0 rgba(240, 246, 248, 0.65))
    drop-shadow(0 -1px 0 rgba(40, 46, 50, 0.6))
    drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
  animation: five-k-chrome-drift 14s ease-in-out infinite;
}

/* 3 — the inline cut, dialled right down so it reads as a polish line. */
.five-k-inline {
  z-index: 3;
  color: rgba(255, 255, 255, 0.5);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.5);
  mix-blend-mode: screen;
  opacity: 0.5;
}

/* 4 — a specular band that slides across the metal. */
.five-k-gloss {
  z-index: 4;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(
    104deg,
    rgba(255, 255, 255, 0) 38%,
    rgba(255, 255, 255, 0.85) 47%,
    rgba(255, 255, 255, 0) 56%
  );
  background-size: 260% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  mix-blend-mode: screen;
  animation: five-k-sweep 6.5s ease-in-out infinite;
}

@keyframes five-k-chrome-drift {
  0%, 100% { background-position: 50% 42%; }
  50% { background-position: 56% 52%; }
}

@keyframes five-k-sweep {
  0%, 12% { background-position: 130% 0; }
  46%, 100% { background-position: -30% 0; }
}

/* ------------------------------------------------------------- the sparks */

.five-k-sparks {
  position: absolute;
  inset: -18% -12%;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
}

.five-k-spark {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  opacity: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.85))
    drop-shadow(0 0 14px rgba(180, 230, 255, 0.55));
  animation: five-k-spark 900ms ease-out forwards;
}

.five-k.crt-on .five-k-spark {
  filter: drop-shadow(0 0 6px rgba(120, 255, 150, 0.9))
    drop-shadow(0 0 16px rgba(40, 220, 90, 0.6));
}

@keyframes five-k-spark {
  0% { opacity: 0; transform: rotate(var(--spin, 0deg)) scale(0.1); }
  35% { opacity: 1; transform: rotate(calc(var(--spin, 0deg) + 25deg)) scale(1); }
  70% { opacity: 0.85; transform: rotate(calc(var(--spin, 0deg) + 45deg)) scale(0.78); }
  100% { opacity: 0; transform: rotate(calc(var(--spin, 0deg) + 70deg)) scale(0.15); }
}

/* -------------------------------------------------------------- the screen */

.five-k-crt {
  position: absolute;
  inset: -6% -4%;
  z-index: 6;
  width: 108%;
  height: 112%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s linear;
}

.five-k.crt-on .five-k-crt {
  opacity: 1;
}

.five-k.crt-on .five-k-shade,
.five-k.crt-on .five-k-face,
.five-k.crt-on .five-k-inline,
.five-k.crt-on .five-k-gloss {
  opacity: 0;
}

.five-k-hint {
  margin: 0.35em 0 0;
  text-align: center;
  font-family: "Share Tech Mono", ui-monospace, monospace;
  font-size: clamp(0.55rem, 2.1vw, 0.72rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(170, 220, 185, 0.5);
  pointer-events: none;
  transition: color 0.2s linear;
}

.five-k.crt-on + .five-k-hint,
.five-k-hint.live {
  color: rgba(120, 255, 150, 0.85);
}

@media (prefers-reduced-motion: reduce) {
  .five-k-face,
  .five-k-gloss {
    animation: none;
  }
  .five-k-spark {
    animation-duration: 1400ms;
  }
}
