:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --surface2: #1c1c28;
  --accent: #00e5ff;
  --accent2: #ff6b35;
  --accent3: #a259ff;
  --text: #e8e8f0;
  --text-dim: #7878a0;
  --border: rgba(255,255,255,0.07);
  --glow: 0 0 30px rgba(0,229,255,0.15);
}

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

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

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
  position: relative;
  z-index: 1;
}

header {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
}

.lang-toggle {
  display: flex;
  border: 1px solid var(--accent);
  border-radius: 8px;
  overflow: hidden;
  width: 30%;
  margin: 0 0 20px auto;
}

.lang-btn {
  padding: 8px 20px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--accent);
  color: var(--bg);
}

.hidden { display: none !important; }

.header-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 4px 12px;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  margin-top: 24px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.back-link:hover {
  background: rgba(0,229,255,0.1);
  color: var(--accent);
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

h1 span.accent { color: var(--accent); }

.subtitle {
  font-size: 14px;
  color: var(--text-dim);
}

nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px;
  box-shadow: var(--glow);
}

.toc-list {
  list-style: none;
}

.toc-item {
  border-radius: 12px;
  transition: background 0.2s, border-color 0.2s;
}

.toc-item:hover {
  background: var(--surface2);
}

.toc-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  border: 1px solid transparent;
  border-radius: 12px;
}

.toc-link:hover {
  color: var(--accent);
}

.toc-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 4px;
  padding: 4px 10px;
  flex-shrink: 0;
}

.toc-title-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-title-ja {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
}

.toc-title-en {
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.3px;
}

.toc-title-wrap .en-text:not(.hidden) {
  font-size: 15px;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
}

.toc-arrow {
  font-size: 14px;
  color: var(--text-dim);
}

.toc-link:hover .toc-arrow {
  color: var(--accent);
}

.footer-note {
  margin-top: 32px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-note a {
  color: var(--accent);
  text-decoration: none;
}

.footer-note a:hover {
  text-decoration: underline;
}

/* Section (subpages) */
section {
  margin-bottom: 48px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 4px;
  padding: 4px 10px;
  white-space: nowrap;
}

h2 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* dev-manual: wider container & header */
body.page--manual .container {
  max-width: 1100px;
  padding: 0 24px;
}

body.page--manual header {
  padding: 60px 0 40px;
}

body.page--manual h1 {
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 16px;
}

body.page--manual h1 span.accent2 { color: var(--accent2); }

body.page--manual .subtitle {
  font-size: 15px;
  max-width: 500px;
  margin: 0 auto 48px;
  line-height: 1.7;
}

body.page--manual section {
  margin-bottom: 80px;
}

body.page--manual .section-header {
  margin-bottom: 32px;
}

body.page--manual h2 {
  font-size: 28px;
}

/* index: centered lang toggle */
body.page--index .lang-toggle {
  position: static;
  width: 18%;
  margin: 0 0 20px auto;

  @media (max-width: 700px) {
    width: 35%;
    max-width: 119px;
  }
}

/* Language cards (dev-manual) */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.lang-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.lang-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-color, var(--accent));
  opacity: 0;
  transition: opacity 0.3s;
}

.lang-card:hover {
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-3px);
  box-shadow: var(--glow);
}

.lang-card:hover::before { opacity: 1; }

.lang-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.lang-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--icon-bg, rgba(0,229,255,0.1));
  flex-shrink: 0;
}

.lang-name {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.lang-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 1px;
}

.lang-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 20px;
}

.use-cases {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--tag-bg, rgba(0,229,255,0.08));
  color: var(--tag-color, var(--accent));
  border: 1px solid var(--tag-border, rgba(0,229,255,0.2));
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.difficulty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.diff-label {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

.diff-dots {
  display: flex;
  gap: 4px;
}

.diff-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.diff-dot.filled {
  background: var(--card-color, var(--accent));
}

/* Hosting (dev-manual) */
.hosting-grid {
  display: grid;
  gap: 16px;
}

.hosting-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 24px;
  align-items: center;
  transition: all 0.3s;
}

.hosting-card:hover {
  border-color: rgba(255,255,255,0.12);
  background: var(--surface2);
}

.hosting-name {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.hosting-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
}

.hosting-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.free-badge {
  background: rgba(0,229,255,0.1);
  border: 1px solid rgba(0,229,255,0.3);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 1px;
}

/* Filter (dev-manual) */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.filter-btn {
  padding: 8px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.filter-btn.active, .filter-btn:hover {
  background: rgba(0,229,255,0.1);
  border-color: rgba(0,229,255,0.3);
  color: var(--accent);
}

/* Comparison table (dev-manual) */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.compare-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}

