/* ベース */
:root {
  --w: 960px;
  --gap: 1rem;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "SF Pro Display", "Segoe UI", "Noto Sans JP", sans-serif;
  --fg:#0f172a;
  /* 文字が薄く見えすぎないように、muted を少し濃くして可読性を上げる */
  --muted:#475569;
  --bg:#f8fafc;
  --page-bg:
    radial-gradient(1200px circle at 12% 0%, rgba(15,23,42,.08), transparent 55%),
    radial-gradient(900px circle at 100% 8%, rgba(251,191,36,.10), transparent 60%),
    var(--bg);
  --surface:#ffffff;
  --accent:#0f172a;
  --accent-weak:#f1f5f9;
  --accent-strong:#0b1220;
  --line:#e2e8f0;
  --shadow: 0 24px 60px -32px rgba(0,0,0,.12);
  --main-grid-size: 32px;
  --main-grid-line: rgba(148,163,184,.18);
  --main-overlay:
    repeating-linear-gradient(
      0deg,
      var(--main-grid-line) 0 1px,
      transparent 1px var(--main-grid-size)
    ),
    repeating-linear-gradient(
      90deg,
      var(--main-grid-line) 0 1px,
      transparent 1px var(--main-grid-size)
    ),
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,0) 44%);
  --elev-1: 0 18px 42px -36px rgba(15,23,42,.18);
  --elev-2: 0 30px 70px -54px rgba(15,23,42,.24);
  --selection-bg: rgba(47,47,47,.18);
  --scrollbar-thumb: rgba(15,23,42,.18);
  --scrollbar-thumb-hover: rgba(15,23,42,.28);
  --scrollbar-track: transparent;
  --glass-bg: rgba(255,255,255,.96);
  --glass-bg-strong: rgba(255,255,255,1);
  --glass-border: rgba(15,23,42,.10);
  --pill-bg: rgba(255,255,255,.7);
  --pill-bg-hover: rgba(255,255,255,.9);
  --panel-bg: rgba(255,255,255,.78);
  --panel-bg-hover: rgba(255,255,255,.95);
  --panel-border: rgba(148,163,184,.30);
  --panel-border-strong: rgba(100,116,139,.55);
  /* セクション見出しバー（Social/Links/Articles） */
  --section-bar-bg: rgba(241,245,249,.92);
  --section-bar-border: rgba(100,116,139,.28);
  --section-bar-shadow: 0 10px 26px -22px rgba(15,23,42,.28);
  --meta-bg: rgba(226,232,240,.6);
  --avatar-bg: rgba(226,232,240,.6);
  --avatar-border: rgba(203,213,225,.8);
  --card-bg: rgba(255,255,255,.68);
  --card-bg-hover: rgba(255,255,255,.9);
  --card-border: rgba(226,232,240,.75);
  --card-border-strong: rgba(148,163,184,.85);
  --ghost-bg: rgba(255,255,255,.9);
  --ghost-bg-hover: #fff;
  --note-bg: rgba(248,250,252,.92);
  --button-bg: var(--accent-strong);
  --button-fg: #ffffff;
  --toggle-track-bg: rgba(0,0,0,.08);
  --toggle-track-border: rgba(0,0,0,.08);
  --toggle-knob-bg: #ffffff;
  --toggle-knob-shadow: 0 4px 12px -6px rgba(15,15,15,.45);
  --toggle-fill-color: rgba(0,0,0,.12);
  --icon-bg: linear-gradient(135deg, rgba(255,255,255,.96), rgba(226,232,240,.82));
  --icon-border: rgba(148,163,184,.55);
  --icon-color: #0f172a;
  /* タイル（Social/Links）のアイコンサイズ */
  --tile-social-icon-box: 44px;
  --tile-social-icon-size: 38px;
  --tile-friend-avatar-size: 48px;
  --tile-friend-plus-size: 48px;
  --tile-friend-plus-font-size: 1.2rem;
  --status-dot: var(--accent);
  --status-dot-ring: rgba(64,64,64,.3);
  --profile-title-bg: linear-gradient(135deg, rgba(241,245,249,.85), rgba(226,232,240,.55));
  --profile-title-color: var(--accent-strong);
  --profile-title-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 10px 20px -18px rgba(15,23,42,.28);
  --profile-hero-bg: linear-gradient(135deg, rgba(0,0,0,.03), rgba(255,255,255,.85));
  --profile-hero-border: var(--line);
  --profile-hero-shadow: 0 24px 48px -36px rgba(15,23,42,.18);
  --profile-portrait-border: rgba(255,255,255,.9);
  --profile-note-border: rgba(148,163,184,.55);
  /* おみくじ（アクセントカラー） */
  --fortune-accent: #e60033;
  --progress-track: rgba(15,23,42,.12);
  --progress-fill-start: #0ea5e9;
  --progress-fill-end: #f59e0b;
  --hero-orb-a: rgba(14,165,233,.30);
  --hero-orb-b: rgba(251,191,36,.28);
  --hero-orb-c: rgba(15,23,42,.17);
  --focus-ring: #0284c7;
  --focus-ring-shadow: rgba(14,165,233,.24);
  --section-divider: rgba(15,23,42,.22);
  --section-divider-glow: rgba(251,191,36,.30);
  --texture-grain: rgba(15,23,42,.045);
  --texture-vignette: rgba(15,23,42,.14);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --fg:#f8fafc;
  --muted:#b7c0cc;
  --bg:#04070d;
  --page-bg:
    radial-gradient(900px circle at 18% -10%, rgba(251,191,36,.12), transparent 55%),
    radial-gradient(900px circle at 100% 8%, rgba(255,255,255,.06), transparent 60%),
    var(--bg);
  --surface:#0b1220;
  --accent:#fbbf24;
  --accent-weak:rgba(255,255,255,.08);
  --accent-strong:#f8fafc;
  --line:rgba(255,255,255,.14);
  --shadow: 0 32px 80px -48px rgba(0,0,0,.9);
  --main-grid-line: rgba(148,163,184,.16);
  --main-overlay:
    repeating-linear-gradient(
      0deg,
      var(--main-grid-line) 0 1px,
      transparent 1px var(--main-grid-size)
    ),
    repeating-linear-gradient(
      90deg,
      var(--main-grid-line) 0 1px,
      transparent 1px var(--main-grid-size)
    ),
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0) 44%);
  --elev-1: 0 18px 42px -36px rgba(0,0,0,.75);
  --elev-2: 0 30px 70px -54px rgba(0,0,0,.92);
  --selection-bg: rgba(251,191,36,.22);
  --scrollbar-thumb: rgba(255,255,255,.18);
  --scrollbar-thumb-hover: rgba(255,255,255,.28);
  --scrollbar-track: transparent;
  --glass-bg: rgba(15,23,42,.72);
  --glass-bg-strong: rgba(17,24,39,.88);
  --glass-border: rgba(255,255,255,.08);
  --pill-bg: rgba(255,255,255,.05);
  --pill-bg-hover: rgba(255,255,255,.12);
  --panel-bg: rgba(15,23,42,.62);
  --panel-bg-hover: rgba(15,23,42,.78);
  --panel-border: rgba(148,163,184,.18);
  --panel-border-strong: rgba(226,232,240,.26);
  /* セクション見出しバー（Social/Links/Articles） */
  --section-bar-bg: rgba(15,23,42,.78);
  --section-bar-border: rgba(226,232,240,.22);
  --section-bar-shadow: 0 18px 40px -30px rgba(0,0,0,.75);
  --meta-bg: rgba(255,255,255,.1);
  --avatar-bg: rgba(255,255,255,.08);
  --avatar-border: rgba(255,255,255,.12);
  --card-bg: rgba(15,23,42,.74);
  --card-bg-hover: rgba(15,23,42,.88);
  --card-border: rgba(255,255,255,.08);
  --card-border-strong: rgba(255,255,255,.2);
  --ghost-bg: rgba(255,255,255,.08);
  --ghost-bg-hover: rgba(255,255,255,.15);
  --note-bg: rgba(18,18,18,.95);
  --button-bg: #1f2937;
  --button-fg: #f8fafc;
  --toggle-track-bg: rgba(255,255,255,.12);
  --toggle-track-border: rgba(255,255,255,.2);
  --toggle-knob-bg: #f5f5f5;
  --toggle-knob-shadow: 0 4px 18px -8px rgba(0,0,0,.85);
  --toggle-fill-color: rgba(255,255,255,.35);
  --icon-bg: linear-gradient(150deg, rgba(255,255,255,.14), rgba(255,255,255,.03));
  --icon-border: rgba(226,232,240,.22);
  --icon-color: #f8fafc;
  --status-dot: rgba(255,255,255,.85);
  --status-dot-ring: rgba(255,255,255,.55);
  --profile-title-bg: linear-gradient(140deg, rgba(255,255,255,.12), rgba(0,0,0,.2));
  --profile-title-color: #f8fafc;
  --profile-title-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 30px -26px rgba(0,0,0,.85);
  --profile-hero-bg: linear-gradient(145deg, rgba(255,255,255,.04), rgba(10,10,10,.9));
  --profile-hero-border: rgba(255,255,255,.08);
  --profile-hero-shadow: 0 32px 80px -48px rgba(0,0,0,.85);
  --profile-portrait-border: rgba(255,255,255,.22);
  --profile-note-border: rgba(255,255,255,.2);
  /* おみくじ（アクセントカラー） */
  --fortune-accent: #ff4d4d;
  --progress-track: rgba(255,255,255,.16);
  --progress-fill-start: #38bdf8;
  --progress-fill-end: #fbbf24;
  --hero-orb-a: rgba(56,189,248,.32);
  --hero-orb-b: rgba(251,191,36,.34);
  --hero-orb-c: rgba(248,250,252,.18);
  --focus-ring: #38bdf8;
  --focus-ring-shadow: rgba(56,189,248,.3);
  --section-divider: rgba(248,250,252,.34);
  --section-divider-glow: rgba(251,191,36,.38);
  --texture-grain: rgba(248,250,252,.06);
  --texture-vignette: rgba(0,0,0,.36);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body {
  margin:0;
  padding:0;
  background: var(--page-bg);
  color:var(--fg);
  font-family: var(--font-sans);
  /* 文章の読みやすさ重視で行間を少し広げる */
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .25s ease, color .25s ease;
}
body {
  /* iOS Safariで「はみ出し要素」があると横スクロールしてレイアウトが崩れて見えるのを防ぐ */
  overflow-x: hidden;
}
a { color: inherit; transition: color .18s ease; outline: none; }
a:hover,
a:focus-visible { color: var(--accent-strong); }
::selection { background: var(--selection-bg); }
img, video, iframe {
  max-width: 100%;
  height: auto;
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
*:focus {
  outline: none;
}
*:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--focus-ring-shadow);
  transition: outline-offset .15s ease, outline-width .15s ease;
}

