:root {
  --color-bg-dark: #222;
  --color-bg-darker: #333;
  --color-text: #fff;
  --color-accent: #00ff0d;
  --footer-height: 50px;
  --z-splash: 1000;
  --z-menu: 900;
  --z-overlay: 800;
  --z-header: 700;
  --z-base: 0;
  --z-modal: 1100;
}

@font-face {
  font-family: 'Russo One';
  src: url('fonts/RussoOne-Regular.woff2') format('woff2'),
       url('fonts/RussoOne-Regular.woff') format('woff');
  font-display: swap;
}

body {
  margin: 0;
  padding-bottom: var(--footer-height);
  font-family: 'Russo One', sans-serif;
  color: var(--color-text);
  text-align: center;
  min-width: 280px;
  background: linear-gradient(to bottom, var(--color-bg-dark), var(--color-bg-darker));
}

.fixed-icon {
  position: fixed;
  bottom: -20px;
  right: -50px;
  width: 40vw;
  height: auto;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 1s ease, transform 1s ease;
  transform: translateY(20px);
}
.fixed-icon.is-visible {
  opacity: 0.1;
  transform: translateY(0);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  width: 300vw;
  height: 300vh;
  background-size: 40px 40px;
}
body::before {
  background-image:
    linear-gradient(var(--color-bg-darker) 3px, transparent 1px),
    linear-gradient(90deg, var(--color-bg-darker) 3px, transparent 1px);
  opacity: 0.8;
  z-index: calc(var(--z-base) - 2);
  animation: gridMove 20s linear infinite;
}
body::after {
  background-image:
    linear-gradient(var(--color-bg-darker) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-bg-darker) 1px, transparent 1px);
  opacity: 0.5;
  z-index: calc(var(--z-base) - 1);
  animation: gridMove 3s linear infinite;
}
@keyframes gridMove {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 40px 40px, 40px 40px; }
}

#splash {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--color-bg-dark);
  z-index: var(--z-splash);
  transition: opacity 1s ease;
}
#splash.is-fadeout { opacity: 0; pointer-events: none; }
#logo {
  width: 220px;
  max-width: 60vw;
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity 0.8s ease, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}
#logo.is-enter { opacity: 1; transform: translateY(0) scale(1); }

header {
  background: rgba(0,0,0,0.4);
  height: 120px;
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 1rem;
  z-index: var(--z-header);
}
.site-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  text-shadow: 2px 2px 6px rgba(0,0,0,0.6);
}
.site-title img {
  height: 60px;
  width: auto;
}

.menu-toggle {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: calc(var(--z-menu) + 1);
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
}

.slide-menu {
  position: fixed;
  top: 0;
  left: -250px;
  width: 250px;
  height: 100vh;
  background: rgba(0,0,0,0.9);
  transition: left 0.3s ease;
  z-index: var(--z-menu);
  padding-top: 60px;
}
.slide-menu.is-active { left: 0; }
.slide-menu ul {
  list-style: none;
  margin: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.slide-menu a {
  color: var(--color-text);
  font-weight: bold;
  font-size: clamp(1rem, 3vw, 1.3rem);
  text-decoration: none;
  transition: color 0.3s ease;
}
.slide-menu a:hover { color: var(--color-accent); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  z-index: var(--z-overlay);
  transition: opacity 0.3s ease;
}
.overlay.is-active { opacity: 1; visibility: visible; }

#main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 1s ease;
}
#main.is-visible { opacity: 1; }

main { flex: 1; padding: 2rem; }
main p {
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  line-height: 1.6;
}

canvas {
  /*border: 2px solid #fff;*/
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  display: block;
}

h1 {
  font-size: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.6);
  text-align: left;
}
p {
  font-size: 1.2rem;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
  max-width: 1000px;
  margin: 0 auto;
  text-align: left;
}
p.center { text-align: center; }

a.fetch-page-link {
  font-size: 1.2rem;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
  text-align: left;
  color: var(--color-accent);
  cursor: pointer;
  transition: color 0.3s ease;
  text-decoration: underline;
  font-style: italic;
}
a.fetch-page-link:hover {
  color: var(--color-accent-hover, #ff6600);
}

footer {
  height: var(--footer-height);
  background: rgba(0,0,0,0.5);
  text-align: center;
  padding: 0.5rem;
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: var(--z-header);
}

li { cursor: pointer; margin: 0.5em 0; }
li:hover { color: blue; }
.fade-out { opacity: 0; }
#content {
  opacity: 1;
  transition: opacity 0.5s ease;
}
#content.is-fadeout { opacity: 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 15px;
  max-width: 1000px;
  margin: 0 auto;
}
.thumbnail {
  width: 100%;
  max-width: 120px;
  margin: auto;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.2s ease, opacity 0.3s ease;
}
.thumbnail:hover { transform: scale(1.05); opacity: 0.9; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 9999;
  overflow-y: auto;
}
.lightbox:target { opacity: 1; visibility: visible; }

.lightbox-content {
  max-width: 90vw;
  text-align: center;
  animation: fadeIn 0.5s;
}
.lightbox img {
  display: block;
  max-width: 90vw;
  max-height: 80vh;
  margin: 0 auto 1rem;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(255,255,255,0.3);
  object-fit: contain;
}
.caption {
  font-family: 'Russo One', sans-serif;
  color: #fff;
  text-align: left;
  padding: 0 0.5rem;
}
.caption h3 {
  margin: 0 0 0.5rem;
  font-size: 20px;
  font-weight: bold;
}
.caption p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-line;
}
.close {
  position: fixed;
  top: 20px;
  right: 30px;
  font-size: 30px;
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.close:hover { transform: scale(1.2); }

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

video {
  max-width: 90vw;
  max-height: 80vh;
  border: 2px solid #fff;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.social-links img {
  max-width: 150px;
  width: 100%;
  height: auto;
  transition: transform 0.2s ease;
}
.social-links img:hover {
  transform: scale(1.05);
}

.character {
  margin: 0 auto;
  width: 100%;
  max-width: 500px;
  min-width: 150px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 10px #ceffe6);
  animation: glow 5s infinite alternate, float 5s ease-in-out infinite;
}
@keyframes glow {
  from { filter: drop-shadow(0 0 10px #ceffe6); }
  to   { filter: drop-shadow(0 0 20px #ceffe6); }
}
@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}
