@import url(https://fonts.googleapis.com/css?family=Share+Tech+Mono);

.image-replacement {
  text-indent: 100%;
  white-space: nowrap;
  overflow: hidden;
}

textarea {
  width: 100%;
  background: linear-gradient(180deg, rgba(0, 12, 0, 0.92), rgba(0, 6, 0, 0.95));
  color: #8bff94;
  border: 2px solid rgba(90, 255, 120, 0.72);
  padding: 12px;
  line-height: 1.35;
  font-family: "Share Tech Mono", monospace;
  resize: none;
  text-transform: none;
  display: block;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
  text-shadow: 0 0 5px rgba(120, 255, 150, 0.85), 0 0 10px rgba(70, 220, 100, 0.35);
  box-shadow: inset 0 0 24px rgba(40, 255, 80, 0.08), 0 0 18px rgba(70, 220, 100, 0.22);
  animation: phosphorPulse 4.6s ease-in-out infinite;
  user-select: text;
  font-size: 11px;
  line-height: 1.2;
}

span.amp {
  font-family: Baskerville, "Goudy Old Style", Palatino, "Book Antiqua", serif !important;
  font-style: italic;
}

body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='30' viewBox='0 0 22 30'%3E%3Cpath d='M2 2V27L8 21L11 29L14 27L11 19H20V2Z' fill='%23ffffff' stroke='%23000000' stroke-width='1.2'/%3E%3Cpath d='M4 4V22L8 18L10.4 25L11.7 24.2L9.6 17H17V4Z' fill='%23cfd6db'/%3E%3Cpath d='M6 24L8 22L11 29L14 27L11 19H13' fill='none' stroke='%23000000' stroke-width='1' opacity='0.58'/%3E%3C/svg%3E") 2 2, auto;
}

body * {
  cursor: inherit !important;
}

body {
  color: #db0e15;
  font-family: "Share Tech Mono", monospace;
  font-size: 26px;
  font-weight: 300;
  text-shadow: 0 0 5px rgba(219, 14, 21, 0.8);
  background: url(https://image.ibb.co/h2hLAJ/bg.png) #000;
  position: relative;
  height: 100vh;
  animation: crtHueShift 11s ease-in-out infinite;
}

.container {
  left: 0;
  right: 0;
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 0 16px;
  box-sizing: border-box;
  z-index: 3;
}

.screen {
  width: min(1280px, 99vw);
}

.container.is-success {
  filter: hue-rotate(180deg) brightness(2.7);
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0) 48%, rgba(0, 0, 0, 0.3) 73%, rgba(0, 0, 0, 0.62) 100%);
  opacity: 0.78;
  animation: vignettePulse 7.8s ease-in-out infinite;
}

.screen {
  position: relative;
  filter: drop-shadow(0 0 8px rgba(255, 20, 40, 0.6));
  animation: screenGlitch 9s steps(1, end) infinite;
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 0, 0, 0.06) 0px,
    rgba(255, 0, 0, 0.02) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: screen;
  animation: signalRoll 5.5s linear infinite;
}

.title {
  text-transform: uppercase;
  text-align: center;
  font-size: 0.72em;
  font-weight: 300;
  animation: titleGlitch 6s steps(1, end) infinite;
  margin: 0 0 6px;
}

.title::after,
.title::before {
  display: none;
}

.container:not(.is-success) .title.is-success {
  color: #22edfc;
}

