/* ============================================================
   JAK FUNGUJE AI - editorial microsite
   Design tokens, layout, sections, motion.
   ============================================================ */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 2. Design tokens ---------- */
:root {
  /* Light */
  --bg: #F6F2EB;
  --bg-soft: #EFE9DD;
  --surface: #FFFFFF;
  --surface-2: #FBF8F2;
  --ink: #1A1A1F;
  --ink-soft: #4A4A52;
  --muted: #8A8A92;
  --accent: #C7522A;
  --accent-soft: #E8B5A1;
  --accent-2: #2D5F4F;
  --accent-2-soft: #A9C9BD;
  --warn: #B8762B;
  --line: rgba(26, 26, 31, 0.10);
  --line-strong: rgba(26, 26, 31, 0.22);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 1px 2px rgba(0,0,0,.04), 0 12px 28px rgba(0,0,0,.07);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.06), 0 24px 56px rgba(0,0,0,.10);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --max-w: 1100px;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out: cubic-bezier(.22,.61,.36,1);
  --ease-in-out: cubic-bezier(.65,.05,.36,1);
}

/* Dark (auto via system, override via data-theme) */
@media (prefers-color-scheme: dark) {
  body[data-theme="auto"] {
    --bg: #14131A;
    --bg-soft: #1A1922;
    --surface: #1C1B23;
    --surface-2: #232229;
    --ink: #F3EFE6;
    --ink-soft: #B5B0A6;
    --muted: #7A7770;
    --accent: #E07A4F;
    --accent-soft: #5b3225;
    --accent-2: #6FB39A;
    --accent-2-soft: #2c4a40;
    --warn: #E0A05A;
    --line: rgba(243,239,230,0.10);
    --line-strong: rgba(243,239,230,0.20);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.35);
    --shadow-md: 0 1px 2px rgba(0,0,0,.45), 0 12px 28px rgba(0,0,0,.45);
    --shadow-lg: 0 4px 12px rgba(0,0,0,.45), 0 24px 56px rgba(0,0,0,.55);
  }
}
body[data-theme="dark"] {
  --bg: #14131A;
  --bg-soft: #1A1922;
  --surface: #1C1B23;
  --surface-2: #232229;
  --ink: #F3EFE6;
  --ink-soft: #B5B0A6;
  --muted: #7A7770;
  --accent: #E07A4F;
  --accent-soft: #5b3225;
  --accent-2: #6FB39A;
  --accent-2-soft: #2c4a40;
  --warn: #E0A05A;
  --line: rgba(243,239,230,0.10);
  --line-strong: rgba(243,239,230,0.20);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.35);
  --shadow-md: 0 1px 2px rgba(0,0,0,.45), 0 12px 28px rgba(0,0,0,.45);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.45), 0 24px 56px rgba(0,0,0,.55);
}

/* ---------- 3. Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: normal;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
h1 { font-size: clamp(2.5rem, 1.5rem + 4.5vw, 4.75rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem); }
p { margin: 0 0 1em; color: var(--ink-soft); }
strong { color: var(--ink); font-weight: 600; }
em { font-style: italic; color: var(--accent); font-family: var(--font-display); font-weight: 500; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

/* ---------- 4. Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 0.7rem clamp(1.25rem, 4vw, 3rem);
  display: flex; align-items: center; gap: 1rem;
}
.topbar__brand {
  display: flex; align-items: center; gap: 0.55rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink);
}
.brand__mark {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  flex-shrink: 0;
}
/* brand mark color follows --bg via CSS variables automatically */
.topbar__progress {
  flex: 1;
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.chapter-indicator { font-weight: 500; color: var(--ink-soft); }
.chapter-indicator .dim { color: var(--muted); }
.progress-track {
  position: relative;
  flex: 1;
  height: 3px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  max-width: 320px;
}
.progress-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .35s var(--ease-out);
}
.time-left { white-space: nowrap; }
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: var(--surface);
  transition: border-color .2s, color .2s, transform .2s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle .icon-moon { display: none; }
