/* =====================================================================
   おブログですわ — 共通スタイル
   このファイルはサイト全体で共有されます。色などを変えたいときはここを編集。
   ===================================================================== */

:root {
  --bg:        #f7f5ef;   /* 背景 */
  --surface:   #ffffff;   /* カード・パネルの面 */
  --text:      #2c2a26;   /* 本文の文字色 */
  --muted:     #7a756c;   /* 補足の文字色 */
  --accent:    #35688f;   /* アクセント色（リンク・ボタン）※夜の海に合う落ち着いた青 */
  --accent-dk: #274e6c;   /* アクセント色（濃いめ） */
  --border:    #e6e0d4;   /* 罫線 */
  --radius:    12px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  line-height: 1.85;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

/* ---------- ヘッダー ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--text);
}
.site-title:hover { text-decoration: none; color: var(--accent); }

.site-nav { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: .92rem;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
/* メニュー内の Labo（実験用スペース）リンク。ほかの項目と少し差をつける */
.btn--labo {
  background: linear-gradient(135deg, rgba(53, 104, 143, .12), rgba(159, 112, 255, .14));
  border-color: var(--accent);
  font-weight: 700;
}

/* ---------- レイアウト（本文 + サイドバー） ---------- */
.layout {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max-width);
  margin: 28px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 200px;   /* sidebar を細めにして content（＝画像）に幅を回す */
  gap: 8px;                    /* content と sidebar の間隔をさらに詰めて content を広げる */
  align-items: start;
}

.content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  min-width: 0;              /* グリッドの中身が中の要素（iframe等）より縮めなくなるのを防ぐ */
  overflow-wrap: break-word; /* 長いURLや英単語は折り返す */
}
.content h1 { margin-top: 0; font-size: 1.8rem; }
.content h2 { margin-top: 1.8em; border-bottom: 2px solid var(--border); padding-bottom: .3em; }
/* h3 は小さめ・黒（本文色）ではっきりと */
.content h3 { margin: 1.6em 0 .3em; font-size: 1.05rem; font-weight: 700; color: var(--text); }
/* h3 の横にちょこんと添える小言（ぼそっとした一言・小さめで控えめ） */
.content kogoto { margin-left: .4em; font-size: .78rem; font-weight: 400; color: var(--muted); vertical-align: baseline; }

/* 記事内の画像は白い枠で縁取りして見やすく（画面幅からはみ出さない） */
.content img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(44, 42, 38, .06);
}

/* 動画などの埋め込みも画面幅からはみ出さない */
.content iframe { max-width: 100%; }

/* コードはページ幅を広げず、ブロック内で横スクロールさせる */
.content pre { max-width: 100%; overflow-x: auto; }

/* ヒーロー（トップの見出し） */
.hero { text-align: center; padding: 24px 0 8px; }
.hero h1 { font-size: 2.1rem; margin-bottom: .3em; }

/* タイトルのタイプライター演出（カタカタ表示用のカーソル） */
.typewriter::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 4px;
  background: var(--accent);
  vertical-align: -0.12em;
  animation: caret-blink 1s steps(1) infinite;
}
/* 打ち終わったあとカーソルを消したい場合は、次の行のコメントを外してください */
/* .typewriter.is-done::after { display: none; } */
@keyframes caret-blink { 50% { opacity: 0; } }
.hero p { color: var(--muted); margin: 0 auto 20px; max-width: 36em; }
.hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- サイドバー ---------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar__block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.sidebar__title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

.article-list { list-style: none; margin: 0; padding: 0; }
.article-list__item + .article-list__item { border-top: 1px dashed var(--border); }
.article-list__item a { display: block; padding: 10px 4px; color: var(--text); }
.article-list__item a:hover { background: #faf7f0; text-decoration: none; border-radius: 6px; }
.article-list__date { display: block; font-size: .78rem; color: var(--muted); }
.article-list__title { display: block; font-size: .95rem; }
.article-list__empty { color: var(--muted); font-size: .9rem; padding: 8px 4px; }

/* ---------- 記事カード（一覧表示） ---------- */
.card-grid { display: grid; gap: 18px; }
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: #fffdf9;
}
.card__meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .82rem; }
.card__title { margin: 6px 0 8px; font-size: 1.2rem; }
.card__excerpt { margin: 0; color: var(--muted); }
.tag {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: .74rem;
}

