/* ========================================
   杜乃家工務店 — style.css
   おみせWeb ポートフォリオ用サンプルサイト
   ======================================== */

/* --------------------------------------------------
   1. CSS Variables (Design Tokens)
-------------------------------------------------- */
:root {
  /* Colors */
  --color-main: #1F3A34;
  --color-sub: #2C4A5E;
  --color-accent: #B38B4A;
  --color-accent-dark: #9D7638;
  --color-base: #FAF8F3;
  --color-base-2: #F2EDE2;
  --color-border: #DDD3C1;
  --color-text: #2B2A27;
  --color-text-light: #6B665F;
  --color-white: #FFFFFF;

  /* Typography */
  --font-serif: 'Noto Serif JP', 'YuMincho', 'Hiragino Mincho ProN', serif;
  --font-sans: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
  --font-en: 'Cormorant Garamond', 'Times New Roman', serif;

  /* Font sizes */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 22px;
  --fs-xl: 26px;
  --fs-2xl: 32px;
  --fs-3xl: 38px;
  --fs-4xl: 52px;

  /* Spacing */
  --section-padding-pc: 120px;
  --section-padding-sp: 72px;

  /* Border radius */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  /* Shadow */
  --shadow-sm: 0 2px 10px rgba(31, 58, 52, 0.06);
  --shadow-md: 0 8px 24px rgba(31, 58, 52, 0.10);
  --shadow-lg: 0 18px 48px rgba(31, 58, 52, 0.14);

  /* Easing */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-dramatic: cubic-bezier(0.65, 0, 0.35, 1);

  /* Transitions */
  --transition: 0.3s var(--ease-out);
}

/* --------------------------------------------------
   2. Reset
-------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--fs-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.85;
  color: var(--color-text);
  background-color: var(--color-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: var(--fs-base);
  color: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--color-main);
  line-height: 1.4;
  letter-spacing: 0.03em;
}

/* --------------------------------------------------
   3. Container
-------------------------------------------------- */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.container--narrow {
  max-width: 900px;
}

/* --------------------------------------------------
   4. Typography Utilities
-------------------------------------------------- */
.section__label {
  font-family: var(--font-en);
  font-size: 14px;
  letter-spacing: 0.25em;
  color: var(--color-accent);
  text-transform: uppercase;
  display: block;
  margin-bottom: 16px;
  font-weight: 500;
}

.section__title {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--color-main);
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.section__subtitle {
  font-size: var(--fs-base);
  color: var(--color-text-light);
  margin-top: 16px;
  line-height: 1.9;
}

.text-center { text-align: center; }
.text-white { color: var(--color-white) !important; }

/* --------------------------------------------------
   5. Section Layout
-------------------------------------------------- */
.section {
  padding: var(--section-padding-sp) 0;
}

.section--base { background-color: var(--color-base); }
.section--cream { background-color: var(--color-base-2); }
.section--main { background-color: var(--color-main); color: var(--color-white); }
.section--main h2, .section--main h3 { color: var(--color-white); }

.section__header {
  margin-bottom: 48px;
}

