:root {
  --bg: #f4f1ec;
  --bg-2: #ebe6de;
  --ink: #1f1c19;
  --ink-2: #5d5750;
  --ink-3: #8b847b;
  --line: #d8d1c6;
  --accent: #a3264a;
  --accent-ink: #fff;
  --chat-bg: #fbfaf8;
  --chat-sub: #77706a;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  --serif: var(--sans);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161514;
    --bg-2: #1e1c1b;
    --ink: #ece7df;
    --ink-2: #b3aca2;
    --ink-3: #807970;
    --line: #34312d;
    --accent: #e46b8b;
    --accent-ink: #1a0b10;
    --chat-bg: #1b1a19;
    --chat-sub: #948d84;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
code, kbd { font-family: var(--mono); font-size: .9em; }
p code, li code, td code { background: var(--bg-2); padding: .1em .35em; border-radius: 3px; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 20px; text-decoration: none; letter-spacing: .04em; }
.site-nav { display: flex; gap: 20px; margin-left: auto; font-size: 14px; }
.site-nav a { text-decoration: none; color: var(--ink-2); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom: 1px solid var(--ink); }
.site-nav a:hover { color: var(--accent); }

.btn {
  display: inline-block; padding: 9px 18px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  font-weight: 700; font-size: 14px; border: 1px solid var(--accent); cursor: pointer;
  font-family: inherit;
}
.btn:hover { color: var(--accent-ink); filter: brightness(1.08); }
.btn-plain { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-plain:hover { color: var(--ink); border-color: var(--ink-3); filter: none; }
.site-head .btn { padding: 6px 14px; font-size: 13px; }

@media (max-width: 720px) {
  .site-head .wrap { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 10px; gap: 6px 16px; }
  .site-nav { order: 3; width: 100%; margin-left: 0; gap: 16px; overflow-x: auto; }
  .site-head .btn { margin-left: auto; }
}

/* page content */
main.wrap { padding-top: 48px; padding-bottom: 72px; }
h1, h2, h3 { line-height: 1.4; font-weight: 700; }
h1 { font-family: var(--serif); font-size: 32px; margin: 0 0 12px; letter-spacing: .02em; }
h2 { font-family: var(--serif); font-size: 22px; margin: 56px 0 16px; }
h3 { font-size: 16px; margin: 28px 0 6px; }
.lead { color: var(--ink-2); margin: 0 0 8px; max-width: 40em; }
.muted { color: var(--ink-3); font-size: 13px; }

/* top hero */
.hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
.hero h1 { font-size: 44px; margin-bottom: 4px; }
.hero .kicker { color: var(--ink-3); font-size: 13px; margin: 0 0 20px; }
.hero .lead { font-size: 16px; margin-bottom: 24px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.stat-line { font-size: 13px; color: var(--ink-3); margin: 0; }
.stat-line b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 36px; }
}

/* feature list */
.feature-list { margin: 0; padding: 0; border-top: 1px solid var(--line); }
.feature-list > div { display: grid; grid-template-columns: 12em 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.feature-list dt { font-weight: 700; }
.feature-list dd { margin: 0; color: var(--ink-2); }
@media (max-width: 600px) {
  .feature-list > div { grid-template-columns: 1fr; gap: 2px; }
}

/* tables */
.table-scroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-weight: 700; border-bottom: 2px solid var(--ink); white-space: nowrap; }
tbody th { font-weight: 400; color: var(--ink-2); white-space: nowrap; }
td.no { color: var(--ink-3); }
.price { font-size: 13px; font-weight: 400; color: var(--ink-2); display: block; }

/* commands */
.cmd-index { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; margin: 20px 0 0; padding: 0; list-style: none; }
.cmd-list { margin: 0; border-top: 1px solid var(--line); }
.cmd-list > div { display: grid; grid-template-columns: 17em 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cmd-list dt { font-family: var(--mono); font-size: 14px; }
.cmd-list dd { margin: 0; color: var(--ink-2); }
.tag { font-family: var(--sans); font-size: 11px; border: 1px solid currentColor; color: var(--accent); padding: 0 5px; border-radius: 3px; margin-left: 6px; white-space: nowrap; vertical-align: 1px; }
.words { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.words li { border: 1px solid var(--line); padding: 2px 10px; border-radius: 3px; font-size: 14px; }
@media (max-width: 600px) {
  .cmd-list > div { grid-template-columns: 1fr; gap: 2px; }
}

/* prose (legal etc) */
.prose { max-width: 42em; }
.prose p, .prose li { color: var(--ink-2); }
.prose ol, .prose ul { padding-left: 1.4em; }
.kv { margin: 0; border-top: 1px solid var(--line); max-width: 42em; }
.kv > div { display: grid; grid-template-columns: 10em 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt { font-weight: 700; }
.kv dd { margin: 0; color: var(--ink-2); }
@media (max-width: 600px) { .kv > div { grid-template-columns: 1fr; gap: 0; } }

details { border-bottom: 1px solid var(--line); padding: 12px 0; max-width: 42em; }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 700; }
details p { color: var(--ink-2); margin: 8px 0 0; }

/* footer */
.site-foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13px; color: var(--ink-3); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }

/* trial chat (Discord風) */
.chat { border: 1px solid var(--line); border-radius: 12px; background: var(--chat-bg); overflow: hidden; display: flex; flex-direction: column; }
.chat-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.chat-bar .ch { color: var(--ink); font-weight: 700; }
.chat-bar label { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.chat-bar input { width: 7.5em; font: inherit; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 1px 2px; }
.chat-bar input:focus { outline: none; border-color: var(--accent); }
.chat-bar button { font: inherit; font-size: 12px; color: var(--ink-3); background: none; border: 0; cursor: pointer; padding: 2px 4px; text-decoration: underline; text-underline-offset: 3px; }
.chat-bar button:hover { color: var(--accent); }
.chat-full { font-size: 12px; color: var(--accent); text-underline-offset: 3px; }

.chat-log { height: 380px; overflow-y: auto; padding: 12px 14px 6px; font-size: 14px; line-height: 1.65; }
.msg { display: grid; grid-template-columns: 36px 1fr; gap: 10px; margin-bottom: 14px; }
.msg .av { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-2); object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--ink-2); }
.msg .who { font-weight: 700; font-size: 14px; }
.msg .who .bot { font-size: 10px; font-weight: 700; background: #5865f2; color: #fff; padding: 0 4px; border-radius: 3px; margin-left: 5px; vertical-align: 1px; }
.msg .body { overflow-wrap: anywhere; }
.msg .body p { margin: 0; }
.msg .sub { font-size: 12px; color: var(--chat-sub); }
.msg .quote { border-left: 3px solid var(--line); padding-left: 10px; }
.msg.pending .body { color: var(--ink-3); font-size: 13px; }

.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; font: inherit; font-size: 14px; color: var(--ink); background: var(--bg-2); border: 1px solid transparent; border-radius: 4px; padding: 8px 10px; }
.chat-form input:focus { outline: none; border-color: var(--accent); }
.chat-form .btn { padding: 7px 14px; }
.chat-form .btn:disabled { opacity: .5; cursor: default; }
.chat-hint { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 12px 10px; font-size: 12px; color: var(--ink-3); }
.chat-hint button { font: inherit; color: var(--ink-2); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.chat-hint button:hover { color: var(--accent); }

/* iOS は 16px 未満の入力欄にフォーカスすると勝手にズームするので */
@media (max-width: 720px) {
  .chat-form input, .chat-bar input { font-size: 16px; }
}