body[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
body[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  body[data-theme="auto"] .theme-toggle .icon-sun { display: none; }
  body[data-theme="auto"] .theme-toggle .icon-moon { display: block; }
}
body[data-theme="light"] .theme-toggle .icon-sun { display: block; }
body[data-theme="light"] .theme-toggle .icon-moon { display: none; }

@media (max-width: 720px) {
  .topbar__progress { gap: 0.45rem; }
  .time-left { display: none; }
  .topbar__brand .brand__name { display: none; }
}

/* ---------- 5. Dot nav (right side, desktop) ---------- */
.dotnav {
  position: fixed;
  right: clamp(0.75rem, 2vw, 1.4rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
}
.dotnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.dotnav a {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none;
  padding: 0.3rem 0.4rem;
  border-radius: 999px;
}
.dotnav a::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background .25s, transform .25s, width .25s;
  flex-shrink: 0;
}
.dotnav a:hover::before { background: var(--ink-soft); }
.dotnav a.is-active::before { background: var(--accent); width: 18px; border-radius: 4px; }
.dotnav a span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
  pointer-events: none;
}
.dotnav a:hover span,
.dotnav a:focus-visible span { opacity: 1; transform: translateX(0); color: var(--ink-soft); }

@media (max-width: 960px) {
  .dotnav { display: none; }
}

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.005em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .15s var(--ease-out), background .2s, color .2s, border-color .2s, box-shadow .2s;
  cursor: pointer;
}
.btn--primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-md);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line-strong);
}
.btn--ghost:hover { color: var(--ink); border-color: var(--ink-soft); }

/* ---------- 7. Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - 60px);
  display: flex; align-items: center;
  padding: clamp(4rem, 10vh, 7rem) 0 clamp(3rem, 8vh, 5rem);
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero__bg .float-token {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  opacity: 0;
  animation: floatTok 16s linear infinite;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
@keyframes floatTok {
  0% { transform: translate(0,0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translate(var(--tx, 80px), var(--ty, -120px)); opacity: 0; }
}

.hero__inner { position: relative; z-index: 1; }
.hero__title {
  font-size: clamp(2.8rem, 1.8rem + 5.5vw, 6rem);
  font-weight: 500;
  font-variation-settings: "opsz" 90;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}
.hero__title em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "opsz" 144;
}
.hero__lead {
  font-size: clamp(1.1rem, 1rem + 0.7vw, 1.35rem);
  max-width: 38ch;
  margin-bottom: 2.25rem;
  line-height: 1.45;
}
.hero__cta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem;
  margin-bottom: 3rem;
}
.hero__meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.hero__highlights {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1.5rem;
  max-width: 600px;
}
.hero__highlights li {
  display: flex; align-items: center; gap: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.hero__highlights .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ---------- 8. Chapter base ---------- */