/* リロードボタン */
.reload-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.9rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px -1px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.reload-btn:hover,
.reload-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.12);
  background: var(--glass-bg-strong);
}
.reload-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.05));
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.reload-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.reload-text {
  font-weight: 600;
  color: var(--accent-strong);
  font-size: 0.88rem;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* ヘッダー内ロゴ（シンプル） */
.site-header .reload-btn {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.site-header .reload-btn:hover,
.site-header .reload-btn:focus-visible {
  transform: none;
  box-shadow: none;
  background: transparent;
}
.site-header .reload-icon-wrapper {
  width: 32px;
  height: 32px;
  background: transparent;
}
.site-header .reload-text {
  font-size: 0.92rem;
  font-weight: 700;
}

/* テーマトグル */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.85rem 0.45rem 0.7rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px -1px rgba(0,0,0,0.08);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--fg);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .12s ease, box-shadow .15s ease;
  backdrop-filter: blur(10px);
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--glass-bg-strong);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px -2px rgba(0,0,0,0.12);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.theme-toggle__track {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 52px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  background: var(--toggle-track-bg);
  border: 1px solid var(--toggle-track-border);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.theme-toggle__track::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: var(--toggle-fill-color);
  opacity: .35;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease, opacity .25s ease;
}
:root[data-theme='dark'] .theme-toggle__track::after {
  transform: scaleX(1);
  opacity: .55;
}
.theme-toggle__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--toggle-knob-bg);
  box-shadow: var(--toggle-knob-shadow);
  transition: transform .25s ease, background .25s ease;
}
.theme-toggle__text {
  letter-spacing: 0.08em;
}
:root[data-theme='dark'] .theme-toggle__knob {
  transform: translateX(26px);
}

/* ヘッダーのテーマ切替（スイッチ） */
.theme-toggle.theme-toggle--switch {
  padding: 0.3rem 0.45rem;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  border-radius: 999px;
  gap: 0.35rem;
  transform: none;
}
.theme-toggle.theme-toggle--switch:hover,
.theme-toggle.theme-toggle--switch:focus-visible {
  background: var(--pill-bg-hover);
  transform: none;
  box-shadow: none;
}
.theme-toggle--switch .theme-toggle__track {
  width: 52px;
  height: 26px;
  border-width: 1px;
}
.theme-toggle--switch .theme-toggle__knob {
  width: 20px;
  height: 20px;
}
:root[data-theme='dark'] .theme-toggle--switch .theme-toggle__knob {
  transform: translateX(26px);
}
.theme-toggle--switch .theme-toggle__glyph {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--fg);
  opacity: .7;
  transition: color .2s ease, opacity .2s ease;
}
.theme-toggle--switch .theme-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* ライトモードの時は太陽アイコンのみ表示 */
:root[data-theme='light'] .theme-toggle--switch .theme-toggle__glyph--sun {
  display: grid;
  color: var(--accent-strong);
  opacity: 1;
}
:root[data-theme='light'] .theme-toggle--switch .theme-toggle__glyph--moon {
  display: none;
}
/* ダークモードの時は月アイコンのみ表示 */
:root[data-theme='dark'] .theme-toggle--switch .theme-toggle__glyph--moon {
  display: grid;
  color: var(--accent-strong);
  opacity: 1;
}
:root[data-theme='dark'] .theme-toggle--switch .theme-toggle__glyph--sun {
  display: none;
}

/* ヘッダーのテーマ切替（アイコン） */
.theme-toggle.theme-toggle--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  display: grid;
  place-items: center;
  transform: none;
  flex-shrink: 0;
}
.theme-toggle.theme-toggle--icon:hover,
.theme-toggle.theme-toggle--icon:focus-visible {
  background: var(--pill-bg-hover);
  transform: none;
  box-shadow: none;
}
.theme-toggle--icon .theme-toggle__icon {
  display: grid;
  place-items: center;
  color: var(--accent-strong);
}
.theme-toggle--icon .theme-icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle--icon .theme-icon--sun { display: block; }
.theme-toggle--icon .theme-icon--moon { display: none; }
:root[data-theme='dark'] .theme-toggle--icon .theme-icon--sun { display: none; }
:root[data-theme='dark'] .theme-toggle--icon .theme-icon--moon { display: block; }

/* ヘッダー（上部固定バー） */
.site-header {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: rgba(255,255,255,.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
:root[data-theme='dark'] .site-header {
  background: rgba(10,10,10,.72);
}
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--progress-track);
  z-index: 2101;
  pointer-events: none;
}
.scroll-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--progress-fill-start), var(--progress-fill-end));
  box-shadow: 0 0 16px -6px var(--progress-fill-end);
}
.site-header__inner {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0.85rem clamp(0.85rem, 2.5vw, 1.6rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.6rem, 1.8vw, 1.2rem);
  position: relative;
}
.site-header__inner .reload-btn {
  flex: 0 0 auto;
  min-width: 0;
}
.site-header__inner .top-nav {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 0;
  justify-content: flex-end;
  max-width: 100%;
  overflow: hidden;
}
.site-header__inner.is-overflowing .top-nav {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.site-header__inner.is-overflowing .top-nav::-webkit-scrollbar {
  display: none;
}

/* レイアウト */
.wrap {
  max-width: var(--w);
  /* 上下とも余白ゼロ（ページ最上部/最下部の「謎の空き」を消す） */
  margin: 0 auto;
  /* padding は main 側で管理する（.wrap と main の指定が競合してモバイル調整が効かなくなるため） */
  padding: 0;
}
.narrow {
  max-width: 95%;
  margin-left: auto;
  margin-right: auto;
}
main {
  background: var(--main-overlay), var(--surface);
  border: 1px solid var(--glass-border);
  /* ヘッダー直下の「わずかな空き」に見えるのは main の上ボーダーが原因になりやすい */
  border-top: 0;
  /* 外枠も角丸なしに統一 */
  border-radius: 0;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  /* “0” だと詰め詰めに見えるので、上下に少し余白を戻す */
  padding: clamp(0.9rem, 2.4vw, 1.4rem) clamp(0.375rem, 1vw, 0.625rem) clamp(0.9rem, 2.4vw, 1.4rem);
}
main::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(130% 72% at 50% -20%, rgba(255,255,255,.24), transparent 60%),
    radial-gradient(120% 88% at 50% 120%, var(--texture-vignette), transparent 62%),
    radial-gradient(var(--texture-grain) 0.75px, transparent 0.75px);
  background-size: auto, auto, 3px 3px;
  opacity: .72;
}
main > * {
  position: relative;
}
section {
  margin: clamp(1.6rem, 3.8vw, 2.9rem) 0;
  scroll-margin: clamp(5rem, 12vw, 8rem) 0;
}
:root.has-reveal .reveal-target {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(2px);
  transition:
    opacity .62s ease,
    transform .62s cubic-bezier(.22,.61,.36,1),
    filter .62s ease;
  transition-delay: var(--reveal-delay, 0ms);
}
:root.has-reveal .reveal-target.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.quick-dock {
  position: fixed;
  right: clamp(0.7rem, 2.2vw, 1.3rem);
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  z-index: 1900;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(12px);
  box-shadow: 0 22px 40px -32px rgba(15,23,42,.55);
}
.quick-dock__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 34px;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
  background: transparent;
  transition: transform .18s ease, background .2s ease, border-color .2s ease;
}
.quick-dock__item:hover,
.quick-dock__item:focus-visible {
  transform: translateY(-2px);
  background: var(--accent-weak);
  border-color: var(--line);
}
@media (max-width: 760px) {
  .quick-dock {
    display: none;
  }
  .quick-dock__item {
    min-width: 54px;
    font-size: 0.7rem;
    padding: 0 0.62rem;
  }
}

/* -----------------------------------------
   パフォーマンス最適化
   ----------------------------------------- */

/* 画面外のセクションは描画を遅延して、初期レンダリングとスクロールを軽くする */
@supports (content-visibility: auto) {
  main > section {
    content-visibility: auto;
    /* ざっくりの高さ見積もり（レンダリングされるまでのスクロールジャンプを抑える） */
    contain-intrinsic-size: 1px 520px;
  }
}

/* 省データ/省電力っぽいときは、重いエフェクトだけ抑える（機能は維持） */
:root[data-reduced-effects='true'] .site-header,
:root[data-reduced-effects='true'] .hero__aside,
:root[data-reduced-effects='true'] .bgm-badge,
:root[data-reduced-effects='true'] .quick-dock {
  backdrop-filter: none;
}
:root[data-reduced-effects='true'] .status-dot,
:root[data-reduced-effects='true'] .bgm-badge__eq span,
:root[data-reduced-effects='true'] .hero__orb {
  animation: none !important;
}
:root[data-reduced-effects='true'] .reveal-target {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}
:root[data-reduced-effects='true'] main::before {
  background: none;
}
/* ページ最下部の “余白だけ” をなくす（間の余白は section 自体の margin で維持） */
main > section:last-of-type {
  margin-bottom: clamp(1.1rem, 3vw, 1.6rem);
}
/* ページ先頭のセクションだけは、ヘッダー直下に余白を作らない */
main > section:first-child {
  margin-top: 0;
}
.section__intro {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.45rem;
}
.section__intro--split {
  justify-content: space-between;
}
.section__intro--bar,
.section__intro--split {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem 1.1rem;
  /* 見出しバーを横いっぱいに伸ばす */
  width: 100%;
  padding: 0.85rem 1.05rem;
  border-radius: 18px;
  background: var(--section-bar-bg);
  border: 1px solid var(--section-bar-border);
  box-shadow: var(--section-bar-shadow);
  position: relative;
  overflow: hidden;
}
.section__intro--bar::after,
.section__intro--split::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.35rem;
  height: 1px;
  background:
    linear-gradient(90deg,
      transparent 0%,
      var(--section-divider) 18%,
      var(--section-divider-glow) 50%,
      var(--section-divider) 82%,
      transparent 100%);
  opacity: .82;
  pointer-events: none;
}
.section__intro--bar {
  justify-content: flex-start;
}
.section__intro--bar > h2,
.section__intro--split > h2 {
  margin: 0;
  /* バーの中ではh2自体の背景を消してスッキリ */
  background: transparent;
  padding: 0;
  border-radius: 0;
}
.section__intro--bar > h1 .icon,
.section__intro--split > h1 .icon,
.section__intro--bar > h2 .icon,
.section__intro--split > h2 .icon {
  /* アイコンはそのまま立体感を残す */
  margin-right: 0.1rem;
}
/* 記事フィルタタブ */
.articles-filter {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  background: var(--section-bar-bg);
  border: 1px solid var(--section-bar-border);
  border-radius: 14px;
  box-shadow: var(--section-bar-shadow);
}

.articles-filter__tab {
  flex: 1;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.articles-filter__tab:hover {
  background: var(--accent-weak);
  color: var(--fg);
}

.articles-filter__tab--active,
.articles-filter__tab[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.2);
}

.articles-filter__tab-note {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.75em;
  font-weight: 400;
  opacity: 0.85;
}

.articles-filter__tab--active .articles-filter__tab-note,
.articles-filter__tab[aria-selected="true"] .articles-filter__tab-note {
  opacity: 0.9;
}

:root[data-theme='dark'] .articles-filter__tab--active,
:root[data-theme='dark'] .articles-filter__tab[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
}

/* 空の状態メッセージ */
.articles-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 2rem;
  text-align: center;
}

.articles-empty__text {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
}