/* ---------- いいねボタン（記事ページ：カテゴリの横） ---------- */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;          /* .tag と同じピル型 */
  background: transparent;
  color: var(--accent);
  font-size: .74rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, color .2s, transform .1s;
}
.like-btn:hover { background: rgba(53, 104, 143, .1); }
.like-btn:active { transform: scale(.94); }
.like-btn.is-liked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.like-btn__heart { line-height: 1; }
.like-btn.is-liked .like-btn__heart { animation: like-pop .35s ease; }
.like-btn__count { font-weight: 700; }
@keyframes like-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.6); }
  100% { transform: scale(1); }
}

/* ---------- フッター（累計アクセス数） ---------- */
.site-footer {
  position: relative;          /* ひ♡み♡つボタンを右下に置くための基準 */
  flex-shrink: 0;
  /* 背景の砂浜（.scene__beach）と同じ砂色にして、最下部でも境目を感じさせない */
  background: linear-gradient(180deg, #d4bd90 0%, #c2a771 55%, #b2955f 100%);
  color: var(--text);
  text-align: center;
  padding: 12px 20px;          /* 縦を小さめにして砂浜が隠れにくいように */
}

/* ---------- 【ひ♡み♡つ】ボタン ----------
   置き場所はフッター右下のまま（もとの「こっそりボタン」と同じ定位置）。
   ただし砂色に埋もれて気づかれないので、小ぶりなピル型にして
   ゆっくり脈動させ、スルーされないようにしています。 */
.secret-link {
  position: absolute;          /* フッター右下のいつもの定位置 */
  right: 12px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  font-size: .85rem;           /* 以前は .68rem（小さすぎた） */
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
  background: linear-gradient(135deg, #ff87ab 0%, #d94f7c 55%, #b83e6a 100%);
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(184, 62, 106, .40);
  text-decoration: none;
  opacity: 1;                  /* 以前は .4（ほぼ見えなかった） */
  animation: secret-pulse 2.2s ease-in-out infinite;
  transition: transform .2s ease, box-shadow .2s ease;
}
.secret-link:hover,
.secret-link:focus {
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 24px rgba(184, 62, 106, .65);
  animation-play-state: paused;   /* ホバー中は脈動を止めてピタッと止める */
}
@keyframes secret-pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 3px 10px rgba(184, 62, 106, .40); }
  50%      { transform: scale(1.04); box-shadow: 0 5px 16px rgba(184, 62, 106, .65); }
}
/* 画面が狭いときは copyright と重ならないよう、流れの中で右寄せにする */
@media (max-width: 560px) {
  .secret-link {
    position: static;
    display: flex;
    width: fit-content;
    margin: 10px 0 0 auto;
  }
}
/* 「動きを減らす」設定のときは脈動させない */
@media (prefers-reduced-motion: reduce) {
  .secret-link { animation: none; }
}
.access-count { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; }
.access-count span { font-weight: 800; color: var(--accent-dk); font-size: 1.25em; }
.copyright { margin: 0; font-size: .8rem; color: rgba(44, 42, 38, .6); }