.box--outer {
  position: relative;
  margin: 0 auto;
  width: 96%;
  max-width: 1180px;
  border-top: #000 8px solid;
  border-bottom: #000 8px solid;
  border-image: url(https://image.ibb.co/kHHeny/hor_line.png) 17 11 17 round;
}

.box {
  display: inline-block;
  text-transform: uppercase;
  text-align: center;
  width: 100%;
  max-width: 1180px;
}

.box--inner {
  display: inline-block;
  width: calc(100% - 105px);
  max-width: 1110px;
}

.box--inner::after,
.box--inner::before {
  content: "";
  display: inline-block;
  background: url(https://image.ibb.co/kvJfud/box_inner.png) no-repeat center;
  max-width: 642px;
  width: 100%;
  height: 27px;
}

.content {
  position: relative;
  display: block;
  max-height: none;
  min-height: 0;
  height: 100%;
}

.content .holder {
  width: min(1040px, 96vw);
  margin: 0 auto;
  position: relative;
}

.col.col__center,
.col.col__left {
  display: inline-block;
}

.col.col__left {
  width: 130px;
}

.col.col__center {
  width: min(1040px, 96vw);
  margin-right: 0;
}

.key-block {
  position: relative;
  width: min(98ch, 100%);
  margin: 0 auto;
  padding-top: 24px;
  border: 1px solid rgba(255, 120, 130, 0.34);
  border-radius: 10px;
  background: rgba(20, 0, 5, 0.28);
  box-shadow: inset 0 0 10px rgba(255, 70, 90, 0.12), 0 0 10px rgba(255, 30, 50, 0.16);
  animation: keyBlockGlow 3.4s ease-in-out infinite, keyBlockTwitch 8.6s steps(1, end) infinite;
}

.key-block textarea {
  width: calc(100% - 20px);
  margin: 0 auto;
  border-radius: 7px;
}

.pgp-main-block textarea {
  width: calc(100% - 12px);
  max-width: none;
  height: 90px;
  overflow: auto;
}

.pgp-main-block {
  width: min(62ch, 100%);
  padding-top: 20px;
}

.ssh-label-line {
  margin-top: 14px;
}

.ssh-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.ssh-key-block {
  margin-top: 10px;
  margin-bottom: 0;
  width: 100%;
  padding-top: 52px;
}

.ssh-key-block .tool-btn {
  position: absolute;
  top: 18px;
  right: 8px;
  z-index: 4;
}

.ssh-key-title {
  margin: 0;
  font-size: 0.58em;
  text-align: left;
}

.ssh-key-block textarea {
  font-size: 0.52em;
  line-height: 1.3;
  min-height: 52px;
  max-height: 52px;
  overflow: auto;
  overflow-wrap: anywhere;
}

.key-block::before {
  content: "█";
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 28px;
  line-height: 1;
  color: rgba(130, 255, 150, 0.92);
  text-shadow: 0 0 8px rgba(130, 255, 150, 0.95), 0 0 16px rgba(70, 220, 100, 0.65);
  opacity: 0;
  pointer-events: none;
}

.key-block.is-typing::before {
  opacity: 1;
  animation: blockCaretBlink 0.5s steps(1, end) infinite;
}

.key-block::after {
  content: "";
  position: absolute;
  inset: 30px 0 0 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(120, 255, 150, 0.03), rgba(120, 255, 150, 0.01));
  mix-blend-mode: screen;
  animation: matrixFlicker 2.8s steps(2, end) infinite;
}

.pgp-main-block {
  animation: keyBlockGlow 3.4s ease-in-out infinite, keyBlockTwitch 8.6s steps(1, end) infinite, pgpShellPulse 5.3s ease-in-out infinite;
}

.pgp-main-block.is-switching::after {
  animation: pgpSwitchGlitch 240ms steps(2, end) 1;
}

.pgp-main-block textarea {
  box-shadow: inset 0 0 24px rgba(70, 255, 120, 0.16), 0 0 20px rgba(70, 255, 120, 0.2);
  animation: phosphorPulse 4.6s ease-in-out infinite, greenTubeGlow 3.1s ease-in-out infinite;
  background:
    linear-gradient(180deg, rgba(0, 10, 0, 0.78), rgba(0, 6, 0, 0.9)),
    url("./assets/pgpBlock-loop-691x408-still.webp") 50% 50% / cover no-repeat;
  background-blend-mode: multiply, normal;
  filter: blur(0.35px) saturate(0.96);
}

.pgp-main-block.is-switching textarea {
  animation: phosphorPulse 4.6s ease-in-out infinite, greenTubeGlow 3.1s ease-in-out infinite, pgpSwitchJitter 240ms steps(2, end) 1;
}

.pgp-main-block textarea.is-active-gif {
  background:
    linear-gradient(180deg, rgba(0, 10, 0, 0.78), rgba(0, 6, 0, 0.9)),
    url("./assets/pgpBlock-loop-691x408.webp") 50% 50% / cover no-repeat;
  background-blend-mode: multiply, normal;
  filter: blur(0.35px) saturate(0.96);
}

.tool-btn {
  border: 1px solid rgba(215, 0, 30, 0.8);
  background: rgba(0, 0, 0, 0.8);
  color: #ff8388;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.62em;
  text-transform: uppercase;
  padding: 4px 8px;
  cursor: pointer;
}

.copy-btn {
  background: #d7001e;
  color: #fff2f2;
  border-color: #ff5060;
  font-size: 0.68em;
  box-shadow: 0 0 8px rgba(215, 0, 30, 0.8);
  animation: copyPulse 2.2s ease-in-out infinite;
}

.tool-btn:hover {
  color: #ffd2d4;
  border-color: #ff8388;
}

#copyKeyBtn {
  position: absolute;
  top: -2px;
  right: 8px;
  z-index: 4;
}

