/* RustateWebRuntime 紹介サイト。外部の読み込み・インラインのスタイルは使わない（CSP default-src 'self' で動く） */
:root {
  color-scheme: light dark;
  --bg: #fbfaf8;
  --bg-soft: #f3f0eb;
  --panel: #ffffff;
  --ink: #1d2433;
  --muted: #5a6475;
  --line: #e2ddd5;
  --accent: #b7410e;
  --accent-ink: #ffffff;
  --accent-soft: #fbe9df;
  --blue: #0b5cad;
  --blue-soft: #e6f0fb;
  --code-bg: #1b2230;
  --code-ink: #e6edf3;
  --shadow: 0 1px 2px rgba(20, 24, 36, .06), 0 8px 24px rgba(20, 24, 36, .06);
  --radius: 14px;
  --maxw: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151c;
    --bg-soft: #181c25;
    --panel: #1b202b;
    --ink: #e8ebf2;
    --muted: #a3acbd;
    --line: #2b3242;
    --accent: #f08a4b;
    --accent-ink: #1a1208;
    --accent-soft: #35231a;
    --blue: #7db6f5;
    --blue-soft: #1a2638;
    --code-bg: #0d1017;
    --code-ink: #dfe6f1;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Yu Gothic UI", "Yu Gothic", "Hiragino Sans", "Noto Sans JP", Meiryo, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .01em;
}
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
code, pre { font-family: "Cascadia Mono", Consolas, "MS Gothic", monospace; }
code { font-size: .88em; background: var(--bg-soft); border: 1px solid var(--line); padding: .05em .4em; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ヘッダ */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-weight: 500; font-size: .66rem; color: var(--muted); letter-spacing: .08em; line-height: 1.2; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: .92rem; font-weight: 600; }
.nav a:hover { background: var(--bg-soft); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .soon::after { content: "準備中"; margin-left: 6px; font-size: .62rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); vertical-align: 2px; }

/* ヒーロー・見出し */
.hero { padding: 72px 0 56px; background:
  radial-gradient(900px 380px at 85% -10%, var(--accent-soft), transparent 70%),
  radial-gradient(700px 320px at 0% 0%, var(--blue-soft), transparent 70%); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.kicker { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; margin: 0 0 18px; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.3; margin: 0 0 18px; letter-spacing: .02em; }
h1 .em { color: var(--accent); }
.lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 28px; max-width: 38em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.page-head { padding: 54px 0 34px; background: linear-gradient(180deg, var(--accent-soft), transparent); border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: 10px; }
.page-head .lead { margin: 0; }
section { padding: 52px 0; }
section.alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); line-height: 1.4; margin: 0 0 8px; padding-left: 14px; border-left: 5px solid var(--accent); }
h2 + .sub { color: var(--muted); margin: 0 0 28px 19px; }
h3 { font-size: 1.15rem; margin: 30px 0 8px; color: var(--blue); }
p { margin: 0 0 14px; }
ul, ol { padding-left: 1.3em; margin: 0 0 16px; }
li { margin: 4px 0; }

/* カード・グリッド */
.grid { display: grid; gap: 18px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; color: var(--ink); }
.card p:last-child { margin-bottom: 0; }
.card .icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 12px; }
.card .icon svg { width: 22px; height: 22px; }
a.card { text-decoration: none; color: inherit; display: block; transition: transform .15s ease, border-color .15s ease; }
a.card:hover { transform: translateY(-2px); border-color: var(--accent); }
a.card .go { color: var(--accent); font-weight: 700; font-size: .9rem; }
.card.dim { opacity: .8; border-style: dashed; }
.card.plain { border-top: 4px solid var(--line); }
.card.good { border-top: 4px solid var(--accent); }
.card.warn { border-top: 4px solid #b3261e; }
.flow { display: grid; gap: 6px; }
.flow .n { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: .9rem; line-height: 1.6; color: var(--muted); }
.flow .n b { display: block; color: var(--ink); }
.flow .dn { text-align: center; color: var(--accent); font-size: .85rem; font-weight: 700; line-height: 1.3; }
.chips { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { margin: 0; padding: 5px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: .9rem; font-weight: 600; }
.card .eg { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--bg-soft); font-size: .9rem; color: var(--muted); line-height: 1.7; }
.card .eg b { color: var(--ink); }
.card.big h3 { font-size: 1.2rem; }
.card ul { margin-bottom: 0; }
.rules { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; counter-reset: r; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 0; }
.rules li::before { content: counter(r); width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; }
.rules b { display: block; }
.rules span { color: var(--muted); font-size: .92rem; }
.cmp th:first-child, .cmp td:first-child { width: 50%; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: -28px; position: relative; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.9rem; line-height: 1.2; color: var(--accent); }
.stat span { font-size: .85rem; color: var(--muted); line-height: 1.5; display: block; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; position: relative; }
.steps li::before { content: counter(s); position: absolute; top: -14px; left: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; }
.steps b { display: block; margin-bottom: 4px; }

/* 表 */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin: 0 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--bg-soft); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }
td code { white-space: nowrap; }

