@charset "UTF-8";

/* =========================================================================
   Starrydata Modern Theme
   Typography & spacing scale revised for visual balance
   ========================================================================= */

:root {
  /* color — Materials Project 風の紫系パレット */
  --bg:        #1e1b4b;   /* indigo-950 */
  --bg-2:      #312e81;   /* indigo-900 */
  --surface:   #ffffff;
  --text:      #1f1f3a;
  --text-2:    #4b5573;
  --text-3:    #9ca3b8;
  --text-on:   #f8fafc;
  --line:      #e6e6f1;
  --accent:    #a78bfa;   /* violet-400 */
  --accent-2:  #7c3aed;   /* violet-600 */
  --accent-3:  #6366f1;   /* indigo-500 */
  --bg-subtle: #f7f7fb;
  --grad-hero: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 55%, #6d28d9 100%);
  --grad-cta:  linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  --grad-accent: linear-gradient(120deg, #a78bfa 0%, #818cf8 100%);
  --shadow-sm: 0 1px 2px rgba(31,31,58,0.04), 0 1px 6px rgba(31,31,58,0.04);
  --shadow-md: 0 4px 8px rgba(31,31,58,0.05), 0 12px 28px rgba(76,29,149,0.08);
  --shadow-lg: 0 16px 36px rgba(76,29,149,0.16);

  /* shape */
  --radius:    16px;
  --radius-sm: 8px;
  --container: 1200px;
  --container-narrow: 920px;

  /* typography scale */
  /* Typography scale (unified) */
  --fs-hero-h1: clamp(1.9rem, 4.2vw, 3.3rem);  /* トップページのヒーロー h1 */
  --fs-h1:      clamp(2rem, 4vw, 3rem);         /* サブページの h1 (.page-head h1) */
  --fs-h2:      clamp(1.55rem, 2.6vw, 2.1rem);  /* セクション見出し */
  --fs-h3:      1.15rem;                        /* カード見出し・サブ見出し */
  --fs-lead:    1.05rem;                        /* リード文・導入文 */
  --fs-body:    1rem;                           /* 本文（プロース）*/
  --fs-small:   0.88rem;                        /* 補助テキスト（ラベル、リンク等）*/
  --fs-tiny:    0.78rem;                        /* eyebrow / タグ / メタ */
  --fs-micro:   0.72rem;                        /* キャプション / ヒント / 最小 */
  /* 旧名エイリアス（既存ルールとの互換のため残す） */
  --fs-base:    1rem;

  /* spacing */
  --gap-section: clamp(48px, 6vw, 80px);
  --gap-card:    24px;
}

/* Reset & base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  margin: 0;
  font-family: "Inter", "Helvetica Neue", Arial, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-subtle);
  font-size: var(--fs-base);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-2); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-3); }
ul, ol { padding-left: 1.25em; }
h1, h2, h3, h4 {
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.012em;
  margin: 0;
}
p { margin: 0 0 1em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center;
  gap: 32px;
  height: 72px;
}
.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 44px;
}
.site-logo img {
  height: 100%;
  width: auto;
  display: block;
}
.site-logo:hover { opacity: 0.78; }
.site-nav { display: flex; gap: 4px; align-items: center; }
.site-nav a {
  padding: 9px 16px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav a:hover { background: #f3eefe; color: var(--accent-2); }
.lang-switch {
  margin-left: auto;
  display: inline-flex;
  background: var(--line);
  border-radius: 999px;
  padding: 3px;
}
.lang-switch a {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
}
.lang-switch a.is-active { background: var(--text); color: #fff; }

/* ---- Hero ---- */
.hero {
  background:
    linear-gradient(rgba(30,27,75,0.40), rgba(30,27,75,0.40)),
    url('../../assets/images/hero/milky_way_katsura.jpg') center center/cover no-repeat fixed,
    var(--grad-hero);
  color: var(--text-on);
  padding: clamp(60px, 7vw, 92px) 0 clamp(44px, 5vw, 64px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 460px at 80% -10%, rgba(167,139,250,0.18), transparent 60%),
    radial-gradient(680px 340px at 0% 110%, rgba(99,102,241,0.14), transparent 60%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; max-width: var(--container); }
.hero-eyebrow {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(167,139,250,0.16);
  border: 1px solid rgba(167,139,250,0.45);
  color: #ddd6fe;
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
  margin-bottom: 28px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}
.hero h1 {
  font-size: var(--fs-hero-h1);
  line-height: 1.12;
  margin: 0 0 20px;
  font-weight: 800;
  text-shadow: 0 2px 20px rgba(0,0,0,0.55);
}
.hero h1 .accent {
  background: linear-gradient(120deg, #c4b5fd 0%, #a78bfa 50%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero h1 .hero-subtitle {
  display: block;
  margin-top: 6px;
  font-size: 0.5em;              /* h1 の半分程度 */
  font-weight: 700;
  line-height: 1.35;
  color: #f8fafc;
  text-shadow: 0 2px 16px rgba(0,0,0,0.55);
}
@media (max-width: 600px) {
  .hero h1 .hero-subtitle { font-size: 0.6em; }
}
.nowrap-grp {
  display: inline-block;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .nowrap-grp { white-space: normal; }
}
.hero .lead {
  font-size: var(--fs-lead);
  line-height: 1.65;
  max-width: 720px;
  color: rgba(248,250,252,0.88);
  margin: 0 0 28px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s;
  line-height: 1;
}
.btn-primary { background: #0f172a; color: #fff; }
.btn-primary:hover { background: #1e293b; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,0.35); color: #fff; }
.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.28);
}
.btn-ghost:hover { background: rgba(255,255,255,0.15); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}
.btn-outline:hover { background: var(--text); color: #fff; }

/* ---- Sections (rhythm) ---- */
.section { padding: var(--gap-section) 0; }
.section-narrow { padding: clamp(36px, 4.5vw, 56px) 0; }
.section h2 {
  font-size: var(--fs-h2);
  margin: 0 0 16px;
  letter-spacing: -0.018em;
}

/* セクション h2 の右上に、同じ文字を小さめ薄グレーで shadow-style に置く */
.section h2[data-echo] {
  position: relative;
  display: inline-block;
  isolation: isolate;
}
.section h2[data-echo]::before {
  content: attr(data-echo);
  position: absolute;
  top: -0.18em;
  left: 0.18em;
  font-size: 1em;
  font-weight: inherit;
  color: rgba(30, 27, 75, 0.09);
  letter-spacing: inherit;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: -1;
}
@media (max-width: 640px) {
  .section h2[data-echo]::before { top: -0.14em; left: 0.14em; }
}
.section .eyebrow,
.eyebrow {
  display: inline-block;
  font-size: var(--fs-tiny);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 700;
  margin-bottom: 14px;
}
.section .lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text-2);
  max-width: 720px;
  margin: 0 0 56px;
}
/* 折り返さず1行に収めたい lead 用（広い画面では1行、狭い画面では自然折り返し） */
.lead.lead-wide,
.section .lead.lead-wide,
.page-head .lead.lead-wide {
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 900px) {
  .lead.lead-wide,
  .section .lead.lead-wide,
  .page-head .lead.lead-wide {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* ---- Stats ---- */
.stats {
  background:
    linear-gradient(rgba(30,27,75,0.40), rgba(30,27,75,0.40)),
    url('../../assets/images/hero/milky_way_katsura.jpg') center center/cover no-repeat fixed,
    var(--bg);
  color: var(--text-on);
  padding: 32px 0 96px;
  position: relative;
}
.stats::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(900px 260px at 50% 50%, rgba(30,27,75,0.18), transparent 75%);
  pointer-events: none;
}
/* iOS Safari は background-attachment:fixed を無視するため、
   モバイルでは stats 側は画像を出さず単色にして「継ぎ目」を消す */
@media (max-width: 900px) {
  .hero {
    background:
      linear-gradient(rgba(30,27,75,0.40), rgba(30,27,75,0.40)),
      url('../../assets/images/hero/milky_way_katsura.jpg') center center/cover no-repeat,
      var(--grad-hero);
  }
  .stats {
    background:
      linear-gradient(rgba(30,27,75,0.55), rgba(30,27,75,0.55)),
      #141031;
  }
}
.stats .container { position: relative; }
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.stat { text-align: left; }
.stat .num {
  font-size: clamp(2.8rem, 4.6vw, 3.8rem);
  font-weight: 800;
  background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 50%, #ffffff 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  letter-spacing: -0.025em;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.55);
}
.stat .label {
  margin-top: 12px;
  color: rgba(248,250,252,0.78);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}

/* ---- Stats detail: ドーナツ + プロジェクト別テーブル ---- */
.stats-detail {
  margin-top: 0;
  color: rgba(248,250,252,0.9);
}
.stats-cta {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}
.stats-donuts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 20px;
}
.stats-donut-card {
  text-align: center;
}
.stats-donut-card h4 {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(248,250,252,0.72);
}
.stats-donut-card canvas {
  display: block;
  margin: 0 auto;
}
.stats-updated {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(248,250,252,0.55);
  letter-spacing: 0.06em;
  margin-bottom: 28px;
  min-height: 1em;
}
.stats-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  background: rgba(15, 13, 45, 0.35);
  border: 1px solid rgba(167, 139, 250, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  color: rgba(248,250,252,0.92);
}
.stats-table th,
.stats-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(167, 139, 250, 0.12);
}
.stats-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(199, 190, 251, 0.85);
  border-bottom-color: rgba(167, 139, 250, 0.35);
  background: rgba(15, 13, 45, 0.4);
}
.stats-table td.num,
.stats-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.stats-table tbody tr:last-child td { border-bottom: none; }
.stats-table tbody tr:hover { background: rgba(167, 139, 250, 0.08); }
.stats-table .project-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.stats-table .project-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 8px currentColor;
}
.stats-table .total-row td {
  font-weight: 700;
  color: #fff;
  background: rgba(124, 58, 237, 0.18);
  border-top: 1px solid rgba(167, 139, 250, 0.4);
}
.stats-loading {
  text-align: center !important;
  color: rgba(248,250,252,0.5) !important;
  padding: 24px 0 !important;
}

