/* 科学の紹介ページ・トップ・作り方の見た目（w.py が組み立てるページ。日本語と英語）。色は動画の見た目に合わせる（T/docs/youtube_plan.md の「画面の見た目」） */
:root { --bg: #fbf6ea; --grid: rgba(35,49,90,.05); --ink: #23315a; --ink2: #5b6584; --card: #fff; --edge: #3b2a20;
  --accent: #e8792b; --accent-ink: #c2410c; --soft: #fdebd9; --gray: #eef0f4;
  /* 白い字を載せる地（札・ボタン）。暗い画面でも同じ色にして、白い字とのコントラストを 4.5 以上に保つ（5.18 と 5.77） */
  --badge: #c2410c; --badge-gray: #5b6584; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #151a2b; --grid: rgba(255,255,255,.03); --ink: #e8ebf3; --ink2: #a8b0c6; --card: #1f2640; --edge: #0b0e18;
    --accent: #f08c45; --accent-ink: #fb9a5a; --soft: #3a2a20; --gray: #2a3150; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  font: 17px/1.85 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif; }
a { color: var(--accent-ink); }
.bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--card); border-bottom: 3px solid var(--edge); position: sticky; top: 0; z-index: 2; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 800; text-decoration: none; font-size: 15px; }
.brand img { border-radius: 50%; }
/* 言葉の切り替え（日本語のページは English、英語のページは 日本語。同じ内容の別の言語のページへ移る） */
.lang { margin-left: auto; flex: none; font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none;
  border: 2px solid var(--edge); border-radius: 999px; padding: 3px 14px; background: var(--bg); }
.lang:hover { background: var(--soft); }
/* サイト内検索（上の帯の「探す」と、開く小窓。find.js）。スマホの帯は虫眼鏡だけ */
.find { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 14px; font-weight: 700;
  color: var(--ink); background: var(--bg); border: 2px solid var(--edge); border-radius: 999px; padding: 3px 14px 3px 10px; cursor: pointer; }
.find + .lang { margin-left: 0; }
.find:hover { background: var(--soft); }
.find svg, .finder svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.find:focus-visible, .lang:focus-visible, .finder-close:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 599px) {
  .bar { gap: 8px; padding: 10px 12px; }
  .find { padding: 3px 8px; }
  .find span { display: none; }
}
@media (max-width: 399px) {   /* 幅360pxでも、英語の名前（Marusuke's Naruhodo Lab）が1行に収まるように */
  .brand { gap: 6px; font-size: 14px; line-height: 1.3; letter-spacing: -.01em; }
  .lang { padding: 3px 9px; }
}
.finder { width: min(720px, calc(100% - 24px)); max-width: none; max-height: none; margin: 14px auto auto; padding: 0; overflow: visible;
  color: var(--ink); background: var(--card); border: 3px solid var(--edge); border-radius: 14px; box-shadow: 5px 5px 0 var(--edge); }
.finder::backdrop { background: rgba(21,26,43,.5); }
html:has(.finder[open]) { overflow: hidden; }   /* 小窓の後ろのページを動かさない */
.finder-in { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); padding: 14px 14px 6px; }
.finder-top { flex: none; display: flex; align-items: center; gap: 6px; }
.finder form { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px; color: var(--ink2);
  background: var(--bg); border: 2px solid var(--edge); border-radius: 10px; }
.finder form:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.finder form > svg { flex: none; width: 18px; height: 18px; }
.finder input { flex: 1; min-width: 0; padding: 9px 0; border: 0; outline: none; background: transparent; color: var(--ink);
  font: inherit; font-size: 17px; }   /* 16px より小さいと、iPhone が欄を押したときに画面を拡大する */
.finder-close { all: unset; flex: none; padding: 8px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink2); }
.finder-close:hover { background: var(--gray); }
.finder-msg { flex: none; font-size: 14px; color: var(--ink2); margin: 10px 2px 8px; }
.finder-list { list-style: none; padding: 0 2px 4px; margin: 0; overflow-y: auto; min-height: 0; }
.finder-list a { display: block; margin-bottom: 8px; padding: 8px 12px; color: var(--ink); text-decoration: none;
  background: var(--card); border: 2px solid var(--edge); border-radius: 10px; }
.finder-list a:hover, .finder-list a:focus-visible { background: var(--soft); outline: none; }
.finder .ft { display: block; font-weight: 700; line-height: 1.6; }
.finder .fs { display: block; margin-top: 3px; font-size: 14px; line-height: 1.7; color: var(--ink2); overflow-wrap: anywhere; }
.finder .fl { display: inline-block; margin-right: 6px; padding: 0 8px; font-size: 12px; font-weight: 700; line-height: 1.6; color: #fff;
  background: var(--badge-gray); border-radius: 999px; }
