/* how-it-works deck: widget and slide styles */

/* Slide 1: Hero */
#top h1 { font-size: clamp(1.85rem, 1rem + 2.2vw, 2.75rem); line-height: 1.08; max-width: 25ch; margin-bottom: 14px; }
#top .lead { font-size: clamp(1rem, .9rem + .4vw, 1.15rem); line-height: 1.5; max-width: 52ch; margin-bottom: 18px; }
#top .meta { margin-top: 14px !important; font-size: .8125rem; max-width: 60ch; line-height: 1.4; color: var(--text-muted); }

/* Slide 2: Equation */
.tc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-width: 0; }
.tc-col { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px 16px; min-width: 0; }
.tc-col.neo { border-color: var(--border-highlight); background: var(--bg-surface-elevated); box-shadow: var(--glow-subtle); }
.tc-col h3 { font-size: .9375rem; margin-bottom: 8px; }
.tc-col h3 small { display: block; font-weight: 420; color: var(--text-muted); font-size: .75rem; }
.tc-att { display: flex; flex-wrap: wrap; gap: 5px; min-height: 52px; align-content: flex-start; margin-bottom: 8px; }
.tc-att .chip { opacity: 0; transform: translateY(5px); transition: opacity .3s, transform .3s var(--ease); }
.tc-att .chip.in { opacity: 1; transform: none; }
.tc .hb { grid-template-columns: 80px 1fr auto; margin: 4px 0; }
.eq-scale { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-surface-elevated); border-left: 3px solid var(--cyan-glow); font-size: .8125rem; line-height: 1.4; color: var(--text-secondary); }
.eq-scale strong { color: var(--text-primary); }

/* Slide 3: Recipes & Distillation Demonstration */
#recipes h2 { font-size: clamp(1.75rem, 1.1rem + 1.8vw, 2.35rem); line-height: 1.1; margin-bottom: 8px; }
#recipes .section-lead { font-size: .84rem; line-height: 1.35; margin-bottom: 8px; }
#recipes .numlist { gap: 4px; }
#recipes .numlist li { padding: 4px 8px 4px 30px; font-size: .76rem; line-height: 1.3; }
#recipes .numlist li::before { top: 4px; }
#recipes .win-body { padding: 8px 10px; display: grid; gap: 6px; }

/* Distillation Demonstration Widget */
.distil-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.distil-tab { background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: .6875rem; padding: 2px 8px; border-radius: 4px; cursor: pointer; transition: all .2s cubic-bezier(0.16, 1, 0.3, 1); display: inline-flex; align-items: center; gap: 5px; font-family: inherit; line-height: 1.3; }
.distil-tab:hover { color: var(--text-primary); border-color: var(--border-highlight); background: var(--bg-surface-elevated); transform: translateY(-1px); }
.distil-tab.active { color: var(--cyan-glow); border-color: var(--cyan-glow); background: rgba(0, 245, 160, .1); font-weight: 600; box-shadow: 0 0 10px rgba(0, 245, 160, .15); }
.distil-tab .tab-idx { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .1); font-size: .625rem; font-weight: 700; color: inherit; }
.distil-tab.active .tab-idx { background: var(--cyan-glow); color: #06080d; }

.distil-play-btn { background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: .6875rem; padding: 2px 8px; border-radius: 4px; cursor: pointer; transition: all .2s cubic-bezier(0.16, 1, 0.3, 1); font-family: inherit; line-height: 1.3; margin-left: auto; }
.distil-play-btn:hover { color: var(--text-primary); border-color: var(--border-highlight); background: var(--bg-surface-elevated); transform: translateY(-1px); }
.distil-play-btn.playing { color: var(--amber-glow); border-color: var(--amber-glow); background: rgba(251, 191, 36, .1); }

.distil-stage { display: none; animation: distilFadeIn .25s cubic-bezier(0.16, 1, 0.3, 1); }
.distil-stage.active { display: grid; gap: 7px; }

@keyframes distilFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.ds-head { display: flex; justify-content: space-between; align-items: center; font-size: .76rem; font-weight: 600; color: var(--text-primary); border-bottom: 1px solid var(--border-subtle); padding-bottom: 4px; }
.ds-head small { color: var(--text-muted); font-weight: 400; }

.ds-diff-box { background: rgba(0, 0, 0, .3); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 7px 9px; font-size: .72rem; }
.ds-diff-title { font-family: var(--font-text); font-weight: 600; color: var(--text-muted); font-size: .6875rem; margin-bottom: 5px; letter-spacing: .02em; }
.ds-diff-text { font-family: monospace; font-size: .7rem; line-height: 1.35; display: grid; gap: 5px; }
.ds-diff-text del { color: var(--red-glow); text-decoration: none; display: block; background: rgba(248, 113, 113, .08); padding: 4px 6px; border-radius: 4px; border-left: 2px solid var(--red-glow); }
.ds-diff-text ins { color: var(--cyan-glow); text-decoration: none; font-weight: 500; display: block; background: rgba(0, 245, 160, .08); padding: 4px 6px; border-radius: 4px; border-left: 2px solid var(--cyan-glow); }

.ds-note { font-size: .7rem; color: var(--text-secondary); line-height: 1.35; padding: 5px 8px; border-radius: 4px; background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); }
.ds-note strong { color: var(--text-primary); }

