html,
body {
  margin: 0;
  padding: 0;
  background: #000;
  overflow-x: hidden;
  touch-action: pan-y;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

#webgl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background:
    radial-gradient(
      circle at 20% 10%,
      rgba(255, 180, 140, 0.15),
      transparent 55%
    ),
    linear-gradient(135deg, #fbffbf 0%, #ce7d88 40%, #6a2f55 70%, #2e1f3a 100%);
}

.overlay {
  position: relative;
  z-index: 1;
}

/* =========================
   loading
========================= */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.08);
  transition: opacity 0.6s ease;
}

.loading-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-top: 2px solid rgba(255, 255, 255, 1);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================
   header
========================= */

.top-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  height: 16px;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
}

.top-header__inner {
  width: 100%;
  padding: 0 16px;
}

/* =========================
   toggle
========================= */

.view-toggle {
  position: fixed;
  top: 34px;
  right: 16px;
  z-index: 30;
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.6);
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* =========================
   sections
========================= */

.top-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 3vw, 56px);
}

/* 1画面目：縦に1列、左に少し余白 */
.overlay > .top-section:first-child {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(120px, 14vh, 180px) clamp(24px, 6vw, 120px)
    clamp(40px, 10vh, 100px);
  gap: clamp(10px, 2vh, 24px);
}

.overlay > .top-section:first-child > div {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: flex-end;
}

/* 1画面目のpanelだけ専用調整 */
.overlay > .top-section:first-child .panel {
  width: 100%;
  margin-top: 0;
  padding: 0;
  opacity: 0;
  transform: translateY(40px);
}

.overlay > .top-section:first-child .panel.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.overlay > .top-section:first-child .panel:nth-child(1) {
  transition-delay: 0.05s;
}

.overlay > .top-section:first-child .panel:nth-child(2) {
  transition-delay: 0.1s;
}

.overlay > .top-section:first-child .panel:nth-child(3) {
  transition-delay: 0.15s;
}

.overlay > .top-section:first-child .panel:nth-child(4) {
  transition-delay: 0.2s;
}

.banner-section {
  justify-content: center;
}

.top-about-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(42px, 6.5vw, 108px);
  font-weight: 600;
  font-style: italic;
  line-height: 0.95;
  letter-spacing: -0.04em;
  transform: skewX(-6deg);
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.18),
    0 0 28px rgba(255, 255, 255, 0.08);
  word-break: break-word;
  transition: transform 0.6s ease;
}

.panel.is-visible .top-about-title {
  transform: translateX(8px) skewX(-6deg);
}

/* =========================
   SVG位置補正（全デバイス）
========================= */

.hero-logo-svg {
  margin-left: 20px;
}

/* =========================
   文字間（PCのみ）
========================= */

@media (min-width: 769px) {
  .overlay > .top-section:first-child {
    gap: clamp(28px, 4vh, 60px);
  }
}

/* =========================
   hero logo
========================= */
.hero-spacer {
  height: 1200px;
  pointer-events: none;
}

.hero-logo-row {
  width: 100%;
  margin: 0 0 clamp(18px, 3vh, 40px);
  padding-left: clamp(4px, 1vw, 12px);
  display: flex;
  justify-content: flex-start;
  align-items: center;

  /* JSで制御するのでここだけ残す */
  opacity: 0;
  transform: translateY(24px);
}

.hero-logo-svg {
  display: block;
  width: clamp(120px, 16vw, 240px);
  height: auto;
  opacity: 0.95;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.12))
    drop-shadow(0 0 24px rgba(255, 255, 255, 0.05));
}

@keyframes heroLogoFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.js-fade {
  opacity: 0;
  transform: translateY(24px);
}

/* =========================
   glb touch viewer
========================= */

.glb-touch-inner {
  position: relative;
  width: 100%;
  padding: 0;
  margin-top: clamp(400px, 60vh, 800px);
}

#glb-touch-viewer {
  width: 100%;
  height: 560px;
  background: transparent;
  overflow: hidden;
  touch-action: none;
}

#glb-touch-viewer canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
}

.glb-overlay-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: clamp(28px, 5vw, 72px);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.4),
    0 0 12px rgba(255, 255, 255, 0.25),
    0 0 20px rgba(193, 190, 255, 0.2);
}

/* =========================
   promo banner
========================= */

.promo-banner {
  display: block;
  width: 100%;
  color: #fff;
  text-decoration: none;
  transform: translateY(10px);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
  will-change: opacity, transform;
}

.promo-banner-inner {
  width: 100%;
  padding: clamp(24px, 3vw, 44px);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.46);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition:
    transform 0.3s ease,
    background-color 0.3s ease,
    border-color 0.3s ease;
}

.promo-banner:hover .promo-banner-inner {
  transform: translateY(-2px);
  background: rgba(0, 0, 0, 0.34);
  border-color: rgba(255, 255, 255, 1);
}

.promo-label {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.72);
}

.promo-title {
  margin: 0 0 12px;
  font-size: clamp(28px, 4.4vw, 56px);
  font-weight: 600;
  line-height: 1.08;
  color: #fff;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.4),
    0 0 12px rgba(255, 255, 255, 0.25),
    0 0 20px rgba(255, 0, 0, 0.16);
}

.promo-text {
  margin: 0;
  font-size: clamp(14px, 1.1vw, 18px);
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.88);
}

/* =========================
   panel
========================= */

.panel {
  width: 100%;
  margin-top: 100px;
  padding: clamp(28px, 2.4vw, 40px);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
  will-change: opacity, transform;
}

.top-section .panel h2 {
  margin: 0 0 8px;
  font-size: clamp(74px, 8vw, 116px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: rgba(0, 0, 0, 0.8);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
}

.top-section .panel p {
  margin: 34px 0;
  color: #000;
  font-size: clamp(16px, 1.2vw, 20px);
  line-height: 1.4;
}

/* =========================
   mobile
========================= */

@media (max-width: 768px) {
  .top-section {
    padding: 24px;
  }

  .overlay > .top-section:first-child {
    gap: 14px;
    padding-top: 96px;
    padding-bottom: 36px;
  }

  .overlay > .top-section:first-child > div {
    min-height: 88px;
    padding: 12px 10px;
  }

  .hero-logo-row {
    padding-left: 80px;
  }

  .top-about-title {
    font-size: clamp(36px, 11vw, 56px);
    line-height: 0.98;
  }

  .panel {
    padding: 0px;
  }

  .top-section .panel {
    padding: 24px 20px;
    text-align: center;
    transform: translateY(60px);
  }

  .top-section .panel h2 {
    font-size: 48px;
    line-height: 1.1;
    display: inline-block;
    text-align: left;
  }

  .top-section .panel p {
    font-size: 20px;
    line-height: 1.2;
  }

  .promo-banner-inner {
    padding: 22px 20px;
  }

  .promo-title {
    font-size: clamp(22px, 7vw, 32px);
  }

  #glb-touch-viewer {
    height: 320px;
  }

  .glb-overlay-text {
    font-size: clamp(24px, 8vw, 36px);
    text-align: center;
    padding: 0 16px;
  }
}
