*, *::before, *::after { box-sizing: border-box; }
body, html {
  margin: 0;
  padding: 0;
  background: #fff;
  width: 100%;
  font-family: 'Noto Serif JP', serif;
  scroll-behavior: smooth;
}

/* ===== HEADER ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  border-bottom: 1px solid #e0e0e0;
}

.header-logo {
 display: flex;
 align-items: center;
}
	
.header-logo img {
 height: 40px;	
}

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

nav a {
  text-decoration: none;
  color: #595757;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  position: relative;
  padding-bottom: 3px;
}
nav a:not(.nav-contact):not([aria-label])::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: #595757;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
nav a:not(.nav-contact):not([aria-label]):hover::after {
  transform: scaleX(1);
}
nav a:not(.nav-contact):not([aria-label]):hover { color: #000; }

.nav-contact {
  background: #111;
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.2s !important;
}
.nav-contact:hover { opacity: 0.7; }

.nav-icons {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: 4px;
}
.nav-icons a {
  color: #595757;
  font-size: 1rem;
  display: flex;
  align-items: center;
}

/* ===== ACCORDION ===== */
.accordion-wrapper {
  display: flex;
  width: 100%;
  height: calc(100vh - 72px);
  margin-top: 72px;
  overflow: hidden;
}

.panel {
  position: relative;
  height: 100%;
  overflow: hidden;
  flex-shrink: 0;
}

.panel:nth-child(n+2) {
  margin-left: -140px;
}

.panel:nth-child(1),
.panel:nth-child(2),
.panel:nth-child(3),
.panel:nth-child(4),
.panel:nth-child(5) {
  clip-path: polygon(
    0 0,
    calc(100% - 119px) 0,
    calc(100% - 113px) 0px,
    calc(100% - 107px) 1px,
    calc(100% - 101px) 3px,
    calc(100% - 96px) 6px,
    calc(100% - 91px) 9px,
    calc(100% - 86px) 13px,
    calc(100% - 9px) 82px,
    calc(100% - 2px) 92px,
    100% 102px,
    100% 100%,
    0 100%
  );
}

.panel:nth-child(1) { width: 43vw; z-index: 6; }
.panel:nth-child(2) { width: calc((57vw + 700px) / 5); z-index: 5; }
.panel:nth-child(3) { width: calc((57vw + 700px) / 5); z-index: 4; }
.panel:nth-child(4) { width: calc((57vw + 700px) / 5); z-index: 3; }
.panel:nth-child(5) { width: calc((57vw + 700px) / 5); z-index: 2; }
.panel:nth-child(6) { width: calc((57vw + 700px) / 5); z-index: 1; }

.img-track {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  display: flex;
  z-index: 0;
}

.img-slide {
  flex-shrink: 0;
  height: 100%;
  background-size: cover;
  background-position: 50% 50%;
  position: relative;
}

/* ===== 改行制御 ===== */
.br-sp { display: none; }

/* ===== スマホ・タブレット: 768px以下 ===== */
@media (max-width: 768px) {
  .philosophy-scroll {
    display: none !important;
  }
  .br-sp { display: inline; }
  .br-pc { display: none; }
}

@media (max-width: 768px) {
  header nav a:not(.nav-contact):not([aria-label]) {
    display: none;
  }
  .footer-nav a[href="#works"],
  .footer-nav a[href="#workflow"] {
    display: none;
  }
  .footer-inner {
    gap: 20px;
    padding: 20px;
  }
  .footer-map {
    width: 200px;
    height: 160px;
    flex-shrink: 0;
  }
  .footer-info {
    min-width: 0;
  }
  .footer-address {
    font-size: 0.78rem;
    word-break: break-word;
  }
  .footer-company {
    font-size: 0.9rem;
  }
  /* 4・5・6枚目を非表示 */
  .panel:nth-child(4),
  .panel:nth-child(5),
  .panel:nth-child(6) {
    display: none;
  }

  /* タブレット・モバイルはオフセット60px（45°、縦も小さく） */
  .panel:nth-child(n+2) {
    margin-left: -60px;
  }

  /* clip-path: 1・2枚目ともモバイルサイズ */
  .panel:nth-child(1),
  .panel:nth-child(2) {
    clip-path: polygon(
      0 0,
      calc(100% - 67px) 0,
      calc(100% - 65px) 0px,
      calc(100% - 63px) 1px,
      calc(100% - 60px) 1px,
      calc(100% - 58px) 2px,
      calc(100% - 57px) 3px,
      calc(100% - 55px) 5px,
      calc(100% - 3px) 52px,
      100% 58px,
      100% 100%,
      0 100%
    );
  }
  .panel:nth-child(3) {
    clip-path: none;
  }

  /* 1枚目を60vw、2・3枚目で残りを均等に: 60vw + W×2 - 60px×2 = 100vw → W = (40vw + 120px) / 2 */
  .panel:nth-child(1) { width: 60vw; }
  .panel:nth-child(2) { width: calc((40vw + 120px) / 2); }
  .panel:nth-child(3) { width: calc((40vw + 120px) / 2); }
}

