:root {
  color-scheme: dark;
  --ink: #020410;
  --blue: #397edb;
  --blue-soft: #8eb9ff;
  --red: #ff203c;
  --white: #f4f7ff;
  --muted: #9aafd3;
  --parallax-x: 0px;
  --parallax-y: 0px;
  font-family: "Courier New", ui-monospace, monospace;
  background: var(--ink);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  min-height: 100dvh;
  color: var(--white);
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 6px;
}

.app {
  position: relative;
  min-height: 100dvh;
  isolation: isolate;
  overflow: hidden;
}

.scene,
.scene__image,
.scene__wash,
.grain,
.vignette,
.rain,
.cloud-layer,
.screen-flash {
  position: absolute;
  inset: 0;
}

.scene {
  z-index: -3;
  overflow: hidden;
  background: #010817;
}

.scene::before {
  content: "";
  position: absolute;
  inset: -42px;
  background-image: url("./rean-background.gif");
  background-position: center;
  background-size: cover;
  filter: blur(24px) brightness(0.38) saturate(1.1);
  transform: scale(1.1);
  image-rendering: pixelated;
}

.scene__image {
  inset: -16px;
  background-image: url("./rean-background.gif");
  background-repeat: no-repeat;
  background-position: 65% center;
  background-size: cover;
  image-rendering: pixelated;
  transform: translate3d(var(--parallax-x), var(--parallax-y), 0) scale(1.018);
  transition: filter 800ms ease, opacity 800ms ease;
  will-change: transform;
}

.scene__wash {
  z-index: 3;
  background:
    linear-gradient(90deg, rgba(0, 3, 15, 0.55) 0%, rgba(0, 4, 18, 0.28) 34%, rgba(0, 5, 20, 0.08) 67%, rgba(1, 2, 8, 0.05) 100%),
    linear-gradient(180deg, rgba(1, 5, 20, 0.06), rgba(1, 3, 14, 0.38));
  transition: opacity 800ms ease;
}

.is-locked .scene__image {
  filter: brightness(0.34) saturate(0.7) blur(2px);
}

.is-locked .scene__wash {
  opacity: 0.9;
}

.vignette {
  z-index: 8;
  pointer-events: none;
  background: radial-gradient(circle at 56% 46%, transparent 36%, rgba(0, 0, 0, 0.2) 72%, rgba(0, 0, 0, 0.72) 112%);
}

.grain {
  z-index: 7;
  pointer-events: none;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
  animation: grain-shift 0.28s steps(2) infinite;
}

.cloud-layer {
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.2;
}

.cloud-layer--far {
  animation: cloud-drift 72s linear infinite;
}

.cloud-layer--near {
  opacity: 0.14;
  animation: cloud-drift-reverse 96s linear infinite;
}

.pixel-cloud {
  position: absolute;
  display: block;
  width: 84px;
  height: 18px;
  background: rgba(18, 69, 146, 0.52);
  box-shadow:
    14px -12px 0 rgba(18, 69, 146, 0.52),
    34px -21px 0 rgba(18, 69, 146, 0.52),
    58px -13px 0 rgba(18, 69, 146, 0.52),
    72px 0 0 rgba(18, 69, 146, 0.52),
    -20px 2px 0 rgba(18, 69, 146, 0.52);
  filter: blur(1px);
}

.pixel-cloud--one { top: 15%; left: 10%; transform: scale(1.35); }
.pixel-cloud--two { top: 27%; left: 63%; transform: scale(0.95); }
.pixel-cloud--three { top: 8%; left: 41%; transform: scale(1.7); }

.rain {
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
  transform: skewX(-9deg);
}

.rain__drop {
  position: absolute;
  top: -18vh;
  left: var(--rain-x);
  width: 1px;
  height: var(--rain-length);
  opacity: var(--rain-opacity);
  background: linear-gradient(180deg, rgba(91, 173, 255, 0), rgba(91, 173, 255, 0.9));
  animation: rain-fall var(--rain-duration) linear var(--rain-delay) infinite;
}

.enter-gate {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  width: 100%;
  border: 0;
  padding: 32px;
  color: var(--white);
  background: rgba(0, 2, 12, 0.24);
  text-align: center;
  transition: opacity 700ms ease, visibility 700ms ease;
}

.enter-gate__prompt {
  margin: 0;
  color: #fff8f9;
  font-size: clamp(1.05rem, 2.25vw, 1.55rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.22em;
  text-shadow:
    0 0 8px rgba(255, 32, 60, 0.72),
    0 0 24px rgba(255, 32, 60, 0.36);
  animation: prompt-blink 1.25s steps(2) infinite;
}

.is-entered .enter-gate {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.profile {
  position: absolute;
  z-index: 12;
  inset: 0;
  width: min(520px, calc(100vw - 68px));
  height: max-content;
  margin: auto;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: none;
  filter: none;
  backface-visibility: visible;
  transition: opacity 650ms ease 240ms;
}

.is-entered .profile {
  opacity: 1;
  pointer-events: auto;
}

.profile-content {
  position: relative;
  padding: 6px 0;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72);
}


.profile-content::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -54px -92px -54px;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 5, 19, 0.58), rgba(0, 4, 17, 0.25) 52%, transparent 76%);
}

