:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: #030404;
}

.mono-page {
  min-height: 100vh;
  min-height: 100lvh;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 46%, #141715 0%, #080a09 52%, #030404 100%);
}

.mono-main {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.flow-layer {
  position: fixed;
  inset: -18vh -18vw;
  inset: -18lvh -18vw;
  pointer-events: none;
  background-image: url("../img/recohere-e.png");
  background-repeat: repeat;
}

.flow-bed {
  opacity: 0.032;
  background-size: 8px 7px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 8%, rgba(0, 0, 0, 0.84) 48%, transparent 96%);
  mask-image: radial-gradient(ellipse at center, #000 8%, rgba(0, 0, 0, 0.84) 48%, transparent 96%);
}

.flow-current {
  will-change: transform;
}

.flow-current-a {
  opacity: 0.055;
  background-size: 12px 10.4px;
  animation: flow-current-a 26s linear infinite alternate;
  -webkit-mask-image: radial-gradient(ellipse 43% 34% at 28% 38%, #000 0%, rgba(0, 0, 0, 0.78) 52%, transparent 100%);
  mask-image: radial-gradient(ellipse 43% 34% at 28% 38%, #000 0%, rgba(0, 0, 0, 0.78) 52%, transparent 100%);
}

.flow-current-b {
  opacity: 0.04;
  background-size: 16px 13.9px;
  animation: flow-current-b 34s linear infinite alternate;
  -webkit-mask-image: radial-gradient(ellipse 46% 38% at 72% 60%, #000 0%, rgba(0, 0, 0, 0.72) 50%, transparent 100%);
  mask-image: radial-gradient(ellipse 46% 38% at 72% 60%, #000 0%, rgba(0, 0, 0, 0.72) 50%, transparent 100%);
}

@keyframes flow-current-a {
  0% { transform: translate3d(-28px, -12px, 0); }
  100% { transform: translate3d(36px, 16px, 0); }
}

@keyframes flow-current-b {
  0% { transform: translate3d(30px, 18px, 0); }
  100% { transform: translate3d(-34px, -18px, 0); }
}

.statement-stack {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: flex;
  width: min(860px, 86vw);
  align-items: center;
  flex-direction: column;
  transform: translate(-50%, -50%);
  text-align: center;
}

.glitch-mark {
  position: relative;
  width: min(620px, 72vw);
  margin: 0;
  filter: drop-shadow(0 0 24px rgba(5, 5, 5, 0.96));
}

.glitch-mark img {
  display: block;
  width: 100%;
  height: auto;
}

.glitch-ready .glitch-base {
  animation: glitch-lock 1.32s steps(1, end) both;
}

.glitch-copy,
.glitch-accent {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.glitch-ready .glitch-copy-a {
  animation: glitch-slice-a 1.32s steps(1, end) both;
}

.glitch-ready .glitch-copy-b {
  animation: glitch-slice-b 1.32s steps(1, end) both;
}

.glitch-accent {
  background: #eb5127;
  -webkit-mask: url("../img/recohere_white.svg") center / 100% 100% no-repeat;
  mask: url("../img/recohere_white.svg") center / 100% 100% no-repeat;
}

.glitch-ready .glitch-accent {
  animation: glitch-accent 1.32s steps(1, end) both;
}

.glitch-mark::after {
  position: absolute;
  right: -2%;
  left: -2%;
  top: 0;
  height: 1px;
  content: "";
  opacity: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.18);
}

.glitch-mark.glitch-ready::after {
  animation: glitch-scan 1.08s ease-out 0.08s both;
}

@keyframes glitch-lock {
  0%, 3% { opacity: 1; transform: translateX(0); filter: none; }
  4% { opacity: 0.36; transform: translateX(-7px); filter: blur(0.6px); }
  7% { opacity: 1; transform: translateX(4px); filter: none; }
  10% { opacity: 0.68; transform: translateX(-2px); }
  14%, 22% { opacity: 1; transform: translateX(0); }
  23% { opacity: 0.82; transform: translateX(2px); }
  27%, 100% { opacity: 1; transform: translateX(0); filter: none; }
}

@keyframes glitch-slice-a {
  0%, 5%, 9%, 15%, 20%, 27%, 100% { opacity: 0; }
  6% { opacity: 0.82; clip-path: inset(7% 0 73% 0); transform: translateX(15px); }
  10% { opacity: 0.68; clip-path: inset(42% 0 36% 0); transform: translateX(-11px); }
  16% { opacity: 0.5; clip-path: inset(71% 0 11% 0); transform: translateX(8px); }
  21% { opacity: 0.34; clip-path: inset(31% 0 57% 0); transform: translateX(-5px); }
}

@keyframes glitch-slice-b {
  0%, 7%, 12%, 18%, 25%, 100% { opacity: 0; }
  8% { opacity: 0.52; clip-path: inset(24% 0 61% 0); transform: translateX(-18px); }
  13% { opacity: 0.72; clip-path: inset(58% 0 19% 0); transform: translateX(13px); }
  19% { opacity: 0.42; clip-path: inset(46% 0 45% 0); transform: translateX(-7px); }
}

@keyframes glitch-accent {
  0%, 10%, 12%, 22%, 24%, 100% { opacity: 0; }
  11% { opacity: 0.72; clip-path: inset(47% 0 39% 0); transform: translateX(17px); }
  23% { opacity: 0.38; clip-path: inset(18% 0 70% 0); transform: translateX(-9px); }
}

@keyframes glitch-scan {
  0%, 100% { top: 0; opacity: 0; }
  9% { opacity: 0.38; }
  66% { opacity: 0.12; }
  82% { top: 100%; opacity: 0; }
}

.statement-copy {
  max-width: 760px;
  margin: 34px 0 0;
  color: rgba(243, 242, 238, 0.62);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(14px, 1.05vw, 17px);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.34;
  text-wrap: balance;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.8);
}

.statement-emphasis {
  color: rgba(235, 81, 39, 0.84);
}

.statement-email {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: clamp(24px, 4vh, 52px);
  bottom: max(clamp(24px, 4vh, 52px), calc(env(safe-area-inset-bottom) + 12px));
  color: rgba(243, 242, 238, 0.36);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.035em;
  line-height: 1;
  text-decoration: none;
  transform: translateX(-50%);
  transition: color 180ms ease;
}

.statement-copyright {
  position: absolute;
  z-index: 4;
  left: clamp(24px, 4vw, 56px);
  bottom: clamp(24px, 4vh, 52px);
  bottom: max(clamp(24px, 4vh, 52px), calc(env(safe-area-inset-bottom) + 12px));
  color: rgba(243, 242, 238, 0.26);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.025em;
  line-height: 1;
}

.statement-email:hover,
.statement-email:focus-visible {
  color: rgba(235, 81, 39, 0.82);
}

@media (max-width: 680px) {
  .statement-stack {
    width: 88vw;
  }

  .glitch-mark {
    width: 72vw;
  }

  .statement-copy {
    max-width: 86vw;
    margin-top: 24px;
    font-size: clamp(13px, 3.7vw, 15px);
    letter-spacing: -0.014em;
  }

  .statement-email {
    bottom: 24px;
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
    font-size: 11px;
  }

  .statement-copyright {
    left: 50%;
    bottom: 52px;
    bottom: max(52px, calc(env(safe-area-inset-bottom) + 40px));
    width: 100%;
    font-size: 9px;
    text-align: center;
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-layer,
  .glitch-ready .glitch-base,
  .glitch-ready .glitch-copy,
  .glitch-ready .glitch-accent,
  .glitch-mark.glitch-ready::after {
    animation: none;
  }
}

.error-main {
  display: grid;
  place-content: center;
  justify-items: center;
  color: rgba(243, 242, 238, 0.62);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-align: center;
}

.error-home,
.error-code,
.error-copy {
  position: relative;
  z-index: 2;
}

.error-home {
  display: block;
  width: min(320px, 68vw);
}

.error-home img {
  display: block;
  width: 100%;
  height: auto;
}

.error-code {
  margin: 42px 0 0;
  color: rgba(235, 81, 39, 0.74);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.error-copy {
  margin: 10px 0 0;
  font-size: 14px;
  letter-spacing: -0.012em;
}