.section__more {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 2px;
  transition: color .18s ease, opacity .18s ease;
  white-space: nowrap;
  padding: 0.25rem 0.2rem;
}
.section__more:hover,
.section__more:focus-visible {
  color: var(--accent-strong);
  opacity: 1;
}
:root[data-theme='dark'] .section__more {
  color: rgba(255,255,255,.78);
}
.section__more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.section__description {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.section__cta {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}
.section__cta .btn {
  font-size: 0.88rem;
  padding: 0.5rem 1.4rem;
}

/* ローカル記事ページ */
#article-page {
  --main-overlay: transparent;
  --page-bg: var(--surface);
  background: var(--surface);
}
:root[data-theme='dark'] #article-page {
  --main-overlay: transparent;
  --page-bg: var(--bg);
  background: var(--bg);
}
#article-page main {
  padding: clamp(1.2rem, 3vw, 2.2rem) 0 clamp(2.8rem, 6vw, 4rem);
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#article-page main::before {
  display: none;
}
#article-page main.wrap {
  max-width: min(980px, calc(100vw - 32px));
}
#article-page .article-shell {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}
#article-page .article-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 2rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#article-page .article-header .page-title {
  display: block;
  margin: 0;
  max-width: 26ch;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.14;
  letter-spacing: 0.01em;
  text-wrap: pretty;
}
#article-page .article-kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
#article-page .article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.98rem;
}
#article-page .article-cover {
  margin: 0 0 2rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
#article-page .article-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
#article-page .article-toc {
  position: static;
  top: auto;
  margin: 0 0 2.1rem;
  padding: 1rem 1.15rem;
  max-width: 720px;
  border: none;
  border-left: 3px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
:root[data-theme='dark'] #article-page .article-toc {
  background: transparent;
}
#article-page .article-toc__header {
  margin-bottom: 0.5rem;
}
#article-page .article-toc__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}
#article-page .article-toc__hint {
  display: none;
  margin: 0.28rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}
#article-page .article-toc__list {
  margin: 0;
  padding-left: 1.2rem;
  list-style: disc;
  display: block;
}
#article-page .article-toc__item {
  margin: 0.28rem 0;
  padding: 0;
  border-top: none;
}
#article-page .article-toc__item:first-child {
  padding-top: 0;
}
#article-page .article-toc__link {
  display: inline;
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.7;
  color: var(--fg);
  text-decoration: none;
}
#article-page .article-toc__link:hover,
#article-page .article-toc__link:focus-visible {
  text-decoration: underline;
}
#article-page .article-toc__sublist {
  margin: 0.15rem 0 0.35rem;
  padding-left: 1.15rem;
  list-style: circle;
}
#article-page .article-toc__subitem {
  margin: 0.14rem 0;
}
#article-page .article-toc__subitem-link {
  display: inline;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
  text-decoration: none;
}
#article-page .article-toc__subitem-link:hover,
#article-page .article-toc__subitem-link:focus-visible {
  text-decoration: underline;
}
#article-page .article-content {
  max-width: 100%;
  margin: 0;
  color: var(--fg);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  line-height: 1.96;
  font-size: 1.06rem;
}
#article-page .article-content > p,
#article-page .article-content > ul,
#article-page .article-content > ol,
#article-page .article-content > blockquote,
#article-page .article-content > pre {
  width: 100%;
  max-width: 68ch;
}
#article-page .article-content > h1:first-child {
  display: none;
}
#article-page .article-content h1,
#article-page .article-content h2,
#article-page .article-content h3 {
  display: block;
  background: transparent;
  padding: 0;
  border-radius: 0;
}
#article-page .article-content h1 {
  margin: 2.6rem 0 1rem;
  padding-bottom: 0;
  font-size: clamp(1.5rem, 2.4vw, 1.75rem);
  border-bottom: none;
}
#article-page .article-content h2 {
  margin: 4rem 0 1.15rem;
  padding: 1.15rem 0 0.55rem;
  font-size: clamp(1.45rem, 2.2vw, 1.8rem);
  font-weight: 700;
  color: var(--fg);
  border: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid rgba(148,163,184,.14);
  border-left: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scroll-margin-top: 1rem;
}
#article-page .article-content h2:first-of-type {
  margin-top: 2.8rem;
}
#article-page .article-content h2::before {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin-bottom: 0.8rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, rgba(56,189,248,0));
}
#article-page .article-content h2 + p {
  margin-top: 1rem;
}
#article-page .article-content h3 {
  margin: 2.35rem 0 0.75rem;
  padding-left: 0.85rem;
  font-size: 1.18rem;
  font-weight: 700;
  border-left: 3px solid rgba(56,189,248,.34);
  scroll-margin-top: 1rem;
}
#article-page .article-content h3 + p {
  margin-top: 0.7rem;
}
#article-page .article-content p {
  margin: 1rem 0;
  color: var(--fg);
}
#article-page .article-content strong {
  color: var(--accent-strong);
}
#article-page .article-content ul,
#article-page .article-content ol {
  margin: 1rem 0;
  padding-left: 1.35rem;
}
#article-page .article-content li {
  margin: 0.32rem 0;
  color: var(--fg);
}
#article-page .article-content a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
:root[data-theme='dark'] #article-page .article-content a {
  color: rgba(255,255,255,.94);
}
#article-page .article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  padding: 0.12rem 0.36rem;
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 0.35rem;
  background: var(--accent-weak);
}
#article-page .article-content pre {
  margin: 1.4rem 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--accent-weak);
  box-shadow: none;
}
#article-page .article-content pre code {
  padding: 0;
  border: none;
  background: transparent;
}
#article-page .article-content blockquote {
  margin: 1.4rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--line);
  border-radius: 0;
  background: transparent;
}
#article-page .article-content blockquote p {
  margin: 0;
}
#article-page .article-content hr {
  display: none;
}
#article-page .article-content table {
  width: 100%;
  display: block;
  overflow-x: auto;
  margin: 1.4rem 0 1.8rem;
  font-size: 0.96rem;
  border-spacing: 0;
  border-collapse: separate;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}
:root[data-theme='dark'] #article-page .article-content table {
  background: transparent;
}
#article-page .article-content th:first-child,
#article-page .article-content td:first-child {
  width: 4rem;
  font-weight: 700;
  white-space: nowrap;
}
#article-page .article-content th:nth-child(2),
#article-page .article-content td:nth-child(2) {
  min-width: 17rem;
}
#article-page .article-content th:last-child,
#article-page .article-content td:last-child {
  min-width: 11rem;
}
#article-page .article-content th,
#article-page .article-content td {
  padding: 0.78rem 0.9rem;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  border-bottom: 1px solid var(--line);
}
#article-page .article-content th {
  font-weight: 700;
  background: transparent;
}
#article-page .article-content tbody tr:nth-child(even) {
  background: transparent;
}
:root[data-theme='dark'] #article-page .article-content tbody tr:nth-child(even) {
  background: transparent;
}
#article-page .article-content tbody tr:last-child td {
  border-bottom: none;
}
#article-page .article__cta {
  max-width: 68ch;
  margin: 2.4rem 0 0;
  padding-top: 1.25rem;
  display: flex;
  justify-content: flex-start;
  border-top: 1px solid var(--line);
}

@media (max-width: 1040px) {
  #article-page main.wrap {
    max-width: min(920px, calc(100vw - 24px));
  }
  #article-page .article-header .page-title {
    max-width: none;
    font-size: clamp(1.85rem, 5vw, 2.45rem);
  }
}

@media (max-width: 720px) {
  #article-page main {
    padding-top: 1rem;
  }
  #article-page .article-header {
    margin-bottom: 1.5rem;
  }
  #article-page .article-meta {
    font-size: 0.92rem;
  }
  #article-page .article-cover {
    margin-bottom: 1.5rem;
    border-radius: 14px;
  }
  #article-page .article-toc {
    max-width: none;
    padding: 0.85rem 0 0.85rem 0.95rem;
  }
  #article-page .article-toc__title {
    font-size: 0.98rem;
  }
  #article-page .article-content {
    padding: 0;
    font-size: 1.01rem;
    line-height: 1.84;
  }
  #article-page .article-content > p,
  #article-page .article-content > ul,
  #article-page .article-content > ol,
  #article-page .article-content > blockquote,
  #article-page .article-content > pre {
    max-width: none;
  }
  #article-page .article-content h2 {
    margin-top: 2.4rem;
    font-size: 1.38rem;
  }
  #article-page .article-content h3 {
    margin-top: 1.7rem;
    font-size: 1.12rem;
  }
  #article-page .article-content table {
    display: block;
    overflow: visible;
    border: none;
    border-radius: 0;
    background: transparent;
  }
  #article-page .article-content thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  #article-page .article-content tbody {
    display: grid;
    gap: 1rem;
  }
  #article-page .article-content tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: transparent;
    overflow: hidden;
  }
  :root[data-theme='dark'] #article-page .article-content tbody tr {
    background: transparent;
  }
  #article-page .article-content th,
  #article-page .article-content td {
    white-space: normal;
  }
  #article-page .article-content tbody td {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0.82rem 0.95rem;
  }
  #article-page .article-content tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.24rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--muted);
  }
  #article-page .article-content tbody td:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    width: auto;
    min-width: 0;
    padding: 0.85rem 0.95rem;
    background: transparent;
  }
  #article-page .article-content tbody td:first-child::before {
    margin-bottom: 0;
  }
  #article-page .article-content tbody td:first-child strong {
    font-size: 1.28rem;
    line-height: 1;
    letter-spacing: 0.01em;
  }
  #article-page .article-content tbody td:nth-child(2),
  #article-page .article-content tbody td:last-child {
    min-width: 0;
  }
  :root[data-theme='dark'] #article-page .article-content tbody td:first-child {
    background: transparent;
  }
  #article-page .article-content tbody tr:last-child td {
    border-bottom: 1px solid var(--line);
  }
  #article-page .article-content tbody tr td:last-child {
    border-bottom: none;
  }
  #article-page .article__cta {
    max-width: none;
  }
}

h1, h2, h3 {
  line-height: 1.22;
  letter-spacing: 0.012em;
  text-wrap: balance;
}
.section__intro .page-title {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 1.72rem);
  font-weight: 670;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--fg);
}
h2 {
  font-size: clamp(1.24rem, 2.2vw, 1.46rem);
  margin: 0 0 .9rem;
  font-weight: 640;
  letter-spacing: .018em;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(148, 163, 184, 0.15);
  padding: 0.4rem 0.9rem;
  border-radius: 10px;
  color: var(--fg);
}
h1 .icon,
h2 .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.55rem;
  border-radius: 12px;
  border: 1px solid var(--icon-border);
  background: var(--icon-bg);
  color: var(--icon-color);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 18px -14px rgba(15,23,42,0.38);
}
h1 .icon svg,
h2 .icon svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--social,
.icon--links,
.icon--articles,
.icon--profile {
  background: var(--icon-bg);
  border-color: var(--icon-border);
  color: var(--icon-color);
}

/* ページタイトル（h1） */
.page-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 1.6rem);
  font-weight: 650;
  letter-spacing: .01em;
}

