/* 物語図鑑 — 言語図鑑と同じデザイントークン */
:root {
  --bg: #05060e;
  --bg2: #0a0c1a;
  --ink: #d9dce8;
  --ink-dim: #8b90a5;
  --ink-faint: #5a5f75;
  --accent: #ffd9a0;
  --accent-dim: #b09468;
  --line: rgba(217, 220, 232, 0.12);
  --serif: "Shippori Mincho", serif;
  --sans: "Zen Kaku Gothic New", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 2;
  letter-spacing: 0.04em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: rgba(255,217,160,0.25); }

/* ---------- Site nav ---------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px;
  background: linear-gradient(rgba(5,6,14,0.82), rgba(5,6,14,0));
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.site-nav.solid { background: linear-gradient(rgba(5,6,14,0.96), rgba(5,6,14,0.7)); }
.site-nav a { pointer-events: auto; text-decoration: none; }
.site-nav .brand {
  font-family: var(--serif); font-size: 14px; letter-spacing: 0.22em;
  color: #eef0f6; transition: color 0.3s;
}
.site-nav .brand b { color: var(--accent); font-weight: 400; margin-right: 7px; }
.site-nav .brand:hover { color: var(--accent); }
.site-nav .links { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav .links a {
  font-size: 11.5px; letter-spacing: 0.16em; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 15px;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.site-nav .links a:hover, .site-nav .links a.on {
  color: var(--accent); border-color: rgba(255,217,160,0.4); background: rgba(255,217,160,0.06);
}
.site-nav .links a.sister { color: var(--ink-faint); border-style: dashed; }
@media (max-width: 520px) {
  .site-nav { padding: 12px 14px; gap: 10px; }
  .site-nav .brand { font-size: 12px; letter-spacing: 0.14em; }
  .site-nav .links a { padding: 4px 11px; font-size: 10.5px; letter-spacing: 0.1em; }
}

/* ---------- Hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; }
#sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-inner {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; pointer-events: none; padding: 0 24px;
}
.hero-kicker { font-size: 12px; letter-spacing: 0.42em; color: var(--ink-dim); margin-bottom: 28px; text-indent: 0.42em; }
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(34px, 7vw, 64px); letter-spacing: 0.18em; text-indent: 0.18em;
  color: #f0f1f7; text-shadow: 0 0 40px rgba(150,170,255,0.25);
}
.hero-sub { margin-top: 30px; font-size: clamp(13px, 2vw, 15px); color: var(--ink-dim); line-height: 2.4; }
.hero-sub strong { color: var(--accent); font-weight: 400; }
.hero-line {
  margin-top: 40px; font-size: 12px; letter-spacing: 0.18em; color: var(--ink-dim);
  line-height: 1.9; min-height: 3.8em; transition: opacity 1.2s;
}
.hero-line em { font-style: normal; color: var(--accent); }
.hero-line small { display: block; font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.14em; }
.scroll-cue {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: 10px; letter-spacing: 0.4em; color: var(--ink-faint);
  writing-mode: vertical-rl; animation: cue 3s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { opacity: 0.3; transform: translate(-50%, 0); }
  50% { opacity: 0.9; transform: translate(-50%, 10px); }
}
.hero-fade {
  position: absolute; bottom: 0; left: 0; right: 0; height: 22vh;
  background: linear-gradient(to bottom, transparent, var(--bg)); z-index: 1; pointer-events: none;
}
.star-tip {
  position: absolute; z-index: 3; pointer-events: none;
  font-family: var(--serif); font-size: 12px; letter-spacing: 0.12em; color: #f0f1f7;
  background: rgba(5,6,14,0.7); border: 1px solid var(--line); border-radius: 3px;
  padding: 4px 10px; white-space: nowrap; opacity: 0; transition: opacity 0.25s;
  transform: translate(-50%, -140%);
}
.star-tip small { display: block; font-family: var(--sans); font-size: 10px; color: var(--ink-dim); letter-spacing: 0.08em; }
.star-tip.show { opacity: 1; }

/* ---------- Sections ---------- */
main { position: relative; z-index: 2; }
.section { max-width: 700px; margin: 0 auto; padding: 120px 28px 40px; }
.section.wide { max-width: 980px; }
.section-num { font-family: var(--serif); font-size: 12px; letter-spacing: 0.35em; color: var(--accent-dim); margin-bottom: 18px; }
.section h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(24px, 4.4vw, 34px); letter-spacing: 0.12em; line-height: 1.7;
  color: #f0f1f7; margin-bottom: 36px;
}
.section p { font-size: 15px; color: var(--ink); margin-bottom: 1.6em; }
.section p.dim { color: var(--ink-dim); font-size: 14px; }
.section strong { color: var(--accent); font-weight: 400; }
.section h3, .sub-h {
  font-family: var(--serif); font-weight: 500; font-size: 17px; letter-spacing: 0.1em;
  color: #eef0f6; margin: 44px 0 14px;
}
.section blockquote {
  border-left: 1px solid var(--accent-dim); padding: 4px 0 4px 22px; margin: 34px 0;
  font-family: var(--serif); font-size: 16px; line-height: 2.2; color: #e8e9f0;
}
.section blockquote cite { display: block; margin-top: 10px; font-family: var(--sans); font-style: normal; font-size: 11.5px; color: var(--ink-faint); letter-spacing: 0.12em; }
.section .more { display: inline-block; margin-top: 10px; font-size: 13px; letter-spacing: 0.12em; color: var(--accent-dim); text-decoration: none; border-bottom: 1px solid transparent; transition: color 0.3s, border-color 0.3s; }
.section .more:hover { color: var(--accent); border-color: rgba(255,217,160,0.4); }
.fade-in { opacity: 0; transform: translateY(18px); transition: opacity 1.1s ease, transform 1.1s ease; }
.fade-in.in { opacity: 1; transform: none; }

