:root {
  --paper: #f5f3ee;
  --card: #ffffff;
  --ink: #18181b;
  --ink2: #3f3f46;
  --mute: #71717a;
  --line: #e4e2dc;
  --soft: #faf9f6;
  --hl: #ffe066;
  --hl2: #fff3b8;
  --accent: #111111;
  --yellow: #ffd23f;
  --f-hook: #f2c230; --f-pain: #f08c4a; --f-blame: #ee8fab; --f-cause: #d6334f; --f-fixes: #8b5cf6;
  --f-mech: #3b82f6; --f-product: #16a34a; --f-proof: #14b8a6; --f-close: #52607a;
  --sans: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  --serif: "IBM Plex Serif", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
#app { display: grid; grid-template-columns: 300px 1fr; height: 100vh; }

/* ---------- sidebar */
#side { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 20px 16px; text-decoration: none; border-bottom: 1px solid var(--line); }
.brand b { display: block; font-size: 18px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--mute); font-size: 12.5px; }
#outline { flex: 1; overflow-y: auto; padding: 8px 10px 20px; }
.part { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); padding: 16px 10px 6px; }
.les { display: grid; grid-template-columns: 26px 1fr 16px; gap: 6px; align-items: start; padding: 7px 10px; border-radius: 8px; text-decoration: none; font-size: 14px; color: var(--ink2); line-height: 1.35; }
.les:hover { background: var(--soft); }
.les .num { color: var(--mute); font-variant-numeric: tabular-nums; font-size: 12.5px; padding-top: 1px; }
.les .tick { color: #16a34a; font-size: 13px; opacity: 0; }
.les.done .tick { opacity: 1; }
.les.on { background: #111; color: #fff; }
.les.on .num { color: #bbb; }
.libLink { display: block; margin: 0 14px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 14px; background: var(--soft); }
.libLink span { display: block; font-weight: 400; color: var(--mute); font-size: 12.5px; }
.libLink.on { background: #111; color: #fff; border-color: #111; }

/* ---------- main frame */
#main { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; min-width: 0; }
#top { display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center; padding: 16px 40px; border-bottom: 1px solid var(--line); background: var(--paper); }
#crumb { font-size: 13.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#crumb b { color: var(--ink); font-weight: 600; }
#dots { display: flex; gap: 6px; }
#dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: #d4d2cb; }
#dots button.on { background: #111; transform: scale(1.25); }
#count { font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }
#stage { overflow-y: auto; padding: 36px 40px 40px; min-height: 0; }
#nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 40px; border-top: 1px solid var(--line); background: var(--paper); }
#nav button { border: 1px solid var(--line); background: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 500; white-space: nowrap; max-width: 440px; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
#nav button.primary { background: #111; color: #fff; border-color: #111; }
#nav button:disabled { opacity: .35; cursor: default; }
#hint { color: var(--mute); font-size: 13px; text-align: center; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.loading { color: var(--mute); padding: 40px; }

/* ---------- slide */
.slide { max-width: 1040px; margin: 0 auto; animation: in .25s ease; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.kicker { font-size: 12.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--mute); margin-bottom: 10px; }
.slide h1 { font-size: 40px; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 18px; }
.slide h2 { font-size: 28px; line-height: 1.2; letter-spacing: -.015em; margin: 0 0 18px; }
.slide h3 { font-size: 15px; margin: 0 0 6px; }
.rule { font-family: var(--serif); font-size: 24px; line-height: 1.45; color: var(--ink2); margin: 0 0 28px; max-width: 900px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px; }
.prose p { font-size: 17.5px; line-height: 1.65; margin: 0 0 16px; max-width: 820px; color: var(--ink2); }
.prose p b { color: var(--ink); }
.q { font-family: var(--serif); background: var(--hl2); border-bottom: 2px solid var(--hl); padding: 1px 3px; border-radius: 3px; cursor: pointer; color: var(--ink); text-decoration: none; }
.q:hover { background: var(--hl); }
.q::before { content: "“"; } .q::after { content: "”"; }
.q sup { font-family: var(--sans); font-size: 10.5px; color: var(--mute); margin-left: 3px; }

/* cover */
.cover { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: start; }
.lnum { display: inline-block; background: var(--yellow); font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: 13px; margin-bottom: 16px; }
.stat { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.stat b { font-size: 54px; letter-spacing: -.03em; line-height: 1; }
.stat span { color: var(--mute); font-size: 15px; }
.statSub { color: var(--mute); font-size: 14px; margin-bottom: 18px; }
.grid92 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; max-width: 360px; }
.grid92 i { aspect-ratio: 1; border-radius: 4px; background: #e8e6df; display: block; }
.grid92 i.y { background: #111; cursor: pointer; }
.grid92 i.y:hover { background: var(--yellow); outline: 2px solid #111; }
.gridCap { font-size: 12.5px; color: var(--mute); margin-top: 10px; }

/* why */
.whyList { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.whyList .card { padding: 22px 24px; }
.whyList h3 { font-size: 17px; margin-bottom: 6px; }
.whyList p { margin: 0; color: var(--ink2); font-size: 15.5px; }
.listen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; align-items: center; }
.listen b { font-size: 13px; color: var(--mute); font-weight: 600; margin-right: 4px; text-transform: uppercase; letter-spacing: .05em; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 14px; }

/* proof slide */
.exhibit { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.exTag { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.exTag .ex { background: #111; color: #fff; font-weight: 600; font-size: 12.5px; padding: 4px 10px; border-radius: 6px; letter-spacing: .03em; }
.exTag .who { font-weight: 600; font-size: 17px; }
.exTag .what { color: var(--mute); font-size: 14px; }
.ctx { font-family: var(--serif); font-size: 18.5px; line-height: 1.75; color: #8a8a90; }
.ctx mark { background: var(--hl); color: var(--ink); padding: 2px 3px; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.ctx .gap { color: #c0beb6; }
.map { margin: 4px 0 22px; }
.map .bar { position: relative; height: 14px; border-radius: 7px; overflow: hidden; display: flex; background: #eee; }
.map .bar span { height: 100%; }
.map .pin { position: relative; height: 0; }
.map .pin i { position: absolute; top: -20px; width: 3px; height: 26px; background: #111; border-radius: 2px; transform: translateX(-1px); }
.map .pinCap { font-size: 13px; color: var(--ink2); margin-top: 12px; }
.map .pinCap b { font-weight: 600; }
.notes .card { padding: 20px 22px; margin-bottom: 14px; }
.notes h3 { font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--mute); margin-bottom: 6px; }
.notes p { margin: 0; font-size: 16px; line-height: 1.6; }
.notes .why p { font-size: 17px; color: var(--ink); }
.notes .notice { background: #fffbe8; border-color: #f3e3a0; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 16px; font-weight: 500; font-size: 14.5px; }
.btn.dark { background: #111; color: #fff; border-color: #111; }
.weakTag { background: #fee2e2 !important; color: #991b1b !important; }

/* all proof */
.allHead { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 16px; }
.search { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font: inherit; width: 300px; background: #fff; }
.allList { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 210px 1fr; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; cursor: pointer; }
.row:hover { border-color: #111; }
.row .src b { display: block; font-size: 14.5px; }
.row .src span { color: var(--mute); font-size: 12.5px; display: block; line-height: 1.35; margin-top: 2px; }
.row .qq { font-family: var(--serif); font-size: 16px; line-height: 1.55; }
.row .qq div + div { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.row .note { font-family: var(--sans); color: var(--mute); font-size: 12.5px; display: block; margin-top: 2px; }
.more { text-align: center; margin: 14px 0; }

/* your turn */
.formula { font-family: var(--serif); font-size: 21px; line-height: 1.6; background: #111; color: #fff; border-radius: 16px; padding: 24px 28px; margin-bottom: 20px; }
.formula b { color: var(--yellow); font-weight: 500; }
.task { font-size: 18px; margin: 0 0 12px; }
textarea.ans { width: 100%; min-height: 220px; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; font: 17px/1.6 var(--serif); background: #fff; resize: vertical; }
textarea.ans:focus { outline: 2px solid #111; outline-offset: 1px; }
.saved { color: var(--mute); font-size: 13px; margin-top: 8px; min-height: 20px; }

/* charts */
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink2); margin-bottom: 16px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.gantt { display: grid; grid-template-columns: 200px 1fr 56px; gap: 6px 14px; align-items: center; font-size: 14px; }
.gantt .lab { text-align: right; color: var(--ink2); }
.gantt .lab small { color: var(--mute); }
.gantt .track { position: relative; height: 22px; background: repeating-linear-gradient(90deg, #f1efe9 0 1px, transparent 1px 10%); border-radius: 4px; }
.gantt .iqr { position: absolute; top: 5px; height: 12px; border-radius: 6px; opacity: .35; }
.gantt .med { position: absolute; top: 2px; width: 18px; height: 18px; border-radius: 50%; transform: translateX(-9px); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.gantt .n { color: var(--mute); font-size: 12.5px; }
.axis { display: grid; grid-template-columns: 200px 1fr 56px; gap: 14px; font-size: 12px; color: var(--mute); margin-top: 6px; }
.axis div:nth-child(2) { display: flex; justify-content: space-between; }
.strips { display: grid; gap: 3px; }
.strip { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; cursor: pointer; }
.strip b { font-size: 11px; color: var(--mute); text-align: right; font-weight: 500; }
.strip .bar { display: flex; height: 9px; border-radius: 3px; overflow: hidden; background: #eee; }
.strip:hover .bar { outline: 2px solid #111; }
.hbar { display: grid; grid-template-columns: 240px 1fr 60px; gap: 12px; align-items: center; margin-bottom: 9px; font-size: 15px; }
.hbar .t { height: 22px; background: #eeece6; border-radius: 6px; overflow: hidden; }
.hbar .t i { display: block; height: 100%; background: #111; border-radius: 6px; }
.hbar .v { font-variant-numeric: tabular-nums; color: var(--ink2); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 6px 0 24px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.tile b { display: block; font-size: 34px; letter-spacing: -.02em; line-height: 1.1; }
.tile span { color: var(--mute); font-size: 13.5px; }
.tile.warn b { color: #b91c1c; }

/* tables */
table.t { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 14.5px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--soft); position: sticky; top: 0; }
table.t td { padding: 11px 14px; border-bottom: 1px solid #f0eee8; vertical-align: top; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #fffbe8; }
.num { font-variant-numeric: tabular-nums; }
.tableWrap { max-height: 62vh; overflow: auto; border-radius: 12px; }

/* clones */
.twin { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.twin .card { padding: 20px 22px; max-height: 60vh; overflow: auto; }
.twin .txt { font-family: var(--serif); font-size: 15px; line-height: 1.7; color: #8a8a90; }
.twin mark { background: var(--hl2); color: var(--ink); border-radius: 2px; }

/* together */
.steps { display: grid; gap: 10px; margin-bottom: 24px; }
.step { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.step .k { width: 28px; height: 28px; border-radius: 8px; background: var(--yellow); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.step p { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.55; }
.step p small { display: block; font-family: var(--sans); color: var(--mute); font-size: 12.5px; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.step a { font-size: 13px; color: var(--mute); white-space: nowrap; }

/* library */
.libGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.libCard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.libCard:hover { border-color: #111; }
.libCard b { font-size: 15px; }
.libCard .p { color: var(--ink2); font-size: 13.5px; margin: 2px 0 10px; line-height: 1.4; }
.libCard .s { color: var(--mute); font-size: 12px; margin-top: 8px; }
.libCard .bar { display: flex; height: 8px; border-radius: 3px; overflow: hidden; }

/* reader */
#reader[hidden] { display: none; }
#reader { position: fixed; inset: 0; z-index: 50; }
#reader .scrim { position: absolute; inset: 0; background: rgba(15, 15, 18, .45); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
#reader .panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(980px, 72vw); background: #fff; display: grid; grid-template-rows: auto auto auto 1fr; box-shadow: -20px 0 60px rgba(0,0,0,.18); animation: slide .25s ease; }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
.rhead { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 20px 28px 6px; }
.rtitle b { font-size: 22px; letter-spacing: -.01em; display: block; }
.rtitle span { color: var(--mute); font-size: 14.5px; }
.x { border: 0; background: #f1f0ec; width: 36px; height: 36px; border-radius: 10px; font-size: 22px; line-height: 1; }
.rmeta { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 28px 12px; }
.rmeta .chip { font-size: 12.5px; padding: 4px 10px; }
.rmeta a.chip { text-decoration: none; }
.rmeta button.chip { background: #111; color: #fff; border-color: #111; }
.rbar { padding: 0 28px 14px; border-bottom: 1px solid var(--line); }
.rbar .bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin-bottom: 10px; }
.rbar .legend { margin: 0; font-size: 12px; gap: 12px; }
.rbody { overflow-y: auto; padding: 22px 28px 60px; position: relative; }
.rvideo { width: 280px; }
.rbody.withVid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 26px; align-items: start; }
.rbody.withVid .rvideo { grid-column: 2; grid-row: 1; position: sticky; top: 0; }
.rbody.withVid .rtext { grid-column: 1; grid-row: 1; }
.rvideo video { width: 100%; border-radius: 12px; background: #000; max-height: 70vh; }
.rtext { font-family: var(--serif); font-size: 17px; line-height: 1.8; color: var(--ink); }
.seg { border-left: 4px solid #ddd; padding: 2px 0 2px 16px; margin: 0 0 12px; }
.seg .sl { display: block; font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; }
.rtext mark { background: var(--hl); padding: 2px 2px; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

@media (max-width: 1100px) {
  #app { grid-template-columns: 250px 1fr; }
  .cover, .exhibit { grid-template-columns: 1fr; }
  .cover > .card { max-width: 440px; }
  .whyList { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  #hint { display: none; }
}