.status-line {
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 2px;
}

.status-subline {
  margin: 0 0 6px;
  text-align: center;
  text-transform: uppercase;
  font-size: 0.58em;
  letter-spacing: 1px;
  color: #ff9aa1;
  opacity: 0.95;
}

.side-guide {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: min(270px, 25vw);
  border: 1px solid rgba(215, 0, 30, 0.46);
  border-radius: 8px;
  background: rgba(12, 0, 4, 0.56);
  color: #ff9aa1;
  text-transform: none;
  z-index: 2;
  box-shadow: 0 0 8px rgba(255, 45, 65, 0.2);
  animation: panelHum 3.6s ease-in-out infinite;
}

.side-guide pre {
  margin: 0;
  padding: 12px;
  font-size: 0.56em;
  line-height: 1.28;
  white-space: pre;
  word-break: normal;
  font-family: "Share Tech Mono", monospace;
}

.type-target::after {
  content: "_";
  color: #ff7078;
  animation: caretBlink 0.7s steps(1, end) infinite;
}

.type-target {
  opacity: 1;
  transition: opacity 220ms ease, filter 220ms ease;
}

.type-target.story-fade-out {
  opacity: 0;
  filter: blur(1px);
}

.side-guide-left {
  left: max(-72px, calc(50% - 790px));
}

.side-guide-right {
  right: max(-72px, calc(50% - 790px));
}

.side-guide-left pre {
  text-align: left;
}

.side-guide-right pre {
  text-align: left;
}

.label-line {
  text-transform: uppercase;
  margin: 0 0 6px;
}

.meta-line {
  font-size: 0.7em;
  text-transform: uppercase;
  opacity: 0.9;
  margin: 10px 0 0;
  text-align: center;
}

#pgpMetaLine {
  font-size: 0.76em;
  color: #9affac;
  text-shadow: 0 0 6px rgba(150, 255, 170, 0.8), 0 0 14px rgba(90, 255, 130, 0.55);
  letter-spacing: 0.4px;
  animation: metaGlowPulse 2.9s ease-in-out infinite;
}

#pgpMetaLine .expires-tag,
#pgpMetaLine .expires-date,
#pgpMetaLine .expires-countdown {
  color: #83ffa6;
  text-shadow: 0 0 8px rgba(140, 255, 170, 0.95), 0 0 16px rgba(70, 255, 120, 0.55);
}

#pgpMetaLine .expires-tag {
  font-size: 1.24em;
  letter-spacing: 0.7px;
}

#pgpMetaLine .expires-countdown {
  font-size: 1.16em;
  animation: countdownPulse 1.4s steps(1, end) infinite;
}

.ssh-meta-line {
  margin-top: 6px;
  font-size: 0.58em;
  text-transform: none;
}

