/* =============================================
   Character Profile — character-common.css
   共通スタイル（全キャラクター共有）
   ============================================= */

/* ─── Base Variables ─── */
:root {
  /* ベースカラー（全キャラ共通） */
  --ink:        #16110e;
  --ink-soft:   #2d2318;
  --ink-mid:    #4a3a2e;
  --ink-light:  #7a6455;
  --paper:      #f5f0e2;
  --paper-warm: #ede5cc;
  --paper-aged: #d4c5a0;
  --paper-dark: #c4b088;

  /* アクセントカラー（各キャラCSSで上書き） */
  --accent:     #8b1a1a;
  --accent-alt: #1a3d8b;
  --accent-lt:  rgba(139,26,26,0.10);
  --gold:       #9a7d3a;
  --gold-pale:  #c8a96a;

  /* フォント */
  --ff-jp:   'Noto Serif JP', serif;
  --ff-en:   'Cormorant Garamond', serif;
  --ff-fell: 'IM Fell English', serif;

  /* タブ高さ */
  --tab-h: 44px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-jp);
  min-height: 100svh;
  overflow-x: hidden;
}

/* ─── Noise Overlay ─── */
.noise-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  opacity: 0.030;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* =============================================
   Header
   ============================================= */
.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 48px 16px;
  border-bottom: 2.5px solid var(--ink);
  position: relative;
  background: linear-gradient(180deg, var(--paper) 60%, var(--paper-warm) 100%);
}
.header::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 48px; right: 48px;
  height: 0.5px;
  background: var(--paper-aged);
}
.header-left  { display: flex; flex-direction: column; gap: 2px; }
.header-right { display: flex; justify-content: flex-end; }
.header-label {
  font-family: var(--ff-fell);
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  color: var(--ink-light);
  text-transform: uppercase;
}
.header-no {
  font-family: var(--ff-en);
  font-style: italic;
  font-size: 0.75rem;
  color: var(--ink-light);
  letter-spacing: 0.12em;
}
.header-center { text-align: center; }
.header-name-jp {
  font-family: var(--ff-jp);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.28em;
  color: var(--ink);
  line-height: 1;
  overflow-wrap: anywhere;
}
.header-name-en {
  font-family: var(--ff-fell);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--ink-light);
  letter-spacing: 0.20em;
  margin-top: 4px;
}

/* =============================================
   Tab Navigation
   ============================================= */
.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--paper-aged);
  background: var(--paper-warm);
  padding: 0 48px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  font-family: var(--ff-fell);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  color: var(--ink-light);
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  padding: 12px 20px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  position: relative;
  top: 1px;
  flex-shrink: 0;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-style: italic;
}

/* =============================================
   Tab Panels
   ============================================= */
.content-area {
  padding: 0;
  min-height: calc(100svh - 160px);
}
.tab-panel {
  display: none;
  padding: 40px 48px;
  animation: panelFade 0.35s ease;
}
.tab-panel.active { display: block; }

@keyframes panelFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   共通ユーティリティ
   ============================================= */
.section-title {
  font-family: var(--ff-fell);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  border-bottom: 1px solid var(--paper-aged);
  padding-bottom: 6px;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.section-title em {
  font-size: 0.72rem;
  color: var(--ink-light);
  letter-spacing: 0.12em;
  font-style: italic;
}

.trait-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trait-list li {
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--ink-soft);
  padding-left: 12px;
  border-left: 2px solid var(--paper-aged);
  transition: border-color 0.2s;
  overflow-wrap: anywhere;
}
.trait-list li:hover { border-left-color: var(--accent); }
.trait-list small {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-light);
  margin-top: 2px;
  font-style: italic;
}

/* キーワードラベル */
.tk {
  display: inline-block;
  font-family: var(--ff-fell);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-lt);
  border-radius: 2px;
  padding: 1px 5px;
  margin-right: 6px;
  vertical-align: middle;
}

/* =============================================
   Overview — 共通レイアウト
   ============================================= */
.overview-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: start;
}
.ov-figure-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.silhouette-frame {
  position: relative;
  padding: 16px;
  width: 100%;
}

