/* STICKY — rebuilt from the original Neocities site */

* { box-sizing: border-box; }

html, body { margin: 0; }
[hidden] { display: none !important; }

body {
  font-family: Verdana, Geneva, sans-serif;
  color: #000;
  background: #fff;
}

img { display: block; max-width: 100%; height: auto; }

a:focus-visible { outline: 3px solid #2b4a7a; outline-offset: 6px; border-radius: 12px; }

/* ---------- Splash (index) ---------- */
body.splash {
  min-height: 100vh;
  background: #fff url("img/bg.gif") repeat;
  background-size: 2000px;
}
.splash main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(60px, 18vh, 150px) 16px 60px;
}
.splash .enter img {
  width: min(600px, 90vw);
  transition: transform .15s ease;
}
.splash .enter:hover img { transform: scale(1.04) rotate(-1.5deg); }
.splash .logo {
  width: min(300px, 45vw);
  margin-top: max(-70px, -11vw);
  pointer-events: none;
}

/* ---------- Home ---------- */
body.home {
  background: whitesmoke;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
.home main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 40px 16px 32px;
}
.home .stickyman { width: min(500px, 82vw); margin-top: clamp(24px, 6vh, 64px); }

.links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(12px, 5vw, 56px);
  width: 100%;
}
/* all three buttons share one square size, centered in a row */
.links a {
  flex: 0 0 auto;
  width: clamp(90px, 26vw, 240px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #000;
  text-decoration: none;
  animation: sway 3.2s ease-in-out infinite;
  transform-origin: 50% 90%;
  position: relative;
  padding-bottom: 6px;
}
.links a:nth-child(2) { animation-delay: -1.1s; }
.links a:nth-child(3) { animation-delay: -2.2s; }
@keyframes sway {
  0%, 100% { transform: rotate(-2deg); }
  50%      { transform: rotate(2deg); }
}
.links a:hover { animation-play-state: paused; }

.links .icon {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.links .icon img { width: 100%; height: 100%; object-fit: contain; transition: transform .15s ease; }
/* x and airplane a little smaller than the stick figure */
.links .x .icon img,
.links .tele .icon img { width: 72%; height: 72%; }
.links a:hover .icon img { transform: scale(1.06); }

/* hand-drawn circle that scribbles in on hover */
/* circle wraps the picture and its word */
.scribble {
  position: absolute;
  top: -10%;
  left: -14%;
  width: 128%;
  height: 130%;
  pointer-events: none;
  overflow: visible;
}
.scribble path {
  fill: none;
  stroke: #d40000;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 720;
  stroke-dashoffset: 720;
  transition: stroke-dashoffset .45s ease;
}
.links a:hover .scribble path,
.links a:focus-visible .scribble path { stroke-dashoffset: 0; }
.links a:focus-visible { outline: none; }

.links .label {
  font-family: "Gochi Hand", "Comic Sans MS", cursive;
  font-size: clamp(20px, 3.4vw, 30px);
  line-height: 1;
}

/* stick figure walks to the games door and goes through it */
.stroll {
  --door-w: clamp(64px, 8vw, 96px);
  --door-h: clamp(104px, 13vw, 156px);
  --door-right: clamp(16px, 8vw, 120px);
  position: relative;
  height: calc(var(--door-h) + 46px);
}
.walker {
  position: absolute;
  bottom: 0;
  left: -130px;
  height: calc(var(--door-h) * .72);
  width: auto;
  z-index: 2;
  pointer-events: none;
  animation: pace 22s linear infinite;
}
/* idle: pace back and forth, turning around before the door */
@keyframes pace {
  0%     { left: -130px; transform: scaleX(1); }
  49.9%  { left: calc(100% - var(--door-right) - var(--door-w) - 150px); transform: scaleX(1); }
  50%    { left: calc(100% - var(--door-right) - var(--door-w) - 150px); transform: scaleX(-1); }
  99.9%  { left: -130px; transform: scaleX(-1); }
  100%   { left: -130px; transform: scaleX(1); }
}

.door {
  position: absolute;
  right: var(--door-right);
  bottom: 0;
  width: var(--door-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #000;
}
.sign {
  font-family: "Gochi Hand", "Comic Sans MS", cursive;
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1;
  background: #fff;
  border: 2.5px solid #000;
  border-radius: 6px 9px 5px 8px;
  padding: 3px 10px 5px;
  transform: rotate(-4deg);
  box-shadow: 2px 2px 0 #000;
  white-space: nowrap;
}
.doorway {
  position: relative;
  width: 100%;
  height: var(--door-h);
  border: 3px solid #000;
  border-bottom: 0;
  border-radius: 8px 10px 0 0;
  background: #fff;
  perspective: 400px;
  overflow: hidden;
}
.inside {
  position: absolute;
  inset: 0;
  background: #111;
  border-radius: 5px 7px 0 0;
}
.panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #fff;
  border: 2.5px solid #000;
  border-bottom: 0;
  border-radius: 4px 6px 0 0;
  transform-origin: left center;
  transition: transform .5s ease;
}
.knob {
  position: absolute;
  right: 12%;
  top: 52%;
  width: 9px;
  height: 9px;
  border: 2.5px solid #000;
  border-radius: 50%;
}
/* closed until someone clicks "games"; a hover just cracks it open */
.door:hover .panel, .door:focus-visible .panel { transform: rotateY(-14deg); }
.door.open .panel { transform: rotateY(-80deg); }
.door:hover .sign { transform: rotate(3deg) scale(1.06); }
.door:focus-visible { outline: 3px solid #d40000; outline-offset: 6px; border-radius: 8px; }

.home footer {
  border-top: 2px solid #000;
  margin: 0 16px;
  padding: 10px 0 18px;
  text-align: center;
  font-family: "Gochi Hand", "Comic Sans MS", cursive;
  font-size: 18px;
}

.small-link {
  font-size: 14px;
  color: #555;
  text-decoration: none;
  border-bottom: 1px dashed #999;
}
.small-link:hover { color: #000; border-bottom-color: #000; }

/* ---------- 404 ---------- */
body.lost {
  min-height: 100vh;
  background: whitesmoke;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
}
.lost img { width: 180px; margin: 0 auto 16px; }
.lost h1 { margin: 0 0 8px; font-size: 28px; }
.lost p { margin: 0 0 20px; }

@media (prefers-reduced-motion: reduce) {
  .enter img, .links .icon img, .scribble path { transition: none; }
  .links a, .walker { animation: none; }
  .walker { left: 16px; }
  .panel { transition: none; }
}