.compare-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.compare-table tr:hover td {
  background: var(--surface2);
}

.check { color: #4ade80; font-size: 16px; }
.cross { color: #f87171; font-size: 16px; }

/* Checklist (dev-manual) */
.checklist {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.check-item:last-child { border-bottom: none; }

.check-box {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-size: 13px;
}

.check-item.done .check-box {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.check-item.done .check-text {
  text-decoration: line-through;
  color: var(--text-dim);
}

.check-text { font-size: 14px; line-height: 1.5; }

/* Progress bar (dev-manual) */
.progress-wrap {
  margin-bottom: 24px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

.progress-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Footer (dev-manual) */
footer {
  text-align: center;
  padding: 48px 0;
  color: var(--text-dim);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  border-top: 1px solid var(--border);
  margin-top: 80px;
  position: relative;
  z-index: 1;
}

footer .footer-back a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

footer .footer-back a:hover {
  text-decoration: underline;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-card, .hosting-card, .checklist {
  animation: fadeUp 0.5s ease both;
}

/* AI IDE / tool section */
section.tool-section {
  margin-bottom: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

.tool-name {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}

.tool-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
  line-height: 1.6;
}

.pros-cons {
  display: grid;
  gap: 20px;
}

@media (min-width: 600px) {
  .pros-cons { grid-template-columns: 1fr 1fr; }
}

.pros, .cons {
  padding: 16px;
  border-radius: 12px;
}

.pros {
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.2);
}

.cons {
  background: rgba(255,107,53,0.06);
  border: 1px solid rgba(255,107,53,0.2);
}

.pros-title, .cons-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.pros-title { color: var(--accent); }
.cons-title { color: var(--accent2); }

.pros ul, .cons ul {
  list-style: none;
  padding-left: 0;
}

.pros li, .cons li {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 6px;
  padding-left: 1em;
  position: relative;
}

.pros li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.cons li::before {
  content: '×';
  position: absolute;
  left: 0;
  color: var(--accent2);
  font-weight: 700;
}

/* Intro box (shared) */
.intro-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 40px;
  border-left: 4px solid var(--accent);
}

.intro-box h2 {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--accent);
}

.intro-box p, .intro-box li {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 10px;
}

.intro-box ul {
  margin: 12px 0 0 1.2em;
  padding-left: 0;
}

.intro-box li { margin-bottom: 6px; }

.intro-box .term {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 16px;
}

.intro-box .term dt { margin-top: 8px; }
.intro-box .term dd { margin-left: 1em; font-size: 13px; }

.intro-box p:not(.intro-box h2 + p) { margin-bottom: 10px; }

/* GitHub Pages / steps */
ol {
  margin-left: 1.25em;
  padding-left: 0.25em;
}

ol li {
  margin-bottom: 10px;
  line-height: 1.6;
}

blockquote {
  margin: 16px 0 0;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-dim);
}

.url-block {
  margin-top: 12px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--accent);
  overflow-x: auto;
}

.url-block code {
  white-space: pre;
}

/* Career / content blocks */
.content-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 8px;
}

.content-block p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
  color: var(--text);
}

.content-block ul {
  margin: 8px 0 0 1.2em;
  padding-left: 0;
}

.content-block li {
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 8px;
}

.content-block pre {
  margin: 0;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.content-block pre code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  white-space: pre;
}

.step-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.step-block .section-header {
  margin-bottom: 12px;
}

.step-block p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-left: 0;
}

/* Subpage footer-note variant */
body:not(.page--index) .footer-note {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Selection tooltip (dev-manual) */
#selection-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.95);
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: 360px;
}

#selection-tooltip.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tooltip-inner {
  background: #0e0e1a;
  border: 1px solid rgba(0,229,255,0.35);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 20px rgba(0,229,255,0.1);
}

.tooltip-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.tooltip-original {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.tooltip-translation {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
}

.tooltip-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.tooltip-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0,229,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.tooltip-arrow {
  width: 12px;
  height: 6px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -6px;
  overflow: hidden;
}

.tooltip-arrow::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  background: #0e0e1a;
  border: 1px solid rgba(0,229,255,0.35);
  transform: rotate(45deg) translate(-2px, -7px);
}

.tooltip-arrow.up {
  bottom: auto;
  top: -6px;
}

.tooltip-arrow.up::before {
  transform: rotate(45deg) translate(3px, 3px);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
  .hosting-card { grid-template-columns: 1fr; }
  .lang-toggle { position: static; margin-bottom: 24px; }
  header { text-align: left; }
}