/* フレームコーナー */
.frame-corner {
  position: absolute;
  width: 18px; height: 18px;
  border-color: var(--accent);
  border-style: solid;
  transition: border-color 0.2s;
}
.tl { top: 0; left: 0;   border-width: 2px 0 0 2px; }
.tr { top: 0; right: 0;  border-width: 2px 2px 0 0; }
.bl { bottom: 0; left: 0;  border-width: 0 0 2px 2px; }
.br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

/* キャラクター写真 */
.figure-photo {
  width: 100%;
  display: block;
  border: 1px solid var(--paper-aged);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.figure-photo.visible { opacity: 1; transform: translateY(0); }

.fig-caption {
  font-family: var(--ff-fell);
  font-style: italic;
  font-size: 0.72rem;
  color: var(--ink-light);
  letter-spacing: 0.12em;
  text-align: center;
}

/* データカラム */
.ov-data-col {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ─── Data Block ─── */
.data-block {
  border-left: 3px solid var(--paper-aged);
  padding-left: 16px;
}
.data-heading {
  font-family: var(--ff-fell);
  font-size: 0.95rem;
  letter-spacing: 0.10em;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.data-heading em { font-size: 0.72rem; color: var(--ink-light); }
.data-heading span { font-style: normal; }

/* ─── Data Table ─── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.80rem;
}
.data-table th {
  text-align: left;
  font-weight: 400;
  color: var(--ink-light);
  padding: 5px 12px 5px 0;
  width: 38%;
  border-bottom: 1px dotted var(--paper-aged);
  vertical-align: top;
}
.data-table td {
  padding: 5px 0;
  border-bottom: 1px dotted var(--paper-aged);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.data-table td b {
  font-family: var(--ff-en);
  font-size: 1.1rem;
  font-weight: 600;
}
.sub-note {
  font-size: 0.72rem;
  color: var(--ink-light);
  font-style: italic;
}

/* ─── Measurements Grid ─── */
.meas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.meas-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--paper-warm);
  border: 1px solid var(--paper-aged);
  border-radius: 3px;
  padding: 8px 4px;
  transition: border-color 0.2s, background 0.2s;
  cursor: default;
}
.meas-item:hover {
  border-color: var(--accent);
  background: var(--accent-lt);
}
.meas-num {
  font-family: var(--ff-en);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  transition: color 0.2s;
}
.meas-unit  { font-size: 0.62rem; color: var(--ink-light); margin-top: 1px; }
.meas-label { font-size: 0.62rem; color: var(--ink-light); margin-top: 3px; letter-spacing: 0.04em; text-align: center; }

/* ─── Voice Bar ─── */
.voice-wrap { display: flex; flex-direction: column; gap: 8px; }
.voice-info { font-size: 0.75rem; color: var(--ink-light); }
.voice-info strong { color: var(--ink); }
.voice-bar-outer { position: relative; padding-bottom: 18px; }
.voice-bar-track {
  position: relative;
  height: 8px;
  background: var(--paper-aged);
  border-radius: 4px;
  overflow: hidden;
}
.voice-bar-speak {
  position: absolute;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.4s 0.8s;
}
.voice-bar-sing {
  position: absolute;
  height: 100%;
  background: var(--accent-alt);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.4s 1.0s;
}
.voice-bar-speak.shown,
.voice-bar-sing.shown { opacity: 0.75; }
.voice-axis {
  display: flex;
  justify-content: space-between;
  font-family: var(--ff-en);
  font-size: 0.60rem;
  color: var(--ink-light);
  margin-top: 4px;
}
.voice-legend { font-size: 0.70rem; color: var(--ink-light); }
.vl-s { color: var(--accent); }
.vl-g { color: var(--accent-alt); }

/* ─── Quote ─── */
.ov-quote {
  border-left: 3px solid var(--accent);
  padding: 12px 18px;
  background: var(--accent-lt);
  transition: border-color 0.2s;
}
.ov-quote p {
  font-family: var(--ff-jp);
  font-size: 0.82rem;
  font-weight: 300;
  line-height: 2;
  color: var(--ink-mid);
  letter-spacing: 0.10em;
}

/* =============================================
   Appearance Tab — 共通
   ============================================= */
.appear-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.appear-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Hair volume bar */
.hair-vol-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.hvb-l, .hvb-r {
  font-family: var(--ff-fell);
  font-size: 0.65rem;
  color: var(--ink-light);
  white-space: nowrap;
}
.hvb-track {
  flex: 1;
  height: 4px;
  background: var(--paper-aged);
  border-radius: 2px;
  overflow: hidden;
}
.hvb-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  border-radius: 2px;
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s;
}

