/* Base Variables */
:root {
  --font-main: "Noto Sans JP", sans-serif;
  --font-serif: "Noto Serif JP", serif;
  --font-en: "Cinzel", serif;
  --color-text: #4a4a4a;
  --color-title: #2c3e50;
  --color-accent: #c5a059;
  /* Soft Gold */
  --color-bg: #fff;
  --color-bg-light: #fdfcf8;
  --color-bg-teal: #f0f7f7;
  --container-width: 1000px;
}

/* Reset & Base */
html {
  font-size: 16px; /* 1rem = 16px に固定 */
}

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

body {
  font-family: var(--font-main);
  color: var(--color-text);
  line-height: 2;
  letter-spacing: 0.08em;
  background-color: var(--color-bg);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s;
}

a:hover {
  opacity: 0.7;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* Typography Utilities */
.text-center {
  text-align: center;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  color: var(--color-title);
  font-weight: 500;
}

.section {
  padding: 100px 0;
}

.container {
  width: 90%;
  max-width: var(--container-width);
  margin: 0 auto;
}

.section-subtitle {
  display: block;
  font-family: var(--font-en);
  color: var(--color-accent);
  font-size: 1rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  line-height: 1.4;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  z-index: 100;
  padding: 20px 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.03);
}

.header-inner {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-en);
  font-size: 1.5rem;
  color: var(--color-title);
  letter-spacing: 0.1em;
}

.logo a {
  color: inherit;
  text-decoration: none;
}

.logo a:hover {
  opacity: 0.8;
}

.nav ul {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav a {
  font-family: var(--font-en);
  font-size: 0.9rem;
  color: var(--color-text);
}

.btn-nav {
  border: 1px solid var(--color-accent);
  padding: 10px 20px;
  border-radius: 50px;
  color: var(--color-accent) !important;
  font-family: var(--font-main) !important;
  font-size: 0.8rem !important;
}

.btn-nav:hover {
  background: var(--color-accent);
  color: #fff !important;
}

/* Hamburger Button (Default hidden) */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001;
  /* Above mobile menu */
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-title);
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-btn span:nth-child(1) {
  top: 0;
}

.hamburger-btn span:nth-child(2) {
  top: 11px;
}

.hamburger-btn span:nth-child(3) {
  bottom: 0;
}

/* Hamburger Active State */
.hamburger-btn.active span:nth-child(1) {
  transform: translateY(11px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: translateY(-11px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: -1;
  /* Drift Animation */
  transition:
    transform 6s ease-in-out,
    opacity 1s ease-in-out;
  will-change: transform;
  transform: scale(1.05);
}

/* Dark overlay for readability */
.hero-bg::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
}

/* Second layer for crossfade animation */
.hero-bg-layer-b {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: -1;
  transition:
    transform 6s ease-in-out,
    opacity 1s ease-in-out;
  will-change: transform, opacity;
  transform: scale(1.05);
}

.hero-bg-layer-b::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
}

.hero-content {
  z-index: 1;
  opacity: 0;
  animation: fadeUp 1.5s ease-out forwards;
  animation-delay: 0.5s;
}

