/* ==========================================================================
   ラクルゥ公式サイト 全ページ共通スタイル
   出典: ラクルゥ Design System (Claude Design 書き出し) のトークンを移植。
   生の16進カラーは :root にのみ書く (検収基準7)。
   調整記録:
     --navy-500 は原典 #5B7C93 だが、地色 #F4FAFC とのコントラスト比が
     4.19:1 で WCAG AA (4.5:1) に届かないため #506F86 (5.0:1) に暗色化。
   ========================================================================== */

:root {
  /* --- base palette --- */
  --sky-50: #F4FAFC;   /* ページ地 */
  --sky-100: #EAF6FB;  /* ヒーロー下 */
  --sky-200: #DCEAF2;  /* 罫線 */
  --sky-300: #CFEAF4;  /* ヒーロー上 */
  --sky-400: #A9DCEE;  /* 淡い塗り (文字色禁止) */
  --sky-700: #2C7392;  /* アクセント (文字可) */
  --navy-500: #506F86; /* 補助文字 (原典 #5B7C93 をAA対応で暗色化) */
  --navy-900: #16324B; /* 本文・見出し */
  --white: #FFFFFF;

  /* --- semantic surfaces --- */
  --bg: var(--sky-50);
  --surface: var(--white);
  --surface-soft: var(--sky-100);
  --fill-soft: var(--sky-400);
  --hero-gradient: linear-gradient(180deg, var(--sky-300) 0%, var(--sky-100) 100%);

  /* --- semantic text --- */
  --ink: var(--navy-900);
  --ink-2: var(--navy-500);
  --accent: var(--sky-700);
  --text-on-accent: var(--white); /* --accent の塗りの上のみ許可 */

  /* --- lines & states --- */
  --line: var(--sky-200);
  --line-strong: var(--sky-400);
  --focus-ring: var(--sky-700);
  --accent-hover: #245E79;
  --accent-wash: rgba(44, 115, 146, 0.08);

  /* --- type --- */
  --font-display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-num: "Outfit", "Zen Kaku Gothic New", sans-serif;
  --size-name: 64px;
  --size-heading: 28px;
  --size-subheading: 20px;
  --size-body: 16px;
  --size-label: 14px;
  --size-aux: 13px;
  --size-name-sp: 40px;
  --size-heading-sp: 22px;
  --leading-body: 1.8;
  --leading-heading: 1.4;
  --tracking-name: -0.02em;
  --tracking-num: 0.02em;
  --weight-body: 400;
  --weight-medium: 500;
  --weight-bold: 700;

  /* --- spacing / layout --- */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
  --max-width: 1120px;
  --text-width: 640px;

  /* --- shape / elevation / motion --- */
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow: 0 6px 20px rgba(22, 50, 75, 0.08);
  --shadow-hover: 0 10px 24px rgba(22, 50, 75, 0.12);
  --lift-hover: -2px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --duration: 160ms;
}

/* --- base ------------------------------------------------------------- */

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: var(--weight-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--leading-heading);
  color: var(--ink);
  margin: 0;
  font-weight: var(--weight-bold);
}

p { margin: 0; text-wrap: pretty; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }

img { max-width: 100%; }

.num {
  font-family: var(--font-num);
  letter-spacing: var(--tracking-num);
  font-variant-numeric: tabular-nums;
}

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-3); }

/* --- ヘッダー (3ページ完全共通・落差演出の前提) ------------------------ */

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }

.site-header .header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.tab-nav { display: flex; gap: var(--space-4); }

.tab-nav a {
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: var(--weight-medium);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color var(--duration) var(--ease);
}

.tab-nav a[aria-current="page"] {
  font-weight: var(--weight-bold);
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* --- フッター ----------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-6) var(--space-3);
  text-align: center;
  color: var(--ink-2);
  font-size: var(--size-aux);
  line-height: 1.8;
}

/* --- ボタン -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: var(--size-body);
  line-height: 1.4;
  white-space: nowrap;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background var(--duration) var(--ease),
              color var(--duration) var(--ease),
              border-color var(--duration) var(--ease);
}

.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--text-on-accent); }

.btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--line-strong); color: var(--accent); }

/* --- ヒーロー (ホーム) ---------------------------------------------------- */

.hero { background: var(--hero-gradient); }

.hero-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-3) 0;
  display: grid;
  grid-template-columns: minmax(0, 580px) minmax(420px, 1fr);
  gap: var(--space-6);
  align-items: end;
}

.hero-figure { display: flex; flex-direction: column; }

.hero-standee {
  position: relative;
  height: clamp(360px, 44vw, 600px);
  overflow: hidden;
}

.hero-standee .slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}

.hero-standee .slide.active { opacity: 1; }

.hero-standee img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: bottom;
  display: block;
}

/* 立ち絵切替サムネイル (小窓4つ) */
.hero-thumbs {
  display: flex;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2) 0;
}