/* --------------------------------------------------
   6. Buttons
-------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 36px;
  font-size: var(--fs-base);
  font-weight: 500;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  line-height: 1;
  text-align: center;
  min-height: 48px;
  border: 1px solid transparent;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.btn--primary:hover {
  background-color: var(--color-accent-dark);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--outline-white {
  background-color: transparent;
  color: var(--color-white);
  border: 1px solid rgba(255,255,255,0.8);
}

.btn--outline-white:hover {
  background-color: var(--color-white);
  color: var(--color-main);
}

.btn--outline-main {
  background-color: transparent;
  color: var(--color-main);
  border: 1px solid var(--color-main);
}

.btn--outline-main:hover {
  background-color: var(--color-main);
  color: var(--color-white);
}

.btn--lg {
  padding: 20px 44px;
  font-size: var(--fs-md);
}

/* --------------------------------------------------
   7. Header
-------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: transparent;
  z-index: 1000;
  transition: background-color 0.35s ease, box-shadow 0.35s ease, height 0.35s ease;
}

.header.is-scrolled,
.header.is-solid {
  background-color: rgba(250, 248, 243, 0.96);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header__logo {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  color: var(--color-white);
  transition: color var(--transition);
}

.header.is-scrolled .header__logo,
.header.is-solid .header__logo {
  color: var(--color-main);
}

.header__logo-main {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.header__logo-sub {
  font-family: var(--font-en);
  font-size: 10px;
  letter-spacing: 0.24em;
  opacity: 0.8;
  margin-top: 2px;
}

.header__nav {
  display: none;
}

.header__nav-list {
  display: flex;
  align-items: center;
  gap: 36px;
}

.header__nav-item > a {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-white);
  letter-spacing: 0.08em;
  transition: color var(--transition), opacity var(--transition);
  position: relative;
  padding: 8px 0;
}

.header.is-scrolled .header__nav-item > a,
.header.is-solid .header__nav-item > a {
  color: var(--color-main);
}

.header__nav-item > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background-color: var(--color-accent);
  transition: width var(--transition), left var(--transition);
}

.header__nav-item > a:hover {
  color: var(--color-accent);
}

.header__nav-item > a:hover::after {
  width: 100%;
  left: 0;
}

.header__nav-item--cta > a {
  background-color: var(--color-accent);
  color: var(--color-white) !important;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
}

.header__nav-item--cta > a::after { display: none; }

.header__nav-item--cta > a:hover {
  background-color: var(--color-accent-dark);
  color: var(--color-white) !important;
}

/* Hamburger */
.header__hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  gap: 6px;
  position: relative;
  z-index: 1100;
}

.header__hamburger-line {
  display: block;
  width: 26px;
  height: 2px;
  background-color: var(--color-white);
  transition: transform var(--transition), opacity var(--transition), background-color var(--transition);
  border-radius: 2px;
}

.header.is-scrolled .header__hamburger-line,
.header.is-solid .header__hamburger-line {
  background-color: var(--color-main);
}

.header__hamburger.is-active .header__hamburger-line {
  background-color: var(--color-white);
}

.header__hamburger.is-active .header__hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.header__hamburger.is-active .header__hamburger-line:nth-child(2) {
  opacity: 0;
}
.header__hamburger.is-active .header__hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Drawer */
.header__drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--color-main);
  color: var(--color-white);
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out);
  z-index: 1050;
  overflow-y: auto;
  padding: 96px 32px 48px;
}

.header__drawer.is-open {
  transform: translateX(0);
}

.header__drawer-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 32px;
}

.header__drawer-item {
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.header__drawer-item a {
  display: block;
  padding: 20px 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-white);
  letter-spacing: 0.05em;
}

.header__drawer-item a:hover {
  color: var(--color-accent);
}

.header__drawer-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.header__drawer-cta .btn {
  width: 100%;
}

body.drawer-open {
  overflow: hidden;
}

/* --------------------------------------------------
   8. Footer
-------------------------------------------------- */
.footer {
  background-color: var(--color-main);
  color: rgba(255,255,255,0.85);
  padding: 72px 0 32px;
}

.footer__grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 48px;
}

.footer__logo {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}

.footer__logo-sub {
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: rgba(255,255,255,0.6);
  display: block;
  margin-bottom: 20px;
}

.footer__catch {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  line-height: 1.8;
  max-width: 360px;
}

.footer-nav__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-nav__item a {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.05em;
  transition: color var(--transition);
}

.footer-nav__item a:hover {
  color: var(--color-accent);
}

.footer__info-item {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  line-height: 1.8;
  margin-bottom: 6px;
}

.footer__info-item strong {
  color: var(--color-white);
  font-weight: 500;
  margin-right: 8px;
}

.footer__social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.footer__social-link svg {
  width: 18px;
  height: 18px;
  display: block;
}

.footer__social-link:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
}

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 24px;
  text-align: center;
}

.footer__portfolio-note {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 8px;
  line-height: 1.7;
}

.footer__copyright {
  font-size: 12px;
  font-family: var(--font-en);
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.55);
}

/* --------------------------------------------------
   9. Page Hero (inner pages)
-------------------------------------------------- */
.page-hero {
  position: relative;
  height: 360px;
  overflow: hidden;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
}

.page-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(31,58,52,0.65) 0%, rgba(0,0,0,0.25) 100%);
  z-index: 2;
}

.page-hero__inner {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 24px;
}

.page-hero__label {
  font-family: var(--font-en);
  font-size: 14px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 16px;
  display: block;
}

.page-hero__title {
  font-family: var(--font-serif);
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--color-white);
  letter-spacing: 0.1em;
  line-height: 1.4;
}

