/* Skillbase（仮） ゴシック雑誌型。左レール＋本文の誌面グリッド。ビルドなし素CSS */
:root {
  --paper: #fbfbf9;
  --paper-tint: #f1f2ec;
  --ink: #17181a;
  --ink-soft: #4c4f52;
  --ink-faint: #8b8e90;
  --hairline: #dcddd8;
  --accent: #0b6b3f;
  --accent-tint: #e3efe6;
  --code-bg: #17181a;
  --code-ink: #c2c8ce;
  --sans: "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  /* 旧テンプレ互換: 明朝廃止によりゴシックへ集約 */
  --serif: var(--sans);
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

/* 日本語見出しの改行品質: 文節単位で折り返し、行長のバランスを取る。
   中途半端な位置での折り返し（「変わ/ったか」等）は手組みなら直す箇所で、放置するとAIくささの一因になる。
   auto-phraseはChromium系のみ対応。非対応ブラウザは通常改行になるだけで害はない */
h1, h2, h3,
.toc-list .t,
.wiki-terms a,
.lead-def {
  word-break: auto-phrase;
}
h1, h2,
.featured-skill h3,
.trend-card h3 {
  text-wrap: balance;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

.visually-hidden-input-label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===== ヘッダー ===== */
.site-header { border-bottom: 1px solid var(--hairline); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.logo { font-size: 1.05rem; font-weight: 900; letter-spacing: -0.02em; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.logo::before { content: ""; width: 12px; height: 12px; background: var(--accent); display: inline-block; }
.logo .tag { font-size: 0.62rem; color: var(--ink-faint); font-weight: 400; }
.site-header nav ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin: 0; padding: 0; font-size: 0.84rem; font-weight: 600; }
.site-header nav a { color: var(--ink-soft); white-space: nowrap; transition: color 0.2s; }
.site-header nav a:hover { color: var(--accent); }

/* ===== 題字ブロック（左寄せ・非対称） ===== */
.masthead { padding: 48px 0 0; }
.masthead .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 4px solid var(--ink); }
.masthead h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.masthead h1::before { content: ""; width: 0.55em; height: 0.55em; background: var(--accent); display: inline-block; transform: translateY(-0.06em); }
.masthead h1 .tag { font-size: 0.85rem; color: var(--ink-faint); font-weight: 500; letter-spacing: 0; }
.masthead .mast-side { text-align: right; font-size: 0.78rem; color: var(--ink-soft); line-height: 1.9; }
.masthead .mast-side strong { display: block; font-size: 0.85rem; color: var(--ink); font-weight: 700; }

/* ===== 誌面グリッド: 左レール＋本文 ===== */
.front-grid { display: grid; grid-template-columns: 190px 1fr; gap: 64px; align-items: start; padding: 40px 0 0; }
.rail { position: sticky; top: 20px; }
.rail .rail-label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.22em; color: var(--ink-faint); margin: 0 0 14px; }
.rail ol { list-style: none; margin: 0 0 32px; padding: 0; }
.rail li { border-top: 1px solid var(--hairline); }
.rail li:last-child { border-bottom: 1px solid var(--hairline); }
.rail a { display: block; padding: 10px 2px; font-size: 0.84rem; font-weight: 700; color: var(--ink-soft); transition: color 0.15s, padding-left 0.2s; }
.rail a:hover { color: var(--accent); padding-left: 8px; }
.rail .rail-note { font-size: 0.72rem; color: var(--ink-faint); line-height: 1.9; margin: 0; }

/* ===== セクション共通 ===== */
.front-main { min-width: 0; }
.front-main section { padding: 0 0 64px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px; }
.section-head::before { content: ""; width: 14px; height: 14px; background: var(--ink); align-self: center; }
.section-head.alt::before { background: var(--accent); }
.section-head h2 { font-size: 1.45rem; font-weight: 900; letter-spacing: -0.01em; margin: 0; }

/* 帯セクション（意図的にリズムを崩す別扱い） */
.front-main section.band { background: var(--paper-tint); padding: 34px 32px 40px; margin-bottom: 64px; }
.front-main section.band .trend-card { background: var(--paper); }

/* 編集後記 */
.postscript p { max-width: 42em; font-size: 0.95rem; color: var(--ink-soft); margin: 0 0 10px; text-align: justify; }
.postscript .ps-date { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); }
.section-head .more { margin-left: auto; font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.section-note { font-size: 0.76rem; color: var(--ink-faint); margin: 12px 0 0; }

/* ===== 一面リード ===== */
.front-lead { border-bottom: 1px solid var(--hairline); margin-bottom: 48px; }
.front-lead .lead-inner { display: grid; grid-template-columns: 3fr 2fr; gap: 48px; align-items: start; padding-bottom: 48px; }
.kicker-label, .featured-skill p.kicker-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: #fff;
  background: var(--accent);
  padding: 4px 12px;
  margin: 0 0 18px;
}
.front-lead h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
.front-lead h2 a:hover { color: var(--accent); }
.front-lead .lede { font-size: 0.98rem; color: var(--ink-soft); margin: 0 0 24px; text-align: justify; }
.read-more { font-size: 0.88rem; font-weight: 700; color: var(--accent); border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.read-more:hover { opacity: 0.65; }

.lead-figure { margin: 0; }
.hero-code { background: var(--code-bg); overflow: hidden; font-family: var(--mono); font-size: 0.76rem; line-height: 1.7; }
.hero-code .code-bar { padding: 9px 14px; border-bottom: 1px solid rgba(255,255,255,0.1); color: #79828b; font-size: 0.7rem; }
.hero-code pre { margin: 0; padding: 16px 18px; overflow-x: auto; color: var(--code-ink); }
.hero-code .k { color: #5fd692; }
.hero-code .s { color: #d3b06e; }
.hero-code .c { color: #6a737c; }
.lead-figure figcaption { font-size: 0.74rem; color: var(--ink-faint); margin-top: 10px; line-height: 1.7; }

/* 今週のSkill（リード右の囲み） */
.featured-skill { border: 2px solid var(--ink); padding: 24px 26px; background: var(--paper); }
.featured-skill h3 { font-size: 1.25rem; font-weight: 900; margin: 0 0 4px; line-height: 1.5; }
.featured-skill .slug { font-family: var(--mono); font-size: 0.74rem; color: var(--accent); display: block; margin-bottom: 12px; }
.featured-skill p { margin: 0 0 16px; font-size: 0.86rem; color: var(--ink-soft); }
.featured-skill .hero-code { margin-bottom: 14px; }
.featured-skill .read-more { font-size: 0.84rem; }

/* ===== 記事索引 ===== */
.index-list { list-style: none; margin: 0; padding: 0; }
.index-list li { border-bottom: 1px solid var(--hairline); }
.index-list a, .index-list .pending { display: grid; grid-template-columns: 7em 1fr; gap: 20px; padding: 20px 4px; align-items: baseline; }
.index-list a { transition: background 0.2s; }
.index-list a:hover { background: var(--paper-tint); }
.index-list .date { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint); }
.index-list h3 { font-size: 1.06rem; font-weight: 800; margin: 0 0 4px; line-height: 1.7; }
.index-list a:hover h3 { color: var(--accent); }
.index-list p { margin: 0; font-size: 0.84rem; color: var(--ink-soft); }
.index-list .pending h3 { color: var(--ink-soft); }
.index-list .pending p { color: var(--ink-faint); }

/* ===== 話題のSkill: 横スクロールのカード帯 ===== */
.trend-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 46%);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 18px;
  margin: 0 -4px;
}
.trend-card {
  scroll-snap-align: start;
  border: 2px solid var(--ink);
  padding: 22px 24px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.2s;
}
.trend-card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--accent-tint), 6px 6px 0 1px var(--accent); }
.trend-card .src { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; color: var(--ink-faint); }
.trend-card h3 { font-size: 1.15rem; font-weight: 900; margin: 0; line-height: 1.5; }
.trend-card .by { font-size: 0.74rem; color: var(--ink-faint); margin: 0; }
.trend-card p { font-size: 0.85rem; color: var(--ink-soft); margin: 0; flex: 1; }
.trend-card .foot { font-size: 0.74rem; color: var(--accent); font-weight: 700; }

