:root {
  --bg: #080a12;
  --bg-soft: #0d111c;
  --surface: #141826;
  --card: #161b2c;
  --ink: #f2f4fa;
  --muted: #9aa3b8;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #8b7cff;
  --accent-hover: #b4a9ff;
  --cyan: #5eead4;
  --accent-soft: rgba(139, 124, 255, 0.16);
  --cyan-soft: rgba(94, 234, 212, 0.1);
  --stamp: #fb8b9a;
  --stamp-soft: rgba(251, 139, 154, 0.14);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 1px 0 rgba(139, 124, 255, 0.18) inset, 0 20px 50px rgba(29, 20, 70, 0.45);
  --sans: "Zen Kaku Gothic New", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --display: "Syne", "Zen Kaku Gothic New", sans-serif;
  --max: 1120px;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 85% -10%, rgba(139, 124, 255, 0.22), transparent 60%),
    radial-gradient(800px 400px at 0% 20%, rgba(94, 234, 212, 0.07), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  font-feature-settings: "palt";
}
::selection { background: rgba(139, 124, 255, 0.38); color: #fff; }

a {
  color: var(--accent-hover);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--cyan); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 18, 0.78);
  backdrop-filter: blur(18px) saturate(1.2);
}
.site-header::after {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--cyan), transparent);
  opacity: 0.55;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.brand-logo {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent) 0%, #6d5efc 45%, var(--cyan) 100%);
  box-shadow: 0 0 16px rgba(139, 124, 255, 0.55);
  flex: none;
}
.brand-mark {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}
.brand-stamp {
  display: inline-block;
  border: 1px solid rgba(251, 139, 154, 0.55);
  color: var(--stamp);
  font-family: var(--display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 2px 7px 1px;
  border-radius: 999px;
  line-height: 1.4;
  background: var(--stamp-soft);
}
.nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
}
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--accent-soft);
}

/* Hero */
.hero {
  position: relative;
  padding: 88px 0 32px;
  overflow: clip;
}
.hero-glow {
  pointer-events: none;
  position: absolute;
  inset: -20% 10% auto auto;
  width: 540px;
  height: 540px;
  background: radial-gradient(circle, rgba(139, 124, 255, 0.28), transparent 68%);
  filter: blur(8px);
}
.hero-inner { position: relative; }
.eyebrow {
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.hero h1 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(2.15rem, 6vw, 3.6rem);
  line-height: 1.2;
  margin: 0 0 22px;
  letter-spacing: 0.02em;
  max-width: 14em;
  text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 0%, #d8d6f8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  font-size: 1.18rem;
  line-height: 1.85;
  color: var(--ink);
  max-width: 46rem;
  margin: 0 0 18px;
  font-weight: 400;
  text-wrap: pretty;
}
.hero-note {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 42rem;
  margin: 0 0 44px;
}

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 20px;
  box-shadow: var(--shadow);
}
.panel h2 {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
}
.panel p { margin: 0 0 14px; color: var(--muted); }
.panel p:last-child { margin-bottom: 0; }
.sponsor-slot {
  border: 1px dashed rgba(139, 124, 255, 0.35);
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 9px,
      rgba(139, 124, 255, 0.06) 9px,
      rgba(139, 124, 255, 0.06) 10px
    );
  min-height: 96px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 0.88rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(180deg, #9a8dff, var(--accent));
  color: #0b0a14 !important;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 24px rgba(139, 124, 255, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn:hover {
  color: #0b0a14 !important;
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgba(139, 124, 255, 0.42);
  transform: translateY(-1px);
}

/* Catalog */
.catalog { padding: 16px 0 80px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.section-title {
  margin: 18px 0 0;
  font-family: var(--sans);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.count {
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  margin: 18px 0 0;
}

.toolbar { margin: 0 0 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filter-label {
  font-family: var(--display);
  font-size: 0.68rem;
  color: var(--muted);
  width: 100%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 8px 0 2px;
  font-weight: 700;
}
.chip {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: var(--accent); color: #fff; }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0a14;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 124, 255, 0.45);
  box-shadow: var(--shadow-hover);
}
.card-meta, .detail-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--display);
  letter-spacing: 0.06em;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.card-meta time { color: var(--cyan); }
.card h2, .prose h1 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.45;
}
.card h2 { font-size: 1.08rem; margin: 0; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { color: var(--accent-hover); }
.summary { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.75; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tag {
  background: var(--accent-soft);
  color: #d6d0ff;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid rgba(139, 124, 255, 0.18);
}
.result {
  margin: 0;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.22);
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.7;
}
.stamp {
  display: inline-block;
  border: 1px solid rgba(251, 139, 154, 0.55);
  color: var(--stamp);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0 6px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: 1px;
  background: var(--stamp-soft);
}
.card-actions {
  margin-top: auto;
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 500;
  padding-top: 4px;
}
.card-actions a { text-decoration: none; color: var(--accent-hover); }
.card-actions a:hover { color: var(--cyan); }
.card-actions a[href*="cases/"]::after { content: " →"; }
.empty { display: none; color: var(--muted); padding: 24px 0 48px; }
.empty.show { display: block; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  padding: 48px 0 56px;
  color: var(--muted);
  font-size: 0.88rem;
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, var(--accent), var(--cyan), transparent 95%);
  opacity: 0.5;
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 40px;
}
.footer-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 1rem;
}
.footer-brand p { margin: 0 0 8px; }
.footer-meta p { margin: 0 0 8px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; }
.footer-nav a { color: var(--ink); text-decoration: none; }
.footer-nav a:hover { color: var(--cyan); }

/* Inner pages */
.page { padding: 48px 0 88px; }
.prose { max-width: 44rem; }
.prose h1 {
  font-size: clamp(1.7rem, 4.2vw, 2.45rem);
  margin: 10px 0 18px;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #d8d6f8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.prose h2 {
  font-family: var(--sans);
  font-size: 1.15rem;
  margin: 36px 0 10px;
  letter-spacing: 0.04em;
}
.prose p, .prose li { color: var(--muted); }
.prose p { margin: 0 0 1em; }
.prose ul { padding-left: 1.2rem; }
.crumb {
  font-size: 0.82rem;
  font-family: var(--display);
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 22px;
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--cyan); }
.detail-meta { margin-bottom: 8px; }
.detail-meta time { color: var(--cyan); }

.detail-result {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 28px 0;
  box-shadow: var(--shadow);
}
.detail-result h2 { margin-top: 0; color: var(--ink); }
.detail-result p { color: var(--ink); }
.detail-result .hero-note { margin: 10px 0 0; }
.source-box {
  margin: 28px 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(139, 124, 255, 0.22);
}
.source-box p { margin: 0 0 8px; }
.source-box p:last-child { margin: 0; }
.source-box a { font-weight: 700; color: var(--accent-hover); }


.related-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: grid;
  gap: 8px;
}
.related-list a {
  display: block;
  text-decoration: none;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.related-list a:hover {
  border-color: rgba(139, 124, 255, 0.45);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

@media (max-width: 720px) {
  .wrap { width: min(var(--max), calc(100% - 28px)); }
  .panels, .footer-inner { grid-template-columns: 1fr; }
  .footer-inner { gap: 24px; }
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0 12px;
  }
  .hero { padding: 48px 0 16px; }
  .hero h1 { font-size: clamp(1.7rem, 8vw, 2.15rem); letter-spacing: 0.01em; white-space: nowrap; }
  .grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; gap: 4px; }
  .nav { width: 100%; }
  .page { padding: 32px 0 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
  .card:hover, .btn:hover { transform: none; }
}
