body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
  color: rgb(38, 15, 44);
  background-color: hsl(245, 19%, 23%);
  position: relative;
  transition: background-color 0.3s ease;
}

@keyframes backgroundAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background: var(--bg-gradient, radial-gradient(circle at center, #5147a8, #5c2788));
  z-index: -1;
  transition: background 0.2s ease;
}

.center {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 5;
  transition: opacity 0.4s ease;
  animation: fadeIn 2s ease-out;
}

.typing {
  font-family: 'Merriweather', serif;
  font-size: 2em;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid #000;
  width: 0;
  color: #2d1a00;
  padding: 6px 14px;
  border-radius: 8px;
  text-shadow: 0 0 8px rgba(255, 255, 150, 0.6);
  transition: opacity 0.4s ease;
}

.svg-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
}

.glow-button {
  display: inline-block;
  margin-top: 30px;
  padding: 10px 30px;
  font-size: 1.2em;
  border: none;
  border-radius: 10px;
  background: #00f0ff;
  color: black;
  box-shadow: 0 0 20px #00f0ff;
  transition: transform 0.2s, box-shadow 0.2s;
}
.glow-button:hover {
  box-shadow: 0 0 30px #00f0ff, 0 0 60px #00f0ff;
}

/* ======== Uusi, tyylikkäämpi nappi ======== */
.gallery-button {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  margin: 20px;
  padding: 0;
  width: 280px;
  height: 200px;
  flex-shrink: 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, #2d1c40 0%, #482b6d 100%);
  color: #f5f5f5;
  font-weight: 600;
  font-size: 1.2em;
  letter-spacing: 0.5px;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.35),
    inset 0 1px 4px rgba(255, 255, 255, 0.15);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.4s ease;
}

/* Kuvan tyyli napin taustalla */
.gallery-button img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  filter: brightness(0.65) contrast(1.1) saturate(0.9);
  transition: transform 0.6s ease, filter 0.6s ease;
  z-index: 1;
}

.gallery-button::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: rgb(0, 0, 0);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s ease;
  z-index: 3;
}

.gallery-button span {
  position: relative;
  z-index: 2;
  padding: 12px 20px;
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(6px);
  text-align: center;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  box-shadow: inset 0 -2px 8px rgba(0, 0, 0, 0.4);
  font-family: 'Merriweather', serif;
}

.gallery-button:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.gallery-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.4s ease;
  opacity: 0.7;
}

.gallery-button:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow:
    0 10px 25px rgba(80, 40, 120, 0.6),
    0 0 35px rgba(140, 90, 200, 0.4);
  background: linear-gradient(135deg, #3a215a 0%, #5a2d90 100%);
}

.gallery-button:hover img {
  transform: scale(1.07);
  filter: brightness(0.9) contrast(1.1) saturate(1.1);
}

.gallery-button:hover::after {
  opacity: 1;
}

.gallery-button:hover span {
  transform: translateY(-4px);
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.25);
}

.site-header, .site-footer {
  position: fixed;
  width: 100%;
  color: white;
  text-align: center;
}
.site-header {
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.4);
  padding: 10px;
  font-size: 1.5em;
  z-index: 100;
  backdrop-filter: blur(5px);
}
.site-footer {
  bottom: 0;
  padding: 10px 20px;
  background: transparent;
  font-size: 0.9em;
  z-index: 10;
}

.penrose {
  width: 4em;
  height: 4em;
  position: absolute;
  top: 0;
  color: hsl(0, 100%, 60%);
  animation: fallAndRotate linear infinite;
  transform-origin: 66% 66%;
  opacity: 0;
}
.penrose div {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: currentColor;
  clip-path: polygon(63% 0, 75% 0, 26% 85%, 89.5% 85%, 98.4% 100%, 0 100%);
  transform: rotate(calc((var(--n) - 1) * 120deg));
  filter: brightness(calc(1 - (var(--n) - 1) * 0.33));
}
.penrose div:nth-child(1){--n:1;}
.penrose div:nth-child(2){--n:2;top:18.3%;left:43.3%;}
.penrose div:nth-child(3){--n:3;top:46.5%;left:5.9%;}

@keyframes fallAndRotate {
  0% { transform: translateY(-120px) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

.highlight-gradient {
  font-weight: bold;
  background: linear-gradient(90deg, #481fa8, #1187ac, #811678, #ffffff, #ffffff, #474242);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  color: transparent;
  animation: gradientMove 3s linear infinite;
}
@keyframes gradientMove {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.green-fade {
  display: inline-block;
  animation: greenFade 6s infinite ease-in-out;
}
@keyframes greenFade {
  0% { color: #244421; }
  25% { color: #7bd389; }
  50% { color: #1c491d; }
  75% { color: #81c784; }
  100% { color: #21471d; }
}

#apila-template {
  display: none;
  position: absolute;
  width: 2em;
  height: 2em;
}
#apila-template > div {
  position: absolute;
  width: 50%;
  height: 50%;
  border-radius: 50%;
  background-color: var(--green);
}
#apila-template #main-square {
  width: 100%;
  height: 100%;
  border-radius: 0;
}
#apila-template .stem {
  position: absolute;
  width: 0.3em;
  height: 1.2em;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) rotate(15deg);
  background: linear-gradient(to bottom, var(--green) 70%, transparent 100%);
  border-radius: 0 0 50% 50%;
  opacity: 0.7;
}
#apila-template .leaf1-left { left: -25%; }
#apila-template .leaf1-right { top: -25%; }
#apila-template .leaf2-left { right: 0; top: -25%; }
#apila-template .leaf2-right { right: -25%; }
#apila-template .leaf3-left { right: -25%; bottom: 0; }
#apila-template .leaf3-right { right: 0; bottom: -25%; }
#apila-template .leaf4-left { bottom: -25%; }
#apila-template .leaf4-right { bottom: 0; left: -25%; }

.apila {
  position: fixed;
  width: 2em;
  height: 2em;
  pointer-events: none;
  opacity: 0;
  animation-fill-mode: forwards;
}

@keyframes apilaFloat {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

.penrose-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -60%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}