/* ============================================
   Layout — ヘッダー・セクション・フッター構造
   ============================================ */

body {
  background-color: var(--color-bg-main);
  color: var(--color-text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--container-padding);
}

/* ---- Header ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: height var(--transition-base),
              background var(--transition-base),
              border-color var(--transition-base);
}

.header.is-shrink {
  height: var(--header-height-shrink);
  background: rgba(10, 10, 10, 0.95);
  border-bottom-color: var(--color-border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--container-padding);
}

.header__logo {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--color-accent);
  transition: font-size var(--transition-base);
}

.header.is-shrink .header__logo {
  font-size: 22px;
}

/* Desktop Nav */
.nav__list {
  display: flex;
  gap: 32px;
}

.nav__link {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-sub);
  position: relative;
  transition: color var(--transition-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--color-text);
}

.nav__link:hover::after,
.nav__link.is-active::after {
  width: 100%;
}

/* Hamburger (Mobile) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px 0;
  cursor: pointer;
  z-index: 1001;
}

.hamburger__line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.hamburger.is-open .hamburger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open .hamburger__line:nth-child(2) {
  opacity: 0;
}

.hamburger.is-open .hamburger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Sections ---- */
.section {
  padding: var(--section-padding);
  position: relative;
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section__title {
  font-family: var(--font-heading);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 60px;
  position: relative;
  color: var(--color-text);
}

.section__title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: 16px auto 0;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 0%, var(--color-bg-main) 75%);
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(60px, 12vw, 140px);
  font-weight: 700;
  letter-spacing: 12px;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 20px;
}

.hero__catchcopy {
  font-family: var(--font-body);
  font-size: clamp(14px, 2vw, 20px);
  letter-spacing: 6px;
  color: var(--color-text-sub);
  margin-bottom: 40px;
}

.hero__scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--color-text-sub);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero__scroll-indicator span {
  display: block;
  width: 1px;
  height: 40px;
  background: var(--color-text-sub);
  animation: scrollLine 1.5s ease-in-out infinite;
}

/* ---- Grid Layouts ---- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

/* ---- Footer ---- */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer__copyright {
  font-size: 14px;
  color: var(--color-text-sub);
  letter-spacing: 1px;
}

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-size: 20px;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity var(--transition-base),
              visibility var(--transition-base),
              transform var(--transition-base),
              background var(--transition-fast);
  cursor: pointer;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-accent-glow);
  box-shadow: var(--shadow-glow);
}

/* ============================================
   Responsive — モバイル・タブレット
   ============================================ */

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 70px 0;
  }

  .section__title {
    margin-bottom: 40px;
  }

  /* Mobile Nav */
  .hamburger {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(300px, 80vw);
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-left: 1px solid var(--color-border);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
  }

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

  .nav__list {
    flex-direction: column;
    align-items: center;
    gap: 28px;
  }

  .nav__link {
    font-size: 18px;
  }

  /* Grids */
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .hero__title {
    letter-spacing: 6px;
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: 0 16px;
  }
}
