/* ==========================================================
   α Canis Majoris — site stylesheet
   基調: 深宇宙 (deep navy) × Sirius の青白い光 × 星雲の紫 × コロナの金
   既存の HTML 構造 (header / .container / .side / .section / footer) と
   数式 HTML エディタの出力をそのまま使えるように書いています.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap');

@property --orbit {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  --void:   #060914;   /* 背景: 深宇宙 */
  --deep:   #0c1226;   /* パネル */
  --panel:  rgba(13, 19, 40, 0.74);
  --line:   rgba(143, 211, 255, 0.13);
  --line-2: rgba(180, 155, 255, 0.14);

  --text:   #c8d0e2;
  --bright: #eef3ff;
  --muted:  #7c87a3;

  --sirius: #8fd3ff;   /* Sirius の青白 */
  --nebula: #b49bff;   /* 星雲の紫 */
  --corona: #ffd27f;   /* コロナの金 */

  --wrap: 1200px;
  --measure: 46em;     /* 本文の行長 (全角約46字) */
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: var(--void);
  scroll-behavior: smooth;
  scroll-padding-top: 76px; /* 上部に固定したメニューの分 */
  -webkit-text-size-adjust: 100%;
  scrollbar-color: rgba(143, 211, 255, 0.25) var(--void);
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  font-size: 1.03rem;
  line-height: 1.9;
  letter-spacing: 0.02em;
  font-feature-settings: "palt" 0;
  -webkit-font-smoothing: antialiased;
}