@media (max-width: 780px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .stats-donuts { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .stats-table { font-size: 0.78rem; }
  .stats-table th, .stats-table td { padding: 8px 12px; }
}

/* ---- Feature grid (3 cards) ---- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-card);
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #d1c4ff;
}
.feature-card .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--grad-cta);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 22px;
}
.feature-card h3 {
  margin: 0 0 10px;
  font-size: var(--fs-h3);
  letter-spacing: -0.005em;
}
.feature-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.98rem;
  line-height: 1.7;
}

/* ---- Research fields ---- */
.fields-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.field-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  display: block;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
.field-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad-cta);
  opacity: 0;
  transition: opacity .2s;
}
.field-card:hover::before { opacity: 1; }
.field-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #d1c4ff;
  color: inherit;
}
.field-card .field-num {
  font-size: 0.78rem;
  color: var(--text-3);
  font-weight: 700;
  letter-spacing: 0.18em;
}
.field-card h3 {
  font-size: 1.15rem;
  margin: 8px 0 4px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.field-card .en {
  font-size: 0.85rem;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

/* ---- Publication / News cards ---- */
.card-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(3, 1fr);
}
.mini-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: box-shadow .2s, transform .15s, border-color .2s;
}
.mini-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #d1c4ff;
}
.mini-card .meta {
  font-size: 0.78rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.mini-card .meta .tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  background: #f3eefe;
  color: var(--accent-2);
  margin-right: 8px;
  font-weight: 700;
}
.mini-card h3 {
  font-size: 1.1rem;
  margin: 0 0 10px;
  line-height: 1.45;
  letter-spacing: -0.005em;
}
.mini-card h3 a { color: var(--text); }
.mini-card h3 a:hover { color: var(--accent-2); }
.mini-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.65;
  /* clip long text */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.section-foot {
  display: flex; justify-content: center;
  margin-top: 48px;
}

/* ---- News list (top page) ---- */
.news-list-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 28px;
  box-shadow: var(--shadow-sm);
}
.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.news-item {
  border-bottom: 1px solid var(--line);
}
.news-item:last-child { border-bottom: none; }
.news-item a {
  display: flex;
  gap: 28px;
  padding: 18px 0;
  color: inherit;
  align-items: baseline;
  transition: background 0.15s;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 8px;
}
.news-item a:hover { background: var(--bg-subtle); }
.news-date {
  flex: 0 0 92px;
  font-size: 0.88rem;
  color: var(--text-3);
  font-family: "Inter", sans-serif;
  letter-spacing: 0.02em;
  font-weight: 600;
}
.news-text { flex: 1; min-width: 0; }
.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.news-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}
.news-tag-cat {
  background: var(--accent-2);
  color: #fff;
}
.news-tag-sub {
  background: #f3eefe;
  color: var(--accent-2);
  border: 1px solid #e7defb;
}
.news-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  line-height: 1.45;
}
.news-item a:hover .news-title { color: var(--accent-2); }
.news-summary {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 600px) {
  .news-item a { flex-direction: column; gap: 6px; padding: 14px 0; }
  .news-date { flex: 0; }
}

/* News ページ専用（一覧ページでは概要を 2 行まで） */
.news-list-page .news-summary {
  -webkit-line-clamp: 2;
}
.news-list-page .news-item a { padding: 22px 8px; }

.news-ext-icon {
  display: inline-block;
  margin-left: 4px;
  color: var(--text-3);
  font-size: 0.85em;
  font-weight: 500;
  transform: translateY(-1px);
}
.news-item a:hover .news-ext-icon { color: var(--accent-2); }

/* ---- News modal ---- */
.news-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
}
.news-modal[hidden] { display: none; }
.news-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 12, 41, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}
.news-modal-panel {
  position: relative;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 44px 48px 40px;
  animation: news-modal-in 0.18s ease-out;
}
@keyframes news-modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.news-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 8px;
}
.news-modal-close:hover { background: var(--bg-subtle); color: var(--text); }
.news-modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-3);
  margin-bottom: 10px;
}
.news-modal-meta time {
  font-family: "Inter", sans-serif;
  letter-spacing: 0.02em;
  font-weight: 600;
}
.news-modal-panel h2 {
  font-size: 1.55rem;
  line-height: 1.35;
  margin: 0 0 22px;
  letter-spacing: -0.01em;
}
.news-modal-panel .article-body { max-width: none; margin: 0; }
.news-modal-panel .article-refs { max-width: none; margin: 0 0 22px; }
@media (max-width: 600px) {
  .news-modal-panel { padding: 36px 22px 26px; }
  .news-modal-panel h2 { font-size: 1.25rem; }
}

