/* Google Fonts は各HTMLの <link> タグで読み込み (パフォーマンス最適化) */

/* ===== Skip Link (A11y) ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: var(--accent-glow);
  color: #fff;
  border-radius: 0 0 8px 8px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* ===== Footer Link ===== */
.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--text-light);
}

/* ===== Focus Visible ===== */
:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 3px;
}

/* ===== ハイコントラストモード対応 ===== */
@media (forced-colors: active) {
  .glitch-text,
  .text-content-card h1,
  .about-card h2,
  .contact-card h2,
  .project-card h3,
  .about-hero-text h1 {
    -webkit-text-fill-color: unset;
    background: none;
    color: CanvasText;
  }
}

:root {
  /* === カラートークン === */
  --bg-color: #030303;
  --card-bg: rgba(20, 20, 20, 0.4);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.3);

  /* テキスト (WCAG AA 4.5:1 準拠 on #030303) */
  --text-primary: #ededed;
  --text-light: #d0d0d0;
  --text-secondary: #a8a8a8;
  --text-muted: #999999; /* 5.16:1 コントラスト比 — AA 準拠 */

  /* アクセントカラー（3色体系: Primary / Secondary / Accent） */
  --accent-primary: #6366f1;   /* Indigo — メインCTA・リンク・重要UI */
  --accent-secondary: #a78bfa; /* Violet — ホバー・補助アクセント */
  --accent-tertiary: #06b6d4;  /* Cyan — ステータス・差し色 */
  /* エイリアス（後方互換） */
  --accent-indigo: var(--accent-primary);
  --accent-violet: var(--accent-secondary);
  --accent-lavender: #a5b4fc;
  --accent-purple: #c4b5fd;
  --accent-glow: rgba(255, 255, 255, 0.15);

  /* タイポグラフィ */
  --font-ja: 'Murecho', sans-serif;
  --font-main: 'Inter', 'Murecho', sans-serif;
  --font-logo: 'Russo One', sans-serif;
  --font-heading: 'Sora', 'Murecho', sans-serif;
  --font-blog-heading: 'Sora', 'Murecho', sans-serif;
  --font-mono: 'Courier New', monospace;

  /* フォントサイズ (最小 0.75rem = 12px) */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 1rem;      /* 16px 基準に引き上げ */
  --text-md: 1rem;
  --text-lg: 1.0625rem;

  /* 行間 */
  --lh-body: 1.75;
  --lh-heading: 1.2;
  --lh-tight: 1.4;

  /* ボーダー半径 */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 50px;

  /* 共通 hover 距離 */
  --hover-lift: -4px;
  --hover-transition: 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);

  /* マウス位置 (JSで更新) */
  --mouse-x: 50%;
  --mouse-y: 50%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* --- UI Polish --- */

/* Active Nav Link — CSS-only: body[data-page] + data-i18n セレクタで判定 */
body[data-page="about"] .nav-btn[data-i18n="nav.about"],
body[data-page="blog"] .nav-btn[data-i18n="nav.blog"],
body[data-page="projects"] .nav-btn[data-i18n="nav.projects"],
body[data-page="contact"] .nav-btn[data-i18n="nav.contact"] {
  color: #fff;
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* Breadcrumbs */
.breadcrumb-nav,
.breadcrumb-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

.breadcrumb-nav a:hover {
  text-decoration: underline;
  color: #fff;
}

.breadcrumb-nav span {
  color: #fff;
  /* Current page is white */
}

/* 1. Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* 2. Selection Color */
::selection {
  background: rgba(147, 51, 234, 0.5);
  /* Purple tint */
  color: #fff;
}

/* 3. Smooth Anchor Scrolling */
html {
  scroll-behavior: smooth;
}

/* --- Effects --- */

/* 1. Aurora Background */
.aurora-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.6;
  animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  contain: layout style;
}

.orb-1 {
  width: 60vw;
  height: 60vw;
  background: #4f46e5;
  /* Indigo */
  top: -20%;
  left: -20%;
  animation-delay: 0s;
}

.orb-2 {
  width: 50vw;
  height: 50vw;
  background: #9333ea;
  /* Purple */
  bottom: -20%;
  right: -10%;
  animation-delay: -5s;
}

.orb-3 {
  width: 40vw;
  height: 40vw;
  background: #06b6d4;
  /* Cyan */
  top: 40%;
  left: 30%;
  animation-delay: -10s;
  opacity: 0.35;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(50px, 80px) scale(1.2);
  }
}

/* 2. Grid Overlay */
.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-size: 60px 60px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  pointer-events: none;
  mask-image: radial-gradient(circle at center, black 60%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle at center, black 60%, transparent 100%);
}

/* 3. Noise & Spotlight */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.spotlight-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y),
      rgba(255, 255, 255, 0.05),
      transparent 40%);
}

/* --- Layout --- */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  padding: 8rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  /* Centered */
  position: relative;
  z-index: 10;
  width: 100%;
}

/* --- Cards --- */

.bento-card {
  background: rgba(15, 15, 20, 0.65);
  border: 1px solid rgba(165, 180, 252, 0.1);
  border-radius: 24px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(24px);
  transition:
    transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.35s ease,
    box-shadow 0.45s ease,
    background 0.35s ease;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Inner Glow on Hover */
.bento-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 24px;
  padding: 1px;
  background: radial-gradient(700px circle at var(--mouse-x) var(--mouse-y),
      rgba(165, 180, 252, 0.3),
      transparent 40%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.3;
  transition: opacity 0.4s ease;
}

.bento-card:hover::before {
  opacity: 1;
}

a.bento-card:hover {
  border-color: rgba(165, 180, 252, 0.35);
  transform: translateY(var(--hover-lift));
  background: rgba(20, 20, 28, 0.75);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    0 24px 64px rgba(0, 0, 0, 0.2),
    0 0 40px rgba(99, 102, 241, 0.08);
}

/* --- Rich Project Cards --- */
.project-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  background: rgba(15, 15, 20, 0.65);
  transition:
    transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.35s ease,
    box-shadow 0.4s ease;
}

.project-card:hover {
  border-color: rgba(165, 180, 252, 0.35);
  transform: translateY(var(--hover-lift));
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(99, 102, 241, 0.1);
}

.card-visual-header {
  height: 200px;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.card-visual-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.3;
  mix-blend-mode: overlay;
}

.card-visual-icon {
  position: relative;
  z-index: 2;
  color: #fff;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.4));
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
}

.project-card:hover .card-visual-icon {
  transform: scale(1.12) rotate(3deg);
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.6));
}

.card-content-body {
  padding: 1rem 1.5rem 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Unique Styles for Projects */

/* UCFitness */
.visual-ucfitness {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
}

.visual-ucfitness .card-visual-pattern {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 20px 20px, 100% 20px;
}

/* Portfolio */
.visual-portfolio {
  background: linear-gradient(135deg, #0f172a 0%, #312e81 100%);
}

.visual-portfolio .card-visual-pattern {
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 75%, rgba(255, 255, 255, 0.05)),
    linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 75%, rgba(255, 255, 255, 0.05));
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

/* Coming Soon */
.visual-coming-soon {
  background: linear-gradient(135deg, #1e1b4b 0%, #374151 100%);
}

.visual-coming-soon .card-visual-icon {
  opacity: 0.4;
}

.project-card.coming-soon {
  opacity: 0.65;
  pointer-events: none;
  filter: grayscale(0.3);
}

.project-card.coming-soon a.disabled {
  color: var(--muted);
  cursor: default;
  pointer-events: none;
}

/* --- Specific Cards --- */

/* Hero: Full Width */
.hero-card {
  grid-column: span 12;
  min-height: 70vh;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: 
    radial-gradient(ellipse at 50% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 40%),
    radial-gradient(ellipse at 20% 60%, rgba(6, 182, 212, 0.06) 0%, transparent 40%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(165, 180, 252, 0.15);
  position: relative;
  overflow: hidden;
}

/* 下部の光のアクセントライン */
.hero-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.6), rgba(168, 85, 247, 0.5), rgba(6, 182, 212, 0.4), transparent);
  filter: blur(0.5px);
}