/* ---------- 秘密ページ（謎解き） ---------- */
.layout--secret { grid-template-columns: 1fr; max-width: 720px; }
.puzzle {
  margin-top: 24px;
  padding: 22px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  background: #fffaf2;
  text-align: center;
}
.puzzle__riddle { font-weight: 700; margin-top: 0; }
.puzzle__form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.puzzle__input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  min-width: 180px;
}
.puzzle__result { min-height: 1.6em; margin-bottom: 0; font-weight: 700; }
.puzzle__result--ok { color: #2f7d32; }
.puzzle__result--ng { color: #b53030; }

/* ---------- マインスイーパー ---------- */
.ms { width: 100%; max-width: 340px; margin: 6px auto 0; }
.ms__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ms__stat { font-weight: 800; font-variant-numeric: tabular-nums; }
.ms__face {
  font-size: 1.3rem;
  line-height: 1;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: background .15s;
}
.ms__face:hover { background: #faf3e8; }
.ms__board {
  display: grid;
  grid-template-columns: repeat(var(--ms-cols, 9), 1fr);
  gap: 3px;
  padding: 3px;
  background: var(--border);
  border-radius: 8px;
}
.ms__cell {
  aspect-ratio: 1;
  width: 100%;
  padding: 0;
  border: 1px solid #d8cfbe;
  border-radius: 5px;
  background: #efe7d6;          /* 未開放のマス */
  color: var(--text);
  font-size: clamp(.85rem, 4vw, 1rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background .1s;
}
.ms__cell:hover { background: #e6dcc6; }
.ms__cell.is-open {
  background: #fffaf2;          /* 開いたマス */
  border-color: var(--border);
  cursor: default;
}
.ms__cell.is-mine { background: #ffe0e0; border-color: #e6b8b8; }
.ms__hint { color: var(--muted); font-size: .8rem; margin: 12px 0 0; }

/* 数字の色（定番配色） */
.ms__cell[data-n="1"] { color: #1976d2; }
.ms__cell[data-n="2"] { color: #388e3c; }
.ms__cell[data-n="3"] { color: #d32f2f; }
.ms__cell[data-n="4"] { color: #512da8; }
.ms__cell[data-n="5"] { color: #8d3b1f; }
.ms__cell[data-n="6"] { color: #00838f; }
.ms__cell[data-n="7"] { color: #455a64; }
.ms__cell[data-n="8"] { color: #757575; }

/* クリアすると現れる「次の画面」 */
.secret-next {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: #fffaf2;
  text-align: center;
  animation: secret-fade .4s ease-out;
}
.secret-next h2 { margin-top: 0; border: none; padding: 0; }
@keyframes secret-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 背景の情景（夜空・海・砂浜） ----------
   .scene は site.js が <body> の先頭に差し込みます（secret/ では出しません）。
   すべてのコンテンツの背面（z-index:-1）に固定表示します。 */
.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;        /* 背景なので操作を妨げない */
}

/* 夜空のグラデーション */
.scene__sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    #060a1a 0%,
    #0a1030 34%,
    #142049 60%,
    #22335d 80%,
    #34496f 100%);
}

  /* 文字の打ち消し線（CSS で二重線にする） */
.double-line {
  text-decoration-line: line-through;
  text-decoration-style: double;
}


/* 月とそのぼんやりした光 */
.scene__moon {
  position: absolute;
  top: 11%;
  right: 12%;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #fffef5 0%, #f4ecd0 55%, #e5d7ad 100%);
  box-shadow:
    0 0 24px 6px rgba(255, 249, 224, .45),
    0 0 70px 24px rgba(224, 214, 176, .28);
}

/* 星（site.js が .star を敷き詰めます） */
.scene__stars { position: absolute; top: 0; left: 0; right: 0; height: 66%; }
.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  opacity: .8;
  animation: star-twinkle var(--dur, 3s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes star-twinkle {
  0%, 100% { opacity: .18; transform: scale(.6); }
  50%      { opacity: 1;   transform: scale(1); }
}

/* 海 */
.scene__sea {
  position: absolute;
  left: 0; right: 0;
  top: 68%;
  bottom: 9%;
  overflow: hidden;
  background: linear-gradient(180deg, #16294f 0%, #0c1a35 60%, #0a1428 100%);
}
/* 水面のさざ波（うっすら流れる光の線） */
.scene__sea::after {
  content: "";
  position: absolute;
  left: -50%; right: -50%; top: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0)   0px,
    rgba(255,255,255,0)   8px,
    rgba(180,205,255,.05) 9px,
    rgba(180,205,255,.05) 10px);
  animation: sea-ripple 7s linear infinite;
}
@keyframes sea-ripple {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}
/* 月あかりの水面反射（月の真下に丸く映り、水面でゆらめく） */
.scene__moonlight {
  position: absolute;
  top: 4%;             /* 水平線のすぐ下 */
  right: 12%;          /* 月と同じ水平位置に合わせる */
  width: 72px;
  height: 62px;        /* 水面なので少し平たい円 */
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%,
    rgba(255,252,235,.75) 0%,
    rgba(255,249,224,.40) 42%,
    rgba(255,249,224,.12) 66%,
    rgba(255,249,224,0)   100%);
  filter: blur(3px);
  animation: moonlight-shimmer 4.5s ease-in-out infinite;
}
@keyframes moonlight-shimmer {
  0%, 100% { opacity: .8; transform: scale(1,    1);   }
  50%      { opacity: 1;  transform: scale(1.10, 0.9); }
}

/* 砂浜 */
.scene__beach {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 9%;
  background: linear-gradient(180deg, #d4bd90 0%, #c2a771 55%, #b2955f 100%);
}
/* 波打ち際の白い泡 */
.scene__beach::before {
  content: "";
  position: absolute;
  top: -3px; left: 0; right: 0;
  height: 7px;
  background: rgba(255,255,255,.55);
  filter: blur(2px);
  animation: foam-lap 5s ease-in-out infinite;
}
@keyframes foam-lap {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50%      { opacity: .70; transform: translateY(-2px); }
}

/* 流れ星（site.js がときどき生成） */
.scene__shooting { position: absolute; inset: 0; }
.shooting-star {
  position: absolute;
  width: 0; height: 0;
  animation: shoot var(--sdur, 900ms) ease-in forwards;
}
.shooting-star__streak {
  display: block;
  width: 130px; height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.95) 100%);
  border-radius: 2px;
  filter: drop-shadow(0 0 6px rgba(255,255,255,.85));
}
@keyframes shoot {
  0%   { transform: rotate(var(--ang, 25deg)) translateX(0);                    opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: rotate(var(--ang, 25deg)) translateX(var(--dist, 320px));   opacity: 0; }
}

/* 動きを減らす設定のときは瞬き・波を止める */
@media (prefers-reduced-motion: reduce) {
  .star, .scene__sea::after, .scene__moonlight, .scene__beach::before { animation: none; }
  .star { opacity: .7; }
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 20px; }
  .sidebar { order: 2; }
}

/* スマホ幅：余白を詰めて本文の幅をしっかり確保する */
@media (max-width: 600px) {
  .layout { margin: 16px auto; padding: 0 12px; }
  .content { padding: 20px 14px; }
  .content h1 { font-size: 1.4rem; line-height: 1.45; }
  .content h2 { font-size: 1.15rem; }
  .site-header__inner { padding: 10px 12px; gap: 8px; }
  .site-title { font-size: 1.15rem; }
  .site-nav { gap: 6px; }
  .btn { padding: 6px 11px; font-size: .8rem; }
  .hero { padding: 12px 0 4px; }
  .hero h1 { font-size: 1.5rem; }
  .sidebar__block { padding: 14px; }
}

/* ハンバーガーアイコンの外側 */
#header .hamburger {
    /* ボタン全体サイズを50pxの正方形に設定 */
    width: 50px;
    height: 50px;
    /* マウスポインターを指に変更 */
    cursor: pointer;
    position: fixed;
    top: 5px;
    right: 10px;
    /* 優先度を変更 */
    z-index: 30;
  }

/* ハンバーガーアイコンの内側の線 */
#header .hamburger span {
    /* ボタン横線の長さと高さを設定 */
    width: 30px;
    height: 3px;
    background-color: #232323;
    /* 絶対位置指定（親は.hamburger） */
    position: absolute;
    left: 10px;
    /* ボタンが押されてXに切り替わるときの動作設定 */
    transition: all 0.3s;
  }

/* ハンバーガーメニュー3本の線の縦の位置を設定 */
#header .hamburger span:nth-of-type(1) {
    top: 16px;
  }
#header .hamburger span:nth-of-type(2) {
    top: 25px;
  }
#header .hamburger span:nth-of-type(3) {
    top: 34px;
  }
  /* メニューの外側を設定 */
#header .nav {
    /* メニュー開いた時の幅を設定 */
    width: 80%;
    /* メニュー開いた時の高さを設定（画面いっぱいに広げる） */
    height: 100vh;
    position: fixed;
    top: 0;
    right: -80%;
    z-index: 20;
    /* スライド表示する際の速度を設定 */
    transition: all 0.6s;
  }

/* メニュー内の設定 */
#header .nav ul {
    width: 100%;
    height: 100vh;
    /* メニューを縦並びにオーバーライド */
    flex-direction: column;
    /* 上下の高さを設定 */
    padding: 60px 0;
    overflow: auto;
    /* 要素同士の余白をオーバーライド */
    gap: 16px;
    text-align: center;
  }

  /* ボタンを押した際の動作を作成 */
#header .nav.active {
    right: 0;
}

/* ボタンをXにするCSS */
#header .hamburger.active span:nth-of-type(1) {
    top: 22px;
    transform: rotate(-45deg);
}
#header .hamburger.active span:nth-of-type(2) {
    opacity: 0;
}
#header .hamburger.active span:nth-of-type(3) {
    top: 22px;
    transform: rotate(45deg);
}