/* 星野: 大きさと周期の違う 3 層の星 + 星雲の淡い光 (固定) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 23px 41px, rgba(255,255,255,.85) 50%, transparent 52%),
    radial-gradient(1px 1px at 131px 87px, rgba(200,225,255,.7) 50%, transparent 52%),
    radial-gradient(1px 1px at 77px 163px, rgba(255,255,255,.55) 50%, transparent 52%),
    radial-gradient(1px 1px at 181px 13px, rgba(255,240,220,.6) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 61px 233px, rgba(255,255,255,.9) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 287px 141px, rgba(190,220,255,.8) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 203px 311px, rgba(255,235,210,.7) 50%, transparent 52%),
    radial-gradient(2px 2px at 371px 97px, rgba(220,235,255,.9) 50%, transparent 52%),
    radial-gradient(2px 2px at 113px 449px, rgba(255,255,255,.75) 50%, transparent 52%),
    radial-gradient(1px 1px at 97px 29px, rgba(255,255,255,.6) 50%, transparent 52%),
    radial-gradient(1px 1px at 41px 113px, rgba(200,220,255,.5) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 263px 401px, rgba(255,250,240,.65) 50%, transparent 52%),
    radial-gradient(1px 1px at 557px 233px, rgba(220,230,255,.55) 50%, transparent 52%),
    radial-gradient(ellipse 70% 55% at 92% -8%, rgba(180,155,255,.16), transparent 62%),
    radial-gradient(ellipse 60% 50% at -10% 110%, rgba(143,211,255,.09), transparent 60%),
    radial-gradient(ellipse 50% 40% at 40% 60%, rgba(70,90,180,.06), transparent 70%),
    var(--void);
  background-size:
    211px 211px, 211px 211px, 211px 211px, 211px 211px,
    353px 353px, 353px 353px, 353px 353px,
    509px 509px, 509px 509px,
    137px 167px, 173px 149px, 433px 389px, 613px 577px,
    100% 100%, 100% 100%, 100% 100%, 100% 100%;
}

::selection {
  background: rgba(180, 155, 255, 0.35);
  color: #fff;
}

/* ---------- リンク ---------- */
a {
  color: var(--sirius);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(143, 211, 255, 0.38);
  text-underline-offset: 0.28em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:visited {
  color: #c9b9ff;
  text-decoration-color: rgba(201, 185, 255, 0.38);
}

a:hover {
  color: var(--corona);
  text-decoration-color: var(--corona);
}

a:focus-visible {
  outline: 2px solid var(--corona);
  outline-offset: 3px;
  border-radius: 3px;
}

strong, b {
  color: var(--bright);
  font-weight: 700;
}

/* ==========================================================
   Header: Sirius A と、その周りを巡る伴星 Sirius B
   ========================================================== */
header {
  position: relative;
  overflow: hidden;
  /* 右のシリウス (光芒の半径 約 105px) と, その下のフォローボタンが収まる高さ */
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding:
    clamp(44px, 8vw, 96px)
    max(20px, calc((100% - var(--wrap)) / 2 + 20px))
    clamp(30px, 4.5vw, 52px);
  background:
    linear-gradient(135deg, rgba(5, 8, 16, 0.92) 0%, rgba(23, 27, 45, 0.78) 50%, rgba(32, 21, 51, 0.82) 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.9);
}

/* Sirius A: 青白い主星 + 回折スパイク */
header::before,
header::after {
  content: '';
  position: absolute;
  top: 50%;
  right: max(110px, calc((100% - var(--wrap)) / 2 + 130px));
  pointer-events: none;
}

header::before {
  width: 7px;
  height: 7px;
  margin: -3.5px -3.5px 0 0;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 4px 1px #fff,
    0 0 14px 5px rgba(170, 220, 255, 0.9),
    0 0 46px 16px rgba(143, 211, 255, 0.32),
    0 0 130px 50px rgba(120, 140, 255, 0.13);
  z-index: 2;
}

header::after {
  width: 300px;
  height: 300px;
  margin: -150px -150px 0 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(200, 232, 255, 0.55) 50%, transparent 100%) center / 100% 1px no-repeat,
    linear-gradient(0deg, transparent 8%, rgba(200, 232, 255, 0.5) 50%, transparent 92%) center / 1px 100% no-repeat,
    linear-gradient(45deg, transparent 32%, rgba(200, 232, 255, 0.18) 50%, transparent 68%) center / 100% 100% no-repeat;
  mask: radial-gradient(circle, #000 0, #000 18%, transparent 70%);
  -webkit-mask: radial-gradient(circle, #000 0, #000 18%, transparent 70%);
  opacity: 0.9;
}

/* Sirius B の軌道 (h1 の擬似要素を header 基準で配置) */
header h1::after {
  content: '';
  position: absolute;
  top: 50%;
  right: max(110px, calc((100% - var(--wrap)) / 2 + 130px));
  width: 200px;
  height: 200px;
  margin: -100px -100px 0 0;
  border-radius: 50%;
  border: 1px solid rgba(180, 155, 255, 0.16);
  /* 伴星: 縦に伸ばした楕円を置き, 軌道ごと scaleY で潰すと丸く見える */
  background: radial-gradient(2.4px 6.6px at 50% 0, #fff 0, #fff 40%, rgba(200, 185, 255, 0.5) 70%, transparent 100%) no-repeat;
  transform: rotate(-24deg) scaleY(0.36) rotate(var(--orbit));
  animation: sirius-b 48s linear infinite;
  pointer-events: none;
}

@keyframes sirius-b {
  to { --orbit: 360deg; }
}

/* H1: 星雲のグラデーション */
h1 {
  position: static;
  max-width: calc(100% - 240px);
  margin: 0;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.05em;
  background: linear-gradient(100deg, #8fe0ff 0%, #9fb4ff 30%, var(--nebula) 58%, var(--corona) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-wrap: balance;
}

/* ヘッダー内の「ホーム」へのリンク */
header p {
  margin: 0 0 auto;
  padding-bottom: clamp(14px, 2vw, 22px);
  font-size: 0.86rem;
  line-height: 1.4;
  letter-spacing: 0.08em;
}

header p:empty {
  display: none;
}

header p a,
header > a {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.38em 0.95em 0.38em 0.8em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 12, 28, 0.55);
  color: var(--text);
  text-decoration: none;
}

header p a::before,
header > a::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 2px rgba(143, 211, 255, 0.85);
}

header p a:visited,
header > a:visited {
  color: var(--text);
}

header p a:hover,
header > a:hover {
  color: var(--bright);
  border-color: rgba(143, 211, 255, 0.45);
}

header > a {
  margin-bottom: clamp(14px, 2vw, 22px);
  font-size: 0.86rem;
  line-height: 1.4;
  letter-spacing: 0.08em;
}

/* シリウスの下の「Twitterをフォロー」 */
header:has(.follow-x)::before,
header:has(.follow-x)::after,
header:has(.follow-x) h1::after {
  top: 44%;
}

header > a.follow-x {
  position: absolute;
  z-index: 3;
  /* 光芒 (半径 約 105px) の先端より下に置き, シリウスと重ねない */
  top: calc(44% + 121px);
  right: max(110px, calc((100% - var(--wrap)) / 2 + 130px));
  transform: translateX(50%);
  margin: 0;
  padding: 0.5em 1.15em 0.5em 0.95em;
  border-color: rgba(143, 211, 255, 0.35);
  background: rgba(8, 12, 28, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--bright);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

header > a.follow-x:visited {
  color: var(--bright);
}

header > a.follow-x:hover {
  color: #fff;
  border-color: var(--sirius);
  background: rgba(143, 211, 255, 0.14);
  box-shadow: 0 0 20px -4px rgba(143, 211, 255, 0.55);
}

/* トグルメニュー (ブログ記事以外のページ) */
.site-menu {
  /* どれだけスクロールしても画面の上部に出しておく */
  position: fixed;
  z-index: 60;
  top: 18px;
  left: max(20px, calc((100% - var(--wrap)) / 2 + 20px));
  max-width: min(calc(100% - 40px), 680px);
  margin: 0;
}

.site-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.65em;
  padding: 0.42em 1.05em 0.42em 0.85em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 12, 28, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.4;
  letter-spacing: 0.08em;
  list-style: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.3s ease;
}

/* ヘッダーを過ぎて本文の上に浮いているとき */
.site-menu.is-floating > summary {
  background: rgba(8, 12, 28, 0.86);
  border-color: rgba(143, 211, 255, 0.28);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.site-menu > summary::-webkit-details-marker {
  display: none;
}

.site-menu > summary:hover,
.site-menu[open] > summary {
  color: var(--bright);
  border-color: rgba(143, 211, 255, 0.45);
  background: rgba(143, 211, 255, 0.08);
}

.site-menu > summary:focus-visible {
  outline: 2px solid var(--corona);
  outline-offset: 3px;
}

/* 三本線 → 開くと × */
.site-menu-icon {
  position: relative;
  width: 14px;
  height: 10px;
  flex: none;
}

.site-menu-icon::before,
.site-menu-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 14px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.25s ease, top 0.25s ease, box-shadow 0.2s ease;
}

.site-menu-icon::before {
  top: 0;
  box-shadow: 0 4.25px 0 currentColor;
}

.site-menu-icon::after {
  top: 8.5px;
}

.site-menu[open] .site-menu-icon::before {
  top: 4.25px;
  box-shadow: none;
  transform: rotate(45deg);
}

.site-menu[open] .site-menu-icon::after {
  top: 4.25px;
  transform: rotate(-45deg);
}

.site-menu nav {
  width: max-content;
  max-width: min(calc(100vw - 24px), 680px);
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 12, 28, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.95);
}

.site-menu nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.site-menu[open] nav {
  animation: site-menu-in 0.22s ease-out;
}

@keyframes site-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.site-menu nav a,
.site-menu nav a:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.42em 1.05em 0.42em 0.85em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 12, 28, 0.62);
  color: var(--bright);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.site-menu nav a::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(200, 220, 255, 0.55);
}

