* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  color: #000;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,.08) 0 1px,
      transparent 1px 3px
    ),
    #c0c0c0;
  font-family: "Times New Roman", serif;
  cursor: crosshair;
}

a {
  color: #0000ee;
  text-decoration: underline;
}

a:visited {
  color: #551a8b;
}

.topbar {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  color: #fff;
  background: navy;
  font-family: "Courier New", monospace;
  font-weight: bold;
}

marquee {
  border-top: 2px solid #fff;
  border-bottom: 2px solid #000;
  padding: 4px 0;
  color: yellow;
  background: #800080;
  font-family: "Comic Sans MS", cursive;
  font-weight: bold;
}

main {
  width: min(1180px, 97vw);
  margin: 10px auto 60px;
  text-align: center;
}

h1,
h2,
p {
  font-size: 16px;
}

h1 {
  margin: 18px 0 4px;
  color: red;
  font-family: "Comic Sans MS", cursive;
  text-shadow: 2px 2px yellow;
}

.warning {
  display: inline-block;
  padding: 2px 5px;
  color: yellow;
  background: #000;
  animation: blink 1s steps(2, end) infinite;
}

.desktop-grid {
  display: grid;
  grid-template-columns: 1fr 240px 1fr;
  grid-template-areas:
    "apple visitor cools"
    "links junk message";
  gap: 18px;
  align-items: start;
  margin-top: 24px;
}

.apple-zone {
  grid-area: apple;
}

.cool-s-zone {
  grid-area: cools;
}

.visitor-box {
  grid-area: visitor;
}

.links-box {
  grid-area: links;
}

.junk {
  grid-area: junk;
}

.system-message {
  grid-area: message;
}

.ascii-zone,
.visitor-box,
.links-box,
.junk,
.system-message {
  border: 4px outset #eee;
  padding: 12px;
  background: #efefef;
  text-align: left;
}

.ascii-zone h2,
.visitor-box h2,
.links-box h2,
.junk h2,
.system-message h2 {
  margin: 0 0 10px;
  font-family: "Courier New", monospace;
  font-size: 15px;
}

.ascii-art {
  overflow: auto;
  display: block;
  margin: 0 auto;
  max-width: 100%;
  text-align: center;
  white-space: pre;
  font-family: "Courier New", monospace;
  user-select: none;
}

.apple-art {
  font-size: clamp(7px, 1.18vw, 14px);
  line-height: .9;
}

.cool-s-art {
  font-size: clamp(14px, 2.55vw, 30px);
  line-height: .92;
}

.ascii-char {
  display: inline-block;
  min-width: .58em;
  transition:
    transform 70ms linear,
    color 70ms linear,
    background 70ms linear;
  transform-origin: center;
}

.ascii-char:hover {
  transform: rotate(24deg) scale(1.22);
}

.ascii-char[data-char="\\"]:hover {
  transform: rotate(-24deg) scale(1.22);
}

.ascii-char.flash-blue {
  color: #0000ff;
}

.ascii-char.flash-yellow {
  color: #ffd400;
  text-shadow: 1px 1px #000;
}

.ascii-char.the-one {
  cursor: pointer;
}

.ascii-char.the-one:hover {
  color: #ff0;
  background: #f00;
  transform: none;
}

.tiny {
  margin: 8px 0 0;
  text-align: center;
  font-size: 11px;
}

.counter {
  border: 3px inset #eee;
  padding: 8px 5px;
  color: #00ff00;
  background: #000;
  font-family: "Courier New", monospace;
  font-size: 28px;
  letter-spacing: 2px;
}

.links-box p {
  margin: 8px 0;
}

.new {
  margin-left: 8px;
  color: red;
  font-weight: bold;
}

.danger {
  margin-left: 8px;
  color: red;
  font-weight: bold;
}

.junk {
  background: #00ffff;
  text-align: center;
}

.broken-eagle {
  width: 130px;
  height: 85px;
  border: 2px dashed red;
}

.netscape {
  color: #008000;
}

.system-message {
  min-height: 180px;
}

#error-layer,
#fx-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.error-box {
  position: absolute;
  width: min(310px, 84vw);
  border: 3px outset #eee;
  background: #c0c0c0;
  box-shadow: 4px 4px 0 rgba(0,0,0,.35);
  font-family: Arial, sans-serif;
  font-size: 13px;
  pointer-events: auto;
  animation: error-pop .12s steps(2, end);
}