/* ---- About prose ---- */
.container-narrow-prose { max-width: 820px; }
.lead-large,
.prose {
  /* 日本語：禁則処理を厳密化 + 末尾バランス改行 */
  line-break: strict;
  overflow-wrap: break-word;
  text-wrap: pretty;
}
.lead-large {
  font-size: clamp(1.12rem, 1.8vw, 1.28rem);
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 22px;
  max-width: 64ch;
}
.lead-large strong {
  color: var(--accent-2);
  font-weight: 700;
  background: linear-gradient(120deg, transparent 0%, transparent 50%, rgba(167,139,250,0.22) 50%, rgba(167,139,250,0.22) 100%);
  padding: 0 2px;
}
.prose {
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--text-2);
  max-width: 68ch;
  margin: 0;
}

/* セクション lead 全般の日本語改行を改善
   word-break: keep-all は幅にゆとりのある lead 系のみに適用。
   カード内本文 (.involve-card p 等) に keep-all を効かせると、日本語の
   スペースの無い長文がグリッドカラムを押し広げるので付けない */
.section .lead,
.page-head .lead,
.hero .lead,
.lead-large,
.prose {
  line-break: strict;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: pretty;
}
.cta-band p,
.feature-card p,
.mini-card p,
.app-desc,
.involve-card p {
  line-break: strict;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

/* ---- Apps grid ---- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.app-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  position: relative;
  overflow: hidden;
  height: 340px;
  display: block;
  transition: transform .15s, box-shadow .2s, border-color .2s;
  text-decoration: none;
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #c4b5fd;
  color: inherit;
}
.app-card .app-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-subtle);
  z-index: 0;
}
.app-card .app-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s ease;
  background: #fff;
}
.app-card:hover .app-thumb img { transform: scale(1.03); }
.app-card .app-thumb-placeholder {
  display: grid;
  place-items: center;
  background: var(--grad-cta);
  color: #fff;
  font-size: 3rem;
  font-weight: 700;
}
.app-card .app-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 140px;                       /* 全カード統一 (説明文 2 行が収まる高さ) */
  padding: 14px 22px 16px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-top: 1px solid rgba(167, 139, 250, 0.18);
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  transition: background 0.2s;
  box-sizing: border-box;
  overflow: hidden;
}
.app-card:hover .app-body {
  background: rgba(255, 255, 255, 0.94);
}

/* === image_layout="top": 横長画像用、画像上 / テキスト下 分離 === */
.app-card[data-image-layout="top"] .app-thumb {
  position: absolute;
  inset: 0 0 140px 0;                   /* テキスト 140px ぶん残す */
  height: auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.app-card[data-image-layout="top"] .app-thumb img {
  object-fit: contain;
  object-position: center top;
  padding: 14px;
}
.app-card[data-image-layout="top"] .app-body {
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid var(--line);
}
.app-card[data-image-layout="top"]:hover .app-body {
  background: var(--bg-subtle);
}
.app-card .app-icon { display: none; }
.app-card .app-open {
  position: absolute;
  top: 14px; right: 16px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--accent-2);
  font-weight: 600;
  z-index: 2;
}
.app-card h3 {
  font-size: 1.08rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text);
}
.app-sub {
  margin: 0;
  font-size: 0.78rem;
  color: var(--accent-2);
  letter-spacing: 0.04em;
  font-weight: 600;
}
.app-desc {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 0.84rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Get involved ---- */
.involve-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.involve-card {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.involve-card.highlight {
  background: linear-gradient(160deg, #1e1b4b 0%, #312e81 60%, #4c1d95 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-lg);
}
.involve-card.highlight h3 { color: #fff; }
.involve-card.highlight p  { color: rgba(255,255,255,0.82); }
.involve-card h3 {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.involve-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.96rem;
  line-height: 1.7;
  flex-grow: 1;
}
.involve-card .tag {
  align-self: flex-start;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  background: #fff;
  color: var(--accent-2);
  border: 1px solid var(--line);
}
.involve-card.highlight .tag {
  background: rgba(255,255,255,0.14);
  color: #ddd6fe;
  border-color: transparent;
}
.involve-card .btn { align-self: flex-start; margin-top: 6px; }
.involve-card.highlight .btn-primary { color: #fff; }

/* ---- TOP page: 各セクション本文テキストの折り返し幅をコンテナ(1200px)に統一 ---- */
.page-home .hero .lead,
.page-home .section .lead,
.page-home .lead-large,
.page-home .prose {
  max-width: none;
}

/* ---- Starrydata Laboratory ---- */
.lab-diagram-wrap {
  margin: 40px auto 44px;
  max-width: 1100px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.lab-diagram {
  width: 100%;
  height: auto;
  display: block;
}
.lab-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 8px;
}
.lab-step {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.lab-step .step-num {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--accent-2);
}
.lab-step h3 {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 700;
  color: var(--text);
}
.lab-step p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.65;
}
@media (max-width: 960px) {
  .lab-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .lab-steps { grid-template-columns: 1fr; }
  .lab-diagram-wrap { padding: 12px; }
}

/* ---- Two-column showcase (text + chart) ---- */
.grid-2col {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr;
  gap: 64px;
  align-items: center;
}
.grid-2col .text-col h2 { margin-bottom: 18px; }
.grid-2col .text-col .lead { max-width: none; margin-bottom: 28px; color: var(--text); }
.grid-2col .text-col .lead strong {
  color: var(--accent-2);
  font-weight: 700;
  background: linear-gradient(120deg, transparent 0%, transparent 60%, rgba(167,139,250,0.18) 60%, rgba(167,139,250,0.18) 100%);
  padding: 0 2px;
}

.kv-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}
.kv-list li {
  display: flex; flex-direction: column;
  padding: 14px 18px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.kv-list .k {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 700;
}
.kv-list .v {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-top: 4px;
}

.chart-col {
  background: linear-gradient(180deg, #0f0c29 0%, #1e1b4b 60%, #302b63 100%);
  border-radius: var(--radius);
  padding: 18px 16px 14px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.chart-col::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(500px 240px at 100% 0%, rgba(167,139,250,0.22), transparent 60%),
    radial-gradient(400px 180px at 0% 100%, rgba(99,102,241,0.18), transparent 60%);
  pointer-events: none;
}
.chart-meta {
  margin: 10px 4px 0;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  text-align: right;
  letter-spacing: 0.02em;
  position: relative;
}

/* ---- Article body (news / topics 個別記事) ---- */
.article-meta {
  font-size: 0.95rem;
  color: var(--text-2);
  margin: 0;
  display: flex;
  gap: 18px;
  align-items: center;
}
.article-meta time {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: 0.02em;
}
.article-meta .author { color: var(--text-3); font-size: 0.88rem; }

/* ---- Use Data page: 縦 1 列に画像 + テキストの行を並べる ---- */
.use-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 900px;
}
.use-list > li + li {
  border-top: 1px solid var(--line);
}
.use-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: center;
  padding: 28px 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
  border-radius: 8px;
}
.use-row:hover {
  background: var(--bg-subtle);
  color: inherit;
}
.use-row-thumb {
  width: 200px;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}
.use-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  background: #fff;
  transition: transform 0.3s;
}
.use-row:hover .use-row-thumb img { transform: scale(1.04); }
.use-row-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--grad-cta);
  color: #fff;
  font-size: 3rem;
}
.use-row-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.use-row-eyebrow {
  font-size: var(--fs-tiny);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-2);
  text-transform: uppercase;
}
.use-row-title {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin: 2px 0 4px;
  letter-spacing: -0.005em;
  color: var(--text);
}
.use-row-desc {
  font-size: var(--fs-small);
  line-height: 1.7;
  color: var(--text-2);
  margin: 0;
}
.use-row-cta {
  margin-top: 8px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--accent-2);
  align-self: flex-start;
  transition: transform 0.2s;
}
.use-row:hover .use-row-cta { transform: translateX(3px); }