/* 上部の微かなグロー */
.hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
  pointer-events: none;
  animation: heroAmbient 8s ease-in-out infinite;
}

@keyframes heroAmbient {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
}

/* Hero Content Layout */
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero-logo-wrapper {
  margin-bottom: 0.5rem;
  position: relative;
  /* オービタルリングのスペース確保 */
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ロゴ背後のグローリング */
.hero-logo-wrapper::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180%;
  height: 180%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  animation: pulseGlow 4s ease-in-out infinite;
  pointer-events: none;
}

/* オービタルリング 1 (外側・遅回転) */
.hero-logo-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 190px;
  height: 190px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: rgba(165, 180, 252, 0.2);
  border-right-color: rgba(168, 85, 247, 0.1);
  animation: orbitSpin 12s linear infinite;
  pointer-events: none;
}

@keyframes orbitSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* オービタルリング 2 (内側・逆回転) */
.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 170px;
  height: 170px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid transparent;
  border-bottom-color: rgba(168, 85, 247, 0.18);
  border-left-color: rgba(99, 102, 241, 0.1);
  animation: orbitSpin 8s linear infinite reverse;
  pointer-events: none;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.hero-logo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(165, 180, 252, 0.3);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 50px rgba(99, 102, 241, 0.3),
    0 0 100px rgba(99, 102, 241, 0.12);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.5s ease,
    border-color 0.5s ease;
}

.hero-logo:hover {
  transform: scale(1.08) rotate(5deg);
  border-color: rgba(165, 180, 252, 0.4);
  box-shadow: 
    0 8px 36px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(99, 102, 241, 0.35),
    0 0 100px rgba(99, 102, 241, 0.15);
}

/* Hero Tagline */
.hero-tagline {
  font-size: 1rem;
  color: rgba(165, 180, 252, 0.7);
  margin-top: 0.5rem;
  letter-spacing: 0.06em;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards 0.6s;
  font-weight: 400;
  max-width: 460px;
  line-height: var(--lh-body);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Skill Badges (icon-only) */
.skill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid color-mix(in srgb, var(--badge-color) 40%, transparent);
  color: var(--badge-color);
  transition: all 0.2s ease;
}

.skill-badge:hover {
  background: color-mix(in srgb, var(--badge-color) 15%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--badge-color) 20%, transparent);
}

/* Stat Card */
.stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Scroll Indicator */
.scroll-indicator {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards 1.2s;
}

.scroll-indicator span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-weight: 400;
  color: var(--text-muted);
}

.mouse-icon {
  width: 24px;
  height: 36px;
  border: 2px solid rgba(165, 180, 252, 0.4);
  border-radius: 12px;
  position: relative;
}

.mouse-icon::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  animation: scrollAnim 2s infinite;
}

@keyframes scrollAnim {
  0% {
    transform: translate(-50%, 0);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, 15px);
    opacity: 0;
  }
}

/* Hero CTA Buttons */
.hero-cta {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards 0.8s;
}

.hero-cta-btn {
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  letter-spacing: 0.02em;
}

.hero-cta-btn--primary {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
  color: #fff;
  border: 1px solid rgba(165, 180, 252, 0.3);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.hero-cta-btn--primary:hover {
  transform: translateY(var(--hover-lift));
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
  border-color: rgba(165, 180, 252, 0.5);
}

.hero-cta-btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-cta-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateY(var(--hover-lift));
  border-color: rgba(255, 255, 255, 0.3);
}

.hero-content h1 {
  font-family: var(--font-logo);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 0%, #e0e7ff 25%, #a5b4fc 50%, #818cf8 75%, #6366f1 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff;
  filter: drop-shadow(0 0 40px rgba(99, 102, 241, 0.2));
  position: relative;
  animation: shimmerText 6s ease-in-out infinite;
}

