
/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #E63946;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #ff4d5a;
}

/* Base Styling Extensions */
body {
  font-family: 'Noto Sans JP', sans-serif;
  background-color: #0f172a;
  color: #fff;
  line-height: 1.7;
  overflow-x: hidden;
  font-size: 14px;
  cursor: default;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

@media (min-width: 1024px) {
  body {
    font-size: 16px;
  }
  .p-8 {
    padding: 40px 12px !important;
  }
}

a, button {
  transition: all 0.3s ease;
}

/* Button Glow Effect */
.btn-glow {
  position: relative;
  overflow: hidden;
}
.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.btn-glow:hover::after {
  opacity: 1;
}

/* Global Section Padding */
section {
  padding-top: 70px;
  padding-bottom: 70px;
  margin-bottom: 0 !important; /* Overriding previous margin-bottom rule */
}

/* SP Padding 10px */
@media (max-width: 768px) {
  .container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

/* Text Titles */
/* Utility Overrides */
.gap-16 {
  gap: 2rem !important;
}

.sp-only {
  display: block;
}
@media (min-width: 769px) {
  .sp-only {
    display: none !important;
  }
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-title h2 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: normal;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.section-title .subtitle {
  font-size: 0.9rem;
  font-weight: 500;
  color: #FACC15;
  margin-top: 5px;
  letter-spacing: 0.3em;
}

/* Header Sticky Shadow on Scroll */
header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  background-color: rgba(15, 23, 42, 0.95) !important;
}
header.scrolled h1, header.scrolled a {
  color: #fff !important;
}
header.scrolled .hamburger-line {
  background-color: #fff !important;
}

/* First View Ken Burns Effect */
@keyframes kenburns {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.15); filter: brightness(1.1); }
}
.ken-burns {
  animation: kenburns 8s ease-out forwards;
}

@keyframes kenburns-infinite {
  0% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.1) translateY(-10px); }
  100% { transform: scale(1) translateY(0); }
}
.kenburns-infinite {
  animation: kenburns-infinite 20s ease-in-out infinite;
}

/* Texture Overlay */
.texture-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 15;
}

/* FV Floating Frame Style */
.fv-frame {
  width: 90%;
  height: 85%;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(230, 57, 70, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: auto;
}
@media (max-width: 768px) {
  .fv-frame {
    width: 95%;
    height: 90%;
    border-radius: 12px;
  }
}

/* Vertical Writing Mode */
.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
}
@media (max-width: 768px) {
  .vertical-text p {
    font-size: 0.7rem;
    letter-spacing: normal;
  }
  .vertical-text h2 {
    font-size: 2.2rem;
    letter-spacing: normal;
  }
  .vertical-text {
    height: auto;
    max-height: 40vh;
  }
}

/* FV Split Layout Shape */
@media (min-width: 1024px) {
  .lg\:clip-path-fv-shape {
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%);
    background-color: #1e293b !important;
  }
}

/* Scroll Line Animation */
@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
.animate-scroll-line {
  animation: scrollLine 2.5s infinite;
}

/* Scroll Reveal Animations */
.reveal {
  opacity: 0;
  transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1);
  will-change: transform, opacity;
}

