:root {
  --tv-animation-duration: 2.0s;
}

body {
  background: #e4e4d6;
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.scalable {
  font-family: monospace;
  font-size: 12px;
  color: #000;
}

.scalable-left {
  transform-origin: bottom left;
}

.scalable-right {
  transform-origin: bottom right;
}

#footer {
  z-index: 10;
  position: fixed;
  bottom: 2.5em;
  flex-direction: row;
  width: 100%;
}

#footer .content {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  padding-left: 2.5em;
  padding-right: 2.5em;
  gap: 4.5em;
}

.spacer {
  flex-grow: 1;
}

.contact-form {
  position: fixed;
  bottom: 6em;
  right: 2.5em;
  background: #e4e4d6;
  border: 2px solid #000;
  padding: 1em;
  font-family: monospace;
  font-size: 12px;
  color: #000;
  min-width: 300px;
  max-width: 400px;
  z-index: 20;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.contact-form.hidden {
  display: none;
}

.contact-form-content {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

.form-section.hidden {
  display: none;
}

.prompt-line {
  margin-bottom: 0.25em;
}

.prompt-text {
  color: #000;
}

.input-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  position: relative;
}

.prompt-symbol {
  color: #000;
  font-weight: bold;
  flex-shrink: 0;
  line-height: 1.2;
}

.terminal-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: monospace;
  font-size: 12px;
  color: #000;
  flex: 1;
  padding: 0;
  margin: 0;
  line-height: 1.2;
}

.terminal-input::selection {
  background: rgba(0, 0, 0, 0.2);
}

.terminal-textarea {
  resize: none;
  overflow: hidden;
  min-height: 1.2em;
}



.ok-button {
  background: #000;
  color: #e4e4d6;
  border: none;
  padding: 0.5em 1em;
  font-family: monospace;
  font-size: 12px;
  cursor: pointer;
  margin-top: 0.5em;
  align-self: flex-start;
}

.ok-button.dimmed {
  background: #666;
  color: #999;
  cursor: not-allowed;
}

.ok-button:hover:not(.dimmed) {
  background: #333;
}

.ok-button:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.typewriter {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 1s steps(40, end);
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

.terminal-scroll {
  opacity: 0;
  animation: fadeIn 0.3s ease-in forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

#footer a {
  cursor: pointer;
  text-decoration: underline;
  user-select: none;
  color: #000;
  padding: 2px 0px;
}

#footer a:hover {
  background: #000;
  color: #e4e4d6;
  text-decoration: none;
}

.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  #footer .content {
    flex-direction: column;
    align-items: center;
    gap: 1em;
    padding-left: 1em;
    padding-right: 1em;
    text-align: center;
  }

  #footer #tagline {
    order: 1;
    width: 100%;
  }

  .spacer,
  #footer #apps,
  #footer #privacy,
  #footer #contact {
    display: none;
  }

  .mobile-nav {
    display: block;
    order: 2;
    width: 100%;
    text-align: center;
  }

  .mobile-nav a {
    cursor: pointer;
    text-decoration: underline;
    user-select: none;
    color: #000;
    padding: 2px 0px;
  }

  .mobile-nav a:hover {
    background: #000;
    color: #e4e4d6;
    text-decoration: none;
  }

  .nav-separator {
    color: #000;
    margin: 0 0.5em;
  }

  .contact-form {
    position: fixed;
    bottom: 6em;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    min-width: 280px;
    max-width: 90vw;
  }

  .apps-modal {
    position: fixed;
    bottom: 6em;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    min-width: 280px;
    max-width: 90vw;
  }
}

#contact-link.active {
  background: #000;
  color: #e4e4d6;
  text-decoration: none;
}

