:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --ink: #1a2233;
  --muted: #5b6b83;
  --primary: #2b6de0;
  --primary-dark: #1f54b8;
  --accent: #0ea5a4;
  --border: #e3e8f0;
  --shadow: 0 4px 20px rgba(27, 44, 88, 0.08);
  --radius: 12px;
  --font: 'Inter', 'Noto Sans JP', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(120deg, #13254a, #1b3a6b);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-mark { font-size: 30px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.brand-tag { font-size: 11px; opacity: 0.8; letter-spacing: 1px; text-transform: uppercase; }
.nav { display: flex; gap: 24px; }
.nav-link { color: #d7e3f7; text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-link:hover { color: #fff; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 20% 20%, rgba(43,109,224,0.25), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(14,165,164,0.22), transparent 45%),
    linear-gradient(150deg, #0d1f40, #15315e);
  color: #fff;
  padding: 80px 0 70px;
}
.hero-content { max-width: 720px; }
.hero h1 { font-size: 40px; line-height: 1.35; font-weight: 700; margin-bottom: 20px; }
.hero-lead { font-size: 17px; color: #c8d6ee; margin-bottom: 30px; }
.hero-lead strong { color: #fff; }

.hero-search { display: flex; gap: 10px; max-width: 620px; }
.hero-search input,
.search-inline input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 16px;
  outline: none;
}
.hero-search input::placeholder { color: rgba(255,255,255,0.6); }

.btn {
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 24px;
  transition: transform 0.1s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }

.hero-stats { display: flex; gap: 48px; margin-top: 44px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 30px; font-weight: 700; color: #7fd6d5; }
.stat-label { font-size: 13px; color: #b9c9e4; }

/* ---------- Sections ---------- */
.section { padding: 56px 0 20px; scroll-margin-top: 80px; }
.section-title { font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.section-sub { color: var(--muted); margin-bottom: 26px; }

/* ---------- Filter bar ---------- */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 18px;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.filter-group select,
.search-inline input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  min-width: 170px;
}
.search-inline { display: flex; gap: 8px; }
.search-inline input { min-width: 220px; }
.search-inline .btn { padding: 10px 18px; }

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 2px 16px;
  color: var(--muted);
  font-size: 14px;
}
.result-hint { font-size: 13px; }

/* ---------- Dataset grid ---------- */
.dataset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(27,44,88,0.14); border-color: var(--primary); }
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: #eef3fb;
  color: var(--primary-dark);
}
.tag.accent { background: #e2f7f6; color: #0c6f6e; }
.tag.warn { background: #fdeeee; color: #b3362f; }
.card-desc {
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
  flex: 1;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.card-meta .org { font-weight: 600; color: var(--ink); }

/* ---------- Featured ---------- */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

/* ---------- Modality grid ---------- */
.modality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.modality-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}
.modality-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.modality-icon { font-size: 28px; margin-bottom: 10px; }
.modality-card h3 { font-size: 16px; margin-bottom: 6px; }
.modality-card p { font-size: 13px; color: var(--muted); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.about-card h3 { font-size: 17px; margin-bottom: 10px; color: var(--primary-dark); }
.about-card p { font-size: 14px; color: var(--muted); }
.about-card strong { color: var(--ink); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin: 34px 0; flex-wrap: wrap; }
.page-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
}
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px;
  z-index: 100;
  overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--surface);
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  padding: 30px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: pop 0.18s ease;
}
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  border: none;
  background: none;
  font-size: 28px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--ink); }
.modal-body h2 { font-size: 22px; margin-bottom: 14px; }
.modal-body .desc { color: var(--muted); margin-bottom: 18px; }
.modal-body h4 { margin: 18px 0 8px; font-size: 14px; color: var(--primary-dark); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.detail-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.detail-table td:first-child { width: 38%; color: var(--muted); font-weight: 500; }
.detail-table td:last-child { color: var(--ink); }
.detail-table a { color: var(--primary); }

/* ---------- Footer ---------- */
.site-footer { background: #0e1a30; color: #aebcd6; margin-top: 60px; padding: 40px 0 20px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; }
.footer-brand { font-size: 20px; color: #fff; margin-bottom: 6px; }
.footer-inner p { font-size: 13px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: #aebcd6; text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.copyright { border-top: 1px solid #22345a; padding-top: 18px; font-size: 12px; color: #6d7d9c; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero h1 { font-size: 30px; }
  .hero-stats { gap: 28px; }
  .nav { gap: 14px; }
  .nav-link { font-size: 13px; }
  .header-inner { flex-wrap: wrap; gap: 8px; }
  .dataset-grid, .featured-grid { grid-template-columns: 1fr; }
}
