/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Hiragino Sans', 'ヒラギノ角ゴ ProN', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', YuGothic, 'メイリオ', Meiryo, sans-serif;
  background: #fff;
  color: #111;
  overflow-x: hidden;
}
ul { list-style: none; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ===== DESIGN TOKENS ===== */
:root {
  --serif: 'Roboto', 'Hiragino Sans', 'Yu Gothic', YuGothic, sans-serif;
  --sans: 'Hiragino Sans', 'ヒラギノ角ゴ ProN', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', YuGothic, 'メイリオ', Meiryo, sans-serif;
  --dark: #05020e;
  --purple: #7b5ea7;
  --purple-light: #b39ddb;
  --white: #fff;
  --gray: #888;
  --header-h: 96px;
}

/* ===== HEADER ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  transition: background 0.45s ease, border-bottom 0.45s ease, backdrop-filter 0.45s ease;
}
.site-header.at-top {
  background: transparent;
  border-bottom: none;
}
.site-header.scrolled {
  background: rgba(5,2,14,0.93);
  border-bottom: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 0 28px;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.header-logo img {
  height: 44px;
  width: auto;
  filter: invert(1) brightness(2);
}
.header-logo-text {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
}
.header-nav ul {
  display: flex;
  gap: 36px;
  align-items: center;
  padding-right: 340px;
}
.header-nav ul li a {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.header-nav ul li a:hover { color: #fff; }
.nav-contact-btn {
  position: fixed;
  top: 0;
  right: 0;
  height: var(--header-h);
  padding: 0 40px;
  background: rgba(100,100,100,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  border-radius: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: background 0.25s;
  white-space: nowrap;
}
.nav-contact-btn:hover { background: rgba(80,80,80,0.95); }
.nav-about-btn {
  position: fixed;
  top: 0;
  right: 179px;
  height: var(--header-h);
  padding: 0 36px;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.18);
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: background 0.25s, color 0.25s;
  white-space: nowrap;
}
.nav-about-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: transform 0.3s, opacity 0.3s;
}

/* ===== HERO ===== */
.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  background: var(--dark);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
}
.hero-catch {
  font-family: var(--serif);
  font-size: clamp(72px, 10vw, 140px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.06em;
  margin-bottom: 36px;
}
.hero-catch .line1,
.hero-catch .line2 { display: block; }
.hero-catch .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(22px);
  animation: charIn 0.55s forwards;
}
@keyframes charIn { to { opacity: 1; transform: translateY(0); } }
.hero-sub {
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 300;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.72);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.hero-sub.visible { opacity: 1; transform: translateY(0); }
.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.45);
  font-size: 10px;
  letter-spacing: 0.22em;
}
.scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.15); }
}

/* ===== SERVICE SECTION ===== */
.service-section { background: #f5f5f5; }

.service-header {
  text-align: center;
  padding: 80px 20px 52px;
  background: #f5f5f5;
}
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: #999;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 700;
  color: #111;
  letter-spacing: 0.04em;
}

/* Service Stage */
.service-stage {
  position: relative;
  width: 100%;
  height: 90vh;
  min-height: 580px;
  overflow: hidden;
}

/* Background images */
.service-bgs {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.sbg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.75s ease;
}
.sbg.active { opacity: 1; }

/* Panels container */
.service-panels {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: row;
}

/* Individual panel */
.spanel {
  flex: 1;
  position: relative;
  border-right: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  overflow: hidden;
  transition: flex 0.7s cubic-bezier(0.25,0.46,0.45,0.94);
}
.spanel:last-child { border-right: none; }
.spanel.active { flex: 3.5; }

/* Dark overlay — active gets grey tint so text is readable */
.spanel-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(5,2,14,0.60);
  transition: background 0.55s ease;
}
.spanel.active .spanel-overlay {
  background: rgba(20,18,30,0.58);
}

/* Inner content */
.spanel-inner {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 40px 56px;
}

/* Collapsed title — visible when NOT active */
.spanel-collapsed {
  position: absolute;
  bottom: 44px;
  left: 28px;
  right: 10px;
  transition: opacity 0.4s ease, transform 0.45s ease;
}
.spanel.active .spanel-collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}
.spanel-name-small {
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

/* Expanded content — slides up from bottom on active */
.spanel-expanded {
  opacity: 0;
  transform: translateY(80px);
  transition: opacity 0.55s ease, transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94);
  pointer-events: none;
}
.spanel.active .spanel-expanded {
  opacity: 1;
  transform: translateY(-15vh); /* slide up to ~center of panel */
  pointer-events: auto;
}
.spanel-name {
  font-family: var(--serif);
  font-size: clamp(32px, 3.2vw, 48px);
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}
.spanel-desc {
  font-family: var(--sans);
  font-size: clamp(14px, 1.2vw, 17px);
  font-weight: 400;
  color: rgba(255,255,255,0.92);
  line-height: 2.0;
  margin-bottom: 32px;
  max-width: 400px;
}
.spanel-link {
  display: inline-block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255,255,255,0.5);
  padding-bottom: 3px;
  transition: border-color 0.2s, color 0.2s;
}
.spanel-link:hover { color: var(--purple-light); border-color: var(--purple-light); }