/* ===== 体系ガイド ===== */
.guide-box { display: grid; grid-template-columns: 2fr 3fr; gap: 44px; align-items: start; }
.guide-box .guide-intro p { margin: 0 0 18px; font-size: 0.92rem; color: var(--ink-soft); text-align: justify; }
.toc-list { list-style: none; margin: 0; padding: 0; counter-reset: chapter; }
.toc-list li { border-bottom: 1px solid var(--hairline); counter-increment: chapter; }
.toc-list li > a, .toc-list li > span { display: flex; gap: 14px; align-items: baseline; padding: 15px 4px; }
.toc-list li > a { transition: background 0.2s; }
.toc-list li > a:hover { background: var(--paper-tint); }
.toc-list li > a::before, .toc-list li > span::before {
  content: counter(chapter, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}
.toc-list .t { font-size: 1rem; font-weight: 800; line-height: 1.7; }
.toc-list a:hover .t { color: var(--accent); }
.toc-list .soon { font-size: 0.7rem; color: var(--ink-faint); margin-left: auto; white-space: nowrap; }
.toc-list li > span .t { color: var(--ink-soft); font-weight: 600; }

/* ===== Skill目録 ===== */
.skill-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.skill-entry { border-bottom: 1px solid var(--hairline); padding: 22px 4px; display: block; transition: background 0.2s; }
a.skill-entry:hover { background: var(--paper-tint); }
.skill-entry .slug { font-family: var(--mono); font-size: 0.72rem; color: var(--accent); display: block; margin-bottom: 2px; }
.skill-entry h3 { font-size: 1.1rem; font-weight: 900; margin: 0 0 6px; line-height: 1.7; }
a.skill-entry:hover h3 { color: var(--accent); }
.skill-entry p { margin: 0; font-size: 0.84rem; color: var(--ink-soft); }
.skill-entry .status { font-size: 0.7rem; color: var(--ink-faint); margin-top: 6px; display: block; }
.skill-entry .hero-code.mini { margin: 12px 0; font-size: 0.7rem; border-radius: 3px; }
.skill-entry .hero-code.mini .code-bar { padding: 7px 12px; font-size: 0.64rem; }
.skill-entry .hero-code.mini pre { padding: 12px 14px; }
a.skill-entry .hero-code.mini { transition: box-shadow 0.2s; }
a.skill-entry:hover .hero-code.mini { box-shadow: 4px 4px 0 var(--accent-tint), 4px 4px 0 1px var(--accent); }

/* ===== 用語集Wiki パネル ===== */
.wiki-panel { background: var(--paper-tint); padding: 32px 34px; }
.wiki-panel .wiki-lede { font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 22px; }
.wiki-terms { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: baseline; margin: 0 0 20px; }
.wiki-terms a {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.wiki-terms a:hover { color: var(--accent); }
.wiki-terms .minor { font-size: 0.95rem; font-weight: 700; border-bottom-width: 2px; border-color: var(--hairline); color: var(--ink-soft); }
.wiki-terms .minor:hover { border-color: var(--accent); }
.wiki-panel .more-link { font-size: 0.85rem; font-weight: 700; color: var(--accent); }

/* ===== コンテンツページの左メニュー（sidebar.php） ===== */
.page-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 56px;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}
.page-grid .page-main { min-width: 0; }
.page-grid .article-page .wrap { margin: 0; padding: 0; }
.side-rail { position: sticky; top: 20px; padding-top: 52px; }
.side-rail .rail-label { margin-top: 26px; }
.side-rail .rail-label:first-child { margin-top: 0; }
.side-rail .rail-dense a { padding: 6px 2px; font-size: 0.8rem; font-weight: 600; }
@media (max-width: 1000px) {
  .page-grid { grid-template-columns: 1fr; gap: 0; }
  .side-rail { position: static; padding-top: 28px; }
  .side-rail ol { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .side-rail li, .side-rail li:last-child { border: none; }
  .side-rail a { border: 1px solid var(--hairline); padding: 6px 14px; font-size: 0.78rem; }
  .side-rail a:hover { padding-left: 14px; }
  .side-rail a.active { padding-left: 14px; border-color: var(--accent); }
}

/* ===== FAQ ===== */
.faq-list { max-width: 720px; }
.faq-item { border-bottom: 1px solid var(--hairline); padding: 22px 0; }
.faq-item h3 { margin: 0 0 8px; font-size: 1.02rem; font-weight: 800; }
.faq-item p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }

/* ===== 記事ページ ===== */
.article-page { padding: 52px 0 76px; }
.article-page .wrap { max-width: 720px; }
.breadcrumb { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); margin: 0 0 32px; letter-spacing: 0.04em; }
.breadcrumb a { color: var(--ink-faint); }
.breadcrumb a:hover { color: var(--accent); }
.article-page h1 { font-size: clamp(1.6rem, 3.4vw, 2.15rem); font-weight: 900; line-height: 1.55; margin: 0 0 16px; letter-spacing: -0.01em; }
.article-meta { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-faint); margin: 0 0 40px; padding-bottom: 20px; border-bottom: 3px solid var(--ink); }
.article-body { font-size: 1rem; }
.article-body h2 { font-size: 1.3rem; font-weight: 900; margin: 54px 0 16px; padding-left: 14px; border-left: 5px solid var(--accent); line-height: 1.6; }
.article-body h3 { font-size: 1.06rem; margin: 34px 0 12px; font-weight: 800; }
.article-body p { margin: 0 0 22px; color: #2d2f31; text-align: justify; }
.article-body ul, .article-body ol { margin: 0 0 22px; padding-left: 1.6em; color: #2d2f31; }
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--ink); }
.article-body pre { background: var(--code-bg); color: var(--code-ink); padding: 18px 20px; overflow-x: auto; font-family: var(--mono); font-size: 0.8rem; line-height: 1.7; margin: 0 0 24px; }
.article-body code { font-family: var(--mono); font-size: 0.85em; background: var(--paper-tint); padding: 2px 6px; color: var(--accent); }
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body .lead-def { background: var(--accent-tint); padding: 20px 24px; margin: 0 0 36px; color: var(--ink); font-size: 0.96rem; }
.article-body .lead-def::before { content: "要点"; display: block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.3em; color: var(--accent); margin-bottom: 8px; }
.article-body .spec-table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 0.9rem; }
.article-body .spec-table th { text-align: left; font-weight: 700; padding: 12px 16px 12px 4px; border-bottom: 1px solid var(--hairline); white-space: nowrap; width: 9em; color: var(--ink-soft); }
.article-body .spec-table td { padding: 12px 4px; border-bottom: 1px solid var(--hairline); }
.article-nav { margin-top: 52px; padding-top: 20px; border-top: 3px solid var(--ink); font-size: 0.88rem; font-weight: 700; }
.article-nav a { color: var(--accent); }