.site-menu nav a:hover {
  color: #fff;
  border-color: rgba(143, 211, 255, 0.55);
  background: rgba(143, 211, 255, 0.12);
}

.site-menu nav a[aria-current] {
  border-color: rgba(143, 211, 255, 0.6);
  background: rgba(143, 211, 255, 0.14);
}

.site-menu nav a[aria-current]::before {
  background: #fff;
  box-shadow: 0 0 6px 2px rgba(143, 211, 255, 0.85);
}

.site-menu nav a:focus-visible {
  outline: 2px solid var(--corona);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .site-menu[open] nav { animation: none; }
  .site-menu-icon::before, .site-menu-icon::after { transition: none; }
}

@media print {
  .site-menu { display: none; }
}

/* ==========================================================
   レイアウト
   ========================================================== */
.container {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(32px, 5vw, 56px) 20px 0;
}

/* Side: 目次は枠を持たない細いレールとして上部に固定 */
.side {
  position: sticky;
  top: 24px;
  flex: 0 0 210px;
  width: auto;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  margin: 0;
  padding: 6px 0 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.side h3 {
  margin: 0 0 14px;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--muted);
  border: none;
  box-shadow: none;
}

.side h3::before {
  display: none;
}

.side ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.side li {
  margin: 0;
}

.side li::marker {
  content: none;
}

