body {
  background-image: url('img/bgtex.png');
  background-size: 256px 256px;
  background-repeat: repeat;
  image-rendering: pixelated;
  margin: 0;
  font-family: 'Tiny5', monospace;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  text-transform: uppercase;
}

::selection {
  background: #e8b939;
  color: #222;
}

.logo-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  image-rendering: pixelated;
  background: rgba(200, 200, 200, 0.7);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
  padding: 8px;
  box-sizing: border-box;
  transition: transform 0.1s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}

.logo.jostle {
  animation: jostle 0.3s ease-in-out infinite;
}

@keyframes jostle {
  0% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-4px) rotate(-1deg); }
  50% { transform: translateX(0) rotate(0); }
  75% { transform: translateX(4px) rotate(1deg); }
  100% { transform: translateX(0) rotate(0); }
}

/* Mining cracks */
.cracks {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  pointer-events: none;
}

.crack {
  fill: none;
  stroke: #2e2e2e;
  stroke-width: 2.5;
  stroke-linecap: square;
  opacity: 0;
}

.logo-wrap[data-stage="1"] .c1,
.logo-wrap[data-stage="2"] .c1,
.logo-wrap[data-stage="2"] .c2,
.logo-wrap[data-stage="3"] .crack {
  opacity: 1;
}

/* Shatter */
.shard {
  position: absolute;
  inset: 8px;
  background-image: url('img/kawpuhlogo.png');
  background-size: 100% 100%;
  image-rendering: pixelated;
  pointer-events: none;
  opacity: 0;
}

.s1 { clip-path: polygon(0 0, 55% 0, 48% 50%, 0 40%); --tx: -40px; --ty: -36px; --rot: -40deg; }
.s2 { clip-path: polygon(55% 0, 100% 0, 100% 45%, 48% 50%); --tx: 40px; --ty: -32px; --rot: 35deg; }
.s3 { clip-path: polygon(0 40%, 48% 50%, 30% 100%, 0 100%); --tx: -44px; --ty: 28px; --rot: -25deg; }
.s4 { clip-path: polygon(48% 50%, 100% 45%, 100% 100%, 70% 100%); --tx: 44px; --ty: 32px; --rot: 30deg; }
.s5 { clip-path: polygon(30% 100%, 48% 50%, 70% 100%); --tx: 2px; --ty: 52px; --rot: 12deg; }

.shattering .logo,
.shattering .cracks {
  visibility: hidden;
}

.shattering .shard {
  animation: shard-fly 0.8s ease-out forwards;
}

@keyframes shard-fly {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)); }
}

.container {
  width: 90%;
  background: rgba(34, 34, 34, 0.97);
  border: 4px solid #fff;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.45);
  padding: 32px;
  max-width: 720px;
}

.title {
  color: #fff;
  font-size: 24px;
  margin: 0 0 12px 0;
  text-align: center;
  font-weight: normal;
  letter-spacing: 0.12em;
}

.title::after {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: #e8b939;
  margin: 12px auto 0;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.nav-link {
  display: block;
  background: #444;
  color: #fff;
  text-decoration: none;
  padding: 16px;
  border: 2px solid #666;
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.06em;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
  transition: background 0.1s, border-color 0.1s, transform 0.1s, box-shadow 0.1s;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: #555;
  border-color: #e8b939;
  color: #ffe9a8;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
  outline: none;
}

.nav-link:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

.social-links {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 2px dashed #555;
}

.social-link {
  flex: 1;
  display: block;
  background: #333;
  color: #fff;
  text-decoration: none;
  padding: 12px;
  border: 2px solid #555;
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.06em;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
  transition: background 0.1s, border-color 0.1s, transform 0.1s, box-shadow 0.1s;
}

.social-link:hover,
.social-link:focus-visible {
  background: #444;
  border-color: #e8b939;
  color: #ffe9a8;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.4);
  outline: none;
}

.social-link:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

/* Responsive breakpoints */
@media (min-width: 480px) {
  .logo-wrap {
    width: 96px;
    height: 96px;
  }

  .title {
    font-size: 28px;
  }

  .nav-link {
    font-size: 16px;
  }

  .social-link {
    font-size: 13px;
  }
}

@media (min-width: 768px) {
  .logo-wrap {
    width: 112px;
    height: 112px;
  }

  .container {
    width: 80%;
  }

  .title {
    font-size: 32px;
  }

  .nav-link {
    font-size: 18px;
  }

  .social-link {
    font-size: 14px;
  }
}

@media (min-width: 1024px) {
  .logo-wrap {
    width: 128px;
    height: 128px;
  }

  .container {
    width: 70%;
  }

  .title {
    font-size: 36px;
  }

  .nav-link {
    font-size: 20px;
  }

  .social-link {
    font-size: 15px;
  }
}

@media (min-width: 1200px) {
  .logo-wrap {
    width: 144px;
    height: 144px;
  }

  .container {
    width: 60%;
  }

  .title {
    font-size: 40px;
  }

  .nav-link {
    font-size: 22px;
  }

  .social-link {
    font-size: 16px;
  }
}