.pierce-note {
  font-size: 0.72rem;
  color: var(--ink-light);
  font-style: italic;
  line-height: 1.6;
}

/* =============================================
   Body Tab — 共通
   ============================================= */
.body-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.body-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* コンプレックスブロック */
.body-section--complex,
.body-section--trigger {
  border: 1px solid rgba(139,26,26,0.22);
  padding: 14px;
  border-radius: 3px;
  background: rgba(139,26,26,0.025);
}
.body-section--trigger .section-title {
  color: #6b1a1a;
  border-bottom-color: rgba(107,26,26,0.22);
}

.complex-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.complex-list li {
  font-size: 0.78rem;
  color: var(--ink-mid);
  padding-left: 12px;
  position: relative;
}
.complex-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.complex-note {
  display: block;
  font-size: 0.72rem;
  color: var(--accent);
  line-height: 1.6;
  margin-top: 4px;
}

/* =============================================
   Personality Tab — 共通
   ============================================= */
.pers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.pers-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pers-block--outer .section-title {
  border-bottom-color: var(--accent);
}
.pers-block--inner {
  border: 1px solid rgba(74, 85, 104, 0.18);
  padding: 14px;
  border-radius: 3px;
  background: var(--accent-lt);
}

/* =============================================
   Daily Life Tab — 共通
   ============================================= */
.daily-wrap { display: flex; flex-direction: column; gap: 32px; }
.timeline-block { display: flex; flex-direction: column; gap: 12px; }

.timeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.timeline-list::before {
  content: '';
  position: absolute;
  left: 70px;
  top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--paper-aged) 100%);
}
.timeline-list li {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 7px 0;
}
.tl-time {
  font-family: var(--ff-en);
  font-size: 0.80rem;
  color: var(--ink-light);
  white-space: nowrap;
  min-width: 60px;
  flex-shrink: 0;
  padding-top: 1px;
  letter-spacing: 0.04em;
}
.tl-ev {
  font-size: 0.80rem;
  color: var(--ink-mid);
  line-height: 1.75;
  padding-left: 20px;
  overflow-wrap: anywhere;
}
.tl-ev small {
  display: block;
  font-size: 0.70rem;
  color: var(--ink-light);
  font-style: italic;
  margin-top: 2px;
}

/* Food block */
.food-block { display: flex; flex-direction: column; gap: 12px; }
.food-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.food-item {
  padding: 12px 14px;
  border-radius: 3px;
  background: var(--paper-warm);
  border: 1px solid var(--paper-aged);
}
.food-item--like,
.food-item--neutral { border-left: 3px solid var(--accent); }
.food-item--dislike,
.food-item--avoid   { border-left: 3px solid var(--ink-light); }
.food-label {
  font-family: var(--ff-fell);
  font-size: 0.70rem;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.12em;
}
.food-item--dislike .food-label,
.food-item--avoid   .food-label { color: var(--ink-light); }
.food-item ul {
  list-style: disc;
  padding-left: 14px;
  font-size: 0.78rem;
  color: var(--ink-mid);
  line-height: 1.8;
}
.food-note {
  font-size: 0.68rem;
  color: var(--accent);
  font-style: italic;
}

/* Hobby block */
.hobby-block { display: flex; flex-direction: column; gap: 12px; }

/* =============================================
   Private Tab — 共通
   ============================================= */