.side a,
.side a:visited {
  position: relative;
  display: block;
  margin-left: -1px;
  padding: 0.42em 0 0.42em 1.1em;
  border-left: 1px solid transparent;
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.55;
  text-decoration: none;
}

.side a:hover {
  color: var(--bright);
  border-left-color: var(--sirius);
}

.side a:hover::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 2px rgba(143, 211, 255, 0.8);
}

/* 目次のないページ (ブログ以外): 本文を中央に */
.container:not(:has(.side)) {
  justify-content: center;
}

.container:not(:has(.side)) > .section {
  max-width: 900px;
}

/* Section: 本文パネル */
.section {
  position: relative;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: clamp(26px, 4.4vw, 56px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 40px 90px -50px rgba(0, 0, 0, 0.95);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* 上辺に光の稜線 */
.section::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(143, 211, 255, 0.7) 22%, rgba(180, 155, 255, 0.5) 60%, transparent);
}

.section > p,
.section > ul,
.section > ol,
.section > h2,
.section > h3,
.section > blockquote {
  max-width: var(--measure);
}

.section > :first-child {
  margin-top: 0;
}

.section p {
  margin: 0 0 1.25em;
}

/* H2: 彗星 (光る核 + 細い尾) */
h2 {
  position: relative;
  margin: 3.2em 0 1.1em;
  padding-bottom: 0.65em;
  font-size: clamp(1.32rem, 2.3vw, 1.62rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.05em;
  color: var(--bright);
}

h2::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--sirius) 0%, rgba(180, 155, 255, 0.45) 35%, transparent 100%);
  box-shadow: none;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 2px rgba(143, 211, 255, 0.9), 0 0 18px 4px rgba(143, 211, 255, 0.35);
}

/* 空の見出しが続く場合の詰め */
h2 + h2 {
  margin-top: 2.4em;
}

/* H3: 四芒星のマーカー */
h3 {
  position: relative;
  margin: 2.3em 0 0.8em;
  padding-left: 1.25em;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #c3dbff;
  border-left: none;
  box-shadow: none;
}

h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.38em;
  width: 0.72em;
  height: 0.72em;
  background: linear-gradient(135deg, var(--sirius), var(--nebula));
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 4px rgba(180, 155, 255, 0.7));
}

h2 + h3 {
  margin-top: 1.4em;
}

/* リスト */
.section ul,
.section ol {
  margin: 0 0 1.4em;
  padding-left: 1.35em;
}

.section li {
  margin: 0.45em 0;
  padding-left: 0.2em;
}

.section li::marker {
  color: rgba(143, 211, 255, 0.65);
}

.section ul ul {
  margin: 0.3em 0;
}

hr {
  border: none;
  height: 1px;
  margin: 2.5em 0;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}

blockquote {
  margin: 1.5em 0;
  padding: 0.4em 0 0.4em 1.2em;
  border-left: 2px solid var(--nebula);
  color: #aeb7cc;
}

code, kbd {
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  background: rgba(143, 211, 255, 0.08);
  color: #d9e9ff;
}

img {
  max-width: 100%;
  height: auto;
}

/* ==========================================================
   テーブル
   ========================================================== */
