/* ===== Global Typography ===== */
body {
  font-family: 'Noto Sans JP', sans-serif;
}

/* Hide default cursor on pointer devices */
@media (pointer: fine) {
  body {
    cursor: none;
  }
}

/* ===== Custom Cursor ===== */
#cursor-glow {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(0, 169, 157, 0.15) 0%,
    rgba(0, 0, 0, 0) 70%
  );
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  z-index: 9999;
  -webkit-transition: opacity 0.3s;
  transition: opacity 0.3s;
}

#cursor-dot {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: #00A99D;
  border-radius: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  z-index: 10000;
  box-shadow: 0 0 10px #00A99D;
}

/* ===== Hero / Utility ===== */
.hero-gradient {
  background: linear-gradient(135deg, #0a0f0d 0%, #001a17 100%);
}

.text-shadow {
  text-shadow: 0 0 20px rgba(0, 169, 157, 0.3);
}

.fade-in-up {
  opacity: 0;
  -webkit-transform: translateY(20px);
  transform: translateY(20px);
  -webkit-transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in-up.visible {
  opacity: 1;
  -webkit-transform: translateY(0);
  transform: translateY(0);
}

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }

/* Cyber grid background */
.cyber-grid {
  background-image:
    linear-gradient(rgba(0, 169, 157, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 169, 157, 0.25) 1px, transparent 1px);
  background-size: 50px 50px;
  -webkit-perspective: 500px;
  perspective: 500px;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  -webkit-animation: grid-move 20s linear infinite;
  animation: grid-move 20s linear infinite;
}

/* Typing effect container */
.typing-container {
  display: inline-block;
  overflow: hidden;
  border-right: 3px solid #00A99D;
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: 0.10em;
}

/* Smooth scroll padding for fixed header */
html {
  scroll-padding-top: 80px;
}

/* ▼▼ モバイルでのスクロールアンカー中央寄せ修正 ▼▼ */
@media (max-width: 768px) {
  .scroll-anchor-center-fix {
    width: 100% !important;
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
  }
}
/* ▲▲ 修正ここまで ▲▲ */

/* ===== Reduced motion support ===== */
@media (prefers-reduced-motion: reduce) {
  #cursor-glow {
    -webkit-transition: none;
    transition: none;
    display: none;
  }

  #cursor-dot {
    -webkit-transition: none;
    transition: none;
    display: none;
  }
}

/* ===== Light Theme ===== */
body.theme-light {
  background-color: #f4f4f5;
  color: #0f172a;
}

/* ヒーロー背景を明るく */
body.theme-light .hero-gradient {
  background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
}

/* 全体のベース背景 */
body.theme-light header,
body.theme-light footer {
  background-color: #f9fafb !important;
}

/* Dark系背景を明るく（カード・セクション・フォーム） */
body.theme-light .bg-meme-dark,
body.theme-light .bg-meme-dark-lighter,
body.theme-light .bg-black {
  background-color: #ffffff !important;
}

/* セクション背景（TOP） */
body.theme-light section#about,
body.theme-light section#service,
body.theme-light section#works,
body.theme-light section#company {
  background-color: #f9fafb !important;
}

/* COMPANYページのヒーローも明るいグラデーションに */
body.theme-light .company-hero {
  background: linear-gradient(135deg, #5e7b6f 0%, #0a3731 100%) !important;
}

/* テキスト色の調整 */
body.theme-light .text-white {
  color: #111827 !important;
}

body.theme-light .text-gray-200,
body.theme-light .text-gray-300,
body.theme-light .text-gray-400,
body.theme-light .text-gray-500 {
  color: #4b5563 !important;
}

/* 枠線を明るく */
body.theme-light .border-gray-700,
body.theme-light .border-gray-800,
body.theme-light .border-gray-900 {
  border-color: #e5e7eb !important;
}

/* カードなどのダークグレー背景 */
body.theme-light .bg-gray-800 {
  background-color: #e5e7eb !important;
}

/* ロゴ背景 */
body.theme-light .logo-bg {
  background: rgba(255, 255, 255, 0.96) !important;
}

/* カーソルの光も少し明るめに */
body.theme-light #cursor-glow {
  background: radial-gradient(
    circle,
    rgba(0, 169, 157, 0.18) 0%,
    rgba(255, 255, 255, 0) 70%
  );
}

/* Light theme overrides for contact section on dark bg（TOPのCTA用） */
body.theme-light #contact .text-white {
  color: #f9fafb !important;
}

body.theme-light #contact .text-gray-300,
body.theme-light #contact .text-gray-400,
body.theme-light #contact .text-gray-500 {
  color: #e5e7eb !important;
}

/* 会社概要ページヒーローの文字色は白のまま */
body.theme-light .company-hero .text-white {
  color: #f9fafb !important;
}

body.theme-light .company-hero .text-gray-400,
body.theme-light .company-hero .text-gray-300,
body.theme-light .company-hero .text-gray-200 {
  color: #e5e7eb !important;
}

/* フォーム系（問い合わせページなど）を明るく */
body.theme-light input[type="text"],
body.theme-light input[type="email"],
body.theme-light input[type="tel"],
body.theme-light input[type="url"],
body.theme-light input[type="password"],
body.theme-light textarea,
body.theme-light select {
  background-color: #ffffff !important;
  color: #111827 !important;
  border-color: #d1d5db !important;
}

body.theme-light input::placeholder,
body.theme-light textarea::placeholder {
  color: #9ca3af !important;
}

/* ===== Animations (for Tailwind's custom keyframes) ===== */

/* Webkit Keyframes for Blob */
@-webkit-keyframes blob {
  0% { -webkit-transform: translate(0px, 0px) scale(1) translateZ(0); }
  33% { -webkit-transform: translate(30px, -50px) scale(1.1) translateZ(0); }
  66% { -webkit-transform: translate(-20px, 20px) scale(0.9) translateZ(0); }
  100% { -webkit-transform: translate(0px, 0px) scale(1) translateZ(0); }
}
@keyframes blob {
  0% { transform: translate(0px, 0px) scale(1) translateZ(0); }
  33% { transform: translate(30px, -50px) scale(1.1) translateZ(0); }
  66% { transform: translate(-20px, 20px) scale(0.9) translateZ(0); }
  100% { transform: translate(0px, 0px) scale(1) translateZ(0); }
}

/* Webkit Keyframes for Typing */
@-webkit-keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

/* Webkit Keyframes for Blink Caret */
@-webkit-keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #00A99D; }
}
@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #00A99D; }
}

/* Webkit Keyframes for Grid Move */
@-webkit-keyframes grid-move {
  0% { background-position: 0 0; }
  100% { background-position: 0 50px; }
}
@keyframes grid-move {
  0% { background-position: 0 0; }
  100% { background-position: 0 50px; }
}

/* Utility class to attach typing animation when desired */
.animate-typing {
  -webkit-animation: typing 3.5s steps(40, end),
    blink-caret 0.75s step-end infinite;
  animation: typing 3.5s steps(40, end),
    blink-caret 0.75s step-end infinite;
}