.page-hero__sub {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255,255,255,0.85);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------
   10. Fade-in Animations (IntersectionObserver)
-------------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

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

.fade-in--left {
  transform: translateX(-40px);
}
.fade-in--left.is-visible {
  transform: translateX(0);
}

.fade-in--stagger-1 { transition-delay: 0.0s; }
.fade-in--stagger-2 { transition-delay: 0.15s; }
.fade-in--stagger-3 { transition-delay: 0.3s; }
.fade-in--stagger-4 { transition-delay: 0.45s; }

/* --------------------------------------------------
   10-B. Reveal / Mask Animations (派手アニメーション)
-------------------------------------------------- */

/* オープニングフェード（黒→透明） */
.intro-overlay {
  position: fixed;
  inset: 0;
  background-color: #0E1A17;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s var(--ease-smooth) 0.2s;
}

.intro-overlay__top,
.intro-overlay__bottom {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  background-color: #0E1A17;
  transition: transform 0.9s var(--ease-smooth) 0.4s;
  z-index: 10000;
}

.intro-overlay__top { top: 0; transform: translateY(0); }
.intro-overlay__bottom { bottom: 0; transform: translateY(0); }

.intro-overlay__brand {
  position: relative;
  z-index: 10001;
  font-family: var(--font-en);
  font-size: 14px;
  letter-spacing: 0.4em;
  color: rgba(255,255,255,0.85);
  opacity: 1;
  transition: opacity 0.4s ease;
  text-transform: uppercase;
}

body.is-loaded .intro-overlay__brand { opacity: 0; }
body.is-loaded .intro-overlay__top { transform: translateY(-100%); }
body.is-loaded .intro-overlay__bottom { transform: translateY(100%); }
body.is-loaded .intro-overlay { opacity: 0; }

body.is-loaded .intro-overlay {
  visibility: hidden;
  transition: opacity 0.6s ease 1.0s, visibility 0s linear 1.6s;
}

/* 行ごとのマスクテキスト（split text 風） */
.reveal-line {
  display: block;
  overflow: hidden;
  position: relative;
}

.reveal-line__inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.0s var(--ease-smooth);
  will-change: transform;
}

.is-loaded .reveal-line__inner,
.reveal-line.is-visible .reveal-line__inner {
  transform: translateY(0);
}

.reveal-line--delay-1 .reveal-line__inner { transition-delay: 0.9s; }
.reveal-line--delay-2 .reveal-line__inner { transition-delay: 1.15s; }
.reveal-line--delay-3 .reveal-line__inner { transition-delay: 1.4s; }
.reveal-line--delay-4 .reveal-line__inner { transition-delay: 1.65s; }

/* 縦書きキャッチ */
.hero__vertical {
  position: absolute;
  top: 14%;
  right: 28px;
  z-index: 3;
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 0.4em;
  color: rgba(255,255,255,0.85);
  opacity: 0;
  transform: translateY(-32px);
  transition: opacity 1.0s ease 1.6s, transform 1.0s var(--ease-smooth) 1.6s;
}

body.is-loaded .hero__vertical {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 1024px) {
  .hero__vertical {
    font-size: 18px;
    right: 48px;
  }
}

/* セクション見出しの左から slide-in */
.title-reveal {
  position: relative;
  display: inline-block;
  overflow: hidden;
  padding-bottom: 4px;
}

.title-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--color-base-2);
  transform: translateX(0);
  transition: transform 0.95s var(--ease-smooth);
  z-index: 1;
}

.section--cream .title-reveal::after { background-color: var(--color-base); }
.section--main .title-reveal::after { background-color: var(--color-main); }
.stats .title-reveal::after { background-color: rgba(31,58,52,0.95); }
.cta-banner .title-reveal::after { background-color: var(--color-main); }
.page-hero .title-reveal::after { background-color: rgba(31,58,52,0.65); }

.title-reveal.is-visible::after {
  transform: translateX(101%);
}

.title-reveal > * {
  position: relative;
  z-index: 0;
}

/* アクセント線が左→右に伸びるライン */
.accent-line {
  display: block;
  width: 64px;
  height: 2px;
  background-color: var(--color-accent);
  margin: 0 auto 20px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s var(--ease-smooth) 0.2s;
}

.accent-line.is-visible {
  transform: scaleX(1);
}

.accent-line--center {
  transform-origin: center;
}

