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

html, body {
  height: 100%;
  font-family: monospace;
  overflow: hidden;
}

/* Background GIF layer */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("haibane.gif");
  background-repeat: repeat;
  background-size: auto;
  z-index: 0;
}

/* CRT container with text + TV model */
.crt {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-shadow: 0 0 2px #cac5fc, 0 0 5px #cac5fc, 0 0 10px #cac5fc;
}

/* Green tint overlay */
.green-tint {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 255, 0, 0.02);
  pointer-events: none;
  z-index: 3;
}

/* Scanlines overlay */
.scanlines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0px,
    rgba(0, 0, 0, 0.2) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 4;
}

/* Text block */
.content {
  position: relative;
  z-index: 2;
  top: 5%;
  padding: 2rem;
  text-align: center;
  max-width: 600px;
  color: #cac5fc;
}

/* 3D model container */
.crt-container {
  position: relative;
  z-index: 2;
}

/* Model styling */
model-viewer {
  width: 600px;
  height: 500px;
}

/* Flickering title text */
.flicker {
  display: inline-block;
  color: #cac5fc;
  text-shadow:
    0 0 1px #cac5fc,
    0 0 2px #cac5fc,
    0 0 4px #cac5fc;
  animation: flickerAnim 2.5s infinite;
}

@keyframes flickerAnim {
  0%   { opacity: 1;    filter: brightness(1); }
  2%   { opacity: 0.8;  filter: brightness(2); }
  4%   { opacity: 0.4;  filter: brightness(3); }
  5%   { opacity: 1;    filter: brightness(1); }
  10%  { opacity: 0.9;  filter: brightness(0.8); }
  11%  { opacity: 0.2;  filter: brightness(2); }
  12%  { opacity: 1;    filter: brightness(1.2); }
  20%  { opacity: 0.7;  filter: brightness(1); }
  22%  { opacity: 0.3;  filter: brightness(1.5); }
  23%  { opacity: 1;    filter: brightness(1); }
  30%  { opacity: 0.9;  filter: brightness(0.8); }
  31%  { opacity: 0.2;  filter: brightness(2.5); }
  32%  { opacity: 1;    filter: brightness(1.1); }
  70%  { opacity: 0.95; filter: brightness(1); }
  71%  { opacity: 0.3;  filter: brightness(1.8); }
  72%  { opacity: 1;    filter: brightness(1); }
  100% { opacity: 1;    filter: brightness(1); }
}
