/* ============================================================
   areuhappy — glitch / net-art styling
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #000;
  --fg: #e6e6e6;
  --dim: #7d7d85;
  --red: #ff0040;
  --cyan: #00f0ff;
  --acid: #39ff14;
  --mono: ui-monospace, "SF Mono", Menlo, "Courier New", monospace;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
}
::selection { background: var(--acid); color: #000; }

/* ---------- backdrop ---------- */
.void {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, #050508 0%, #000 75%);
}

/* raw ascii/hex noise, filled by glitch.js */
.noise {
  position: absolute;
  inset: -2%;
  margin: 0;
  font: 12px/14px var(--mono);
  color: #1d1d24;
  white-space: pre;
  overflow: hidden;
  user-select: none;
}
.noise .hot { color: #2c4a2a; }

/* CRT scanlines */
.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.035) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}
/* rolling bright band */
.scanlines::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 18vh;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.04), transparent);
  animation: roll 9s linear infinite;
}
@keyframes roll { from { top: -20vh; } to { top: 110vh; } }

.grain {
  position: absolute;
  inset: 0;
  opacity: .08;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain .4s steps(3) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); }
  33% { transform: translate(-3%,2%); }
  66% { transform: translate(2%,-3%); }
}
.vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 22vmax 6vmax #000;
}
@media (orientation: portrait) {
  /* on tall phones vmax is the height; keep the dark edges off the text */
  .vignette { box-shadow: inset 0 0 30vmin 3vmin #000; }
}

/* random tear bars, positioned by glitch.js during bursts */
.tear {
  position: absolute;
  left: 0; right: 0;
  height: 6px;
  opacity: 0;
  background: linear-gradient(90deg, var(--red), transparent 30%, var(--cyan) 60%, transparent);
  mix-blend-mode: screen;
}
body.burst .tear { opacity: .55; }
body.burst .void { filter: hue-rotate(60deg) contrast(1.3); }

/* ---------- glitch text ---------- */
.glitch {
  position: relative;
  display: inline-block;
  text-shadow: -1px 0 rgba(255,0,64,.6), 1px 0 rgba(0,240,255,.6);
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent;
}
.glitch::before {
  color: var(--red);
  transform: translateX(-2px);
  mix-blend-mode: screen;
  clip-path: inset(0 0 100% 0);
  animation: slice-a 3.2s steps(1) infinite;
}
.glitch::after {
  color: var(--cyan);
  transform: translateX(2px);
  mix-blend-mode: screen;
  clip-path: inset(100% 0 0 0);
  animation: slice-b 2.7s steps(1) infinite;
}
@keyframes slice-a {
  0%, 88%, 100% { clip-path: inset(0 0 100% 0); transform: translateX(0); }
  89% { clip-path: inset(12% 0 70% 0); transform: translateX(-6px); }
  91% { clip-path: inset(55% 0 25% 0); transform: translateX(5px); }
  93% { clip-path: inset(30% 0 52% 0); transform: translateX(-3px); }
  95% { clip-path: inset(78% 0 5% 0); transform: translateX(8px); }
}
@keyframes slice-b {
  0%, 82%, 100% { clip-path: inset(100% 0 0 0); transform: translateX(0); }
  83% { clip-path: inset(40% 0 40% 0); transform: translateX(6px); }
  86% { clip-path: inset(5% 0 80% 0); transform: translateX(-7px); }
  89% { clip-path: inset(65% 0 12% 0); transform: translateX(4px); }
}
/* bursts: everything glitches hard at once */
body.burst .glitch { transform: skewX(-8deg) translateX(3px); }
body.burst .glitch::before { clip-path: inset(20% 0 45% 0); transform: translateX(-10px); }
body.burst .glitch::after  { clip-path: inset(60% 0 10% 0); transform: translateX(10px); }

/* ---------- main page ---------- */
.center {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh; /* mobile: ignore the collapsing address bar */
  display: grid;
  place-items: center;
  padding: 16px;
}

.question {
  all: unset;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  cursor: pointer;
  font-family: var(--mono);
  font-size: clamp(2rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--fg);
  text-align: center;
  animation: jitter 4s steps(1) infinite;
}
.question:hover, .question:focus-visible {
  color: #fff;
  animation-duration: .25s;
}
.question:hover::before { animation-duration: .6s; }
.question:hover::after  { animation-duration: .5s; }
.cursor {
  display: inline-block;
  width: .5em;
  height: .08em;
  margin-left: .1em;
  background: var(--acid);
  vertical-align: baseline;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes jitter {
  0%, 96%, 100% { transform: none; }
  97% { transform: translate(2px, -1px); }
  98% { transform: translate(-3px, 1px) skewX(4deg); }
  99% { transform: translate(1px, 0); }
}

/* ---------- 409 page ---------- */
.conflict {
  font-size: clamp(2.4rem, 11vw, 8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  text-align: center;
  line-height: .95;
  animation: jitter 2.5s steps(1) infinite;
}
.conflict.glitch::before { animation-duration: 1.6s; }
.conflict.glitch::after  { animation-duration: 1.3s; }

/* ---------- "no connection" page ---------- */
.offline {
  position: relative;
  z-index: 1;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--dim);
}
.offline .screen {
  min-height: 100vh;
  min-height: 100svh; /* mobile: ignore the collapsing address bar */
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}
.offline h1 {
  color: var(--fg);
  font-weight: 500;
  font-size: 1.6em;
  margin: 18px 0 14px;
}
.offline .muted { font-size: .95em; line-height: 1.6; }
.offline ul { margin: 6px 0 0; padding-left: 22px; line-height: 1.7; }
.offline .code {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: .78em;
  letter-spacing: .02em;
  color: var(--red);
}
.offline .icon {
  width: 72px; height: 72px; color: #5f6368;
  filter: drop-shadow(-2px 0 rgba(255,0,64,.5)) drop-shadow(2px 0 rgba(0,240,255,.5));
}

.scroll-hint {
  margin-top: 60px;
  text-align: center;
  font-family: var(--mono);
  font-size: .8em;
  color: var(--acid);
  opacity: .6;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* browser flavours */
.firefox h1 { font-weight: 300; font-size: 2em; }
.firefox .icon { color: #8f8f9d; }
.safari .screen { text-align: center; align-items: center; }
.safari h1 { font-weight: 600; font-size: 1.4em; }
.safari ul { list-style: none; padding: 0; }

/* below the fold */
.below {
  min-height: 100vh;
  min-height: 100svh; /* mobile: ignore the collapsing address bar */
  max-width: 720px;
  margin: 0 auto;
  padding: 120px 16px 80px;
  text-align: center;
  font-family: var(--mono);
}
.wallet {
  display: block;
  color: var(--acid);
  font-size: clamp(.6rem, 3.1vw, 1.15rem); /* keeps the 42 chars on one line on phones */
  word-break: break-all;
  padding: 18px 12px;
  border: 1px solid #1f3a1c;
  background: rgba(57, 255, 20, .03);
  box-shadow: 0 0 30px rgba(57, 255, 20, .07), inset 0 0 20px rgba(57,255,20,.04);
}
.wallet.glitch::before, .wallet.glitch::after { padding: 18px 12px; }
.copy {
  margin-top: 10px;
  padding: 6px 10px;
  font: .8rem var(--mono);
  letter-spacing: .06em;
  color: var(--acid);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  opacity: .75;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .2s, border-color .2s;
}
.copy:hover, .copy:focus-visible { opacity: 1; border-color: #1f3a1c; outline: none; }
.copy.done { color: var(--cyan); opacity: 1; }
.ask {
  margin: 56px 0 8px;
  font-size: clamp(1.2rem, 3.8vw, 1.9rem);
  color: var(--fg);
}
.sub {
  margin: 0 0 28px;
  font-size: .85rem;
  color: var(--dim);
  font-style: italic;
}
.guess { display: flex; justify-content: center; }
.prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
  padding: 10px 14px;
  border: 1px solid #333;
  background: #050505;
}
.prompt:focus-within { border-color: var(--acid); box-shadow: 0 0 18px rgba(57,255,20,.15); }
.prompt span { color: var(--acid); }
.prompt input {
  flex: 1;
  min-width: 0;
  font: 1.05rem var(--mono);
  color: var(--fg);
  caret-color: var(--acid);
  background: transparent;
  border: 0;
  outline: none;
}
.error.is-hint { color: var(--acid); opacity: .75; }
.error {
  min-height: 1.4em;
  margin: 10px 0 0;
  font-size: .75rem;
  color: var(--red);
  letter-spacing: .04em;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