/* ヒーロー */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  gap: clamp(1.2rem, 2.4vw, 2.1rem);
  padding: clamp(1.6rem, 4.2vw, 3.2rem);
  background:
    linear-gradient(125deg, rgba(0,0,0,.02), rgba(0,0,0,.04)),
    var(--surface);
  /* 角丸なしに統一 */
  border-radius: 0;
  border:1px solid var(--line);
  margin-bottom: clamp(1.7rem, 3.2vw, 2.6rem);
  overflow: hidden;
  position: relative;
}
:root[data-theme='dark'] .hero {
  background:
    linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.02)),
    var(--surface);
}
.hero__ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero__orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  mix-blend-mode: screen;
  opacity: .72;
}
.hero__orb--a {
  width: clamp(180px, 22vw, 270px);
  height: clamp(180px, 22vw, 270px);
  top: -14%;
  right: 10%;
  background: radial-gradient(circle at 30% 30%, var(--hero-orb-a), rgba(14,165,233,0));
  animation: heroOrbFloatA 14s ease-in-out infinite;
}
.hero__orb--b {
  width: clamp(200px, 24vw, 320px);
  height: clamp(200px, 24vw, 320px);
  bottom: -24%;
  left: 8%;
  background: radial-gradient(circle at 65% 35%, var(--hero-orb-b), rgba(251,191,36,0));
  animation: heroOrbFloatB 18s ease-in-out infinite;
}
.hero__orb--c {
  width: clamp(120px, 15vw, 190px);
  height: clamp(120px, 15vw, 190px);
  top: 30%;
  left: 56%;
  background: radial-gradient(circle at 50% 50%, var(--hero-orb-c), rgba(15,23,42,0));
  animation: heroOrbFloatC 16s ease-in-out infinite;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  /* ヒーロー背景：モバイルは軽量版 / 大きい画面は高解像度 */
  background: url("../assets/IMG_4573-small.jpg") 85% 20%/cover no-repeat;
  opacity: .28;
  filter: saturate(.9);
    /* transform: scaleX(-1); */
  transform-origin: center;
  z-index: 0;
  pointer-events: none;
}

@media (min-width: 821px) {
  .hero::before {
    background-image: url("../assets/IMG_4573-medium.jpg");
  }
}

@media (min-width: 821px) and (min-resolution: 2dppx) {
  .hero::before {
    background-image: url("../assets/IMG_4573.jpg");
  }
}
:root[data-theme='dark'] .hero::before {
  opacity: .22;
  filter: saturate(.85) brightness(.92);
}
.hero::after {
  content:"";
  position:absolute;
  inset:-140px 35% auto -160px;
  height: 280px;
  background: radial-gradient(circle at center, rgba(0,0,0,.04), rgba(0,0,0,0));
  opacity:.6;
  pointer-events:none;
}
:root[data-theme='dark'] .hero::after {
  background: radial-gradient(circle at center, rgba(255,255,255,.12), rgba(255,255,255,0));
  opacity: .35;
}
.hero__body {
  position: relative;
  z-index:1;
  max-width: 560px;
  padding-bottom: clamp(3.5rem, 8vw, 5.5rem);
}
.hero h1 {
  margin:0 0 .75rem;
  font-size: clamp(2.2rem, 5.5vw, 2.9rem);
  font-weight: 680;
  letter-spacing: .02em;
  text-wrap: pretty;
}
.subtitle {
  color:var(--muted);
  margin:0 0 .55rem;
  font-size: clamp(1rem, 2vw, 1.05rem);
}
.note { color:var(--muted); margin:0 0 1.6rem; }
.hero__skills {
  display:flex;
  align-items:flex-start;
  gap: clamp(0.75rem, 1.8vw, 1.35rem);
  flex-wrap: wrap;
  margin: 0 0 1.65rem;
}
.hero__skills-label {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:.4rem;
  padding:0;
  min-width:min(120px, 45vw);
  margin-top:.15rem;
}
.hero__skills-label::before {
  content:"";
  display:block;
  width:32px;
  height:2px;
  border-radius:999px;
  background: linear-gradient(90deg, rgba(0,0,0,.34), rgba(0,0,0,0));
}
:root[data-theme='dark'] .hero__skills-label::before {
  background: linear-gradient(90deg, rgba(255,255,255,.32), rgba(255,255,255,0));
}
.hero__skills-label-main {
  font-size:.8rem;
  font-weight:600;
  letter-spacing:.28em;
  text-transform:uppercase;
  color: var(--accent-strong);
  line-height:1.05;
}
.hero__skills-label-sub {
  font-size:.95rem;
  font-weight:500;
  color: var(--muted);
  letter-spacing:.02em;
}
.hero__skills .chips { margin:0; }
.chips {
  list-style:none;
  margin:0 0 1.65rem;
  padding:0;
  display:flex;
  gap:.6rem;
  flex-wrap:wrap;
}
.chips li {
  padding:.5rem .85rem;
  border-radius:999px;
  background: var(--accent-weak);
  color: var(--accent-strong);
  font-size:.85rem;
  font-weight:500;
  letter-spacing:.01em;
  border:1px solid var(--line);
  outline: none;
}
.hero__actions {
  display:flex;
  gap:.9rem;
  flex-wrap:wrap;
  margin-bottom: clamp(1rem, 2.2vw, 1.5rem);
}
.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.4rem;
  padding:.7rem 1.7rem;
  border:1px solid var(--button-bg);
  border-radius: 999px;
  text-decoration:none;
  color: var(--button-fg);
  background: var(--button-bg);
  font-weight:600;
  letter-spacing:.01em;
  box-shadow:0 18px 36px -28px rgba(0,0,0,.12);
  transition: transform .18s ease, box-shadow .18s ease, background .22s ease;
  outline: none;
}
.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow:0 28px 48px -32px rgba(0,0,0,.18);
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}
:root[data-theme='dark'] .btn:not(.btn--ghost):not(.fortune-btn):hover,
:root[data-theme='dark'] .btn:not(.btn--ghost):not(.fortune-btn):focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn:active {
  transform: translateY(0);
}
.btn--ghost {
  background:var(--ghost-bg);
  color: var(--accent-strong);
  border-color: var(--line);
  box-shadow:none;
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  background:var(--ghost-bg-hover);
  border-color: var(--accent);
  transform: translateY(-1.5px);
  box-shadow:0 16px 36px -28px rgba(0,0,0,.1);
}
.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.5rem, 1.8vw, 1.5rem);
  flex-wrap: nowrap;
  /* ヘッダーのロゴ文字より大きくならないように、ほどよいサイズに */
  font-size: clamp(0.75rem, 0.85vw, 0.88rem);
  letter-spacing: 0.005em;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.top-nav a {
  position: relative;
  padding: 0.35rem 0;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  transition: color .18s ease;
}
:root[data-theme='dark'] .top-nav a:hover,
:root[data-theme='dark'] .top-nav a:focus-visible,
:root[data-theme='dark'] .top-nav a:active {
  color: var(--accent);
}
.top-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.1rem;
  height: 2px;
  border-radius: 999px;
  background: rgba(14,165,233,.55);
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease, background .2s ease;
}
:root[data-theme='dark'] .top-nav a::after {
  background: rgba(251,191,36,.6);
}
.top-nav a:hover,
.top-nav a:focus-visible,
.top-nav a:active {
  color: var(--accent-strong);
}
.top-nav a:hover::after,
.top-nav a:focus-visible::after,
.top-nav a:active::after {
  transform: scaleX(1);
  opacity: 1;
}
.top-nav a[aria-current="page"] {
  color: var(--accent-strong);
}
:root[data-theme='dark'] .top-nav a[aria-current="page"] {
  color: var(--accent);
}
.top-nav a[aria-current="page"]::after {
  transform: scaleX(1);
  opacity: 1;
  background: rgba(14,165,233,.8);
}
:root[data-theme='dark'] .top-nav a[aria-current="page"]::after {
  background: rgba(251,191,36,.9);
}
.hero__aside {
  position: absolute;
  bottom: clamp(1rem, 3vw, 2rem);
  left: clamp(1.2rem, 3.5vw, 2.6rem);
  z-index:1;
  padding: clamp(0.6rem, 1.5vw, 0.85rem) clamp(0.85rem, 2vw, 1.35rem);
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  border-radius: 18px;
  border:1px solid var(--line);
  box-shadow: 0 24px 48px -38px rgba(0,0,0,.14);
  max-width: min(320px, 45%);
  width: auto;
  font-size: .9rem;
}
.hero__status {
  display:flex;
  align-items:center;
  gap:.4rem;
  margin:0 0 .35rem;
  font-weight: 600;
  letter-spacing: .01em;
  font-size: .86rem;
}
.status-dot {
  display:inline-flex;
  width:.58rem;
  height:.58rem;
  border-radius:50%;
  background: var(--status-dot);
  box-shadow:0 0 0 0 var(--status-dot-ring);
  animation: ping 2.8s cubic-bezier(0, 0, .2, 1) infinite;
}
.status-label { color: var(--accent-strong); }
.hero__mini {
  margin:0;
  color: var(--muted);
  font-size:.8rem;
  line-height: 1.5;
}

@media (max-width: 1080px){
  .hero__body {
    padding-bottom: clamp(3rem, 9vw, 5rem);
  }
  .hero__aside {
    bottom: clamp(0.8rem, 2.6vw, 1.6rem);
    left: clamp(0.9rem, 4vw, 2.2rem);
    padding: clamp(0.5rem, 1.3vw, 0.75rem) clamp(0.8rem, 2.1vw, 1.2rem);
    max-width: min(300px, 55%);
  }
}

/* リスト */
.list {
  list-style: none;
  margin:0;
  padding:0;
  display:grid;
  gap:1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
}
.list--icons {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: clamp(0.8rem, 2vw, 1.3rem);
}
.list a {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  text-decoration:none;
  padding:1rem 1.25rem;
  background: var(--panel-bg);
  border:1px solid var(--panel-border);
  border-radius: 16px;
  font-weight:520;
  color: var(--accent-strong);
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
  transform: translateY(0);
  box-shadow: var(--elev-1);
}
.list--icons a {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 0.9rem 0.75rem;
  border-radius: 18px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: translateY(0);
}
.list--icons a::after {
  display: none;
}
.list--icons a:hover,
.list--icons a:focus-visible {
  background: var(--panel-bg);
  border-color: var(--panel-border);
  box-shadow: var(--elev-1);
  transform: translateY(-1.5px);
}
.list--icons a:active {
  transform: translateY(0);
  box-shadow: none;
}
.social-label {
  font-weight: 650;
  font-size: 0.92rem;
  letter-spacing: .01em;
  color: var(--accent-strong);
}
.list--social a {
  padding:.9rem 1.15rem;
}
.list--social a::after {
  display: none;
}
.list__left {
  display:flex;
  align-items:center;
  gap:.75rem;
  min-width: 0;
}
.list__label {
  font-weight:560;
  letter-spacing:.01em;
  white-space: nowrap;
}
.list__meta {
  font-size:.72rem;
  letter-spacing:.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--meta-bg);
  padding:.25rem .65rem;
  border-radius: 999px;
  font-weight:600;
}
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent-strong);
}
.list--icons .social-icon {
  width: var(--tile-social-icon-box);
  height: var(--tile-social-icon-box);
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.list--icons .social-icon svg,
.list--icons .social-icon img {
  width: var(--tile-social-icon-size);
  height: var(--tile-social-icon-size);
}
.social-icon svg {
  width: 100%;
  height: 100%;
}
.social-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Amazonアイコン（透過PNGを白黒で使う） */
:root[data-theme='dark'] .amazon-icon {
  filter: invert(1);
}
.list a::after {
  content:"↗";
  font-size: .9rem;
  color: rgba(107,114,128,.7);
  margin-left: auto;
}
.list a:hover,
.list a:focus-visible {
  background: var(--panel-bg-hover);
  border-color: var(--panel-border-strong);
  color: var(--accent-strong);
  transform: translateY(-1.5px);
  box-shadow: var(--elev-2);
}
.list a:active {
  transform: translateY(0);
  box-shadow: var(--elev-1);
}
.list--friends {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.list--friends.list--icons {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}
a.friend-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
}
a.friend-card::after {
  display: none;
}
.list--friends.list--icons a:not(.friend-card)::before {
  content: "+";
  width: var(--tile-friend-plus-size);
  height: var(--tile-friend-plus-size);
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--pill-bg);
  border: 1px dashed var(--panel-border-strong);
  color: var(--muted);
  font-weight: 800;
  font-size: var(--tile-friend-plus-font-size);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.friend-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--avatar-bg);
  border: 1px solid var(--avatar-border);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.list--icons .friend-card__avatar {
  width: var(--tile-friend-avatar-size);
  height: var(--tile-friend-avatar-size);
  border-radius: 50%;
}
.friend-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.friend-card__name {
  flex: 1;
  display: inline-flex;
  align-items: center;
}
.list--icons .friend-card__name {
  flex: 0 0 auto;
  justify-content: center;
  font-weight: 650;
  font-size: 0.92rem;
  letter-spacing: .01em;
  color: var(--accent-strong);
}