.meta-actions {
  margin: 6px 0 0;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.copy-fp-btn {
  background: rgba(0, 0, 0, 0.88);
  color: #ffbfc5;
  border-color: #ff6a76;
  font-size: 0.56em;
  padding: 4px 8px;
}

.tools-line {
  font-size: 0.58em;
  text-align: center;
  margin: 4px 0 0;
  text-transform: none;
}

.story-strip,
.story-feed {
  display: none;
}

.tools-line a {
  color: #ff8388;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 131, 136, 0.7);
}

.tool-link-btn {
  color: #ff8388;
  background: transparent;
  border: 0;
  border-bottom: 1px dotted rgba(255, 131, 136, 0.7);
  font-family: "Share Tech Mono", monospace;
  font-size: 1em;
  padding: 0;
  cursor: pointer;
  text-transform: none;
}

.tools-line a:hover {
  color: #ffd2d4;
}

.tool-link-btn:hover {
  color: #ffd2d4;
}

.row {
  display: flex;
  justify-content: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 8;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-panel {
  width: min(920px, 95vw);
  max-height: 82vh;
  overflow: auto;
  border: 2px solid rgba(215, 0, 30, 0.8);
  background: rgba(0, 0, 0, 0.92);
  color: #ffd2d4;
  padding: 12px;
  box-shadow: 0 0 14px rgba(215, 0, 30, 0.28);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal-header p {
  margin: 0;
  font-size: 0.7em;
}

.modal-panel pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.58em;
  line-height: 1.4;
  text-transform: none;
}

.modal-stack {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
}

.modal-text {
  text-align: left;
  padding-right: 0;
  border-right: 0;
}

.modal-top,
.modal-bottom {
  width: 100%;
}

.modal-bottom {
  border: 1px solid rgba(255, 131, 136, 0.35);
  padding: 10px;
  box-sizing: border-box;
  margin-top: 4px;
}

.mermaid-flow {
  text-transform: none;
  font-size: 0.68em;
  min-height: 440px;
  border: 1px solid rgba(255, 131, 136, 0.45);
  padding: 10px 10px 36px;
  overflow: visible;
  box-sizing: border-box;
  margin-bottom: 8px;
}

.mermaid-flow svg {
  width: 100%;
  max-width: 100%;
  height: auto !important;
  min-height: 394px;
  margin-bottom: 24px;
  display: block;
  overflow: visible;
}

.modal-section-title {
  margin: 0 0 6px;
  font-size: 0.72em;
  text-transform: uppercase;
  color: #ff8388;
}

.modal-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 131, 136, 0.75), transparent);
}

@media only screen and (max-width: 900px) {
  .mermaid-flow {
    min-height: 260px;
    font-size: 0.7em;
  }
}

@media only screen and (max-width: 1260px) {
  .col.col__center,
  .col.col__left {
    display: block;
    width: auto;
    margin: 0;
  }

  .box--outer::after,
  .box--outer::before {
    display: none;
  }

  .content {
    height: auto;
  }

  .side-guide {
    width: min(190px, 20vw);
  }

  .side-guide-left {
    left: -56px;
  }

  .side-guide-right {
    right: -56px;
  }
}

@media only screen and (max-width: 600px) {
  html,
  body {
    height: auto;
    min-height: 100%;
  }

  body {
    overflow: auto;
    font-size: 18px;
  }

  .container {
    position: relative;
    top: auto;
    transform: none;
    min-height: unset;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 0 18px;
  }

  .screen {
    order: 1;
    width: 100%;
  }

  .content {
    min-height: 0;
    max-height: none;
    height: auto;
  }

  .content .holder {
    position: relative;
    top: auto;
    transform: none;
    width: min(95vw, 760px);
  }

  .key-block {
    width: 100%;
  }

  .ssh-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  textarea {
    font-size: 10px;
    line-height: 1.2;
    padding: 8px;
  }

  #copyKeyBtn {
    top: -4px;
    right: 6px;
    font-size: 0.7em;
    padding: 6px 10px;
  }

  .meta-actions .tool-btn {
    min-height: 38px;
    padding: 7px 12px;
    font-size: 0.72em;
  }

  .ssh-key-block .tool-btn {
    top: 16px;
    right: 6px;
    font-size: 0.66em;
    padding: 5px 8px;
  }

  .tools-line {
    font-size: 0.7em;
    line-height: 1.5;
    padding: 0 6px;
    word-break: break-word;
  }

  .title::after,
  .title::before {
    width: 4%;
    height: 18px;
  }

  .box--outer {
    border-image: url(https://image.ibb.co/kHHeny/hor_line.png) 17 330 17 round;
  }

  .box--inner {
    width: calc(100% - 44px);
  }

  .screen::after {
    max-width: none;
  }

  .side-guide {
    display: block;
    position: static;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
    width: min(92vw, 520px);
    margin: 6px auto 0;
    z-index: 3;
  }

  .side-guide-left {
    order: 2;
  }

  .side-guide-right {
    order: 3;
  }

  .side-guide pre {
    font-size: 0.58em;
    line-height: 1.3;
    padding: 10px;
  }

  .container.on > .screen {
    animation: crtSnap 1.1s cubic-bezier(0.2, 0.9, 0.18, 1), turn-on 1s ease-out 0.55s, screenGlitch 9s steps(1, end) 1.8s infinite;
    animation-fill-mode: forwards, forwards, none;
  }

  .container.on > .screen::before {
    animation: bootScanTwitch 1.7s steps(1, end), signalRoll 5.5s linear 1.7s infinite;
  }

  .container.on > .screen::after {
    animation: bootVignetteTwitch 1.35s steps(1, end) 0.25s, vignettePulse 7.8s ease-in-out 1.6s infinite;
  }

  .container.on > .side-guide {
    animation: sidePanelSnapMobile 1.25s cubic-bezier(0.2, 0.9, 0.18, 1), panelHum 3.6s ease-in-out 1.25s infinite;
    animation-fill-mode: forwards, none;
  }

  .pgp-main-block textarea {
    width: calc(100% - 12px);
    height: 76px;
  }

  .meta-line,
  .ssh-meta-line {
    font-size: 0.56em;
    line-height: 1.45;
    padding: 0 6px;
  }
}

