/* =================================================================
   studio CLOTO - Animations & Effects
   ================================================================= */
/* 初期表示で文字を一瞬表示しないための可視制御 */
.glowAnime {
  visibility: hidden;
}
.glowAnime.glow {
  visibility: visible;
}

/* ===== Text Glow Animation ===== */
.glowAnime span {
  opacity: 0;
}

.glowAnime.glow span {
  animation: glow_anime_on 1s ease-out forwards;
}

@keyframes glow_anime_on {
  0% {
    opacity: 0;
    text-shadow:
      0 0 0 #fff,
      0 0 0 #fff;
  }
  50% {
    opacity: 1;
    text-shadow:
      0 0 10px #fff,
      0 0 15px #fff;
  }
  100% {
    opacity: 1;
    text-shadow:
      0 0 0 #fff,
      0 0 0 #fff;
  }
}

/* ===== Fade In Animation ===== */
.fadeInElement {
  opacity: 0;
  animation: fadeIn 1.2s ease-out forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* ===== Hero Animations ===== */
/* note: hero-specific keyframes are referenced by hero.css (title-line/float) */
.hero__title-line {
  display: block;
  opacity: 0;
  transform: translateY(50px);
  animation: slideInUp 1s ease forwards;
  white-space: nowrap;
}

.hero__title-line:nth-child(1) {
  animation-delay: 0.2s;
}
.hero__title-line:nth-child(2) {
  animation-delay: 0.4s;
}
.hero__title-line:nth-child(3) {
  animation-delay: 0.6s;
}

.hero__subtitle {
  opacity: 0;
  animation: fadeIn 1s ease 0.8s forwards;
}

.hero__description {
  opacity: 0;
  animation: fadeIn 1s ease 1s forwards;
}

.hero__cta {
  opacity: 0;
  animation: fadeIn 1s ease 1.2s forwards;
}

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Kanji Logo Float Animation ===== */
.hero__kanji-logo {
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.3));
  transition:
    transform 0.1s ease-out,
    opacity 0.1s ease-out;
}

.hero__kanji-logo--scrolling {
  animation: none;
  filter: drop-shadow(0 0 30px rgba(246, 191, 0, 0.4))
    drop-shadow(0 0 60px rgba(0, 0, 0, 0.5));
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.02);
  }
}

/* ===== Scroll Indicator Animations ===== */
.scroll-indicator {
  animation: scrollGlimmer 4s ease-in-out infinite;
}

.scroll-indicator__line {
  animation:
    scrollPulse 2s ease-in-out infinite,
    scrollLineGlimmer 4s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.2);
  }
}

@keyframes scrollGlimmer {
  0%,
  85%,
  100% {
    color: var(--color-gray);
    text-shadow: none;
  }
  90%,
  95% {
    color: var(--color-accent);
    text-shadow: 0 0 10px rgba(246, 191, 0, 0.6);
  }
}

@keyframes scrollLineGlimmer {
  0%,
  85%,
  100% {
    background: linear-gradient(to bottom, var(--color-gray), transparent);
    box-shadow: none;
  }
  90%,
  95% {
    background: linear-gradient(to bottom, var(--color-accent), transparent);
    box-shadow: 0 0 8px rgba(246, 191, 0, 0.5);
  }
}

/* ===== Button Animations ===== */
.hero__cta .btn {
  position: relative;
  overflow: hidden;
  background-size: 200% 100%;
  transition: all 0.3s ease;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  min-width: 210px;
  text-align: center;
}

.hero__cta .btn--primary {
  background: linear-gradient(-45deg, #f6bf00, #ff8c00, #ff6b35, #f6bf00);
  background-size: 400% 400%;
  animation: gradientFlow 3s ease infinite;
  color: white;
  border: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero__cta .btn--outline {
  background: linear-gradient(
    -45deg,
    transparent,
    rgba(135, 176, 197, 0.1),
    transparent,
    rgba(176, 196, 222, 0.1)
  );
  background-size: 400% 400%;
  animation: gradientFlow 3s ease infinite;
  border: 2px solid #87b0c5;
  color: white;
  position: relative;
}

.hero__cta .btn--outline::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(-45deg, #87b0c5, #b0c4de, #708090, #87b0c5);
  background-size: 400% 400%;
  animation: gradientFlow 3s ease infinite;
  border-radius: 6px;
  z-index: -1;
}

@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero__cta .btn:hover {
  transform: translateY(-2px);
}

.hero__cta .btn--primary:hover {
  box-shadow: 0 8px 20px rgba(246, 191, 0, 0.4);
}

.hero__cta .btn--outline:hover {
  box-shadow: 0 8px 20px rgba(135, 176, 197, 0.3);
}

/* ===== Button Hover Effects ===== */
.btn--primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  transition: left 0.5s ease;
}

.btn--primary::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    #ff6b35,
    var(--color-accent),
    #ffcd3c,
    #ff9f40
  );
  border-radius: inherit;
  z-index: -1;
  animation: primaryBorderFlow 2s linear infinite;
}

