:root {
  --bg: #f3f6f2;
  --text: #14201b;
  --muted: #5b6b63;
  --accent: #3c9d7a;
  --surface: rgba(255, 255, 255, 0.62);
  --border: rgba(20, 32, 27, 0.08);
  --shadow: rgba(20, 32, 27, 0.12);
  --radius: 16px;
  --dur: 0.5s;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-sans: "Manrope", "Noto Sans JP", sans-serif;
  --font-display: "Manrope", "Noto Sans JP", sans-serif;
  --font-mono: "Courier New", monospace;
}

[data-theme="dark"] {
  /* ダーク（青寄り） */
  --bg: #0f172a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38b48b;
  --surface: rgba(30, 41, 59, 0.6);
}

/* reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease);
  line-height: 1.6;
  letter-spacing: 0.01em;
  overflow: hidden;
}

/* スクロールバー非表示 */
::-webkit-scrollbar {
  display: none;
}
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* nav */
.nav {
  position: fixed;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 20px 60px;
  z-index: 1000;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: inherit;
}

.nav-links {
  justify-self: end;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-links a + a {
  margin-left: 32px;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 14px;
  text-decoration: none;
  color: var(--muted);
  transition: 0.2s;
  position: relative;
  padding: 4px 0;
}

.nav-links a.active {
  color: var(--text);
}

.nav-dot {
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform var(--dur) var(--ease);
  pointer-events: none;
}

/* zzz animation */
.zzz {
  position: absolute;
  color: var(--accent);
  font-family: monospace;
  font-weight: bold;
  pointer-events: none;
  opacity: 0;
  z-index: 1001;
  user-select: none;
  animation: float-zzz 3s ease-out forwards;
}

@keyframes float-zzz {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  100% {
    transform: translate(15px, -40px) scale(1.2);
    opacity: 0;
  }
}

/* ロード時のアニメーション抑制 */
.no-transition,
.no-transition * {
  transition: none !important;
}

.nav-links a:not(.active):hover {
  color: var(--text);
}

/* ===== トグル ===== */
.theme-toggle {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden !important;
  transition:
    background var(--dur) var(--ease),
    box-shadow 0.3s var(--ease),
    transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  z-index: 1001;
  touch-action: none;
  user-select: none;
  backdrop-filter: blur(16px);
}

.theme-toggle:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.theme-toggle:active {
  cursor: grabbing;
}

.theme-toggle.animating {
  cursor: default;
}

.theme-toggle.dragging {
  transition: none;
}

.orbit,
.orbit img {
  pointer-events: none;
}

.orbit {
  position: relative;
  width: 22px;
  height: 22px;
  /* 回転の中心をボタンの少し下（アイコン中心から見て約35px下）に設定 */
  transform-origin: 50% 250%;
}

.orbit img {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  transition:
    transform var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
}

/* ライト状態 */
#sunIcon {
  transform: translate(-50%, 0%);
  opacity: 1;
}
#moonIcon {
  transform: translate(-50%, 120%);
  opacity: 0;
}

/* ダーク状態 */
[data-theme="dark"] #sunIcon {
  transform: translate(-50%, -120%);
  opacity: 0;
}
[data-theme="dark"] #moonIcon {
  transform: translate(-50%, 0%);
  opacity: 1;
}

main {
  position: relative;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.sections-wrapper {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}

.hero,
.section {
  flex: 0 0 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding-left: 12vw;
  padding-right: 12vw;
  padding-top: 160px;
  overflow-y: auto;
  position: relative;
}

.hero {
  justify-content: center;
  padding-top: 0;
}

.eyebrow,
.section-kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow {
  margin-bottom: 18px;
}

.title {
  font-family: var(--font-display);
  font-size: clamp(64px, 9vw, 100px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 0.92;
}

.sub {
  margin-top: 24px;
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  opacity: 0.94;
  line-height: 1.8;
  max-width: 760px;
  letter-spacing: 0.02em;
}

.lead {
  margin-top: 18px;
  max-width: 680px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.cta {
  margin-top: 40px;
}

.btn {
  display: inline-block;
  font-family: var(--font-sans);
  text-decoration: none;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  margin-right: 10px;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(16px);
}

.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.btn:hover {
  transform: translateY(-2px) scale(1.03);
}

.btn:active {
  transform: scale(0.97);
}

.text-link {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  transition:
    opacity 0.2s,
    border-color 0.2s;
  display: inline-flex;
  align-items: center;
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
}

.text-link:hover {
  opacity: 0.72;
}

.section-kicker {
  margin-bottom: 10px;
}

.section h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 28px;
  letter-spacing: 0.04em;
}

.content-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 860px;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(20, 32, 27, 0.08);
}

.policy-item + .policy-item {
  margin-top: 42px;
}

.policy-item h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.policy-item h3 span {
  color: var(--accent);
  margin-right: 12px;
  font-family: var(--font-mono);
}

.policy-item p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.9;
  letter-spacing: 0.02em;
}

.policy-item ul {
  list-style: none;
  margin-top: 12px;
}

.policy-item li {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  letter-spacing: 0.02em;
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 8px;
}