/* Linksセクションの募集中テキスト */
.links-note {
  margin: 1.25rem 0 0;
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--fg);
  background: var(--note-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--elev-1);
  transition: background .2s ease, border-color .2s ease;
}
.links-note:hover {
  background: var(--card-bg-hover);
  border-color: var(--panel-border-strong);
}

/* カード */
.cards {
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:clamp(1.25rem, 2.8vw, 1.85rem);
  grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
}
#articles-page .cards {
  grid-template-columns: 1fr;
}
#articles-page .cards {
  gap: clamp(1.5rem, 3vw, 2rem);
}
#works-page .cards {
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 3vw, 2rem);
}
#works-page .card--work {
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  position: relative;
}
#works-page .card--work .card__link {
  flex-direction: row;
  gap: 0;
}
#works-page .card--work .card__thumb {
  /* スマホ〜タブレットで自然に伸縮するサムネ幅 */
  flex: 0 0 clamp(140px, 40vw, 260px);
  width: clamp(140px, 40vw, 260px);
  padding-top: 0;
  aspect-ratio: 16 / 9;
  border-radius: 20px 0 0 20px;
  position: relative;
  overflow: hidden;
}
#works-page .card--work .card__thumb img:not(.thumb-logo) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#works-page .card--work .card__thumb img.thumb-logo {
  object-fit: contain;
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: auto;
  height: 72%;
  border-radius: 22%;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 18px 40px -34px rgba(15,23,42,.35);
}
:root[data-theme='dark'] #works-page .card--work .card__thumb img.thumb-logo {
  border-color: rgba(255,255,255,.20);
  box-shadow: 0 22px 52px -42px rgba(0,0,0,.85);
}
#works-page .card--work .card__thumb svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
#works-page .card--work .card__content {
  flex: 1 1 auto;
  border-top: none;
  border-left: 1px solid var(--card-border);
  padding: 1.1rem 1.2rem;
  justify-content: center;
}
@media (min-width: 760px) {
  #works-page .card--work .card__thumb {
    flex: 0 0 320px;
    width: 320px;
  }
  #works-page .card--work .card__content {
    padding: 1.25rem 1.4rem;
  }
}
/* #works-page .narrow の padding は articles.html と統一（main の padding のみ使用） */
#articles-page .card {
  box-shadow: var(--elev-1);
}
#articles-page .card:hover,
#articles-page .card:focus-within {
  box-shadow: var(--elev-2);
}
#articles-page .card--article h3 {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.35;
  min-width: 0;
  white-space: nowrap; /* 勝手に改行させない */
  overflow: hidden;
  text-overflow: ellipsis;
}
#top [data-rss="home-articles"] .card--article h3 {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.35;
  min-width: 0;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  text-wrap: unset; /* balance を外してカード幅を素直に使う */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
#works-page .card--work h3 {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.35;
}
#articles-page .card__date {
  font-size: 0.9rem;
}
#works-page .card__date {
  font-size: 0.9rem;
}

/* Articlesページ: スマホでも「左サムネ + 右テキスト」に寄せる（スクショの見た目） */
#articles-page .card--article {
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  position: relative;
}
#articles-page .card--article .card__link {
  flex-direction: row;
  gap: 0;
}
#articles-page .card--article .card__thumb {
  /* Worksカードと同じ寸法 */
  flex: 0 0 clamp(140px, 40vw, 260px);
  width: clamp(140px, 40vw, 260px);
  padding-top: 0;
  aspect-ratio: 16 / 9;
  border-radius: 20px 0 0 20px;
  position: relative;
  overflow: hidden;
}
#articles-page .card--article .card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#articles-page .card--article .card__content {
  flex: 1 1 auto;
  border-top: none;
  border-left: 1px solid var(--card-border);
  padding: 1.1rem 1.2rem;
  justify-content: center;
}

/* 画面が広い時も Worksカードと同じ幅 */
@media (min-width: 760px) {
  #articles-page .card--article .card__thumb {
    flex: 0 0 320px;
    width: 320px;
  }
  #articles-page .card--article .card__content {
    padding: 1.25rem 1.4rem;
  }
}
.cards-scroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: clamp(1rem, 2vw, 1.5rem);
  padding-bottom: 1rem; /* スクロールバーの領域確保 */
  -webkit-overflow-scrolling: touch; /* iOSでの慣性スクロール */
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.cards-scroll::-webkit-scrollbar {
  height: 10px;
}
.cards-scroll::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
.cards-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.cards-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}
.cards-scroll > li {
  list-style: none;
  scroll-snap-align: start;
  flex: 0 0 auto; /* 横幅を固定しないと縮む */
  width: min(320px, 80vw); /* カードの幅設定 */
}
.cards > li {
  list-style:none;
}
.card {
  border:1px solid transparent;
  background:
    linear-gradient(var(--glass-bg-strong), var(--glass-bg-strong)) padding-box,
    linear-gradient(145deg, rgba(14,165,233,.22), rgba(251,191,36,.16), rgba(148,163,184,.24)) border-box;
  padding:1.6rem;
  border-radius: 24px;
  transition: background .2s ease, border .2s ease, transform .18s ease, box-shadow .25s ease;
  position: relative;
  box-shadow: var(--elev-1);
  will-change: transform;
}
:root[data-theme='dark'] .card {
  background:
    linear-gradient(var(--glass-bg-strong), var(--glass-bg-strong)) padding-box,
    linear-gradient(145deg, rgba(56,189,248,.24), rgba(251,191,36,.2), rgba(248,250,252,.16)) border-box;
}
.card::before {
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  pointer-events:none;
  background: radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,.28), transparent 48%);
  opacity:.5;
}
:root[data-theme='dark'] .card::before {
  background: radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,.12), transparent 50%);
  opacity: .6;
}
.card::after {
  content:"";
  position:absolute;
  inset:8% 6% auto auto;
  width:56px;
  height:56px;
  background: radial-gradient(circle at center, rgba(0,0,0,.06), transparent 70%);
  opacity:0;
  transition: opacity .28s ease;
}
:root[data-theme='dark'] .card::after {
  background: radial-gradient(circle at center, rgba(255,255,255,.08), transparent 70%);
}
.card:hover,
.card:focus-within {
  transform: translateY(-5px);
  border-color: transparent;
  background:
    linear-gradient(var(--card-bg-hover), var(--card-bg-hover)) padding-box,
    linear-gradient(145deg, rgba(14,165,233,.34), rgba(251,191,36,.28), rgba(148,163,184,.34)) border-box;
  box-shadow: var(--elev-2);
}
:root[data-theme='dark'] .card:hover,
:root[data-theme='dark'] .card:focus-within {
  background:
    linear-gradient(var(--card-bg-hover), var(--card-bg-hover)) padding-box,
    linear-gradient(145deg, rgba(56,189,248,.3), rgba(251,191,36,.28), rgba(248,250,252,.2)) border-box;
}
.card:hover::after,
.card:focus-within::after { opacity:1; }
.card.card--upcoming .card__link {
  cursor: default;
}
.card.card--upcoming .card__link:focus-visible {
  outline:none;
}
.card h3 {
  margin:0;
  font-size:1.12rem;
  font-weight:640;
  line-height: 1.36;
  letter-spacing: .014em;
}
.card__link {
  display:flex;
  flex-direction:column;
  gap:0.85rem;
  text-decoration:none;
  color:inherit;
  height:100%;
}
.card__link p {
  margin: 0;
  color: var(--muted);
  line-height: 1.74;
}
.card__note {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.card__thumb {
  position:relative;
  width:100%;
  padding-top:56.25%;
  border-radius:16px;
  overflow:hidden;
  background:var(--accent-weak);
  border:1px solid var(--card-border);
  isolation: isolate;
}
.card__thumb::after {
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  background: linear-gradient(112deg, transparent 14%, rgba(255,255,255,.28) 42%, rgba(255,255,255,.07) 53%, transparent 76%);
  transform: translateX(-130%);
  transition: transform .75s cubic-bezier(.22,.61,.36,1);
}
:root[data-theme='dark'] .card__thumb::after {
  background: linear-gradient(112deg, transparent 14%, rgba(255,255,255,.2) 42%, rgba(248,250,252,.08) 53%, transparent 76%);
}
.card__thumb--placeholder {
  background:
    radial-gradient(600px circle at 10% 20%, rgba(20,184,166,.25), transparent 55%),
    radial-gradient(700px circle at 90% 0%, rgba(251,191,36,.22), transparent 60%),
    linear-gradient(135deg, rgba(0,0,0,.02), rgba(0,0,0,.06));
}
.card__thumb img,
.card__thumb svg {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transform: scale(1);
  transition: transform .25s ease;
}
.card:hover .card__thumb::after,
.card:focus-within .card__thumb::after {
  transform: translateX(130%);
}
.card__thumb img.thumb-logo {
  /* アプリアイコンっぽく（角丸 + 枠 + 影 + 中央配置） */
  object-fit: contain;
  inset: auto;
  top: 50%;
  left: 50%;
  width: auto;
  height: 72%;
  border-radius: 22%;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 18px 40px -34px rgba(15,23,42,.35);
  transform: translate(-50%, -50%) scale(1);
}
:root[data-theme='dark'] .card__thumb img.thumb-logo {
  border-color: rgba(255,255,255,.20);
  box-shadow: 0 22px 52px -42px rgba(0,0,0,.85);
}
.card__thumb svg {
  object-fit: contain;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}
.card__content {
  display:flex;
  flex-direction:column;
  gap:0.45rem;
}
.card__meta {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:0.55rem;
  font-size:0.82rem;
  color:var(--muted);
}
.badge {
  display:inline-flex;
  align-items:center;
  gap:0.25rem;
  padding:0.2rem 0.7rem;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--accent-weak);
  font-size:0.72rem;
  font-weight:620;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:var(--accent-strong);
}
.badge--note {
  background: #0d9488;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.35);
}
:root[data-theme='dark'] .badge--note {
  background: #14b8a6;
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.badge--platform {
  background: rgba(59,130,246,.95);
  border-color: rgba(255,255,255,.4);
  color: #fff;
  box-shadow: 0 10px 24px -18px rgba(15,23,42,.35);
  text-transform: none;
}
:root[data-theme='dark'] .badge--platform {
  background: rgba(96,165,250,.92);
  border-color: rgba(255,255,255,.3);
}
.badge--web {
  background: rgba(34,197,94,.95);
  border-color: rgba(255,255,255,.4);
  color: #fff;
  box-shadow: 0 10px 24px -18px rgba(15,23,42,.35);
  text-transform: none;
}
:root[data-theme='dark'] .badge--web {
  background: rgba(74,222,128,.92);
  border-color: rgba(255,255,255,.3);
}
.badge--qiita {
  background: rgba(132,204,22,.95);
  border-color: rgba(255,255,255,.4);
  color: #fff;
  box-shadow: 0 10px 24px -18px rgba(15,23,42,.35);
  text-transform: none;
}
:root[data-theme='dark'] .badge--qiita {
  background: rgba(163,230,53,.92);
  border-color: rgba(255,255,255,.3);
}
.badge--zenn {
  background: rgba(59, 130, 246, .95);
  border-color: rgba(255, 255, 255, .4);
  color: #fff;
  box-shadow: 0 10px 24px -18px rgba(15, 23, 42, .35);
  text-transform: none;
}
:root[data-theme='dark'] .badge--zenn {
  background: rgba(96, 165, 250, .92);
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
}
.badge--local {
  background: rgba(100, 116, 139, .9);
  border-color: rgba(255, 255, 255, .35);
  color: #fff;
  box-shadow: 0 10px 24px -18px rgba(15, 23, 42, .35);
  text-transform: none;
}
:root[data-theme='dark'] .badge--local {
  background: rgba(148, 163, 184, .85);
  border-color: rgba(255, 255, 255, .25);
  color: #fff;
}
.badge--crypto {
  background: rgba(245,158,11,.95);
  border-color: rgba(255,255,255,.4);
  color: #fff;
  box-shadow: 0 10px 24px -18px rgba(15,23,42,.35);
  text-transform: none;
}
:root[data-theme='dark'] .badge--crypto {
  background: rgba(251,191,36,.92);
  border-color: rgba(255,255,255,.3);
}
.badge--corner {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  left: auto;
  z-index: 2;
  text-transform: none;
}
/* Articlesページではカード全体の右上に配置 */
#articles-page .card--article .badge--corner {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  left: auto;
  z-index: 10;
}
/* Worksページではカード全体の右上に配置 */
#works-page .card--work .badge--corner {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  left: auto;
  z-index: 10;
}
.badge--soon {
  position: absolute;
  left: 0.9rem;
  bottom: 0.9rem;
  z-index: 2;
  background: rgba(0,0,0,.62);
  border-color: rgba(255,255,255,.28);
  color: rgba(255,255,255,.92);
  letter-spacing: .12em;
  font-size: 0.64rem;
}
:root[data-theme='dark'] .badge--soon {
  /* サムネが白い場合でも読めるように、ダークモードでも暗めのピルにする */
  background: rgba(0,0,0,.62);
  border-color: rgba(255,255,255,.28);
  color: rgba(255,255,255,.92);
}
.badge--source {
  background:var(--meta-bg);
}
.badge--series {
  background:rgba(14,165,233,.15);
  border-color:rgba(14,165,233,.4);
  color:#0ea5e9;
}
:root[data-theme='dark'] .badge--series {
  border-color:rgba(56,189,248,.5);
  color:#38bdf8;
}
.meta__length,
.meta__status {
  font-weight:560;
  letter-spacing:.01em;
}
.tag-pills {
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-wrap:wrap;
  gap:0.45rem;
}
.tag-pills li {
  list-style:none;
  padding:0.35rem 0.8rem;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--accent-weak);
  font-size:0.78rem;
  font-weight:520;
  color:var(--accent-strong);
}
.card__cta {
  display:inline-flex;
  align-items:center;
  gap:0.2rem;
  font-weight:600;
  font-size:0.88rem;
  color:var(--accent-strong);
  opacity:.85;
  transition:opacity .2s ease;
}
.card__link:hover .card__cta,
.card__link:focus-visible .card__cta {
  opacity:1;
}
.card--article {
  padding: 0;
  overflow: hidden;
}
.card--article .card__link {
  gap: 0;
}
.card--article .card__thumb {
  border-radius: 24px 24px 0 0;
  border: none;
}
.card--article .card__content {
  padding: 1.1rem 1.2rem 1.3rem;
  background: var(--glass-bg-strong);
  border-top: 1px solid var(--card-border);
}
.card__date {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: 0.88rem;
  color: var(--muted);
  letter-spacing: .02em;
  font-weight: 520;
}
.card--article:hover .card__thumb img,
.card--article:focus-within .card__thumb img {
  transform: scale(1.03);
}
.card--work {
  padding: 0;
  overflow: hidden;
}
.card--work .card__link {
  gap: 0;
}
.card--work .card__thumb {
  border-radius: 24px 24px 0 0;
  border: none;
}
.card--work .card__content {
  padding: 1.1rem 1.2rem 1.3rem;
  background: var(--glass-bg-strong);
  border-top: 1px solid var(--card-border);
}
.card--work:hover .card__thumb img:not(.thumb-logo),
.card--work:focus-within .card__thumb img:not(.thumb-logo),
.card--work:hover .card__thumb svg,
.card--work:focus-within .card__thumb svg {
  transform: scale(1.03);
}
.card--work:hover .card__thumb img.thumb-logo,
.card--work:focus-within .card__thumb img.thumb-logo {
  transform: translate(-50%, -50%) scale(1.03);
}
.meta { margin:0; color:var(--muted); font-size:.92rem; }

