/* ぽらりの かがくラボ。図鑑と同じ夜の色が土台（docs/research/2026-10-30_サイトの形の案.md 5章）。
   トップは「絵本の夜の見開き」：空に縦書きのひとこと、丘でねむるぽらり、読み込んだときに流れ星が1回だけ通る。
   ぽらりの声はおなかのラベンダー色で、おとなの文と見分けられるようにする */
:root {
  --night: #141C38;
  --night-low: #1F2A4D;  /* 地平線ちかくの空 */
  --ground: #0D1330;     /* 丘より下 */
  --text: #FFF4E0;
  --muted: #B9C0DA;
  --star: #FFE08A;
  --voice: #E0DBEA;      /* ぽらりのおなかの色＝ぽらりの声 */
  --voice-ink: #2B2F4A;  /* ぽらりの目・鼻の色 */
  --rule: #2E3A66;
  --measure: 34em;
  font-family: "BIZ UDPGothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--text); font-size: 17px; line-height: 1.85; }
body.page-home { background: var(--ground); }
a { color: var(--star); text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--star); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.draft-ribbon { margin: 0; padding: 6px 16px; background: #FFC9A0; color: var(--night); font-size: 13px; font-weight: 700; text-align: center; }

/* ── 上のしるしと下の帯 ── */
.site-head { max-width: 760px; margin: 0 auto; padding: 14px 20px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; position: relative; z-index: 2; }
.site-name { color: var(--text); font-weight: 700; text-decoration: none; letter-spacing: 0.06em; font-size: 15px; }
.site-head nav { display: flex; gap: 16px; font-size: 14px; }
.site-head nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.site-head nav a:hover { color: var(--text); }
.site-foot { max-width: 760px; margin: 0 auto; padding: 28px 20px 40px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); }
.site-foot a { color: var(--muted); }

/* ── トップ：夜空の見開き ── */
.page-home .site-head { position: absolute; left: 0; right: 0; }
.hero { position: relative; height: min(88svh, 720px); min-height: 520px; overflow: hidden; background: linear-gradient(180deg, var(--night) 0%, var(--night) 45%, var(--night-low) 100%); }
.stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-tagline {
  position: absolute; top: 76px; right: max(28px, calc(50% - 330px));
  margin: 0; writing-mode: vertical-rl; text-orientation: mixed;
  font-size: clamp(26px, 7.4vw, 40px); line-height: 1.7; letter-spacing: 0.14em; font-weight: 700;
}
/* 縦書きは「、」で列を分け、列の中では折り返さない */
.hero-tagline span { display: block; white-space: nowrap; }
.hero-tagline span + span { margin-block-start: 0.5em; padding-block-start: 0; }
.hill { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 110px; }
.hero-porari { position: absolute; bottom: 38px; left: max(14px, calc(50% - 320px)); width: clamp(120px, 34vw, 170px); height: auto; }
/* 流れ星：読み込んで少ししてから、縦書きのひとことをよけて左の空を右上→左下へ1回だけ。
   明るい頭は進む向き（左下）、尾は右上。ぽらりはねたまま */
.meteor { position: absolute; top: 12%; left: 38%; width: 170px; height: 2.5px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, #fff 0%, var(--text) 12%, rgba(255, 244, 224, 0) 100%);
  transform: rotate(-30deg); transform-origin: left center;
  animation: meteor 1.3s cubic-bezier(.3, .1, .4, 1) 1.6s 1 forwards; }
@keyframes meteor {
  0% { opacity: 0; translate: 0 0; }
  12% { opacity: 1; }
  100% { opacity: 0; translate: -32vw 18vh; }
}
@media (prefers-reduced-motion: reduce) { .meteor { display: none; } }

.home { max-width: 760px; margin: 0 auto; padding: 8px 20px 24px; display: flex; flex-direction: column; gap: 44px; }
.home .porari-say { margin-top: -6px; }

/* ── ぽらりの声 ── */
.porari-say { display: flex; align-items: flex-end; gap: 6px; margin: 28px 0; max-width: var(--measure); }
.porari-say img { flex: none; width: 80px; height: 80px; }
.bubble { position: relative; margin: 0 0 22px; padding: 12px 18px; background: var(--voice); color: var(--voice-ink); border-radius: 22px 22px 22px 6px; font-size: 16px; line-height: 1.7; font-weight: 700; letter-spacing: 0.04em; }

/* ── 図鑑への入口（ページでひとつだけのボタン） ── */
.zukan-call { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px; padding: 18px 20px 20px 8px; border: 2px solid var(--star); border-radius: 28px; }
.zukan-call img { width: 112px; height: 112px; }
.zukan-call h2 { margin: 0; word-break: keep-all; font-size: 19px; line-height: 1.5; color: var(--star); }
.zukan-call p { margin: 4px 0 14px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.tool { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px; background: var(--star); color: var(--night); font-weight: 700; text-decoration: none; }
.tool:hover { background: var(--text); }
.tool-soon { display: inline-block; margin: 0; padding: 8px 18px; border: 2px dashed var(--star); border-radius: 22px; word-break: keep-all; line-height: 1.5; color: var(--star); font-weight: 700; }

/* ── 見出し・一覧 ── */
.h2 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; }
.fields { list-style: none; margin: 0; padding: 0; }
.fields a { display: flex; align-items: baseline; gap: 14px; padding: 10px 0; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--rule); }
.fields-name { font-size: 26px; font-weight: 700; letter-spacing: 0.1em; }
.fields-sub { font-size: 14px; color: var(--muted); }
.reads { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.reads a { display: grid; grid-template-columns: 1fr; gap: 0; padding: 14px 0 16px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--text); }
.reads time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.reads-title { font-size: 18px; font-weight: 700; line-height: 1.55; }
.reads-desc { font-size: 14px; color: var(--muted); line-height: 1.7; }
.reads a:hover .reads-title { color: var(--star); }
.empty { margin: 0; padding: 14px 0; color: var(--muted); border-top: 1px solid var(--rule); }
@media (min-width: 640px) {
  .reads a { grid-template-columns: 9.5em 1fr; column-gap: 20px; }
  .reads time { grid-row: span 2; padding-top: 4px; }
}