/* スクロールインジケーター（旧）は削除済み */

/* パララックス用ラッパー */
[data-parallax-y] {
  will-change: transform;
}

/* 数字カウントアップのブラインド演出 */
.stat-blind {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.stat-blind::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(31,58,52,0.85);
  transform: translateY(0);
  transition: transform 1.0s var(--ease-smooth);
  z-index: 1;
}

.stat-blind.is-visible::before {
  transform: translateY(-101%);
}

.stat-blind > * {
  position: relative;
  z-index: 0;
}

/* 単位を下からfade-in */
.stat-unit-reveal {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s var(--ease-smooth);
}

.stat-unit-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 1.2s;
}

/* 大きな引用符（concept 用） */
.big-quote {
  position: relative;
  padding: 60px 24px 24px;
}

.big-quote::before,
.big-quote::after {
  position: absolute;
  font-family: var(--font-serif);
  font-size: 120px;
  color: var(--color-accent);
  opacity: 0;
  line-height: 1;
  transition: opacity 1.0s var(--ease-smooth), transform 1.0s var(--ease-smooth);
}

.big-quote::before {
  content: '“';
  top: -8px;
  left: 0;
  transform: translateY(20px);
}

.big-quote::after {
  content: '”';
  bottom: -40px;
  right: 0;
  transform: translateY(-20px);
}

.big-quote.is-visible::before,
.big-quote.is-visible::after {
  opacity: 0.55;
  transform: translateY(0);
}

.big-quote__text {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.0s ease 0.5s, transform 1.0s var(--ease-smooth) 0.5s;
}

.big-quote.is-visible .big-quote__text {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .big-quote {
    padding: 72px 56px 32px;
  }
  .big-quote::before {
    font-size: 180px;
    top: -16px;
    left: -8px;
  }
  .big-quote::after {
    font-size: 180px;
    bottom: -64px;
    right: -8px;
  }
}

/* メッセージセクションの左右スライドイン */
.slide-from-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 1.1s var(--ease-smooth), transform 1.1s var(--ease-smooth);
}

.slide-from-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 1.1s var(--ease-smooth) 0.2s, transform 1.1s var(--ease-smooth) 0.2s;
}

.slide-from-left.is-visible,
.slide-from-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* --------------------------------------------------
   11. Focus Visible
-------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* --------------------------------------------------
   12. Reduced Motion
-------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-in, .fade-in--left {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero__bg {
    animation: none !important;
  }
  /* 派手アニメーションも全て即時表示 */
  .reveal-line__inner,
  .slide-from-left,
  .slide-from-right,
  .big-quote__text,
  .stat-unit-reveal,
  .accent-line,
  .hero__vertical {
    opacity: 1 !important;
    transform: none !important;
  }
  .title-reveal::after,
  .stat-blind::before {
    transform: translateX(101%) !important;
    transition: none !important;
  }
  .big-quote::before,
  .big-quote::after {
    opacity: 0.55 !important;
    transform: none !important;
  }
  .accent-line {
    transform: scaleX(1) !important;
  }
  .intro-overlay {
    display: none !important;
  }
}

/* SP（767px以下）はパララックスや一部演出を無効化（CPU負荷削減） */
@media (max-width: 767px) {
  [data-parallax-y] {
    transform: none !important;
  }
  .hero__bg {
    animation-duration: 30s !important;
  }
  /* SPでは縦書きキャッチを非表示（画面が狭いため） */
  .hero__vertical {
    display: none;
  }
}

/* --------------------------------------------------
   12-B. 画像中心の派手アニメーション群
-------------------------------------------------- */

/* ============ ヒーロー：自動スライドショー ============ */
.hero-slideshow {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  z-index: 1;
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 2;
}

.hero-slide__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  /* デフォルトを Ken Burns の終了位置にしておく＋transitionで瞬間ジャンプを滑らかに。
     is-active 解除時に animation が解けても、現在位置からデフォルト位置へ滑らかに移動する */
  transform: scale(1.18);
  transition: transform 1.8s ease-out;
}

.hero-slide[data-zoom="tl-br"] .hero-slide__img { transform: scale(1.20); transform-origin: 70% 70%; }
.hero-slide[data-zoom="br-tl"] .hero-slide__img { transform: scale(1.20); transform-origin: 30% 30%; }
.hero-slide[data-zoom="tr-bl"] .hero-slide__img { transform: scale(1.20); transform-origin: 30% 70%; }
.hero-slide[data-zoom="bl-tr"] .hero-slide__img { transform: scale(1.20); transform-origin: 70% 30%; }