/* プロフィール */
#profile-page .profile-section {
  display: grid;
  gap: clamp(1.8rem, 4vw, 2.8rem);
}
#profile-page .profile-hero {
  display: flex;
  align-items: center;
  gap: clamp(1.6rem, 4.2vw, 2.7rem);
  padding: clamp(1.7rem, 4.2vw, 2.5rem);
  background: var(--profile-hero-bg);
  border: 1px solid var(--profile-hero-border);
  border-radius: 28px;
  box-shadow: var(--profile-hero-shadow);
}
#profile-page .profile-portrait {
  width: clamp(140px, 22vw, 180px);
  height: clamp(140px, 22vw, 180px);
  /* 常に丸アイコンにする */
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 20px 40px -34px rgba(15,23,42,.28);
  border: 6px solid var(--profile-portrait-border);
}
#profile-page .profile-hero__content {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
#profile-page .profile-tagline {
  margin: 0;
  font-weight: 620;
  letter-spacing: .02em;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: var(--accent-strong);
}
#profile-page .profile-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
#profile-page .profile-body {
  display: grid;
  gap: clamp(1.6rem, 4vw, 2.4rem);
  align-items: start;
}
#profile-page .profile-cards {
  display: grid;
  gap: clamp(1.2rem, 3vw, 1.6rem);
  min-width: 0;
}
#profile-page .profile-card {
  margin: 0;
  padding: clamp(1.2rem, 3.2vw, 1.7rem);
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background: var(--card-bg-hover);
  box-shadow: var(--elev-1);
  transition: transform .18s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}
#profile-page .profile-card:hover,
#profile-page .profile-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--panel-border-strong);
  box-shadow: var(--elev-2);
}
#profile-page .profile-dl {
  display: grid;
  grid-template-columns: minmax(110px, 140px) minmax(0, 1fr);
  gap: 0.55rem 1.1rem;
  margin: 0;
}
#profile-page .profile-dl dt {
  margin: 0;
  font-weight: 650;
  letter-spacing: .02em;
  color: var(--muted);
}
#profile-page .profile-dl dd {
  margin: 0;
  font-weight: 520;
  color: var(--fg);
  min-width: 0;
}
#profile-page .profile-dl dd a {
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color .18s ease, border-color .18s ease;
}
#profile-page .profile-dl dd a:hover,
#profile-page .profile-dl dd a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Profile: 常に縦積みにする（Noteを右カラムにしない） */
#profile-page .profile-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg-hover);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 22px 46px -40px rgba(15,23,42,.2);
}
#profile-page .profile-table th,
#profile-page .profile-table td {
  padding: clamp(0.85rem, 2.3vw, 1.3rem) clamp(1.2rem, 3vw, 1.9rem);
  border-bottom: 1px solid var(--line);
}
#profile-page .profile-table th {
  width: 140px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  letter-spacing: .02em;
}
#profile-page .profile-table td {
  font-weight: 520;
  color: var(--fg);
}
#profile-page .profile-table tr:last-child th,
#profile-page .profile-table tr:last-child td {
  border-bottom: none;
}
#profile-page .profile-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
#profile-page .profile-links a {
  display: inline-flex;
  align-items: center;
  padding: .45rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--pill-bg);
  text-decoration: none;
  font-weight: 520;
  color: var(--accent-strong);
  letter-spacing: .01em;
  transition: background .2s ease, border .2s ease, transform .15s ease;
}
#profile-page .profile-links a:hover,
#profile-page .profile-links a:focus-visible {
  background: var(--pill-bg-hover);
  border-color: var(--panel-border-strong);
  transform: translateY(-1px);
}
#profile-page .profile-oshimen {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
#profile-page .profile-oshimen li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  border: 1px dashed var(--panel-border-strong);
  background: var(--note-bg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
#profile-page .profile-oshimen__group {
  font-weight: 620;
  letter-spacing: .02em;
  color: var(--accent-strong);
}
#profile-page .profile-oshimen__group--nogi {
  color: #7e1083;
}
#profile-page .profile-oshimen__group--hinata {
  color: #4baddd;
}
#profile-page .profile-oshimen__group--sakura {
  color: #e06a8e;
}
#profile-page .profile-oshimen__group--others {
  color: #d97706;
}
:root[data-theme='dark'] #profile-page .profile-oshimen__group--nogi {
  color: #d4aadd;
}
:root[data-theme='dark'] #profile-page .profile-oshimen__group--hinata {
  color: #7cc7e8;
}
:root[data-theme='dark'] #profile-page .profile-oshimen__group--sakura {
  color: #f9c6d6;
}
:root[data-theme='dark'] #profile-page .profile-oshimen__group--others {
  color: #fbbf24;
}
#profile-page .profile-oshimen__member {
  font-weight: 520;
  color: var(--fg);
}
#profile-page .profile-oshimen__member a {
  display: inline-block;
  align-items: center;
  gap: 0.2rem;
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color .18s ease, border-color .18s ease;
}
#profile-page .profile-oshimen__member a:hover,
#profile-page .profile-oshimen__member a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
#profile-page .profile-oshimen__hint {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}
#profile-page .profile-note {
  padding: clamp(1.2rem, 3vw, 1.8rem);
  border: 1px solid var(--panel-border);
  background: var(--note-bg);
  border-radius: 24px;
  box-shadow: var(--elev-1), inset 0 4px 0 var(--profile-note-border);
  color: var(--muted);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
#profile-page .profile-note > h2 {
  align-self: flex-start;
}
#profile-page .profile-note p { margin: 0; }

