/* Kriptografi di Dunia Nyata — slide styles.
   Every slide is a fixed 1600×900 canvas scaled to the window (see scaleCanvas in app.js),
   so sizes below are in canvas pixels and look identical on any screen or projector. */

:root {
  --paper: #f6f3ec;
  --paper-2: #ece7db;
  --card: #fffdf8;
  --rule: #ddd6c6;
  --ink: #141a23;
  --ink-2: #39424f;
  --muted: #6b7380;
  --night: #0d141e;
  --night-2: #152030;
  --accent: #0d7a6f;
  --accent-soft: #e0f1ed;
  --accent-bright: #2dd4bf;
  --amber: #c26a06;
  --amber-soft: #fdf0dc;
  --good: #15803d;
  --good-soft: #e7f6ec;
  --bad: #b91c1c;
  --code-bg: #0f1722;
  --code-fg: #e6edf3;
  --sans: "Inter", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", "Cascadia Code", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #05080d;
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }

/* ---------- viewport & canvas ---------- */

#viewport { position: fixed; inset: 0; overflow: hidden; }
#canvas {
  position: absolute;
  top: 50%; left: 50%;
  width: 1600px; height: 900px;
  transform-origin: center center;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

.slide {
  position: relative;
  width: 1600px; height: 900px;
  padding: 112px 104px 96px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  overflow: hidden;
}
#canvas .slide { animation: enter .38s cubic-bezier(.2, .8, .2, 1) both; }
#canvas .slide[data-dir="-1"] { animation-name: enter-back; }
@keyframes enter { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

.slide-top, .slide-foot {
  position: absolute;
  left: 104px; right: 104px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 17px;
  color: var(--muted);
  z-index: 2;
}
.slide-top { top: 42px; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.slide-top .chapter { max-width: 1000px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-top .chapter code { font-family: inherit; background: none; padding: 0; color: inherit; font-size: inherit; }
.slide-top .brand { color: var(--accent); }
.slide-foot { bottom: 34px; }
.slide-foot .num { font-family: var(--mono); font-size: 18px; color: var(--ink-2); }

/* ---------- titles & body ---------- */

.slide-title {
  margin: 0 0 38px;
  font-size: 60px;
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: -.022em;
  color: var(--ink);
  max-width: 1340px;
  text-wrap: balance;
}
.slide-title::before {
  content: "";
  display: block;
  width: 56px; height: 6px;
  border-radius: 3px;
  background: var(--accent);
  margin-bottom: 22px;
}
.slide-title code { font-size: .86em; }

.slide-body {
  --fit: 1;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  font-size: calc(36px * var(--fit));
  line-height: 1.38;
  color: var(--ink-2);
}
.slide-body > :first-child { margin-top: 0; }
.slide-body p { margin: .45em 0; }
.slide-body strong { color: var(--ink); font-weight: 700; }
.slide-body em { color: var(--ink); }

.slide-body ul, .slide-body ol { list-style: none; margin: 0; padding: 0; }
.slide-body li { position: relative; padding-left: 1.1em; margin: .38em 0; }
.slide-body li::before {
  content: "";
  position: absolute;
  left: .12em; top: .5em;
  width: .38em; height: .38em;
  border-radius: 2px;
  background: var(--accent);
}
.slide-body li li { font-size: .84em; margin: .2em 0; }
.slide-body li li::before { background: transparent; border: 2px solid var(--accent); }

code {
  font-family: var(--mono);
  font-size: .84em;
  background: var(--paper-2);
  color: #8a2f0d;
  padding: .06em .32em;
  border-radius: 6px;
}
a { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .18em; overflow-wrap: anywhere; }

/* ---------- code blocks ---------- */

.code-block {
  position: relative;
  margin: .5em 0;
  padding: 26px 32px;
  background: var(--code-bg);
  border-radius: 18px;
  font-size: .64em;
  box-shadow: 0 14px 30px rgba(15, 23, 34, .18);
}
.code-block::after {
  content: attr(data-lang);
  position: absolute;
  top: 12px; right: 18px;
  font: 600 14px/1 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #6e7b8c;
}
.code-block[data-lang="output"] { background: #1c2633; }
.code-block[data-lang="output"] code { color: #b9f5d8; }
.code-block pre { margin: 0; overflow: visible; }
.code-block code {
  display: block;
  font-family: var(--mono);
  font-size: 1em;
  line-height: 1.5;
  background: none;
  color: var(--code-fg);
  padding: 0;
  white-space: pre;
}
.hljs-keyword, .hljs-selector-tag, .hljs-meta .hljs-keyword { color: #ff7b72; }
.hljs-string, .hljs-regexp { color: #a5d6ff; }
.hljs-comment, .hljs-quote { color: #8b98a8; font-style: italic; }
.hljs-number, .hljs-literal, .hljs-attr, .hljs-variable.constant_ { color: #79c0ff; }
.hljs-title, .hljs-title.function_, .hljs-title.class_, .hljs-section { color: #d2a8ff; }
.hljs-built_in, .hljs-type, .hljs-symbol { color: #ffa657; }
.hljs-meta, .hljs-meta .hljs-string { color: #8b98a8; }
.hljs-params, .hljs-subst { color: var(--code-fg); }

/* ---------- tables ---------- */

.kind-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .72em;
  line-height: 1.3;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--rule);
}
.kind-table th {
  background: var(--night);
  color: #fff;
  text-align: left;
  font-weight: 650;
  padding: .62em .9em;
}
.kind-table td { padding: .55em .9em; border-top: 1px solid var(--rule); vertical-align: top; }
.kind-table tr:nth-child(even) td { background: #f3efe5; }
.kind-table td:first-child { font-weight: 650; color: var(--ink); }

/* ---------- picture layouts ---------- */

.kind-picture .slide-body {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  align-items: center;
}
.pic-text { align-self: center; }
.pic-figure {
  margin: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pic-figure img, .solo-figure img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 50px rgba(20, 26, 35, .18), 0 0 0 1px rgba(20, 26, 35, .06);
}
.pic-stack .slide-body { display: flex; flex-direction: column; gap: 28px; }
.pic-stack .pic-figure { flex: 1; min-height: 240px; }
.picture-solo .slide-body { display: flex; }
.picture-solo .pic-figure { flex: 1; }

/* Timeline slides ("2015", "2016/2017", …): big year on the left, evidence on the right. */
.year-split .slide-title {
  position: absolute;
  left: 104px; top: 50%;
  transform: translateY(-50%);
  width: 380px;
  margin: 0;
  font-size: 128px;
  line-height: .95;
  color: var(--accent);
  letter-spacing: -.04em;
}
.year-split .slide-title::before { width: 80px; height: 8px; margin-bottom: 30px; }
.year-split .slide-body { margin-left: 440px; }

/* ---------- image-only slides (memes, screenshots) ---------- */

.kind-image { background: var(--paper-2); padding: 52px 104px 84px; }
.solo-figure {
  margin: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- dark slides: cover, sections, closing ---------- */

.kind-cover, .kind-section, .kind-closing {
  background:
    radial-gradient(1200px 700px at 85% 10%, rgba(45, 212, 191, .10), transparent 60%),
    linear-gradient(160deg, var(--night-2), var(--night) 60%);
  color: #fff;
  justify-content: center;
}
.kind-section .slide-top, .kind-section .slide-foot,
.kind-closing .slide-top, .kind-closing .slide-foot { color: #7d8a9b; }
.kind-section .slide-top .brand, .kind-closing .slide-top .brand { color: var(--accent-bright); }
.kind-section .slide-foot .num, .kind-closing .slide-foot .num { color: #aab4c2; }

.hex-rain {
  position: absolute;
  top: -20px; right: -40px;
  margin: 0;
  font: 22px/1.45 var(--mono);
  color: rgba(45, 212, 191, .085);
  white-space: pre;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(100deg, transparent 15%, #000 60%);
  mask-image: linear-gradient(100deg, transparent 15%, #000 60%);
}
.kicker {
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--accent-bright);
  margin-bottom: 28px;
}

.cover-inner { position: relative; max-width: 1200px; }
.kind-cover h1 {
  margin: 0;
  font-size: 104px;
  line-height: 1.0;
  font-weight: 800;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.cover-rule { width: 120px; height: 8px; border-radius: 4px; background: var(--accent-bright); margin: 48px 0 36px; }
.cover-name { margin: 0; font-size: 38px; color: #dbe3ec; font-weight: 500; }
.cover-date { margin: 12px 0 0; font-size: 24px; color: #8593a5; letter-spacing: .04em; }

.section-number {
  position: absolute;
  right: 70px; bottom: -70px;
  font: 800 520px/1 var(--sans);
  letter-spacing: -.06em;
  color: transparent;
  -webkit-text-stroke: 3px rgba(255, 255, 255, .10);
  pointer-events: none;
}
.section-inner { position: relative; max-width: 1150px; }
.kind-section h1, .kind-closing h1 {
  margin: 0;
  font-size: 92px;
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.kind-section h1 code, .kind-closing h1 code { background: none; padding: 0; color: var(--accent-bright); font-size: .9em; white-space: nowrap; }
.section-sub { margin: 34px 0 0; font-size: 36px; color: #b6c2d1; max-width: 1000px; }

.kind-closing .closing-links { display: flex; gap: 28px; margin-top: 54px; }
.kind-closing .closing-links a {
  font-size: 32px;
  color: #fff;
  text-decoration: none;
  padding: 16px 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.kind-closing .closing-links a::before { content: "↗ "; color: var(--accent-bright); }

/* ---------- interactive walkthroughs ---------- */

.kind-demo { padding-bottom: 84px; }
.kind-demo .slide-title { font-size: 50px; margin-bottom: 16px; }
.kind-demo .slide-title::before { margin-bottom: 18px; }
.kind-demo .slide-body { display: flex; font-size: 22px; line-height: 1.35; overflow: visible; }
.demo-host { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.demo-intro { margin: 0 0 14px; font-size: 22px; color: var(--muted); }
.lab {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 0 0 1px var(--rule), 0 18px 40px rgba(20, 26, 35, .07);
  padding: 18px 30px 20px;
}
.lab-toolbar { display: flex; align-items: center; gap: 12px; font-size: 16px; color: var(--muted); }
.lab-toolbar button {
  border: 0;
  border-radius: 999px;
  padding: 7px 16px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}
.lab-toolbar button:hover { background: var(--accent-soft); color: var(--accent); }
.step-dots { display: flex; gap: 6px; margin-left: 8px; }
.step-dots i { width: 30px; height: 6px; border-radius: 3px; background: var(--rule); transition: background .3s; }
.step-dots i.done { background: var(--accent); }
.lab-toolbar .hint { font-family: var(--mono); }
.demo-source { margin-left: auto; font-size: 16px; font-weight: 600; text-decoration: none; }

.demo-scene {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  overflow: hidden;
}
.scene-inner { display: flex; flex-direction: column; gap: 16px; flex-shrink: 0; }
.step-caption {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}
.step-number { font: 700 42px/1 var(--mono); color: var(--accent); min-width: 64px; }
.step-caption h2 { margin: 0 0 4px; font-size: 27px; color: var(--ink); letter-spacing: -.01em; }
.step-caption p { margin: 0; font-size: 21px; color: var(--ink-2); }

/* flow diagrams */
.flow { display: flex; align-items: stretch; justify-content: center; gap: 10px; }
.flow-block {
  min-width: 150px;
  max-width: 360px;
  padding: 12px 18px;
  border: 2px solid var(--rule);
  border-radius: 14px;
  background: #fbf9f3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: background .3s, border-color .3s;
}
.flow-block small {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.flow-block strong { font: 600 22px/1.25 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.flow-block.accent { border-color: var(--accent); background: var(--accent-soft); }
.flow-block.accent strong { color: var(--accent); }
.flow-block.secret { border-color: var(--amber); background: var(--amber-soft); }
.flow-block.secret strong { color: var(--amber); }
.flow-block.success { border-color: var(--good); background: var(--good-soft); }
.flow-block.success strong { color: var(--good); }
.flow-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 60px; }
.flow-arrow small { font-size: 14px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.flow-arrow span { font-size: 32px; color: var(--accent); line-height: 1; }

.equation { text-align: center; font: 500 30px/1.3 var(--mono); color: var(--ink); }
.equation em { font-style: normal; color: var(--accent); font-weight: 700; }
.equation sup { font-size: .6em; }
.trace-note { text-align: center; margin: 0; font-size: 18px; color: var(--muted); }

.letter {
  display: inline-grid;
  place-items: center;
  width: 54px; height: 62px;
  margin: 0 3px;
  font: 700 34px var(--mono);
  border: 2px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transition: all .3s;
}
.letter.focus { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* byte traces */
.trace-row { display: flex; align-items: center; gap: 16px; margin: 5px 0; justify-content: center; }
.trace-label { width: 190px; text-align: right; font-size: 17px; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.trace-bytes { display: flex; gap: 5px; }
.trace-byte {
  display: grid;
  place-items: center;
  width: 46px; height: 38px;
  font: 600 19px var(--mono);
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
}
.trace-byte.selected { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); transform: scale(1.08); }
.trace-byte.good { background: var(--good-soft); border-color: #9ad8b0; color: var(--good); }
.detail-trace { margin-top: 4px; }

/* MIGS */
.message-pair { display: flex; justify-content: center; gap: 36px; font-size: 20px; color: var(--muted); }
.parameter-lane { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.param { border: 2px solid var(--rule); border-radius: 14px; padding: 8px 16px 10px; background: #fff; }
.param small { display: block; font: 600 15px var(--mono); color: var(--muted); }
.param div { font: 700 38px var(--mono); letter-spacing: .02em; }
.digit { display: inline-block; }
.param.amount { border-color: var(--accent); } .param.amount div { color: var(--accent); }
.param.injected { border-color: var(--amber); background: var(--amber-soft); } .param.injected div { color: var(--amber); }
.param.card { border-color: #6366f1; } .param.card div { color: #4f46e5; }
.param.name { border-color: #db2777; } .param.name div { color: #be185d; }
.down-wire { text-align: center; font-size: 20px; color: var(--muted); font-weight: 600; }
.down-wire.lit { color: var(--accent); }
.byte-tape {
  margin: 0 auto;
  padding: 16px 26px;
  border-radius: 14px;
  background: var(--code-bg);
  color: var(--code-fg);
  font: 600 32px/1.4 var(--mono);
  text-align: center;
  opacity: .25;
  transition: opacity .4s;
}
.byte-tape.visible { opacity: 1; }

/* CCM */
.ccm-path {
  margin-top: 12px;
  position: relative;
  border: 2px dashed var(--rule);
  border-radius: 16px;
  padding: 26px 14px 12px;
  transition: opacity .4s, border-color .4s;
}
.ccm-path.pending { opacity: .35; }
.ccm-path.active { border-color: #9fd3ca; }
.path-label {
  position: absolute;
  top: -12px; left: 20px;
  padding: 0 10px;
  background: var(--card);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--accent);
}
.ccm-path .flow-block { min-width: 120px; max-width: 230px; padding: 8px 14px; }
.ccm-path .flow-block strong { font-size: 18px; }
.ccm-path .flow-arrow { min-width: 48px; }
.verification {
  align-self: center;
  padding: 10px 22px;
  border-radius: 12px;
  background: var(--good-soft);
  color: var(--good);
  font-size: 21px;
  font-weight: 700;
}

/* XOR */
.xor-layout { display: grid; grid-template-columns: 1fr 380px; gap: 34px; align-items: center; }
.xor-layout .trace-label { width: 160px; }
.xor-layout .trace-byte { width: 58px; height: 46px; font-size: 22px; }
.bit-detail {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 18px;
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 22px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bit-detail small { font: 700 13px var(--sans); letter-spacing: .14em; color: #7d8a9b; margin-bottom: 8px; }
.bit-detail div { display: flex; align-items: center; }
.bit { display: inline-block; width: 26px; text-align: center; }
.bit.b1 { color: var(--accent-bright); font-weight: 700; }
.bit.b0 { color: #5d6b7d; }
.bit-detail b { margin-left: 14px; color: #aab4c2; font-weight: 500; }
.bit-detail hr { border: 0; border-top: 1px solid #334155; margin: 8px 0; width: 100%; }
.bit-detail p { margin: 10px 0 0; font-size: 20px; }
.bit-detail em { font-style: normal; color: #fbbf24; }
.xor-symbol { font-size: 110px; color: var(--accent-bright); justify-content: center; line-height: 1; }
.decoded { display: flex; justify-content: center; }

/* Diffie–Hellman */
.exchange { display: grid; grid-template-columns: 1fr 300px 1fr; gap: 26px; align-items: stretch; }
.party { background: #fbf9f3; border: 1px solid var(--rule); border-radius: 18px; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.party h3 { margin: 0 0 4px; text-align: center; font-size: 15px; letter-spacing: .16em; color: var(--muted); }
.party .flow-block { max-width: none; flex-direction: row; justify-content: space-between; align-items: center; }
.party .flow-block small { margin: 0; }
.party .flow-block strong { font-size: 30px; }
.channel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.channel small { font-size: 14px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.packet {
  font: 700 24px var(--mono);
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  transition: all .5s cubic-bezier(.2, .8, .2, 1);
}
.packet.sent-right, .packet.sent-left { background: var(--accent); color: #fff; }
.packet.sent-right { transform: translateX(10px); }
.packet.sent-left { transform: translateX(-10px); }
.channel-note { text-align: center; font-size: 18px; color: var(--muted); }

/* Babuk disk */
.disk-overview { position: relative; height: 46px; border-radius: 10px; background: var(--paper-2); overflow: hidden; }
.encrypted-range { position: absolute; inset: 0 auto 0 0; background: var(--amber); transition: width .6s; min-width: 3px; }
.disk-overview span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 17px; color: var(--muted); font-weight: 600; }
.zoom-label { text-align: center; font-size: 18px; color: var(--muted); }
.disk-blocks { display: grid; grid-template-columns: repeat(20, 1fr); gap: 6px; }
.disk-cell {
  position: relative;
  height: 50px;
  border-radius: 7px;
  background: #f1ede3;
  border: 1px solid var(--rule);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3px;
  font: 600 13px var(--mono);
  color: var(--muted);
  transition: background .35s var(--delay, 0ms), border-color .35s var(--delay, 0ms);
}
.disk-cell.encrypted { background: #f3b45b; border-color: var(--amber); color: #5a3000; }
.disk-cell.boundary::after {
  content: "";
  position: absolute;
  left: 20%; top: -6px; bottom: -6px;
  width: 3px;
  background: var(--bad);
  border-radius: 2px;
}
.legend { display: flex; justify-content: center; gap: 30px; font-size: 17px; color: var(--muted); }

/* timestamp search */
.candidate-strip { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.candidate {
  font: 600 20px var(--mono);
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: #fff;
  transition: all .3s;
}
.candidate.testing { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); }
.candidate.rejected { opacity: .45; color: var(--bad); text-decoration: line-through; }
.candidate.matched { background: var(--good); border-color: var(--good); color: #fff; opacity: 1; text-decoration: none; }
.compare-target {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--code-fg);
  font: 600 22px var(--mono);
}
.compare-target code { background: none; color: #fbbf24; font-size: 1em; }
.compare-target span { color: var(--accent-bright); }

/* weak key search (eMudhra) */
.key-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.key-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fff;
}
.key-card small { font-size: 17px; color: var(--muted); }
.key-card strong { font: 700 34px var(--mono); color: var(--bad); }
.key-card.focus { border: 2px solid var(--bad); background: #fff5f3; }

/* ---------- presenter controls ---------- */

#controls {
  position: fixed;
  right: 18px; bottom: 16px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(13, 20, 30, .86);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
  color: #e6edf3;
  z-index: 10;
  transition: opacity .4s;
}
#controls button {
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
}
#controls button:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
#controls button:disabled { opacity: .3; cursor: default; }
#counter { min-width: 84px; text-align: center; font: 600 14px var(--mono); color: #aab4c2; }
#progress { position: fixed; left: 0; right: 0; bottom: 0; height: 4px; z-index: 9; }
#progress i { display: block; height: 100%; width: 0; background: var(--accent-bright); transition: width .35s; }
body.idle #controls { opacity: 0; pointer-events: none; }
body.idle { cursor: none; }

/* ---------- slide list ---------- */

#contents {
  width: min(920px, 92vw);
  max-height: 84vh;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
  overflow: hidden;
}
#contents[open] { display: flex; flex-direction: column; }
#contents::backdrop { background: rgba(5, 8, 13, .65); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--rule); }
.dialog-head h2 { margin: 0; font-size: 20px; white-space: nowrap; }
#search { flex: 1; font: 17px var(--sans); padding: 10px 14px; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
#close-menu { border: 0; background: var(--paper-2); width: 38px; height: 38px; border-radius: 50%; font-size: 16px; }
#slide-list { overflow: auto; padding: 8px 10px; flex: 1; }
#slide-list button {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 16px;
  color: var(--ink-2);
}
#slide-list button:hover { background: var(--paper); }
#slide-list button.current { background: var(--accent-soft); color: var(--accent); }
#slide-list button.kind-section, #slide-list button.kind-cover { font-weight: 750; color: var(--ink); margin-top: 6px; }
#slide-list small { font-family: var(--mono); color: var(--muted); }
#slide-list em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
#contents .hint { margin: 0; padding: 12px 22px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--rule); }

#print-root { display: none; }
#print-root.building { display: block; position: absolute; left: -20000px; top: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  @page { size: 1600px 900px; margin: 0; }
  html, body { height: auto; overflow: visible; background: #fff; }
  #viewport, #controls, #progress, #contents { display: none !important; }
  #print-root { display: block !important; position: static !important; }
  #print-root .slide { break-after: page; page-break-after: always; animation: none; }
  .lab-toolbar { visibility: hidden; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