/* Wiki用: 関連語 */
.wiki-related { margin-top: 40px; background: var(--paper-tint); padding: 22px 26px; }
.wiki-related h2 { font-size: 0.95rem; font-weight: 800; margin: 0 0 12px; }
.wiki-related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.wiki-related a { font-weight: 700; font-size: 0.9rem; color: var(--accent); }

/* 記事一覧ページ */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--hairline); }
.post-list a { display: block; padding: 24px 4px; transition: background 0.2s; }
.post-list a:hover { background: var(--paper-tint); }
.post-list .date { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint); display: block; margin-bottom: 6px; }
.post-list h3 { margin: 0 0 6px; font-size: 1.12rem; font-weight: 800; line-height: 1.7; }
.post-list a:hover h3 { color: var(--accent); }
.post-list p { margin: 0; color: var(--ink-soft); font-size: 0.86rem; }

/* ===== 共通エリア（購読） ===== */
.lead-capture { border-top: 4px solid var(--ink); padding: 68px 0; background: var(--paper-tint); }
.lead-capture .wrap { max-width: 640px; text-align: center; }
.lead-capture h2 { margin: 0 0 12px; font-size: 1.45rem; font-weight: 900; letter-spacing: -0.01em; }
.lead-capture > .wrap > p { color: var(--ink-soft); margin: 0 0 30px; font-size: 0.92rem; }
.lead-form { display: flex; gap: 0; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.lead-form input[type="email"] { padding: 13px 18px; border: 2px solid var(--ink); border-right: none; background: var(--paper); color: var(--ink); min-width: 280px; font-size: 0.95rem; }
.lead-form input[type="email"]::placeholder { color: var(--ink-faint); }
.lead-form input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.lead-form button { padding: 13px 28px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 800; cursor: pointer; font-size: 0.95rem; transition: background 0.2s, border-color 0.2s; }
.lead-form button:hover { background: var(--accent); border-color: var(--accent); }
.lead-note { font-size: 0.72rem; color: var(--ink-faint); margin: 0; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--hairline); padding: 34px 0; }
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.site-footer nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 22px; margin: 0; padding: 0; font-size: 0.8rem; font-weight: 600; }
.site-footer nav a { color: var(--ink-soft); }
.copyright { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint); margin: 0; }