.error-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 4px;
  color: #fff;
  background: navy;
  font-weight: bold;
}

.error-close {
  width: 20px;
  height: 18px;
  border: 2px outset #eee;
  padding: 0;
  color: #000;
  background: #c0c0c0;
  line-height: 12px;
  font-weight: bold;
}

.error-body {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
}

.error-icon {
  font-size: 30px;
}

.error-box.vanish {
  animation: pixel-away .55s steps(6, end) forwards;
}

.falling-apple,
.pixel,
.dancer,
.worm {
  position: fixed;
  z-index: 1200;
  pointer-events: none;
}

.falling-apple {
  top: -40px;
  font-size: 24px;
  animation: fall linear forwards;
}

.pixel {
  width: 8px;
  height: 8px;
  background: currentColor;
  animation: burst .9s ease-out forwards;
}

.dancer {
  font-size: 42px;
  animation:
    dance .18s steps(2, end) infinite,
    drift 4s linear forwards;
}

.worm {
  left: -120px;
  bottom: 18px;
  font-family: "Courier New", monospace;
  font-size: 20px;
  animation: worm-walk 7s linear forwards;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,.88);
}

.modal.open {
  display: grid;
}

.secret-box,
.window-box {
  position: relative;
  width: min(650px, 94vw);
  padding: 24px;
  font-family: "Courier New", monospace;
}

.secret-box {
  border: 4px solid lime;
  color: lime;
  background: #000;
  text-align: left;
  box-shadow: 0 0 24px lime;
}

.window-box {
  border: 4px outset #eee;
  color: #000;
  background: #c0c0c0;
  text-align: left;
}

.window-title {
  margin: -20px -20px 16px;
  padding: 5px 8px;
  color: #fff;
  background: navy;
  font-weight: bold;
}

.modal-close {
  position: absolute;
  top: 6px;
  right: 6px;
  border: 2px outset #eee;
  background: #c0c0c0;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
}

.folder-grid button {
  border: 2px outset #eee;
  padding: 10px;
  background: #c0c0c0;
  text-align: left;
}

#file-output {
  min-height: 100px;
  border: 2px inset #eee;
  padding: 10px;
  background: #fff;
}

#melt {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      #111 0 8%,
      #5b1212 8% 16%,
      #d08b2c 16% 24%,
      #111 24% 34%,
      #efe1bd 34% 45%,
      #5b1212 45% 57%,
      #111 57% 68%,
      #d08b2c 68% 79%,
      #efe1bd 79% 89%,
      #111 89% 100%
    );
  transform-origin: top;
  animation: melt-away 1.35s cubic-bezier(.7,0,.9,.2) forwards;
}

@keyframes blink {
  50% { visibility: hidden; }
}

@keyframes error-pop {
  from { transform: scale(.75); }
  to { transform: scale(1); }
}

@keyframes melt-away {
  0% {
    transform: translateY(0) scaleY(1);
    filter: blur(0);
  }
  55% {
    transform: translateY(18vh) scaleY(1.2);
    filter: blur(3px);
  }
  100% {
    transform: translateY(115vh) scaleY(2.6);
    filter: blur(12px);
  }
}

@keyframes pixel-away {
  0% {
    opacity: 1;
    transform: translate(0,0) scale(1);
  }
  100% {
    opacity: 0;
    transform:
      translate(var(--fly-x), var(--fly-y))
      rotate(20deg)
      scale(.08);
    filter: blur(8px);
  }
}

@keyframes fall {
  to {
    transform: translateY(120vh) rotate(720deg);
  }
}

@keyframes burst {
  to {
    transform: translate(var(--x), var(--y)) rotate(360deg);
    opacity: 0;
  }
}

@keyframes dance {
  0% { transform: rotate(-12deg); }
  100% { transform: rotate(12deg); }
}

@keyframes drift {
  to { left: 110vw; }
}

@keyframes worm-walk {
  to { left: 110vw; }
}

@media (max-width: 850px) {
  .desktop-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "apple"
      "cools"
      "visitor"
      "links"
      "junk"
      "message";
  }

  .apple-art {
    font-size: 7px;
  }

  .cool-s-art {
    font-size: 18px;
  }
}

@media (max-width: 600px) {
  .folder-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}