@media (max-width: 640px) {
  .use-row { grid-template-columns: 1fr; gap: 14px; padding: 20px 8px; }
  .use-row-thumb { width: 100%; aspect-ratio: 16 / 9; }
}

.use-cite {
  max-width: 900px;
  margin: 48px auto 0;
  padding: 24px 28px;
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent-2);
  border-radius: 0 8px 8px 0;
}
.use-cite-title {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}
.use-cite-body {
  font-size: var(--fs-small);
  color: var(--text-2);
  margin: 0 0 10px;
  line-height: 1.7;
}
.use-cite-ref {
  font-size: var(--fs-small);
  color: var(--text);
  margin: 0;
  line-height: 1.75;
}
.use-cite-ref a {
  color: var(--accent-2);
  font-weight: 500;
}

@media (max-width: 640px) {
  .use-cards { grid-template-columns: 1fr; }
}

/* ---- Contact page ---- */
.contact-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 40px 32px;
  box-shadow: var(--shadow-md);
  margin: 0 auto 32px;
  overflow: hidden;
}
/* violet アクセントの上帯 */
.contact-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grad-cta);
}
.contact-block { margin: 36px 0; }
.contact-block-topics { margin-top: 0; margin-bottom: 28px; }

/* Contact: 見出し（センター揃え）*/
.contact-h2 {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.contact-h2::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--accent-2);
  border-radius: 2px;
}

/* Contact: 相談テーマ（2 列 × 2 行、各項目左揃え、全体をウィンドウ中央に）*/
.contact-block-topics {
  max-width: none;
  text-align: center;
}
.contact-topics-grid {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;   /* グリッド全体をウィンドウ中央に */
  justify-items: start;      /* セル内は左揃え（同じ列で左端が揃う）*/
  gap: 10px 24px;
}
.contact-topic {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.08);
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
}
.contact-topic:hover {
  background: rgba(167, 139, 250, 0.14);
  transform: translateY(-1px);
}
.contact-topic-check {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--grad-cta);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.28);
}
.contact-topic-check svg {
  width: 12px;
  height: 12px;
}
.contact-topic-text {
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text);
}

/* Contact: 署名（代表・所属） */
.contact-signature {
  max-width: 720px;
  margin: 36px auto 0;
  padding: 20px 24px;
  border-left: 3px solid var(--accent-2);
  background: var(--bg-subtle);
  border-radius: 0 8px 8px 0;
}
.contact-signature-label {
  font-size: var(--fs-tiny);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 6px;
}
.contact-signature-body {
  margin: 0;
  font-size: var(--fs-small);
  line-height: 1.7;
  color: var(--text-2);
}

/* ---- Data page ---- */
.data-intro {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 56px;
}
.data-intro-figure { margin: 0; }
.data-intro-figure img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.data-intro-figure figcaption {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-3);
  text-align: center;
  line-height: 1.55;
}
.data-intro-body p {
  color: var(--text-2);
  font-size: var(--fs-body);
  line-height: 1.85;
  margin: 0 0 16px;
}
.data-intro-body p:last-child { margin-bottom: 0; }

.data-list-heading {
  font-size: var(--fs-h2);
  font-weight: 700;
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-2);
  display: inline-block;
  letter-spacing: -0.005em;
}

.data-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.data-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.data-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-2);
}
.data-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-subtle, #f7f7fa);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.data-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.data-card:hover .data-card-thumb img { transform: scale(1.03); }
.data-card-thumb-placeholder {
  background: linear-gradient(135deg, #eef1f6 0%, #dde3ec 100%);
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.data-card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.data-card-title {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.data-card-full {
  font-size: var(--fs-small);
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 10px;
  flex: 1;
}
.data-card-owner {
  font-size: var(--fs-micro);
  color: var(--text-3);
  letter-spacing: 0.02em;
}

/* Individual project page (data/_field) — 1200px の中で読みやすい幅に制限 */
.data-project-body { max-width: 68ch; }
.data-project-body p {
  color: var(--text-2);
  font-size: var(--fs-body);
  line-height: 1.9;
  margin: 0 0 20px;
}
.data-project-body p:last-child { margin-bottom: 0; }
.data-project-figure {
  margin: 40px 0 0;
  text-align: center;
}
.data-project-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.data-project-figure figcaption {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--text-3);
  line-height: 1.6;
}
.data-project-back {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.data-project-back a {
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 500;
}
.data-owner-line {
  font-size: 0.95rem !important;
  color: var(--text-3) !important;
  margin-top: 12px !important;
}

@media (max-width: 640px) {
  .data-intro { grid-template-columns: 1fr; gap: 20px; }
  .data-cards { grid-template-columns: 1fr; }
}
.contact-block h2 {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.005em;
}
.contact-topics {
  margin: 0;
  padding-left: 1.4em;
  color: var(--text-2);
}
.contact-topics li { margin: 6px 0; font-size: var(--fs-body); line-height: 1.7; color: var(--text-2); }
.contact-org {
  margin: 0;
  color: var(--text-2);
  font-size: var(--fs-body);
  line-height: 1.8;
}

/* Contact form: 1200px コンテナの中で読みやすい幅に自制する
   （.contact-block-topics は 2x2 グリッドを中央に置くため幅制限しない）*/
.contact-card { max-width: 720px; margin-left: auto; margin-right: auto; }
.contact-topics { max-width: 720px; }

/* Contact form */
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: 0.01em;
}
.form-field label .req {
  color: var(--accent-2);
  margin-left: 2px;
  font-weight: 400;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-subtle, #fafafa);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}
.form-field textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}
.form-field input.has-error,
.form-field textarea.has-error {
  border-color: var(--accent-2);
}
.field-hint {
  color: var(--text-3, #999);
  font-size: var(--fs-micro);
  margin: 4px 0 0;
  line-height: 1.5;
}
.field-error {
  color: var(--accent-2);
  font-size: var(--fs-tiny);
  margin: 6px 0 0;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-row .form-field { margin-bottom: 20px; }
.form-note {
  color: var(--text-3, #999);
  font-size: var(--fs-micro);
  text-align: center;
  margin: 14px 0 0;
  line-height: 1.5;
}
.contact-card .btn-primary {
  width: 100%;
  margin-top: 8px;
  padding: 14px 20px;
  font-size: var(--fs-body);
  border-radius: 8px;
  background: var(--grad-cta);
  color: #fff;
  border: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.28);
}
.contact-card .btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.35);
}
.contact-card .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.contact-card-success {
  text-align: center;
  padding: 44px 32px 40px;
}
.contact-card-success h2 {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.005em;
}
.contact-card-success p {
  color: var(--text-2);
  margin: 0 0 20px;
  line-height: 1.7;
}
.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: #4a7a2e;
  background: rgba(74, 122, 46, 0.10);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-icon svg { width: 30px; height: 30px; }

.hidden { display: none !important; }

@media (max-width: 640px) {
  .contact-card { padding: 22px 20px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .contact-topics-grid { grid-template-columns: auto; gap: 8px; }
  .contact-topic { white-space: normal; padding: 8px 14px; }
}

.article-refs {
  max-width: 70ch;
  margin: 0 auto 32px;
  padding: 18px 22px;
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent-2);
  border-radius: 6px;
  font-size: 0.94rem;
}
.article-ref + .article-ref { margin-top: 10px; }
.article-ref-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  background: #fff;
  padding: 2px 9px;
  border-radius: 999px;
  margin-right: 10px;
  vertical-align: middle;
}
.article-ref a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}
.article-ref-doi {
  display: block;
  margin: 4px 0 0 calc(0.72rem * 2 + 10px);
  font-size: 0.78rem;
  color: var(--text-3);
  font-family: "Menlo", monospace;
}