.policy-item li::before {
  content: "";
  position: absolute;
  left: 0.4em;
  top: 0.72em;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.8;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 36px;
  max-width: 900px;
}

.commands-lead {
  max-width: 720px;
}

.link-lead {
  max-width: 640px;
}

.command-group + .command-group {
  margin-top: 52px;
}

.command-cards {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 1120px;
}

.card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  transition:
    transform 0.4s var(--ease),
    color 0.4s var(--ease),
    border-color 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
  line-height: 1.9;
  box-shadow: 0 12px 32px rgba(20, 32, 27, 0.06);
}

.command-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.14) 0%,
      rgba(255, 255, 255, 0.04) 100%
    ),
    var(--surface);
}

.command-top {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

.command-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px 7px;
  border-radius: 10px;
  border: 1px solid rgba(20, 32, 27, 0.08);
  background: rgba(255, 255, 255, 0.16);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.command-summary {
  margin-bottom: 20px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.command-meta {
  display: grid;
  gap: 16px;
}

.command-meta div {
  padding-top: 14px;
  border-top: 1px solid rgba(20, 32, 27, 0.08);
}

.command-meta dt {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.command-meta dd {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

.command-meta code {
  padding: 0.15em 0.45em;
  border-radius: 999px;
  background: rgba(20, 32, 27, 0.06);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.link-panel {
  margin-top: 36px;
  width: min(100%, 860px);
  padding: 30px;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--border);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.18) 0%,
      rgba(255, 255, 255, 0.04) 100%
    ),
    var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(20, 32, 27, 0.08);
}

.link-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.4s var(--ease),
    opacity 0.4s var(--ease);
}

.link-row + .link-row {
  border-top: 1px solid rgba(20, 32, 27, 0.08);
}

.link-row:hover,
.link-row:focus-visible {
  transform: translateY(-2px);
}

.link-row + .supporter-block {
  margin-top: 10px;
  padding-top: 24px;
  border-top: 1px solid rgba(20, 32, 27, 0.08);
}

.link-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(20, 32, 27, 0.06);
  overflow: hidden;
}

.link-icon {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
  object-position: center;
}

.link-icon[src$=".png"] {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.invite-mark {
  color: var(--text);
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.invite-glyph {
  transform: translateY(-1px);
}

.dark-icon {
  display: none;
}

.link-copy {
  display: grid;
  gap: 6px;
}

.link-label {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.link-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.link-arrow {
  color: var(--muted);
  font-size: 18px;
  transition:
    transform 0.4s var(--ease),
    color 0.4s var(--ease);
}

.link-row:hover .link-arrow,
.link-row:focus-visible .link-arrow {
  color: var(--text);
  transform: translate(2px, -2px);
}

.supporter-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

.card strong {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
}

.card:hover,
.card:focus-visible {
  color: var(--text);
  transform: translateY(-4px);
  border-color: rgba(60, 157, 122, 0.18);
  box-shadow: 0 18px 38px rgba(20, 32, 27, 0.08);
}

[data-theme="dark"] .command-card {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05) 0%,
      rgba(255, 255, 255, 0.015) 100%
    ),
    var(--surface);
}

[data-theme="dark"] .command-chip {
  background: rgba(15, 23, 42, 0.22);
  border-color: rgba(226, 232, 240, 0.1);
}

[data-theme="dark"] .command-meta div {
  border-top-color: rgba(226, 232, 240, 0.08);
}

[data-theme="dark"] .command-meta code {
  background: rgba(226, 232, 240, 0.08);
}

[data-theme="dark"] .link-panel {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.06) 0%,
      rgba(255, 255, 255, 0.015) 100%
    ),
    var(--surface);
}

[data-theme="dark"] .link-mark {
  background: rgba(15, 23, 42, 0.24);
  border-color: rgba(226, 232, 240, 0.08);
}

[data-theme="dark"] .light-icon {
  display: none;
}

[data-theme="dark"] .dark-icon {
  display: block;
}

[data-theme="dark"] .link-row + .link-row {
  border-top-color: rgba(226, 232, 240, 0.08);
}

[data-theme="dark"] .link-row + .supporter-block {
  border-top-color: rgba(226, 232, 240, 0.08);
}

@media (max-width: 900px) {
  .nav {
    grid-template-columns: 1fr auto;
    gap: 18px;
    padding: 18px 24px;
  }

  .nav-links {
    grid-column: 1 / -1;
    justify-self: start;
    gap: 18px;
    flex-wrap: wrap;
  }

  .nav-links a + a {
    margin-left: 0;
  }

  .hero,
  .section {
    padding-left: 24px;
    padding-right: 24px;
    padding-top: 150px;
  }

  .sub {
    font-size: 18px;
  }

  .content-box {
    padding: 28px 22px;
  }

  .link-panel {
    padding: 24px 22px;
  }

  .link-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 16px;
  }

  .link-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .link-icon {
    width: 22px;
    height: 22px;
  }

  .link-icon[src$=".png"] {
    width: 100%;
    height: 100%;
  }

  .link-arrow {
    display: none;
  }

  .command-cards {
    grid-template-columns: 1fr;
  }

  .theme-toggle {
    bottom: 22px;
    right: 22px;
  }
}