@keyframes shimmerText {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

/* グリッチエフェクト (削除 — shimmerのみ保持) */
.hero-content h1.glitch-text {
  transition: filter 0.3s ease;
}

.hero-content h1.glitch-text:hover {
  filter: drop-shadow(0 0 60px rgba(99, 102, 241, 0.3));
}

.typing-text {
  font-size: 1.15rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  min-height: 1.5em;
  letter-spacing: 0.03em;
}

/* About: Smaller Side Card */
.about-wrapper {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.about-card {
  width: 100%;
  height: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* About Card: フラットレイアウト（本文 → フッター行） */
.about-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(165, 180, 252, 0.1);
  color: #a5b4fc;
  margin-bottom: 0.6rem;
}

.about-card h2 {
  font-family: var(--font-logo);
  font-size: 1.75rem;
  margin-bottom: 0.8rem;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.about-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: var(--text-md);
}

/* フッター行: ボタン + 区切り + バッジ横並び */
.about-footer {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.about-card-link {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.2rem;
  background: rgba(165, 180, 252, 0.08);
  border: 1px solid rgba(165, 180, 252, 0.15);
  border-radius: 8px;
  color: #a5b4fc;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.about-card-link:hover {
  background: rgba(165, 180, 252, 0.15);
  border-color: rgba(165, 180, 252, 0.3);
  transform: translateX(4px);
}

/* Tech Stack ストリップ（横一列） */
.about-stack-strip {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.about-stack-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.about-stack-badges {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.about-stack-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* モバイル: About */
@media (max-width: 768px) {
  .about-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .about-stack-strip {
    gap: 0.6rem;
  }

  .about-stack-divider {
    display: none;
  }

  .about-card h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }

  .about-card p {
    font-size: 0.85rem;
    line-height: 1.65;
  }

  .about-card p br {
    display: none;
  }

  .about-card-link {
    margin-top: 0.8rem;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
  }

  .about-stack-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
  }
}

.contact-card h2,
.project-card h3 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  margin-bottom: 1rem;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.projects-page-grid>.project-card {
  grid-column: span 6;
  /* Default: 2 columns on standard screens */
  height: auto;
}

@media (min-width: 1024px) {
  .projects-page-grid>.project-card {
    grid-column: span 4;
    /* 3 columns on large screens */
  }
}

@media (max-width: 768px) {
  .projects-page-grid>.project-card {
    grid-column: span 12;
    flex-direction: row;
    max-height: 160px;
    border-radius: var(--radius-md);
  }

  .projects-page-grid>.project-card .card-visual-header {
    height: auto;
    width: 110px;
    min-width: 110px;
    border-bottom: none;
    border-right: 1px solid var(--border-color);
    border-radius: 13px 0 0 13px;
  }

  .projects-page-grid>.project-card .card-visual-icon svg {
    width: 36px;
    height: 36px;
  }

  .projects-page-grid>.project-card .card-content-body {
    padding: 0.8rem 1rem;
  }

  .projects-page-grid>.project-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
  }

  .projects-page-grid>.project-card p {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .projects-page-grid>.project-card a {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}

/* Projects Wrapper (Legacy/Index) */
.projects-subgrid {
  grid-column: span 6;
  /* Changed to 6 so 6+6=12 fits in one row */
  display: flex;
  flex-direction: column;
  height: 100%;
  /* Match grid cell height */
  gap: 1.5rem;
}





/* Update Project Card to fill Flex Container */
.project-card {
  flex: 1;
  /* Grow to fill wrapper */
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Ensure Grid Stretches */
.bento-grid {
  align-items: stretch;
  /* Explicitly force stretch */
}

.project-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.project-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.project-card a {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  background: rgba(165, 180, 252, 0.06);
  border: 1px solid rgba(165, 180, 252, 0.15);
  border-radius: 8px;
  color: var(--accent-lavender);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.25s ease;
}

.project-card a:hover {
  background: rgba(165, 180, 252, 0.15);
  border-color: rgba(165, 180, 252, 0.3);
  transform: translateX(3px);
}

/* Contact: Full Width */
.contact-card {
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 1rem;
}

/* --- SNS Cards (Contact Page) --- */
.sns-cards-wrapper {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.sns-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 2rem 2.2rem;
  border-radius: 20px;
  text-decoration: none;
  color: #fff;
  min-width: 150px;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.sns-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sns-card:hover {
  transform: translateY(-5px);
}

.sns-card:hover::before {
  opacity: 1;
}

.sns-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  transition: transform 0.3s ease, background 0.3s ease;
}

.sns-card:hover .sns-icon-circle {
  transform: scale(1.12) rotate(-5deg);
  background: rgba(255, 255, 255, 0.25);
}

.sns-label {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sns-handle {
  font-size: 0.8rem;
  opacity: 0.7;
  font-weight: 400;
}

/* GitHub */
.sns-github {
  background: linear-gradient(135deg, rgba(110, 118, 129, 0.15) 0%, rgba(110, 118, 129, 0.06) 100%);
  border: 1px solid rgba(110, 118, 129, 0.3);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.sns-github:hover {
  background: linear-gradient(135deg, rgba(110, 118, 129, 0.22) 0%, rgba(110, 118, 129, 0.1) 100%);
  border-color: rgba(110, 118, 129, 0.5);
  box-shadow: 0 6px 24px rgba(110, 118, 129, 0.18);
}

/* X (Twitter) */
.sns-x {
  background: linear-gradient(135deg, rgba(29, 161, 242, 0.13) 0%, rgba(29, 161, 242, 0.04) 100%);
  border: 1px solid rgba(29, 161, 242, 0.25);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.sns-x:hover {
  background: linear-gradient(135deg, rgba(29, 161, 242, 0.2) 0%, rgba(29, 161, 242, 0.08) 100%);
  border-color: rgba(29, 161, 242, 0.45);
  box-shadow: 0 6px 24px rgba(29, 161, 242, 0.15);
}

/* Instagram */
.sns-instagram {
  background: linear-gradient(135deg, rgba(193, 53, 132, 0.13) 0%, rgba(252, 176, 69, 0.07) 100%);
  border: 1px solid rgba(193, 53, 132, 0.25);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.sns-instagram:hover {
  background: linear-gradient(135deg, rgba(193, 53, 132, 0.2) 0%, rgba(252, 176, 69, 0.12) 100%);
  border-color: rgba(193, 53, 132, 0.45);
  box-shadow: 0 6px 24px rgba(193, 53, 132, 0.15);
}

@media (max-width: 600px) {
  .sns-cards-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .sns-card {
    width: 100%;
    max-width: 280px;
  }
}

/* Page Footer */
.site-footer {
  padding: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 10;
}

.site-footer::before {
  content: '';
  display: block;
  width: 100%;
  max-width: 1200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.3), transparent);
  margin: 0 auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
}

.footer-brand {
  flex: 1;
  max-width: 320px;
}

.footer-logo {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.6rem;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.footer-social {
  display: flex;
  gap: 0.8rem;
}

.footer-social-link {
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
}

.footer-social-link:hover {
  color: #fff;
  transform: translateY(-2px);
}

.footer-nav {
  display: flex;
  gap: 3rem;
}

.footer-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav-heading {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.footer-bottom {
  text-align: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
    padding: 2rem 1rem 1.5rem;
  }

  .footer-brand {
    max-width: none;
  }

  .footer-nav {
    gap: 2rem;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-bottom {
    padding: 1rem;
  }
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  mix-blend-mode: normal;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(3, 3, 3, 0.5);
  border-bottom: 1px solid rgba(165, 180, 252, 0.08);
  transition: background 0.3s ease, padding 0.3s ease;
}

/* ヘッダー下部のグラデーションライン */
.header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg, 
    transparent 0%, 
    rgba(99, 102, 241, 0.3) 20%, 
    rgba(168, 85, 247, 0.4) 50%, 
    rgba(6, 182, 212, 0.3) 80%, 
    transparent 100%
  );
}

.logo {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.nav-menu {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.25s ease;
  letter-spacing: 0.01em;
}

.nav-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #fff;
}

/* 言語トグル */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.lang-icon {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.3s;
}
.lang-btn:hover .lang-icon {
  opacity: 1;
  transform: rotate(20deg);
}
.lang-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.nav-icon {
  color: #fff;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.nav-icon:hover {
  opacity: 1;
}

/* --- ハンバーガーメニュー --- */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.hamburger svg {
  width: 28px;
  height: 28px;
}

/* ===== Mobile Adjustments ===== */
@media (max-width: 768px) {
  /* メニュー展開時のスクロールロック */
  body.menu-open {
    overflow: hidden;
  }

  .hamburger {
    display: block;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* --- フルスクリーン ナビメニュー --- */
  .nav-menu {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(5, 5, 5, 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-menu .nav-btn {
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    padding: 1.2rem 2rem;
    width: 80%;
    max-width: 320px;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.2s, background 0.2s;
  }

  .nav-menu .nav-btn:last-of-type {
    border-bottom: none;
  }

  .nav-menu .nav-btn:hover {
    color: #fff;
    background: rgba(99, 102, 241, 0.15);
  }

  .nav-menu .nav-icon {
    margin-top: 2rem;
    opacity: 0.4;
  }

  .nav-menu-overlay {
    display: none;
  }

  /* --- レイアウト: 画面幅いっぱい --- */
  .bento-grid {
    padding: 4rem max(0.8rem, env(safe-area-inset-left)) 1.5rem;
    gap: 0.7rem;
  }

  .bento-card {
    grid-column: span 12;
    border-radius: 16px;
    padding: 1.3rem 1.1rem;
  }

  .about-wrapper,
  .projects-subgrid {
    grid-column: span 12;
  }

  /* ヒーロー: インパクト重視 */
  .hero-card {
    min-height: 50vh;
    min-height: 50dvh;
    margin-bottom: 0;
    border-radius: 16px;
    padding: 2rem 1.2rem;
    position: relative;
    overflow: hidden;
    background: 
      radial-gradient(ellipse at 50% 30%, rgba(99, 102, 241, 0.06) 0%, transparent 60%),
      rgba(255, 255, 255, 0.02);
  }

  /* ヒーロー下部のグラデーションライン */
  .hero-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(165, 180, 252, 0.3), transparent);
  }

  .hero-content {
    gap: 0.8rem;
  }

  .hero-logo-wrapper {
    margin-bottom: 0;
    width: 120px;
    height: 120px;
  }

  .hero-logo-wrapper::after,
  .orbit-ring {
    display: none;
  }

  .hero-logo {
    width: 100px;
    height: 100px;
    border: 2px solid rgba(165, 180, 252, 0.3);
    box-shadow: 
      0 0 40px rgba(99, 102, 241, 0.3),
      0 0 80px rgba(99, 102, 241, 0.1),
      0 4px 20px rgba(0, 0, 0, 0.4);
  }

  .hero-content h1 {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
    margin-bottom: 0;
    letter-spacing: -0.03em;
  }

  .typing-text {
    font-size: 0.85rem;
  }

  .hero-tagline {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    max-width: 280px;
    line-height: 1.65;
  }

  .scroll-indicator {
    margin-top: 2rem;
  }

  .scroll-indicator span {
    font-size: var(--text-xs);
  }

  .mouse-icon {
    width: 20px;
    height: 30px;
  }

  .hero-cta {
    flex-direction: column;
    gap: 0.7rem;
    align-items: center;
    margin-top: 1rem;
  }

  .hero-cta-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.82rem;
    width: 200px;
    text-align: center;
  }

  /* --- 本文テキスト全体のモバイル縮小 --- */
  .about-card p,
  .contact-card p,
  .contact-card li,
  .bento-card p,
  .bento-card li {
    font-size: 0.88rem;
    line-height: 1.65;
  }

  .hero-tagline {
    font-size: 0.82rem;
  }

  .project-card p {
    font-size: 0.85rem;
  }

  .project-card a {
    font-size: 0.8rem;
  }

  .sns-label {
    font-size: 0.95rem;
  }

  .sns-handle {
    font-size: 0.75rem;
  }

  .scroll-indicator {
    margin-top: 2rem;
  }

  .scroll-indicator span {
    font-size: 0.7rem;
  }

  /* コンタクト */
  .contact-card {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 1.2rem 1rem;
  }

  /* Index: プロジェクトカード横型 */
  .projects-subgrid .project-card {
    flex-direction: row;
    max-height: 130px;
    border-radius: var(--radius-md);
    padding: 0;
  }

  .projects-subgrid .project-card .card-visual-header {
    height: auto;
    width: 90px;
    min-width: 90px;
    border-bottom: none;
    border-right: 1px solid var(--border-color);
    border-radius: 13px 0 0 13px;
  }

  .projects-subgrid .project-card .card-visual-icon svg {
    width: 28px;
    height: 28px;
  }

  .projects-subgrid .project-card .card-content-body {
    padding: 0.6rem 0.8rem;
  }

  .projects-subgrid .project-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
  }

  .projects-subgrid .project-card p {
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .projects-subgrid .project-card a {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
  }

  /* ホームナビカード: モバイルでフル幅 */
  .home-nav-card--projects,
  .home-nav-card--blog,
  .home-nav-card--connect {
    grid-column: span 12;
  }

  /* ヘッダー */
  .header {
    padding: 0.5rem 0.8rem;
    background: rgba(3, 3, 3, 0.65);
    border-bottom-color: rgba(165, 180, 252, 0.06);
  }

  .logo {
    font-size: 1.15rem;
  }

  /* タッチターゲットの最低サイズ確保 (44×44px) */
  .hero-cta-btn,
  .nav-btn,
  .filter-tag,
  .about-card-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* テキストコンテンツ */
  .text-content-card {
    padding: 1.2rem 1rem;
  }

  .text-content-card h1 {
    font-size: 1.7rem;
    padding-left: 0;
  }

  .text-content-card h1::before {
    display: none;
  }

  .blog-page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .blog-page-desc {
    font-size: var(--text-sm);
  }

  .blog-controls {
    margin-bottom: 1.2rem;
  }

  .filter-tag {
    padding: 0.3rem 0.6rem;
    font-size: var(--text-xs);
  }

  .text-content-card h2 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
  }

  .text-content-card p,
  .text-content-card li {
    font-size: 0.88rem;
    line-height: 1.65;
  }

  /* ブログ / Markdown コンテンツ */
  .blog-preview-grid {
    gap: 1rem;
  }

  .blog-preview-card {
    border-radius: 12px;
  }

  /* ヒーローカードはモバイルで縦並びに */
  .blog-hero-card {
    flex-direction: column;
  }

  .blog-hero-card .blog-preview-banner {
    width: 100%;
    min-width: auto;
    height: 100px;
    border-radius: 12px 12px 0 0;
  }

  .blog-hero-card .blog-banner-emoji {
    font-size: 2.2rem;
  }

  .blog-hero-card .blog-preview-body {
    padding: 1rem 1.1rem;
  }

  .blog-hero-card .blog-preview-title {
    font-size: 1.05rem;
  }

  .blog-hero-card .blog-preview-excerpt {
    font-size: var(--text-sm);
    -webkit-line-clamp: 3;
  }

  /* バナー */
  .blog-preview-banner {
    height: 80px;
  }

  .blog-banner-emoji {
    font-size: 2rem;
  }

  .blog-preview-body {
    padding: 1rem 1.1rem;
  }

  .blog-preview-header {
    margin-bottom: 0.4rem;
  }

  .blog-preview-title {
    font-size: 0.9rem;
  }

  .blog-preview-excerpt {
    font-size: var(--text-xs);
    -webkit-line-clamp: 2;
    margin-bottom: 0.8rem;
  }

  .blog-preview-readmore {
    font-size: var(--text-xs);
  }

  .blog-preview-tag {
    font-size: var(--text-xs);
    padding: 0.15rem 0.4rem;
  }

  .blog-preview-date {
    font-size: var(--text-xs);
  }

  .blog-preview-footer {
    padding-bottom: 1rem;
  }

  .markdown-content h1 {
    font-size: 1.5rem;
  }

  .markdown-content h2 {
    font-size: 1.15rem;
  }

  .markdown-content h3 {
    font-size: 1rem;
  }

  .markdown-content p,
  .markdown-content li {
    font-size: 0.88rem;
    line-height: 1.7;
  }

  .markdown-content pre code {
    font-size: 0.78rem;
  }

  .markdown-content table {
    font-size: 0.8rem;
  }

  .blog-back-link {
    font-size: 0.78rem;
  }

  /* フッター */
  .site-footer {
    padding: 2rem 0.8rem 1.5rem;
    font-size: 0.75rem;
  }

  .site-footer::before {
    margin-bottom: 1rem;
    width: 60px;
  }
}

/* ===== Extra Small Screens ===== */
@media (max-width: 480px) {
  .hero-content h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .hero-cta-btn {
    width: 100%;
    max-width: 260px;
  }

  .bento-grid {
    padding: 3.5rem 0.5rem 1rem;
    gap: 0.5rem;
  }

  .bento-card {
    padding: 1rem;
  }

  .about-stack-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .home-featured-grid,
  .home-blog-grid {
    grid-template-columns: 1fr;
  }

  .footer-nav {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }
}

/* --- Content Pages --- */
.text-content-card {
  grid-column: span 12;
  text-align: left;
  display: block;
  padding: 2.5rem 2rem;
  line-height: 1.8;
}

.text-content-card h1 {
  font-family: var(--font-logo);
  font-size: 3.2rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 30%, #a5b4fc 55%, #818cf8 80%, #6366f1 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline-block;
  letter-spacing: -0.02em;
  line-height: 1.2;
  padding-bottom: 0.8rem;
  filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.15));
}

/* h1 の下部にアクセントライン */
.text-content-card h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 72px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-violet), rgba(6, 182, 212, 0.5));
}

/* h1 アクセントドット — 削除済み */

/* ページ説明文のスタイル強化 */
.text-content-card > p {
  position: relative;
  padding-left: 1rem;
  border-left: 2px solid rgba(99, 102, 241, 0.4);
}

/* ==================== */
/* Blog ページヘッダー   */
/* ==================== */
.blog-page-header {
  margin-bottom: 2rem;
}

.blog-page-header h1 {
  font-family: var(--font-logo);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 0.6rem;
  padding-bottom: 0.6rem;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 60%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-page-desc {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: 0;
  padding-left: 0.8rem;
  border-left: 2px solid rgba(99, 102, 241, 0.25);
  line-height: 1.6;
}

/* Blog タグフィルター */
.blog-controls {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ブログ検索入力 */
.blog-search-wrapper {
  position: relative;
  max-width: 400px;
}

.blog-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #64748b);
  pointer-events: none;
}

.blog-search-input {
  width: 100%;
  padding: 0.6rem 0.75rem 0.6rem 2.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md, 8px);
  color: var(--text-primary, #f1f5f9);
  font-size: 0.9rem;
  font-family: var(--font-main, "Inter", sans-serif);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.blog-search-input::placeholder {
  color: var(--text-muted, #64748b);
}

.blog-search-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* iOS ズーム防止 */
@supports (-webkit-touch-callout: none) {
  .blog-search-input {
    font-size: 16px;
  }
}

/* ブログ空ステート */
.blog-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 1rem;
  width: 100%;
  text-align: center;
  color: var(--text-muted, #64748b);
}

.blog-empty-state svg {
  opacity: 0.4;
}

.blog-empty-state p {
  font-size: 0.95rem;
  margin: 0;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .blog-search-wrapper {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-search-input {
    transition: none;
  }
}

.blog-tag-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 0.3rem;
}

.blog-tag-list::-webkit-scrollbar {
  display: none;
}

.filter-tag {
  padding: 0.4rem 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-tag:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

.filter-tag.active {
  background: rgba(165, 180, 252, 0.15);
  border-color: rgba(165, 180, 252, 0.25);
  color: #a5b4fc;
}

/* text-content-card h1 モバイル対応は上記 main mobile block 内で統合済み */

.text-content-card h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

.text-content-card p,
.text-content-card li {
  color: var(--text-light);
  font-size: var(--text-lg);
  margin-bottom: 1rem;
}

.text-content-card ul {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

.text-content-card a {
  color: #a5b4fc;
  text-decoration: underline;
}

/* Blog preview cards are now <div>, no anchor override needed */

/* Markdown Content Styles */
.markdown-content h1 {
  font-size: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  color: #fff;
  font-weight: bold;
}

.markdown-content h2 {
  font-size: 1.3rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: #eee;
}

.markdown-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.markdown-content ul,
.markdown-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.markdown-content li {
  margin-bottom: 0.5rem;
}

/* ===== About Page - Rich Layout ===== */
.about-hero {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.about-hero-logo {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(99, 102, 241, 0.06);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.about-hero-logo:hover {
  transform: scale(1.03);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 60px rgba(99, 102, 241, 0.1);
}

.about-hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-hero-text h1 {
  font-family: var(--font-logo);
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 60%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline-block;
  padding-bottom: 0.6rem;
}

.about-hero-text h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #6366f1, #a78bfa, transparent);
}

.about-hero-text .about-tagline {
  color: #a5b4fc;
  font-size: 1.1rem;
  line-height: 1.6;
}

.about-section {
  margin-bottom: 2rem;
}

.about-section:last-child {
  margin-bottom: 0;
}

.about-section h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.about-section h2 .section-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(165, 180, 252, 0.1);
  color: #a5b4fc;
  flex-shrink: 0;
}

.about-section p {
  color: var(--text-light);
  line-height: 1.8;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.skill-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.2rem;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.skill-card:hover {
  border-color: rgba(165, 180, 252, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.skill-card .skill-label {
  font-size: 0.8rem;
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.skill-card .skill-items {
  color: var(--text-light);
  font-size: var(--text-md);
  line-height: 1.6;
}

.about-quote {
  background: rgba(99, 102, 241, 0.04);
  border-left: 3px solid rgba(165, 180, 252, 0.5);
  border-radius: 0 14px 14px 0;
  padding: 1.5rem 2rem;
  margin-top: 1rem;
}

.about-quote .quote-text {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: #a5b4fc;
  margin-bottom: 0.5rem;
}

.about-quote .quote-desc {
  color: var(--text-secondary);
  line-height: 1.7;
}

@media (max-width: 600px) {

  .project-card,
  .contact-card {
    grid-column: 1 / -1;
  }

  .hero-tagline {
    font-size: 0.85rem;
  }

  /* --- About ページ モバイル最適化 --- */

  /* brタグを無効化: テキストを自然にリフローさせる */
  .about-section p br,
  .about-quote .quote-desc br,
  .about-tagline br {
    display: none;
  }

  .about-hero {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
  }

  .about-hero-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
  }

  .about-hero-text h1 {
    font-size: 1.5rem;
    padding-bottom: 0.4rem;
  }

  .about-hero-text h1::after {
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 2px;
  }

  .about-hero-text .about-tagline {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .about-section {
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 1rem 1rem;
  }

  .about-section + .about-section {
    margin-top: 0.5rem;
  }

  .about-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.35rem;
    gap: 0.5rem;
  }

  .about-section h2 .section-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
  }

  .about-section h2 .section-icon svg {
    width: 13px;
    height: 13px;
  }

  .about-section p {
    font-size: 0.85rem;
    line-height: 1.7;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.6rem;
  }

  .skill-card {
    padding: 0.75rem 0.7rem;
    border-radius: 10px;
  }

  .skill-card .skill-label {
    font-size: var(--text-xs);
    margin-bottom: 0.3rem;
  }

  .skill-card .skill-items {
    font-size: 0.78rem;
    line-height: 1.5;
  }

  .about-quote {
    padding: 0.8rem 1rem;
    border-radius: 0 10px 10px 0;
    border-left-width: 2px;
    margin-top: 0.6rem;
  }

  .about-quote .quote-text {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
  }

  .about-quote .quote-desc {
    font-size: 0.82rem;
    line-height: 1.6;
  }
}

/* --- Blog Preview Cards --- */
.blog-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.blog-preview-card {
  display: flex;
  flex-direction: column;
  background: rgba(15, 15, 20, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 16px;
  padding: 0;
  text-decoration: none !important;
  color: inherit;
  cursor: pointer;
  position: relative;
  z-index: 5;
  overflow: hidden;
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.35s ease;
  animation: blogCardFadeIn 0.5s ease both;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.15),
    0 8px 24px rgba(0, 0, 0, 0.1);
}

/* カード上部バナーエリア */
.blog-preview-banner {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.blog-preview-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(15, 15, 20, 0.8) 100%);
  pointer-events: none;
}

.blog-banner-emoji {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s ease;
  position: relative;
  z-index: 1;
}

.blog-preview-card:hover .blog-banner-emoji {
  transform: scale(1.3) rotate(-8deg);
}

/* カード本体 */
.blog-preview-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.2rem 1.4rem 1.2rem;
}

.blog-preview-body .blog-preview-header,
.blog-preview-body .blog-preview-title,
.blog-preview-body .blog-preview-excerpt,
.blog-preview-body .blog-preview-footer {
  padding-left: 0;
  padding-right: 0;
}

/* ヒーローカード（最新記事を大きく表示） */
.blog-hero-card {
  grid-column: 1 / -1;
  flex-direction: row;
}

.blog-hero-card .blog-preview-banner {
  width: 280px;
  min-width: 280px;
  height: auto;
  min-height: 200px;
  border-radius: 16px 0 0 16px;
}

.blog-hero-card .blog-banner-emoji {
  font-size: 3.5rem;
}

.blog-hero-card .blog-preview-body {
  padding: 1.6rem 1.8rem;
}

.blog-hero-card .blog-preview-title {
  font-size: 1.35rem;
  -webkit-line-clamp: 3;
}

.blog-hero-card .blog-preview-excerpt {
  -webkit-line-clamp: 4;
  font-size: var(--text-base);
}

.blog-preview-card,
.blog-preview-card * {
  text-decoration: none;
}

/* ヒーローカード: モバイル対応（ベーススタイル直後に配置 — カスケード順序対策） */
@media (max-width: 768px) {
  .blog-hero-card {
    flex-direction: column;
  }

  .blog-hero-card .blog-preview-banner {
    width: 100%;
    min-width: auto;
    height: 100px;
    border-radius: 12px 12px 0 0;
  }

  .blog-hero-card .blog-banner-emoji {
    font-size: 2.2rem;
  }

  .blog-hero-card .blog-preview-body {
    padding: 1rem 1.1rem;
  }

  .blog-hero-card .blog-preview-title {
    font-size: 1.05rem;
  }

  .blog-hero-card .blog-preview-excerpt {
    font-size: var(--text-sm);
    -webkit-line-clamp: 3;
  }

  .blog-preview-banner {
    height: 80px;
  }

  .blog-banner-emoji {
    font-size: 2rem;
  }

  .blog-preview-body {
    padding: 1rem 1.1rem;
  }
}

.blog-preview-card:hover {
  background: rgba(25, 25, 35, 0.8);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-5px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    0 0 40px rgba(99, 102, 241, 0.1);
}

@keyframes blogCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-preview-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.blog-preview-date {
  font-size: var(--text-xs);
  color: var(--accent-indigo);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.blog-preview-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.7rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.blog-preview-card:hover .blog-preview-title {
  color: #fff;
}

.blog-preview-excerpt {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
}

.blog-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.2rem;
  margin-top: auto;
}

.blog-preview-tags {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.blog-preview-tag {
  font-size: var(--text-xs);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid rgba(99, 102, 241, 0.12);
  transition: all 0.2s ease;
}

.blog-preview-card:hover .blog-preview-tag {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.3);
}

.blog-preview-readmore {
  font-size: var(--text-xs);
  color: var(--accent-lavender);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.25s ease, transform 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.blog-preview-card:hover .blog-preview-readmore {
  color: #c4b5fd;
  transform: translateX(4px);
}

/* --- Blog Post Page --- */
.blog-back-link {
  display: inline-block;
  color: #a5b4fc;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.blog-back-link:hover {
  color: #c4b5fd;
}

/* Markdown content styling for blog posts */
.markdown-content h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.markdown-content h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--accent-lavender);
}

.markdown-content h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent-purple);
}

.markdown-content p {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.markdown-content ul,
.markdown-content ol {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.markdown-content li {
  margin-bottom: 0.3rem;
}

.markdown-content code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: #e2e8f0;
}

.markdown-content pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.2rem;
  overflow-x: auto;
  margin-bottom: 1.2rem;
}

.markdown-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.6rem 1rem;
  text-align: left;
}

.markdown-content th {
  background: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
  font-weight: 600;
}

.markdown-content td {
  color: var(--text-light);
}

.markdown-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.markdown-content a {
  color: var(--accent-lavender);
  text-decoration: none;
}

.markdown-content a:hover {
  color: var(--accent-purple);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .blog-preview-grid {
    grid-template-columns: 1fr;
  }

  .markdown-content h1 {
    font-size: 1.4rem;
  }

  .markdown-content h2 {
    font-size: 1.1rem;
  }

  .markdown-content pre {
    padding: 0.8rem;
    font-size: 0.8rem;
  }
}

/* --- View Transitions (Phase 2) --- */
@media (prefers-reduced-motion: no-preference) {

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.5s;
    mix-blend-mode: normal;
  }
}

/* --- 3D Tilt Effect Utility (Phase 2) --- */
.bento-card {
  transform-style: preserve-3d;
  /* perspective is handled in JS transform or parent */
}

/* --- Projects Page Layout Fixes --- */
.text-content-card {
  grid-column: 1 / -1;
}

.projects-page-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}