.article-body {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text);
  max-width: 70ch;
  margin: 0 auto;
}
.article-body p { margin: 0 0 1.2em; }
.article-body p:last-child { margin-bottom: 0; }
.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2em 0 0.6em;
  padding-bottom: 0.4em;
  border-bottom: 2px solid var(--accent-2);
  color: var(--text);
}
.article-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.8em 0 0.5em;
  color: var(--text);
}
.article-body h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5em 0 0.4em;
  color: var(--text);
}
.article-body a {
  color: var(--accent-2);
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
.article-body a:hover { border-bottom-color: var(--accent-2); }
.article-body ul, .article-body ol { margin: 0 0 1.2em; padding-left: 1.5em; }
.article-body li { margin: 0.3em 0; }
.article-body strong, .article-body b { font-weight: 700; }
.article-body em, .article-body i { font-style: italic; }
.article-body img {
  max-width: 100%; height: auto;
  border-radius: 8px;
  margin: 1em 0;
  display: block;
}
.article-body blockquote {
  border-left: 3px solid var(--accent-2);
  margin: 1em 0;
  padding: 0.4em 1em;
  background: var(--bg-subtle);
  color: var(--text-2);
}
.article-body code {
  font-family: "Menlo", "Consolas", monospace;
  background: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}
.article-body table {
  border-collapse: collapse;
  margin: 1em 0;
  width: 100%;
}
.article-body th, .article-body td {
  padding: 8px 12px;
  border: 1px solid var(--line);
}
.article-body th { background: var(--bg-subtle); font-weight: 700; }
.article-foot {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
}

/* ---- Page head (sub-page hero, lightweight) ---- */
.page-head {
  position: relative;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
  padding: clamp(40px, 5vw, 68px) 0 clamp(28px, 3.5vw, 44px);
  overflow: hidden;
}
.page-head > .container { position: relative; }

/* h1: 現在言語のメインタイトル */
.page-head h1 {
  position: relative;
  display: inline-block;
  font-size: var(--fs-h1);
  margin: 0 0 16px;
  letter-spacing: -0.018em;
  isolation: isolate;
}

/* data-echo: 同じサイズの文字を薄グレーで少し右斜め上にずらして重ねる */
.page-head h1[data-echo]::before {
  content: attr(data-echo);
  position: absolute;
  top: -0.18em;
  left: 0.18em;
  font-size: 1em;
  font-weight: inherit;
  color: rgba(30, 27, 75, 0.09);
  letter-spacing: inherit;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: -1;
}
.page-head .lead {
  position: relative;
  z-index: 1;
}
@media (max-width: 640px) {
  .page-head h1 { margin-top: 4px; }
  .page-head h1[data-echo]::before { top: -0.14em; left: 0.14em; }
}
.page-head .lead {
  font-size: var(--fs-lead);
  color: var(--text-2);
  max-width: none;
  margin: 0;
  line-break: strict;
  text-wrap: pretty;
}
.section-top-tight { padding-top: clamp(24px, 2.5vw, 40px); }

/* ---- Team page ---- */
.team-group { margin: 0 0 64px; }
.team-group:last-child { margin-bottom: 0; }
.team-group-title {
  font-size: 1.35rem;
  letter-spacing: -0.005em;
  margin: 0 0 28px;
  padding: 0 0 12px;
  border-bottom: 2px solid var(--accent-2);
  display: flex;
  align-items: baseline;
  gap: 14px;
  color: var(--text);
}
.team-group-title .en {
  font-size: 0.85rem;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.team-group-title .count {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-2);
  background: #f3eefe;
  padding: 3px 12px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.team-page-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 56px;
}
.team-page-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  gap: 22px;
  align-items: flex-start;
  transition: none;
}
.team-page-card:hover {
  box-shadow: none;
  border-color: transparent;
  transform: none;
}
.team-page-card .photo {
  flex-shrink: 0;
  width: 120px;
  height: 160px;
  border-radius: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #c4b5fd, #818cf8);
  position: relative;
}
.team-page-card .photo img {
  object-position: center top;
}
.team-page-card .photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.team-page-card .photo .photo-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 2rem;
  font-family: "Inter", sans-serif;
}
.team-page-card .info { flex: 1; min-width: 0; }
.team-page-card .name {
  font-size: 1.15rem;
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text);
}
.team-page-card .name .en {
  display: block;
  font-size: 0.82rem;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.team-page-card .role {
  font-size: 0.92rem;
  color: var(--accent-2);
  font-weight: 600;
  margin: 0 0 10px;
}
.team-page-card .aff {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0;
}
.team-page-card .links {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.team-page-card .links a {
  display: inline-block;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 4px;
  background: #f3eefe;
  color: var(--accent-2);
  border: 1px solid #e2d5fc;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.team-page-card .links a:hover {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}

/* Alumni はやや控えめに */
.team-group[data-group="alumni"] .team-page-card { opacity: 0.85; }
.team-group[data-group="alumni"] .team-group-title { border-bottom-color: var(--text-3); }
.team-group[data-group="alumni"] .team-group-title .count { background: #f0f0f5; color: var(--text-2); }

/* Alumni リスト（写真なし、名前のみ） */
.alumni-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 40px;
}
.alumni-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 14px;
  color: var(--text-2);
}
.alumni-list .name-ja {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 600;
}
.alumni-list .name-en {
  font-size: 0.85rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.alumni-list .period {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .alumni-list { grid-template-columns: 1fr; }
  .alumni-list li { flex-wrap: wrap; }
  .alumni-list .period {
    margin-left: 0;
    width: 100%;
    font-size: 0.75rem;
  }
}

@media (max-width: 760px) {
  .team-page-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 480px) {
  .team-page-card { flex-direction: column; gap: 14px; }
  .team-page-card .photo { width: 140px; height: 186px; }
  .team-page-card .name { font-size: 1.2rem; }
}

/* ---- Papers page ---- */
.papers-source {
  font-size: var(--fs-small);
  color: var(--text-3);
  margin: 16px 0 0;
}
.papers-source a {
  color: var(--accent-2);
  font-weight: 500;
}
.papers-h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  margin: 0 0 14px;
  letter-spacing: -0.015em;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.papers-h2 .count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-2);
  background: #f3eefe;
  padding: 4px 14px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.papers-note {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.7;
  margin: 0 0 32px;
  max-width: 760px;
}

.paper-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.paper-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 28px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.paper-item:last-child { border-bottom: none; }
.paper-item-compact {
  grid-template-columns: 1fr;
  padding: 18px 0;
}
.paper-year-col {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-2);
  font-family: "Inter", sans-serif;
  letter-spacing: -0.01em;
  line-height: 1;
  text-align: right;
}
.paper-body { min-width: 0; }
.paper-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}
.paper-title a {
  color: var(--text);
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.paper-title a:hover {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
}
.paper-authors {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.55;
}
.paper-meta {
  margin: 0 0 4px;
  font-size: 0.88rem;
  color: var(--text-2);
}
.paper-meta .journal { font-style: italic; color: var(--text); }
.paper-meta strong { color: var(--text); font-weight: 700; }
.paper-doi {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-3);
  font-family: "Menlo", "Consolas", monospace;
}
.paper-doi a { color: var(--text-3); }
.paper-doi a:hover { color: var(--accent-2); }
.paper-citations { margin: 6px 0 0; }
.citation-pill {
  display: inline-block;
  padding: 2px 12px;
  background: #f3eefe;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--accent-2);
}
.citation-pill strong { color: var(--accent-2); font-weight: 700; }