.apps-modal {
  position: fixed;
  bottom: 6em;
  right: 22em;
  background: #e4e4d6;
  border: 2px solid #000;
  padding: 1em;
  font-family: monospace;
  font-size: 12px;
  color: #000;
  min-width: 200px;
  max-width: 300px;
  z-index: 20;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.apps-modal.hidden {
  display: none;
}

.apps-modal-content {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.apps-list {
  display: none;
  flex-direction: column;
  gap: 0.25em;
}

.app-link-line {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.app-link {
  color: #000;
  text-decoration: underline;
  cursor: pointer;
}

.app-link:hover {
  background: #000;
  color: #e4e4d6;
  text-decoration: none !important;
}

#apps-link {
  cursor: pointer;
  text-decoration: underline;
}

#apps-link:hover {
  background: #000;
  color: #e4e4d6;
  text-decoration: none;
}

#apps-link.active {
  background: #000;
  color: #e4e4d6;
  text-decoration: none;
}

.pi-icon {
  position: fixed;
  bottom: 8px;
  right: 12px;
  font-family: monospace;
  font-size: 14px;
  color: #5b5b4f;
  cursor: pointer;
  z-index: 100;
  transition: all 0.2s ease;
  user-select: none;
  opacity: 0.5;
}

.pi-icon:hover {
  color: #000;
  opacity: 1.0;
}

#site-wrapper {
  width: 100%;
  height: 100%;
}

.tv-shutdown #site-wrapper {
  animation: tvShutdown var(--tv-animation-duration) ease-in-out forwards;
}

.tv-shutdown {
  background: #1a1a18 !important;
}

@keyframes tvShutdown {
  0% {
    transform: scale(1, 1);
    opacity: 1;
    background: #e4e4d6;
    filter: brightness(1);
    box-shadow: none;
  }
  25% {
    background: #000;
    filter: brightness(1);
  }
  50% {
    transform: scale(1, 0.004);
    opacity: 1;
    background: #fff;
    filter: brightness(5);
    box-shadow: 0 0 40px #fff, 0 0 80px #fff, 0 0 120px #fff;
  }
  95% {
    transform: scale(0.002, 0.002);
    opacity: 1;
    background: #fff;
    filter: brightness(10);
    box-shadow: 0 0 80px #fff, 0 0 160px #fff, 0 0 240px #fff;
  }
  100% {
    transform: scale(0, 0);
    opacity: 0;
    background: #000;
    filter: brightness(1);
    box-shadow: none;
  }
}

.tv-shutdown .pi-icon {
  display: none;
}

.return-arrow {
  position: fixed;
  bottom: 8px;
  right: 12px;
  font-family: monospace;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.2s ease;
  user-select: none;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.return-arrow:hover {
  transform: scale(1.2);
  text-shadow: 0 0 15px rgba(255, 255, 255, 1);
}

.return-arrow.hidden {
  display: none;
}

.tv-startup #site-wrapper {
  animation: tvStartup var(--tv-animation-duration) ease-out forwards;
}

.tv-startup {
  background: transparent !important;
}

@keyframes tvStartup {
  0% {
    transform: scale(0, 0);
    opacity: 0;
    background: #fff;
    filter: brightness(1);
    box-shadow: none;
  }
  5% {
    transform: scale(0.002, 0.002);
    opacity: 1;
    background: #fff;
    filter: brightness(10);
    box-shadow: 0 0 80px #fff, 0 0 160px #fff, 0 0 240px #fff;
  }
  50% {
    transform: scale(1, 0.004);
    opacity: 1;
    background: #fff;
    filter: brightness(5);
    box-shadow: 0 0 40px #fff, 0 0 80px #fff, 0 0 120px #fff;
  }
  75% {
    background: #e4e4d6;
    filter: brightness(1);
    box-shadow: none;
  }
  100% {
    transform: scale(1, 1);
    opacity: 1;
    background: #e4e4d6;
    filter: brightness(1);
    box-shadow: none;
  }
}

.tv-off-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -2;
}

.tv-off-video.visible {
  opacity: 1;
}

.tv-off-video.hidden {
  display: none;
}

/* Video Vignette Overlay */
.video-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  opacity: 1;
  background: radial-gradient(
    ellipse at center,
    transparent 30%,
    rgba(0, 0, 0, 0.5) 80%,
    rgba(0, 0, 0, 0.9) 90%,
    rgba(0, 0, 0, 0.95) 100%
  );
}

.video-vignette.hidden {
  display: none;
}