.priv-grid  { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.priv-block { display: flex; flex-direction: column; gap: 12px; }
.priv-block--box,
.priv-block--note {
  border: 1px solid rgba(74, 85, 104, 0.18);
  padding: 16px;
  border-radius: 3px;
  background: var(--accent-lt);
}

/* =============================================
   Secret Tab — 共通
   ============================================= */
.secret-wrap { display: flex; flex-direction: column; gap: 36px; }
.secret-header {
  text-align: center;
  padding: 24px;
  background: var(--paper-warm);
  border: 1px solid var(--paper-aged);
  border-top: 3px solid var(--accent);
}
.secret-label {
  font-family: var(--ff-fell);
  font-size: 0.65rem;
  letter-spacing: 0.5em;
  color: var(--ink-light);
  margin-bottom: 8px;
}
.secret-title {
  font-family: var(--ff-jp);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.20em;
  color: var(--ink);
}
.secret-sub {
  font-family: var(--ff-fell);
  font-style: italic;
  font-size: 0.75rem;
  color: var(--ink-light);
  letter-spacing: 0.15em;
  margin-top: 4px;
}

.secret-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.secret-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--paper-warm);
  border: 1px solid var(--paper-aged);
  border-radius: 3px;
  border-left: 3px solid var(--accent);
}
.secret-block--full   { grid-column: 1 / -1; }
.secret-block-title {
  font-family: var(--ff-fell);
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 4px;
}

.secret-quote {
  border-left: 3px solid var(--accent);
  padding: 12px 18px;
  background: var(--accent-lt);
}
.secret-quote p {
  font-family: var(--ff-jp);
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 2.2;
  color: var(--ink-mid);
  letter-spacing: 0.12em;
}

/* =============================================
   Gallery Tab（澪のみ使用・共通定義）
   ============================================= */
.gallery-header { margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--paper-aged); }
.gallery-intro  { font-family: var(--ff-fell); font-style: italic; font-size: 0.82rem; color: var(--ink-light); letter-spacing: 0.18em; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery-item--featured { grid-column: 1; grid-row: 1 / 3; }
.gallery-item {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  animation: fadeInUp 0.5s ease both;
}
.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.12s; }
.gallery-item:nth-child(3) { animation-delay: 0.19s; }
.gallery-item:nth-child(4) { animation-delay: 0.26s; }
.gallery-item:nth-child(5) { animation-delay: 0.33s; }

.gallery-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  border: 1px solid var(--paper-aged);
  aspect-ratio: 2 / 3;
  transition: border-color 0.3s;
}
.gallery-item--featured .gallery-img-wrap {
  aspect-ratio: auto;
  height: 100%;
  min-height: 420px;
}
.gallery-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94), filter 0.4s ease;
  filter: brightness(0.97) saturate(0.95);
}
.gallery-item:hover .gallery-img-wrap { border-color: var(--gold); }
.gallery-item:hover .gallery-img-wrap img { transform: scale(1.04); filter: brightness(1) saturate(1.05); }

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(22,17,14,0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-tag  { font-family: var(--ff-fell); font-size: 0.62rem; letter-spacing: 0.20em; color: var(--gold-pale); text-transform: uppercase; margin-bottom: 4px; }
.gallery-desc { font-size: 0.72rem; color: rgba(245,240,226,0.88); line-height: 1.6; font-family: var(--ff-jp); font-weight: 300; }
.gallery-caption {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 4px 4px;
  border-bottom: 1px solid var(--paper-aged);
  transition: border-color 0.2s;
}
.gallery-item:hover .gallery-caption { border-bottom-color: var(--gold); }
.gc-num   { font-family: var(--ff-en); font-size: 0.65rem; color: var(--gold); letter-spacing: 0.12em; }
.gc-title { font-family: var(--ff-jp); font-size: 0.75rem; color: var(--ink-mid); letter-spacing: 0.06em; }

/* ─── Lightbox ─── */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(16,11,8,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.lightbox.open { display: flex; }
.lb-img-wrap { max-width: 88vw; max-height: 88vh; display: flex; align-items: center; justify-content: center; }
.lb-img-wrap img {
  max-width: 100%; max-height: 88vh;
  object-fit: contain;
  border: 1px solid rgba(154,125,58,0.3);
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
  animation: lbFadeIn 0.3s ease;
}
@keyframes lbFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.lb-close {
  position: fixed; top: 24px; right: 32px;
  background: none;
  border: 1px solid rgba(245,240,226,0.3);
  color: rgba(245,240,226,0.7);
  font-size: 1.1rem;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 501;
}
.lb-close:hover { background: rgba(245,240,226,0.12); color: var(--paper); border-color: var(--gold-pale); }
.lb-prev, .lb-next {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(245,240,226,0.06);
  border: 1px solid rgba(245,240,226,0.15);
  color: rgba(245,240,226,0.6);
  font-size: 2rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  z-index: 501; line-height: 1;
}
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-prev:hover, .lb-next:hover { background: rgba(245,240,226,0.15); color: var(--paper); border-color: var(--gold-pale); }
.lb-info { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; }
#lb-num   { font-family: var(--ff-en); font-size: 0.72rem; color: var(--gold-pale); letter-spacing: 0.15em; }
#lb-title { font-family: var(--ff-jp); font-size: 0.75rem; color: rgba(245,240,226,0.6); letter-spacing: 0.10em; }

/* =============================================
   Animations
   ============================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.data-block, .appear-block, .body-section,
.pers-block, .priv-block, .secret-block,
.daily-block, .food-block, .hobby-block {
  animation: fadeInUp 0.5s ease both;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 1024px) {
  .appear-grid { grid-template-columns: repeat(2, 1fr); }
  .body-grid   { grid-template-columns: repeat(2, 1fr); }
  .pers-grid   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Header */
  .header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 6px;
    padding: 16px 20px;
  }
  .header-right { justify-content: center; }

  /* Tabs */
  .tab-nav   { padding: 0 12px; }
  .tab-panel { padding: 24px 20px; }

  /* Grids */
  .overview-grid { grid-template-columns: 1fr; }
  .appear-grid   { grid-template-columns: 1fr; }
  .body-grid     { grid-template-columns: 1fr; }
  .pers-grid     { grid-template-columns: 1fr; }
  .priv-grid     { grid-template-columns: 1fr; }
  .secret-grid   { grid-template-columns: 1fr; }
  .food-grid     { grid-template-columns: 1fr; }

  /* Measurements */
  .meas-grid { grid-template-columns: repeat(3, 1fr); }

  /* Gallery */
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item--featured { grid-column: 1; grid-row: auto; }
}