.chapter {
  padding: clamp(4rem, 11vh, 8rem) 0;
  position: relative;
}
.chapter--alt { background: var(--bg-soft); }
.chapter__head {
  max-width: 58ch;
  margin-bottom: 3rem;
}
.chapter__num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.chapter__title {
  margin-bottom: 1.1rem;
  font-variation-settings: "opsz" 90;
}
.chapter__lead {
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.18rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---------- 9. Aha pattern ---------- */
.aha {
  margin-top: 2.25rem;
  padding: 1.1rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.98rem;
  color: var(--ink);
  display: flex; gap: 0.8rem; align-items: flex-start;
}
.aha__label {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.05rem;
}
.aha__text { line-height: 1.55; }

/* ---------- 10. Chat compare (sec 01) ---------- */
.chat-compare__questions {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.qchip {
  padding: 0.55rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  transition: border-color .2s, color .2s, background .2s, transform .15s;
}
.qchip:hover { color: var(--ink); border-color: var(--ink-soft); }
.qchip.is-active {
  background: var(--ink); color: var(--bg);
  border-color: var(--ink);
}
.qchip:active { transform: scale(.97); }

.chat-compare__grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 760px) {
  .chat-compare__grid { grid-template-columns: 1fr; }
}
.chatbox {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  min-height: 260px;
}
.chatbox--ai { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.chatbox__head { margin-bottom: 1.25rem; }
.chatbox__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.6rem;
}
.chatbox__badge--rule {
  background: color-mix(in srgb, var(--muted) 20%, transparent);
  color: var(--ink-soft);
}
.chatbox__badge--ai {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.chatbox__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
}
.chatbox__sub { font-size: 0.9rem; margin: 0; color: var(--muted); }
.chatbox__body { flex: 1; }
.chat-placeholder { color: var(--muted); font-style: italic; }

.bubble {
  display: inline-block;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  margin: 0.35rem 0;
  max-width: 90%;
  font-size: 0.96rem;
  line-height: 1.5;
}
.bubble--user {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-right-radius: 4px;
  margin-left: auto;
  display: block;
  margin-right: 0;
}
.chatbox__body { display: flex; flex-direction: column; }
.bubble--user { align-self: flex-end; }
.bubble--bot {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
  color: var(--ink);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.chatbox--rule .bubble--bot {
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.typing-dots {
  display: inline-flex; gap: 4px; padding: 0.7rem 1rem;
  background: var(--surface-2);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  margin: 0.35rem 0;
}
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: typingDot 1.2s infinite var(--ease-in-out);
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typingDot {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- 11. Token lab (sec 02) ---------- */
.token-lab__pick {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  margin-bottom: 1.75rem;
  align-items: center;
}
.label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.25rem;
}
.seed-chip {
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  background: var(--surface);
  color: var(--ink-soft);
  transition: border-color .2s, color .2s, background .2s;
}
.seed-chip.is-active {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.seed-chip:hover { color: var(--ink); border-color: var(--ink-soft); }

.token-lab__stage {
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 820px) {
  .token-lab__stage { grid-template-columns: 1fr; }
}

.micro-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.token-stream {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  align-items: center;
  min-height: 80px;
}
.tok {
  display: inline-flex; align-items: center;
  padding: 0.42rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  opacity: 0;
  transform: translateY(6px);
  animation: tokIn .4s var(--ease-out) forwards;
}
.tok--new { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.tok--c0 { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.tok--c1 { background: color-mix(in srgb, var(--accent-2) 14%, var(--surface)); }
.tok--c2 { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
@keyframes tokIn {
  to { opacity: 1; transform: translateY(0); }
}

.prob-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.prob-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
  position: relative;
  overflow: hidden;
}
.prob-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--p, 0%);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  transition: width .6s var(--ease-out);
  z-index: 0;
}
.prob-item > * { position: relative; z-index: 1; }
.prob-item:hover { border-color: var(--accent); transform: translateX(2px); }
.prob-word {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  color: var(--ink);
}
.prob-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.hint { font-size: 0.86rem; color: var(--muted); margin: 0.85rem 0 0; }

.token-lab__actions { margin-top: 1.25rem; }

/* ---------- 12. Prompt lab (sec 03) ---------- */
.prompt-lab__controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.toggle-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem 1rem;
  background: var(--surface);
  margin: 0;
}
.toggle-group legend {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.4rem;
}
.toggle-group label {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.toggle-group input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  display: grid; place-items: center;
  transition: border-color .15s;
  flex-shrink: 0;
}
.toggle-group input[type="radio"]:checked { border-color: var(--accent); }
.toggle-group input[type="radio"]:checked::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.toggle-group label:hover { color: var(--ink); }
.toggle-group input[type="radio"]:checked + span { color: var(--ink); font-weight: 500; }

.prompt-lab__panes {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 820px) {
  .prompt-lab__panes { grid-template-columns: 1fr; }
}
.pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.pane--response { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 20%, var(--line)); }
.pane__head { margin-bottom: 1rem; }
.pane__kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.pane__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0.2rem 0 0;
}
.prompt-text {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
  background: var(--bg-soft);
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
}
.response-text {
  font-size: 1rem; line-height: 1.6; color: var(--ink);
  transition: opacity .25s var(--ease-out);
}
.response-text ul { padding-left: 1.1rem; margin: 0; }
.response-text li { margin: 0.3rem 0; }
.response-text p { margin: 0 0 0.7rem; color: inherit; }
.response-text.is-changing { opacity: 0; }

/* ---------- 13. Context lab (sec 04) ---------- */
.context-lab {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 880px) {
  .context-lab { grid-template-columns: 1fr; }
}
.context-lab__convo {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.55rem;
  position: relative;
}
.msg {
  display: flex; flex-direction: column;
  max-width: 88%;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.45;
  position: relative;
  transition: opacity .35s var(--ease-out), filter .35s var(--ease-out);
}
.msg--user {
  align-self: flex-end;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-bottom-right-radius: 4px;
}
.msg--ai {
  align-self: flex-start;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
  border-bottom-left-radius: 4px;
}
.msg__role {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.msg.is-out {
  opacity: 0.25;
  filter: grayscale(0.6);
}
.msg.is-out::after {
  content: "⌀ mimo kontext";
  position: absolute;
  top: 50%;
  right: -0.35rem;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.context-lab__panel {
  display: flex; flex-direction: column; gap: 1rem;
  position: sticky; top: 90px;
}
.slider-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
}
.slider-label {
  display: block;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
}
.slider-label strong { color: var(--accent); font-family: var(--font-mono); font-size: 1.05rem; }
input[type="range"] {
  width: 100%;
  appearance: none; -webkit-appearance: none;
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  border: 3px solid var(--bg);
  transition: transform .15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--bg);
}
.slider-ticks {
  display: flex; justify-content: space-between;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.model-answer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.model-answer__head { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.6rem; }
.model-answer__head h3 { font-size: 1.05rem; margin: 0; font-family: var(--font-body); font-weight: 600; }
.dot--accent { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.model-answer__text { font-size: 0.98rem; line-height: 1.55; margin: 0 0 0.6rem; color: var(--ink); }
.model-answer__note { font-size: 0.82rem; color: var(--muted); font-style: italic; margin: 0; }

/* ---------- 14. Halucinace (sec 05) ---------- */
.halluc-lab__pick {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.halluc-lab__cards {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 760px) {
  .halluc-lab__cards { grid-template-columns: 1fr; }
}
.halluc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  min-height: 220px;
}
.halluc-card header { margin-bottom: 0.85rem; }
.halluc-card h3 { font-size: 1.15rem; margin: 0.3rem 0 0; }
.halluc-card__text { font-size: 0.98rem; line-height: 1.55; color: var(--ink); flex: 1; margin: 0; }
.halluc-card__tag {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
}
.halluc-card--bad { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.halluc-card--good { border-color: color-mix(in srgb, var(--accent-2) 30%, var(--line)); }
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
}
.badge--warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.badge--ok { background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: var(--accent-2); }
.badge--neutral {
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

.why {
  margin: 2rem 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.2rem;
}
.why summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--ink);
  padding: 0.6rem 0;
  list-style: none;
  display: flex; align-items: center; gap: 0.5rem;
}
.why summary::before {
  content: "+";
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent);
  transition: transform .2s;
  line-height: 1;
  width: 1rem;
  display: inline-block;
}
.why[open] summary::before { content: "−"; }
.why summary::-webkit-details-marker { display: none; }
.why p { margin: 0.25rem 0 0.85rem; font-size: 0.96rem; line-height: 1.55; }

/* ---------- 15. Image lab (sec 06) ---------- */
.image-lab {
  display: grid; grid-template-columns: 1fr 1.1fr;
  gap: 1.75rem; align-items: start;
}
@media (max-width: 900px) {
  .image-lab { grid-template-columns: 1fr; }
}
.image-lab__controls {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 1.1rem;
}
.control-row { display: flex; flex-direction: column; gap: 0.45rem; }
.control-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.chip-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  padding: 0.45rem 0.85rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  transition: border-color .2s, color .2s, background .2s, transform .15s;
}
.chip:hover { color: var(--ink); border-color: var(--ink-soft); }
.chip.is-active {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.chip--neg.is-active {
  background: color-mix(in srgb, var(--warn) 18%, var(--surface));
  color: var(--warn);
  border-color: var(--warn);
}

.image-lab__canvas {
  margin: 0;
  display: flex; flex-direction: column;
  gap: 0.85rem;
}
.image-frame {
  position: relative;
  aspect-ratio: 4/5;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.image-frame svg { width: 100%; height: 100%; display: block; }
.image-lab__caption { display: flex; flex-direction: column; gap: 0.5rem; }
.image-lab__caption p {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0;
  background: var(--bg-soft);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  line-height: 1.5;
}

/* ---------- 16. Quiz (sec 07) ---------- */
.quiz {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem clamp(1.25rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-md);
}
.quiz__progress {
  display: flex; align-items: center; gap: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.quiz__bar {
  flex: 1; height: 4px; background: var(--line); border-radius: 999px;
  overflow: hidden;
}
.quiz__bar div {
  height: 100%;
  width: 20%;
  background: var(--accent);
  transition: width .4s var(--ease-out);
}
.quiz__question {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.1rem + 1.3vw, 1.9rem);
  line-height: 1.25;
  margin: 0 0 1.5rem;
  color: var(--ink);
}
.quiz__options {
  display: grid; gap: 0.6rem;
  margin-bottom: 1rem;
}
.quiz__option {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.95rem 1.15rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: left;
  font-size: 1rem;
  transition: border-color .2s, background .2s, transform .15s;
}
.quiz__option:hover:not(:disabled) {
  border-color: var(--ink-soft);
  transform: translateX(2px);
}
.quiz__option .letter {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  flex-shrink: 0;
  transition: background .2s, color .2s, border-color .2s;
}
.quiz__option.is-correct {
  border-color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 10%, var(--surface-2));
}
.quiz__option.is-correct .letter {
  background: var(--accent-2); color: #fff; border-color: var(--accent-2);
}
.quiz__option.is-wrong {
  border-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--surface-2));
}
.quiz__option.is-wrong .letter {
  background: var(--warn); color: #fff; border-color: var(--warn);
}
.quiz__option:disabled { cursor: default; opacity: 0.95; }

