* {
      box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 100;
  line-height: 1.2;
  min-height: 100vh;
  transition: background 2s ease, color 2s ease;
  overflow: hidden;
}
body.terminal {
  background: #0d0d0d;
  color: white;
}
body.clean {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: black;
}
main {
  width: 100%;
  height: 100vh;
  position: relative;
}
.phase {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transition: opacity 1s ease;
}
/* Terminal code (background) */
.terminal-phase {
  font-family: "Bitcount Grid Single Ink", system-ui;
  font-size: clamp(16px, 5vw, 100px);
  font-weight: 300;
  font-optical-sizing: auto;
  text-transform: uppercase;
  line-height: 1.3;
  white-space: pre-wrap;
  word-break: break-word;
  z-index: 1;
}
.terminal-phase span {
  opacity: 0;
  display: inline-block;
}
@keyframes fadeChar {
  to { opacity: 1; }
}
/* Centered image */
.terminal-image {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  transition: opacity 1s ease;
}
.terminal-image img {
  width: clamp(100px, 30vw, 300px);
  height: auto;
  max-height: 50vh;
}
/* Matrix Grid - Final Phase */
.final-phase {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0;
  z-index: 3;
  transition: opacity 3s ease;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 0;
  padding: 0;
  margin: 0;
}
.final-phase.show {
  opacity: 1;
}

.matrix-cell {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
}
.matrix-cell.text-cell {
  padding: 2rem;
  font-size: clamp(12px, 1.5vw, 16px);
  letter-spacing: 0.02em;
  font-weight: 100;
  line-height: 1.4;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  grid-column: span 2;
  grid-row: span 2;
  background-color: black;
  color: white;
}
.matrix-cell.text-cell-med {
  padding: 2rem;
  font-size: clamp(12px, 1.5vw, 16px);
  letter-spacing: 0.02em;
  font-weight: 100;
  line-height: 1.4;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  grid-column: span 1;
  grid-row: span 2;
  background-color: black;
  color: white;
}
.matrix-cell.text-cell-small {
  padding: 2rem;
  font-size: clamp(12px, 1.5vw, 16px);
  letter-spacing: 0.02em;
  font-weight: 100;
  line-height: 1.4;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  grid-column: span 1;
  grid-row: span 1;
  background-color: black;
  color: white;
}

/* Live feed scrolling effect */
.matrix-cell.live-feed {
  overflow: hidden;
  padding: 1rem;
  position: relative;
  justify-content: flex-start;
}

.feed-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: scrollFeed 30s linear infinite;
}

.feed-item {
  font-size: clamp(10px, 1.2vw, 14px);
  line-height: 1.3;
}

/* Stagger the fade animations */
.feed-item:nth-child(1) { animation-delay: 0s; }
.feed-item:nth-child(2) { animation-delay: 1s; }
.feed-item:nth-child(3) { animation-delay: 2s; }
.feed-item:nth-child(4) { animation-delay: 3s; }
.feed-item:nth-child(5) { animation-delay: 4s; }
.feed-item:nth-child(6) { animation-delay: 5s; }
.feed-item:nth-child(7) { animation-delay: 6s; }
.feed-item:nth-child(8) { animation-delay: 7s; }

@keyframes scrollFeed {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}

@keyframes fadeInOut {
  0%, 100% {
    opacity: 0;
  }
  15%, 85% {
    opacity: 1;
  }
}

.matrix-cell.image-cell {
  padding: 0;
}
.matrix-cell.image-cell-big {
  padding: 0;
  grid-row: span 2;
}
.matrix-cell.image-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.matrix-cell.image-cell-big img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.no-wrap {
  white-space: nowrap;
}
.blank {
  border: none;
  border-bottom: 1px solid white;
  background: transparent;
  color: green;
  font-family: 'Inter', sans-serif;
  font-weight: 100;
  font-size: inherit;
  width: 120px;
  text-align: center;
  padding: 4px 8px;
  margin: 0 4px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.05em;
  position: relative;
  display: inline-block;
}
.blank::placeholder {
  color: #999999;
  font-weight: 100;
  text-align: center;
}
.blank:focus {
  outline: none;
  border-bottom: 1px solid white;
  transform: translateY(-1px);
}
.blank:focus::placeholder {
  opacity: 0;
}
.sticky-bottom-right {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  /* Optional: Add some styling */
  width: 60px;
  height: 60px;
  cursor: pointer;
}

/* Optional: Add hover effect */
.sticky-bottom-right:hover {
  opacity: 0.8;
  transform: scale(1.05);
  transition: all 0.2s ease;
}
@media (max-width: 768px) {
  .final-phase {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(6, 1fr);
  }
  .matrix-cell.text-cell {
    grid-column: span 2;
    grid-row: span 2;
    font-size: clamp(11px, 3vw, 14px);
    padding: 1.5rem;
  }
}