/* コード */
pre { background: var(--code-bg); color: var(--code-ink); padding: 18px 20px; border-radius: var(--radius); overflow-x: auto; font-size: .86rem; line-height: 1.65; margin: 0 0 20px; }
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.code-cap { font-size: .8rem; color: var(--muted); margin: -8px 0 18px; }
.note { border-left: 4px solid var(--blue); background: var(--blue-soft); padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 0 0 20px; }
.note.warn { border-left-color: var(--accent); background: var(--accent-soft); }
.note p:last-child { margin-bottom: 0; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: 2px; }

/* 仕組みの図 */
.arch { display: grid; grid-template-columns: 1fr 190px 1.15fr; gap: 14px; align-items: stretch; margin: 8px 0 24px; }
.arch .side { border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; border: 1.5px solid var(--line); }
.arch .browser { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); }
.arch .server { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.arch .t { font-weight: 800; font-size: .95rem; }
.arch .b { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: .9rem; }
.arch .b span { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); line-height: 1.5; }
.arch .mid { display: flex; flex-direction: column; justify-content: center; gap: 14px; text-align: center; font-size: .8rem; line-height: 1.5; }
.arch .arrow { border-radius: 12px; padding: 10px 8px; border: 1px solid var(--line); background: var(--panel); }
.arch .arrow b { display: block; font-size: .88rem; }
.arch .arrow .ar { display: block; font-size: 1.4rem; line-height: 1.1; color: var(--accent); }
.arch .arrow.up .ar { color: var(--blue); }

/* ヒーローの小さな図 */
.mini { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 22px; display: grid; gap: 12px; }
.mini .row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.mini .box { border-radius: 12px; padding: 12px; font-size: .84rem; line-height: 1.5; border: 1px solid var(--line); }
.mini .box b { display: block; font-size: .92rem; }
.mini .srv { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.mini .brw { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); }
.mini .ar { color: var(--accent); font-size: 1.3rem; text-align: center; line-height: 1.1; }
.mini .ar small { display: block; font-size: .64rem; color: var(--muted); }
.mini .cap { font-size: .8rem; color: var(--muted); text-align: center; margin: 0; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); margin: 2px 4px 2px 0; }

/* 詳細ページの目次 */
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; font-size: .88rem; font-weight: 600; }
.toc a:hover { border-color: var(--accent); color: var(--accent); }
.defs { display: grid; grid-template-columns: 11em 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); margin: 0 0 20px; }
.defs dt, .defs dd { margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.defs dt { font-weight: 700; background: var(--bg-soft); }
.defs dt:last-of-type, .defs dd:last-of-type { border-bottom: 0; }

/* デモ（準備中） */
.placeholder { border: 2px dashed var(--line); border-radius: 22px; padding: 56px 24px; text-align: center; background: var(--panel); }
.placeholder .big { font-size: 3rem; line-height: 1; color: var(--accent); margin-bottom: 10px; }
.placeholder h2 { border: 0; padding: 0; }

footer { border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--muted); font-size: .88rem; background: var(--bg-soft); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; }
footer a { color: var(--muted); }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .grid.c3, .grid.c4, .steps { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .arch { grid-template-columns: 1fr; }
  .arch .mid { flex-direction: row; }
  .arch .mid .arrow { flex: 1; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .grid.c2, .grid.c3, .grid.c4, .steps { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 40px; }
  section { padding: 38px 0; }
  .defs { grid-template-columns: 1fr; }
  .defs dt { border-bottom: 0; padding-bottom: 0; }
  .mini .row { grid-template-columns: 1fr; }
  .mini .ar small { display: inline; margin-left: 8px; font-size: .75rem; }
  .nav a { padding: 6px 10px; font-size: .86rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } a.card { transition: none; } }