/* Ken Burns animation duration を slide間隔（PC 6000ms）と一致させて、
   アニメ完了 = 切替タイミングにし、途中打ち切りによるガクツキを防ぐ */
.hero-slide.is-active .hero-slide__img {
  animation: kenBurnsCenter 6s ease-out;
}

.hero-slide[data-zoom="tl-br"].is-active .hero-slide__img {
  animation: kenBurnsTopLeft 6s ease-out;
}

.hero-slide[data-zoom="br-tl"].is-active .hero-slide__img {
  animation: kenBurnsBottomRight 6s ease-out;
}

.hero-slide[data-zoom="tr-bl"].is-active .hero-slide__img {
  animation: kenBurnsTopRight 6s ease-out;
}

.hero-slide[data-zoom="bl-tr"].is-active .hero-slide__img {
  animation: kenBurnsBottomLeft 6s ease-out;
}

@media (max-width: 767px) {
  /* SP は slide間隔 7500ms に合わせる */
  .hero-slide.is-active .hero-slide__img,
  .hero-slide[data-zoom="tl-br"].is-active .hero-slide__img,
  .hero-slide[data-zoom="br-tl"].is-active .hero-slide__img,
  .hero-slide[data-zoom="tr-bl"].is-active .hero-slide__img,
  .hero-slide[data-zoom="bl-tr"].is-active .hero-slide__img {
    animation-duration: 7.5s;
  }
}

@keyframes kenBurnsCenter {
  from { transform: scale(1.05); transform-origin: center center; }
  to   { transform: scale(1.18); transform-origin: center center; }
}
@keyframes kenBurnsTopLeft {
  from { transform: scale(1.05); transform-origin: 30% 30%; }
  to   { transform: scale(1.20); transform-origin: 70% 70%; }
}
@keyframes kenBurnsBottomRight {
  from { transform: scale(1.05); transform-origin: 70% 70%; }
  to   { transform: scale(1.20); transform-origin: 30% 30%; }
}
@keyframes kenBurnsTopRight {
  from { transform: scale(1.05); transform-origin: 70% 30%; }
  to   { transform: scale(1.20); transform-origin: 30% 70%; }
}
@keyframes kenBurnsBottomLeft {
  from { transform: scale(1.05); transform-origin: 30% 70%; }
  to   { transform: scale(1.20); transform-origin: 70% 30%; }
}

/* スライドキャプション（画像と連動して切り替わる） */
.hero-captions {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.hero-caption {
  position: absolute;
  bottom: 12%;
  left: 0;
  right: 0;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.0s ease, transform 1.0s var(--ease-smooth);
  font-family: var(--font-serif);
  font-size: 18px;
  color: rgba(255,255,255,0.95);
  letter-spacing: 0.15em;
  text-shadow: 0 2px 14px rgba(0,0,0,0.5);
  padding: 0 24px;
  line-height: 1.7;
}

.hero-caption.is-active {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.4s;
}

@media (min-width: 768px) {
  .hero-caption { font-size: 22px; bottom: 14%; }
}
@media (min-width: 1024px) {
  .hero-caption { font-size: 26px; }
}

/* ヒーローインジケーター（ドット） */
.hero-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  background-color: rgba(0,0,0,0.25);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  border: none;
  padding: 0;
}

.hero-dot:hover {
  background-color: rgba(255,255,255,0.7);
  transform: scale(1.2);
}

.hero-dot.is-active {
  background-color: var(--color-accent);
  transform: scale(1.3);
}

/* ============ Before/Afterスライダー ============ */
.ba-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  user-select: none;
  cursor: ew-resize;
  background-color: var(--color-border);
}

.ba-slider__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-slider__after-wrap {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
}

.ba-slider__after-wrap .ba-slider__img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: auto;
  max-width: none;
  /* JS側で width をスライダー全体の幅と同じピクセル値に設定する */
}

.ba-slider__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background-color: rgba(255,255,255,0.95);
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 0 18px rgba(0,0,0,0.4);
  outline: none;
}

.ba-slider__handle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.ba-slider__handle:focus-visible .ba-slider__knob {
  box-shadow: 0 4px 18px rgba(0,0,0,0.3), 0 0 0 3px var(--color-accent);
}