@media (max-height: 900px) {
  body {
    font-size: 21px;
  }

  .title {
    font-size: 0.65em;
    margin-bottom: 4px;
  }

  .content {
    max-height: none;
    min-height: 0;
  }

  .pgp-main-block textarea {
    height: 68px;
  }

  .ssh-key-block textarea {
    min-height: 46px;
    max-height: 46px;
  }

  .meta-line,
  .ssh-meta-line {
    font-size: 0.5em;
  }

  .tools-line {
    font-size: 0.52em;
  }

  .side-guide pre {
    font-size: 0.5em;
    line-height: 1.22;
    padding: 8px;
  }
}

@media (pointer: coarse) {
  html,
  body,
  body * {
    cursor: auto !important;
  }

  .crt-cursor {
    display: none;
  }
}

.flash {
  animation: flashText 1s ease-out alternate infinite;
}

@keyframes flashText {
  0% {
    opacity: 0.3;
  }
  100% {
    opacity: 1;
  }
}

.typewriter .typewriter-line {
  visibility: hidden;
}

@keyframes flicker {
  0% {
    opacity: 0.86139;
  }
  5% {
    opacity: 0.12793;
  }
  10% {
    opacity: 0.36759;
  }
  15% {
    opacity: 0.9766;
  }
  20% {
    opacity: 0.61364;
  }
  25% {
    opacity: 0.94477;
  }
  30% {
    opacity: 0.57811;
  }
  35% {
    opacity: 0.03416;
  }
  40% {
    opacity: 0.21835;
  }
  45% {
    opacity: 0.62054;
  }
  50% {
    opacity: 0.89452;
  }
  55% {
    opacity: 0.89997;
  }
  60% {
    opacity: 0.37872;
  }
  65% {
    opacity: 0.04929;
  }
  70% {
    opacity: 0.14477;
  }
  75% {
    opacity: 0.27512;
  }
  80% {
    opacity: 0.84701;
  }
  85% {
    opacity: 0.85952;
  }
  90% {
    opacity: 0.76553;
  }
  95% {
    opacity: 0.91372;
  }
  100% {
    opacity: 0.05536;
  }
}

@keyframes steady {
  from {
    background: rgba(255, 230, 230, 0.1);
  }
  to {
    background: rgba(49, 45, 45, 0.1);
  }
}

body {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

body::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(49, 45, 45, 0.045);
  opacity: 0;
  animation: steady 4s, flicker 0.35s steps(2, end) infinite 1.1s;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
  opacity: 0;
  animation: staticTwitch 4.8s steps(1, end) infinite;
}

.crt-cursor {
  position: fixed;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 148, 158, 0.95);
  border-radius: 3px;
  background: rgba(46, 8, 12, 0.26);
  box-shadow: 0 0 10px rgba(255, 120, 130, 0.72), 0 0 16px rgba(255, 50, 70, 0.35);
  mix-blend-mode: screen;
  animation: keysCursorPulse 1.1s ease-in-out infinite;
}

.crt-cursor::before {
  content: "";
  position: absolute;
  inset: 4px;
  background:
    linear-gradient(rgba(255, 173, 182, 0.96), rgba(255, 173, 182, 0.96)) center / 1px 100% no-repeat,
    linear-gradient(rgba(255, 173, 182, 0.96), rgba(255, 173, 182, 0.96)) center / 100% 1px no-repeat;
}

.crt-cursor::after {
  content: "";
  position: absolute;
  left: -7px;
  top: -7px;
  width: 32px;
  height: 32px;
  border: 1px dashed rgba(255, 147, 160, 0.44);
  border-radius: 50%;
}

@keyframes keysCursorPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.96; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.82; }
}

@keyframes copyPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(215, 0, 30, 0.8); }
  50% { box-shadow: 0 0 14px rgba(255, 80, 96, 0.95); }
}

