:root {
  --bg: #0d1017;
  --bg-2: #121722;
  --panel: #171d2b;
  --panel-2: #1f2739;
  --line: #2a3450;
  --text: #eaeef8;
  --muted: #98a3bf;
  --accent: #2f5fe0;
  --accent-hi: #4a78f2;
  --accent-soft: #8fb0ff;
  --ok: #3fd29a;
  --warn: #ffb454;
  --radius: 14px;
  --max: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 17px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 1.2em; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; }
p + p { margin-top: 1em; }
.box { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 40; background: rgba(13,16,23,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .box { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.logo-img { width: 32px; height: 32px; object-fit: contain; display: block; border-radius: 6px; }
.menu { display: flex; gap: 6px; }
.menu a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-size: 15px; font-weight: 500; transition: background .15s, color .15s; }
.menu a:hover { background: var(--panel); color: var(--text); }
.menu a.here { background: var(--accent); color: #fff; }
.toggle { display: none; background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 9px 16px; border-radius: 10px; font-size: 15px; cursor: pointer; font-family: inherit; }

/* buttons */
.pill { display: inline-flex; align-items: center; padding: 12px 22px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 600; font-size: 16px; cursor: pointer; font-family: inherit; transition: border-color .15s, background .15s; }
.pill:hover { border-color: var(--accent-hi); }
.pill.hot { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.hot:hover { background: var(--accent-hi); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* page frame: sidebar + article */
.frame { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; padding-top: 44px; padding-bottom: 40px; align-items: start; }
.toc { position: sticky; top: 90px; font-size: 15px; }
.toc small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc ol { list-style: none; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s; }
.toc li a:hover { color: var(--text); }
.toc li a.on { color: var(--text); border-left-color: var(--accent-hi); }

/* title block */
.title { padding-bottom: 36px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-soft); background: rgba(47,95,224,.15); border: 1px solid rgba(74,120,242,.4); padding: 3px 14px; border-radius: 99px; margin-bottom: 18px; }
.title h1 { font-size: clamp(32px, 4.6vw, 52px); letter-spacing: -.025em; }
.title h1 mark { background: none; color: var(--accent-soft); }
.quick { margin-top: 26px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent-hi); border-radius: 0 var(--radius) var(--radius) 0; padding: 22px 26px; }
.quick b { display: block; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-soft); margin-bottom: 8px; }
.quick p { color: #d3daec; font-size: 18px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.facts div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--bg-2); }
.facts dt { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.facts dd { font-weight: 600; }

/* article blocks */
.blk { padding: 44px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 84px; }
.blk:last-of-type { border-bottom: 0; }
.blk > .num { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--accent-soft); margin-bottom: 8px; }
.blk h2 { font-size: clamp(26px, 3.2vw, 34px); margin-bottom: 12px; }
.sub { color: var(--muted); max-width: 640px; margin-bottom: 26px; }
.copy p { color: #cbd3e6; max-width: 680px; }
.copy h3 { font-size: 20px; margin: 22px 0 6px; }

/* cards */
.sheets { display: grid; gap: 16px; }
.s2 { grid-template-columns: repeat(2, 1fr); }
.s3 { grid-template-columns: repeat(3, 1fr); }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: border-color .2s; }
.sheet:hover { border-color: var(--accent-hi); }
.sheet h3 { font-size: 19px; margin-bottom: 6px; }
.sheet p { color: var(--muted); font-size: 16px; }
.sheet .big { display: block; font-size: 30px; font-weight: 800; color: var(--accent-soft); letter-spacing: -.02em; margin-bottom: 6px; line-height: 1.1; }

/* vertical stepper */
.flow { list-style: none; padding: 0; position: relative; display: grid; gap: 0; }
.flow li { position: relative; padding: 0 0 26px 58px; }
.flow li::before { content: attr(data-n); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.flow li::after { content: ""; position: absolute; left: 18px; top: 42px; bottom: 4px; width: 2px; background: var(--line); }
.flow li:last-child::after { display: none; }
.flow li strong { display: block; font-size: 18px; margin-bottom: 2px; }
.flow li span { color: var(--muted); font-size: 16px; }

/* rows */
.rows { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.row { display: grid; grid-template-columns: 52px 1fr 1.5fr; gap: 18px; padding: 16px 20px; border-bottom: 1px solid var(--line); align-items: center; }
.row:last-child { border-bottom: 0; }
.row b { width: 36px; height: 36px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); color: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.row h3 { font-size: 18px; }
.row p { color: var(--muted); font-size: 16px; }

/* segmented tabs (use cases) */
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.seg button { background: var(--panel); border: 1px solid var(--line); color: var(--muted); padding: 9px 18px; border-radius: 99px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.case { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.case.on { display: block; }
.case h3 { font-size: 21px; margin-bottom: 6px; }
.case p { color: #cbd3e6; }

/* chooser */
.choose { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; cursor: pointer; font-family: inherit; color: inherit; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--accent-hi); }
.choice.on { background: var(--accent); border-color: var(--accent); }
.choice strong { display: block; font-size: 20px; }
.choice span { font-size: 14px; color: var(--muted); }
.choice.on span { color: #dbe5ff; }
.detail { display: none; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 24px; }
.detail.on { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; }
.detail h3 { font-size: 22px; margin-bottom: 8px; }
.detail p { color: #cbd3e6; }
.detail ul { color: var(--muted); font-size: 16px; }
.detail li { margin-bottom: 5px; }

/* checklist */
.checks { list-style: none; padding: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s; }
.checks li:hover { border-color: var(--accent-hi); }
.checks li::before { content: ""; flex: 0 0 22px; height: 22px; border: 2px solid var(--line); border-radius: 7px; margin-top: 3px; }
.checks li.done { background: rgba(63,210,154,.08); border-color: rgba(63,210,154,.4); }
.checks li.done::before { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 4px var(--panel); }
.checks li strong { display: block; }
.checks li span { color: var(--muted); font-size: 16px; }

/* table */
.scroll-x { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.scroll-x table { min-width: 520px; }
.grid-t { width: 100%; border-collapse: collapse; }
.grid-t th, .grid-t td { padding: 13px 18px; text-align: left; font-size: 16px; border-bottom: 1px solid var(--line); }
.grid-t th { background: var(--panel-2); color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.grid-t td { background: var(--panel); color: #cbd3e6; }
.grid-t td:first-child { color: var(--text); font-weight: 600; }
.grid-t tr:last-child td { border-bottom: 0; }

/* myth / fact */
.duel { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; background: var(--panel); }
.duel div { padding: 16px 22px; }
.duel div:first-child { background: rgba(255,180,84,.07); border-right: 1px solid var(--line); }
.duel small { display: block; font-weight: 800; letter-spacing: .12em; font-size: 12px; margin-bottom: 4px; color: var(--warn); }
.duel div:last-child small { color: var(--ok); }
.duel p { font-size: 16px; color: #cbd3e6; }

/* A–Z */
.az { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.az div { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px 18px; }
.az b { display: block; color: var(--accent-soft); font-size: 16px; margin-bottom: 2px; }
.az span { display: block; font-size: 15px; color: var(--muted); line-height: 1.5; }
kbd { font-family: ui-monospace, Menlo, monospace; background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 8px; font-size: 14px; }

/* Q&A */
.qa { display: grid; gap: 10px; }
.qa details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; }
.qa summary { list-style: none; cursor: pointer; padding: 16px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--accent-soft); font-size: 22px; line-height: 1; }
.qa details[open] summary::after { content: "–"; }
.qa p { padding-bottom: 16px; color: var(--muted); }

/* next cards */
.next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 12px 0 56px; }
.next a { display: block; background: linear-gradient(135deg, #1a2d6b, #131a2e); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; transition: border-color .2s; }
.next a:hover { border-color: var(--accent-hi); }
.next small { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-soft); margin-bottom: 6px; }
.next strong { font-size: 21px; display: block; }
.next span { color: #b9c6ea; font-size: 15px; }

/* footer */
.foot { padding: 40px 0 26px; background: var(--bg-2); border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.foot-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 30px; }
.foot h4 { color: var(--text); font-size: 15px; margin-bottom: 12px; }
.foot ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.foot a:hover { color: var(--text); }
.fine { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }
.mt { margin-top: 24px; }

.js .fade { opacity: 0; transform: translateY(12px); transition: opacity .5s, transform .5s; }
.js .fade.show { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .frame { grid-template-columns: 1fr; gap: 8px; padding-top: 24px; }
  .toc { position: static; }
  .toc ol { display: flex; gap: 8px; overflow-x: auto; border: 0; padding-bottom: 8px; }
  .toc li a { border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; margin: 0; white-space: nowrap; }
  .toc li a.on { background: var(--accent); border-color: var(--accent); }
  .detail.on, .foot-top { grid-template-columns: 1fr; }
  .s3, .choose { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 44px 1fr; }
  .row p { grid-column: 2; }
}
@media (max-width: 660px) {
  body { font-size: 16px; }
  .toggle { display: block; }
  .menu { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--bg); padding: 12px 20px 18px; border-bottom: 1px solid var(--line); }
  .menu.open { display: flex; }
  .s2, .s3, .choose, .duel, .facts, .next { grid-template-columns: 1fr; }
  .duel div:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .blk { padding: 34px 0; }
}