.hero-sub {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  font-family: var(--font-serif);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-main {
  font-size: 3.5rem;
  font-family: var(--font-serif);
  line-height: 1.5;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-scroll {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-en);
  font-size: 0.8rem;
  color: #fff;
  letter-spacing: 0.2em;
  opacity: 0.8;
}

.hero-scroll::after {
  content: "";
  display: block;
  width: 1px;
  height: 50px;
  background: #fff;
  margin: 10px auto 0;
}

/* Concept */
.concept-text {
  max-width: 600px;
  margin: 0 auto;
}

.concept-text p {
  margin-bottom: 2rem;
}

/* Profile */
.bg-light {
  background-color: var(--color-bg-light);
}

.profile-wrapper {
  display: flex;
  align-items: center;
  gap: 80px;
}

.profile-img {
  flex: 1;
}

.profile-img img {
}

.profile-info {
  flex: 1;
}

.client-name {
  font-family: var(--font-en);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.client-role {
  font-size: 0.9rem;
  color: var(--color-accent);
  margin-bottom: 2rem;
  display: block;
}

.history-list {
  margin-top: 2rem;
  font-size: 0.9rem;
}

.history-list li {
  margin-bottom: 10px;
  padding-left: 1rem;
  position: relative;
}

.history-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

/* Services */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 4rem;
}

.service-card {
  text-align: center;
  padding: 30px;
  background: #fff;
  border: 1px solid #f0f0f0;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  container-type: inline-size;
  /* Add container context */
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
}

.service-icon {
  font-size: 2.5rem;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.service-card h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.service-card p {
  font-size: 0.9rem;
  color: #666;
  text-align: justify;
  word-break: break-all;
}

/* Atmosphere */
.atmosphere {
  padding: 80px 0;
  background: linear-gradient(180deg, var(--color-bg-light) 0%, var(--color-bg) 100%);
}

.atmosphere-content {
  max-width: 700px;
  margin: 0 auto;
}

.atmosphere-text-centered {
  text-align: center;
  padding: 50px 40px;
  position: relative;
}

/* 上下の装飾ライン */
.atmosphere-text-centered::before,
.atmosphere-text-centered::after {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: var(--color-accent);
  margin: 0 auto;
}

.atmosphere-text-centered::before {
  margin-bottom: 30px;
}

.atmosphere-text-centered::after {
  margin-top: 30px;
}

.atmosphere-icon {
  display: block;
  font-size: 2rem;
  color: var(--color-accent);
  margin-bottom: 20px;
  opacity: 0.8;
}

.atmosphere-text-centered h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: var(--color-title);
}

.atmosphere-text-centered p {
  font-size: 0.95rem;
  line-height: 2.2;
  color: var(--color-text);
}

@media screen and (min-width: 769px) {
  .atmosphere {
    padding: 100px 0;
  }

  .atmosphere-text-centered {
    padding: 60px 50px;
  }

  .atmosphere-text-centered h3 {
    font-size: 1.8rem;
  }
}

/* Contact */
.flow-steps {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 4rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.step {
  width: 100%;
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f0f0;
  text-align: left;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid #f5f5f5;
  padding-bottom: 10px;
}

.step-num {
  display: block;
  font-family: var(--font-en);
  font-size: 2.5rem;
  color: #b0c4c4;
  line-height: 1;
  font-weight: bold;
}

.step-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--color-title);
  line-height: 1.4;
  margin: 0;
}

.step-content {
  padding-left: 0;
}

.step-desc {
  font-weight: bold;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.step-note {
  font-size: 0.85rem;
  color: #888;
  line-height: 1.6;
}

.step-arrow {
  font-size: 1.5rem;
  color: #ddd;
}

.cta-area {
  margin-top: 3rem;
}

.btn-primary {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 15px 50px;
  font-size: 1.1rem;
  border-radius: 50px;
  margin-top: 1.5rem;
  letter-spacing: 0.1em;
  box-shadow: 0 5px 15px rgba(197, 160, 89, 0.4);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(197, 160, 89, 0.6);
}

.btn-primary.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  box-shadow: none;
}