/* ===== モーション設計「紙面が刷り上がる」 =====
   印刷物のメタファー（押印、罫引き、刷り出し）で演出を統一する。
   reduced-motion時は下の全域無効化（冒頭の *{animation:none}）が効くため個別対応不要 */

/* 題字: 緑の角判が押印され、太罫が左から引かれる（CSSのみ、JS不要） */
@media (prefers-reduced-motion: no-preference) {
  .masthead h1::before { animation: stamp-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both; }
  .masthead .wrap { border-bottom: none; position: relative; }
  .masthead .wrap::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
    background: var(--ink);
    transform-origin: left;
    animation: rule-draw 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
  }
  .masthead h1 { animation: rise-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .masthead .mast-side { animation: rise-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both; }
}
@keyframes stamp-in {
  from { transform: translateY(-0.06em) scale(0) rotate(-8deg); }
  to   { transform: translateY(-0.06em) scale(1) rotate(0); }
}
@keyframes rule-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* セクション見出しの■マーカー: 回転しながら定位置に収まる */
.motion-on .front-main section .section-head::before {
  transform: scale(0) rotate(90deg);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s;
}
.motion-on .front-main section.is-in .section-head::before { transform: scale(1) rotate(0); }

/* キッカーラベル: 緑帯が左からワイプして刷り出される */
.motion-on .front-lead .kicker-label {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
}
.motion-on .front-lead.is-in .kicker-label { clip-path: inset(0 0 0 0); }