.finder mark { padding: 0 1px; border-radius: 3px; font-weight: 700; color: var(--accent-ink); background: var(--soft); }
.finder-list a:hover mark, .finder-list a:focus-visible mark { background: var(--card); }
main { max-width: 720px; margin: 0 auto; padding: 12px 18px 40px; }
.crumb { font-size: 13px; color: var(--ink2); margin: 6px 0 0; }
.crumb a { color: var(--ink2); }
h1 { font-size: 26px; line-height: 1.45; margin: 8px 0 10px; letter-spacing: .01em; }
h2 { font-size: 20px; margin: 36px 0 12px; }
h3 { font-size: 17px; margin: 22px 0 6px; }
/* 記事の見出しの前のアイコン（丸いバッジ。枠は動画とカードと同じこげ茶） */
h2.sec { display: flex; align-items: center; gap: 10px; }
.ico { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--soft); border: 2px solid var(--edge); color: var(--accent-ink); }
.ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
hr { border: 0; border-top: 2px solid var(--edge); opacity: .25; margin: 40px 0 24px; }
/* 題と日付の行のまとまりを、本文と線で分ける（2026-10-31、利用者「すこし上下がつまってないかな？」。TA619） */
.meta { font-size: 13px; color: var(--ink2); margin: 0 0 22px; padding-bottom: 12px;
  border-bottom: 2px solid color-mix(in srgb, var(--ink2) 30%, transparent); }
