:root {
  color-scheme: dark;
  --amber: #ffb000;
  --amber-bright: #ffe1a0;
  --amber-dim: #7b4300;
  --black: #050300;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
  background: var(--black);
}

body {
  min-height: 100svh;
  overflow: hidden;
  color: var(--amber);
  font-family: "Courier New", Courier, monospace;
  text-transform: uppercase;
}

#field, .scanlines, .flash {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#field { opacity: .46; }

.scanlines {
  z-index: 20;
  opacity: .2;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, .64) 4px
  );
  mix-blend-mode: multiply;
}

body::after {
  content: "";
  position: fixed;
  z-index: 18;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 12vw 4vw #000;
}

main {
  position: relative;
  z-index: 10;
  min-height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 2rem 1rem 6.5rem;
}

.bolt-button {
  position: relative;
  width: min(42vw, 19.75rem);
  min-width: 12.75rem;
  height: min(70vh, 37.5rem);
  min-height: 28rem;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.bolt-button:focus-visible {
  outline: 1px solid var(--amber-bright);
  outline-offset: 1rem;
}

.bolt, .bolt-halo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bolt {
  overflow: visible;
  filter: drop-shadow(0 0 7px #e78400);
}

#namePattern text {
  fill: #ffd064;
  font: 700 7.2px/1 "Courier New", monospace;
  letter-spacing: .46px;
}

.bolt-core {
  fill: url(#namePattern);
  stroke: none;
  animation: liveCurrent 3.7s steps(2, end) infinite;
}

.bolt-shadow {
  fill: url(#namePattern);
  stroke: none;
  opacity: .42;
  filter: blur(7px);
}

.bolt-halo {
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 176, 0, .2), rgba(122, 60, 0, .06) 44%, transparent 72%);
  filter: blur(18px);
  animation: breathe 4s ease-in-out infinite;
}

.bolt-button:hover .bolt,
.bolt-button:focus-visible .bolt {
  filter: drop-shadow(0 0 16px #ffd27a) drop-shadow(0 0 38px #d66b00);
}

.identity {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin: 0;
  color: inherit;
  text-decoration: none;
  text-shadow: 0 0 13px rgba(255, 176, 0, .6);
}

.identity:hover,
.identity:focus-visible {
  color: var(--amber-bright);
  outline: none;
  text-shadow: 0 0 18px rgba(255, 176, 0, .9);
}

.identity h1 {
  margin: 0;
  font-size: clamp(1.15rem, 4vw, 2.7rem);
  line-height: 1;
  letter-spacing: .14em;
  text-transform: lowercase;
}

.prompt {
  margin-right: .65rem;
  color: #ffd27a;
  font-size: clamp(.9rem, 2vw, 1.4rem);
}

.cursor {
  width: clamp(.55rem, 1.2vw, .9rem);
  height: clamp(1.1rem, 3.6vw, 2.3rem);
  margin-left: .45rem;
  background: var(--amber);
  box-shadow: 0 0 .9rem var(--amber);
  animation: cursorBlink 1.05s steps(1, end) infinite;
}

footer {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: clamp(1.15rem, 3vw, 2.15rem);
  left: 0;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
}

.flash {
  z-index: 100;
  opacity: 0;
  background: #fff0bf;
  mix-blend-mode: screen;
}

body.surging .flash { animation: screenFlash .48s steps(2, end); }
body.surging .bolt { animation: strike .52s steps(2, end); }
body.surging .bolt-halo { animation: surgeHalo .58s ease-out; }

@keyframes cursorBlink { 50% { opacity: 0; } }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .68; } }
@keyframes liveCurrent {
  0%, 89%, 100% { opacity: .92; }
  90% { opacity: .35; transform: translateX(-1px); }
  92% { opacity: 1; transform: translateX(1px); }
  94% { opacity: .58; }
}
@keyframes screenFlash {
  0%, 100% { opacity: 0; }
  10% { opacity: .14; }
  22% { opacity: 0; }
  35% { opacity: .08; }
}
@keyframes strike {
  0%, 100% { transform: translate(0, 0) scale(1); }
  18% { transform: translate(-2px, 1px) scale(1.025); filter: drop-shadow(0 0 26px #ffe1a0) drop-shadow(0 0 56px #ff9a00); }
  36% { transform: translate(2px, -1px) scale(.995); }
  52% { transform: translate(-1px, 0) scale(1.015); filter: drop-shadow(0 0 36px white) drop-shadow(0 0 70px #ff9a00); }
}
@keyframes surgeHalo {
  0% { opacity: .5; transform: scale(.9); }
  35% { opacity: 1; transform: scale(1.32); }
  100% { opacity: .4; transform: scale(1); }
}

@media (max-width: 520px) {
  main { padding: 1.5rem 1rem 6rem; }
  .bolt-button {
    width: min(64vw, 17.25rem);
    height: min(68svh, 35rem);
    min-height: 0;
  }
  .prompt { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .flash { display: none; }
}
