:root {
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --surface: rgba(30, 41, 59, 0.7);
  --surface-strong: #1e293b;
  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.1);
  --line: #334155;
  --shadow: 0 10px 30px -10px rgba(2, 6, 17, 0.7);
  --glow: 0 0 20px rgba(56, 189, 248, 0.15);
  --banner-height: 48px;
  --banner-z: 999;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", "Noto Sans JP", sans-serif;
  color: var(--text-main);
  line-height: 1.75;
  background-color: var(--bg-darker);
  background-image: 
    radial-gradient(at 0% 0%, hsla(199, 89%, 48%, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, hsla(187, 92%, 35%, 0.15) 0px, transparent 50%),
    radial-gradient(at 50% 100%, hsla(217, 91%, 60%, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  padding-top: var(--banner-height);
}

/* モバイルでメニュー開いたときにスクロール禁止 */
.no-scroll {
  overflow: hidden;
}

.container {
  width: min(1000px, 92%);
  margin: 12px auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 32px;
  margin-bottom: 32px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* カード自体はクリックで遷移しない要素が多いため、hoverでの持ち上げ効果は無効化しました */

/* Hero Section */
.hero {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 860px) {
  .hero {
    grid-template-columns: 1.5fr 1fr;
    padding: 48px;
  }
}

.tag {
  display: inline-block;
  margin-bottom: 16px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 800;
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
  font-weight: 700;
  background: linear-gradient(to bottom right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-sub);
  margin-top: 24px;
}

.hero-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
  filter: grayscale(20%) contrast(1.1);
  box-shadow: var(--shadow);
  transition: filter 0.3s ease;
}

/* hero画像もクリックで遷移しないため、hoverでの変化は無効化 */

/* Sections */
.section-title {
  margin: 64px 0 24px;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  /* 固定ヘッダと重ならないようにスクロール時の余白を確保 */
  scroll-margin-top: calc(var(--banner-height) + 12px);
}

.section-title::after {
  content: "";
  height: 1px;
  flex-grow: 1;
  background: linear-gradient(to right, var(--line), transparent);
}

.grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 860px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

/* List details */
ul {
  margin: 0;
  padding-left: 1.25rem;
  list-style-type: none;
}

li {
  position: relative;
  margin-bottom: 12px;
}

/* 入れ子レベルごとのマーカー */
ul > li {
  position: relative;
}
ul > li::before {
  /* 最上位の箇条（1段目）: 大きめのソリッドドット */
  content: "";
  position: absolute;
  left: -1.25rem;
  top: 0.6rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7ee7ff, var(--accent));
  /* 控えめな光彩 */
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.12);
}

ul ul > li::before {
  /* 2段目: 強めのグラデーションで目立たせる */
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 0.55rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  /* 2段目: 中空のリング（輪郭） + 光彩 */
  background: transparent;
  border: 2px solid rgba(56, 189, 248, 0.95);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.28);
}

ul ul ul > li::before {
  /* 3段目以降: より控えめな小ドット */
  content: "";
  position: absolute;
  left: -0.9rem;
  top: 0.5rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(180deg, #60e1ff, var(--accent));
  opacity: 0.95;
}

.timeline-item {
  padding: 0 0 32px 24px;
  border-left: 1px solid var(--line);
  position: relative;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.muted {
  color: var(--text-sub);
  font-size: 0.95rem;
}

.meta {
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* Badges */
.award-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  /* 通常時は光を表示しない（元の見た目に戻す） */
  text-shadow: none;
}

.award-badge:hover,
.award-badge:focus-visible {
  /* ホバーで移動させない（位置固定）。背景・シャドウを金色寄せに統一して青みを排除 */
  background: linear-gradient(180deg, rgba(251,191,36,0.16) 0%, rgba(251,191,36,0.08) 60%, transparent 100%);
  color: #dbcc00; /* 暗めの文字色で可読性を確保 */
  border-color: rgba(251, 191, 36, 0.95);
  box-shadow: 0 10px 26px rgba(251, 191, 36, 0.12), inset 0 1px 0 rgba(255, 240, 200, 0.06);
  transform: none; /* 位置変化を無効化 */
  text-decoration: none;
}

/* 明示的にホバー時も金色の光にする（グローバル a:hover の影響を受けないよう優先） */
.award-badge:hover,
.award-badge:focus-visible {
  text-shadow: 0 2px 12px rgba(251, 191, 36, 0.95);
}

.award-badge:active {
  transform: none;
  box-shadow: 0 6px 12px rgba(251, 191, 36, 0.10);
}

.mini-badge {
  display: inline-flex;
  margin-left: 12px;
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px border transparent;
  transition: all 0.2s ease;
}

a:hover {
  text-shadow: 0 0 8px var(--accent);
  border-bottom: 1px solid var(--accent);
}

.paper-link {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 6px 16px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.paper-link:hover {
  background: var(--accent);
  color: var(--bg-darker);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

/* Top-of-page compact banner (独立バナー・固定表示) */
.top-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--banner-height);
  background: var(--surface-strong);
  border-bottom: 1px solid var(--line);
  z-index: var(--banner-z);
  box-shadow: 0 2px 10px rgba(2, 6, 17, 0.6);
}
.banner-inner {
  width: min(1000px, 92%);
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  height: 100%;
}
.top-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ハンバーガー基礎（デスクトップでは非表示） */
.hamburger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--accent);
}
.hamburger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.hamburger-box{
  display: inline-block;
  width: 22px;
  height: 16px;
  position: relative;
}
.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after{
  display: block;
  background-color: currentColor;
  height: 2px;
  border-radius: 2px;
  position: absolute;
  left: 0;
  right: 0;
}
.hamburger-inner{ top: 50%; transform: translateY(-50%); }
.hamburger-inner::before{ content: ''; top: -7px; }
.hamburger-inner::after{ content: ''; top: 7px; }
/* ハンバーガーのアクティブ（×）変形用アニメーション */
.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after{
  transition: transform 0.25s ease, top 0.25s ease, opacity 0.25s ease;
}
.hamburger.is-active .hamburger-inner{ background-color: transparent; }
.hamburger.is-active .hamburger-inner::before{
  transform: translateY(7px) rotate(45deg);
}
.hamburger.is-active .hamburger-inner::after{
  transform: translateY(-7px) rotate(-45deg);
}
.toc-link {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.toc-link:hover {
  background: var(--accent);
  color: var(--bg-darker);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.14);
}
.toc-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