.projects-page-grid .project-card .card-content-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}


/* --- Blog Readability (Phase 4) --- */

/* 記事内タグ表示 */
.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
  margin-bottom: 1.5rem;
}

.blog-post-tag {
  padding: 0.3rem 0.7rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
}

/* Table of Contents - 折りたたみ式 */
/* ============================================ */
/* ブログ: 目次サイドバー                       */
/* ============================================ */

/* 記事表示時のグリッドレイアウトは JS で body.blog-single-active を付与して制御 */
body.blog-single-active .bento-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 0;
  align-items: start;
}

body.blog-single-active .bento-card.text-content-card {
  grid-column: 1;
}

.blog-toc-sidebar {
  display: none; /* 記事一覧時は非表示 */
}

body.blog-single-active .blog-toc-sidebar {
  display: block;
  grid-column: 2;
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(165, 180, 252, 0.2) transparent;
  padding-top: 8rem; /* ヘッダー分 + タイトル分の余白 */
}

.blog-toc {
  background: transparent;
  border: none;
  padding: 0 0.5rem;
}

.blog-toc-title {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.blog-toc-icon {
  font-size: 0.8rem;
}

.blog-toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.blog-toc li {
  margin-bottom: 0.1rem;
}

.blog-toc li a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
  font-size: 0.75rem;
  display: block;
  padding: 0.15rem 0 0.15rem 0.6rem;
  line-height: 1.45;
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-toc li a:hover {
  color: var(--accent-lavender);
  white-space: normal;
}

.blog-toc li a.toc-active {
  color: var(--accent-lavender);
  border-left-color: var(--accent-lavender);
  font-weight: 500;
}

/* h3 インデント */
.toc-h3 {
  padding-left: 0.6rem;
}

.toc-h3 a {
  font-size: 0.7rem !important;
}

/* モバイル/タブレット: サイドバー非表示 */
@media (max-width: 1024px) {
  body.blog-single-active .bento-grid {
    grid-template-columns: 1fr;
  }

  body.blog-single-active .blog-toc-sidebar {
    display: none;
  }
}

/* Blog Headings */
#blog-single-content h2 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  font-size: 1.8rem;
  color: #fff;
  position: relative;
  border: none;
}

