/* RESET & BASIC LAYOUT */
html, body {
  margin: 0; 
  padding: 0;
  width: 100%; 
  height: 100%;
  overflow-x: hidden;
}

html {
  background: #16161D;
}
body {
  background: transparent;
  overflow: hidden; 
  display: flex; 
  justify-content: center; 
  align-items: center;
}

/* BACKGROUND VIDEO */
.bg-video {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  object-fit: cover;
  z-index: -10;
  opacity: 0.33;
}

/* PATTERN OVERLAY */
.pattern-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background: url('pat-2.png') repeat;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* MARQUEE (fog animation) */
.fogMarquee {
  position: fixed;
  bottom: -10%;
  left: 0;
  width: 100vw;
  height: 560px; 
  overflow: hidden;
  opacity: 0.66;
  z-index: 999;
}
.fogMarquee ul {
  display: flex;
  margin: 0; 
  padding: 0;
  list-style: none;
  width: 5980px; 
  animation: marqueeScroll 60s linear infinite;
  will-change: transform;
}
.item1, .item2, .item3, .item4 {
  margin-left: -690px;
}
.fogMarquee li img {
  width: 1840px;
  height: auto;
}
@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-2990px); }
}

/* THIRD FOG */
.fog3 {
  position: fixed;
  bottom: -10%;
  left: 0;
  width: 1840px; 
  height: 560px;
  background: url('fog3.png') no-repeat center;
  background-size: auto;
  pointer-events: none;
  z-index: 1000;
  animation: driftFog3 36s linear infinite,
             fadeFog3 18s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes driftFog3 {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-120vw); }
}
@keyframes fadeFog3 {
  0%, 100% { opacity: 0.50; }
  50%      { opacity: 0; }
}

/* CONTENT (LOGO) */
.content {
  z-index: 2000; 
  text-align: center;
  transition: opacity 0.8s ease;
}

/* Base styling for .intro */
.intro {
  position: absolute;
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Noto Serif JP', serif;
  font-size: 18px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  max-width: min(800px, calc(100% - 60px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease;
  z-index: 9999;
}

/* Mobile override: let the text span nearly the full width */
@media (max-width: 768px) {
  .intro {
    /* Instead of centering by left:50% and transform, we use left/right */
    left: 20px;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    max-width: 100%;
    width: auto;
    /* Optionally adjust font size if desired */
    font-size: 18px; /* or a slightly larger value if needed */
    line-height: 1.8;
  }
}
.intro.show {
  opacity: 1;
  pointer-events: auto;
}

/* HIGHLIGHT (for Sōen and Kanji) */
.highlight {
  color: #ffffff;
}

/* SOUND BUTTON */
.sound-btn {
  position: fixed;
  bottom: 30px; 
  right: 30px;
  width: 64px;
  height: 64px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  z-index: 9999;
  outline: none;
}
.sound-btn svg {
  width: 100%;
  height: 100%;
}

/* Hide the logo when sound is on */
body.soundOnFocus .content {
  opacity: 0;
  pointer-events: none;
}

/* MEDIA QUERY for smaller devices */
@media (max-width: 768px) {
  /* Scale down the logo so the background circle is visible with ~10px leeway */
  .content svg {
    max-width: calc(100% - 15px);
    width: 100%;
    height: auto;
  }

  /* Increase intro text size */
  .intro {
    font-size: 18px;
    line-height: 1.8;
  }
}

/* NOSCRIPT message styling */
.noscript-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #ffcc00;
  color: #000;
  text-align: center;
  padding: 10px;
  z-index: 10000;
}