.ds-invariants { display: grid; gap: 5px; }
.ds-inv { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 6px 9px; font-size: .7rem; }
.ds-inv-title { display: flex; justify-content: space-between; align-items: center; color: var(--text-primary); margin-bottom: 2px; font-size: .72rem; }
.ds-inv-title code { color: var(--cyan-glow); font-family: monospace; font-size: .6875rem; background: rgba(0, 245, 160, .08); padding: 1px 4px; border-radius: 3px; }
.ds-inv p { margin: 0; color: var(--text-secondary); font-size: .6875rem; line-height: 1.3; }

.ds-dag { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; align-items: stretch; margin: 3px 0; }
.ds-dag-step { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 6px 4px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.ds-dag-step strong { font-size: .7rem; color: var(--text-primary); line-height: 1.2; }
.ds-dag-step small { font-size: .65rem; color: var(--text-muted); line-height: 1.2; }

.ds-eval-table { display: grid; gap: 4px; }
.ds-eval-row { display: grid; grid-template-columns: 1.2fr 1.3fr 1.3fr auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 6px; background: var(--bg-surface); border: 1px solid var(--border-subtle); font-size: .72rem; }
.ds-eval-row.win-row { background: rgba(0, 245, 160, .06); border-color: rgba(0, 245, 160, .3); box-shadow: 0 0 14px rgba(0, 245, 160, .1); }
.ds-eval-row strong { font-size: .72rem; color: var(--text-primary); display: block; }
.ds-eval-row small { font-size: .68rem; color: var(--text-muted); }
.ds-eval-row .hb { margin: 0; grid-template-columns: 56px 1fr 28px; }

/* Slide 4: Delegation */
#delegation h2 { font-size: clamp(1.75rem, 1.1rem + 1.8vw, 2.35rem); line-height: 1.1; margin-bottom: 10px; }
#delegation .section-lead { font-size: .875rem; line-height: 1.4; margin-bottom: 8px; }
.tech-flow { gap: 5px; margin: 8px 0; }
.tech-flow li { padding: 5px 8px 5px 32px; font-size: .78rem; line-height: 1.35; }
.tech-flow li::before { top: 5px; }
.dp-step { display: grid; grid-template-columns: 20px 1fr auto 75px; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--border-subtle); opacity: .3; transition: opacity .4s; }
.dp-step.done { opacity: 1; }
.dp-step .no { font-family: var(--font-display); font-weight: 600; color: var(--blue-glow); }
.dp-step .txt { font-size: .78rem; color: var(--text-primary); }
.dp-step .txt small { display: block; color: var(--text-muted); font-size: .72rem; }
.dp-bar { height: 6px; border-radius: 999px; background: var(--bg-input); overflow: hidden; border: 1px solid var(--border-subtle); }
.dp-bar i { display: block; height: 100%; width: 0; background: var(--blue-glow); border-radius: 999px; transition: width .6s var(--ease); }
.dp-step.done .dp-bar i { width: var(--v); }
.dp-step[data-t="f"] .dp-bar i { background: var(--amber-glow); }
.dp-step[data-t="s"] .dp-bar i { background: var(--cyan-glow); }
.dp-esc { margin: 2px 0; padding: 4px 8px; border-left: 3px solid var(--amber-glow); background: rgba(251, 191, 36, .06); font-size: .72rem; color: var(--text-secondary); border-radius: 0 6px 6px 0; max-height: 0; opacity: 0; overflow: hidden; padding-block: 0; transition: max-height .5s var(--ease), opacity .4s, padding .4s; }
.dp-esc.show { max-height: 80px; opacity: 1; padding-block: 5px; }
.dp-total { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 6px; font-size: .78rem; color: var(--text-secondary); }
.dp-total b { font-family: var(--font-display); font-size: 1.2rem; color: var(--text-primary); margin-left: 6px; }
.dp-total b.g { color: var(--cyan-glow); }

