/* Navigation footer: logo left, external links right */
.nav-footer {
  position: absolute;
  bottom: 44px;
  left: 0;
  right: 0;
  padding: 0 48px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-logo img {
  height: 38px;
  width: auto;
  object-fit: contain;
  opacity: 0.9;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.nav-logo:hover img {
  opacity: 1;
  transform: scale(1.05);
}

.nav-external-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.nav-ext-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.nav-ext-link .nav-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.nav-ext-link:hover .nav-icon-wrap {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-ext-link:hover {
  color: #fff;
}

/* HP icon: blue gradient */
.nav-icon-wrap.icon-web {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
}

/* Instagram icon: brand gradient */
.nav-icon-wrap.icon-insta {
  background: radial-gradient(
    circle at 30% 110%,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
}

.nav-ext-link svg {
  flex-shrink: 0;
  color: #fff;
}

/* Intro - Fixed Background Video + Scroll Text */
.intro-video-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  transition: opacity 0.5s ease;
}

.intro-video-fixed video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.intro-video-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.intro-scroll-wrapper {
  position: relative;
  z-index: 1;
  /* 4 sections: 3 text panels + 1 hold section for last text */
  height: 400vh;
  padding: 0;
}

.intro-scroll-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.intro-scroll-text {
  text-align: center;
  color: #fff;
  opacity: 0;
  transform: translateY(25px);
  filter: blur(6px);
  transition:
    opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity, filter;
  padding: 0 20px;
}

.intro-scroll-text.active {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.intro-scroll-text.exit-up {
  opacity: 0;
  transform: translateY(-20px);
  filter: blur(4px);
}

.intro-scroll-en {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.6;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
  margin-bottom: 14px;
  color: #fff;
}

.intro-scroll-ja {
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  font-weight: 300;
  letter-spacing: 0.25em;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.6);
  color: #fff;
  margin: 0;
}

/* Gradient at the very bottom of the intro wrapper to blend into next section */
.intro-scroll-wrapper::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30vh;
  background: linear-gradient(to top, var(--color-bg) 0%, transparent 100%);
  z-index: 5;
  pointer-events: none;
}

.scroll-prompt {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  animation: bounce 2s infinite;
}

/* ===============================
   Horizontal Scroll-Linked Panels
   (Nishiyama-style)
   =============================== */

/* --- Configuration Variables --- */
:root {
  --hscroll-panel-count: 3;
  /* Total distance = (panelCount + 1) × 100vh — increased for 3 panels */
  --hscroll-total-height: calc((var(--hscroll-panel-count) + 2) * 100vh);
  --hscroll-bp-tablet: 1024px;
  --hscroll-bp-mobile: 768px;
  --hscroll-ease: cubic-bezier(0.22, 1, 0.36, 1); /* power2.out feel */
}

/* Outer section: creates the scrollable height */
.hscroll-section {
  position: relative;
  height: var(--hscroll-total-height);
  background: var(--color-bg);
  z-index: 1;
  outline: none; /* keyboard focus will be visible via indicator */
}

/* Header (scrolls normally, shown initially, then sticky hides it) */
.hscroll-header {
  padding: 120px 0 40px;
  text-align: center;
  background: var(--color-bg);
  position: relative;
  z-index: 2;
}

/* Sticky viewport: stays fixed while user scrolls through section height */
.hscroll-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  background: var(--color-bg);
}

/* Track: holds all panels side-by-side, translated by JS */
.hscroll-track {
  display: flex;
  width: calc(100vw * var(--hscroll-panel-count));
  height: 80vh;
  will-change: transform;
  /* No CSS transition — JS uses rAF for 60fps smoothness */
}

/* Individual Panel */
.hscroll-panel {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 5%;
  box-sizing: border-box;
  /* Fade panels that aren't centered — keep minimum 0.7 for visibility */
  opacity: 0.7;
  transition: opacity 0.5s var(--hscroll-ease);
}

.hscroll-panel.is-active {
  opacity: 1;
}

/* Panel Image */
.hscroll-panel-img {
  flex: 0 0 65%;
  max-width: 65%;
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: 16px;
  position: relative;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.hscroll-panel-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition:
    transform 1s var(--hscroll-ease),
    filter 0.5s var(--hscroll-ease);
  filter: brightness(1.1);
}

.hscroll-panel.is-active .hscroll-panel-img img {
  transform: scale(1.05);
}

/* Panel Body (text side) */
.hscroll-panel-body {
  flex: 0 0 42%;
  max-width: 42%;
  margin-left: -7%;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 50px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* Slide-in content effect — keep visible during transitions */
  transform: translateX(10px) translateY(10px);
  opacity: 0.6;
  transition:
    transform 0.7s var(--hscroll-ease) 0.15s,
    opacity 0.6s var(--hscroll-ease) 0.15s;
}

.hscroll-panel.is-active .hscroll-panel-body {
  transform: translateX(0) translateY(0);
  opacity: 1;
}

.hscroll-panel-num {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 300;
  color: var(--color-accent);
  opacity: 0.4;
  line-height: 1;
  letter-spacing: 0.05em;
  margin-bottom: -15px;
}

.hscroll-panel-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 2.5vw, 2.6rem);
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
  margin: 0;
}

