/* =========================================================
   3D Product Viewer — style
   ========================================================= */
:root {
  --bg-1: #dcdddf;
  --bg-2: #b8b9bc;
  --ink: #1b1c1e;
  --ink-soft: #55575c;
  --line: rgba(27, 28, 30, 0.14);
  --glass: rgba(255, 255, 255, 0.55);
  --accent: #1b1c1e;
  --radius: 999px;
  --font: "Inter", "Noto Sans JP", system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(120% 90% at 50% 40%, var(--bg-1) 0%, var(--bg-2) 100%) fixed;
  background-color: var(--bg-2);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ---------- 3D canvas ---------- */
#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
  cursor: grab;
  touch-action: pan-y; /* 縦スワイプはスクロール、横ドラッグは回転 */
}
#scene.is-dragging { cursor: grabbing; }

/* ---------- Header ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(16px, 4vw, 48px);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.logo {
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 14px;
}
.logo span { font-weight: 400; color: var(--ink-soft); }
.nav__links { display: flex; gap: 28px; font-size: 12px; letter-spacing: 0.14em; }
.nav__links a { color: var(--ink); text-decoration: none; opacity: 0.55; transition: opacity .3s; }
.nav__links a.is-current { opacity: 1; }
.nav__cart {
  font-size: 12px; letter-spacing: 0.14em;
  padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--glass); backdrop-filter: blur(8px);
}

/* ---------- Scroll sections (高さでスクロール量を作る) ---------- */
.stage { position: relative; height: 140vh; pointer-events: none; }
.stage--tee { height: 120vh; }
.stage--shoe { height: 100vh; }

/* ---------- Fixed product panels ---------- */
.panel {
  position: fixed;
  z-index: 10;
  left: clamp(16px, 6vw, 96px);
  top: 50%;
  width: min(400px, 38vw);
  transform: translateY(-50%);
  pointer-events: none;
}
.panel > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}
.panel.is-active { pointer-events: auto; }
.panel.is-active > * { opacity: 1; transform: none; }
.panel.is-active > *:nth-child(2) { transition-delay: .06s; }
.panel.is-active > *:nth-child(3) { transition-delay: .12s; }
.panel.is-active > *:nth-child(4) { transition-delay: .18s; }
.panel.is-active > *:nth-child(5) { transition-delay: .24s; }
.panel.is-active > *:nth-child(6) { transition-delay: .30s; }

.panel__index { font-size: 11px; letter-spacing: 0.24em; color: var(--ink-soft); margin-bottom: 18px; }
.panel__title {
  font-size: clamp(40px, 5.4vw, 76px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.panel__desc { font-size: 14px; line-height: 1.9; color: var(--ink-soft); margin-bottom: 26px; max-width: 34ch; }

.swatches { display: flex; gap: 10px; align-items: center; margin-bottom: 28px; }
.swatches__label { font-size: 11px; letter-spacing: 0.18em; color: var(--ink-soft); margin-right: 6px; min-width: 52px; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
  outline: 1.5px solid transparent; outline-offset: 3px;
  transition: outline-color .25s, transform .25s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.is-selected { outline-color: var(--ink); }


/* ---------- View bar (6面ボタン) ---------- */
.viewbar {
  position: fixed;
  z-index: 15;
  left: 50%; bottom: 28px;
  transform: translateX(-50%);
  display: flex; gap: 4px; align-items: center;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid rgba(255,255,255,.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(0,0,0,.08);
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  scrollbar-width: none;
  transition: opacity .4s;
}
.viewbar::-webkit-scrollbar { display: none; }
.viewbar.is-hidden { opacity: 0; pointer-events: none; }
.viewbar button {
  flex: none;
  padding: 9px 14px; border-radius: var(--radius);
  font-size: 11px; letter-spacing: 0.16em; color: var(--ink-soft);
  transition: background .25s, color .25s;
}
.viewbar button:hover { color: var(--ink); }
.viewbar button.is-selected { background: var(--ink); color: #fff; }
.viewbar__sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; flex: none; }

/* ---------- Side progress ---------- */
.progress {
  position: fixed; z-index: 15;
  right: clamp(16px, 3vw, 40px); top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 14px; align-items: flex-end;
  font-size: 11px; letter-spacing: 0.2em;
}
.progress a { color: var(--ink); text-decoration: none; opacity: .35; display: flex; align-items: center; gap: 10px; transition: opacity .3s; }
.progress a::after { content: ""; width: 18px; height: 1px; background: currentColor; transition: width .4s; }
.progress a.is-current { opacity: 1; }
.progress a.is-current::after { width: 40px; }

/* ---------- Scroll hint ---------- */
.hint {
  position: fixed; z-index: 15;
  left: 50%; bottom: 92px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 0.3em; color: var(--ink-soft);
  pointer-events: none;
  transition: opacity .5s;
}
.hint.is-hidden { opacity: 0; }
.hint__line { width: 1px; height: 36px; background: var(--line); position: relative; overflow: hidden; }
.hint__line::after {
  content: ""; position: absolute; left: 0; top: -40%; width: 100%; height: 40%;
  background: var(--ink);
  animation: hint 1.8s cubic-bezier(.6, 0, .3, 1) infinite;
}
@keyframes hint { to { top: 110%; } }

/* ---------- Big background word ---------- */
.bigword {
  position: fixed; z-index: -1;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 22vw; font-weight: 900; letter-spacing: -0.05em;
  color: rgba(255,255,255,.28);
  white-space: nowrap; pointer-events: none; user-select: none;
  transition: opacity .6s, transform .9s cubic-bezier(.2,.8,.2,1);
}
.bigword.is-out { opacity: 0; transform: translate(-50%, -30%); }


/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg-1);
  font-size: 11px; letter-spacing: 0.3em;
  transition: opacity .6s, visibility .6s;
}
.loader.is-done { opacity: 0; visibility: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav__links { display: none; }
  .panel {
    top: auto; bottom: 88px;
    left: 16px; right: 16px; width: auto;
    transform: none;
  }
  .panel__title { font-size: 38px; margin-bottom: 10px; }
  .panel__index { margin-bottom: 8px; }
  .panel__desc { display: none; }
    .swatches { margin-bottom: 14px; }
  .progress { display: none; }
  .hint { display: none; }
  .viewbar { bottom: 16px; }
}