/* ── 分野のページ ── */
.field { max-width: 760px; margin: 0 auto; padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 36px; }
.field-title { margin: 0; font-size: 44px; line-height: 1.2; letter-spacing: 0.12em; }
.field-title span { display: block; margin-top: 6px; font-size: 15px; letter-spacing: 0.04em; font-weight: 400; color: var(--muted); }
.lead { margin: -16px 0 0; max-width: var(--measure); }

/* ── 記事・about：読むためのページ ── */
.article { max-width: calc(var(--measure) + 40px); margin: 0 auto; padding: 20px 20px 24px; }
.crumb { margin: 0 0 10px; font-size: 14px; }
.crumb a { text-decoration: none; }
.article-title { margin: 0; font-size: clamp(26px, 6.6vw, 34px); line-height: 1.45; letter-spacing: 0.02em; }
.article-date { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.points { margin: 28px 0 8px; padding: 16px 20px 14px; background: var(--night-low); border-radius: 6px 22px 22px 22px; }
.points h2 { margin: 0 0 4px; font-size: 14px; color: var(--star); letter-spacing: 0.06em; }
.points ul { list-style: none; margin: 0; padding: 0; }
.points li { position: relative; padding-left: 1.4em; font-weight: 700; }
.points li::before { content: "★"; position: absolute; left: 0; color: var(--star); font-size: 0.8em; top: 0.2em; }
.prose h2 { margin: 48px 0 10px; font-size: 22px; line-height: 1.5; }
.prose h3 { margin: 32px 0 6px; font-size: 18px; line-height: 1.5; color: var(--star); }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose blockquote { margin: 0 0 18px; padding-left: 14px; border-left: 3px solid var(--rule); color: var(--muted); }
.prose .table-wrap { margin: 0 0 22px; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.prose th { color: var(--muted); font-size: 13px; font-weight: 700; border-bottom-width: 2px; }
.prose td:last-child, .prose th:last-child { text-align: right; white-space: nowrap; color: var(--star); font-weight: 700; }
.prose th:last-child { color: var(--muted); }
.prose .cell-note { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.prose hr { margin: 32px 0; border: 0; border-top: 1px solid var(--rule); }
/* 出典は記事の終わりの小さな文字 */
.prose h2:last-of-type { font-size: 15px; color: var(--muted); padding-top: 18px; border-top: 1px solid var(--rule); }
.prose h2:last-of-type ~ * { font-size: 14px; color: var(--muted); }