/* フッター */
.foot {
  /* main の上下余白と合わさって下が空きやすいので、少し詰める */
  margin-top: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-top:1px solid var(--line);
  color:var(--muted);
  text-align:center;
  font-size:.9rem;
}

/* Articlesページ：下の余白（padding/margin）が大きく見えるのを解消 */
#articles-page main {
  padding-bottom: clamp(0.9rem, 2.4vw, 1.4rem);
}
#articles-page main > section {
  margin-bottom: clamp(1.1rem, 3vw, 1.6rem);
}
#articles-page .foot {
  margin-top: 0;
}

/* Articles・Worksページ：スマホで横余白を抑える（共通） */
@media (max-width: 640px) {
  #articles-page main,
  #works-page main {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  #articles-page .narrow,
  #works-page .narrow {
    max-width: 100%;
  }
}
@media (max-width: 420px) {
  #articles-page main,
  #works-page main {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }
}

/* プロフィール専用ページ */
#profile-page .wrap {
  /* 他ページと同じく、上下の「謎の余白」を作らない */
  margin: 0 auto;
}
#profile-page .profile-section {
  margin-top: 0;
}

/* 細かい快適性 */
html { scroll-behavior: smooth; }

@media (max-width: 820px){
  .hero::before {
    background-position: 50% center;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero__body {
    padding-bottom: 0;
  }
  .hero__aside {
    position: static;
    margin-top: 0.5rem;
    max-width: none;
    width: 100%;
  }
  .list--icons,
  .list--friends.list--icons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #profile-page .profile-hero {
    flex-direction: column;
    text-align: center;
  }
  #profile-page .profile-hero__content {
    align-items: center;
  }
  #profile-page .profile-portrait {
    border-radius: 50%;
  }
  #profile-page .profile-table th {
    width: auto;
  }
  #profile-page .profile-links {
    justify-content: center;
  }
  #profile-page .profile-note {
    border-radius: 24px;
  }
}

@media (max-width: 640px){
  /* 画面を有効活用（余白＝ベゼル感を減らす） */
  .wrap {
    margin: 0 auto;
  }
  main { border-radius: 0; }
  .hero {
    padding: 1.25rem;
    /* ここは角丸なしでOK（スマホ時） */
    border-radius: 0;
  }
  .hero::before {
    background-position: 15% center;
  }
  /* ヘッダーは常に1行に固定（足りない場合はJSで自動縮小、最終手段でナビだけ横スクロール） */
  .site-header__inner {
    flex-wrap: nowrap;
    padding: 0.75rem clamp(1rem, 3vw, 1.4rem);
    gap: clamp(0.5rem, 2vw, 1rem);
  }
  .site-header__inner .top-nav {
    width: auto;
    margin-left: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.5rem 0.75rem;
  }
  .site-header__inner .theme-toggle {
    margin-left: 0;
  }

  /* スマホでも詰まりすぎないように上下の余白を確保 */
  main { padding: 0.85rem clamp(0.375rem, 1vw, 0.625rem) 1rem; }
  .list:not(.list--icons) { grid-template-columns: 1fr; }
  /* Social/Links の両方を4列に固定（in-appブラウザ差分にも強い指定） */
  .list--icons,
  .list--friends.list--icons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .list--icons a,
  .list--friends.list--icons a {
    padding: 0.72rem 0.45rem;
  }
  .social-label,
  .list--icons .friend-card__name {
    font-size: 0.82rem;
  }
  .cards { grid-template-columns: 1fr; }
  .profile {
    grid-template-columns: 1fr;
    text-align:center;
  }
  .profile dl { margin:0 auto; }
  .reload-btn {
    padding: 0.5rem 0.85rem;
    gap: 0.65rem;
  }
  .theme-toggle {
    padding: 0.45rem 0.8rem;
  }
  /* スマホ：スイッチを非表示にしてアイコンのみ表示 */
  .theme-toggle--switch .theme-toggle__track {
    display: none;
  }
  .theme-toggle--switch {
    padding: 0.5rem;
    gap: 0;
    justify-content: center;
    min-width: 44px;
    width: 44px;
    height: 44px;
  }
  .theme-toggle--switch .theme-toggle__glyph {
    width: 24px;
    height: 24px;
    opacity: 1;
  }
  .theme-toggle--switch .theme-icon {
    width: 20px;
    height: 20px;
  }
  .reload-icon-wrapper {
    width: 36px;
    height: 36px;
  }
  .reload-icon {
    width: 100%;
    height: 100%;
  }
  .reload-text {
    font-size: 0.82rem;
  }
  #profile-page .profile-section {
    gap: clamp(1.4rem, 6vw, 2.2rem);
  }
  #profile-page .profile-table th,
  #profile-page .profile-table td {
    padding: clamp(0.75rem, 4vw, 1.1rem) clamp(1rem, 5vw, 1.4rem);
  }
  #profile-page .profile-links {
    gap: .55rem;
  }
  #profile-page .profile-dl {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  #profile-page .profile-dl dt {
    font-size: 0.82rem;
  }

  /* スマホ：記事フィルタタブ */
  .articles-filter {
    gap: 0.35rem;
    padding: 0.4rem;
    border-radius: 12px;
  }
  .articles-filter__tab {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 8px;
  }
  .articles-filter__tab-note {
    font-size: 0.7em;
    margin-left: 0.2rem;
  }
  .articles-empty {
    min-height: 200px;
    padding: 1.5rem;
  }
  .articles-empty__text {
    font-size: 0.9rem;
  }

  /* スマホ：Articles/Works のカードサイズを統一 */
  #articles-page .card--article,
  #works-page .card--work {
    height: 120px;
    min-height: 120px;
    max-height: 120px;
    overflow: hidden;
  }
  #articles-page .card--article .card__link,
  #works-page .card--work .card__link {
    align-items: stretch;
    height: 100%;
  }
  #articles-page .card--article .card__thumb,
  #works-page .card--work .card__thumb {
    height: 120px;
    min-height: 120px;
    max-height: 120px;
    aspect-ratio: unset;
    flex: 0 0 40%;
    width: 40%;
    padding-top: 0;
  }
  #articles-page .card--article .card__thumb img,
  #works-page .card--work .card__thumb img:not(.thumb-logo),
  #works-page .card--work .card__thumb svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
  #articles-page .card--article .card__content,
  #works-page .card--work .card__content {
    min-height: 0;
    padding: 0.5rem 0.75rem;
    justify-content: center;
    gap: 0.18rem;
    overflow: hidden;
  }
  #articles-page .card--article .card__content {
    justify-content: center;
    gap: 0.2rem;
  }
  #articles-page .card--article h3,
  #works-page .card--work h3 {
    font-size: 0.98rem;
    line-height: 1.3;
  }
  #articles-page .card__date,
  #works-page .card__date {
    font-size: 0.82rem;
  }
  /* スマホ：NOTEバッジの文字が大きく見えるので少し小さく */
  #articles-page .badge--note {
    font-size: 0.64rem;
    padding: 0.16rem 0.55rem;
    letter-spacing: 0.06em;
  }
  #articles-page .badge--corner {
    top: 0.75rem;
    right: 0.75rem;
    left: auto;
  }
  #works-page .cards {
    gap: 1rem;
  }
  #works-page .card--work .card__link {
    align-items: stretch;
  }
  #works-page .card--work .card__thumb {
    height: auto;
    min-height: 100%;
    aspect-ratio: auto;
  }
  #works-page .card--work .card__link p {
    margin: 0;
    line-height: 1.35;
  }
  #works-page .card--work .card__content > p:not(.card__note) {
    font-size: 0.94rem;
    margin-top: 0.14rem;
    display: -webkit-box;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #works-page .card--work .card__note {
    margin-top: 0.16rem !important;
    font-size: 0.8rem !important;
    line-height: 1.3;
    display: -webkit-box;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #works-page .badge--corner {
    top: 0.75rem;
    right: 0.75rem;
    left: auto;
  }
  /* スマホ：COMING SOON/LATERバッジのサイズを小さく */
  .badge--soon {
    font-size: 0.56rem;
    padding: 0.14rem 0.5rem;
    letter-spacing: 0.1em;
    left: 0.65rem;
    bottom: 0.65rem;
  }
}

@media (max-width: 420px){
  :root {
    --tile-social-icon-box: 38px;
    --tile-social-icon-size: 32px;
    --tile-friend-avatar-size: 44px;
    --tile-friend-plus-size: 44px;
    --tile-friend-plus-font-size: 1.1rem;
  }
  .wrap {
    margin: 0 auto;
  }
  main {
    border-radius: 0;
    /* 極小幅でも詰まりすぎないように上下に少し余白 */
    padding: 0.75rem 0.95rem 0.95rem;
  }
  section {
    margin: 1.2rem 0;
  }
  .section__intro--bar,
  .section__intro--split {
    padding: 0.65rem 0.75rem;
    border-radius: 16px;
  }
  .section__more {
    font-size: 0.85rem;
  }
  .section__cta {
    justify-content: center;
  }
  .site-header__inner {
    padding: 0.7rem 1rem;
    gap: 0.5rem;
  }
  .site-header__inner .top-nav {
    justify-content: flex-end;
    gap: 0.4rem 0.6rem;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
  }
  .site-header .reload-icon-wrapper {
    width: 28px;
    height: 28px;
  }
  .site-header .reload-text {
    font-size: 0.82rem;
  }
  /* 420px以下でもスイッチを非表示にしてアイコンのみ表示（640pxの設定を継承） */
  .theme-toggle--switch .theme-toggle__track {
    display: none;
  }
  .theme-toggle--switch {
    padding: 0.5rem;
    gap: 0;
    justify-content: center;
    min-width: 44px;
    width: 44px;
    height: 44px;
  }
  .theme-toggle--switch .theme-toggle__glyph {
    width: 24px;
    height: 24px;
    opacity: 1;
  }
  .theme-toggle--switch .theme-icon {
    width: 20px;
    height: 20px;
  }
  .top-nav a::after {
    bottom: 0.1rem;
  }
  .list--icons,
  .list--friends.list--icons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .list--icons a,
  .list--friends.list--icons a {
    padding: 0.68rem 0.35rem;
    border-radius: 16px;
  }
  .social-label,
  .list--icons .friend-card__name {
    font-size: 0.78rem;
  }
  #articles-page .card--article .card__content,
  #works-page .card--work .card__content {
    padding: 0.78rem 0.78rem;
  }
  #articles-page .card--article h3,
  #works-page .card--work h3 {
    font-size: 0.96rem;
    line-height: 1.28;
  }
  #articles-page .card__date,
  #works-page .card__date {
    font-size: 0.8rem;
  }
  #works-page .card--work .card__content > p:not(.card__note) {
    font-size: 0.9rem;
  }
  #works-page .card--work .card__note {
    font-size: 0.76rem !important;
  }
  #works-page .cards {
    gap: 0.85rem;
  }
  /* 極小画面：COMING SOON/LATERバッジをさらに小さく */
  .badge--soon {
    font-size: 0.52rem;
    padding: 0.12rem 0.45rem;
    letter-spacing: 0.08em;
    left: 0.6rem;
    bottom: 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce){
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .site-header,
  .hero__aside,
  .bgm-badge {
    backdrop-filter: none !important;
  }
  .btn--fortune:hover,
  .fortune-btn:hover {
    transform: none;
  }
  .reveal-target {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .hero__orb {
    animation: none !important;
  }
  .quick-dock__item:hover,
  .quick-dock__item:focus-visible {
    transform: none;
  }
  .card__thumb::after {
    display: none;
  }
}

@keyframes heroOrbFloatA {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-18px, 16px, 0) scale(1.06); }
}
@keyframes heroOrbFloatB {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(20px, -14px, 0) scale(0.94); }
}
@keyframes heroOrbFloatC {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-12px, -18px, 0) scale(1.08); }
}