#blog-single-content h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, #6366f1 0%, #a78bfa 30%, transparent 100%);
}

#blog-single-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  color: #e0e7ff;
  padding-left: 0.8rem;
  border-left: 3px solid rgba(99, 102, 241, 0.5);
}

#blog-single-content p,
#blog-single-content li {
  line-height: 1.8;
  margin-bottom: 1.2rem;
  color: var(--text-light);
}

/* リード文（h1直後の最初の段落を強調） */
#blog-single-content .blog-post-tags + p,
#blog-single-content .reading-time + p,
#blog-single-content h1 + p {
  font-size: 1.1rem;
  color: #b8b8b8;
  line-height: 1.9;
  border-left: 3px solid rgba(165, 180, 252, 0.3);
  padding-left: 1rem;
  margin-bottom: 2rem;
}

/* 引用 (blockquote) - コールアウトスタイル */
#blog-single-content blockquote {
  background: rgba(99, 102, 241, 0.06);
  border-left: 4px solid #6366f1;
  border-radius: 0 12px 12px 0;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  position: relative;
  color: #c4b5fd;
}

#blog-single-content blockquote::before {
  content: '\201C';
  position: absolute;
  top: -0.2rem;
  left: 0.6rem;
  font-size: 3rem;
  color: rgba(99, 102, 241, 0.2);
  font-family: Georgia, serif;
  line-height: 1;
}

