/* ───────────────────────────────────────────
   BASE RESET & TOKENS
─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --black:   #000000;
  --white:   #f5f5f0;
  --grey:    #888888;
  --dim:     #222222;
  --font:    'Courier Prime', 'Courier New', Courier, monospace;
  --speed:   60ms;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* ───────────────────────────────────────────
   FILM GRAIN NOISE LAYER
─────────────────────────────────────────── */
.noise {
  pointer-events: none;
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  z-index: 0;
  animation: grainShift 0.15s steps(1) infinite;
}

@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, -3%); }
  50%  { transform: translate(1%, 2%); }
  75%  { transform: translate(3%, -1%); }
  100% { transform: translate(-1%, 3%); }
}

/* ───────────────────────────────────────────
   LAYOUT
─────────────────────────────────────────── */
.center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 2rem;
}

/* ───────────────────────────────────────────
   TERMINAL BLOCK
─────────────────────────────────────────── */
.terminal-wrapper {
  max-width: 660px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.prompt {
  font-size: clamp(0.65rem, 2vw, 0.8rem);
  color: var(--grey);
  letter-spacing: 0.04em;
  user-select: none;
}

.blink-cursor {
  display: inline-block;
  width: 7px;
  height: 0.9em;
  background: var(--grey);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1.1s step-end infinite;
}

/* ───────────────────────────────────────────
   TYPEWRITER TEXT
─────────────────────────────────────────── */
.typewriter {
  font-size: clamp(1.25rem, 4.5vw, 2rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--white);
  min-height: 4rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* blinking block cursor after text */
.cursor {
  display: inline-block;
  font-size: clamp(1.25rem, 4.5vw, 2rem);
  line-height: 1;
  color: var(--white);
  animation: blink 1s step-end infinite;
  opacity: 0;          /* hidden until typing begins */
  user-select: none;
  vertical-align: middle;
  margin-left: 1px;
}

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

/* ───────────────────────────────────────────
   FOOTER
─────────────────────────────────────────── */
.footer {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.footer-text {
  font-size: 0.7rem;
  color: var(--dim);
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

/* ───────────────────────────────────────────
   SCANLINE EFFECT (subtle)
─────────────────────────────────────────── */
.center::before {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.07) 3px,
    rgba(0,0,0,0.07) 4px
  );
  z-index: 0;
}

/* ───────────────────────────────────────────
   VIGNETTE
─────────────────────────────────────────── */
.center::after {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0,0,0,0.65) 100%
  );
  z-index: 0;
}

/* ───────────────────────────────────────────
   RESPONSIVE
─────────────────────────────────────────── */
@media (max-width: 480px) {
  .typewriter {
    font-size: 1.15rem;
  }
  .terminal-wrapper {
    gap: 0.4rem;
  }
}