.ba-slider__knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--color-main);
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
  pointer-events: none;
}

.ba-slider__knob::before {
  content: '◀ ▶';
  font-size: 11px;
  letter-spacing: 0;
  color: var(--color-accent);
}

.ba-slider__label {
  position: absolute;
  top: 16px;
  z-index: 4;
  padding: 6px 14px;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--color-white);
  background-color: rgba(31,58,52,0.7);
  text-transform: uppercase;
  pointer-events: none;
}

.ba-slider__label--before {
  left: 16px;
}

.ba-slider__label--after {
  right: 16px;
  background-color: rgba(179,139,74,0.85);
}

/* ============ ワークカード：ホバーで画像切り替え ============ */
.work-card-swap__image,
.work-item__image-swap {
  position: relative;
  overflow: hidden;
}

.work-card-swap__image .swap-img,
.work-item__image-swap .swap-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.6s var(--ease-smooth), transform 0.8s var(--ease-out);
}

.work-card-swap__image .swap-img--secondary,
.work-item__image-swap .swap-img--secondary {
  opacity: 0;
}

.work-card-swap:hover .swap-img--primary,
.work-item:hover .swap-img--primary {
  opacity: 0;
}

.work-card-swap:hover .swap-img--secondary,
.work-item:hover .swap-img--secondary {
  opacity: 1;
  transform: scale(1.06);
}

/* ============ ステップ画像（concept.html 通常スクロール） ============ */
.steps-stage {
  position: relative;
  background-color: var(--color-base-2);
}

.steps-stage__list {
  display: flex;
  flex-direction: column;
  gap: 56px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps-stage__step {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  background-color: var(--color-white);
  padding: 24px;
  border: 1px solid var(--color-border);
}

.steps-stage__visual {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--color-border);
}

.steps-stage__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}

.steps-stage__step:hover .steps-stage__img {
  transform: scale(1.04);
}

.steps-stage__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 4px 16px;
}

.steps-stage__step-number {
  font-family: var(--font-en);
  font-size: 14px;
  letter-spacing: 0.25em;
  color: var(--color-accent);
  display: block;
  margin-bottom: 8px;
}

.steps-stage__step-title {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--color-main);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  font-weight: 600;
  line-height: 1.5;
}

.steps-stage__step-text {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.9;
}

@media (min-width: 768px) {
  .steps-stage__step {
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    padding: 32px;
    align-items: center;
  }
  /* 偶数番目は画像と本文を入れ替えて視覚リズムを出す */
  .steps-stage__step:nth-child(even) .steps-stage__visual {
    order: 2;
  }
  .steps-stage__step:nth-child(even) .steps-stage__body {
    order: 1;
  }
}

@media (min-width: 1024px) {
  .steps-stage__list {
    gap: 72px;
  }
  .steps-stage__step {
    gap: 56px;
    padding: 40px;
  }
  .steps-stage__step-title {
    font-size: 24px;
  }
}

/* ============ フルスクリーン画像ギャラリー & ライトボックス ============ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  background-color: var(--color-border);
}

.gallery-item:nth-child(5n+1) {
  grid-row: span 2;
  aspect-ratio: 1 / 2;
}

.gallery-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out), filter 0.6s ease;
}

.gallery-item:hover .gallery-item__img {
  transform: scale(1.08);
  filter: brightness(1.05);
}

.gallery-item::after {
  content: '+';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  font-family: var(--font-en);
  font-size: 28px;
  color: var(--color-white);
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(31,58,52,0.0);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.5s var(--ease-out), background-color 0.4s ease;
  pointer-events: none;
}

.gallery-item:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  background-color: rgba(31,58,52,0.4);
}

/* ライトボックス */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background-color: rgba(11, 18, 16, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0s;
}

.lightbox__img-wrap {
  position: relative;
  max-width: 1200px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.4s ease, transform 0.5s var(--ease-out);
}

.lightbox.is-open .lightbox__img {
  opacity: 1;
  transform: scale(1);
}

.lightbox__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.12);
  color: var(--color-white);
  border: 1px solid rgba(255,255,255,0.4);
  font-size: 22px;
  cursor: pointer;
  z-index: 9100;
  transition: background-color 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
}