/* ---- Year group (details/summary for citing papers) ---- */
.year-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 14px;
  background: var(--bg-subtle);
  transition: border-color .2s;
}
.year-group[open] {
  border-color: var(--accent-2);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.year-summary {
  cursor: pointer;
  padding: 16px 22px;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background .15s;
}
.year-summary::-webkit-details-marker { display: none; }
.year-summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 12px;
  font-size: 0.7em;
  transition: transform 0.2s;
  color: var(--accent-2);
}
.year-group[open] .year-summary::before { transform: rotate(90deg); }
.year-summary:hover { background: #f3eefe; }
.year-group[open] .year-summary:hover { background: transparent; }
.year-label {
  font-size: 1.18rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.year-count {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--line);
  padding: 3px 12px;
  border-radius: 999px;
}
.year-group[open] .year-count {
  background: #f3eefe;
  color: var(--accent-2);
  font-weight: 600;
}
.year-group .paper-list { padding: 0 22px 12px; }
.year-group .paper-item-compact:first-child { border-top: 1px solid var(--line); }

@media (max-width: 600px) {
  .paper-item { grid-template-columns: 1fr; gap: 8px; }
  .paper-year-col { text-align: left; font-size: 1.1rem; }
}

/* ---- Research page ---- */
.research-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.research-item {
  border-bottom: 1px solid var(--line);
  padding: 0 0 44px;
}
.research-item:last-child { border-bottom: none; padding-bottom: 0; }
.research-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 0 0 12px;
  border-bottom: 2px solid var(--accent-2);
}
.research-name {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  margin: 0;
  letter-spacing: -0.015em;
  color: var(--text);
}
.research-name .en {
  display: block;
  font-size: 0.85rem;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-top: 4px;
  text-transform: uppercase;
}
.research-stats {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 18px;
}
.research-stats li {
  text-align: right;
}
.research-stats .k {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 700;
}
.research-stats .v {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-2);
  letter-spacing: -0.01em;
}
.research-desc {
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text);
  max-width: 70ch;
  margin: 0 0 22px;
  line-break: strict;
  text-wrap: pretty;
}
/* テンプレで余分な <br> が出る場合の末尾を消す */
.research-desc br:last-child,
.research-desc br + br { display: none; }
.research-data {
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent-2);
  padding: 18px 22px;
  border-radius: 0 8px 8px 0;
}
.research-data-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 12px;
}
.research-data-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.research-data-list li {
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  color: var(--text-2);
}
@media (max-width: 640px) {
  .research-head { flex-direction: column; align-items: flex-start; }
  .research-stats { width: 100%; justify-content: flex-start; gap: 20px; }
  .research-stats li { text-align: left; }
}

/* ---- Collaborate CTA ---- */
.cta-band {
  background: var(--grad-hero);
  color: var(--text-on);
  border-radius: var(--radius);
  padding: clamp(40px, 6vw, 60px) clamp(28px, 5vw, 52px);
  margin: 0 auto;
  max-width: var(--container);
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(700px 300px at 100% 0%, rgba(167,139,250,.24), transparent 60%),
    radial-gradient(500px 200px at 0% 100%, rgba(99,102,241,.18), transparent 60%);
}
.cta-band > * { position: relative; }
.cta-band .eyebrow { color: #ddd6fe; }
.cta-band h2 {
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  margin: 0 0 18px;
  max-width: 22ch;
}
.cta-band p {
  max-width: 60ch;
  color: rgba(248,250,252,0.85);
  font-size: 1.13rem;
  line-height: 1.75;
  margin: 0 0 32px;
}

/* ---- Team preview ---- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
}
.member-card {
  text-align: center;
}
.member-card .photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 0;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  margin: 0 0 16px;
  object-fit: cover;
  object-position: center top;
  overflow: hidden;
}
.member-card h4 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.005em;
}
.member-card .role {
  color: var(--text-2);
  font-size: 0.88rem;
  margin-top: 6px;
  line-height: 1.4;
}

/* ---- Partners / Funding ---- */
.partner-row {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: 36px 64px;
  filter: grayscale(0.3);
}
.partner-row .partner {
  height: 38px;
  display: grid; place-items: center;
  color: var(--text-3); font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--bg);
  color: rgba(248,250,252,.7);
  padding: 72px 0 40px;
}
.site-footer .container {
  display: grid;
  grid-template-columns: 2fr repeat(5, 1fr);
  gap: 40px;
}
.site-footer h5 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 16px;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.site-footer ul {
  list-style: none;
  margin: 0; padding: 0;
}
.site-footer li { margin: 8px 0; font-size: 0.95rem; }
.site-footer a { color: rgba(248,250,252,.7); }
.site-footer a:hover { color: #fff; }
.footer-logo { height: 40px; width: auto; display: block; opacity: 0.85; transition: opacity 0.2s; filter: brightness(0) invert(1); }
.footer-logo-link:hover .footer-logo { opacity: 1; }
.site-footer .small { font-size: 0.88rem; color: rgba(248,250,252,.5); line-height: 1.7; }
.footer-partners-bar {
  background: #f0f0f0;
  margin-top: 44px;
}
.footer-partners {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 20px 0;
}
.footer-partner-logo {
  height: 36px;
  width: auto;
}
.footer-bottom {
  margin-top: 20px; padding-top: 22px;
  display: flex; justify-content: space-between;
  font-size: 0.85rem;
  color: rgba(248,250,252,.5);
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
  html { font-size: 15.5px; }
  .site-nav { display: none; }
  .stats .container { grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
  .feature-grid { grid-template-columns: 1fr; gap: 20px; }
  .fields-grid  { grid-template-columns: repeat(2, 1fr); }
  .card-grid    { grid-template-columns: 1fr; }
  .team-grid    { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .site-footer .container { grid-template-columns: repeat(3, 1fr); gap: 36px; }
  .cta-band { padding: 56px 28px; margin: 0 16px; }
  .hero .lead { font-size: 0.98rem; }
  .grid-2col { grid-template-columns: 1fr; gap: 36px; }
  .apps-grid { grid-template-columns: repeat(2, 1fr); }
  .involve-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .apps-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  html { font-size: 15px; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .fields-grid { grid-template-columns: 1fr; }
  .site-footer .container { grid-template-columns: 1fr; }
  .feature-card { padding: 28px 24px; }
  .mini-card { padding: 24px; }
  .stats { padding: 72px 0; }
}

/* ==========================================================================
   Home Resources section — Task Navigation + CTA to /resources/
   ========================================================================== */
.home-resources-sub {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 20px;
  letter-spacing: -0.005em;
}
.home-resources-cta {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 26px 32px;
  margin-top: 32px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
  text-decoration: none;
  color: inherit;
  transition: transform .12s, box-shadow .15s;
}
.home-resources-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.15);
  color: inherit;
}
.home-resources-cta-body { flex: 1; min-width: 0; }
.home-resources-cta-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 6px;
}
.home-resources-cta h3 {
  font-size: 1.25rem;
  margin: 0 0 8px;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.35;
}
.home-resources-cta p {
  font-size: 14px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.7;
}
.home-resources-cta-arrow {
  font-size: 2rem;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform .18s;
  font-weight: 300;
  line-height: 1;
}
.home-resources-cta:hover .home-resources-cta-arrow {
  transform: translateX(4px);
}
@media (max-width: 640px) {
  .home-resources-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }
  .home-resources-cta-arrow { align-self: flex-end; }
}

