/* クラウド図鑑の共通スタイル（atlas.html / compare.html）。Cloudflare 図鑑の index.html を土台にしている */
:root {
  --bg: #ffffff; --surface: #fafaf8; --card: #ffffff; --ink: #1b1b1f; --muted: #6b6b76; --faint: #9a9aa4;
  --line: #e8e6e1; --accent: #5b4fe0; --accent-ink: #4338ca; --accent-soft: #efedff; --shadow: 0 1px 2px rgba(20,20,30,.05), 0 8px 24px rgba(20,20,30,.06);
  --c-compute: #f08c00; --c-container: #2f7de1; --c-serverless: #e8590c; --c-storage: #1f9e6e; --c-database: #3b5bdb;
  --c-analytics: #0f8ea8; --c-ai: #8a4fe0; --c-network: #6d6a2a; --c-security: #e0463a; --c-devops: #d6457a;
  --c-ops: #5b6475; --c-integration: #b07a12; --c-hybrid: #8a5a3c; --c-other: #2b8a3e;
  --p-aws: #ff9900; --p-azure: #0078d4; --p-gcp: #1e8e3e; --p-cloudflare: #f6821f;
  color-scheme: light dark;
}
:root[data-p="aws"]   { --accent: #ff9900; --accent-ink: #b35c00; --accent-soft: #fff4e0; }
:root[data-p="azure"] { --accent: #0078d4; --accent-ink: #005a9e; --accent-soft: #e8f2fc; }
:root[data-p="gcp"]   { --accent: #1e8e3e; --accent-ink: #137333; --accent-soft: #e6f4ea; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121214; --surface: #18181b; --card: #1d1d21; --ink: #ececf0; --muted: #a2a2ad; --faint: #75757f;
  --line: #2c2c32; --accent-ink: #a99fff; --accent-soft: #1f1b3a; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
}
:root[data-p="aws"]:not([data-theme="light"])   { --accent-ink: #ffb84d; --accent-soft: #2a1e0c; }
:root[data-p="azure"]:not([data-theme="light"]) { --accent-ink: #5cb0f2; --accent-soft: #0f1e2c; }
:root[data-p="gcp"]:not([data-theme="light"])   { --accent-ink: #5bc77a; --accent-soft: #10241a; }
}
:root[data-theme="dark"] {
  --bg: #121214; --surface: #18181b; --card: #1d1d21; --ink: #ececf0; --muted: #a2a2ad; --faint: #75757f;
  --line: #2c2c32; --accent-ink: #a99fff; --accent-soft: #1f1b3a; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
}
:root[data-p="aws"][data-theme="dark"]   { --accent-ink: #ffb84d; --accent-soft: #2a1e0c; }
:root[data-p="azure"][data-theme="dark"] { --accent-ink: #5cb0f2; --accent-soft: #0f1e2c; }
:root[data-p="gcp"][data-theme="dark"]   { --accent-ink: #5bc77a; --accent-soft: #10241a; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 132px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.7 "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* hero */
header.hero { padding-top: 56px; padding-bottom: 28px; position: relative; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; letter-spacing: .12em; color: var(--accent-ink); font-weight: 700; }
.eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--accent); }
h1 { font-size: clamp(26px, 7.2vw, 48px); line-height: 1.2; margin: 12px 0 10px; letter-spacing: -.01em; }
h1 em { font-style: normal; color: var(--accent); }
.lead { color: var(--muted); max-width: 680px; margin: 0; }
.stats { display: flex; gap: 28px; margin-top: 22px; flex-wrap: wrap; }
.stats b { display: block; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--muted); }
.crumb { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumb a { color: var(--ink); font-weight: 700; text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.theme { position: absolute; top: 18px; right: 24px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; width: 36px; height: 36px; cursor: pointer; }

/* 4 社の切り替え */
.pnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 22px; }
.pnav a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; }
.pnav a i { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); }
.pnav a:hover { border-color: var(--pc); }
.pnav a[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pnav a.cmp { border-style: dashed; }

/* toolbar */
.bar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.bar .wrap { padding-top: 12px; padding-bottom: 12px; display: grid; gap: 10px; }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; border: 0; background: none; outline: none; height: 44px; font: inherit; color: var(--ink); min-width: 0; }
.search kbd { font: 11px/1 ui-monospace, monospace; color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -24px; padding: 0 24px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.only[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
a.chip { color: var(--ink); text-decoration: none; }

/* sections */
main { padding: 12px 0 80px; }
section.cat { margin-top: 36px; }
.cat-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cat-head h2 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.cat-head h2::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.cat-head p { margin: 0; color: var(--muted); font-size: 13px; }
.cat-head .n { margin-left: auto; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card { position: relative; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 14px; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start; min-height: 104px; }
.card .txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card h3 { margin: 0; font-size: 15.5px; line-height: 1.35; }
.card.has-badge h3 { padding-right: 62px; }
.card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.badge { position: absolute; top: 13px; right: 12px; display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 9px; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; }

/* icon tile: main icon + optional sub icon badge (composite) */
.ico { position: relative; width: 48px; height: 48px; border-radius: 13px; background: color-mix(in srgb, var(--c) 13%, var(--card)); color: var(--c); display: grid; place-items: center; flex: none; }
.ico > svg { width: 26px; height: 26px; }
.ico .sub { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--card); border: 1.5px solid color-mix(in srgb, var(--c) 45%, var(--line)); color: var(--ink); display: grid; place-items: center; }
.ico .sub svg { width: 13px; height: 13px; stroke-width: 2.4; }
.ico.lg { width: 68px; height: 68px; border-radius: 18px; }
.ico.lg > svg { width: 36px; height: 36px; }
.ico.lg .sub { width: 32px; height: 32px; right: -8px; bottom: -8px; border-width: 2px; }
.ico.lg .sub svg { width: 17px; height: 17px; }

/* detail panel */
dialog { border: 0; padding: 0; margin: 0 0 0 auto; height: 100dvh; max-height: none; width: min(640px, 100vw); background: var(--bg); color: var(--ink); box-shadow: -20px 0 60px rgba(0,0,0,.18); }
dialog[open] { animation: slide .28s cubic-bezier(.2,.8,.2,1); }
dialog::backdrop { background: rgba(10,10,15,.35); backdrop-filter: blur(2px); animation: fade .2s; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.panel { height: 100%; overflow-y: auto; display: flex; flex-direction: column; }
.panel-top { position: sticky; top: 0; background: var(--bg); display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); z-index: 1; }
.panel-top .cat-tag { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.panel-top .cat-tag i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.close { border: 1px solid var(--line); background: var(--card); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 18px; line-height: 1; }
.panel-body { padding: 24px 24px 48px; }
.d-head { display: flex; align-items: center; gap: 20px; margin: 4px 0 12px; }
.panel h2 { font-size: 26px; line-height: 1.25; margin: 0; }
.panel .alias { font-size: 12.5px; color: var(--faint); margin: 0 0 10px; }
.panel .one { font-size: 17px; font-weight: 600; color: var(--accent-ink); margin: 0 0 20px; }
.block { margin: 0 0 20px; }
.block h4 { margin: 0 0 4px; font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.block p { margin: 0; }
.analogy { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.analogy h4::before { content: "💡 "; }
.uniq { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; }
.uniq h4 { color: var(--accent-ink); }
.rel { display: flex; flex-wrap: wrap; gap: 6px; }
.rel .chip { font-size: 12.5px; }
.peers { display: grid; gap: 10px; }
.peer { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--card); }
.peer > b { display: block; font-size: 13px; margin-bottom: 6px; }
.peer dl { margin: 0; display: grid; grid-template-columns: 112px 1fr; gap: 6px 10px; align-items: baseline; font-size: 13px; }
.peer dt { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.peer dt i { width: 8px; height: 8px; border-radius: 50%; background: var(--pc); flex: none; }
.peer dd { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.peer dd a { color: var(--ink); font-weight: 600; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.peer dd .none { color: var(--faint); }
.peer .note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.docs { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.docs:hover { text-decoration: underline; }

footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--muted); font-size: 12.5px; }
footer p { margin: 0 0 6px; }
footer a { color: inherit; }

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .chips { margin: 0 -16px; padding: 0 16px; }
  header.hero { padding-top: 64px; }
  .theme { right: 16px; }
  .search kbd { display: none; }
  .panel-body { padding: 20px 16px 40px; }
  .panel h2 { font-size: 22px; }
  .peer dl { grid-template-columns: 1fr; gap: 2px; }
  .peer dd { margin-bottom: 6px; }
  html { scroll-padding-top: 124px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
