@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;600&display=swap');

:root {
  --bg: #050505;
  --fg: #c8c8c8;
  --dim: #555;
  --accent: #7fffb0;
  --red: #ff2f55;
  --cyan: #2ff3ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-x: hidden;
}

/* garis scan CRT */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.025) 0px,
    rgba(255,255,255,0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 10;
}

/* vignette */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.85) 100%);
  z-index: 11;
}

canvas#noise {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.06;
  pointer-events: none;
  z-index: 9;
}

main { position: relative; z-index: 1; max-width: 640px; width: 100%; }

::selection { background: var(--accent); color: #000; }

.cursor {
  display: inline-block;
  width: 0.6em; height: 1.1em;
  background: var(--fg);
  vertical-align: -0.15em;
  margin-left: 2px;
}
.cursor.blink { animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* glitch */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}
.glitch.on::before { opacity: .8; color: var(--red);  transform: translate(-2px, 0); clip-path: inset(10% 0 55% 0); }
.glitch.on::after  { opacity: .8; color: var(--cyan); transform: translate(2px, 0);  clip-path: inset(60% 0 5% 0); }
.glitch.on { transform: translateX(1px) skewX(-2deg); }

.muted { color: var(--dim); }

input.pw {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--dim);
  color: var(--accent);
  font: inherit;
  font-size: 16px;
  padding: 8px 0;
  width: 100%;
  outline: none;
  letter-spacing: 0.15em;
}
input.pw:focus { border-color: var(--accent); }

a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted currentColor; }

@media (prefers-reduced-motion: reduce) {
  .cursor.blink { animation: none; }
  .glitch.on { transform: none; }
}