/* Task Navigation grid (used inside home-resources section) */
.task-nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.task-nav-card {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform .12s, box-shadow .15s, border-color .15s;
  min-height: 160px;
}
.task-nav-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  border-color: var(--accent);
  color: inherit;
}
.task-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #4f46e5;
  margin-bottom: 14px;
}
.task-nav-icon svg { display: block; }
.task-nav-system {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.task-nav-card h3,
.task-nav-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.4;
}
.task-nav-card p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}
@media (max-width: 900px) {
  .task-nav-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .task-nav-grid { grid-template-columns: 1fr; }
  .task-nav-card { min-height: 0; }
}

/* ==========================================================================
   Data mega-menu (header dropdown)
   ========================================================================== */

/* site-header は sticky ではないので mega は absolute で足下に流れる */
.site-header { position: relative; }

.site-nav-item.has-mega,
.site-nav-item.has-dropdown { position: relative; }

/* About 用の狭幅ドロップダウン (site-nav-item の内側) */
.site-nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  z-index: 90;
  animation: mega-fade-in .14s ease-out;
}
.site-nav-dropdown[hidden] { display: none; }
.site-nav-dropdown a {
  display: block;
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: background .12s, color .12s;
}
.site-nav-dropdown a:hover {
  background: #f3eefe;
  color: var(--accent-2);
}
@media (max-width: 980px) {
  .site-nav-dropdown { display: none !important; }
}
.site-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: inherit;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.site-nav-btn:hover { background: #f3eefe; color: var(--accent-2); }
.site-nav-item.is-open .site-nav-btn { background: #f3eefe; color: var(--accent-2); }
.site-nav-caret {
  transition: transform .18s ease;
  opacity: 0.7;
}
.site-nav-item.is-open .site-nav-caret { transform: rotate(180deg); }

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  z-index: 90;
  animation: mega-fade-in .14s ease-out;
}
@keyframes mega-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mega-menu[hidden] { display: none; }

.mega-menu-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px 28px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 1100px) {
  .mega-menu-inner { grid-template-columns: repeat(2, 1fr); }
}

/* About mega-menu: 3 カラム、コンテナも少し狭め */
#mega-about .mega-menu-inner {
  max-width: 1000px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) {
  #mega-about .mega-menu-inner { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  #mega-about .mega-menu-inner { grid-template-columns: 1fr; }
}

.mega-menu-col-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  padding-left: 12px;
}

.mega-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mega-menu-list li { margin: 0; }

.mega-menu-link {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.mega-menu-link:hover { background: #f8f7ff; color: inherit; }

.mega-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #4f46e5;
}
.mega-menu-icon svg { display: block; }

.mega-menu-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mega-menu-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.mega-menu-ext {
  font-size: 0.85em;
  color: var(--muted);
  font-weight: 500;
  margin-left: 2px;
}
.mega-menu-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 2px;
}

/* mega-menu の下段 "See all" 帯 */
.mega-menu-foot {
  border-top: 1px solid var(--line);
  background: #fafbff;
  text-align: center;
  padding: 12px 20px;
}
.mega-menu-foot-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.mega-menu-foot-link:hover { color: var(--accent-2); text-decoration: underline; }

@media (max-width: 980px) {
  /* .site-nav display:none 側で全体が隠れるので mega も同時に非表示 */
  .mega-menu { display: none !important; }
}

/* ==========================================================================
   Resources landing page (/resources/)
   ========================================================================== */
.resources-section-head {
  margin-bottom: 24px;
}
.resources-section-head h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.6rem);
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.resources-section-desc {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

/* Featured (メインシステム) カード — Explore セクションの Starrydata 用 */
.resources-featured-card {
  display: grid;
  grid-template-columns: 42% 1fr;
  gap: 32px;
  align-items: center;
  padding: 28px 32px;
  margin: 0 0 28px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
  text-decoration: none;
  color: inherit;
  transition: transform .12s, box-shadow .15s;
}
.resources-featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.15);
  color: inherit;
}
.resources-featured-thumb {
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
}
.resources-featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.resources-featured-card:hover .resources-featured-thumb img { transform: scale(1.02); }
.resources-featured-body { min-width: 0; }
.resources-featured-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent-2);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.resources-featured-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.resources-featured-desc {
  font-size: 14.5px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.7;
}
@media (max-width: 700px) {
  .resources-featured-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
  }
  .resources-featured-title { font-size: 1.2rem; }
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Explore セクション: サムネイル付きカード (top ページの app-card と同じ寸法) */
.resources-grid.has-thumbs .resources-card {
  display: block;
  padding: 0;
  height: 340px;
  position: relative;
  overflow: hidden;
}
.resources-grid.has-thumbs .resources-card-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 0;
}
.resources-grid.has-thumbs .resources-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  padding: 14px 14px 0;
  box-sizing: border-box;
  display: block;
  transition: transform .4s ease;
  background: #fff;
}
.resources-grid.has-thumbs .resources-card:hover .resources-card-thumb img {
  transform: scale(1.03);
}
.resources-grid.has-thumbs .resources-card-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 140px;
  padding: 14px 22px 16px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-top: 1px solid rgba(167, 139, 250, 0.18);
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  box-sizing: border-box;
  overflow: hidden;
  transition: background .2s;
}
.resources-grid.has-thumbs .resources-card:hover .resources-card-body {
  background: rgba(255, 255, 255, 0.94);
}
.resources-grid.has-thumbs .resources-card-title {
  font-size: 15px;
  margin: 0;
  line-height: 1.35;
}
.resources-grid.has-thumbs .resources-card-desc {
  font-size: 13px;
  margin: 0;
  line-height: 1.55;
}
.resources-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform .12s, box-shadow .15s, border-color .15s;
  min-height: 100px;
}
.resources-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  border-color: var(--accent);
  color: inherit;
}
.resources-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #4f46e5;
}
.resources-card-icon svg { display: block; }
.resources-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.4;
}
.resources-card-ext {
  font-size: 0.85em;
  color: var(--muted);
  font-weight: 500;
  margin-left: 2px;
}
.resources-card-desc {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}
@media (max-width: 900px) {
  .resources-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .resources-grid { grid-template-columns: 1fr; }
}

