@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700;800;900&display=swap');
:root {
  color-scheme: dark;
  --bg: #101219;
  --panel: #191d27;
  --line: #303643;
  --text: #f2f1ec;
  --muted: #a8b1c2;
  --accent: #c6f69b;
  --ink: #172315;
  --rose: #ffb5a7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', system-ui, sans-serif;
  line-height: 1.7;
}
button, input, select { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .5; cursor: wait; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, canvas:focus-visible, summary:focus-visible {
  outline: 3px solid #e0f9b8;
  outline-offset: 5px;
}
header.shell {
  max-width: 1360px;
  margin: auto;
  padding: 24px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.brand {
  font-size: 23px;
  letter-spacing: -1px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 23px;
  height: 23px;
  background: var(--accent);
  border-radius: 7px 7px 7px 1px;
  transform: rotate(-12deg);
}
.brand span:last-child {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 2px;
  margin-left: 12px;
}

/* ナビゲーション（実験メニュー ドロップダウン） */
.nav-details {
  position: relative;
}
.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #242a36;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.nav-trigger::-webkit-details-marker {
  display: none;
}
.nav-trigger::after {
  content: "▾";
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.nav-details[open] .nav-trigger::after {
  transform: rotate(180deg);
}
.nav-details[open] .nav-trigger {
  background: #303848;
  border-color: var(--accent);
}
.nav-details .topnav {
  display: none;
}
.nav-details[open] .topnav {
  display: flex;
  flex-direction: column;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #191d27;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  min-width: 220px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.7);
  z-index: 1000;
  gap: 4px;
}
.nav-details[open] .topnav a {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  white-space: nowrap;
}
.nav-details[open] .topnav a:hover,
.nav-details[open] .topnav a[aria-current] {
  background: #242a36;
  color: var(--text);
  text-decoration: none;
}
.nav-details[open] .topnav a[aria-current]::after {
  content: "●";
  font-size: 8px;
  color: var(--accent);
}

/* details を持たない既存ページのフォールバック */
header.shell > nav.topnav {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--muted);
}
header.shell > nav.topnav a {
  white-space: nowrap;
}
header.shell > nav.topnav a[aria-current] {
  color: var(--text);
  font-weight: 700;
}

main {
  max-width: 1360px;
  margin: auto;
  padding: 40px 36px 60px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 10px;
}
.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.35;
  letter-spacing: -1.5px;
  margin: 0 0 12px;
}
h2 {
  font-size: 22px;
  letter-spacing: -.5px;
  margin: 0 0 15px;
}
h3 { font-size: 16px; }
p { margin: 0 0 16px; }
.sub {
  font-size: 13px;
  color: var(--muted);
}
.badge {
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 6px 12px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--muted);
}
.btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 18px;
  background: #242a36;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  text-decoration: none;
}
.btn:hover {
  background: #303848;
  text-decoration: none;
}
.btn.primary {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}
.btn.primary:hover {
  filter: brightness(1.07);
}
.btn.ghost { background: transparent; }
.btn.small {
  padding: 7px 12px;
  font-size: 11px;
  min-height: 38px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  padding: 24px;
}
.muted { color: var(--muted); }
.fine {
  font-size: 11px;
  color: var(--muted);
}
.status {
  font-size: 12px;
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  max-width: min(90vw, 600px);
  padding: 12px 22px;
  background: #e2f5ce;
  color: #182315;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 8px 40px #0006;
}
.toast:empty { display: none; }
input[type=text], input[type=url] {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #475162;
  background: #10151e;
  border-radius: 9px;
  color: var(--text);
  min-width: 0;
}
input[type=range] {
  accent-color: var(--accent);
  width: 100%;
  height: 28px;
  cursor: pointer;
}
label { font-size: 13px; }
footer {
  max-width: 1360px;
  margin: auto;
  padding: 20px 36px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  color: var(--muted);
}
[hidden] { display: none !important; }
dialog {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  width: min(540px, 92vw);
}
dialog::backdrop {
  background: #080a12bb;
  backdrop-filter: blur(5px);
}
dialog .actions { margin-top: 18px; }
.empty {
  text-align: center;
  padding: 36px 12px;
  color: var(--muted);
}

@media(max-width: 860px) {
  header.shell {
    padding: 16px 20px;
  }
  .brand span:last-child {
    display: none;
  }
  
  /* モバイル時のメニュー位置微調整 */
  .nav-details[open] .topnav {
    right: 0;
  }
  
  /* nav-details を持たない既存ページのフォールバック */
  header.shell > nav.topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 11px;
    justify-content: flex-end;
  }

  main { padding: 28px 18px 42px; }
  .intro {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }
  .intro .badge { display: none; }
  footer {
    padding: 20px;
    flex-direction: column;
  }
  .panel { padding: 20px; }
}

@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
