@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&family=Noto+Sans+JP:wght@300;400;500;700;900&display=swap');

:root {
  --primary-blue: #0066CC;
  --bg-white: #FFFFFF;
  --bg-soft: #F1F5F9;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text-main);
  background-color: var(--bg-white);
  line-height: 1.8;
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5vw;
}

/* --- Grain Texture Overlay --- */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: url("../img/noise.svg");
  opacity: 0.04;
  pointer-events: none;
  z-index: 9999;
}

/* --- Scanline Animation --- */
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
  opacity: 0.05;
  z-index: 10001;
  pointer-events: none;
  animation: scanline 8s linear infinite;
}

@keyframes scanline {
  0% { top: -5%; }
  100% { top: 105%; }
}

/* --- Custom Cursor --- */
.custom-cursor {
  width: 20px;
  height: 20px;
  background: var(--theme-accent);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: width 0.3s, height 0.3s, background 0.3s;
}

.custom-cursor.hover {
  width: 60px;
  height: 60px;
  background: rgba(var(--theme-primary-rgb), 0.1);
  border: 1px solid var(--theme-accent);
  mix-blend-mode: normal;
}

.cursor-tag {
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--theme-accent);
  color: #fff;
  font-family: 'Outfit';
  font-size: 8px;
  padding: 4px 8px;
  white-space: nowrap;
  letter-spacing: 0.1em;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s;
}

body:hover .cursor-tag {
  opacity: 1;
}

/* --- Clean Floating Header (Transparent & No Blur) --- */
/* Route A の .site-header-inner 個別設定は削除 → B/C と同じcommon.cssデフォルトを使用 */


.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: transparent !important;
  border-bottom: none !important;
  transition: background-color 0.4s ease;
}

.site-header-inner {
  width: 100%;
  max-width: 100%; /* PC全幅ヘッダー */
  padding: 0 5vw;  /* 左右の余白を確保 */
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.menu-open .site-header {
  z-index: 10002 !important;
  background-color: transparent !important; /* Let the menu overlay BG show through */
  backdrop-filter: none;
}

.logo { display: flex; align-items: center; } /* baseline gap防止 */
.logo-img { height: 32px; width: auto; display: block; }
.main-nav { display: flex; gap: 3rem; list-style: none; }
.main-nav a { 
  text-decoration: none; 
  font-family: 'Outfit'; 
  font-size: 0.65rem; 
  font-weight: 700; 
  color: var(--text-main); 
  letter-spacing: 0.15em; 
  text-align: center;
  line-height: 1.4;
  display: block;
}

.main-nav a span {
  font-family: 'Noto Sans JP';
  font-size: 10px;
  font-weight: 400;
  opacity: 0.4;
  letter-spacing: 0.05em;
  display: block;
}

/* Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  width: 32px;
  height: 20px;
  z-index: 10001;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-main);
  position: absolute;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s;
  left: 0;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { bottom: 0; }

/* Force explicit colors for the X button to guarantee visibility against the overlay */
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(9px) rotate(45deg); background: var(--text-main); }
.menu-open .menu-toggle span:nth-child(2) { transform: translateY(-9px) rotate(-45deg); background: var(--text-main); }

/* Overrides for absolute certainty on Dark backgrounds */
body.top-b.menu-open .menu-toggle span,
body.top-c.menu-open .menu-toggle span,
html.route-b body.menu-open .menu-toggle span,
html.route-c body.menu-open .menu-toggle span {
  background: #ffffff !important;
}

/* Overrides for absolute certainty on Light backgrounds */
body.top-a.menu-open .menu-toggle span,
html.route-a body.menu-open .menu-toggle span {
  background: #111111 !important;
}

/* Menu Overlay (Adaptive colors based on Route) */
.menu-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--bg-white); /* Default for Top A/B */
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Route C Specific Dark Overlay */
html.route-c .menu-overlay {
  background: var(--bg-darker);
}

/* Ensure Logo is visible on Top C menu overlay */
html.route-c .menu-open .logo-img {
  filter: brightness(0) invert(1);
}

.menu-open .menu-overlay {
  opacity: 1;
  pointer-events: auto;
}