h1 {
  margin: 0;
  color: #fff8f9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.1rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 0.84;
  letter-spacing: 0.025em;
  text-shadow:
    2px 0 0 #7b0717,
    -1px 0 0 #7b0717,
    0 3px 0 #470412,
    0 0 8px #ff263f,
    0 0 20px rgba(255, 20, 49, 0.6);
}

.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 21px 0 0;
  color: #cad5eb;
  font-size: 0.76rem;
  letter-spacing: 0.025em;
}

.status span {
  width: 6px;
  height: 6px;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: status-pulse 2.1s steps(2) infinite;
}


.typewriter {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: var(--blue-soft);
  font-size: 0.76rem;
  line-height: 1.5;
}

.caret {
  display: inline-block;
  width: 6px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -2px;
  background: var(--red);
  box-shadow: 0 0 5px rgba(255, 27, 53, 0.86);
  animation: caret-blink 0.85s steps(2) infinite;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 30px;
  margin-top: 30px;
}

.profile-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 4px 10px;
  color: #c8d6ef;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  transition: color 140ms ease, transform 140ms ease, text-shadow 140ms ease;
}

.profile-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  shape-rendering: crispEdges;
}

.profile-link:hover {
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 32, 60, 0.55);
  transform: translateY(-1px);
}

.site-footer {
  position: absolute;
  z-index: 13;
  right: 0;
  bottom: clamp(18px, 3.5vh, 34px);
  left: 0;
  display: flex;
  justify-content: center;
  color: #718ab7;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.78);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 800ms ease 520ms, transform 800ms ease 520ms;
}

.is-entered .site-footer {
  opacity: 1;
  transform: translateY(0);
}

.screen-flash {
  z-index: 24;
  pointer-events: none;
  opacity: 0;
  background: rgba(35, 90, 193, 0.16);
}

.is-entered .screen-flash {
  animation: screen-power-on 620ms steps(4) 1;
}

noscript {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  left: 20px;
  padding: 12px;
  color: #fff;
  background: #6d0b1a;
}

.cursor-dot {
  display: none;
}

@media (pointer: fine) {
  html.has-custom-cursor,
  html.has-custom-cursor body,
  html.has-custom-cursor body *,
  html.has-custom-cursor a,
  html.has-custom-cursor button {
    cursor: none !important;
  }

  html.has-custom-cursor .cursor-dot {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    display: block;
    width: 12px;
    height: 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    background: #ff203c;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(-50%, -50%, 0);
    will-change: left, top;
  }

  html.has-custom-cursor .cursor-dot.is-visible {
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .scene__image {
    inset: -12px;
    background-position: 43% center;
    background-size: auto 100%;
    transform: translate3d(var(--parallax-x), var(--parallax-y), 0) scale(1.06);
  }

  .scene__wash {
    background:
      linear-gradient(180deg, rgba(0, 4, 18, 0.18) 0%, rgba(0, 4, 18, 0.4) 34%, rgba(0, 2, 12, 0.82) 100%),
      rgba(0, 5, 20, 0.1);
  }

  .profile {
    width: min(430px, calc(100vw - 36px));
  }

  .profile-content {
    padding: 6px 0;
  }

  .profile-content::after {
    inset: -42px -34px;
    background: radial-gradient(ellipse at 50% 52%, rgba(0, 4, 18, 0.78), rgba(0, 4, 18, 0.44) 56%, transparent 82%);
  }

  h1 {
    font-size: clamp(3.8rem, 18vw, 5rem);
  }
}

@media (max-width: 470px) {
  .profile {
    width: calc(100vw - 30px);
  }

  .profile-content {
    padding: 4px 0;
  }

  .status {
    margin-top: 17px;
    font-size: 0.68rem;
  }


  .typewriter {
    font-size: 0.68rem;
  }

  .profile-links {
    gap: 14px 22px;
    margin-top: 24px;
  }

  .profile-link {
    font-size: 0.7rem;
  }

  .profile-link svg {
    width: 18px;
    height: 18px;
  }

  .site-footer {
    bottom: 15px;
    font-size: 0.6rem;
  }
}

@media (max-height: 650px) and (min-width: 761px) {
  .profile {
    width: min(410px, calc(100vw - 56px));
  }

  h1 {
    font-size: 4.35rem;
  }

  .profile-links {
    margin-top: 18px;
  }
}

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

  .caret {
    display: none;
  }
}