@media (max-width: 480px) {
  header {
    padding: 0 12px;
    gap: 8px;
  }
  .header-logo img {
    height: 28px;
  }
  nav {
    gap: 10px;
  }
  .nav-contact {
    padding: 6px 10px;
    font-size: 0.62rem;
  }
  .accordion-wrapper {
    height: calc(100vh - 72px);
    height: calc(100dvh - 72px);
    margin-top: 72px;
  }
}

.panel-label {
  position: absolute;
  bottom: 60px;
  max-height: 300px;
  width: auto;
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.5)) drop-shadow(0 0 12px rgba(0,0,0,0.9));
}
/* ラベル位置はJSで動的に設定 */
@media (max-width: 768px) and (min-width: 481px) {
  .panel-label {
    max-height: 180px !important;
  }
}
@media (max-width: 480px) {
  .panel-label {
    max-height: 120px !important;
  }
}

/* ===== FADE-IN ANIMATION ===== */
.fade-in-section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== PHILOSOPHY SECTION ===== */
.philosophy-section {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px 40px;
  box-sizing: border-box;
  position: relative;
}
.philosophy-scroll {
  position: absolute;
  left: 32px;
  bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.philosophy-scroll span {
  writing-mode: vertical-rl;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #999;
  text-transform: uppercase;
}

.philosophy-scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 60px;
  background: #999;
  animation: scrollLine 1.8s ease-in-out infinite;
}

@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  51%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

.philosophy-inner {
  max-width: 700px;
}

.philosophy-heading {
  margin: 0 0 24px;
  text-align: center;
}

.philosophy-heading img {
  max-width: 100%;
  height: auto;
}

.philosophy-sub {
  font-size: 1.2rem;
  font-weight: 400;
  color: #333;
  letter-spacing: 0.05em;
  margin: 0 0 24px;
  font-family: inherit;
  line-height: 1.8;
}

.philosophy-body {
  font-size: 1rem;
  color: #666;
  line-height: 2.0;
  margin: 0;
}
/* ===== FURNITURE SECTION ===== */
.furniture-section {
  width: 100%;
  padding: 80px 40px;
  box-sizing: border-box;
}

.furniture-title {
  text-align: center;
  margin: 0 0 48px;
}

.furniture-title img {
  height: auto;
  max-width: 100%;
}

.furniture-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 48px;
}

.furniture-left {
  flex-shrink: 0;
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.furniture-logo {
  width: 100%;
  height: auto;
}

.furniture-body {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.8;
  margin: 0;
}

.furniture-images {
  display: flex;
  gap: 12px;
  flex: 1;
}

.furniture-img {
  flex: 1;
  width: 0;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

@media (max-width: 768px) {
  .furniture-section {
    padding: 60px 24px;
  }
  .furniture-inner {
    flex-direction: column;
    gap: 28px;
  }
  .furniture-left {
    width: 100%;
    flex-direction: row;
    align-items: center;
  }
  .furniture-logo {
    width: 160px;
  }
  .furniture-images {
    width: 100%;
  }
  .furniture-img {
    flex: 1;
    width: 0;
  }
}

@media (max-width: 480px) {
  .furniture-title {
    font-size: 1.6rem;
  }
}

/* ===== NEW WORKS SECTION ===== */
.works-section {
  width: 100%;
  padding: 80px 0 40px;
  overflow: hidden;
}

.works-title {
  font-size: 1.6rem;
  font-weight: 300;
  color: #aaa;
  letter-spacing: 0.05em;
  font-family: 'Noto Serif JP', serif;
  text-align: center;
  margin: 0 0 30px;
}

.works-slider-outer {
  overflow: hidden;
  user-select: none;
  cursor: grab;
  margin: 0 40px;
}
.works-slider-outer:active {
  cursor: grabbing;
}

.works-slider-track {
  display: flex;
  gap: 24px;
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  width: max-content;
}

.works-card {
  flex-shrink: 0;
  width: calc((100vw - 80px - 72px) / 4);
  overflow: hidden;
  position: relative;
  background: #ccc;
  aspect-ratio: 4 / 5;
  cursor: pointer;
}
.works-card.is-pressed {
  transform: scale(0.97);
}

@media (max-width: 768px) {
  .works-slider-outer {
    margin: 0 20px;
  }
  .works-card {
    width: calc((100vw - 40px - 24px) / 2);
  }
}

.works-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.works-card.is-hover .works-card-img {
  transform: scale(1.04);
}

.works-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  transition: background 0.3s ease;
}
.works-card.is-hover .works-card-overlay {
  background: rgba(0, 0, 0, 0.7);
}

.works-card-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.works-card.is-hover .works-card-view {
  opacity: 1;
}
.works-card-view span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.8);
  padding: 8px 20px;
  text-transform: uppercase;
}