.btn--primary:hover::before {
  left: 100%;
}

.btn--primary:hover {
  background: linear-gradient(
    135deg,
    #ff6b35,
    #ffcd3c,
    var(--color-accent),
    #ff9f40
  );
  color: var(--color-black);
  transform: translateY(-3px) scale(1.05);
}

@keyframes primaryBorderFlow {
  0% {
    background: linear-gradient(
      45deg,
      #ff6b35,
      var(--color-accent),
      #ffcd3c,
      #ff9f40
    );
  }
  25% {
    background: linear-gradient(
      45deg,
      var(--color-accent),
      #ffcd3c,
      #ff9f40,
      #ff6b35
    );
  }
  50% {
    background: linear-gradient(
      45deg,
      #ffcd3c,
      #ff9f40,
      #ff6b35,
      var(--color-accent)
    );
  }
  75% {
    background: linear-gradient(
      45deg,
      #ff9f40,
      #ff6b35,
      var(--color-accent),
      #ffcd3c
    );
  }
  100% {
    background: linear-gradient(
      45deg,
      #ff6b35,
      var(--color-accent),
      #ffcd3c,
      #ff9f40
    );
  }
}

/* ===== Vision Section Geometric Animations ===== */
.vision__geometric--today {
  animation: pulseGlow 3s ease-in-out infinite;
}

.vision__geometric--2030 {
  animation: rotateGlow 6s linear infinite;
}

.vision__geometric--2040 {
  animation: floatGlow 4s ease-in-out infinite;
}

.vision__geometric--2050 {
  animation: sparkleGlow 5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 30px rgba(246, 191, 0, 0.3));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 50px rgba(246, 191, 0, 0.6));
  }
}

@keyframes rotateGlow {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.05);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes floatGlow {
  0%,
  100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

@keyframes sparkleGlow {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
    filter: drop-shadow(0 0 30px rgba(246, 191, 0, 0.3));
  }
  25% {
    transform: rotate(90deg) scale(1.1);
    filter: drop-shadow(0 0 50px rgba(246, 191, 0, 0.6));
  }
  50% {
    transform: rotate(180deg) scale(1);
    filter: drop-shadow(0 0 40px rgba(246, 191, 0, 0.5));
  }
  75% {
    transform: rotate(270deg) scale(1.05);
    filter: drop-shadow(0 0 60px rgba(246, 191, 0, 0.7));
  }
}

/* ===== About Section Geometric Animations ===== */
.about__geometric--mission {
  animation: aboutPulseGlow 3s ease-in-out infinite;
}

.about__geometric--vision {
  animation: aboutRotateGlow 6s linear infinite;
}

.about__geometric--values {
  animation: aboutFloatGlow 4s ease-in-out infinite;
}

.about__geometric--future {
  animation: aboutSparkleGlow 5s ease-in-out infinite;
}

@keyframes aboutPulseGlow {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 30px rgba(246, 191, 0, 0.3));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 50px rgba(246, 191, 0, 0.6));
  }
}

@keyframes aboutRotateGlow {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.05);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes aboutFloatGlow {
  0%,
  100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

@keyframes aboutSparkleGlow {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
    filter: drop-shadow(0 0 30px rgba(246, 191, 0, 0.3));
  }
  25% {
    transform: rotate(90deg) scale(1.1);
    filter: drop-shadow(0 0 50px rgba(246, 191, 0, 0.6));
  }
  50% {
    transform: rotate(180deg) scale(1);
    filter: drop-shadow(0 0 40px rgba(246, 191, 0, 0.5));
  }
  75% {
    transform: rotate(270deg) scale(1.05);
    filter: drop-shadow(0 0 60px rgba(246, 191, 0, 0.7));
  }
}

/* ===== Service Card Slide Animations ===== */
.service-section:nth-child(odd) .service-overview {
  animation: slideInLeft 0.8s ease-out;
}