table {
  width: auto;
  max-width: 100%;
  margin: 1.5rem 0;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(7, 11, 26, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

th {
  padding: 0.7em 1.3em;
  background: rgba(143, 211, 255, 0.06);
  color: var(--sirius);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

td {
  padding: 0.62em 1.3em;
  color: var(--text);
  border-bottom: 1px solid rgba(180, 155, 255, 0.1);
}

tr:last-child td {
  border-bottom: none;
}

td + td,
th + th {
  border-left: 1px solid rgba(143, 211, 255, 0.06);
}

tr td {
  transition: background-color 0.2s ease;
}

tr:hover td {
  background-color: rgba(180, 155, 255, 0.07);
}

.table-wrapper {
  width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
  margin: 0;
  max-width: none;
}

/* ==========================================================
   数式 (MathJax)
   ========================================================== */
mjx-container {
  color: var(--bright);
}

mjx-container[display="true"] {
  max-width: 100%;
  margin: 1.2em 0 !important;
  padding: 0.6em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* ==========================================================
   Footer
   ========================================================== */
body > footer {
  position: relative;
  margin-top: clamp(64px, 10vw, 120px);
  padding: 44px 20px 52px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  background: linear-gradient(to top, rgba(2, 4, 8, 0.9) 0%, rgba(6, 9, 20, 0) 100%);
  border-top: 1px solid var(--line-2);
}

body > footer::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 2px rgba(180, 155, 255, 0.8), 0 0 20px 6px rgba(180, 155, 255, 0.25);
}

body > footer p {
  margin: 0;
}

body > footer a {
  color: var(--sirius);
  text-decoration: none;
}

body > footer a:hover {
  color: var(--nebula);
  text-shadow: 0 0 8px rgba(180, 155, 255, 0.8);
}

/* ==========================================================
   トップページのオープニング (intro.js)
   ========================================================== */
/* スクリプトが動くまでの一瞬, ページを隠す */
html.intro-pending::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--void);
}

html.intro-pending,
html.intro-playing {
  overflow: hidden;
}

/* 再生中はヘッダーのシリウスを隠し, 到着したら現す */
header::before,
header::after,
header h1::after {
  transition: opacity 0.35s ease;
}

html.intro-playing header::before,
html.intro-playing header::after,
html.intro-playing header h1::after {
  opacity: 0;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 1001;
  overflow: hidden;
  cursor: pointer;
}

.intro-back {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 85% 10%, rgba(180, 155, 255, 0.10), transparent 62%),
    radial-gradient(ellipse 60% 50% at 10% 100%, rgba(143, 211, 255, 0.07), transparent 60%),
    var(--void);
}

.intro-sky {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  will-change: transform;
}

