:root {
  --bg: #0a0a0f;
  --bg-soft: #12121a;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f8;
  --muted: #9a9ab0;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --grad: linear-gradient(135deg, #7c5cff 0%, #00d4ff 100%);
  --grad-soft: linear-gradient(135deg, #7c5cff33 0%, #00d4ff33 100%);
  --radius: 18px;
  --max: 1180px;
  --max-read: 760px;
  --font: "Hiragino Sans", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.4; animation: float 18s ease-in-out infinite; }
.aurora span:nth-child(1) { width: 520px; height: 520px; background: #7c5cff; top: -120px; left: -80px; }
.aurora span:nth-child(2) { width: 440px; height: 440px; background: #00d4ff; bottom: -100px; right: -60px; animation-delay: -6s; }
.aurora span:nth-child(3) { width: 360px; height: 360px; background: #ff5c97; top: 40%; left: 55%; animation-delay: -11s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -40px) scale(1.1); }
  66% { transform: translate(-40px, 50px) scale(0.95); }
}
.grid-overlay {
  position: fixed; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  pointer-events: none;
}

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

/* Nav */
nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 15, 0.6);
  border-bottom: 1px solid var(--border);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; text-decoration: none; color: var(--text); }
.logo .dot { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; font-size: 16px; box-shadow: 0 0 24px rgba(124, 92, 255, 0.5); }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14.5px; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 12px; font-size: 14.5px; font-weight: 600; text-decoration: none; border: none; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 30px rgba(124, 92, 255, 0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(124, 92, 255, 0.5); }

/* Hero */
header { padding: 110px 0 70px; text-align: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; background: var(--grad-soft); border: 1px solid var(--border); font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.pill .live { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
h1 { font-size: clamp(34px, 5.5vw, 60px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 800; margin-bottom: 22px; }
h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sub { font-size: clamp(16px, 2.2vw, 20px); color: var(--muted); max-width: 640px; margin: 0 auto; }

/* Article list */
section { padding: 50px 0 90px; }
.sec-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.sec-head h2 { font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.02em; margin-bottom: 14px; }
.sec-head p { color: var(--muted); font-size: 16px; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 28px; transition: transform 0.3s, border-color 0.3s, background 0.3s;
  text-decoration: none; color: inherit; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-5px); border-color: rgba(124, 92, 255, 0.4); background: rgba(124, 92, 255, 0.06); }
.card .cat { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--grad-soft); border: 1px solid var(--border); color: var(--accent-2); width: fit-content; margin-bottom: 16px; }
.card h3 { font-size: 21px; line-height: 1.4; margin-bottom: 12px; letter-spacing: -0.01em; }
.card p.ex { color: var(--muted); font-size: 14.5px; flex: 1; }
.card .meta { color: var(--muted); font-size: 13px; margin-top: 18px; }

.loading { color: var(--muted); font-size: 15px; padding: 30px 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 36px; }
.chip {
  padding: 8px 18px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  transition: all 0.2s; font-family: inherit;
}
.chip:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 20px rgba(124,92,255,0.35); }
.more-btn { display: block; margin: 40px auto 0; }

/* Footer */
footer { padding: 60px 0 40px; border-top: 1px solid var(--border); margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 44px; }
.foot-grid h4 { font-size: 14px; margin-bottom: 16px; color: var(--text); }
.foot-grid a { display: block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 10px; transition: color 0.2s; }
.foot-grid a:hover { color: var(--text); }
.foot-grid .logo { margin-bottom: 14px; }
.foot-grid .desc { color: var(--muted); font-size: 14px; max-width: 280px; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; flex-wrap: wrap; gap: 12px; }

/* Article page */
.article { padding: 110px 0 60px; }
.article .wrap { max-width: var(--max-read); }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 28px; transition: color 0.2s; }
.back:hover { color: var(--text); }
.article .cat { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--grad-soft); border: 1px solid var(--border); color: var(--accent-2); margin-bottom: 18px; }
.article h1 { font-size: clamp(28px, 4.5vw, 44px); line-height: 1.25; letter-spacing: -0.02em; margin-bottom: 16px; text-align: left; }
.article .meta { color: var(--muted); font-size: 14px; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.article .lead { font-size: 18px; color: #d8d8e6; margin-bottom: 36px; padding: 18px 22px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; }
.article .body { font-size: 16.5px; }
.article .body h2 { font-size: 26px; margin: 44px 0 18px; letter-spacing: -0.01em; padding-top: 8px; }
.article .body h2::before { content: ""; display: inline-block; width: 22px; height: 4px; border-radius: 2px; background: var(--grad); margin-right: 12px; vertical-align: middle; }
.article .body h3 { font-size: 20px; margin: 30px 0 12px; color: #e8e8f2; }
.article .body p { margin-bottom: 20px; color: #dcdce8; }
.article .body ul, .article .body ol { margin: 0 0 22px 24px; color: #dcdce8; }
.article .body li { margin-bottom: 10px; }
.article .body strong { color: #fff; font-weight: 700; }
.article .body blockquote { margin: 24px 0; padding: 16px 22px; border-left: 3px solid var(--accent-2); background: rgba(0, 212, 255, 0.06); border-radius: 0 10px 10px 0; color: #cfeefb; font-style: italic; }
.article .body code { background: var(--surface); border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; font-size: 14px; color: var(--accent-2); }
.article .body .note { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; margin: 28px 0; font-size: 15px; color: var(--muted); }
.article .body .note strong { color: var(--text); }
.share { margin: 50px 0 20px; padding-top: 30px; border-top: 1px solid var(--border); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.share span { color: var(--muted); font-size: 14px; }
.share a { color: var(--text); text-decoration: none; font-size: 14px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); transition: background 0.2s; }
.share a:hover { background: rgba(255,255,255,0.08); }

.related { margin: 20px auto 40px; max-width: var(--max-read); box-sizing: border-box; }
.rel-head { font-size: 22px; font-weight: 700; margin: 0 0 18px; color: var(--text); }
.rel-grid { display: grid; grid-template-columns: 1fr; gap: 14px; max-width: var(--max-read); margin: 0 auto; }
.rel-card { display: flex; flex-direction: row; align-items: center; gap: 16px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); text-decoration: none; transition: transform 0.2s, border-color 0.2s; }
.rel-card:hover { transform: translateY(-3px); border-color: var(--accent-2); }
.rel-cat { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: var(--grad-soft); border: 1px solid var(--border); color: var(--accent-2); width: fit-content; flex-shrink: 0; }
.rel-title { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.45; }
.rel-ex { display: none; }

/* カテゴリ別カラー（訪問者の回遊性向上） */
.cat[data-cat="モデル"], .rel-cat[data-cat="モデル"], .chip[data-cat="モデル"] { --cc: #7c5cff; }
.cat[data-cat="エージェント"], .rel-cat[data-cat="エージェント"], .chip[data-cat="エージェント"] { --cc: #00d4ff; }
.cat[data-cat="オープン"], .rel-cat[data-cat="オープン"], .chip[data-cat="オープン"] { --cc: #34d399; }
.cat[data-cat="法規制"], .rel-cat[data-cat="法規制"], .chip[data-cat="法規制"] { --cc: #ff5c97; }
.cat[data-cat="画像"], .rel-cat[data-cat="画像"], .chip[data-cat="画像"] { --cc: #ffb454; }
.cat[data-cat="動画"], .rel-cat[data-cat="動画"], .chip[data-cat="動画"] { --cc: #ff7a59; }
.cat[data-cat="音声"], .rel-cat[data-cat="音声"], .chip[data-cat="音声"] { --cc: #b06cff; }
.cat[data-cat="社会"], .rel-cat[data-cat="社会"], .chip[data-cat="社会"] { --cc: #4dd0e1; }
.cat[data-cat="開発"], .rel-cat[data-cat="開発"], .chip[data-cat="開発"] { --cc: #8bc34a; }
.cat[data-cat="検索"], .rel-cat[data-cat="検索"], .chip[data-cat="検索"] { --cc: #5c9dff; }
.cat[data-cat="ローカル"], .rel-cat[data-cat="ローカル"], .chip[data-cat="ローカル"] { --cc: #c0c0d0; }
.cat, .rel-cat { color: var(--cc, var(--accent-2)) !important; border-color: color-mix(in srgb, var(--cc, var(--accent-2)) 40%, transparent) !important; background: color-mix(in srgb, var(--cc, var(--accent-2)) 14%, transparent) !important; }
.chip[data-cat]:not([data-cat="all"]) { color: var(--cc); border-color: color-mix(in srgb, var(--cc) 40%, transparent); }
.chip[data-cat]:not([data-cat="all"]):hover { background: color-mix(in srgb, var(--cc) 20%, transparent); }
.chip.active[data-cat]:not([data-cat="all"]) { background: var(--cc); color: #fff; border-color: transparent; }

@media (max-width: 880px) { .rel-grid { grid-template-columns: 1fr; } }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s, transform 0.7s; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 880px) {
  .cards { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 520px) {
  .foot-grid { grid-template-columns: 1fr; }
  header { padding: 90px 0 50px; }
}