.thumb {
  width: 56px;
  height: 56px;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

.thumb:hover { box-shadow: var(--shadow); }
.thumb[aria-selected="true"] { border-color: var(--accent); }

.hero-text {
  padding-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.name-kana { font-size: var(--size-aux); color: var(--ink-2); letter-spacing: 0.24em; margin-bottom: 4px; }

.name-main {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--size-name);
  letter-spacing: var(--tracking-name);
  line-height: 1.2;
  color: var(--ink);
}

.name-romaji {
  font-family: var(--font-num);
  font-size: var(--size-subheading);
  letter-spacing: 0.12em;
  color: var(--ink-2);
  margin-top: 8px;
}

.hero-catch { max-width: var(--text-width); font-size: var(--size-body); line-height: var(--leading-body); }

.hero-buttons { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.hero-video { max-width: 400px; margin-top: var(--space-1); }

.video-embed {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
  aspect-ratio: 16 / 9;
}

.video-embed iframe { width: 100%; height: 100%; border: none; display: block; }

/* --- セクション共通 ------------------------------------------------------- */

.section { padding-top: var(--space-12); }

.section-heading h2 { font-size: var(--size-heading); letter-spacing: 0.01em; }

.section-heading .latin {
  font-family: var(--font-num);
  font-size: var(--size-aux);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 4px;
}

.card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
}

/* --- プロフィール帳 -------------------------------------------------------- */

.profile-card { padding: var(--space-6); margin-top: var(--space-4); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }

.profile-list h3 { font-size: var(--size-subheading); margin-bottom: var(--space-2); }

.profile-list dl { margin: 0; }

.profile-list .row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}

.profile-list .row:first-of-type { border-top: none; }

.profile-list dt { color: var(--ink-2); font-size: var(--size-label); }
.profile-list dd { margin: 0; color: var(--ink); font-size: var(--size-body); }

/* --- リンクカード ----------------------------------------------------------- */

.link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }

.link-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.link-card:hover { transform: translateY(var(--lift-hover)); box-shadow: var(--shadow-hover); }

.link-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex: none;
}

.link-label { display: block; font-weight: var(--weight-bold); color: var(--ink); }
.link-sublabel { display: block; font-size: var(--size-aux); color: var(--ink-2); font-family: var(--font-num); }

/* --- 蛸壺ページ (意図的に貧相: カード・影・角丸・グラデなし) ----------------- */

.plain-page { padding-top: var(--space-8); padding-bottom: var(--space-12); }

.plain-avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--line); object-fit: cover; display: block; }

.plain-page h1 { font-size: var(--size-heading); margin-top: var(--space-3); }

.plain-table { border-top: 1px solid var(--line); margin-top: var(--space-4); padding-top: var(--space-1); max-width: var(--text-width); }

.plain-table .row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--space-2);
  padding: var(--space-1) 0;
}

.plain-table .row + .row { border-top: 1px solid var(--line); }

.plain-table .row span:first-child { color: var(--ink-2); font-size: var(--size-label); }

/* --- 人狼ビューア (準備中) --------------------------------------------------- */

.werewolf-page { padding-top: var(--space-10); padding-bottom: var(--space-12); }

.coming-soon {
  border: 2px solid var(--fill-soft);
  border-radius: var(--radius);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  max-width: var(--text-width);
  margin: 0 auto;
}

.coming-soon h1 { font-size: var(--size-heading); }

.werewolf-note {
  max-width: var(--text-width);
  margin: var(--space-4) auto 0;
  text-align: center;
  color: var(--ink-2);
  font-size: var(--size-body);
  line-height: var(--leading-body);
}

.werewolf-note p + p { margin-top: var(--space-1); }

/* --- 404 -------------------------------------------------------------------- */

.notfound-page { padding-top: var(--space-10); padding-bottom: var(--space-12); text-align: center; }

.notfound-page h1 { font-size: var(--size-heading); }

.notfound-links { margin-top: var(--space-4); display: flex; gap: var(--space-4); justify-content: center; flex-wrap: wrap; }

/* --- レスポンシブ (設計書7章: ブレークポイントは768pxの1つのみ) ---------------- */

@media (max-width: 768px) {
  /* minmax(0,1fr): 列が中身 (立ち絵) の最小幅に引っ張られて横はみ出しするのを防ぐ */
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); padding-top: var(--space-4); }
  /* SP縦積み順: 名前→キャッチ→立ち絵→ボタン→動画 */
  .hero-text { display: contents; }
  .hero-name { order: 1; }
  .hero-catch { order: 2; }
  .hero-figure { order: 3; margin-top: var(--space-3); }
  .hero-standee { height: 40vh; }
  .hero-buttons { order: 4; margin-bottom: var(--space-3); }
  .hero-video { order: 5; max-width: 100%; margin-bottom: var(--space-4); }
  .two-col, .link-grid { grid-template-columns: minmax(0, 1fr); }
  .name-main { font-size: var(--size-name-sp); }
  .section-heading h2 { font-size: var(--size-heading-sp); }
}

/* SP でもタブは3つ横並びを維持 (ハンバーガーにしない) */
@media (max-width: 520px) {
  .site-header .header-inner {
    height: auto;
    padding: var(--space-2);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
  .tab-nav { gap: var(--space-2); }
  .tab-nav a { font-size: var(--size-label); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