.works-card-info {
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  color: #fff;
  padding: 0;
}
.works-card-title {
  display: block;
  height: 18px;
  width: auto;
}

.works-more {
  text-align: right;
  padding: 20px 40px 0;
}
.works-more a {
  font-size: 1.2rem;
  color: #111;
  text-decoration: none;
  letter-spacing: 0.15em;
  position: relative;
  padding-bottom: 3px;
}
.works-more a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: #111;
  transform: scaleX(1);
  transform-origin: left;
  transition: transform 0.3s ease;
  animation: moreUnderline 3s ease-in-out infinite;
}
.works-more a:hover::after {
  transform: scaleX(1);
  animation: none;
}

@keyframes moreUnderline {
  0%   { transform: scaleX(1); }
  40%  { transform: scaleX(0); transform-origin: right; }
  60%  { transform: scaleX(0); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: left; }
}

@media (max-width: 768px) {
  .works-more a {
    font-size: 1rem;
  }
}

/* ===== WORKS MODAL ===== */
#works-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
#works-modal.open { display: flex; }

#works-modal-inner {
  background: #fff;
  padding: 40px 32px 32px;
  max-width: 560px;
  width: 90%;
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#works-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #333;
  line-height: 1;
}
#works-modal-title {
  height: 28px;
  width: auto;
  margin: 0 0 10px;
  flex-shrink: 0;
  align-self: flex-start;
}
#works-modal-images {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#works-modal-main {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
#works-modal-main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
#works-modal-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  flex-shrink: 0;
}
.modal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: background 0.3s;
}
.modal-dot.active { background: #333; }

#works-modal-thumbs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-shrink: 0;
}
#works-modal-thumbs img {
  width: calc((100% - 12px) / 3);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 4px;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.3s;
}
#works-modal-thumbs img:hover { opacity: 1; }

/* タブレット以下：+アイコン表示、VIEW非表示 */
@media (max-width: 1024px) {
  .works-card-view { display: none; }
  .works-card::after {
    content: '+';
    position: absolute;
    bottom: 8px;
    right: 10px;
    color: rgba(255,255,255,0.85);
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1;
    pointer-events: none;
  }
}

@media (min-width: 1025px) {
  #works-modal-inner {
    max-width: 760px;
  }
}

@media (max-width: 480px) {
  #works-modal-inner {
    padding: 40px 16px 16px;
  }
}

/* ===== WORKFLOW SECTION ===== */
.workflow-title {
  text-align: center;
  margin: 0 0 24px;
}

.workflow-title img {
  max-width: 300px;
}
	
.workflow-section {
  width: 100%;
  padding: 80px 40px 80px;
  box-sizing: border-box;
  position: relative;
}

.workflow-inner {
  max-width: 800px;
  margin: 0 auto;
}

.workflow-item {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 60px;
  table-layout: fixed;
}

.workflow-num {
  width: 80px;
  min-width: 80px;
  padding: 0;
  position: relative;
}

.workflow-num img {
  position: absolute;
  display: block;
  bottom: -3px;
  right: 0;
  width: auto;
  height: 55px;
}

@media (max-width: 768px) {
  .workflow-num {
    width: 40px;
    min-width: 40px;
  }
  .workflow-num img {
    width: auto;
    height: 40px;
  }
}

.workflow-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: #595757;
  padding: 0 0 7px 20px;
  border-bottom: 1px solid #ccc;
  vertical-align: bottom;
}

.workflow-body {
  font-size: 1rem;
  color: #555;
  line-height: 1.9;
  padding: 12px 0 0 20px;
  vertical-align: top;
}

.workflow-divider { display: none; }
	
.workflow-box {
  margin-top: 24px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 24px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 24px;
  box-sizing: border-box;
}