.quiz__feedback {
  margin-top: 1.1rem;
  padding: 1rem 1.15rem;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.96rem;
  line-height: 1.55;
}
.quiz__next {
  margin-top: 1.25rem;
  display: flex; justify-content: flex-end;
}

.quiz__result { text-align: center; padding: 1rem 0 0.5rem; }
.quiz__result h3 {
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  margin-bottom: 0.75rem;
  font-variation-settings: "opsz" 90;
}
.quiz__score {
  font-family: var(--font-display);
  font-size: clamp(3rem, 2rem + 4vw, 5rem);
  color: var(--accent);
  font-variation-settings: "opsz" 144;
  line-height: 1;
  margin: 1rem 0 0.5rem;
}
.quiz__score span { color: var(--muted); font-size: 0.5em; }
.quiz__result p { max-width: 50ch; margin: 0.85rem auto 1.5rem; color: var(--ink-soft); font-size: 1.05rem; }
.quiz__result-actions { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }

/* ---------- 17. Footer ---------- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 2.5rem 0;
  text-align: center;
}
.footer__line { margin: 0 0 0.4rem; color: var(--ink-soft); font-size: 0.96rem; }
.footer__small { font-size: 0.82rem; color: var(--muted); margin: 0; max-width: 50ch; margin-inline: auto; }

/* ---------- 18. Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ---------- 19. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.2s !important;
  }
  .reveal { transform: none; }
  .float-token { display: none !important; }
  .typing-dots span { animation: none; opacity: 0.6; }
}

/* ---------- 20. Small screens (< 480) ---------- */
@media (max-width: 480px) {
  .container { padding-inline: 1.1rem; }
  .topbar__inner { padding: 0.6rem 1rem; gap: 0.6rem; }
  .progress-track { max-width: 100%; }
  .hero__cta { flex-direction: column; align-items: flex-start; }
  .chapter__head { margin-bottom: 2rem; }
  .token-lab__stage { padding: 1.25rem; }
  .quiz { padding: 1.5rem 1.1rem; }
}