@keyframes ping {
  0% { transform: scale(.95); box-shadow:0 0 0 0 var(--status-dot-ring); }
  70% { transform: scale(1); box-shadow:0 0 0 10px rgba(0,0,0,0); }
  100% { transform: scale(.95); box-shadow:0 0 0 0 rgba(0,0,0,0); }
}

/* =========================================
   おみくじ
   ========================================= */

/* ボタンと結果を配置するエリア */
.fortune-container {
  text-align: center;
  margin: 0;
  padding: 0;
  min-height: 150px; /* コメントとラッキーアイテム分の高さを確保 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 補助テキスト */
.fortune-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: .01em;
  transition: opacity 0.3s ease;
}

.fortune-hint.fortune-loading {
  animation: fortunePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes fortunePulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.02);
  }
}

/* ボタンのデザイン */
.fortune-btn {
  border-color: var(--fortune-accent);
  background: var(--ghost-bg);
  color: var(--fortune-accent);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ホバー時の動き */
.fortune-btn:hover {
  background: var(--fortune-accent);
  border-color: var(--fortune-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 0, 51, 0.3);
}

/* 結果テキストのデザイン */
.fortune-result {
  display: none;
  font-size: 2rem;
  font-weight: bold;
  color: var(--fortune-accent);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: scale(1) translateY(0);
  position: relative;
  min-height: 80px;
  overflow: hidden;
}

.fortune-result.fortune-reveal {
  animation: fortuneReveal 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* スロットマシンのコンテナ */
.fortune-slot {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 80px;
  --slot-item-height: 80px;
  margin: 0 auto;
  overflow: hidden;
  border: 3px solid var(--fortune-accent);
  border-radius: 12px;
  background: linear-gradient(
    to bottom,
    rgba(230, 0, 51, 0.15) 0%,
    transparent 25%,
    transparent 75%,
    rgba(230, 0, 51, 0.15) 100%
  );
  box-shadow: 
    inset 0 0 30px rgba(230, 0, 51, 0.3),
    0 4px 12px rgba(230, 0, 51, 0.2);
}

.fortune-slot-stopped {
  animation: fortuneSlotStop 0.3s ease-out forwards;
}

@keyframes fortuneSlotStop {
  0% {
    box-shadow: 
      inset 0 0 30px rgba(230, 0, 51, 0.3),
      0 4px 12px rgba(230, 0, 51, 0.2);
  }
  100% {
    box-shadow: 
      inset 0 0 30px rgba(230, 0, 51, 0.3),
      0 4px 12px rgba(230, 0, 51, 0.2),
      0 0 20px rgba(230, 0, 51, 0.4);
  }
}

/* スロットの中央に選択線を表示 */
.fortune-slot::before,
.fortune-slot::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--fortune-accent);
  z-index: 10;
  box-shadow: 0 0 8px var(--fortune-accent);
}

.fortune-slot::before {
  top: 0;
}

.fortune-slot::after {
  bottom: 0;
}

/* スロットリール */
.fortune-slot-reel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transform: translateY(0);
  will-change: transform;
  width: 100%;
  height: 100%;
}

/* スロットアイテム */
.fortune-slot-item {
  height: var(--slot-item-height, 80px);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: var(--fortune-accent);
  flex-shrink: 0;
}

/* スロット回転アニメーション */
.fortune-slot-spinning {
  animation: fortuneSlotSpin 0.08s linear infinite;
}

@keyframes fortuneSlotSpin {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(calc(var(--slot-item-height, 80px) * -1));
  }
}

/* スロット減速アニメーション */
.fortune-slot-slowing {
  animation: fortuneSlotSlow 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fortuneSlotSlow {
  0% {
    transform: translateY(var(--slot-start, 0));
  }
  100% {
    transform: translateY(var(--slot-end, 0));
  }
}

/* 最終結果テキスト */
.fortune-result-text {
  display: none;
  font-size: 2rem;
  font-weight: bold;
  color: var(--fortune-accent);
  text-align: center;
  opacity: 1;
  min-height: 80px;
}

.fortune-result-text[style*="block"] {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.fortune-result.fortune-shuffling {
  animation: fortuneShuffleText 0.08s ease-in-out;
  opacity: 0.7;
  transform: scale(0.9);
}

.fortune-result:hover {
  opacity: 0.8;
}

.fortune-comment {
  display: none;
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  transition: opacity 0.2s ease;
  opacity: 0;
  transform: translateY(10px);
}

.fortune-comment.fortune-reveal {
  animation: fortuneFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fortune-comment:hover {
  opacity: 0.8;
}

.fortune-lucky {
  display: none;
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  transition: opacity 0.2s ease;
  opacity: 0;
  transform: translateY(10px);
}

.fortune-lucky.fortune-reveal {
  animation: fortuneFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fortune-lucky:hover {
  opacity: 0.8;
}

/* 「もう一度」ボタン */
.fortune-retry-btn {
  margin-top: 0.5rem;
  animation: fortuneRetryAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fortuneRetryAppear {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 結果が表示されている時のコンテナ */
.fortune-container:has(.fortune-result[style*="block"]) {
  cursor: pointer;
}

/* アニメーション定義 */
@keyframes rotateOut {
  0% { transform: rotateX(0) scale(1); opacity: 1; }
  100% { transform: rotateX(90deg) scale(0.8); opacity: 0; }
}

@keyframes popUp {
  0% { transform: translateY(20px) scale(0.5); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* おみくじ結果の演出アニメーション（滑らか版） */
@keyframes fortuneReveal {
  0% {
    transform: scale(0.2) translateY(40px) rotateY(120deg);
    opacity: 0;
    filter: blur(8px);
  }
  30% {
    transform: scale(0.6) translateY(15px) rotateY(60deg);
    opacity: 0.4;
    filter: blur(4px);
  }
  60% {
    transform: scale(1.05) translateY(-3px) rotateY(0deg);
    opacity: 0.9;
    filter: blur(1px);
  }
  80% {
    transform: scale(0.98) translateY(1px) rotateY(0deg);
    opacity: 1;
    filter: blur(0px);
  }
  100% {
    transform: scale(1) translateY(0) rotateY(0deg);
    opacity: 1;
    filter: blur(0px);
  }
}

@keyframes fortuneFadeIn {
  0% {
    transform: translateY(15px);
    opacity: 0;
    filter: blur(4px);
  }
  50% {
    transform: translateY(3px);
    opacity: 0.6;
    filter: blur(1px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
    filter: blur(0px);
  }
}

/* おみくじを引く前のシャッフル演出（滑らか版） */
@keyframes fortuneShuffle {
  0% { 
    transform: rotate(0deg) scale(1) translateY(0);
  }
  25% { 
    transform: rotate(-3deg) scale(0.97) translateY(-2px);
  }
  50% { 
    transform: rotate(0deg) scale(1) translateY(0);
  }
  75% { 
    transform: rotate(3deg) scale(0.97) translateY(-2px);
  }
  100% { 
    transform: rotate(0deg) scale(1) translateY(0);
  }
}

.fortune-btn[aria-busy="true"] {
  animation: fortuneShuffle 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 結果テキストのシャッフル演出 */
@keyframes fortuneShuffleText {
  0% {
    transform: scale(0.85) rotateZ(-2deg);
    opacity: 0.5;
  }
  50% {
    transform: scale(0.95) rotateZ(2deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(0.9) rotateZ(0deg);
    opacity: 0.7;
  }
}

/* JSから付与されるクラス */
.animate-out {
  animation: rotateOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* iPad向けのおみくじスタイル調整 */
@media (min-width: 768px) and (max-width: 1024px) {
  .fortune-container {
    padding: 1rem;
    min-height: 200px;
    gap: 0.8rem;
  }
  
  .fortune-slot {
    max-width: 100%;
    width: 100%;
    height: 90px;
    --slot-item-height: 90px;
  }
  
  .fortune-slot-item {
    height: var(--slot-item-height, 90px);
    font-size: 1.75rem;
  }
  
  .fortune-result {
    font-size: 1.75rem;
    min-height: 90px;
  }
  
  .fortune-result-text {
    font-size: 1.75rem;
    min-height: 90px;
  }
  
  .fortune-btn {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }
  
  .fortune-comment {
    font-size: 1.05rem;
    max-width: 100%;
    line-height: 1.7;
  }
  
  .fortune-lucky {
    font-size: 1rem;
  }
}

/* =========================================
   LINE風 BGMバッジ
   ========================================= */
.profile-bgm {
  margin-top: -0.25rem;
  margin-bottom: 0.25rem;
  display: flex;
  justify-content: flex-start;
}

/* モバイルで中央寄せにする場合 */
@media (max-width: 820px) {
  .profile-bgm {
    justify-content: center;
  }
}

.bgm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.8rem 0.35rem 0.45rem;
  background: rgba(0, 0, 0, 0.4); /* デフォルトで少し暗く */
  border-radius: 999px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, transform 0.15s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  max-width: 100%;
  overflow: hidden;
}

/* ダークモード/ライトモードで調整 */
:root[data-theme='light'] .bgm-badge {
  background: rgba(255, 255, 255, 0.6);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme='dark'] .bgm-badge {
  background: rgba(40, 40, 40, 0.6);
  color: #f0f0f0;
  border-color: rgba(255, 255, 255, 0.1);
}

.bgm-badge:hover {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  transform: translateY(-1px);
}
:root[data-theme='light'] .bgm-badge:hover {
  background: rgba(255, 255, 255, 0.85);
  color: #000;
}
:root[data-theme='dark'] .bgm-badge:hover {
  background: rgba(60, 60, 60, 0.8);
  color: #fff;
}

.bgm-badge__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #27ae60; /* LINE music green */
  border-radius: 50%;
  color: #fff;
  flex-shrink: 0;
}
.bgm-badge__icon svg {
  width: 12px;
  height: 12px;
  margin-left: 2px; /* 三角を中央に見せる微調整 */
}

.bgm-badge__content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 100px;
}

.bgm-badge__text {
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.02em;
  /* 長い場合にスクロールさせるアニメーション */
  /* mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%); */
}

.bgm-badge__eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  margin-left: 0.2rem;
}

.bgm-badge__eq span {
  display: block;
  width: 3px;
  background: currentColor;
  border-radius: 1px;
  opacity: 0.8;
  animation: eq-bounce 1s ease-in-out infinite;
}
.bgm-badge__eq span:nth-child(1) { height: 6px; animation-delay: 0s; }
.bgm-badge__eq span:nth-child(2) { height: 12px; animation-delay: 0.2s; }
.bgm-badge__eq span:nth-child(3) { height: 8px; animation-delay: 0.4s; }
.bgm-badge__eq span:nth-child(4) { height: 10px; animation-delay: 0.1s; }

@keyframes eq-bounce {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.4); }
}
