:root {
  --bg: #07080f;
  --primary: #a78bfa;
  --primary-light: #c4b5fd;
  --glow: rgba(167, 139, 250, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: #e2e8f0;
  font-family: 'Noto Sans JP', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.font-syne {
  font-family: 'Syne', sans-serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Nav */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 8, 15, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.nav-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-logo-text {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-light);
  background: var(--glass-bg);
}

.nav-back a {
  color: #64748b;
  text-decoration: none;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav-back a:hover {
  color: #94a3b8;
}

/* Doc layout */
.doc-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.doc-header {
  margin-bottom: 3rem;
  text-align: center;
}

.doc-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--primary);
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 4px;
  padding: 0.15rem 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.doc-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.75rem;
}

.doc-updated {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #475569;
}

.doc-app {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 0.35rem;
}

/* Notice box */
.notice {
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  color: var(--primary-light);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

/* Sections */
.doc-section {
  margin-bottom: 2.5rem;
}

.doc-section h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f1f5f9;
  padding: 0.6rem 1rem;
  border-left: 3px solid var(--primary);
  background: rgba(167, 139, 250, 0.06);
  border-radius: 0 8px 8px 0;
  margin-bottom: 1.25rem;
}

.doc-section h3 {
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #cbd5e1;
  margin: 1.25rem 0 0.5rem;
}

.doc-section p {
  color: #94a3b8;
  line-height: 1.8;
  font-size: 0.93rem;
  margin-bottom: 0.75rem;
}

.doc-section ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
}

.doc-section ul li {
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.75;
  padding: 0.25rem 0 0.25rem 1.25rem;
  position: relative;
}

.doc-section ul li::before {
  content: '·';
  position: absolute;
  left: 0.25rem;
  color: var(--primary);
  font-size: 1.2rem;
  line-height: 1.2;
}

.doc-section a {
  color: var(--primary-light);
  text-decoration: none;
  transition: text-decoration 0.2s;
}

.doc-section a:hover {
  text-decoration: underline;
}

.info-row {
  display: grid;
  grid-template-columns: 8em 1fr;
  gap: 0.4rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.65rem 0;
  font-size: 0.9rem;
}

.info-row:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.info-label {
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.info-value {
  color: #94a3b8;
  line-height: 1.6;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.25), transparent);
  margin: 2rem 0;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

footer {
  border-top: 1px solid var(--glass-border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: #475569;
  font-size: 0.8rem;
}

footer p+p {
  margin-top: 0.4rem;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  flex-shrink: 0;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #64748b;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

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

nav.open .nav-hamburger span:nth-child(2) {
  opacity: 0;
}

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  nav.open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(7, 8, 15, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    gap: 0.5rem;
    z-index: 99;
  }

  nav.open .nav-links a {
    padding: 0.6rem 0.5rem;
    font-size: 0.9rem;
  }

  .info-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .info-label {
    font-size: 0.72rem;
  }
}
