* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

html, body {
  overscroll-behavior: none;
}

nav {
  background-color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  height: 52px;
  border-bottom: 1px solid #ddd;
  z-index: 100;
}

nav .logo {
  position: absolute;
  left: 24px;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 20px 0 0;
  font-weight: bold;
  font-size: 16px;
}

.nav-menu {
  display: flex;
  align-items: center;
}

nav a {
  color: #000;
  text-decoration: none;
  padding: 16px 20px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}

nav a:not(.logo):hover {
  background-color: #f0f0f0;
}

.lang-switcher {
  position: absolute;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 0;
  background: #f0f0f0;
  border-radius: 20px;
  padding: 3px;
}

.lang-switcher .lang {
  color: #666;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: bold;
  transition: background 0.2s, color 0.2s;
}

.lang-switcher .lang.active {
  background: #222;
  color: #fff;
  pointer-events: none;
}

.lang-switcher .lang-divider {
  display: none;
}

/* Hamburger button */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  position: absolute;
  right: 24px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #000;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile */
@media (max-width: 768px) {
  nav {
    justify-content: flex-start;
  }

  .hamburger {
    display: flex;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu > a {
    padding: 14px 24px;
    border-top: 1px solid #f0f0f0;
  }

  .lang-switcher {
    display: none;
  }

  nav:has(.nav-menu.open) .lang-switcher {
    display: flex;
    position: absolute;
    right: 64px;
    padding: 3px;
  }
}

main {
  height: calc(100vh - 52px);
  overflow: hidden;
  perspective: 800px;
  background-color: #ffffff;
}

/* Aurora background */
#aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.75;
  will-change: transform;
}

.blob1 {
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, #E40971, transparent 65%);
  top: -20%;
  left: -20%;
  animation: aurora1 8s ease-in-out infinite alternate;
}

.blob2 {
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, #2DA5E0, transparent 65%);
  top: 5%;
  right: -20%;
  animation: aurora2 10s ease-in-out infinite alternate;
}

.blob3 {
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, #FAED03, transparent 65%);
  bottom: -20%;
  left: 10%;
  animation: aurora3 7s ease-in-out infinite alternate;
}

.blob4 {
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, #05AC67, transparent 65%);
  top: 30%;
  left: 30%;
  animation: aurora4 12s ease-in-out infinite alternate;
}


@keyframes aurora1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30vw, 25vh) scale(1.3); }
}

@keyframes aurora2 {
  from { transform: translate(0, 0) scale(1.1); }
  to   { transform: translate(-25vw, 30vh) scale(0.8); }
}

@keyframes aurora3 {
  from { transform: translate(0, 0) scale(0.9); }
  to   { transform: translate(20vw, -25vh) scale(1.3); }
}

@keyframes aurora4 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-20vw, -20vh) scale(1.2); }
}


main.about-main {
  height: auto;
  overflow: visible;
  perspective: none;
}

#scene {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  transform-style: preserve-3d;
}

#bg-rect {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(-50px);
  transform-style: preserve-3d;
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.4, 0, 1, 1);
}

@keyframes rectIntro {
  from { transform: translate(-50%, -50%) translateZ(-50px) scale(0.04); opacity: 0; }
  to   { transform: translate(-50%, -50%) translateZ(-50px) scale(1);    opacity: 1; }
}

#bg-rect.intro {
  animation: rectIntro 1s cubic-bezier(0.34, 1.4, 0.64, 1) 0.1s both;
}

#scene.exiting #bg-rect,
#scene.entering #bg-rect {
  transform: translate(-50%, -50%) translateZ(750px);
}

#scene.exiting-works #bg-rect {
  transform: translate(-50%, -50%) translateZ(-50px) rotateY(-82deg) scaleZ(6);
}

#scene.exiting-works #particle-canvas {
  opacity: 0;
  transition: opacity 0.2s;
}

#bg-rect .face {
  position: absolute;
  box-sizing: border-box;
  border: 8px solid rgba(255, 255, 255, 0.85);
}

#bg-rect .face.front,
#bg-rect .face.back {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(12px);
}

#bg-rect .face.back {
  transform: translateZ(calc(-1 * var(--d, 60px)));
  border: none;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#bg-rect .face.left,
#bg-rect .face.right {
  width: var(--d, 60px);
  height: 100%;
  top: 0;
}

#bg-rect .face.left {
  left: 0;
  transform-origin: left center;
  transform: rotateY(90deg);
  background: rgba(255, 255, 255, 0.85);
}

#bg-rect .face.right {
  right: 0;
  transform-origin: right center;
  transform: rotateY(-90deg);
  background: rgba(255, 255, 255, 0.85);
}

#bg-rect .face.top,
#bg-rect .face.bottom {
  width: 100%;
  height: var(--d, 60px);
  left: 0;
}

#bg-rect .face.top {
  top: 0;
  transform-origin: center top;
  transform: rotateX(-90deg);
  background: rgba(255, 255, 255, 0.85);
}

#bg-rect .face.bottom {
  bottom: 0;
  transform-origin: center bottom;
  transform: rotateX(90deg);
  background: rgba(255, 255, 255, 0.85);
}

#particle-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28%;
  max-height: 80%;
  height: auto;
  transition: opacity 0.5s ease-in;
}

@media (max-width: 768px) {
  #particle-svg {
    width: 72%;
  }

  html:has(body.home),
  body.home {
    height: 100%;
    overflow: hidden;
  }

  body.home main {
    height: calc(100dvh - 52px);
  }
}

#particle-svg path {
  fill: #000;
}

#particle-svg.hidden {
  opacity: 0;
}

#particle-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
  transition: opacity 0.5s ease-in;
}

#particle-canvas.hidden {
  opacity: 0;
}

#scene.exiting #particle-svg,
#scene.entering #particle-svg {
  opacity: 0;
}

#scene.exiting #particle-canvas,
#scene.entering #particle-canvas {
  opacity: 0;
}

/* Site Footer */
.site-footer {
  background: #111;
  color: #fff;
  padding: 40px 0;
}

.site-footer__inner {
  padding: 0 clamp(32px, 8vw, 120px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer__name {
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.site-footer__divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin: 8px 0;
}

.site-footer__address {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.03em;
}

.site-footer__email {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

.site-footer__email:hover {
  color: #fff;
}