/* SKILL.mdパネル: コードが段階的に印字され、カーソルが明滅（AIがSkillを書いている暗喩） */
.motion-on .front-lead .hero-code pre {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1s steps(8, end) 0.55s;
}
.motion-on .front-lead.is-in .hero-code pre { clip-path: inset(0 0 0 0); }
.motion-on .front-lead .hero-code pre::after {
  content: "▍";
  color: #5fd692;
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* 左レールINDEX: スクロール位置に追従して現在地が点灯（motion.jsのスクロールスパイ） */
.rail a { transition: color 0.2s, padding-left 0.25s ease, font-weight 0s; }
.rail a.active { color: var(--accent); padding-left: 8px; font-weight: 800; }

/* ナビ: ホバーで下線が左から伸びる */
.site-header nav a { position: relative; }
.site-header nav a::after {
  content: "";
  position: absolute; left: 0; bottom: -4px; height: 2px; width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-header nav a:hover::after { transform: scaleX(1); }

/* ===== スクロール連動モーション（motion.jsがmotion-onを付与。reduced-motion時は付与されず即時表示） ===== */
.motion-on .front-main section,
.motion-on .trend-card,
.motion-on .article-page .article-body > h2,
.motion-on .wiki-terms a {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.motion-on .front-main section.is-in,
.motion-on .trend-card.is-in,
.motion-on .article-page .article-body > h2.is-in,
.motion-on .wiki-terms a.is-in {
  opacity: 1;
  transform: none;
}

/* ===== モバイル ===== */
@media (max-width: 1000px) {
  .front-grid { grid-template-columns: 1fr; gap: 0; }
  .rail { position: static; margin-bottom: 40px; }
  .rail ol { display: flex; flex-wrap: wrap; gap: 8px; border: none; margin-bottom: 12px; }
  .rail li, .rail li:last-child { border: none; }
  .rail a { border: 1px solid var(--hairline); padding: 6px 14px; font-size: 0.78rem; }
  .rail a:hover { padding-left: 14px; }
  .rail a.active { padding-left: 14px; border-color: var(--accent); }
  .rail .rail-note { display: none; }
}
@media (max-width: 860px) {
  .front-lead .lead-inner { grid-template-columns: 1fr; gap: 32px; }
  .skill-cols { grid-template-columns: 1fr; }
  .guide-box { grid-template-columns: 1fr; gap: 18px; }
  .index-list a, .index-list .pending { grid-template-columns: 1fr; gap: 4px; }
  .trend-strip { grid-auto-columns: 84%; }
  .masthead .wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
  .masthead .mast-side { text-align: left; }
  .site-header .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-direction: column; gap: 8px; }
  .site-header nav ul { gap: 14px; }
  .lead-form input[type="email"] { border-right: 2px solid var(--ink); min-width: 0; width: 100%; }
  .lead-form { gap: 10px; }
  .lead-form button { width: 100%; }
}