#blog-single-content blockquote p {
  color: #c4b5fd;
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

#blog-single-content blockquote p:last-child {
  margin-bottom: 0;
}

/* リスト - カスタムブレット */
#blog-single-content ul {
  list-style: none;
  padding-left: 0;
}

#blog-single-content ul > li {
  position: relative;
  padding-left: 1.6rem;
}

#blog-single-content ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  transform: rotate(45deg);
}

#blog-single-content ol {
  padding-left: 1.5rem;
  counter-reset: ol-counter;
  list-style: none;
}

#blog-single-content ol > li {
  counter-increment: ol-counter;
  position: relative;
  padding-left: 1.2rem;
}

#blog-single-content ol > li::before {
  content: counter(ol-counter);
  position: absolute;
  left: -0.8rem;
  top: 0.1em;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  font-size: 0.75em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 区切り線 (hr) */
#blog-single-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
  margin: 2.5rem 0;
}

/* 画像スタイリング */
#blog-single-content img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  margin: 1.5rem 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#blog-single-content img:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* コールアウトボックス（Markdown内で使用） */
.callout {
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  font-size: 0.95rem;
  line-height: 1.7;
}

.callout-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.callout-body {
  flex: 1;
}

.callout-body p {
  margin: 0 !important;
  font-size: 0.95rem !important;
}

.callout-body strong {
  display: block;
  margin-bottom: 0.3rem;
}

.callout-info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.callout-tip {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.callout-danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.callout-memo {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

/* コードブロック言語ラベル */
.code-block-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.code-lang-label {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 0 12px 0 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 1;
}

/* コードブロック コピーボタン */
.code-copy-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(30, 30, 40, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--text-secondary, #94a3b8);
  font-size: 0.75rem;
  font-family: var(--font-main, "Inter", sans-serif);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}

.code-block-wrapper:hover .code-copy-btn,
.code-copy-btn:focus-visible {
  opacity: 1;
}

.code-copy-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.5);
}

.code-copy-btn:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 2px;
}