.workflow-box-left {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.workflow-box-logo {
  height: 60px;
  width: auto;
  display: block;
}

.workflow-box-label {
  font-size: 0.9rem;
  color: #555;
  margin: 0;
  line-height: 1.2;
}

.workflow-box-images {
  display: flex;
  gap: 12px;
  flex: 1;
}

.workflow-box-img {
  flex: 1;
  width: 0;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

@media (max-width: 768px) {
  .workflow-box {
    flex-direction: column;
    align-items: flex-start;
  }
  .workflow-box-left {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
	.workflow-box-label br {
		display: none;
	}
  .workflow-box-images {
    width: 100%;
  }
  .workflow-box-img {
    flex: 1;
    width: 0;
  }
}
	
@media (max-width: 480px) {
  .philosophy-heading img {
    max-width: 60%;
  }
  .philosophy-sub {
    font-size: 1rem;
    letter-spacing: 0.02em;
  }
  .philosophy-body {
    font-size: 0.875rem;
    letter-spacing: 0;
  }
  .philosophy-body br {
    display: none;
  }
  .works-title {
    text-align: center;
  }
  .works-title img {
    max-width: 60%;
  }
  .workflow-title {
    margin-bottom: 30px;
  }
  .workflow-title img {
    max-width: 60%;
  }
	.workflow-box-label br {
		display: inherit;
	}
  .workflow-item {
    display: block;
  }
  .workflow-item tr {
    display: block;
    width: 100%;
  }
  .workflow-item td {
    display: block;
    width: 100%;
  }
  /* 数字＋見出し行だけ横並び */
  .workflow-item tr:first-child {
    display: flex;
    align-items: flex-end;
    gap: 0px;
  }
  .workflow-item tr:first-child .workflow-num {
    width: 40px !important;
    min-width: 40px;
    height: 50px;
    position: relative;
    flex-shrink: 0;
  }
  .workflow-item tr:first-child .workflow-num img {
    position: absolute;
    display: block;
    bottom: -3px;
    left: 0;
    width: auto;
    height: 40px;
  }
  .workflow-item tr:first-child .workflow-heading {
    width: auto !important;
    min-width: 0;
    flex: 1;
    padding-left: 13px;
    padding-top: 0;
    padding-bottom: 3px;
  }
  .workflow-body {
    padding-left: 0;
  }
  .workflow-box-left {
    flex-direction: column;
    align-items: flex-start;
  }
  .workflow-box-images {
    flex-direction: column;
  }
  .workflow-box-img {
    width: 100%;
    flex: none;
    aspect-ratio: 4 / 3;
  }
}
	
/* ===== FOOTER ===== */
.site-footer {
  width: 100%;
  padding: 60px 40px 0;
  box-sizing: border-box;
}

.footer-inner {
  display: inline-flex;
  gap: 40px;
  align-items: flex-start;
  margin: 0 auto 0px;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid #e0e0e0;
  max-width: 750px;
  padding: 30px;

}

.footer-map {
  flex-shrink: 0;
  width: 280px;
  height: 180px;
}

.footer-map iframe {
  width: 100%;
  height: 100%;
  filter: grayscale(40%) saturate(80%);
  display: block;
}

.footer-mail {
  color: #555;
  text-decoration: none;
  border-bottom: 1px solid #aaa;
  transition: color 0.2s, border-color 0.2s;
}

.footer-mail:hover {
  color: #111;
  border-color: #111;
}
.footer-info {
  flex: none;
  width: fit-content;
}

.footer-company {
  font-size: 1rem;
  font-weight: 500;
  color: #595757;
  margin: 0 0 16px;
  line-height: 1.2;
}

.footer-company span {
  font-size: 0.85rem;
  font-weight: 400;
}

.footer-address {
  font-size: 0.85rem;
  color: #595757;
  line-height: 1.6;
  margin: 0;
}

.footer-nav-wrap {
  padding: 20px 0;
}

.footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.footer-nav a {
  text-decoration: none;
  color: #595757;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-contact {
  background: #111;
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 4px;
}

.footer-instagram {
  display: flex;
  align-items: center;
  color: #595757;
}

.footer-copy {
  text-align: center;
  padding: 24px 0;
}

.footer-copy p {
  font-size: 0.75rem;
  color: #999;
  margin: 0;
}

@media (max-width: 480px) {
  .site-footer {
    padding: 40px 20px 0;
  }
  .footer-inner {
    flex-direction: column;
    align-items: center;
  }
  .footer-map {
    width: 100%;
    height: 200px;
  }
  .footer-nav {
    flex-wrap: wrap;
    gap: 16px;
  }
}