:root {
  --bg: #14110e;
  --fg: #efe6d6;
  --dim: #9a8f7f;
  --ink: #d64933;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 300;
}

/* every short-term memory reset, the page swaps between color and black & white */
html {
  transition: filter 1.5s ease;
}

html.bw {
  filter: grayscale(1) contrast(1.08);
}

/* ---------- background layers ---------- */
#memories,
#grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#grain {
  opacity: 0.06;
  image-rendering: pixelated;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(120, 80, 40, 0.08) 0%, transparent 45%, rgba(0, 0, 0, 0.85) 100%);
}

/* ---------- content ---------- */
main {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 70px;
  text-align: center;
}

#logo {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 300;
  font-size: clamp(24px, 4.5vw, 40px);
  letter-spacing: 0.35em;
  /* letter-spacing adds trailing space; compensate to stay centered */
  margin-right: -0.35em;
  line-height: 1.2;
  color: var(--fg);
  opacity: 0.75;
}

.tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 8px;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.55em;
  color: var(--dim);
  opacity: 0.8;
  user-select: none;
  /* very faint VHS chroma fringe */
  text-shadow: -1px 0 rgba(214, 73, 51, 0.3), 1px 0 rgba(80, 160, 255, 0.2);
}

.tagline .rule {
  width: 0;
  height: 1px;
  background: var(--dim);
  opacity: 0.6;
  transition: width 0.8s ease;
}

.tagline.ready .rule {
  width: 48px;
}

#typed {
  margin-right: -0.55em;
  white-space: pre;
}

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

.links a {
  display: block;
  width: 26px;
  height: 26px;
  opacity: 0.45;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.links a:hover,
.links a:focus-visible {
  opacity: 0.95;
  transform: translateY(-2px);
}

.links img,
.links svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (orientation: portrait) {
  .tagline {
    font-size: 9px;
    gap: 10px;
  }
  .tagline.ready .rule {
    width: 24px;
  }
  .links {
    gap: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    transition: none;
  }
}
