/* ==========================================================================
   Apple Style (iPad Inspired) - 少子化・人口減少統計LP スタイル
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=SF+Pro+Display:wght@600;700;800;900&display=swap');

:root {
  --bg-primary: #000000;
  --bg-secondary: #08080a;
  --bg-card: #161617;
  --bg-card-hover: #1d1d1f;
  --bg-modal: #161617;
  
  --text-main: #f5f5f7;
  --text-muted: #86868b;
  --text-dim: #6e6e73;
  
  --apple-blue: #2997ff;
  --apple-blue-dark: #0071e3;
  --apple-red: #ff3b30;
  --apple-purple: #af52de;
  --apple-cyan: #55bef0;
  --apple-amber: #ff9f0a;
  --apple-green: #30d158;

  --border-color: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(255, 255, 255, 0.25);

  --font-apple: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro JP", "Inter", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Consolas, monospace;

  --radius-pill: 9999px;
  --radius-card: 24px;
  --radius-btn: 980px;

  --transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

html {
  scroll-behavior: smooth;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-apple);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.015em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #333336;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--apple-blue);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.8rem;
}

/* Hero Section (iPad Landing Style) */
.hero {
  padding: 5.5rem 0 4rem;
  text-align: center;
  position: relative;
  background: radial-gradient(circle at 50% 0%, rgba(255, 59, 48, 0.12) 0%, rgba(41, 151, 255, 0.04) 50%, transparent 80%);
}

.hero-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--apple-red);
  margin-bottom: 1.2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 1.35rem;
  color: var(--text-muted);
  max-width: 860px;
  margin: 0 auto 2.8rem;
  line-height: 1.6;
  font-weight: 500;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-btn);
  font-size: 1.02rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--apple-red);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 59, 48, 0.3);
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 25px rgba(255, 59, 48, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  backdrop-filter: blur(20px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.02);
}

/* Section Header */
.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  font-weight: 500;
}

/* Big Numbers Section (Apple Bento Style Grid) */
.metrics-section {
  padding: 4rem 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.8rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 2.6rem 2.2rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.metric-card:hover {
  transform: scale(1.02);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
}

.metric-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 1rem;
}

.metric-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}

.metric-value {
  font-size: 3.8rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric-unit {
  font-size: 1.4rem;
  color: var(--apple-red);
  font-weight: 800;
}

/* Progress bar inside metric card */
.metric-progress-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.metric-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--apple-red), var(--apple-amber));
  border-radius: 3px;
}

.metric-subtext {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 1.6rem;
}

.metric-link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--apple-blue);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.metric-link:hover {
  color: #55bef0;
  transform: translateX(4px);
}

/* Interactive Charts Section */
.chart-section {
  padding: 4rem 0;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 3rem 2.6rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-bottom: 2.2rem;
}

.chart-controls {
  display: flex;
  gap: 0.8rem;
}

.chart-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition);
}

.chart-btn.active, .chart-btn:hover {
  background: var(--apple-red);
  color: #ffffff;
  border-color: var(--apple-red);
  box-shadow: 0 4px 15px rgba(255, 59, 48, 0.4);
}

.chart-wrapper {
  position: relative;
  height: 440px;
  width: 100%;
}

/* 3 Factor Analysis Section */
.factors-section {
  padding: 4rem 0;
}

.factors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.factor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 2.6rem 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.factor-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: scale(1.02);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
}

.factor-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--apple-amber);
  margin-bottom: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.factor-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: #ffffff;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.factor-text {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 2.2rem;
}

.factor-action {
  align-self: flex-start;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--apple-blue);
  text-decoration: none;
  background: rgba(41, 151, 255, 0.12);
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-btn);
  border: 1px solid rgba(41, 151, 255, 0.3);
  transition: var(--transition);
  cursor: pointer;
}

.factor-action:hover {
  background: var(--apple-blue);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(41, 151, 255, 0.4);
}

/* Reports Archive Section */
.reports-section {
  padding: 4rem 0 6.5rem;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2.2rem;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 2.6rem 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.report-card:hover {
  border-color: var(--border-hover);
  transform: scale(1.015);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
}

.report-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.report-category {
  color: var(--apple-blue);
  font-weight: 700;
  background: rgba(41, 151, 255, 0.15);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
}

.report-card-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
  color: #ffffff;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.report-card-sub {
  font-size: 0.96rem;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
  line-height: 1.6;
}

.btn-open-modal {
  align-self: flex-start;
  background: var(--apple-blue-dark);
  color: #ffffff;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 113, 227, 0.3);
}

.btn-open-modal:hover {
  background: #0077ed;
  transform: scale(1.03);
  box-shadow: 0 8px 25px rgba(0, 113, 227, 0.5);
}

/* Modal UI (Apple Style Modal) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #1c1c1e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-card);
  width: 92%;
  max-width: 880px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 3.2rem 2.8rem;
  position: relative;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.9);
}

.modal-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.modal-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  padding-right: 2.8rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.modal-subtitle {
  color: var(--apple-blue);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

/* Modal TOC Bar */
.modal-toc {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.2rem 1.6rem;
  margin-bottom: 2.4rem;
}

.modal-toc-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--apple-amber);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
}

.modal-toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  list-style: none;
}

.modal-toc-link {
  font-size: 0.88rem;
  color: #d2d2d7;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.modal-toc-link:hover {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
}

footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  background: var(--bg-primary);
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.6rem;
  }
  .metric-value {
    font-size: 3rem;
  }
  .chart-wrapper {
    height: 320px;
  }
  .modal-box {
    padding: 2.2rem 1.6rem;
  }
}