/* ---------- 記事内デモ：ハンバーガーメニューを中央に出す枠 ---------- */
/* .hb-demo の枠を「画面」に見立て、本文の真ん中に置く。
   中のメニューはこの枠を基準に動くので、記事の中で完結して開閉できる。 */
.hb-demo {
    position: relative;          /* 中のメニューをこの枠を基準に配置する */
    width: 100%;
    max-width: 400px;
    height: 220px;
    margin: 25px auto;          /* ← 左右 auto で本文の中央にくる */
    border: 3px dashed #871010;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;            /* 枠からはみ出したメニューを隠す */
}

.hb-demo .hamburger {
    width: 50px;
    height: 50px;
    position: absolute;          /* 枠(.hb-demo)の右上に配置 */
    top: 8px;
    right: 10px;
    cursor: pointer;
    z-index: 3;
}
.hb-demo .hamburger span {
    width: 30px;
    height: 3px;
    background-color: #232323;
    position: absolute;
    left: 10px;
    transition: all 0.3s;
}
.hb-demo .hamburger span:nth-of-type(1) { top: 16px; }
.hb-demo .hamburger span:nth-of-type(2) { top: 25px; }
.hb-demo .hamburger span:nth-of-type(3) { top: 34px; }

.hb-demo .nav {
    position: absolute;
    top: 0;
    right: -100%;                /* ふだんは枠の外（右）に隠しておく */
    width: 70%;
    height: 100%;
    background: #c10000;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.08);
    transition: right 0.5s;      /* スライドの速さ */
    z-index: 2;
}
.hb-demo .nav ul {
    list-style: none;
    margin: 0;
    padding: 56px 0 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: center;
}
.hb-demo .nav.active { right: 0; }   /* 開いたら枠の中へスライドイン */

