/* ================================================
   針の穴から見える世界 — スタイルシート
   幻想的・星空・虹色・アクセシビリティ重視
   ================================================ */

:root {
  --bg: #06060e;
  --card-bg: rgba(20, 18, 40, 0.85);
  --text: #f0eeff;
  --text-muted: #a0a0c8;
  --accent: #c9a96e;
  --border: rgba(255, 255, 255, 0.08);
  --glow: rgba(155, 114, 207, 0.2);
}

/* ===== リセット ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  line-height: 2.2;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===== 星空キャンバス ===== */
#stars-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* コンテンツは星の上に */
header, main, footer {
  position: relative;
  z-index: 1;
}

/* ===== スキップリンク ===== */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--accent);
  color: #000;
  padding: 10px 20px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 8px;
  z-index: 1000;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 16px;
}

/* ===== スクリーンリーダー専用 ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== ヘッダー ===== */
header[role="banner"] {
  text-align: center;
  padding: 100px 24px 80px;
}

/* 虹色キラキラタイトル */
.site-name {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.4;
  margin-bottom: 16px;

  background: linear-gradient(
    90deg,
    #ff6ec7,
    #ffb347,
    #fffb87,
    #87ff87,
    #87d7ff,
    #b47fff,
    #ff6ec7
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbow 4s linear infinite;
  filter: drop-shadow(0 0 18px rgba(180, 127, 255, 0.6));
}

@keyframes rainbow {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.site-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  letter-spacing: 0.06em;
}

.site-author {
  font-size: 0.95rem;
  color: var(--accent);
  opacity: 0.9;
}

/* ===== ヘッダーナビ ===== */
.header-nav {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  padding: 6px 18px;
  border: 1px solid rgba(180, 127, 255, 0.25);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  letter-spacing: 0.04em;
}

.header-nav a:hover,
.header-nav a:focus,
.header-nav a[aria-current="page"] {
  color: var(--text);
  border-color: rgba(180, 127, 255, 0.6);
  background: rgba(180, 127, 255, 0.1);
}

/* ===== リンク（ヘッダータイトルリンク） ===== */
.site-title-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

/* ===== ナビゲーション（パンくず） ===== */
nav.breadcrumb {
  margin-bottom: 48px;
}
nav.breadcrumb a {
  color: #b47fff;
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
nav.breadcrumb a:hover,
nav.breadcrumb a:focus {
  color: var(--accent);
  border-color: var(--accent);
}

/* ===== メイン ===== */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 28px 120px;
}

/* ===== カードグリッド ===== */
.card-grid {
  display: grid;
  gap: 32px;
}

/* ===== カード ===== */
.card {
  background: var(--card-bg);
  border: 1px solid rgba(180, 127, 255, 0.2);
  border-radius: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.8s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 16px 60px rgba(155, 114, 207, 0.3),
    0 0 40px rgba(201, 169, 110, 0.15);
}

.card-inner {
  padding: 40px;
}

.date {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  letter-spacing: 0.1em;
}

.card h3 {
  font-size: 1.4rem;
  margin-bottom: 18px;
  line-height: 1.6;
}

.card h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.card h3 a:hover,
.card h3 a:focus {
  color: var(--accent);
  text-decoration: underline;
}

.excerpt {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 28px;
  line-height: 2;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b47fff;
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, gap 0.2s;
  padding-bottom: 2px;
}
.read-more:hover,
.read-more:focus {
  border-color: #b47fff;
  gap: 12px;
}

/* ===== 記事詳細 ===== */
.post {
  opacity: 0;
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.post-header {
  margin-bottom: 56px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

.post-header h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.6;
  margin: 14px 0 18px;
  color: var(--text);
}

.post-author {
  font-size: 0.95rem;
  color: var(--accent);
}

/* 本文 */
.post-body {
  font-size: 1.15rem;
  line-height: 2.4;
  color: var(--text);
}

.post-body p {
  margin-bottom: 2.2em;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.post-sign {
  margin-top: 56px !important;
  text-align: right;
  color: var(--accent);
  font-size: 1.05rem;
}

/* ===== フッター ===== */
footer[role="contentinfo"] {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ===== フォーカス ===== */
:focus-visible {
  outline: 2px solid #b47fff;
  outline-offset: 4px;
  border-radius: 4px;
}

/* ===== アニメーション ===== */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== モーション軽減 ===== */
@media (prefers-reduced-motion: reduce) {
  .card, .post {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .card:hover { transform: none; }
  .site-name { animation: none; }
  html { scroll-behavior: auto; }
}

/* ===== レスポンシブ ===== */
@media (max-width: 600px) {
  html { font-size: 16px; }
  header[role="banner"] { padding: 70px 20px 56px; }
  .card-inner { padding: 28px; }
  main { padding: 32px 16px 80px; }
}