/* ===== CREDIT CARD SECTION ===== */
.credit-section {
  background: #f8f8f6;
  padding: 120px 20px;
}
.credit-inner { max-width: 900px; margin: 0 auto; }
.credit-catch {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 700;
  color: #111;
  line-height: 1.5;
  letter-spacing: 0.05em;
  margin: 18px 0 28px;
}
.credit-desc {
  font-size: 15px;
  line-height: 2.1;
  color: #444;
  margin-bottom: 64px;
  max-width: 680px;
}
.credit-merits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 64px;
}
.credit-merit {
  border-top: 2px solid #111;
  padding-top: 24px;
}
.credit-merit-icon {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #999;
  margin-bottom: 14px;
}
.credit-merit-title {
  font-family: var(--serif);
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 700;
  color: #111;
  margin-bottom: 12px;
  line-height: 1.5;
}
.credit-merit-text {
  font-size: 13px;
  line-height: 2;
  color: #555;
}
.credit-cards {
  border-top: 1px solid #ddd;
  padding-top: 36px;
  opacity: 1 !important;
  transform: none !important;
}
.credit-cards-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.credit-card-logos {
  display: block;
  margin-bottom: 14px;
}
.card-badge {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #333;
  background: #fff;
}
.payment-cards-img {
  max-width: 680px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 8px;
}
.credit-cards-note {
  font-size: 12px;
  color: #999;
  line-height: 1.8;
}

/* ===== CONTACT ===== */
.contact-section {
  background: var(--dark);
  padding: 110px 20px;
  text-align: center;
}
.contact-inner { max-width: 600px; margin: 0 auto; }
.section-label.light { color: rgba(255,255,255,0.38); }
.contact-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 50px);
  font-weight: 700;
  color: #fff;
  line-height: 1.5;
  letter-spacing: 0.05em;
  margin: 18px 0 26px;
}
.contact-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.58);
  line-height: 2;
  margin-bottom: 52px;
}
.contact-btn {
  display: inline-block;
  padding: 16px 52px;
  border: 1px solid rgba(255,255,255,0.55);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  transition: background 0.3s, color 0.3s;
}
.contact-btn:hover { background: #fff; color: var(--dark); }
.contact-btn-img {
  display: inline-block;
  max-width: 420px;
  width: 100%;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  padding: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.contact-btn-img img {
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
  transition: transform 0.4s ease;
}
.contact-btn-img:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 44px rgba(123,94,167,0.28);
}
.contact-btn-img:hover img { transform: scale(1.03); }

/* ===== FOOTER ===== */
.site-footer {
  background: #000;
  padding: 52px 32px 36px;
  position: relative;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-logo img {
  height: 30px;
  width: auto;
  filter: invert(1) brightness(2);
}
.footer-logo span {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.footer-address { font-size: 12px; color: rgba(255,255,255,0.38); letter-spacing: 0.04em; }
.footer-sns a { color: rgba(255,255,255,0.55); transition: color 0.2s; }
.footer-sns a:hover { color: #fff; }
.footer-copy { font-size: 11px; color: rgba(255,255,255,0.28); letter-spacing: 0.06em; }
.page-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 50;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
}
.page-top.visible { opacity: 1; transform: translateY(0); }
.page-top:hover { background: var(--purple-light); }

/* ===== MERIT FADE-IN ===== */
@keyframes meritFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== SCROLL FADE-UP ===== */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.85s ease, transform 0.85s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .header-nav { display: none; }
  .hamburger { display: flex; }
  .nav-contact-btn { display: none; }
  .nav-about-btn { display: none; }
}

@media (max-width: 768px) {
  /* SERVICE STAGE: スマホはカード縦積みに変更 */
  .service-stage {
    height: auto;
    min-height: unset;
    overflow: visible;
  }
  .service-bgs { display: none; } /* 背景画像は非表示 */
  .service-panels {
    position: static;
    flex-direction: column;
    gap: 0;
  }
  .spanel {
    flex: none !important;
    position: relative;
    height: auto !important;
    min-height: 180px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    background: #111;
    overflow: visible;
  }
  .spanel-overlay {
    background: rgba(5,2,14,0.55) !important;
  }
  /* スマホでは全パネルの内容を常に表示 */
  .spanel-collapsed { display: none; }
  .spanel-expanded {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  .spanel-inner {
    position: static;
    padding: 28px 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .spanel-name {
    font-size: 20px;
    margin-bottom: 10px;
  }
  .spanel-desc {
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 14px;
    max-width: 100%;
  }
  .spanel-link {
    font-size: 13px;
  }

  /* CREDIT SECTION */
  .credit-section { padding: 60px 20px; }
  .credit-merits {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* CONTACT */
  .contact-section { padding: 70px 20px; }
  .contact-sub br { display: none; }

  /* FOOTER */
  .site-footer { padding: 40px 20px 28px; }
}