/* ボタンを×印に変える */
.hb-demo .hamburger.active span:nth-of-type(1) { top: 22px; transform: rotate(-45deg); }
.hb-demo .hamburger.active span:nth-of-type(2) { opacity: 0; }
.hb-demo .hamburger.active span:nth-of-type(3) { top: 22px; transform: rotate(45deg); }

/* ---------- ヘッダーのハンバーガー（二刀流アイコン） ---------- */
/* デモ(.hb-demo .hamburger)をベースに、右上固定＋剣風の装飾を加えたもの。
   ・上の線 … 左から1/4の位置に ▶（右向きのまま）
   ・下の線 … 右から1/4の位置に ◀（左向きのまま）
   ・✖のとき … 上下の線が回転して交差し、二刀流の剣がクロスして見える */
.nav-toggle {
  position: fixed;
  /* ヘッダーの実測高さ(--header-h, site.js が設定)を基準に上下中央へ。
     ヘッダーの高さは端末で変わるため、固定値の top では中心がずれる。 */
  top: calc((var(--header-h, 76px) - 52px) / 2);
  right: 16px;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 50;                 /* ドロワー(40)・暗幕(35)より前面 */
}

/* 三本線（＝剣の刃） */
.nav-toggle span {
  position: absolute;
  left: 11px;                  /* 30px幅を52pxの中央に */
  width: 30px;
  height: 3px;
  background-color: var(--text);
  border-radius: 2px;
  transition: top .35s, transform .35s, opacity .2s;
}
.nav-toggle span:nth-of-type(1) { top: 17px; }
.nav-toggle span:nth-of-type(2) { top: 25px; }
.nav-toggle span:nth-of-type(3) { top: 33px; }

/* 三角（＝剣の鍔）。
   文字の ▶ / ◀ は端末ごとに使われるフォントが変わり、字形の高さも
   ベースラインも違うため位置がずれる。border で描けばフォントが
   関係しない純粋な図形になり、どの端末でも寸法が一致する。 */
.nav-toggle span:nth-of-type(1)::before,
.nav-toggle span:nth-of-type(3)::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;     /* 三角の高さ＝5+5＝10px */
  border-bottom: 5px solid transparent;
  transform: translate(-50%, -50%);      /* 線の中央にぴったり重ねる */
}
/* 上の線：左から1/4の切れ目に ▶（右向き） */
.nav-toggle span:nth-of-type(1)::before {
  left: 25%;                   /* 4分割の左から1番目の切れ目 */
  border-left: 8px solid var(--text);
}
/* 下の線：右から1/4（左から3/4）の切れ目に ◀（左向き） */
.nav-toggle span:nth-of-type(3)::before {
  left: 75%;                   /* 4分割の右から1番目の切れ目 */
  border-right: 8px solid var(--text);
}

/* ✖（開いた状態）＝二刀流の剣がクロス */
.nav-toggle.active span:nth-of-type(1) { top: 25px; transform: rotate(-45deg); }
.nav-toggle.active span:nth-of-type(2) { opacity: 0; }
.nav-toggle.active span:nth-of-type(3) { top: 25px; transform: rotate(45deg); }