/* ---------- 21. FAQ section ---------- */
.faq {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 760px;
}
.faq__item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.faq__item[open] {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: var(--shadow-sm);
}
.faq__item > summary {
  cursor: pointer;
  padding: 1.05rem 1.25rem;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
}
.faq__item > summary::-webkit-details-marker { display: none; }
.faq__item > summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.2s;
  line-height: 1;
}
.faq__item[open] > summary::after {
  content: "−";
}
.faq__item > summary:hover {
  color: var(--accent);
}
.faq__item > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}
.faq__item p {
  margin: 0;
  padding: 0 1.25rem 1.15rem;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.faq__item p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.faq__item p a:hover {
  text-decoration-thickness: 2px;
}

/* ---------- 22. Live AI: badge, custom input, loading ---------- */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 999px;
  transition: opacity 0.25s;
}
.ai-badge[hidden] { display: none !important; }
.ai-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 30%, transparent);
}
.ai-badge.is-exhausted::before { background: var(--warn); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 30%, transparent); }
.ai-badge.is-exhausted { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

.live-form {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.live-form__input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 0.7rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink);
}
.live-form__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.live-form__input::placeholder { color: var(--muted); }
.live-form__submit {
  padding: 0.7rem 1.2rem;
}
.live-form__hint {
  width: 100%;
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.live-form__hint.is-warn { color: var(--warn); }

.live-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-style: italic;
}
.live-loading span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: dot-pulse 1.2s infinite ease-in-out;
}
.live-loading span:nth-child(2) { animation-delay: 0.15s; }
.live-loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .live-loading span { animation: none; opacity: 0.6; }
}

