:root {
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.78);
  --bg-card-hover: rgba(31, 41, 55, 0.88);
  --bg-glass: rgba(15, 23, 42, 0.65);
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-highlight: rgba(129, 140, 248, 0.45);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-indigo: #818cf8;
  --accent-sky: #38bdf8;
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-purple: #c084fc;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}

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

body {
  font-family: 'Inter', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.08) 0%, transparent 35%),
    radial-gradient(circle at 85% 20%, rgba(192, 132, 252, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(244, 63, 94, 0.05) 0%, transparent 40%);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Hero */
.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-purple), var(--accent-rose));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 0 20px rgba(129, 140, 248, 0.4);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge-pill {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.3);
  color: #c7d2fe;
  font-weight: 500;
}

/* Hero Section */
.hero {
  padding: 2.5rem 0 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-title {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.85rem;
  background: linear-gradient(90deg, #ffffff, #bae6fd, #e9d5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-card);
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.kpi-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--accent-sky);
  font-weight: 500;
}

/* Section 1: Interactive Timeline */
.section-block {
  margin-top: 2rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.timeline-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .timeline-track {
    grid-template-columns: 1fr;
  }
}

.phase-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.phase-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-sky), var(--accent-purple));
  opacity: 0.45;
  transition: opacity 0.2s ease;
}

.phase-card:hover {
  border-color: rgba(129, 140, 248, 0.4);
  transform: translateY(-2px);
}

.phase-card.active {
  background: rgba(30, 41, 59, 0.92);
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 1px var(--accent-sky), var(--shadow-card);
}

.phase-card.active::before {
  opacity: 1;
}

.phase-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.phase-period {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-sky);
  background: rgba(56, 189, 248, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.phase-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.phase-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.phase-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.phase-milestones {
  list-style: none;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.65rem;
}

.phase-milestones li {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  padding-left: 0.9rem;
  position: relative;
}

.phase-milestones li::before {
  content: '•';
  color: var(--accent-purple);
  position: absolute;
  left: 0;
}

/* Controls & Filter Toolbar */
.controls-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-card);
}

.controls-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.search-input {
  width: 100%;
  background: rgba(9, 13, 22, 0.75);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent-indigo);
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.control-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.select-input {
  background: rgba(9, 13, 22, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
}

.view-tabs {
  display: flex;
  background: rgba(9, 13, 22, 0.8);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.view-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.view-tab.active {
  background: var(--accent-indigo);
  color: #fff;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.cat-pill {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
}

.cat-pill:hover {
  border-color: var(--text-muted);
}

.cat-pill.active {
  background: rgba(129, 140, 248, 0.2);
  border-color: var(--accent-indigo);
  color: #fff;
  font-weight: 600;
}

.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Custom Weighting Bar */
.weights-bar {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 860px) {
  .weights-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.weight-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.weight-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.weight-slider {
  accent-color: var(--accent-indigo);
  width: 100%;
  cursor: pointer;
}

/* Perspective Legend Bar */
.perspective-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-top: 1.25rem;
}

@media (max-width: 860px) {
  .perspective-legend {
    grid-template-columns: 1fr;
  }
}

.legend-card {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.55);
}

.legend-title {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Issue Cards Grid (Matrix View) */
.issues-container {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding-bottom: 4rem;
}

.issue-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}

.issue-card:hover {
  border-color: rgba(148, 163, 184, 0.35);
}

.issue-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.issue-meta-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.cat-badge {
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.year-badge {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.issue-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.issue-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 880px;
}

.score-badge-box {
  background: rgba(9, 13, 22, 0.85);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  text-align: center;
  min-width: 125px;
}

.score-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}

.score-number {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--accent-indigo);
}

/* Metrics Bar inside Card */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  background: rgba(9, 13, 22, 0.55);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
  .metrics-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.metric-cell {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.metric-cell-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 600;
}

.metric-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 999px;
}

/* 3 Perspectives Matrix Grid */
.perspectives-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.1rem;
}

@media (max-width: 1024px) {
  .perspectives-grid {
    grid-template-columns: 1fr;
  }
}

.perspective-col {
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.p-header {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.p-stance {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.p-argument {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.p-points {
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.6rem;
}

.p-points li {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  padding-left: 0.85rem;
  position: relative;
}

.p-points li::before {
  content: '▸';
  position: absolute;
  left: 0;
  opacity: 0.8;
}

/* Bottlenecks & Tags Footer */
.issue-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-subtle);
}

.bottleneck-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.bottleneck-label {
  font-size: 0.75rem;
  color: var(--accent-amber);
  font-weight: 700;
}

.bottleneck-chip {
  font-size: 0.74rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-chip {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Compact Table Comparison View */
.comparison-table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.comparison-table th,
.comparison-table td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.comparison-table th {
  background: rgba(9, 13, 22, 0.9);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.comparison-table td {
  font-size: 0.83rem;
}

.comparison-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Scatter / Quadrant Plot View */
.quadrant-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.quadrant-canvas {
  position: relative;
  height: 360px;
  background: rgba(9, 13, 22, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: 1rem;
  overflow: hidden;
}

.quadrant-axis-x {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(148, 163, 184, 0.2);
}

.quadrant-axis-y {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(148, 163, 184, 0.2);
}

.quadrant-node {
  position: absolute;
  transform: translate(-50%, 50%);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s, z-index 0.15s;
}

.quadrant-node:hover {
  transform: translate(-50%, 50%) scale(1.08);
  z-index: 10;
}

.reset-btn {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}