/* 関連ページ リスト */
.resources-related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resources-related-list a {
  display: block;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color .12s, transform .12s;
}
.resources-related-list a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.resources-related-list strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}
.resources-related-list span {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ==========================================================================
   Footer bottom row (GitHub icon 等)
   ========================================================================== */
.footer-externals {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
.footer-externals a {
  display: inline-flex;
  align-items: center;
  color: inherit;
  opacity: 0.75;
  transition: opacity .12s;
}
.footer-externals a:hover { opacity: 1; color: var(--accent); }

/* ==========================================================================
   Cite page (/cite/)
   ========================================================================== */
.page-cite .section .container { max-width: 900px; }

.cite-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cite-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.cite-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
  padding-top: 2px;
}
.cite-body { min-width: 0; }
.cite-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 10px;
  letter-spacing: -0.005em;
}
.cite-title a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .12s, color .12s;
}
.cite-title a:hover {
  color: var(--accent);
  border-bottom-color: currentColor;
}
.cite-year {
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}
.cite-authors {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  margin: 0 0 8px;
}
.cite-journal {
  font-size: 14.5px;
  color: var(--text);
  margin: 0 0 6px;
}
.cite-doi {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}
.cite-doi a { color: inherit; }

.cite-notes {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.cite-notes h3 {
  font-size: 1.05rem;
  margin: 24px 0 10px;
  color: var(--text);
}
.cite-notes h3:first-child { margin-top: 0; }
.cite-notes p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-2);
  margin: 0 0 12px;
}
.cite-notes code {
  background: #eef2ff;
  color: #1e293b;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}
.cite-links {
  list-style: disc;
  padding-left: 1.4em;
  margin: 12px 0 0;
}
.cite-links li { margin: 4px 0; }
.cite-links a { color: var(--accent); }

@media (max-width: 600px) {
  .cite-item {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .cite-num { padding-top: 0; }
}

/* ==========================================================================
   Manual pages
   ========================================================================== */

/* 本文カラムを 900px に絞り、prose を full-fill させる（読みやすい行長） */
.page-manual .section .container,
.page-manual .manual-next .container {
  max-width: 900px;
}
.page-manual .prose,
.page-manual .section .lead,
.page-manual .lead-large,
.page-manual ol.prose,
.page-manual ul.prose {
  max-width: none;
}

/* 見出し階層のリズム */
.page-manual .section h2 {
  margin-top: 48px;
  margin-bottom: 16px;
  font-size: clamp(1.35rem, 2.2vw, 1.6rem);
  letter-spacing: -0.005em;
}
.page-manual .section h2:first-of-type { margin-top: 0; }
.page-manual .section h3 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.page-manual .section ol.prose,
.page-manual .section ul.prose {
  padding-left: 1.4em;
  margin: 12px 0 20px;
}
.page-manual .section ol.prose li,
.page-manual .section ul.prose li { margin: 6px 0; }
.page-manual .section ol.prose ul { margin: 6px 0 6px; }
.page-manual .section p.prose { margin: 12px 0 18px; }

/* Chapter navigation tab bar (page-head 直下) */
.manual-chapter-nav {
  background: #fafbff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.manual-chapter-nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 28px;
}
.manual-chapter-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.manual-chapter-nav li { flex-shrink: 0; }
.manual-chapter-nav li a {
  display: block;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13.5px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .12s, border-color .12s, background .12s;
}
.manual-chapter-nav li a:hover {
  color: var(--text);
  background: rgba(167, 139, 250, 0.06);
}
.manual-chapter-nav li.is-current a {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
  font-weight: 700;
}
.manual-chapter-nav .ch {
  font-weight: 700;
  margin-right: 4px;
  color: var(--muted);
}
.manual-chapter-nav li.is-current .ch { color: var(--accent-2); }
@media (max-width: 600px) {
  .manual-chapter-nav-inner { padding: 0 16px; }
  .manual-chapter-nav li a { padding: 10px 12px; font-size: 13px; }
}

/* Figure（スクリーンショット + キャプション） */
.manual-figure {
  margin: 24px 0 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.manual-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.manual-figure figcaption {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--muted);
  background: #fafbff;
  border-top: 1px solid var(--line);
  line-height: 1.65;
}

/* Callout（注意 / 補足） */
.manual-callout {
  padding: 14px 18px;
  border-radius: 8px;
  margin: 20px 0;
  border-left: 4px solid transparent;
  line-height: 1.75;
  color: var(--text);
  font-size: var(--fs-body);
}
.manual-callout > :first-child { margin-top: 0; }
.manual-callout > :last-child { margin-bottom: 0; }
.manual-callout.warn { background: #fff7e6; border-left-color: #f0b429; }
.manual-callout.note { background: #e8f5e9; border-left-color: #43a047; }

/* テーブル */
.manual-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 24px;
  font-size: 14.5px;
}
.manual-table th,
.manual-table td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.6;
}
.manual-table thead th {
  background: #eef2ff;
  font-weight: 600;
  color: var(--text);
}

/* コードブロック */
.manual-code {
  background: #0d1b3e;
  color: #e2e8f0;
  padding: 18px 20px;
  border-radius: 10px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.65;
  margin: 18px 0 24px;
}
.manual-code code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

/* インラインコード（prose 内） */
.page-manual .section code {
  background: #eef2ff;
  color: #1e293b;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}
/* コードブロック内の code は色を継承 */
.page-manual .section pre.manual-code code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Chapter 一覧カード（マニュアル index） — 縦 1 列 × 4 行 */
.manual-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.manual-card {
  display: block;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.manual-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  border-color: var(--accent);
  color: inherit;
}
.manual-card-eyebrow {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.manual-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 4px;
  color: var(--text);
  line-height: 1.4;
}
.manual-card-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

/* 「次のステップ」フッタセクション */
.manual-next {
  background: #f7f9ff;
  border-top: 1px solid var(--line);
}
.manual-next h2 {
  font-size: 1.15rem;
  margin: 0 0 12px;
}
.manual-next h2 + ul.prose { margin-top: 0; }
.manual-next ul.prose li { margin: 4px 0; }
