/* Credo - Base Styles (craftake準拠) */
:root {
  --font-sans: "Noto Sans JP", "Outfit", sans-serif;
  --font-logo: "Inter", sans-serif;
  --color-brand-blue: #0052cc;
  --color-brand-navy: #0a192f;
  --color-blue-500: #0052cc;
  --color-blue-600: #0047b3;
  --color-blue-700: #003d99;
  --color-blue-800: #003380;
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-400: #94a3b8;
  --color-slate-600: #475569;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;
}

html {
  scroll-behavior: smooth;
  font-feature-settings: "palt";
}

body {
  font-family: "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: all 0.3s ease;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid #f1f5f9;
  padding: 0.75rem 1.5rem;
}

.header-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: block;
  z-index: 50;
}

.logo-link:hover {
  opacity: 0.8;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-svg {
  height: 2.5rem;
  width: auto;
}

@media (min-width: 768px) {
  .logo-svg {
    height: 3rem;
  }
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-brand {
  font-family: var(--font-logo);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: #0f172a;
}

.logo-tagline {
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #64748b;
  margin-top: 0.125rem;
}

.logo-white .logo-brand {
  color: white;
}

.logo-white .logo-tagline {
  color: #94a3b8;
}

.nav-desktop {
  display: none;
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #475569;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--color-brand-blue);
}

.nav-link-active {
  color: var(--color-brand-blue);
  border-bottom: 2px solid var(--color-brand-blue);
  padding-bottom: 0.25rem;
}

.nav-link:hover {
  color: var(--color-brand-blue);
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  background: var(--color-brand-blue);
  border-radius: 0.375rem;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-contact:hover {
  background: #0047b3;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 50;
}

@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
}

.menu-toggle span {
  display: block;
  width: 1.5rem;
  height: 0.125rem;
  background: #1e293b;
}

/* Mobile Navigation */
.nav-mobile {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.nav-mobile.active {
  pointer-events: auto;
}

.nav-mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-mobile.active .nav-mobile-backdrop {
  opacity: 1;
}

.nav-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  background: white;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.nav-mobile.active .nav-mobile-drawer {
  transform: translateX(0);
}

.nav-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.nav-mobile-close {
  padding: 0.5rem;
  font-size: 1.5rem;
  line-height: 1;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-mobile-close:hover {
  color: #1e293b;
  background: #f1f5f9;
  border-radius: 9999px;
}

.nav-mobile-links {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
}

.nav-mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  font-weight: 500;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  transition: background, color 0.2s;
}

.nav-mobile-link:hover {
  background: #f8fafc;
  color: var(--color-brand-blue);
}

.nav-mobile-cta {
  margin: 1rem 1.5rem;
  padding: 0.75rem 1.5rem;
  background: #0047b3;
  color: white !important;
  border-radius: 0.5rem;
  justify-content: center;
  border: none;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.nav-mobile-cta:hover {
  background: #1e3a8a;
}

/* Footer */
.footer {
  background: #0f172a;
  color: white;
  padding: 4rem 0 2rem;
  border-top: 1px solid #1e293b;
}

.footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-desc {
  color: #94a3b8;
  line-height: 1.6;
  max-width: 24rem;
  font-size: 0.875rem;
  margin-top: 1rem;
}

.footer-heading {
  font-weight: 700;
  margin-bottom: 1rem;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 0.5rem;
  display: inline-block;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: white;
}

.footer-contact p {
  color: #94a3b8;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.footer-contact-link {
  color: #4090ff;
  font-size: 0.875rem;
  font-weight: 500;
}

.footer-contact-link:hover {
  color: white;
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-privacy {
  color: #64748b;
  transition: color 0.2s;
}

.footer-privacy:hover {
  color: #94a3b8;
}

/* Section utilities */
.section {
  padding: 4rem 1.5rem;
}

@media (min-width: 768px) {
  .section {
    padding: 6rem 1.5rem;
  }
}

.section-gray {
  background: #f8fafc;
}

.section-white {
  background: white;
}

.section-dark {
  background: #0f172a;
  color: white;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  background: var(--color-brand-blue);
  border-radius: 0.5rem;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(29, 78, 216, 0.2);
}

.btn-primary:hover {
  background: #0047b3;
  box-shadow: 0 10px 15px -3px rgba(29, 78, 216, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-brand-blue);
  background: white;
  border: 2px solid var(--color-brand-blue);
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #e6f0ff;
}

/* =============================================
   ANIMATIONS (Framer Motion 完全再現)
   ============================================= */

/* Hero noise texture */
.hero-noise {
  position: absolute;
  inset: 0;
  z-index: 10;
  opacity: 0.03;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Scroll indicator bounce */
.scroll-indicator {
  animation: scroll-bounce 2s ease-in-out infinite;
}
@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* CTA background pulse */
.cta-bg-pulse {
  animation: cta-pulse 4s ease-in-out infinite;
}
@keyframes cta-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.5; }
}

/* --- Initial states (before animation triggers) --- */

/* fade-up: opacity:0, y:20px → opacity:1, y:0 */
[data-anim="fade-up"] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-anim="fade-up"].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* fade-up-30: same but y:30px, duration 0.8s */
[data-anim="fade-up-30"] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-anim="fade-up-30"].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* slide-left: opacity:0, x:-30px → opacity:1, x:0 */
[data-anim="slide-left"] {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-anim="slide-left"].in-view {
  opacity: 1;
  transform: translateX(0);
}

/* slide-right: opacity:0, x:30px → opacity:1, x:0 */
[data-anim="slide-right"] {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-anim="slide-right"].in-view {
  opacity: 1;
  transform: translateX(0);
}

/* scale-up: opacity:0, scale:0.95 → opacity:1, scale:1 */
[data-anim="scale-up"] {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-anim="scale-up"].in-view {
  opacity: 1;
  transform: scale(1);
}

/* scale-from-zero: scale:0 → scale:1 */
[data-anim="scale-zero"] {
  transform: scale(0);
  transition: transform 0.6s ease;
}
[data-anim="scale-zero"].in-view {
  transform: scale(1);
}

/* fade-up-10: small fade, y:10px */
[data-anim="fade-up-10"] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-anim="fade-up-10"].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* --- Hero page-load animations --- */

/* Hero background image: scale 1.15 + blur → scale 1 + no blur */
.hero-bg-img {
  transform: scale(1.15);
  filter: blur(10px);
  transition: transform 2s ease-out, filter 2s ease-out;
}
.hero-bg-img.loaded {
  transform: scale(1);
  filter: blur(0);
}

/* Hero intro tag */
.hero-tag {
  opacity: 0;
  transform: translateY(20px);
}
.hero-tag.loaded {
  animation: hero-tag-in 0.8s ease forwards;
  animation-delay: 0.5s;
}
@keyframes hero-tag-in {
  to { opacity: 1; transform: translateY(0); }
}

/* Hero text reveal - line slides up from overflow:hidden container */
.hero-text-reveal {
  overflow: hidden;
}
.hero-text-line {
  transform: translateY(100%);
}
.hero-text-line.loaded {
  animation: text-reveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes text-reveal {
  to { transform: translateY(0); }
}

/* Hero decorative line */
.hero-line {
  opacity: 0;
  transform: translateX(-20px);
}
.hero-line.loaded {
  animation: hero-line-in 1s ease forwards;
  animation-delay: 1s;
}
@keyframes hero-line-in {
  to { opacity: 1; transform: translateX(0); }
}

/* Hero description */
.hero-desc {
  opacity: 0;
}
.hero-desc.loaded {
  animation: hero-desc-in 1s ease forwards;
  animation-delay: 1.2s;
}
@keyframes hero-desc-in {
  to { opacity: 1; }
}

/* Hero scroll indicator fade on scroll */
.hero-scroll-indicator {
  transition: opacity 0.3s ease;
}

/* Sub-page hero content (About, Services) */
.subhero-content {
  opacity: 0;
  transform: translateY(30px);
}
.subhero-content.loaded {
  animation: subhero-in 0.8s ease forwards;
  animation-delay: 0.2s;
}
@keyframes subhero-in {
  to { opacity: 1; transform: translateY(0); }
}

/* Parallax background */
.parallax-bg {
  will-change: transform;
  transition: transform 0.05s linear;
}