.btn-micro { background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: .6875rem; padding: 2px 7px; border-radius: 4px; cursor: pointer; transition: all .2s cubic-bezier(0.16, 1, 0.3, 1); font-family: inherit; line-height: 1.2; }
.btn-micro:hover { color: var(--text-primary); border-color: var(--border-highlight); background: var(--bg-surface-elevated); transform: translateY(-1px); }
.btn-micro.active { color: var(--cyan-glow); border-color: var(--border-highlight); background: rgba(0, 245, 160, .08); font-weight: 600; }
.dp-workloads { display: flex; gap: 4px; }

/* Slide 5: Pilot & Setup */
#pilot h2.wide, #proof h2.wide { margin-bottom: 10px; font-size: clamp(1.75rem, 1.1rem + 1.8vw, 2.35rem); }
#pilot .split, #proof .split { gap: clamp(16px, 2.5vw, 32px); align-items: start; }
#pilot .cards, #proof .cards { display: grid; gap: 8px; margin-top: 0; }
#pilot .card, #proof .card { padding: 9px 12px; }
#pilot .card h3, #proof .card h3 { font-size: .84rem; margin-bottom: 2px; color: var(--text-primary); }
#pilot .card p, #proof .card p { font-size: .75rem; line-height: 1.35; margin: 0; color: var(--text-secondary); }
#pilot .table-scroll, #proof .table-scroll { margin-top: 0; }
#pilot table.t, #proof table.t { font-size: .78rem; }
#pilot table.t th, #proof table.t th { padding: 5px 8px; font-size: .72rem; }
#pilot table.t td, #proof table.t td { padding: 4px 8px; font-size: .76rem; line-height: 1.3; }
#pilot table.t td small, #proof table.t td small { color: var(--text-muted); font-size: .7rem; }
#pilot table.t td strong, #proof table.t td strong { font-size: .78rem; }
#pilot .fine, #proof .fine { margin-top: 6px; font-size: .72rem; }
#simulated h2 { margin-bottom: 8px; }
#simulated .section-lead { margin-bottom: 8px; }
#simulated .table-scroll { margin-top: 6px; }

/* Responsive adjustments for phones (<= 899px) */
@media (max-width: 899px) {
  #top h1 { font-size: 1.5rem; }
  #top .meta { font-size: .75rem; margin-top: 10px !important; }
  .tc-cols { gap: 8px; }
  .tc-col { padding: 10px; }
  .tc-col h3 { font-size: .875rem; margin-bottom: 6px; }
  .tc-att { min-height: 0; margin-bottom: 8px; gap: 4px; }
  .tc .hb { grid-template-columns: 1fr auto; margin: 3px 0; }
  .tc .hb .tr { grid-column: 1 / -1; grid-row: 2; height: 7px; }
  #equation .equation-big { font-size: 1.05rem; margin-bottom: 8px; }
  .eq-scale { display: none; }
  #recipes .section-lead { display: none; }
  #recipes .numlist { display: none; }
  .distil-tabs { gap: 3px; }
  .distil-tab { font-size: .625rem; padding: 2px 5px; }
  .ds-dag { grid-template-columns: 1fr 1fr; }
  .ds-eval-row { grid-template-columns: 1fr auto; }
  .ds-eval-row .hb { display: none; }
  #delegation h2 { font-size: 1.25rem; margin-bottom: 6px; }
  #delegation .section-lead { display: none; }
  #delegation .tech-flow { display: none; }
  #delegation .stat-row { display: none; }
  #delegation .dp-step { padding: 2px 0; }
  #delegation .dp-step .txt { font-size: .72rem; }
  #delegation .dp-step .txt small { font-size: .65rem; }
  #delegation .dp-esc { font-size: .65rem; }
  #delegation .dp-total { padding-top: 4px; font-size: .72rem; }
  #pilot h2.wide, #proof h2.wide { font-size: 1.25rem; margin-bottom: 6px; }
  #pilot .cards, #proof .cards { display: none; }
  #pilot .fine, #proof .fine { display: none; }
}
