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

html {
  height: 100%;
  font-size: 20px;
}

body {
  background: #3535C6;
  font-family: 'Press Start 2P', monospace;
  color: #BCBCFF;
  animation: crt-flicker 22s step-end infinite;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 50%, transparent 30%, rgba(0,0,0,0.41) 100%);
}

/* ── index layout ── */

body.index {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 72px #7878F8;
}

body.index main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* ── about layout ── */

body.about {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6rem 6rem 5rem;
}

.page-border {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  box-shadow: inset 0 0 0 72px #7878F8;
}

body.about header,
body.about main,
body.about footer {
  width: 100%;
}

body.about header {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 2.8rem;
}

body.about header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

body.about header nav a {
  color: #9898D8;
  font-size: 1rem;
  text-decoration: none;
  letter-spacing: 0.15em;
  transition: color 0.1s;
}

body.about header nav a:hover {
  color: #BCBCFF;
}

body.about header nav a.run {
  color: #3535C6;
  background: #BCBCFF;
  padding: 0.5em 1.2em;
  transition: background 0.1s;
}

body.about header nav a.run:hover {
  background: #fff;
}

body.about header > p {
  color: #9898D8;
  font-size: 1rem;
  letter-spacing: 0.25em;
}

body.about main {
  display: flex;
  flex-direction: column;
  gap: 2.8rem;
}

body.about footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2.8rem;
  padding-top: 0.5rem;
}

body.about footer a {
  display: inline-block;
  color: #3535C6;
  background: #BCBCFF;
  font-family: 'Press Start 2P', monospace;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-decoration: none;
  padding: 0.9em 2em;
  transition: background 0.1s;
}

body.about footer a:hover {
  background: #fff;
}

body.about footer a.back {
  background: transparent;
  color: #9898D8;
  padding: 0;
}

body.about footer a.back:hover {
  background: transparent;
  color: #BCBCFF;
}

section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

h2 {
  color: #9898D8;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #3d3daa;
}

section p {
  color: #BCBCFF;
  font-size: 1rem;
  line-height: 2;
  letter-spacing: 0.05em;
}

section p strong,
section ul li strong {
  color: #fff;
  font-weight: 400;
}

section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

section ul li {
  color: #BCBCFF;
  font-size: 1rem;
  letter-spacing: 0.05em;
  line-height: 1.6;
  padding-left: 1.2em;
  position: relative;
}

section ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: #9898D8;
}

ul.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 2rem;
}

ul.features li::before {
  content: '·';
}

/* ── heading ── */

h1 {
  position: relative;
  color: #fff;
  font-size: clamp(1.4rem, 4vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  display: flex;
  align-items: baseline;
}

h1::before,
h1::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

h1.glitch::before {
  color: #44FFFF;
  animation: glitch-top 0.12s steps(1) forwards;
}

h1.glitch::after {
  color: #FF44FF;
  animation: glitch-bot 0.12s steps(1) forwards;
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  background: #fff;
  margin-left: 0.15em;
  position: relative;
  top: 0.05em;
  animation: blink 1.1s step-end 18 forwards, cursor-hide 0s 19.8s forwards;
}

/* ── stream link ── */

.stream-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.1s;
}

.stream-link:hover {
  color: #44FFFF;
}

.live-dot {
  display: none;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: #ff2222;
  flex-shrink: 0;
  animation: live-pulse 1.4s ease-in-out infinite;
}

.live-dot.visible {
  display: inline-block;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ── index nav ── */

.projects {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8rem;
}

.projects h2 {
  border-bottom: none;
  padding-bottom: 0;
  letter-spacing: 0.3em;
}

.projects ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.projects a {
  color: #BCBCFF;
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.1s;
}

.projects a:hover {
  color: #fff;
}

.socials {
  margin-top: 1rem;
}

.socials ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.socials a {
  color: #BCBCFF;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.1s;
}

.socials a:hover {
  color: #fff;
}

.socials svg {
  width: 26px;
  height: 26px;
}

/* ── crt ── */

.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.13) 0px,
    rgba(0,0,0,0.13) 1px,
    transparent 1px,
    transparent 4px
  );
}

/* ── animations ── */

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

@keyframes crt-flicker {
  0%, 94%, 97%, 100% { opacity: 1; }
  95%                { opacity: 0.93; }
  96%                { opacity: 1; }
  98%                { opacity: 0.96; }
  99%                { opacity: 1; }
}

@keyframes glitch-top {
  0%   { opacity: 1; clip-path: inset(0 0 62% 0); transform: translate(-3px, 0); }
  33%  { clip-path: inset(0 0 62% 0); transform: translate(3px, 0); }
  66%  { clip-path: inset(10% 0 55% 0); transform: translate(-2px, 0); }
  100% { opacity: 0; }
}

@keyframes cursor-hide {
  to { opacity: 0; }
}

@keyframes glitch-bot {
  0%   { opacity: 1; clip-path: inset(58% 0 0 0); transform: translate(3px, 0); }
  33%  { clip-path: inset(58% 0 0 0); transform: translate(-3px, 0); }
  66%  { clip-path: inset(65% 0 0 0); transform: translate(2px, 0); }
  100% { opacity: 0; }
}

@media (max-width: 600px) {
  body.about {
    padding: 5rem 3rem 4rem;
  }

  ul.features {
    grid-template-columns: 1fr;
  }
}