@keyframes phosphorPulse {
  0%, 100% { filter: brightness(1) contrast(1); }
  50% { filter: brightness(1.08) contrast(1.06); }
}

@keyframes greenTubeGlow {
  0%, 100% { box-shadow: inset 0 0 20px rgba(70, 255, 120, 0.12), 0 0 16px rgba(70, 255, 120, 0.15); }
  50% { box-shadow: inset 0 0 28px rgba(120, 255, 160, 0.2), 0 0 24px rgba(120, 255, 160, 0.3); }
}

@keyframes matrixFlicker {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.25; }
}

@keyframes staticTwitch {
  0%, 58%, 100% { opacity: 0; transform: translate(0, 0); }
  59% { opacity: 0.1; transform: translate(0.4px, -0.3px); }
  60% { opacity: 0.04; transform: translate(-0.35px, 0.3px); }
  61% { opacity: 0; transform: translate(0, 0); }
  82% { opacity: 0.14; transform: translate(-0.45px, -0.2px); }
  83% { opacity: 0.08; transform: translate(0.55px, 0.35px); }
  84% { opacity: 0; transform: translate(0, 0); }
}

@keyframes titleGlitch {
  0%, 92%, 100% { transform: translate(0, 0); text-shadow: 0 0 5px rgba(219, 14, 21, 0.8); }
  93% { transform: translate(0.8px, 0); text-shadow: -1px 0 rgba(0, 255, 255, 0.3), 1px 0 rgba(255, 0, 0, 0.5); }
  94% { transform: translate(-0.8px, 0.2px); text-shadow: 1px 0 rgba(0, 255, 255, 0.35), -1px 0 rgba(255, 0, 0, 0.6); }
  95% { transform: translate(0, 0); text-shadow: 0 0 5px rgba(219, 14, 21, 0.8); }
}

@keyframes crtHueShift {
  0%, 100% { filter: saturate(1) brightness(1); }
  50% { filter: saturate(1.05) brightness(1.02); }
}

@keyframes signalRoll {
  0% { transform: translateY(-3px); opacity: 0.25; }
  50% { transform: translateY(2px); opacity: 0.12; }
  100% { transform: translateY(-3px); opacity: 0.25; }
}

@keyframes panelHum {
  0%, 100% { box-shadow: 0 0 10px rgba(215, 0, 30, 0.25); }
  50% { box-shadow: 0 0 16px rgba(255, 55, 70, 0.4); }
}

@keyframes pgpShellPulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(120, 255, 170, 0.14)); }
  50% { filter: drop-shadow(0 0 10px rgba(130, 255, 175, 0.3)); }
}

@keyframes pgpSwitchGlitch {
  0% {
    opacity: 0.3;
    transform: translateX(-1px);
    background-position: 0 0;
  }
  50% {
    opacity: 0.72;
    transform: translateX(1px);
    background-position: 0 2px;
  }
  100% {
    opacity: 0.55;
    transform: translateX(0);
    background-position: 0 0;
  }
}

@keyframes pgpSwitchJitter {
  0% {
    transform: translate(0, 0);
    filter: brightness(1.05) contrast(1.08) saturate(1.1);
  }
  33% {
    transform: translate(0.8px, -0.4px);
    filter: brightness(1.14) contrast(1.2) saturate(1.2);
  }
  66% {
    transform: translate(-0.8px, 0.4px);
    filter: brightness(0.97) contrast(1.12) saturate(1.12);
  }
  100% {
    transform: translate(0, 0);
    filter: brightness(1.02) contrast(1.05) saturate(1.08);
  }
}

@keyframes metaGlowPulse {
  0%, 100% { opacity: 0.93; }
  50% { opacity: 1; }
}

@keyframes countdownPulse {
  0%, 52% { opacity: 1; }
  53%, 100% { opacity: 0.75; }
}

@keyframes vignettePulse {
  0%, 100% { opacity: 0.74; }
  50% { opacity: 0.86; }
}

@keyframes bootScanTwitch {
  0% { opacity: 0; transform: translateY(-8px) scaleY(0.02); }
  24% { opacity: 0.7; transform: translateY(2px) scaleY(0.24); }
  40% { opacity: 0.22; transform: translateY(-2px) scaleY(0.7); }
  62% { opacity: 0.58; transform: translateY(1px) scaleY(1.03); }
  78% { opacity: 0.18; transform: translateY(0) scaleY(0.96); }
  100% { opacity: 0.25; transform: translateY(0) scaleY(1); }
}