/* 対比カード（岩戸 vs デメテル など） */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 30px 0; }
.pair > div { border: 1px solid var(--line); border-radius: 6px; padding: 22px 22px 16px; background: rgba(10,12,26,0.5); }
.pair h4 { font-family: var(--serif); font-weight: 500; font-size: 14px; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 10px; }
.pair p { font-size: 13.5px; color: var(--ink-dim); margin-bottom: 0.6em; }
@media (max-width: 560px) { .pair { grid-template-columns: 1fr; } }

/* ---------- Page (list / article) ---------- */
.page { max-width: 980px; margin: 0 auto; padding: 130px 28px 60px; }
.page.narrow { max-width: 700px; }
.page-kicker { font-family: var(--serif); font-size: 12px; letter-spacing: 0.35em; color: var(--accent-dim); margin-bottom: 18px; }
.page h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(28px, 5vw, 44px); letter-spacing: 0.14em; line-height: 1.6; color: #f0f1f7;
}
.page h1 small { display: block; font-family: var(--sans); font-weight: 300; font-size: 12px; letter-spacing: 0.3em; color: var(--ink-dim); margin-top: 10px; }
.page .intro { margin-top: 26px; font-size: 14.5px; color: var(--ink-dim); max-width: 620px; }
.page .meta { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 11.5px; letter-spacing: 0.14em; color: var(--ink-faint); }
.page .meta b { font-weight: 400; color: var(--ink-dim); }