.intro-lines line {
  stroke: rgba(160, 200, 255, 0.38);
  stroke-width: 1;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.intro-labels text {
  fill: rgba(180, 200, 255, 0.7);
  font-family: inherit;
  font-size: 15px;
  font-style: italic;
  letter-spacing: 0.12em;
  opacity: 0;
}

/* ヘッダーと同じ描き方のシリウス (中心が原点) */
.sirius-mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.sirius-mark > span {
  position: absolute;
  left: 0;
  top: 0;
}

.sm-core {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 4px 1px #fff,
    0 0 14px 5px rgba(170, 220, 255, 0.9),
    0 0 46px 16px rgba(143, 211, 255, 0.32),
    0 0 130px 50px rgba(120, 140, 255, 0.13);
}

.sm-spikes {
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(200, 232, 255, 0.55) 50%, transparent 100%) center / 100% 1px no-repeat,
    linear-gradient(0deg, transparent 8%, rgba(200, 232, 255, 0.5) 50%, transparent 92%) center / 1px 100% no-repeat,
    linear-gradient(45deg, transparent 32%, rgba(200, 232, 255, 0.18) 50%, transparent 68%) center / 100% 100% no-repeat;
  mask: radial-gradient(circle, #000 0, #000 18%, transparent 70%);
  -webkit-mask: radial-gradient(circle, #000 0, #000 18%, transparent 70%);
  opacity: 0.9;
}

.sm-orbit {
  width: 200px;
  height: 200px;
  margin: -100px 0 0 -100px;
  border-radius: 50%;
  border: 1px solid rgba(180, 155, 255, 0.16);
  background: radial-gradient(2.4px 6.6px at 50% 0, #fff 0, #fff 40%, rgba(200, 185, 255, 0.5) 70%, transparent 100%) no-repeat;
  transform: rotate(-24deg) scaleY(0.36) rotate(var(--orbit));
  animation: sirius-b 48s linear infinite;
}

.intro-name {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  opacity: 0;
  white-space: nowrap;
  font-size: clamp(1.1rem, 5.2vw, 2.3rem);
  font-weight: 500;
}

.intro-name > span {
  display: inline-block;
  letter-spacing: 0.32em;
  /* 末尾の字間と同じだけ左にも余白を取り, 文字列の見た目を中央に揃える */
  padding-left: 0.32em;
  background: linear-gradient(100deg, #8fe0ff 0%, #9fb4ff 35%, var(--nebula) 70%, var(--corona) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.intro-starnames text {
  fill: rgba(190, 205, 235, 0.5);
  font-family: inherit;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.intro-starnames text.bright {
  fill: rgba(215, 228, 250, 0.75);
  font-size: 11.5px;
}

.intro-skip {
  position: absolute;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  padding: 0.4em 1em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 12, 28, 0.5);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.intro-skip:hover,
.intro-skip:focus-visible {
  color: var(--bright);
  border-color: rgba(143, 211, 255, 0.45);
  outline: none;
}

/* ==========================================================
   オフラインモード (offline.js がメニューとフッターに置く)
   ========================================================== */
.offline-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
}

body > footer .offline-box {
  margin: 0 auto 22px;
  max-width: 560px;
}

.site-menu nav .offline-box {
  justify-content: flex-start;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.offline-btn,
.offline-sub {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.42em 1.05em 0.42em 0.85em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 12, 28, 0.62);
  color: var(--bright);
  font: inherit;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.offline-btn svg {
  width: 1em;
  height: 1em;
  flex: none;
}

.offline-btn:hover,
.offline-sub:hover {
  border-color: rgba(143, 211, 255, 0.55);
  background: rgba(143, 211, 255, 0.1);
}

.offline-btn:focus-visible,
.offline-sub:focus-visible {
  outline: 2px solid var(--corona);
  outline-offset: 2px;
}

.offline-btn[disabled] {
  cursor: progress;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.offline-box.is-on .offline-btn {
  border-color: rgba(143, 211, 255, 0.6);
  background: rgba(143, 211, 255, 0.14);
  box-shadow: 0 0 16px -6px rgba(143, 211, 255, 0.7);
}

.offline-sub {
  padding: 0.42em 1em;
  color: var(--text);
}

.offline-sub[hidden] {
  display: none;
}

body > footer .offline-status,
.site-menu .offline-status {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.site-menu .offline-status:empty {
  display: none;
}

.site-menu nav .offline-box .offline-status {
  text-align: left;
}

/* ==========================================================
   レスポンシブ
   ========================================================== */
@media screen and (max-width: 900px) {
  header::before,
  header::after,
  header h1::after {
    right: 70px;
  }
  h1 {
    max-width: calc(100% - 150px);
  }
  header > a.follow-x {
    top: auto;
    bottom: 16px;
    right: 20px;
    transform: none;
  }
}

@media screen and (max-width: 768px) {
  body {
    font-size: 1rem;
    line-height: 1.85;
  }

  header {
    min-height: 250px;
  }
  .site-menu {
    top: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
  }
  /* 見出しが右上のシリウスの光芒に重ならないように */
  header h1 {
    max-width: calc(100% - 92px);
  }
  header::before,
  header::after,
  header h1::after {
    top: 92px;
    right: 64px;
  }
  header::after {
    width: 200px;
    height: 200px;
    margin: -100px -100px 0 0;
  }
  header h1::after {
    width: 130px;
    height: 130px;
    margin: -65px -65px 0 0;
  }
  h1 {
    max-width: 100%;
  }
  header:has(.follow-x)::before,
  header:has(.follow-x)::after,
  header:has(.follow-x) h1::after {
    top: 92px;
  }
  header > a.follow-x {
    position: relative;
    top: auto;
    bottom: auto;
    right: auto;
    transform: none;
    margin-top: 18px;
  }

  .container {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding: 24px 12px 0;
  }

  .side {
    position: static;
    flex: none;
    max-height: none;
    padding: 18px 20px 14px;
    background: rgba(10, 15, 32, 0.6);
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .side ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2em 1.4em;
    border-left: none;
  }

  .side a,
  .side a:visited {
    padding: 0.3em 0;
    border-left: none;
  }

  .side a:hover::before {
    display: none;
  }

  .section {
    padding: 26px 20px;
    border-radius: 14px;
  }

  .section::before {
    left: 16px;
    right: 16px;
  }

  th, td {
    padding-left: 1em;
    padding-right: 1em;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  header h1::after {
    animation: none;
    --orbit: 140deg;
  }
  * {
    transition: none !important;
  }
}

@media print {
  body::before,
  header::before,
  header::after,
  header h1::after {
    display: none;
  }
  html, body, header, .section, footer {
    background: #fff !important;
    color: #000;
  }
  h1 {
    -webkit-text-fill-color: #000;
    color: #000;
    filter: none;
  }
  .side {
    display: none;
  }
}

/* ==========================================================
   記事本文 (article-body): 図・埋め込み投稿・音楽
   ========================================================== */
.article-body > section > p,
.article-body > section > h2,
.article-body > section > h3,
.article-body > section > ul,
.article-body > section > ol {
  max-width: var(--measure);
}

.article-body > section:first-child > :first-child {
  margin-top: 0;
}

.article-figure {
  max-width: var(--measure);
  margin: 2em 0;
}

.article-figure img {
  display: block;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.article-figure br {
  display: none;
}

.article-figure figcaption {
  margin-top: 0.8em;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.section .figure-note {
  margin: 0.4em 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

/* X (Twitter) の投稿を引用したカード */
.section blockquote.x-embed {
  max-width: 34em;
  margin: 1.6em 0;
  padding: 1em 1.2em;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 12, 28, 0.55);
  color: var(--text);
}

.section .x-embed-text {
  margin: 0 0 0.6em;
  white-space: pre-line;
  color: var(--bright);
}

.x-embed-media {
  color: var(--sirius);
  font-size: 0.88em;
  word-break: break-all;
}

.x-embed-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2em 0.9em;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* 音楽の埋め込み (表示のみ) */
.spotify-embed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8em 1.4em;
  max-width: 34em;
  margin: 1.6em 0;
  padding: 1em 1.2em;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(30, 215, 96, 0.08), rgba(8, 12, 28, 0.55) 60%);
}

.spotify-label {
  color: #7ee2a3;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.spotify-title {
  color: var(--bright);
  font-weight: 700;
  line-height: 1.5;
}

.spotify-artist {
  color: var(--muted);
  font-size: 0.86rem;
}

.spotify-embed .source-link {
  font-size: 0.86rem;
  white-space: nowrap;
}

/* ==========================================================
   ブログ: タグ・検索
   ========================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* タグ (共通) */
.tag,
a.tag,
a.tag:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.15em;
  padding: 0.22em 0.78em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(143, 211, 255, 0.05);
  color: #b9c6de;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.tag::before {
  content: '#';
  color: var(--muted);
}

.tag:hover {
  color: var(--bright);
  border-color: rgba(143, 211, 255, 0.45);
  background: rgba(143, 211, 255, 0.1);
}

.tag.is-active,
a.tag.is-active:visited {
  color: var(--bright);
  border-color: var(--sirius);
  background: rgba(143, 211, 255, 0.16);
  box-shadow: 0 0 12px -2px rgba(143, 211, 255, 0.45);
}

.tag.is-active::before {
  color: var(--sirius);
}

.tag-count {
  margin-left: 0.45em;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tag.is-active .tag-count {
  color: var(--sirius);
}

ul.tag-list,
.section ul.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
  margin: 0;
  padding: 0;
}

.section ul.tag-list li {
  margin: 0;
  padding: 0;
}

/* 記事ページの見出し下: 日付とタグ */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em 1.1em;
  margin-top: clamp(14px, 2vw, 20px);
  max-width: calc(100% - 240px);
}

.post-meta time {
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

/* 一覧: 検索欄 */
#blog-app:not(.is-ready) .blog-tools {
  display: none;
}

.blog-tools {
  margin-bottom: 0.5em;
}

.blog-search {
  position: relative;
  max-width: var(--measure);
}

.blog-search input {
  width: 100%;
  padding: 0.85em 3.2em 0.85em 2.9em;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237c87a3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 1em 50% / 18px no-repeat,
    rgba(5, 8, 20, 0.7);
  color: var(--bright);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-search input::placeholder {
  color: var(--muted);
}

.blog-search input:focus {
  outline: none;
  border-color: rgba(143, 211, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(143, 211, 255, 0.14), 0 0 24px -6px rgba(143, 211, 255, 0.5);
}

.blog-search input::-webkit-search-cancel-button {
  filter: invert(0.7);
}

.blog-key {
  position: absolute;
  right: 0.9em;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.05em 0.5em;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  pointer-events: none;
}

.blog-search input:focus ~ .blog-key,
.blog-search input:not(:placeholder-shown) ~ .blog-key {
  display: none;
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 1.1em 0 0;
}

.blog-status-row {
  display: flex;
  align-items: center;
  gap: 1em;
  min-height: 2em;
  margin-top: 1em;
}

.section .blog-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.blog-clear {
  padding: 0;
  border: none;
  background: none;
  color: var(--sirius);
  font: inherit;
  font-size: 0.84rem;
  text-decoration: underline;
  text-decoration-color: rgba(143, 211, 255, 0.38);
  text-underline-offset: 0.28em;
  cursor: pointer;
}

.blog-clear:hover {
  color: var(--corona);
}

.blog-clear:focus-visible,
.tag:focus-visible {
  outline: 2px solid var(--corona);
  outline-offset: 2px;
}

/* 一覧: 記事 */
.blog-results > h2:first-child {
  margin-top: 1.6em;
}

.section ul.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.section li.post-item {
  position: relative;
  margin: 0;
  padding: 1.15em 0 1.25em;
  border-bottom: 1px solid rgba(180, 155, 255, 0.09);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1.5em;
  row-gap: 0.45em;
  max-width: var(--measure);
}

.section li.post-item:last-child {
  border-bottom: none;
}

.post-title,
.post-title:visited {
  grid-column: 1;
  color: var(--bright);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.55;
  text-decoration: none;
}

.post-title:hover {
  color: var(--sirius);
}

.post-side {
  grid-column: 2;
  grid-row: 1;
  align-self: baseline;
  display: inline-flex;
  align-items: baseline;
  gap: 0.9em;
}

.post-likes {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.post-likes .like-star {
  width: 0.85em;
  height: 0.85em;
  fill: rgba(143, 211, 255, 0.55);
}

.post-item .post-date {
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.section .post-summary,
.section .post-snippet,
.post-item .tag-list {
  grid-column: 1 / -1;
  margin: 0;
}

.post-summary {
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.75;
}

.post-snippet {
  padding-left: 0.9em;
  border-left: 1px solid rgba(180, 155, 255, 0.35);
  color: #a9b3c9;
  font-size: 0.88rem;
  line-height: 1.75;
}

.post-item .tag-list {
  margin-top: 0.3em;
}

mark {
  padding: 0 0.1em;
  border-radius: 3px;
  background: rgba(255, 210, 127, 0.2);
  color: var(--corona);
}

.section .blog-empty {
  margin: 2em 0 1em;
  color: var(--muted);
}

@media screen and (max-width: 768px) {
  .post-meta {
    max-width: 100%;
  }
  .section li.post-item {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-side {
    grid-column: 1;
    grid-row: auto;
  }
}

/* いいね・コメント (giscus) */
.comments {
  margin-top: 4em;
  max-width: var(--measure);
}

.comments > h2 {
  margin-top: 0;
}

.section .comments-note {
  margin: 0 0 1.4em;
  color: var(--muted);
  font-size: 0.88rem;
}

.comments .giscus,
.comments .giscus-frame {
  width: 100%;
  min-height: 120px;
}

/* いいね */
.like-box {
  margin-top: 3.2em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em 1.2em;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.55em 1.15em 0.55em 0.95em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(143, 211, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.3;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.3s ease;
}

.like-btn:hover {
  color: var(--bright);
  border-color: rgba(143, 211, 255, 0.45);
  background: rgba(143, 211, 255, 0.1);
}

.like-btn:focus-visible {
  outline: 2px solid var(--corona);
  outline-offset: 3px;
}

.like-star {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: var(--sirius);
  stroke-width: 1.6;
  stroke-linejoin: round;
  transition: fill 0.2s ease, filter 0.3s ease;
}

.like-count {
  min-width: 1.2em;
  padding-left: 0.7em;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.like-btn.is-liked {
  color: var(--bright);
  border-color: var(--sirius);
  background: rgba(143, 211, 255, 0.14);
  box-shadow: 0 0 22px -6px rgba(143, 211, 255, 0.6);
}

.like-btn.is-liked .like-star {
  fill: #fff;
  stroke: #fff;
  filter: drop-shadow(0 0 4px rgba(143, 211, 255, 0.95)) drop-shadow(0 0 10px rgba(143, 211, 255, 0.5));
}

.like-btn.is-liked .like-count {
  color: var(--sirius);
}

/* 押したときに一度だけ星が瞬く */
.like-btn.pop .like-star {
  animation: like-pop 0.5s ease-out;
}

@keyframes like-pop {
  0%   { transform: scale(1) rotate(0); }
  40%  { transform: scale(1.45) rotate(45deg); }
  100% { transform: scale(1) rotate(90deg); }
}

.section .like-msg {
  margin: 0;
  color: var(--corona);
  font-size: 0.84rem;
}

.section .like-msg:empty {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .like-btn.pop .like-star {
    animation: none;
  }
}