.hscroll-panel-desc {
  font-size: clamp(1.05rem, 1.1vw, 1.25rem);
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.hscroll-panel-body .btn {
  align-self: flex-start;
  margin-top: 10px;
}

/* --- Indicators --- */
.hscroll-indicators {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 10;
}

.hscroll-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.4s var(--hscroll-ease);
  position: relative;
}

.hscroll-dot.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: scale(1.3);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

.hscroll-dot:hover {
  border-color: var(--color-accent);
  transform: scale(1.15);
}

.hscroll-dot:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.hscroll-progress-bar {
  width: 80px;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
  margin-left: 10px;
}

.hscroll-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
  border-radius: 2px;
  transition: width 0.15s linear;
}

/* --- CTA Button --- */
.hscroll-cta {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.hscroll-cta.show {
  opacity: 1;
  pointer-events: auto;
}

/* --- Tablet (768–1023px): horizontal still, slightly adjusted --- */
@media (min-width: 768px) and (max-width: 1023px) {
  .hscroll-panel {
    gap: 0;
    padding: 0 5%;
  }

  .hscroll-panel-img {
    flex: 0 0 65%;
    max-width: 65%;
  }

  .hscroll-panel-body {
    flex: 0 0 55%;
    max-width: 55%;
    margin-left: -20%;
    padding: 40px;
  }

  .hscroll-panel-title {
    font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  }

  .hscroll-panel-desc {
    font-size: 1.1rem;
  }
}

/* --- Mobile (<768px): completely disable horizontal scroll, stack vertically --- */
@media (max-width: 767px) {
  .hscroll-section {
    height: auto !important;
    padding-bottom: 60px;
  }

  .hscroll-header {
    padding: 80px 0 30px;
  }

  .hscroll-sticky {
    position: relative !important;
    height: auto !important;
    overflow: visible;
  }

  .hscroll-track {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
  }

  .hscroll-panel {
    flex: none;
    width: 100% !important;
    height: auto !important;
    flex-direction: column;
    padding: 40px 5%;
    gap: 0;
    opacity: 1 !important;
  }

  .hscroll-panel-img {
    flex: none;
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 12px;
  }

  .hscroll-panel-body {
    max-width: 100%;
    margin-left: 0;
    margin-top: -15%;
    padding: 30px;
    transform: none !important;
    opacity: 1 !important;
    transition: none;
  }

  .hscroll-panel-num {
    font-size: 2.5rem;
  }

  /* Hide desktop-only indicators */
  .hscroll-indicators {
    display: none;
  }

  .hscroll-cta {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    text-align: center;
    margin-top: 30px;
    opacity: 1;
    pointer-events: auto;
  }
}

/* --- prefers-reduced-motion: disable all transforms and transitions --- */
@media (prefers-reduced-motion: reduce) {
  .hscroll-track {
    transition: none !important;
  }

  .hscroll-panel {
    opacity: 1 !important;
    transition: none !important;
  }

  .hscroll-panel-body {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }

  .hscroll-panel-img img {
    transition: none !important;
    transform: none !important;
  }

  .hscroll-dot {
    transition: none !important;
  }

  .hscroll-progress-fill {
    transition: none !important;
  }
}

/* Product Slider */
.product-slider-section {
  background-color: var(--color-bg);
}

.product-slider-container {
  width: 100vw;
  padding: 40px 0;
  background: transparent;
}

.product-slider-track {
  display: flex;
  width: max-content;
  animation: infinite-scroll 50s linear infinite;
}

.product-slider-track:hover {
  animation-play-state: paused;
}

.product-slider-track .slide-group img {
  width: 350px;
  height: 250px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  filter: brightness(0.9);
  transition:
    filter 0.3s ease,
    transform 0.3s ease;
}

.product-slider-track .slide-group img:hover {
  filter: brightness(1);
  transform: translateY(-5px);
}

/* ===============================
   Stacked Cards Animation
   =============================== */
.stacked-sections {
  position: relative;
  /* 3 cards × 100vh each */
  height: 300vh;
  z-index: 1;
}

.stacked-track {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.stack-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform, opacity;
  transform-origin: top center;
}

.stack-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stack-card-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 1;
}

.stack-card-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  color: #fff;
}

.stack-card-content .section-title span {
  color: #fff;
}