.code-copy-btn.copied {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
  opacity: 1;
}

.code-copy-btn svg {
  flex-shrink: 0;
}

/* 言語ラベルとコピーボタンの共存時: ラベルを左に移動 */
.code-block-wrapper .code-lang-label + .code-copy-btn {
  /* コピーボタンは右上に配置済み */
}

.code-block-wrapper .code-lang-label:first-child {
  right: auto;
  left: 0;
  border-radius: 12px 0 8px 0;
}

/* モバイル: コピーボタン常時表示 */
@media (max-width: 768px) {
  .code-copy-btn {
    opacity: 1;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .code-copy-btn {
    transition: none;
  }
}

.code-block-wrapper pre {
  margin-bottom: 0;
}

/* 読書プログレスバー */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a78bfa, #c4b5fd);
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

/* 推定読了時間 */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.reading-time-icon {
  font-size: 1rem;
}

/* ============================================ */
/* インラインスタイル置換用クラス               */
/* ============================================ */

/* ロゴリンク */
.logo-link {
  color: #fff;
  text-decoration: none;
}

/* フッターリンク行 */
.footer-links {
  margin-top: 0.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  font-size: var(--text-sm);
}

.footer-links--legal {
  margin-top: 0.3rem;
  font-size: calc(var(--text-sm) - 0.05rem);
  opacity: 0.7;
}

/* ホーム: ナビカード共通 */
.home-nav-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition:
    transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.35s ease,
    box-shadow 0.4s ease;
}

.home-nav-card:hover {
  transform: translateY(var(--hover-lift));
}

.home-nav-card--projects {
  grid-column: span 4;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(49, 46, 129, 0.8) 100%);
  border-color: rgba(99, 102, 241, 0.2);
}

.home-nav-card--projects:hover {
  border-color: rgba(165, 180, 252, 0.5);
  background: linear-gradient(135deg, rgba(15, 23, 42, 1) 0%, rgba(49, 46, 129, 0.95) 100%);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(99, 102, 241, 0.15);
}

.home-nav-card--blog {
  grid-column: span 4;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.7) 0%, rgba(5, 150, 105, 0.35) 100%);
  border-color: rgba(16, 185, 129, 0.2);
}

.home-nav-card--blog:hover {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.85) 0%, rgba(5, 150, 105, 0.5) 100%);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(16, 185, 129, 0.12);
}

.home-nav-card--connect {
  grid-column: span 4;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.5) 0%, rgba(168, 85, 247, 0.2) 100%);
  border-color: rgba(168, 85, 247, 0.15);
}

.home-connect-sns-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.home-nav-card--connect:hover {
  border-color: rgba(168, 85, 247, 0.4);
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.65) 0%, rgba(168, 85, 247, 0.35) 100%);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(168, 85, 247, 0.1);
}

.home-nav-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.home-nav-label {
  font-size: var(--text-md);
  font-weight: 600;
  color: #fff;
}

.home-nav-count {
  font-size: 1.1rem;
  font-weight: 800;
}

.home-nav-count--indigo {
  color: var(--accent-lavender);
}

.home-nav-count--white {
  color: rgba(255, 255, 255, 0.9);
}

.home-nav-arrow {
  color: var(--text-muted);
  font-size: var(--text-xs);
  transition: transform 0.3s ease, color 0.3s ease;
}

.home-nav-card:hover .home-nav-arrow {
  transform: translateX(3px);
  color: var(--text-light);
}

.home-nav-arrow--light {
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--text-xs);
  transition: transform 0.3s ease, color 0.3s ease;
}

.home-nav-card:hover .home-nav-arrow--light {
  transform: translateX(3px);
  color: rgba(255, 255, 255, 0.8);
}

/* Connect ソーシャルリンク */
.home-social-link {
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  font-size: var(--text-xs);
  white-space: nowrap;
  transition: color 0.25s ease, transform 0.25s ease;
}

.home-social-link:hover {
  color: #fff;
  transform: translateY(-1px);
}

/* Connect タイトル */
.home-connect-label {
  font-size: var(--text-md);
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

/* モバイル: ナビカードをフル幅に（カスケード順序修正） */
@media (max-width: 768px) {
  .home-nav-card--projects,
  .home-nav-card--blog,
  .home-nav-card--connect {
    grid-column: span 12;
  }

  .home-nav-card {
    padding: 1.2rem 1rem;
  }

  .home-connect-sns-row {
    flex-wrap: wrap;
    gap: 0.8rem;
  }
}

/* About カード full width */
.about-card--home {
  grid-column: 1 / -1;
  height: auto;
}

/* ============================================ */
/* ホームページ セクション (Featured / Latest)  */
/* ============================================ */
.home-section {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.home-section-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.home-section-link {
  font-size: var(--text-sm);
  color: var(--accent-lavender);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.home-section-link:hover {
  color: var(--accent-purple);
  transform: translateX(3px);
}

/* Featured Projects Grid (ホーム用) */
.home-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

/* ホーム用プロジェクトカードのコンパクト化 */
.home-featured-grid .project-card .card-visual-header {
  height: 120px;
}

.home-featured-grid .project-card .card-visual-icon svg {
  width: 36px;
  height: 36px;
}

.home-featured-grid .project-card .card-content-body {
  padding: 0.8rem 1.2rem 1rem;
}

.home-featured-grid .project-card .card-content-body h3 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.home-featured-grid .project-card .card-content-body p {
  font-size: var(--text-sm);
  line-height: 1.5;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-featured-grid .project-card .card-content-body a {
  font-size: var(--text-xs);
  margin-top: 0.5rem;
}

/* Latest Blog Grid (ホーム用) */
.home-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* ブログカード (ホーム用) */
.home-blog-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm, 10px);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.home-blog-card:hover {
  transform: translateY(var(--hover-lift, -4px));
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
.home-blog-emoji {
  font-size: 1.5rem;
  line-height: 1;
}
.home-blog-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}
.home-blog-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-primary);
}
.home-blog-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}
.home-blog-tags .blog-preview-tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  font-weight: 500;
}

@media (max-width: 768px) {
  .home-featured-grid {
    grid-template-columns: 1fr;
  }
  .home-blog-grid {
    grid-template-columns: 1fr;
  }
  .home-section-title {
    font-size: 1.15rem;
  }
}

/* ===== マイクロインタラクション ===== */

/* リンクのアンダーラインアニメーション */
.footer-link,
.home-section-link {
  position: relative;
}
.footer-link::after,
.home-section-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-primary);
  transition: width 0.3s ease;
}
.footer-link:hover::after,
.home-section-link:hover::after {
  width: 100%;
}

/* カードホバーでのボーダーグロー効果 */
.bento-card:hover,
.project-card:hover,
.home-blog-card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 30px rgba(99, 102, 241, 0.06);
}

/* ボタンクリック時の微細なフィードバック */
.hero-cta-btn:active,
.nav-btn:active,
.error-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Social リンクのホバーエフェクト */
.footer-social-link {
  transition: color 0.2s, transform 0.25s;
}
.footer-social-link:hover {
  transform: translateY(-2px) scale(1.1);
}

/* Contact ページ */
.contact-content {
  text-align: center;
}

.contact-desc {
  margin: 0.5rem auto 0;
}