@keyframes rain-fall {
  from { transform: translate3d(0, -20vh, 0); }
  to { transform: translate3d(-7vw, 130vh, 0); }
}

@keyframes cloud-drift {
  from { transform: translateX(-18vw); }
  to { transform: translateX(112vw); }
}

@keyframes cloud-drift-reverse {
  from { transform: translateX(105vw); }
  to { transform: translateX(-85vw); }
}

@keyframes grain-shift {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-2%, 1%, 0); }
  50% { transform: translate3d(1%, -2%, 0); }
  75% { transform: translate3d(2%, 2%, 0); }
  100% { transform: translate3d(-1%, -1%, 0); }
}

@keyframes prompt-blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0.38; }
}

@keyframes caret-blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@keyframes status-pulse {
  0%, 68% { opacity: 1; }
  69%, 100% { opacity: 0.42; }
}

@keyframes screen-power-on {
  0% { opacity: 0; transform: scaleY(0.02); }
  18% { opacity: 0.62; transform: scaleY(0.02); }
  45% { opacity: 0.12; transform: scaleY(1); }
  62% { opacity: 0.38; transform: scaleY(0.14); }
  100% { opacity: 0; transform: scaleY(1); }
}

/* Themed Discord contact popup */
.profile-link--button {
  border: 0;
  background: transparent;
}

.discord-dialog {
  width: min(390px, calc(100vw - 34px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  color: var(--white);
  background: transparent;
}

.discord-dialog::backdrop {
  background: rgba(0, 2, 12, 0.76);
  backdrop-filter: blur(7px) saturate(0.78);
}

.discord-dialog[open] {
  animation: discord-dialog-in 180ms ease-out both;
}

.discord-dialog__content {
  position: relative;
  padding: 42px 34px 32px;
  border: 1px solid rgba(255, 32, 60, 0.72);
  background:
    linear-gradient(135deg, rgba(255, 32, 60, 0.07), transparent 36%),
    linear-gradient(180deg, rgba(5, 14, 37, 0.98), rgba(1, 5, 19, 0.98));
  box-shadow:
    0 0 0 1px rgba(74, 137, 231, 0.18) inset,
    0 0 24px rgba(255, 32, 60, 0.2),
    0 24px 80px rgba(0, 0, 0, 0.68);
  text-align: center;
  clip-path: polygon(0 10px, 10px 10px, 10px 0, calc(100% - 10px) 0, calc(100% - 10px) 10px, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 10px calc(100% - 10px), 0 calc(100% - 10px));
}

.discord-dialog__content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 74px;
  height: 2px;
  background: var(--red);
  box-shadow: 0 0 12px rgba(255, 32, 60, 0.9);
  transform: translateX(-50%);
}

.discord-dialog__close {
  position: absolute;
  top: 13px;
  right: 15px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 0;
  padding: 0;
  color: #8298bd;
  background: transparent;
  font-size: 1.45rem;
  line-height: 1;
  transition: color 140ms ease, text-shadow 140ms ease, transform 140ms ease;
}

.discord-dialog__close:hover {
  color: #fff;
  text-shadow: 0 0 9px var(--red);
  transform: rotate(90deg);
}

.discord-dialog__eyebrow {
  margin: 0 0 14px;
  color: var(--blue-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.discord-dialog__username {
  margin: 0;
  color: #fff8f9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 9vw, 3.15rem);
  line-height: 1;
  letter-spacing: 0.035em;
  text-shadow:
    2px 0 0 #7b0717,
    0 2px 0 #470412,
    0 0 8px rgba(255, 38, 63, 0.84),
    0 0 20px rgba(255, 20, 49, 0.38);
}

.discord-dialog__hint {
  max-width: 29ch;
  margin: 18px auto 0;
  color: #9fb0cf;
  font-size: 0.74rem;
  line-height: 1.6;
}

.discord-dialog__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 206px;
  margin-top: 25px;
  border: 1px solid rgba(74, 137, 231, 0.72);
  padding: 12px 17px;
  color: #d9e5fb;
  background: rgba(11, 29, 62, 0.58);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.52);
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.discord-dialog__copy svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  shape-rendering: crispEdges;
}

.discord-dialog__copy:hover,
.discord-dialog__copy.is-copied {
  border-color: var(--red);
  color: #fff;
  background: rgba(83, 8, 24, 0.46);
  box-shadow: 0 0 14px rgba(255, 32, 60, 0.28), 3px 3px 0 rgba(0, 0, 0, 0.52);
  transform: translateY(-1px);
}

@media (max-width: 470px) {
  .discord-dialog__content {
    padding: 39px 22px 27px;
  }

  .discord-dialog__copy {
    width: 100%;
    min-width: 0;
  }
}

@keyframes discord-dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