.service-section:nth-child(even) .service-detail {
  animation: slideInRight 0.8s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== Progress Bar Animations ===== */
.vision-progress__fill {
  animation: visionProgressFill linear both;
  animation-timeline: --vision-pin;
  animation-range: contain 0% contain 100%;
  transform-origin: left center;
  will-change: transform;
}

/* Disable CSS progress animation when JS fallback is active to avoid double-updates (Safari) */
.js-scroll-active .vision-progress__fill {
  animation: none !important;
}

@keyframes visionProgressFill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.about-progress__fill {
  animation: aboutProgressFill linear both;
  animation-timeline: --about-pin;
  animation-range: contain 0% contain 100%;
}

@keyframes aboutProgressFill {
  from {
    height: 0%;
  }
  to {
    height: 100%;
  }
}

/* ===== Marker Animations ===== */
/* Disable marker animations when JS fallback is active (Safari) */
.js-scroll-active .vision-progress__marker {
  animation: none !important;
}

/* Vision Progress Markers */
.vision-progress__marker:nth-child(1) {
  animation: markerActivate1 linear both;
  animation-timeline: --vision-pin;
  animation-range: contain 0% contain 20%;
}

.vision-progress__marker:nth-child(2) {
  animation: markerActivate2 linear both;
  animation-timeline: --vision-pin;
  animation-range: contain 20% contain 40%;
}

.vision-progress__marker:nth-child(3) {
  animation: markerActivate3 linear both;
  animation-timeline: --vision-pin;
  animation-range: contain 40% contain 60%;
}

.vision-progress__marker:nth-child(4) {
  animation: markerActivate4 linear both;
  animation-timeline: --vision-pin;
  animation-range: contain 60% contain 80%;
}

.vision-progress__marker:nth-child(5) {
  animation: markerActivate5 linear both;
  animation-timeline: --vision-pin;
  animation-range: contain 80% contain 100%;
}

/* About Progress Markers */
.about-progress__marker:nth-child(1) {
  animation: aboutMarkerActivate1 linear both;
  animation-timeline: --about-pin;
  animation-range: contain 0% contain 25%;
}

.about-progress__marker:nth-child(2) {
  animation: aboutMarkerActivate2 linear both;
  animation-timeline: --about-pin;
  animation-range: contain 25% contain 50%;
}

.about-progress__marker:nth-child(3) {
  animation: aboutMarkerActivate3 linear both;
  animation-timeline: --about-pin;
  animation-range: contain 50% contain 75%;
}

.about-progress__marker:nth-child(4) {
  animation: aboutMarkerActivate4 linear both;
  animation-timeline: --about-pin;
  animation-range: contain 75% contain 100%;
}

/* Marker Activate Keyframes */
@keyframes markerActivate1 {
  from {
    color: var(--color-gray);
    opacity: 0.6;
  }
  to {
    color: #4a90e2;
    opacity: 1;
    text-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
  }
}

@keyframes aboutMarkerActivate1 {
  from {
    color: var(--color-gray);
    opacity: 0.6;
  }
  to {
    color: var(--color-accent);
    opacity: 1;
    text-shadow: 0 0 10px rgba(246, 191, 0, 0.5);
  }
}

@keyframes markerActivate2 {
  from {
    color: var(--color-gray);
    opacity: 0.6;
  }
  to {
    color: #8b5cf6;
    opacity: 1;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
  }
}

@keyframes aboutMarkerActivate2 {
  from {
    color: var(--color-gray);
    opacity: 0.6;
  }
  to {
    color: #ff6b35;
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
  }
}

@keyframes markerActivate3 {
  from {
    color: var(--color-gray);
    opacity: 0.6;
  }
  to {
    color: #ec4899;
    opacity: 1;
    text-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
  }
}

@keyframes aboutMarkerActivate3 {
  from {
    color: var(--color-gray);
    opacity: 0.6;
  }
  to {
    color: #00d4aa;
    opacity: 1;
    text-shadow: 0 0 10px rgba(0, 212, 170, 0.5);
  }
}

@keyframes markerActivate4 {
  from {
    color: var(--color-gray);
    opacity: 0.6;
  }
  to {
    color: #f59e0b;
    opacity: 1;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  }
}

@keyframes markerActivate5 {
  from {
    color: var(--color-gray);
    opacity: 0.6;
  }
  to {
    color: #f6bf00;
    opacity: 1;
    text-shadow: 0 0 10px rgba(246, 191, 0, 0.5);
  }
}

@keyframes aboutMarkerActivate4 {
  from {
    color: var(--color-gray);
    opacity: 0.6;
  }
  to {
    color: #f093fb;
    opacity: 1;
    text-shadow: 0 0 10px rgba(240, 147, 251, 0.5);
  }
}

/* ===== Mobile Responsive Animations ===== */
@media (max-width: 480px) {
  .hero__kanji-logo--scrolling {
    filter: drop-shadow(0 0 15px rgba(246, 191, 0, 0.3))
      drop-shadow(0 0 30px rgba(0, 0, 0, 0.4));
  }

  .vision__geometric,
  .about__geometric {
    width: 150px;
    height: 150px;
  }
}

/* ===== Override: Disable slide-in from bottom for hero title line ===== */
.hero__title-line {
  animation: none !important;
  transform: none !important;
  opacity: 1;
}

/* ===== Simple fadeUp utility (for splash logo etc.) ===== */
.fadeUp {
  animation-name: fadeUpAnime;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
  opacity: 0;
}
@keyframes fadeUpAnime {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