.lightbox__btn:hover {
  background-color: rgba(255,255,255,0.25);
  transform: translateY(-50%) scale(1.05);
}

.lightbox__btn--prev { left: 16px; }
.lightbox__btn--next { right: 16px; }

.lightbox__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background-color: rgba(255,255,255,0.12);
  color: var(--color-white);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  z-index: 9100;
  transition: background-color 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__close:hover {
  background-color: rgba(255,255,255,0.25);
  transform: rotate(90deg);
}

.lightbox__counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.8);
}

@media (min-width: 768px) {
  .lightbox__btn { width: 64px; height: 64px; font-size: 26px; }
  .lightbox__btn--prev { left: 32px; }
  .lightbox__btn--next { right: 32px; }
}

body.lightbox-open {
  overflow: hidden;
}

/* ============ Sticky パララックス画像セクション ============ */
.sticky-parallax {
  position: relative;
  background-color: var(--color-main);
  color: var(--color-white);
}

.sticky-parallax__pin {
  position: relative;
}

.sticky-parallax__stage {
  position: relative;
  height: 70vh;
  min-height: 480px;
  overflow: hidden;
}

.sticky-parallax__bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.sticky-parallax__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.4s ease, transform 1.4s var(--ease-smooth);
}

.sticky-parallax__img.is-active {
  opacity: 1;
  transform: scale(1.0);
}

.sticky-parallax__stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(31,58,52,0.55) 100%);
  z-index: 2;
}

.sticky-parallax__content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-parallax__text {
  text-align: center;
  max-width: 720px;
  padding: 32px;
}

.sticky-parallax__label {
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: 0.4em;
  color: rgba(255,255,255,0.85);
  margin-bottom: 20px;
  text-transform: uppercase;
  display: block;
}

.sticky-parallax__title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--color-white);
  line-height: 1.7;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.sticky-parallax__body {
  font-size: 14px;
  line-height: 2.0;
  color: rgba(255,255,255,0.85);
}

@media (min-width: 768px) {
  .sticky-parallax__title { font-size: 36px; }
  .sticky-parallax__body { font-size: 16px; }
}

@media (min-width: 1024px) {
  .sticky-parallax__title { font-size: 44px; }
}

/* SP最適化：sticky-parallaxは控えめ */
@media (max-width: 767px) {
  .sticky-parallax__stage {
    height: 60vh;
    min-height: 400px;
  }
}

/* ============ reduced-motion 対応（追加） ============ */
@media (prefers-reduced-motion: reduce) {
  .hero-slide {
    transition: none !important;
  }
  .hero-slide.is-active .hero-slide__img,
  .hero-slide[data-zoom] .hero-slide__img {
    animation: none !important;
    transform: none !important;
  }
  .hero-caption {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .steps-stage__img.is-active,
  .sticky-parallax__img.is-active {
    transition: none !important;
    transform: none !important;
  }
  .ba-slider {
    cursor: default !important;
  }
}

/* SP最適化：自動スライドショーは controlled by JS（詳細は main.js） */
@media (max-width: 767px) {
  .hero-slide.is-active .hero-slide__img,
  .hero-slide[data-zoom] .hero-slide__img {
    animation-duration: 12s !important;
  }
}

/* --------------------------------------------------
   13. Responsive — Tablet (768px+)
-------------------------------------------------- */
@media (min-width: 768px) {
  :root {
    --fs-xl: 30px;
    --fs-2xl: 36px;
  }

  .page-hero {
    height: 440px;
  }

  .page-hero__title {
    font-size: 38px;
  }

  .footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.4fr;
    gap: 48px;
  }
}

/* --------------------------------------------------
   14. Responsive — PC (1024px+)
-------------------------------------------------- */
@media (min-width: 1024px) {
  .section {
    padding: var(--section-padding-pc) 0;
  }

  .header {
    height: 80px;
  }

  .header__hamburger { display: none; }
  .header__drawer { display: none; }

  .header__nav {
    display: flex;
    align-items: center;
    gap: 40px;
  }

  .header__logo-main { font-size: 20px; }
  .header__logo-sub { font-size: 11px; }

  .page-hero {
    height: 520px;
  }

  .page-hero__title {
    font-size: 44px;
  }
}

/* --------------------------------------------------
   15. Responsive — Large PC (1280px+)
-------------------------------------------------- */
@media (min-width: 1280px) {
  .section__title {
    font-size: 38px;
  }
}