.meta span { display: inline-block; }   /* 項目の途中で折れない */
.preview { font-size: 14px; font-weight: 700; color: #fff; background: var(--ink2); border-radius: 8px; padding: 6px 12px; margin: 10px 0 0; }
.hook p { margin: 0 0 14px; font-size: 17.5px; }   /* 段落の間は行の間より広く（6px では1つの塊に見えた） */
.hook p:last-of-type { font-weight: 800; font-size: 19px; margin-bottom: 12px; }
.hook figure { margin: 0 0 4px; }
.card { position: relative; background: var(--card); border: 3px solid var(--edge); border-radius: 14px;
  box-shadow: 5px 5px 0 var(--edge); padding: 14px 18px; margin: 18px 0 26px; }
.card h2 { margin: 0 0 6px; }
.tag { display: inline-block; font-size: 13px; font-weight: 800; color: #fff; background: var(--badge);
  border-radius: 999px; padding: 2px 12px; letter-spacing: .04em; }
.tag.gray { background: var(--badge-gray); }
.answer p { margin: 0 0 10px; font-size: 17.5px; }
.answer p:last-of-type { margin-bottom: 0; }
.answer .naru { float: right; width: 64px; height: auto; margin: -4px -6px 4px 10px; transform: scaleX(-1); }
.answer::after { content: ""; display: block; clear: both; }
.myth .wrong { font-size: 18px; font-weight: 700; color: var(--ink2); margin: 6px 0 8px; }
.myth .x { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--badge);
  color: #fff; font-size: 15px; margin-right: 6px; vertical-align: 2px; }
.myth p { margin: 0 0 10px; }
figure { margin: 0 0 22px; }
figure img, .video img { display: block; width: 100%; height: auto; border: 3px solid var(--edge); border-radius: 10px; }
figcaption { font-size: 15px; color: var(--ink2); margin-top: 6px; line-height: 1.7; }
/* 図は押すと大きな絵が開く。右上の印で、押せると分かるようにする */
figure .zoom { display: block; position: relative; }
figure .zoom-ico { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; background: rgba(35,49,90,.78); color: #fff; }
.zoom-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.video { position: relative; aspect-ratio: 16 / 9; }
.video button { all: unset; cursor: pointer; display: block; position: relative; }
/* 再生の札は右下（サムネイルの真ん中の大事な字を隠さない）。白い字と赤の地は 4.69 */
.video .play { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; height: 42px;
  padding: 0 14px 0 12px; border-radius: 12px; background: #e1251b; color: #fff; font-size: 16px; font-weight: 800;
  font-variant-numeric: tabular-nums; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.video .play svg { width: 18px; height: 18px; fill: #fff; }
.video button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 12px; }
.video iframe { width: 100%; height: 100%; border: 3px solid var(--edge); border-radius: 10px; }
details { background: var(--card); border: 2px solid var(--edge); border-radius: 10px; margin: 0 0 10px; padding: 0 14px; }
summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
details p { margin: 0 0 12px; }
.chapters { margin-top: 12px; }
.chapters ol { list-style: none; padding: 0; margin: 0 0 10px; }
.chapters a { display: block; text-decoration: none; color: var(--ink); padding: 3px 0; font-size: 15px; }
.chapters .t { display: inline-block; width: 48px; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
/* 動画の台本の全文（字幕から。チャプターごとの見出し） */
.script h3 { font-size: 15.5px; margin: 16px 0 6px; }
.script h3 .t { display: inline-block; width: 48px; color: var(--accent-ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.script .line { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); gap: 8px; font-size: 15.5px; line-height: 1.75; margin: 0 0 8px; }
:lang(en) .script .line { grid-template-columns: 4em minmax(0, 1fr); }
.script .who { color: var(--ink2); font-size: 12.5px; font-weight: 700; padding-top: .25em; }
.script .say { min-width: 0; overflow-wrap: anywhere; }
/* 所長の言葉は吹き出しの形（Tの台本の欄と同じ。色だけに頼らず、形と話し手の欄でも分かる） */
.script .maru .who { color: var(--accent-ink); }
.script .maru .say { justify-self: start; padding: 1px 12px; border: 2px solid var(--accent); border-radius: 14px; background: var(--soft); color: var(--accent-ink); font-weight: 700; }
/* 持ち帰る一言：PCは絵の右に札と文。スマホは絵と札を上に並べ、文を横幅いっぱいに（細長く折れないため） */
.take { display: grid; grid-template-columns: 72px minmax(0, 1fr); grid-template-areas: "img tag" "img text";
  column-gap: 14px; row-gap: 4px; align-items: center; background: var(--soft); }
.take img { grid-area: img; width: 72px; height: auto; }
.take .tag { grid-area: tag; justify-self: start; align-self: end; }
.take p { grid-area: text; align-self: start; margin: 0; font-size: 18px; font-weight: 700; line-height: 1.7; }
@media (max-width: 599px) {
  .take { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "img tag" "text text"; row-gap: 8px; }
  .take img { width: 40px; }
  .take .tag { align-self: center; }
}
.sources, .next { padding-left: 20px; }
.sources li { font-size: 14.5px; margin-bottom: 6px; line-height: 1.6; }
.note { font-size: 14px; color: var(--ink2); background: var(--gray); border-radius: 10px; padding: 10px 14px; }
.next { list-style: none; padding: 0; }
.next li { margin-bottom: 10px; }
.next a { display: block; background: var(--card); border: 2px solid var(--edge); border-radius: 10px; padding: 10px 14px;
  font-weight: 700; color: var(--ink); text-decoration: none; line-height: 1.6; }
.next a::after { content: " →"; color: var(--accent-ink); }
.hero { text-align: center; margin: 18px 0 8px; }
.hero img { border-radius: 50%; }
.hero h1 { font-size: 28px; }
/* 言葉の切れ目（<wbr>）でだけ折る */
.phrase { word-break: keep-all; overflow-wrap: anywhere; }
.hero p { margin: 0 0 10px; }
.small { font-size: 14px; color: var(--ink2); }
.button { display: inline-block; padding: 10px 18px; border-radius: 8px; background: var(--badge); color: #fff; text-decoration: none; font-weight: 700; }
/* スマホのトップは紹介を詰めて、最初の画面に記事が見えるようにする */
@media (max-width: 599px) {
  .hero { margin: 10px 0 4px; }
  .hero img { width: 64px; height: 64px; }
  .hero h1 { font-size: 23px; margin: 4px 0 6px; }
  .hero p { font-size: 15px; line-height: 1.7; margin: 0 0 8px; }
  .hero .button { padding: 8px 16px; font-size: 15px; }
}
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } }   /* 広い画面は2列（3列だとカードの題とサムネイルの字が小さい。2026-10-30、利用者） */
.cards a { display: block; background: var(--card); border: 3px solid var(--edge); border-radius: 12px; box-shadow: 4px 4px 0 var(--edge);
  overflow: hidden; color: var(--ink); text-decoration: none; }
.cards img { display: block; width: 100%; height: auto; border-bottom: 3px solid var(--edge); }
.cards span { display: block; padding: 10px 12px; font-weight: 700; line-height: 1.6; }
footer { text-align: center; font-size: 13px; color: var(--ink2); padding: 20px 16px 32px; border-top: 3px solid var(--edge); background: var(--card); }
footer a { color: var(--ink2); }
/* PCでは少し広く（1行は約46字まで。長すぎると行の頭に戻るとき目が迷う。2026-10-30、利用者「PCで見てるけど、幅が狭くないかな」） */
@media (min-width: 900px) {
  body { font-size: 18px; }
  main { max-width: 880px; }
}