/* ─── Focus / Reduced Motion ─── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* =============================================
   Header Nav（一覧・Topリンク）
   ============================================= */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 4px;
}
.header-nav-link {
  font-family: var(--ff-fell);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--ink-light);
  text-decoration: none;
  transition: color 0.18s;
  white-space: nowrap;
}
.header-nav-link:hover { color: var(--accent); }
.header-nav-sep {
  font-size: 0.6rem;
  color: var(--paper-aged);
}

/* =============================================
   Footer Nav（前後キャラリンク・図鑑ページめくり）
   ============================================= */
.site-footer {
  /* 3カラム：前キャラ | タイトル | 次キャラ */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  border-top: 2px solid var(--ink);
  padding: 16px 48px;
  background: var(--paper-warm);
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 48px; right: 48px;
  height: 0.5px;
  background: var(--paper-aged);
}

.footer-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink-light);
  transition: color 0.2s;
  min-width: 0;
}
.footer-nav-link:hover { color: var(--accent); }

.footer-nav-link--prev { justify-content: flex-start; }
.footer-nav-link--next { justify-content: flex-end; }

.fnl-arrow {
  font-family: var(--ff-en);
  font-size: 1.1rem;
  color: var(--paper-dark);
  transition: color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.footer-nav-link--prev:hover .fnl-arrow { transform: translateX(-3px); color: var(--accent); }
.footer-nav-link--next:hover .fnl-arrow { transform: translateX(3px);  color: var(--accent); }

.fnl-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.footer-nav-link--next .fnl-body { align-items: flex-end; }

.fnl-no {
  font-family: var(--ff-fell);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--paper-dark);
  font-style: italic;
}
.fnl-name {
  font-family: var(--ff-jp);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: inherit;
  overflow-wrap: anywhere;
}

.footer-copy {
  font-family: var(--ff-fell);
  font-size: 0.68rem;
  color: var(--ink-light);
  letter-spacing: 0.15em;
  text-align: center;
  white-space: nowrap;
}

/* ── レスポンシブ対応 ── */
@media (max-width: 768px) {
  .site-footer {
    padding: 14px 20px;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
  }
  .site-footer::before { left: 20px; right: 20px; }
  .fnl-name { font-size: 0.72rem; }
  .footer-copy { font-size: 0.6rem; }
}

@media (max-width: 480px) {
  .site-footer {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .footer-copy {
    grid-column: 1 / -1;
    order: -1;
    border-bottom: 1px dotted var(--paper-aged);
    padding-bottom: 8px;
    margin-bottom: 4px;
  }
}