/* filter pills / search（索引） */
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 14px; align-items: center; }
.pill {
  font: inherit; font-size: 11.5px; letter-spacing: 0.14em; color: var(--ink-dim);
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 14px; cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.pill:hover, .pill.on { color: var(--accent); border-color: rgba(255,217,160,0.4); background: rgba(255,217,160,0.06); }
.search {
  font: inherit; font-size: 13px; letter-spacing: 0.06em; color: var(--ink);
  background: rgba(10,12,26,0.6); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px; width: 100%; max-width: 380px; outline: none; margin: 8px 0 20px;
}
.search:focus { border-color: rgba(255,217,160,0.4); }
.search::placeholder { color: var(--ink-faint); }
.count { font-size: 11.5px; letter-spacing: 0.14em; color: var(--ink-faint); margin: 0 0 26px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 40px; }
.tile {
  --c: var(--accent);
  position: relative; display: block; text-decoration: none;
  border: 1px solid var(--line); border-radius: 6px; padding: 24px 22px 20px;
  background: rgba(10,12,26,0.5); overflow: hidden;
  transition: border-color 0.35s, transform 0.35s, background 0.35s;
}
.tile::before {
  content: ""; position: absolute; top: 18px; left: 22px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 12px var(--c), 0 0 24px color-mix(in srgb, var(--c) 40%, transparent);
}
.tile:hover { border-color: color-mix(in srgb, var(--c) 45%, transparent); transform: translateY(-2px); background: rgba(14,16,32,0.7); }
.tile .k { font-size: 10.5px; letter-spacing: 0.2em; color: var(--ink-faint); padding-left: 16px; margin-bottom: 14px; }
.tile .t { font-family: var(--serif); font-weight: 500; font-size: 19px; letter-spacing: 0.1em; color: #f0f1f7; line-height: 1.5; }
.tile .t small { font-family: var(--sans); font-weight: 300; font-size: 11px; letter-spacing: 0.16em; color: var(--ink-dim); margin-left: 8px; }
.tile .l { margin-top: 12px; font-size: 13px; line-height: 1.9; color: var(--ink-dim); }
.tile .m { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.tile .m span { font-size: 10px; letter-spacing: 0.12em; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.tile.topic { padding-top: 26px; }
.tile.topic .t { font-size: 20px; }
.group-h { font-family: var(--serif); font-weight: 500; font-size: 15px; letter-spacing: 0.3em; color: var(--accent-dim); margin: 56px 0 4px; }
.group-h:first-of-type { margin-top: 30px; }

/* index rows（索引） */
.rows { margin-top: 10px; border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 10px 1.4fr 1fr 1.1fr auto; gap: 16px; align-items: baseline;
  padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none;
  transition: background 0.3s;
}
.row:hover { background: rgba(255,217,160,0.04); }
.row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); align-self: center; }
.row .n { font-family: var(--serif); font-size: 15.5px; letter-spacing: 0.08em; color: #eef0f6; }
.row .n small { font-family: var(--sans); font-size: 10.5px; color: var(--ink-faint); margin-left: 8px; letter-spacing: 0.12em; }
.row .s, .row .r { font-size: 12px; color: var(--ink-dim); letter-spacing: 0.06em; }
.row .mo { font-size: 10px; letter-spacing: 0.12em; color: var(--ink-faint); white-space: nowrap; }
@media (max-width: 640px) {
  .row { grid-template-columns: 10px 1fr; gap: 4px 12px; }
  .row .s, .row .r, .row .mo { grid-column: 2; }
}

/* article body */
.article { max-width: 700px; margin: 0 auto; padding: 0 28px 60px; }
.article h2 { font-family: var(--serif); font-weight: 500; font-size: 20px; letter-spacing: 0.16em; color: var(--accent); margin: 70px 0 22px; }
.article p { font-size: 15px; margin-bottom: 1.6em; }
.article p.dim { color: var(--ink-dim); font-size: 13.5px; }
.article blockquote {
  border-left: 1px solid var(--accent-dim); padding: 4px 0 4px 22px; margin: 34px 0;
  font-family: var(--serif); font-size: 16px; line-height: 2.2; color: #e8e9f0;
}
.article blockquote cite { display: block; margin-top: 10px; font-family: var(--sans); font-style: normal; font-size: 11.5px; color: var(--ink-faint); letter-spacing: 0.12em; }
.article .related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.article .related .tile { padding: 18px 18px 14px; }
.article .related .tile .t { font-size: 16px; }
.article .stub { border: 1px dashed var(--line); border-radius: 6px; padding: 22px 24px; color: var(--ink-dim); font-size: 13.5px; }
.article .stub b { color: var(--accent-dim); font-weight: 400; }

/* ---------- Footer ---------- */
footer { position: relative; z-index: 2; max-width: 700px; margin: 0 auto; padding: 80px 28px 60px; border-top: 1px solid var(--line); }
footer .fam { font-size: 11px; letter-spacing: 0.3em; color: var(--ink-faint); margin-bottom: 14px; }
footer .links { display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 12.5px; letter-spacing: 0.1em; }
footer .links a { color: var(--accent-dim); text-decoration: none; }
footer .links a:hover { color: var(--accent); }
footer .note { margin-top: 30px; font-size: 11.5px; line-height: 2; color: var(--ink-faint); }
footer .copy { margin-top: 20px; font-size: 11px; letter-spacing: 0.14em; color: var(--ink-faint); }

/* 索引ページ: 言語図鑑 languages/ と同じ、文字だけの上部ナビ */
.idx-top { max-width: 980px; margin: 0 auto; padding: 40px 28px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 11px; letter-spacing: 0.3em; color: var(--ink-faint); }
.idx-top a { text-decoration: none; transition: color 0.3s; }
.idx-top a:hover { color: var(--accent); }
.page.idx { padding-top: 80px; }