.overlay-nav { list-style: none; text-align: center; width: 100%; padding: 0; }
.overlay-nav li { margin-bottom: 3.5rem; transform: translateY(30px); opacity: 0; transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.menu-open .overlay-nav li { transform: translateY(0); opacity: 1; }

.menu-open .overlay-nav li:nth-child(1) { transition-delay: 0.1s; }
.menu-open .overlay-nav li:nth-child(2) { transition-delay: 0.2s; }
.menu-open .overlay-nav li:nth-child(3) { transition-delay: 0.3s; }
.menu-open .overlay-nav li:nth-child(4) { transition-delay: 0.4s; }
.menu-open .overlay-nav li:nth-child(5) { transition-delay: 0.5s; }

.overlay-nav a { 
  font-family: 'Noto Sans JP'; 
  font-size: 2.2rem; 
  font-weight: 700; 
  color: var(--text-main); 
  text-decoration: none; 
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: color 0.3s;
}

.overlay-nav a:hover {
    color: var(--theme-accent);
}

.overlay-nav a .en {
  font-family: 'Outfit';
  font-size: 0.8rem;
  letter-spacing: 0.4em;
  opacity: 0.5;
  margin-bottom: 0.5rem;
}

/* --- Reveal Animations --- */
.reveal { 
  opacity: 0; 
  transform: translateY(40px); 
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1); 
}

.reveal.active { 
  opacity: 1; 
  transform: translateY(0); 
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- Responsive Helpers --- */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .menu-toggle { display: block; }
  .custom-cursor { display: none; }
  .site-header { position: sticky; top: 0; }
  .site-header-inner { height: 80px; padding: 0 1.5rem; }
  .logo-img { height: 24px; }
  
  .overlay-nav a { font-size: 1.5rem; }
  .overlay-nav a .en { font-size: 0.7rem; margin-bottom: 0.2rem; }
  .overlay-nav li { margin-bottom: 2rem; }

  /* Ensure article content has side padding on mobile */
  .l-mainContent__inner {
    padding: 0 20px !important;
  }

  /* Mobile-only line break */
  .sp-br {
    display: block !important;
    content: "" !important;
    height: 0 !important;
  }
}

/* PC-only line break (hidden on mobile) */
.pc-br {
  display: inline; /* 通常の改行を許可 */
}
@media (max-width: 768px) {
  .pc-br {
    display: none !important;
  }
}

/* Mobile-only line break (hidden on PC) */
.sp-br {
  display: none;
}
@media (max-width: 768px) {
  .sp-br {
    display: inline !important; /* スマホのみ改行を有効化 */
  }
}

/* --- Contact Form 7 Enhancements --- */

/* 1. iOS Safari Zoom Fix: Force 16px font-size on focus/mobile */
@media (max-width: 768px) {
  .wpcf7-form-control:not(.wpcf7-submit) {
    font-size: 16px !important;
  }
}

/* 2. Success Message as a Speech Bubble above the submit button */
.wpcf7 {
  position: relative;
}

.wpcf7-response-output {
  margin: 0 !important;
  padding: 15px 20px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-align: center !important;
  position: absolute !important;
  bottom: 100px; /* Position above the submit area */
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 90%;
  max-width: 400px;
  background: var(--bg-white, #fff) !important;
  color: var(--text-main, #000) !important;
  border: 2px solid var(--theme-accent, #00a16a) !important;
  box-shadow: 0 15px 30px rgba(0,0,0,0.15) !important;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10;
}

/* Speech bubble arrow */
.wpcf7-response-output::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -10px;
  border-width: 10px;
  border-style: solid;
  border-color: var(--theme-accent, #00a16a) transparent transparent transparent;
}

/* Show message with animation */
.wpcf7-form.sent .wpcf7-response-output,
.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.failed .wpcf7-response-output {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Message Status Colors */
.wpcf7-form.sent .wpcf7-response-output {
  border-color: #00a16a !important; /* Success Green */
}
.wpcf7-form.sent .wpcf7-response-output::after {
  border-top-color: #00a16a !important;
}

.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.failed .wpcf7-response-output {
  border-color: #ff4444 !important; /* Error Red */
}
.wpcf7-form.invalid .wpcf7-response-output::after,
.wpcf7-form.failed .wpcf7-response-output::after {
  border-top-color: #ff4444 !important;
}