footer {
  margin: 80px 0 40px;
  text-align: center;
  color: var(--text-sub);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

/* ==================================================
   モバイル対応（スマホ表示）: 小さい画面向けに余白・フォント・レイアウトを調整
   コメントは日本語で記述しています。
   ==================================================*/
@media (max-width: 859px) {
  .container {
    width: 94%;
    margin: 8px auto;
  }

  /* モバイルではナビを隠してハンバーガーで開く */
  .hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .top-nav {
    display: none;
    position: absolute;
    right: 8px;
    top: var(--banner-height);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    flex-direction: column;
    gap: 8px;
    z-index: calc(var(--banner-z) + 1);
    min-width: 160px;
    box-shadow: var(--shadow);
  }

  /* open クラスで表示 */
  .top-nav.open {
    display: flex;
  }

  .top-nav .toc-link {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: nowrap;
  }

  .card {
    padding: 20px;
    border-radius: 18px;
  }

  /* Hero を1カラム表示にし隙間を詰める */
  .hero {
    gap: 20px;
    padding: 20px;
    grid-template-columns: 1fr;
  }

  /* 画像を横幅に合わせて中央配置 */
  .hero-image {
    width: 84%;
    margin: 0 auto;
    border-radius: 14px;
  }

  /* ヘッダ内の幅を小さくし、ナビは折り返し許可 */
  .banner-inner {
    width: 94%;
    justify-content: space-between;
    padding: 0 6px;
  }

  /* ハンバーガーを右端に寄せる */
  .hamburger{
    margin-left: auto;
  }

  .top-nav {
    /* フルスクリーンのモバイルナビに変更 */
    .top-nav {
      /* 初期は画面外（右）に配置し、開いたらスライドイン */
      display: flex;
      position: fixed;
      inset: 0; /* top:0; right:0; bottom:0; left:0; */
      justify-content: center;
      align-items: center;
      background: rgba(2,6,17,0.92);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      transform: translateX(100%);
      transition: transform 0.32s cubic-bezier(0.2,0.8,0.2,1);
      padding: 24px;
      z-index: calc(var(--banner-z) + 2);
      flex-direction: column;
      gap: 18px;
    }

    /* open クラスでフルスクリーン表示 */
    .top-nav.open {
      transform: translateX(0);
    }

    .top-nav .toc-link {
      display: block;
      padding: 12px 20px;
      border-radius: 12px;
      white-space: nowrap;
      font-size: 1.1rem;
      color: var(--text-main);
      background: transparent;
      border: 1px solid rgba(255,255,255,0.04);
    }

    .top-nav .toc-link:hover {
      background: rgba(56,189,248,0.08);
      color: var(--accent);
    }
  }

  body {
    padding-top: var(--banner-height);
  }

  .card {
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 14px;
  }

  .hero-image {
    width: 100%;
  }

  .toc-link {
    font-size: 0.8rem;
    padding: 6px 8px;
  }

  .tag {
    font-size: 0.65rem;
    padding: 4px 12px;
  }

  .hero p {
    font-size: 1rem;
  }
}