.reveal-up { transform: translateY(40px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-zoom { transform: scale(0.9); }

.reveal.active {
  opacity: 1 !important;
  transform: translate(0, 0) scale(1) !important;
}

/* Staggered Delay Helpers */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* Image Styles */
.img-style-1 { filter: brightness(1.05) contrast(1.1); }
.img-style-2 { clip-path: polygon(0 0, 100% 5%, 100% 100%, 0 95%); }
.img-style-3 { border-left: 10px solid var(--primary-color); }
.img-style-4 { filter: sepia(0.2); }

/* Background Variants (Dark Mode) */
.bg-plain { background-color: var(--bg-dark); }
.bg-soft { background-color: #111827; }
.bg-accent-light { background-color: #1e293b; }
.bg-dark-section { background-color: #020617; color: #fff; }
.bg-dark-section h2, .bg-dark-section p { color: #fff; }

/* Marquee Gallery */
.marquee-wrapper {
  overflow: hidden;
  display: flex;
  width: 100%;
}
.marquee-content {
  display: flex;
  animation: marquee 40s linear infinite;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Lightbox Centering Fix */
.lum-lightbox {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.lum-lightbox-inner {
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Back to top */
#back-to-top {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 1000;
  cursor: pointer;
}

/* Responsive fixes */
@media (max-width: 1024px) {
  .section-title h2 { font-size: 2rem; }
}

/* Enhanced Looping Marker Animation */
.marker-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: 
    drawAndErase 6s ease-in-out infinite,
    wobble 0.5s ease-in-out infinite alternate;
}

@keyframes drawAndErase {
  0%, 10% { stroke-dashoffset: 1000; opacity: 0; }
  20% { opacity: 1; }
  35%, 65% { stroke-dashoffset: 0; }
  90%, 100% { stroke-dashoffset: -1000; opacity: 0; }
}

@keyframes wobble {
  from { transform: translateY(0) scaleX(1); }
  to { transform: translateY(2px) scaleX(1.02); }
}

/* Add a glowing filter to the marker for more style */
.marker-path {
  filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.4));
}

/* Trigger animation on active slide */
.swiper-slide-active .rounded-\[20px\] {
  opacity: 1 !important;
  transform: translate(0, 0) scale(1) !important;
}

/* ============================================================
   Animations & Interactivity
   ============================================================ */

/* Keyframes - Defined globally */
@keyframes breathingShape {
  from { transform: scale(1) translateX(0); opacity: 0.9; }
  to { transform: scale(1.05) translateX(-10px); opacity: 1; }
}
@keyframes textShimmer {
  to { background-position: 200% center; }
}
@keyframes navPulse {
  from { opacity: 0.7; transform: scale(1); }
  to { opacity: 1; transform: scale(1.02); }
}
@keyframes collageKenBurns {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}
@keyframes floatY {
  from { margin-top: 0; }
  to { margin-top: 10px; }
}
@keyframes fireFlicker {
  0% { transform: scale(1) rotate(0deg); opacity: 0.4; }
  100% { transform: scale(1.1) rotate(2deg); opacity: 0.8; }
}
@keyframes lightSweep {
  0% { left: -150%; }
  20%, 100% { left: 150%; }
}
@keyframes particleFloat {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  20% { opacity: 0.6; }
  80% { opacity: 0.6; }
  100% { transform: translateY(-100vh) translateX(50px); opacity: 0; }
}

/* Desktop Only Animations */
@media (min-width: 1025px) {
  .lg\:clip-path-fv-shape {
    animation: breathingShape 10s ease-in-out infinite alternate;
  }
  
  .section-title h2, #fv h2 {
    position: relative;
    background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.8) 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 5s linear infinite;
  }

  nav a {
    animation: navPulse 3s ease-in-out infinite alternate;
  }

  .swiper-slide-active img {
    animation: collageKenBurns 12s ease-in-out infinite alternate;
  }

  .swiper-slide-active .rounded-\[20px\] { animation: floatY 6s ease-in-out infinite alternate; }

  .swiper-slide .relative::after {
    animation: lightSweep 8s infinite;
  }

  .swiper-slide .relative::before {
    animation: fireFlicker 4s ease-in-out infinite alternate;
  }

  .particle {
    animation: particleFloat 15s linear infinite;
  }

  /* Smooth Parallax Transition */
  .swiper-slide img {
    transition: transform 0.2s ease-out !important;
  }
}

/* Static Mobile Reset - Allow Reveal Animations */
@media (max-width: 1024px) {
  *:not(.swiper-wrapper):not(.swiper-slide):not(.swiper-slide img):not(.marquee-content):not(.marquee-content *):not(.reveal):not(.reveal *):not(.swiper-pagination-bullet):not(.swiper-button-next):not(.swiper-button-prev):not(.glightbox-container):not(.glightbox-container *),
  *:not(.swiper-wrapper):not(.swiper-slide):not(.swiper-slide img):not(.marquee-content):not(.marquee-content *):not(.reveal):not(.reveal *):not(.glightbox-container):not(.glightbox-container *)::before,
  *:not(.swiper-wrapper):not(.swiper-slide):not(.swiper-slide img):not(.marquee-content):not(.marquee-content *):not(.reveal):not(.reveal *):not(.glightbox-container):not(.glightbox-container *)::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  
  /* GLightbox Mobile Fix */
  .glightbox-container {
    --transition-duration: 300ms;
    -webkit-overflow-scrolling: touch;
  }
  .gclose, .gnext, .gprev, .goverlay {
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
  }
  .gclose svg {
    pointer-events: none; /* Ensure the click event bubbles up to the button */
  }
  
  /* Restore necessary static colors for mobile shimmer targets */
  .section-title h2, #fv h2 {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: none !important;
  }

  /* Hide high-end interactive elements on mobile */
  .custom-cursor, .custom-cursor-outer, .particle-container {
    display: none !important;
  }

  /* Hamburger Menu Overlay Fix - Simple Display Toggle */
  #menu-overlay {
    background-color: #0f172a !important;
  }

  /* Custom Padding Overrides */
  .p-10, .p-8 {
    padding: 40px 10px !important;
  }

  /* Ensure FV elements are visible even without entrance animations */
  .swiper-slide .rounded-\[20px\] {
    opacity: 1 !important;
  }
}

/* Custom Cursor Base Styles (hidden by default on mobile) */
.custom-cursor, .custom-cursor-outer {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}
.custom-cursor-outer {
  width: 35px;
  height: 35px;
  background-color: transparent;
  border: 1px solid var(--primary-color);
  opacity: 0.5;
}

/* Floating Particles Base Styles */
.particle-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: linear-gradient(to top, #E63946, #FBBF24);
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.8);
  border-radius: 50%;
  filter: blur(1px);
}

/* Neo Animated Border for FV */
.animated-border {
  position: absolute;
  inset: -10px;
  border: 4px solid #E63946;
  border-radius: 25px;
  z-index: -1;
  animation: neonPulse 3s ease-in-out infinite;
}

@media (min-width: 1024px) {
  .animated-border {
    inset: -25px;
    border-radius: 50px;
    border-width: 6px;
  }
}

@keyframes neonPulse {
  0%, 100% {
    transform: scale(1);
    border-color: #E63946;
    box-shadow: 0 0 15px #E63946, 0 0 30px rgba(230, 57, 70, 0.4), inset 0 0 10px rgba(230, 57, 70, 0.4);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.03);
    border-color: #FBBF24;
    box-shadow: 0 0 20px #FBBF24, 0 0 40px rgba(250, 204, 21, 0.5), inset 0 0 15px rgba(250, 204, 21, 0.5);
    filter: brightness(1.2);
  }
}