@keyframes bootVignetteTwitch {
  0% { opacity: 0; transform: scale(1.08); }
  26% { opacity: 0.92; transform: scale(1.02); }
  49% { opacity: 0.44; transform: scale(1.01); }
  67% { opacity: 0.86; transform: scale(1); }
  100% { opacity: 0.78; transform: scale(1); }
}

@keyframes sidePanelSnap {
  0% {
    transform: translateY(-50%) scaleY(0.02);
    opacity: 0;
    filter: brightness(2.2) contrast(1.18);
  }
  26% {
    transform: translateY(-50%) scaleY(0.06);
    opacity: 0.9;
    filter: brightness(2.6) contrast(1.25);
  }
  48% {
    transform: translateY(-50%) scaleY(1.06);
    opacity: 1;
    filter: brightness(1.45) contrast(1.1);
  }
  70% {
    transform: translateY(-50%) scaleY(0.94);
    opacity: 1;
    filter: brightness(1.18) contrast(1.04);
  }
  100% {
    transform: translateY(-50%) scaleY(1);
    opacity: 1;
    filter: brightness(1) contrast(1);
  }
}

@keyframes sidePanelSnapMobile {
  0% {
    transform: scaleY(0.03);
    opacity: 0;
    filter: brightness(2.2) contrast(1.18);
  }
  24% {
    transform: scaleY(0.07);
    opacity: 0.9;
    filter: brightness(2.55) contrast(1.24);
  }
  49% {
    transform: scaleY(1.05);
    opacity: 1;
    filter: brightness(1.4) contrast(1.08);
  }
  72% {
    transform: scaleY(0.95);
    opacity: 1;
    filter: brightness(1.16) contrast(1.03);
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
    filter: brightness(1) contrast(1);
  }
}

@keyframes crtSnap {
  0% {
    transform: scale(1, 0.005);
    opacity: 0;
    filter: brightness(2.1) contrast(1.15);
  }
  18% {
    transform: scale(1, 0.018);
    opacity: 0.95;
    filter: brightness(2.6) contrast(1.22);
  }
  34% {
    transform: scale(1, 0.012);
    opacity: 0.7;
    filter: brightness(2.25) contrast(1.2);
  }
  52% {
    transform: scale(1, 1.08);
    opacity: 1;
    filter: brightness(1.55) contrast(1.1);
  }
  72% {
    transform: scale(1, 0.93);
    opacity: 1;
    filter: brightness(1.2) contrast(1.05);
  }
  100% {
    transform: scale(1, 1);
    opacity: 1;
    filter: brightness(1) contrast(1);
  }
}

@keyframes keyBlockGlow {
  0%, 100% {
    box-shadow: inset 0 0 10px rgba(255, 70, 90, 0.12), 0 0 10px rgba(255, 30, 50, 0.16);
  }
  50% {
    box-shadow: inset 0 0 14px rgba(255, 90, 110, 0.18), 0 0 16px rgba(255, 45, 65, 0.28);
  }
}

@keyframes keyBlockTwitch {
  0%, 95%, 100% {
    transform: translate(0, 0);
  }
  96% {
    transform: translate(0.4px, -0.25px);
  }
  97% {
    transform: translate(-0.35px, 0.2px);
  }
  98% {
    transform: translate(0, 0);
  }
}

@keyframes caretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes blockCaretBlink {
  0%, 54% { opacity: 1; }
  55%, 100% { opacity: 0; }
}

@keyframes screenGlitch {
  0%, 93%, 100% {
    transform: translate(0, 0);
    filter: drop-shadow(0 0 8px rgba(255, 20, 40, 0.6));
  }
  94% {
    transform: translate(0.6px, -0.45px);
    filter: drop-shadow(0 0 12px rgba(255, 40, 60, 0.75));
  }
  95% {
    transform: translate(-0.7px, 0.4px);
    filter: drop-shadow(0 0 9px rgba(255, 20, 40, 0.7));
  }
  96% {
    transform: translate(0.2px, 0);
    filter: drop-shadow(0 0 8px rgba(255, 20, 40, 0.62));
  }
}

body.off {
  background: #000;
}

body.off::after {
  animation: none;
}