.live-source {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.15rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  border-radius: 4px;
}
.live-source--live { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.live-source--fallback { color: var(--muted); }

.toggle-group--topic {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  border: none;
  padding: 0;
  margin: 0;
  flex-basis: 100%;
}
.toggle-group--topic legend {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  width: 100%;
  margin-bottom: 0.3rem;
}
.toggle-group--topic .live-form__input { flex: 1 1 200px; }

.chat-placeholder + .live-source,
.bubble + .live-source {
  display: inline-block;
  margin-top: 0.5rem;
}

/* ---------- 23. Token splitter (ch02) ---------- */
.token-splitter {
  margin-bottom: 2.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.token-splitter__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.token-splitter__lead {
  margin: 0 0 1rem;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.token-splitter__form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.token-splitter__form .live-form__input { flex: 1 1 220px; }
.token-splitter__out {
  min-height: 2.6rem;
  padding: 0.85rem;
  background: var(--bg-soft, color-mix(in srgb, var(--ink) 3%, transparent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.15rem;
  margin-bottom: 0.85rem;
}
.token-splitter__chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  border-radius: 4px;
  color: var(--ink);
  background: var(--tk-bg, #FBE3D0);
  border: 1px solid var(--tk-bd, #C7522A);
  border-color: color-mix(in srgb, var(--tk-bd) 60%, transparent);
  white-space: pre;
  transition: transform 0.15s, opacity 0.15s;
}
.token-splitter__chip--space {
  background: transparent;
  border: 1px dashed color-mix(in srgb, var(--ink) 18%, transparent);
  color: var(--muted);
  padding: 0.3rem 0.35rem;
}
.token-splitter__chip--punct {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border-color: color-mix(in srgb, var(--ink) 18%, transparent);
}
.token-splitter__stats {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin: 0 0 0.85rem;
}
.token-splitter__stats strong {
  color: var(--accent);
  font-weight: 600;
}
.token-splitter__note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  .token-splitter__chip { transition: none; }
}

/* ---------- 24. Temperature widget (ch02) ---------- */
.temp-lab {
  margin-top: 2.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.temp-lab__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.temp-lab__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0;
  color: var(--ink);
}
.temp-lab__lead {
  margin: 0 0 1.1rem;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.temp-lab__slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}
.temp-lab__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.temp-lab__label strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  margin-right: 0.25rem;
}
.temp-lab__ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0 0.2rem;
}
.temp-lab__samples {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.temp-lab__sample {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-soft, color-mix(in srgb, var(--ink) 3%, transparent));
  border-left: 3px solid var(--accent);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
}
.temp-lab__sample--cold { border-left-color: #3B6E94; }
.temp-lab__sample--mid { border-left-color: var(--accent); }
.temp-lab__sample--hot { border-left-color: #D85F3A; }
.temp-lab__sample-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.temp-lab__note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}
@media (min-width: 700px) {
  .temp-lab__samples { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- 25. Diffusion animation (ch06) ---------- */
.image-frame { overflow: hidden; }
.image-frame__svg-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-frame__svg-wrap > svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: filter 0.6s ease-out, opacity 0.5s ease-out;
}
.image-frame.is-diffusing .image-frame__svg-wrap > svg {
  filter: blur(20px) saturate(1.3);
  opacity: 0.6;
}
.image-frame__noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease-out;
  z-index: 2;
}
.image-frame.is-diffusing .image-frame__noise {
  opacity: 0.95;
}
.image-frame__noise svg { width: 100%; height: 100%; display: block; }
.image-frame__progress {
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  background: var(--accent);
  width: 0%;
  transition: width 1.2s linear;
  z-index: 3;
  opacity: 0;
}
.image-frame.is-diffusing .image-frame__progress {
  opacity: 1;
  width: 100%;
}
@media (prefers-reduced-motion: reduce) {
  .image-frame.is-diffusing .image-frame__svg-wrap > svg { filter: none; opacity: 1; }
  .image-frame__noise { display: none; }
  .image-frame__progress { display: none; }
}
