:root {
  --bg: #07080f;
  --periwinkle: #6b84ff;
  --periwinkle-glow: rgba(107, 132, 255, 0.55);
  --cyan: #00f0ff;
  --magenta: #ff2a85;
  --text: #eef1ff;
  --muted: #7f8ab8;
  --panel: rgba(12, 15, 28, 0.78);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Space Mono', monospace;
}

body { overflow-x: hidden; background: var(--bg); }

#mosh-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.92;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0px,
    rgba(255, 255, 255, 0) 2px,
    rgba(0, 0, 0, 0.22) 3px,
    rgba(0, 0, 0, 0.22) 4px
  );
}

.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  text-align: center;
}

.logo-glitch-stage {
  position: relative;
  display: inline-grid;
  place-items: center;
  margin-bottom: 1.75rem;
  text-decoration: none;
  animation: floatLogo 5s ease-in-out infinite;
}

.logo-glitch-stage img {
  grid-area: 1 / 1;
  width: min(450px, 80vw);
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.logo-base {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 24px var(--periwinkle-glow));
  transition: transform 0.15s ease;
}

.logo-layer-cyan, .logo-layer-magenta {
  position: relative;
  pointer-events: none;
  opacity: 0.78;
  mix-blend-mode: screen;
}

.logo-layer-cyan {
  z-index: 3;
  filter: drop-shadow(-3px 0 0 var(--cyan)) hue-rotate(45deg) saturate(2);
  animation: glitchSliceA 4.2s infinite steps(1);
}

.logo-layer-magenta {
  z-index: 1;
  filter: drop-shadow(3px 0 0 var(--magenta)) hue-rotate(-55deg) saturate(2.2);
  animation: glitchSliceB 3.7s infinite steps(1);
}

.logo-glitch-stage:hover .logo-layer-cyan,
.logo-glitch-stage.glitch-spike .logo-layer-cyan {
  animation: glitchSliceHyperA 0.35s infinite steps(2);
  opacity: 0.95;
}

.logo-glitch-stage:hover .logo-layer-magenta,
.logo-glitch-stage.glitch-spike .logo-layer-magenta {
  animation: glitchSliceHyperB 0.3s infinite steps(2);
  opacity: 0.95;
}

.logo-glitch-stage.glitch-spike .logo-base { transform: skewX(-4deg) scale(1.02); }

@keyframes floatLogo {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes glitchSliceA {
  0%, 86%, 100% { clip-path: inset(50% 0 50% 0); transform: translate(0, 0); }
  88% { clip-path: inset(12% 0 68% 0); transform: translate(-8px, -2px); }
  90% { clip-path: inset(58% 0 18% 0); transform: translate(7px, 1px); }
  92% { clip-path: inset(32% 0 48% 0); transform: translate(-5px, 0); }
  94% { clip-path: inset(75% 0 8% 0); transform: translate(9px, -1px); }
}

@keyframes glitchSliceB {
  0%, 82%, 100% { clip-path: inset(50% 0 50% 0); transform: translate(0, 0); }
  84% { clip-path: inset(64% 0 14% 0); transform: translate(8px, 2px); }
  87% { clip-path: inset(18% 0 62% 0); transform: translate(-9px, -1px); }
  91% { clip-path: inset(44% 0 36% 0); transform: translate(6px, 0); }
  95% { clip-path: inset(8% 0 78% 0); transform: translate(-6px, 2px); }
}

@keyframes glitchSliceHyperA {
  0% { clip-path: inset(10% 0 70% 0); transform: translate(-10px, -2px); }
  33% { clip-path: inset(45% 0 30% 0); transform: translate(9px, 1px); }
  66% { clip-path: inset(72% 0 10% 0); transform: translate(-7px, 2px); }
  100% { clip-path: inset(22% 0 55% 0); transform: translate(8px, -1px); }
}

@keyframes glitchSliceHyperB {
  0% { clip-path: inset(65% 0 12% 0); transform: translate(10px, 2px); }
  33% { clip-path: inset(15% 0 60% 0); transform: translate(-9px, -2px); }
  66% { clip-path: inset(38% 0 40% 0); transform: translate(8px, 0); }
  100% { clip-path: inset(80% 0 5% 0); transform: translate(-11px, 1px); }
}

.type-hud {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--panel);
  border: 1px solid rgba(107, 132, 255, 0.35);
  backdrop-filter: blur(8px);
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.type-hud .prompt { color: var(--periwinkle); font-weight: 700; }
#typed-buffer { color: var(--cyan); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--periwinkle);
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.nav-mosh {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  max-width: 820px;
}

.mosh-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.72rem 1.25rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  border: 1.5px solid rgba(107, 132, 255, 0.45);
  border-radius: 4px;
  backdrop-filter: blur(6px);
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px) scale(0.94);
  clip-path: inset(0 100% 0 0);
  transition: opacity 0.45s ease, transform 0.35s ease, clip-path 0.55s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mosh-btn.emerged { opacity: 1; transform: translateY(0) scale(1); clip-path: inset(0 0% 0 0); }

.mosh-btn:hover, .mosh-btn.is-match {
  border-color: var(--cyan);
  background: rgba(107, 132, 255, 0.22);
  transform: translateY(-2px) scale(1.04);
  box-shadow: -3px 0 0 var(--magenta), 3px 0 0 var(--cyan), 0 0 22px var(--periwinkle-glow);
}

.mosh-btn.dimmed { opacity: 0.32; transform: scale(0.97); }
.mosh-btn .matched-chars { color: var(--cyan); text-decoration: underline; text-underline-offset: 4px; }

.enter-hint {
  font-size: 0.68rem;
  padding: 0.12rem 0.35rem;
  border-radius: 3px;
  background: var(--cyan);
  color: #05060b;
  font-weight: 700;
  display: none;
}

.mosh-btn.is-exact .enter-hint { display: inline-block; }

.scroll-cue {
  position: absolute;
  bottom: 1.5rem;
  color: var(--periwinkle);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
}

.feed-wrap {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 1.25rem 6rem;
}

.post {
  background: rgba(11, 14, 26, 0.88);
  border: 1px solid rgba(107, 132, 255, 0.28);
  border-radius: 8px;
  padding: 1.75rem;
  margin-bottom: 2.25rem;
  backdrop-filter: blur(10px);
}

.post h2 { font-family: 'Syne', sans-serif; color: var(--periwinkle); margin-bottom: 0.85rem; font-size: 1.5rem; }
.post p { line-height: 1.7; margin-bottom: 0.85rem; }
.post-meta { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid rgba(107, 132, 255, 0.18); font-size: 0.78rem; color: var(--muted); }