@keyframes turn-on {
  0% {
    transform: scale(0.992);
    filter: brightness(0.88) saturate(0.92);
    opacity: 0.3;
  }
  65% {
    transform: scale(1.001);
    filter: brightness(1.02) saturate(1.02);
    opacity: 0.88;
  }
  100% {
    transform: scale(1);
    filter: contrast(1) brightness(1.08) saturate(1.06);
    opacity: 1;
  }
}

@keyframes turn-off {
  0% {
    transform: scale(1, 1.3) translate3d(0, 0, 0);
    filter: brightness(1);
    opacity: 1;
  }
  60% {
    transform: scale(1.3, 0.001) translate3d(0, 0, 0);
    filter: brightness(10);
  }
  100% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: scale(0, 0.0001) translate3d(0, 0, 0);
    filter: brightness(50);
  }
}

.screen {
  width: 100%;
  height: 100%;
  border: none;
}

.container.off > .screen {
  animation: turn-off 0.55s cubic-bezier(0.23, 1, 0.32, 1);
  animation-fill-mode: forwards;
}

.container.on > .screen {
  transform-origin: center;
  animation: crtSnap 0.88s cubic-bezier(0.2, 0.9, 0.18, 1), turn-on 0.85s ease-out 0.48s, screenGlitch 9s steps(1, end) 1.45s infinite;
  animation-fill-mode: forwards, forwards, none;
}

.container.on > .screen::before {
  animation: bootScanTwitch 1.35s steps(1, end), signalRoll 5.5s linear 1.35s infinite;
}

.container.on > .screen::after {
  animation: bootVignetteTwitch 1.1s steps(1, end) 0.2s, vignettePulse 7.8s ease-in-out 1.3s infinite;
}

.container.on > .side-guide {
  transform-origin: center;
  animation: sidePanelSnap 0.92s cubic-bezier(0.2, 0.9, 0.18, 1), panelHum 3.6s ease-in-out 1s infinite;
  animation-fill-mode: forwards, none;
}

/* themed scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #d7001e #090003;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #090003;
  border: 1px solid rgba(215, 0, 30, 0.35);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(#ff2038, #b9001a);
  border: 1px solid #ff6d7c;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(#ff5060, #d7001e);
}

/* Slow rounded CRT power-on */
body.boot-seq .container {
  opacity: 0;
  visibility: hidden;
}

body:not(.boot-seq) .container {
  opacity: 1;
  visibility: visible;
  animation: crtTvTurnOn 900ms linear both;
  transform-origin: center center;
}

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  pointer-events: auto;
  background: radial-gradient(circle at 50% 48%, rgba(14, 0, 6, 0.98), rgba(0, 0, 0, 1));
  transition: opacity 220ms ease;
}

.page-transition::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    linear-gradient(rgba(20, 8, 10, 0) 50%, rgba(0, 0, 0, 0.3) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.07), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06)),
    repeating-linear-gradient(0deg, rgba(255, 105, 132, 0.18) 0 1px, transparent 1px 4px),
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 3px);
  background-size: 100% 2px, 3px 100%, auto, auto;
  opacity: 0.56;
  animation: crtTvNoise 140ms steps(2, end) infinite;
}

.page-transition::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(86vw, 1020px);
  aspect-ratio: 4 / 3;
  transform: translate(-50%, -50%);
  border-radius: 50% 50% 48% 48% / 58% 58% 42% 42%;
  border: 1px solid rgba(255, 164, 188, 0.45);
  background:
    radial-gradient(circle at 50% 52%, rgba(255, 120, 144, 0.36), rgba(255, 78, 118, 0.14) 48%, rgba(0, 0, 0, 0) 76%),
    radial-gradient(circle at 50% 46%, rgba(255, 216, 224, 0.2), rgba(0, 0, 0, 0) 63%);
  box-shadow: inset 0 0 90px rgba(255, 144, 170, 0.22), 0 0 130px rgba(255, 86, 126, 0.18);
  animation: crtTvTurnOnGlow 900ms linear forwards, crtTvFlicker 0.15s infinite;
}

.page-transition-inner {
  position: absolute;
  inset: 0;
}

.page-transition-inner::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(72vw, 840px);
  height: 4px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 220, 228, 0), rgba(255, 220, 228, 1), rgba(255, 220, 228, 0));
  box-shadow: 0 0 28px rgba(255, 220, 228, 0.92), 0 0 64px rgba(255, 118, 152, 0.78);
  animation: crtTvScanline 900ms linear forwards;
}

.page-transition.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