/* Projects ページ */
.projects-desc {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.projects-header {
  margin-bottom: 0;
}

/* プロジェクトカードリンク */
.project-link {
  margin-top: 1rem;
  align-self: flex-start;
}

/* 法的ページ（Privacy/Terms）の border-left 無効化 */
.text-content-card--legal > p {
  border-left: none;
  padding-left: 0;
}

/* 最終更新日 */
.legal-updated {
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============================================ */
/* 前後記事ナビゲーション                       */
/* ============================================ */
.blog-prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-prev-next-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  transition: all 0.3s ease;
}

.blog-prev-next-link:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

.blog-prev-next-link--next {
  text-align: right;
}

.blog-prev-next-label {
  font-size: var(--text-xs);
  color: var(--accent-indigo);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.blog-prev-next-title {
  font-size: var(--text-sm);
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 600px) {
  .blog-prev-next {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-top: 2rem;
  }

  .blog-prev-next-link--next {
    text-align: left;
  }
}

/* ============================================ */
/* prefers-reduced-motion (アクセシビリティ)     */
/* ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .aurora-orb {
    animation: none;
    opacity: 0.3;
  }

  .hero-tagline {
    opacity: 1;
    animation: none;
  }

  .hero-cta {
    opacity: 1;
    animation: none;
  }

  .orbit-ring,
  .hero-logo-wrapper::after {
    animation: none;
  }

  .scroll-indicator {
    display: none;
  }

  .blog-preview-card {
    animation: none;
  }
}

/* ============================================ */
/* タブレット対応 (769px - 1024px)              */
/* ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .bento-grid {
    padding: 6rem 1.5rem 3rem;
    gap: 1rem;
  }

  .bento-card {
    border-radius: var(--radius-lg);
  }

  .hero-card {
    min-height: 50vh;
  }

  .hero-content h1 {
    font-size: clamp(3rem, 8vw, 5rem);
  }

  .home-nav-card--projects,
  .home-nav-card--blog,
  .home-nav-card--connect {
    grid-column: span 4;
  }

  .text-content-card {
    padding: 2rem 1.5rem;
  }

  .text-content-card h1 {
    font-size: 2.4rem;
  }

  .about-hero {
    gap: 1.5rem;
  }

  .about-hero-logo {
    width: 100px;
    height: 100px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sns-card {
    padding: 1.5rem 1.8rem;
    min-width: 130px;
  }

  .blog-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================ */
/* スクロールアニメーション (Intersection Observer) */
/* ============================================ */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* スタガー遅延 */
.scroll-reveal[data-delay="1"] { transition-delay: 0.1s; }
.scroll-reveal[data-delay="2"] { transition-delay: 0.2s; }
.scroll-reveal[data-delay="3"] { transition-delay: 0.3s; }

/* ============================================ */
/* Back to Top ボタン                           */
/* ============================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(165, 180, 252, 0.2);
  background: rgba(15, 15, 20, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--accent-lavender);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(165, 180, 252, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ============================================ */
/* 動的ヘッダー（スクロールで非表示／再表示）    */
/* ============================================ */
.header {
  transition: background 0.3s ease, padding 0.3s ease, transform 0.3s ease;
}

.header.header--hidden {
  transform: translateY(-100%);
}

.header.header--scrolled {
  background: rgba(3, 3, 3, 0.85);
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ============================================ */
/* エラーステート統一コンポーネント             */
/* ============================================ */
.error-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 1.5rem;
  width: 100%;
  text-align: center;
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md, 8px);
}

.error-card svg {
  color: rgba(239, 68, 68, 0.5);
}

.error-card p {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.9rem;
  margin: 0;
}

.error-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm, 6px);
  color: #a5b4fc;
  font-size: 0.85rem;
  font-family: var(--font-main, "Inter", sans-serif);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  min-height: 44px;
  min-width: 44px;
}

.error-retry-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
}

.error-retry-btn:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .error-retry-btn {
    transition: none;
  }
}

/* ============================================ */
/* 日本語テキスト最適化                         */
/* ============================================ */
/* レイアウト要素(ヘッダー/ヒーロー/ナビ/フッター */
/* /CTA)には影響させず、本文テキストのみに適用    */

/* word-break のみグローバル（レイアウトに影響小） */
:lang(ja) {
  word-break: break-all;
  overflow-wrap: break-word;
}

/* 本文テキスト用: line-height/letter-spacing を適用 */
:lang(ja) .article-body,
:lang(ja) .blog-content,
:lang(ja) .card-desc,
:lang(ja) .project-desc,
:lang(ja) .project-description,
:lang(ja) .about-card p,
:lang(ja) .privacy-content p,
:lang(ja) .terms-content p {
  line-height: 1.9;
  letter-spacing: 0.04em;
}

/* コンテンツ見出し用 */
:lang(ja) .article-body h2,
:lang(ja) .article-body h3,
:lang(ja) .blog-content h2,
:lang(ja) .blog-content h3 {
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* ============================================ */
/* Aurora 背景最適化（モバイル: 静的グラデ）    */
/* ============================================ */
@media (max-width: 768px) {
  .aurora-orb.orb-3 {
    display: none; /* 3つ目のorbをモバイルで非表示 */
  }
  .orb-1 {
    width: 80vw;
    height: 80vw;
    filter: blur(80px);
    opacity: 0.4;
  }
  .orb-2 {
    width: 60vw;
    height: 60vw;
    filter: blur(80px);
    opacity: 0.35;
  }
}

/* Grid Overlay: Heroセクションのみに制限 */
.grid-overlay {
  mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 100%);
}

@media (max-width: 768px) {
  .grid-overlay {
    display: none;
  }
}

/* ============================================= */
/* Cookie Consent Banner                         */
/* ============================================= */

.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s ease;
}

.cookie-consent--visible {
  transform: translateY(0);
  opacity: 1;
}

.cookie-consent-text {
  color: var(--text-secondary, #b0b0b0);
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.6;
  max-width: 600px;
  margin: 0;
}

.cookie-consent-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 44px;
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm, 0.875rem);
  font-weight: 600;
  font-family: var(--font-main, 'Inter', sans-serif);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: linear-gradient(135deg, var(--accent-primary, #6366f1), var(--accent-secondary, #a855f7));
  color: #fff;
}

.cookie-btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.cookie-btn-accept:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 2px;
}

.cookie-btn-decline {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, #b0b0b0);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-btn-decline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #f0f0f0);
}

.cookie-btn-decline:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 2px;
}

/* Cookie Settings フッターリンク */
.cookie-settings-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
  color: var(--text-muted, #888);
  transition: color 0.2s ease;
}

.cookie-settings-link:hover {
  color: var(--text-primary, #f0f0f0);
}

.cookie-settings-link:focus-visible {
  outline: 3px solid #a5b4fc;
  outline-offset: 2px;
}

/* レスポンシブ: モバイル */
@media (max-width: 768px) {
  .cookie-consent {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem 1rem;
    gap: 1rem;
  }

  .cookie-consent-actions {
    width: 100%;
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
  }
}

/* モーション軽減設定 */
@media (prefers-reduced-motion: reduce) {
  .cookie-consent {
    transition: none;
  }

  .cookie-consent--visible {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================================
   Blog Post Share Buttons
   ============================================================ */
.blog-share-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.blog-share-label {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
}
.blog-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}
.blog-share-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}
.blog-share-btn svg {
  width: 16px;
  height: 16px;
}
.blog-share-btn.copied {
  border-color: #10b981;
  color: #10b981;
}

/* ============================================================
   Related Articles
   ============================================================ */
.blog-related-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.blog-related-title {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 1rem;
}
.blog-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}
.blog-related-card {
  display: block;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02);
  text-decoration: none;
  transition: all 0.2s ease;
}
.blog-related-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}
.blog-related-card-emoji {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.blog-related-card-title {
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.blog-related-card-date {
  color: var(--text-secondary);
  font-size: 0.7rem;
}
@media (max-width: 768px) {
  .blog-related-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Skeleton Loading UI
   ============================================================ */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
.skeleton-card {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}
.skeleton-banner {
  height: 140px;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
  animation: skeleton-pulse 1.8s ease-in-out infinite;
}
.skeleton-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  animation: skeleton-pulse 1.8s ease-in-out infinite;
}
.skeleton-line.w-20 { width: 20%; }
.skeleton-line.w-30 { width: 30%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-blog-card {
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.skeleton-blog-card .skeleton-line {
  animation-delay: 0.3s;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-line, .skeleton-banner {
    animation: none;
    opacity: 0.6;
  }
}