:root {
  --color-bg-deep: #111a2e;
  --color-bg: #162038;
  --color-primary: #ffffff;
  --color-accent: #e8c547;
  --color-text: #f5f5fa;
  --color-text-soft: rgba(255, 255, 255, 0.95);
  --color-text-dim: rgba(255, 255, 255, 0.6);
  --font-ja: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", "Yu Gothic", "Noto Sans JP", sans-serif;
  --font-en: "Space Grotesk", sans-serif;
  --border-silver: rgba(160, 160, 184, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ja);
  background-color: var(--color-bg-deep);
  color: var(--color-text);
  line-height: 1.9;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background: url('starfield_bg.webp?v=20260225') center/cover fixed;
}
.starfield::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.08);
}

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: #1a2a4a;
  z-index: 999;
  transition: width 0.1s linear;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 2rem;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  mix-blend-mode: difference;
}
.nav-menu {
  display: none;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}
.nav-menu li a {
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s ease;
}
.nav-menu li a:hover { color: #ffffff; }
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  transition: all 0.3s ease;
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(8, 12, 20, 0.98);
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: calc(5rem + env(safe-area-inset-top)) 1.5rem calc(2rem + env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.mobile-menu.active { opacity: 1; visibility: visible; }
.mobile-menu-close {
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top));
  right: calc(1.5rem + env(safe-area-inset-right));
  font-size: 2.5rem;
  color: #ffffff;
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 0.5rem;
}
.mobile-menu-list {
  flex: 0 0 auto;
  width: min(100%, 28rem);
  list-style: none;
  padding: 0;
  margin: auto 0;
  text-align: center;
}
.mobile-menu-list li { margin: 1.5rem 0; }
.mobile-menu-list li a {
  font-family: var(--font-en);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease;
}
.mobile-menu-list li a:hover { color: #ffffff; }

.legal-main {
  position: relative;
  z-index: 1;
  padding-top: 5rem;
  min-height: 100vh;
}
.legal-hero {
  text-align: center;
  padding: 4rem 2rem 3rem;
  border-bottom: 1px solid var(--border-silver);
}
.legal-label {
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}
.legal-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-primary);
}
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  background: #ffffff;
  color: #1a1a2e;
  position: relative;
  z-index: 2;
}
.legal-intro {
  font-size: 0.95rem;
  color: #2a2a3e;
  line-height: 1.9;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.legal-section { margin-bottom: 3rem; }
.legal-section:last-child { margin-bottom: 0; }
.legal-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111a2e;
  margin-bottom: 1.2rem;
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}
.legal-section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 3px;
  height: 1.2em;
  background: #1a2a4a;
}
.legal-section p {
  font-size: 0.9rem;
  color: #2a2a3e;
  margin-bottom: 1rem;
  line-height: 1.9;
}
.legal-section ul {
  padding-left: 1.5rem;
  margin: 0 0 1rem;
}
.legal-section li {
  font-size: 0.9rem;
  color: #2a2a3e;
  margin-bottom: 0.5rem;
  line-height: 1.8;
}
.legal-link {
  color: #1a2a4a;
  text-decoration: underline;
  word-break: break-all;
}

footer {
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border-silver);
  position: relative;
  z-index: 1;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.footer-links a {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.3s ease;
}
.footer-links a:hover { color: #ffffff; }
footer p {
  font-family: var(--font-en);
  font-size: 0.7rem;
  color: var(--color-text-dim);
  letter-spacing: 0.1em;
}

#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: rgba(26, 42, 74, 0.08);
  border: 1px solid rgba(26, 42, 74, 0.25);
  color: #1a2a4a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background 0.3s ease;
  text-decoration: none;
}
#back-to-top.visible { opacity: 1; visibility: visible; }
#back-to-top:hover { background: rgba(26, 42, 74, 0.15); }

@media (min-width: 769px) {
  .nav { padding: 1.2rem 3rem; }
  .nav-menu {
    display: flex;
    gap: clamp(0.9rem, 1.8vw, 2rem);
  }
  .nav-toggle { display: none; }
  .nav-menu li a { font-size: 0.85rem; }
}

@media (max-width: 768px) {
  .starfield {
    background: url('starfield_bg_sp.webp?v=20260225') center/cover no-repeat;
    background-attachment: scroll;
  }
  .legal-content { padding: 2rem 1.2rem 4rem; }
  .legal-hero { padding: 3rem 1.2rem 2rem; }
}