.btn-primary.btn-outline:hover {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 5px 15px rgba(197, 160, 89, 0.4);
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-buttons .btn-primary {
  margin-top: 0;
}

/* Footer */
.footer {
  background-color: var(--color-title);
  color: #fff;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-copy {
  font-family: var(--font-english);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

/* --- Animation Styles --- */
.js-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1.5s ease-out,
    transform 1.5s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, transform;
}

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

/* Staggered delay for child elements if needed */
.js-fade-in-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

.js-fade-in-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.js-fade-in-stagger.is-visible > *:nth-child(1) {
  transition-delay: 0.1s;
}

.js-fade-in-stagger.is-visible > *:nth-child(2) {
  transition-delay: 0.3s;
}

.js-fade-in-stagger.is-visible > *:nth-child(3) {
  transition-delay: 0.5s;
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

/* Mobile Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 15px;
  }

  .nav ul {
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-main {
    font-size: 2rem;
  }

  .profile-wrapper {
    flex-direction: column;
    gap: 40px;
  }

  .section-title {
    font-size: 2rem;
  }

  .atmosphere-img {
    height: 300px;
  }

  .atmosphere-text {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    margin-top: -50px;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .flow-steps {
    flex-direction: column;
  }

  .step-arrow {
    transform: rotate(90deg);
  }
}

/* Submenu Styles */
.nav ul li {
  position: relative;
}

.nav ul li:hover .submenu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(255, 255, 255, 0.95);
  min-width: 220px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  /* Initially hidden to allow hover transition, but display must be toggled for layout */
  display: none;
}

/* Override display on hover to allow transition */
.nav ul li:hover .submenu {
  display: block;
}

.submenu li {
  display: block;
  margin: 0;
}

.submenu a {
  display: block;
  padding: 10px 20px;
  color: var(--color-text);
  font-size: 0.85rem;
  white-space: nowrap;
  text-align: left;
  border-bottom: 1px solid #f5f5f5;
  transition:
    background 0.3s,
    color 0.3s;
}

.submenu li:last-child a {
  border-bottom: none;
}

.submenu a:hover {
  background: var(--color-bg-light);
  color: var(--color-accent);
}

/* Mobile Submenu Adjustment */
@media (max-width: 768px) {
  .nav ul li:hover .submenu {
    position: static;
    transform: none;
    display: block;
    box-shadow: none;
    background: transparent;
    padding-left: 20px;
    min-width: auto;
    opacity: 1;
    visibility: visible;
  }

  .submenu {
    /* Mobile: always show or toggle via JS? For css-only, hover is tricky on mobile. 
           Assuming simpler stack for now or user taps. */
    display: none;
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav ul li:hover .submenu {
    display: block;
  }

  .submenu a {
    padding: 5px 0;
    border: none;
  }

  /* --- Hamburger Menu Mobile Styles --- */
  .hamburger-btn {
    display: block;
  }

  .header-inner {
    flex-direction: row;
    /* Keep logo and burger side by side */
    justify-content: space-between;
    align-items: center;
  }

  /* Mobile Navigation Overlay */
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    padding-top: 80px;
    /* Space for header */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.3s ease,
      visibility 0.3s ease;
    overflow-y: auto;
    /* Allow scrolling if menu is long */
  }

  .nav.nav-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav ul {
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    /* Left align items */
    padding: 0 40px;
    width: 100%;
  }

  .nav ul li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 0;
  }

  .nav ul li:last-child {
    border-bottom: none;
  }

  .nav a {
    font-size: 1.1rem;
    display: block;
    width: 100%;
  }

  .btn-nav {
    /* Adjust button style in menu to look like a normal link or keep button? */
    /* Keeping it simple for mobile menu consistency, or center it */
    display: inline-block;
    width: auto;
    margin-top: 20px;
    text-align: center;
    align-self: center;
    /* Center the button */
  }

  /* Mobile Submenu: Always expanded and indented */
  .nav ul li .submenu {
    position: static;
    display: block;
    /* Always show */
    opacity: 1;
    visibility: visible;
    background: transparent;
    box-shadow: none;
    padding: 10px 0 0 20px;
    /* Indent */
    transform: none;
    min-width: auto;
    border-radius: 0;
  }

  .submenu li {
    border-bottom: none;
    /* No separator for submenu items */
    padding: 8px 0;
  }

  .submenu a {
    font-size: 0.95rem;
    color: #666;
    padding: 0;
  }

  .submenu a:hover {
    background: transparent;
    color: var(--color-accent);
  }

  /* Override hover effect since it's always open */
  .nav ul li:hover .submenu {
    display: block;
    /* Redundant but safe */
  }
}

/* ============================================
   Page Transition - Fade + Blur
   ============================================ */
.page-transition {
  opacity: 1;
  filter: blur(0);
  transition:
    opacity 0.6s ease,
    filter 0.6s ease;
}

.page-transition.is-leaving {
  opacity: 0;
  filter: blur(8px);
}

/* 初期状態: 完全に非表示（HTMLに直接クラス付与） */
.page-transition.is-entering {
  opacity: 0;
  filter: blur(8px);
  transition: none; /* 読み込み中はアニメーションなし */
}

/* 読み込み完了後: フェードイン開始 */
.page-transition.is-loaded {
  transition:
    opacity 0.6s ease,
    filter 0.6s ease;
}