/* ---------- スライド式メニュー（右から出るドロワー） ---------- */
.site-nav--drawer {
  position: fixed;
  top: 0;
  right: -80%;                 /* ふだんは画面の外（右）に隠す */
  width: min(80%, 300px);
  height: 100vh;
  flex-direction: column;      /* .site-nav の flex を縦並びに上書き */
  justify-content: center;
  gap: 14px;
  padding: 80px 26px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 24px rgba(44, 42, 38, .14);
  transition: right .45s ease; /* スライドの速さ */
  z-index: 40;
  overflow-y: auto;
}
.site-nav--drawer.active { right: 0; }   /* 開いたら画面内へ */
.site-nav--drawer .btn {
  display: block;
  text-align: center;
  font-size: 1rem;
  padding: 12px 16px;
}

/* 背景の暗幕 */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 15, .38);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility .4s;
  z-index: 35;
}
.nav-overlay.active { opacity: 1; visibility: visible; }

/* 展開メニューの一番下ゾーン（三分割の下1/3）に薄い波アニメーション */
.site-nav--drawer::before,
.site-nav--drawer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 33%;                 /* ドロワーを三分割した一番下のゾーン */
  pointer-events: none;        /* リンク操作の邪魔をしない */
  z-index: 0;                  /* リンクより後ろ */
  background-repeat: repeat-x;
  background-position: 0 bottom;
}
/* 奥の波：ゆっくり・うすめ（右へ流れる） */
.site-nav--drawer::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 40' preserveAspectRatio='none'%3E%3Cpath d='M0 15 Q30 5 60 15 T120 15 V40 H0 Z' fill='%2384b5d5'/%3E%3C/svg%3E");
  background-size: 180px 100%;
  opacity: .30;
  animation: nav-wave-back 9s linear infinite;
}
/* 手前の波：少し速く（左へ流れる） */
.site-nav--drawer::after {
  height: 26%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 40' preserveAspectRatio='none'%3E%3Cpath d='M0 15 Q30 25 60 15 T120 15 V40 H0 Z' fill='%2384b5d5'/%3E%3C/svg%3E");
  background-size: 140px 100%;
  opacity: .45;
  animation: nav-wave-front 6s linear infinite;
}
@keyframes nav-wave-back  { from { background-position-x: 0; } to { background-position-x: 180px; } }
@keyframes nav-wave-front { from { background-position-x: 0; } to { background-position-x: -140px; } }
/* リンクは波より前面に置く */
.site-nav--drawer .btn { position: relative; z-index: 1; }

/* 「動きを減らす」設定のときは波を止める */
@media (prefers-reduced-motion: reduce) {
  .site-nav--drawer::before,
  .site-nav--drawer::after { animation: none; }
}

/* ---------- コードブロック（Qiita風） ---------- */
.codeblock {
  margin: 1.4em 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;            /* 角丸からはみ出さないように */
  background: #1e2430;         /* 暗い背景 */
}
.codeblock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #2b3342;
  color: #d7dee8;
  font-size: .8rem;
}
.codeblock__name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .02em;
}
.codeblock__copy {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}
.codeblock__copy:hover { background: rgba(255, 255, 255, .12); }
.codeblock pre {
  margin: 0;
  padding: 14px 16px;
  max-width: 100%;
  overflow-x: auto;            /* 長い行は横スクロール */
}
.codeblock code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.6;
  color: #e6e6e6;
  white-space: pre;            /* 折り返さず整形を保つ */
}

/* ---------- おまけ：Spotify おすすめ（横並び＋薄い区切り線） ---------- */
.spotify-row {
  display: flex;
  flex-wrap: wrap;
  margin: 12px 0;
}
.spotify-card {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 18px;             /* 線と中身のあいだの余白 */
}
.spotify-card:first-child { padding-left: 0; }
.spotify-card:last-child  { padding-right: 0; }
/* カードとカードのあいだに薄い区切り線 */
.spotify-card + .spotify-card {
  border-left: 1px solid var(--border);
}

/* スマホ幅：3枚だと潰れて読みにくいので縦積みにして、線も横向きに */
@media (max-width: 560px) {
  .spotify-row { flex-direction: column; }
  .spotify-card { padding: 16px 0 0; }
  .spotify-card:first-child { padding-top: 0; }
  .spotify-card + .spotify-card {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}