/* =====================================================================
   The Biology of Hunger, Satiety, and Obesity
   A premium, interactive medical teaching deck.
   Design system — light, calm, spacious. 16:9, scaled to viewport.
   ===================================================================== */

:root{
  /* --- Palette (from the design brief) --- */
  --bg:            #F7F4FF;   /* very light lavender canvas   */
  --violet-soft:   #B8A7F2;   /* soft violet                  */
  --purple:        #8066D8;   /* primary purple               */
  --plum:          #493A78;   /* deep plum                    */
  --blue:          #7FA9D8;   /* muted blue (neural)          */
  --teal:          #65B8B3;   /* soft teal (inhibitory)       */
  --coral:         #E9877B;   /* warm coral (activating)      */
  --green:         #7FBF9B;   /* soft green (inhibitory)      */
  --gold:          #D8B66C;   /* pale gold (hormones)         */
  --ink:           #252238;   /* dark readable text           */

  /* Derived tints */
  --ink-soft:      #5b5570;
  --ink-faint:     #8b85a0;
  --line:          #E4DDF6;
  --line-strong:   #D3C8F0;
  --card:          #FFFFFF;
  --card-2:        #FCFAFF;
  --purple-050:    #F1ECFC;
  --purple-100:    #E7DEFB;
  --coral-050:     #FCEDEA;
  --teal-050:      #E7F5F4;
  --green-050:     #EAF6EF;
  --gold-050:      #F8F1DF;
  --blue-050:      #EAF1FA;

  --shadow-sm: 0 2px 8px rgba(73,58,120,.08);
  --shadow:    0 8px 30px rgba(73,58,120,.12);
  --shadow-lg: 0 20px 60px rgba(73,58,120,.20);

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;

  --sans: "Manrope","Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --body: "Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --label:"IBM Plex Sans","Inter",sans-serif;

  --stage-w: 1280px;
  --stage-h: 720px;
}

*{ box-sizing:border-box; }
html,body{ margin:0; height:100%; }
body{
  font-family:var(--body);
  color:var(--ink);
  background:
    radial-gradient(1200px 700px at 15% -10%, #EFEAFF 0%, transparent 55%),
    radial-gradient(1000px 700px at 100% 110%, #ECF3FF 0%, transparent 55%),
    var(--bg);
  overflow:hidden;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

/* =====================================================================
   Stage — a fixed 16:9 canvas scaled to fit the viewport via JS var.
   ===================================================================== */
#stage-wrap{
  position:fixed; inset:0;
  display:grid; place-items:center;
}
#stage{
  position:relative;
  width:var(--stage-w); height:var(--stage-h);
  transform:scale(var(--scale,1));
  transform-origin:center center;
}

.slide{
  position:absolute; inset:0;
  padding:42px 60px 40px;
  display:none;
  flex-direction:column;
  opacity:0;
}
.slide.active{ display:flex; animation:slideIn .5s cubic-bezier(.22,.9,.3,1) both; opacity:1; }
.reduce-motion .slide.active{ animation:none; }
@keyframes slideIn{
  from{ opacity:0; transform:translateY(14px) scale(.995); }
  to{   opacity:1; transform:none; }
}

/* =====================================================================
   Typography
   ===================================================================== */
.kicker{
  font-family:var(--label);
  text-transform:uppercase; letter-spacing:.16em;
  font-size:15px; font-weight:600; color:var(--purple);
  display:inline-flex; align-items:center; gap:10px;
}
.kicker::before{
  content:""; width:26px; height:2px; border-radius:2px;
  background:linear-gradient(90deg,var(--purple),var(--violet-soft));
}
h1,h2,h3{ font-family:var(--sans); font-weight:800; color:var(--plum); margin:0; line-height:1.08; }
.slide h2{ font-size:35px; letter-spacing:-.01em; }
.slide h3{ font-size:21px; font-weight:700; }
.sub{ color:var(--ink-soft); font-size:18px; font-weight:500; margin-top:5px; }
p{ margin:0; }
.accent{ color:var(--purple); font-weight:700; }
.slide-head{ margin-bottom:14px; flex:0 0 auto; }
.slide-head h2{ margin-top:6px; }

.body-scroll{ flex:1 1 auto; min-height:0; }

/* =====================================================================
   Cards, grids, generic layout
   ===================================================================== */
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--shadow-sm);
  padding:17px 20px;
}
.card.pad-lg{ padding:22px 26px; }
.card h3{ margin-bottom:5px; }
.grid{ display:grid; gap:16px; }
.g-2{ grid-template-columns:repeat(2,1fr); }
.g-3{ grid-template-columns:repeat(3,1fr); }
.g-4{ grid-template-columns:repeat(4,1fr); }
.cols{ display:flex; gap:22px; }
.col{ flex:1; min-width:0; }
.row{ display:flex; gap:14px; align-items:center; }
.center{ align-items:center; justify-content:center; }
.mt-s{ margin-top:9px; } .mt-m{ margin-top:14px; } .mt-l{ margin-top:20px; }
.fill{ flex:1 1 auto; }

/* Pills / chips / tags */
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 14px; border-radius:999px;
  font-size:14px; font-weight:600; font-family:var(--label);
  background:var(--purple-050); color:var(--plum);
  border:1px solid var(--line-strong);
}
.tag{ display:inline-block; padding:3px 10px; border-radius:8px; font-size:13px; font-weight:700; font-family:var(--label); }
.tag-coral{ background:var(--coral-050); color:#b8544a; }
.tag-teal{  background:var(--teal-050);  color:#2f7c77; }
.tag-green{ background:var(--green-050); color:#3d8a63; }
.tag-gold{  background:var(--gold-050);  color:#9c7d33; }
.tag-purple{background:var(--purple-050);color:var(--plum); }
.tag-blue{  background:var(--blue-050);  color:#3f6ea8; }

/* Number badges */
.num{
  flex:0 0 auto;
  width:38px; height:38px; border-radius:50%;
  display:grid; place-items:center;
  font-family:var(--sans); font-weight:800; font-size:18px;
  color:#fff; background:linear-gradient(135deg,var(--purple),var(--violet-soft));
  box-shadow:0 4px 12px rgba(128,102,216,.35);
}

/* Metric figures */
.metric .figure{ font-family:var(--sans); font-weight:800; font-size:46px; color:var(--purple); line-height:1; }
.metric .label{ color:var(--ink-soft); font-size:15px; margin-top:6px; }

/* Icon bubble */
.ibubble{
  width:44px; height:44px; border-radius:12px; flex:0 0 auto;
  display:grid; place-items:center;
  background:var(--purple-050); color:var(--purple);
}
.ibubble svg{ width:24px; height:24px; }
.ibubble.coral{ background:var(--coral-050); color:#c85f53; }
.ibubble.teal{ background:var(--teal-050); color:#2f8f89; }
.ibubble.green{ background:var(--green-050); color:#43966d; }
.ibubble.gold{ background:var(--gold-050); color:#a7842f; }
.ibubble.blue{ background:var(--blue-050); color:#4276b0; }

/* Lists */
ul.clean{ list-style:none; margin:0; padding:0; }
ul.clean li{ display:flex; gap:10px; align-items:flex-start; padding:5px 0; font-size:16px; color:var(--ink-soft); }
ul.clean li::before{ content:""; margin-top:9px; width:7px; height:7px; border-radius:50%; background:var(--violet-soft); flex:0 0 auto; }
ul.clean.coral li::before{ background:var(--coral); }
ul.clean.teal  li::before{ background:var(--teal); }
ul.clean.green li::before{ background:var(--green); }
ul.clean li b{ color:var(--ink); font-weight:700; }

/* Callouts */
.callout{
  display:flex; gap:14px; align-items:center;
  padding:16px 20px; border-radius:var(--r);
  background:linear-gradient(120deg,var(--purple-050),#fff);
  border:1px solid var(--line-strong);
}
.callout .ibubble{ background:#fff; }
.callout .k{ font-family:var(--label); font-weight:700; color:var(--purple); font-size:14px; text-transform:uppercase; letter-spacing:.08em; }
.callout .t{ font-size:18px; color:var(--ink); font-weight:600; }
.callout.warn{ background:linear-gradient(120deg,var(--coral-050),#fff); border-color:#f2ceca; }
.callout.warn .k{ color:#c05a4e; }

/* Key-idea banner (dark accent, used sparingly) */
.keyidea{
  margin-top:auto;
  display:flex; gap:15px; align-items:center;
  padding:13px 22px; border-radius:var(--r);
  background:linear-gradient(120deg,var(--plum),#5b4a92);
  color:#fff; box-shadow:var(--shadow);
}
.keyidea .ic{ width:40px; height:40px; flex:0 0 auto; display:grid; place-items:center;
  border-radius:12px; background:rgba(255,255,255,.14); }
.keyidea .ic svg{ width:24px; height:24px; color:#fff; }
.keyidea .lab{ font-family:var(--label); text-transform:uppercase; letter-spacing:.12em; font-size:11.5px; opacity:.75; }
.keyidea .msg{ font-size:18px; font-weight:700; font-family:var(--sans); line-height:1.2; }

/* =====================================================================
   Signal legend (consistent physiology visual language)
   ===================================================================== */
.legend{ display:flex; flex-wrap:wrap; gap:14px 22px; }
.legend .item{ display:flex; align-items:center; gap:9px; font-size:14px; color:var(--ink-soft); font-weight:600; }
.sig{ width:34px; height:0; border-top:3px solid; position:relative; }
.sig.stim{ border-color:var(--coral); }
.sig.inhib{ border-color:var(--green); }
.sig.neural{ border-top-style:dashed; border-color:var(--blue); }
.sig.hormone{ border-color:var(--gold); }
.sig.feedforward{ border-top-style:dashed; border-color:var(--purple); }
.badge-sign{ width:20px; height:20px; border-radius:50%; display:inline-grid; place-items:center; color:#fff; font-weight:800; font-size:13px; font-family:var(--sans); }
.badge-sign.plus{ background:var(--coral); }
.badge-sign.minus{ background:var(--green); }

/* =====================================================================
   Progressive-reveal steps
   ===================================================================== */
.step{
  opacity:0; transform:translateY(10px);
  transition:opacity .45s ease, transform .45s cubic-bezier(.22,.9,.3,1);
  will-change:opacity,transform;
}
.step.shown{ opacity:1; transform:none; }
.reduce-motion .step{ transition:none; }
/* variant reveals */
.step.grow{ transform:scale(.9); }
.step.grow.shown{ transform:scale(1); }
.step.fade{ transform:none; }

/* =====================================================================
   Pathway diagram (horizontal node → arrow → node flow)
   ===================================================================== */
.pathway{ display:flex; align-items:stretch; gap:0; flex-wrap:wrap; }
.pnode{
  position:relative; flex:1 1 0; min-width:0;
  background:var(--card); border:1.5px solid var(--line-strong);
  border-radius:var(--r); padding:12px 13px 11px; text-align:center;
  display:flex; flex-direction:column; align-items:center; gap:6px;
}
.pnode .icon{ width:44px; height:44px; border-radius:12px; display:grid; place-items:center; background:var(--purple-050); color:var(--purple); }
.pnode .icon svg{ width:26px; height:26px; }
.pnode .name{ font-family:var(--sans); font-weight:800; font-size:15px; color:var(--plum); line-height:1.12; }
.pnode .cap{ font-size:12px; color:var(--ink-soft); line-height:1.28; }
.pnode.active-node{ border-color:var(--purple); box-shadow:0 0 0 4px rgba(128,102,216,.14); }
.pnode.stim{ border-color:var(--coral); } .pnode.stim .icon{ background:var(--coral-050); color:#c85f53; }
.pnode.inhib{ border-color:var(--green); } .pnode.inhib .icon{ background:var(--green-050); color:#43966d; }
.pnode.hormone .icon{ background:var(--gold-050); color:#a7842f; }
.pnode.neural .icon{ background:var(--blue-050); color:#4276b0; }
.parrow{
  flex:0 0 34px; align-self:center; height:34px;
  display:grid; place-items:center; color:var(--violet-soft);
}
.parrow svg{ width:26px; height:26px; }
.parrow.stim{ color:var(--coral); }
.parrow.inhib{ color:var(--green); }
@keyframes pulseGlow{ 0%,100%{ box-shadow:0 0 0 0 rgba(128,102,216,.28);} 50%{ box-shadow:0 0 0 8px rgba(128,102,216,0);} }
.pnode.pulse.shown{ animation:pulseGlow 1.6s ease-out 1; }
.reduce-motion .pnode.pulse.shown{ animation:none; }

/* ---- Realistic organ imagery (generated transparent cutouts) ---- */
.organ-fig{ display:block; width:auto; object-fit:contain;
  filter:drop-shadow(0 12px 18px rgba(73,58,120,.24)); }
.pnode .organ-fig{ height:96px; margin:2px auto 4px; }
.pnode.organ-node{ padding-top:16px; gap:8px; }
.pnode.organ-node .name{ font-size:17px; }
.pnode.organ-node .cap{ font-size:12.5px; }
/* small inline organ beside a label / tag */
.organ-chip{ height:34px; width:auto; object-fit:contain; vertical-align:middle;
  filter:drop-shadow(0 4px 7px rgba(73,58,120,.22)); }
/* Generated transparent concept icons (replace mismatched inline SVG tiles) */
.concept-icon{ height:48px; width:auto; object-fit:contain; flex:0 0 auto;
  filter:drop-shadow(0 6px 10px rgba(73,58,120,.20)); }

/* Molecular token language — small ligand/receptor chips beside labels */
.mol-chip{ height:34px; width:auto; object-fit:contain; vertical-align:middle;
  filter:drop-shadow(0 4px 7px rgba(73,58,120,.22)); }
/* Token image that replaces a flat SVG icon-bubble WITHOUT growing node height */
.mol-ic{ height:52px; width:auto; object-fit:contain; display:block; margin:0 auto 2px;
  filter:drop-shadow(0 5px 8px rgba(73,58,120,.22)); }

/* Task 3 — reserve space so bottom strips clear the fixed footer */
.slide > .keyidea, .slide > .callout{ margin-bottom:40px; }

/* Compact overloaded content slides so nothing clips past 720px */
.slide.compact .card{ padding:10px 15px; }
/* body-scroll is flex:1 and fills all height — reserve a bottom safe-area so its
   bottom edge (and any height:100% cards inside) clears the footer + nav toolbar */
.slide.compact .body-scroll{ margin-bottom:36px; }
.slide.compact .slide-head{ margin-bottom:8px; }
.slide.compact ul.clean li{ padding:2px 0; line-height:1.32; }
.slide.compact .mrow-lite{ padding:5px 10px; }
.slide.compact .anim-figure figcaption{ margin:0; }

/* Trailing non-callout rows also need to clear the fixed footer */
.slide > .cols.foot-safe{ margin-bottom:40px; }

/* Embedded concept animations (ready mp4 clips) */
.anim-figure{ display:flex; flex-direction:column; align-items:center; gap:7px; margin:0 auto; }
.anim-figure figcaption{ font-family:var(--label); font-size:13px; font-weight:600;
  color:var(--ink-soft); text-transform:uppercase; letter-spacing:.05em; text-align:center; }
.anim-video{ width:100%; border-radius:18px;
  box-shadow:0 20px 40px -18px rgba(73,58,120,.4); display:block; }
/* larger side figure floating on the canvas */
.organ-side{ width:auto; object-fit:contain;
  filter:drop-shadow(0 16px 26px rgba(73,58,120,.26)); }

/* hover-to-highlight: hovering a pathway dims the rest, pops the focused node */
.pathway:hover .pnode{ opacity:.48; transition:opacity .2s ease, box-shadow .2s ease, border-color .2s ease; }
.pathway:hover .pnode:hover{ opacity:1; border-color:var(--purple); box-shadow:0 0 0 4px rgba(128,102,216,.16); }
.reduce-motion .pathway:hover .pnode{ transition:none; }

/* vertical cascade (receptor → 2nd messenger chain) */
.cascade{ display:flex; flex-direction:column; gap:6px; }
.cascade .lvl{
  background:var(--purple-050); border:1px solid var(--line-strong);
  border-radius:10px; padding:7px 14px; text-align:center;
  font-family:var(--label); font-weight:700; color:var(--plum); font-size:14.5px;
}
.cascade .down{ align-self:center; color:var(--purple); font-size:13px; line-height:1; }

/* =====================================================================
   Title slide
   ===================================================================== */
.slide-title{ padding:0; }
.hero-wrap{ position:absolute; inset:0; display:grid; grid-template-columns:1.05fr .95fr; }
.hero-left{ padding:70px 20px 70px 74px; display:flex; flex-direction:column; justify-content:center; z-index:2; }
.hero-eyebrow{ font-family:var(--label); letter-spacing:.22em; text-transform:uppercase; font-size:14px; color:var(--purple); font-weight:600; }
.hero-title{ font-family:var(--sans); font-weight:800; font-size:58px; line-height:1.04; color:var(--plum); margin:18px 0 0; letter-spacing:-.02em; }
.hero-title .em{ background:linear-gradient(100deg,var(--purple),var(--violet-soft) 60%,var(--blue)); -webkit-background-clip:text; background-clip:text; color:transparent; }
.hero-sub{ font-size:22px; color:var(--ink-soft); margin-top:18px; max-width:30ch; font-weight:500; }
.hero-rule{ width:70px; height:4px; border-radius:4px; margin:30px 0 26px; background:linear-gradient(90deg,var(--coral),var(--gold)); }
.hero-presenter .nm{ font-family:var(--sans); font-weight:800; font-size:24px; color:var(--ink); }
.hero-presenter .rl{ font-size:17px; color:var(--ink-soft); margin-top:3px; }
.hero-presenter .inst{ font-size:16px; color:var(--purple); font-weight:600; margin-top:2px; }
.hero-right{ position:relative; overflow:hidden; }
.hero-img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:58% 50%; display:block;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 16%,#000 100%);
          mask-image:linear-gradient(90deg,transparent 0,#000 16%,#000 100%); }

/* =====================================================================
   Section dividers
   ===================================================================== */
.slide-section{ justify-content:center; position:relative; overflow:hidden; }
/* generated art bleeds off the right, edges feathered so it melts into the canvas (no box) */
.section-art{ position:absolute; right:-4%; top:50%; transform:translateY(-50%);
  width:54%; height:62%; object-fit:cover; z-index:0; pointer-events:none;
  -webkit-mask-image:linear-gradient(to right, transparent 0, #000 32%),
                     linear-gradient(to bottom, transparent 0, #000 15%, #000 85%, transparent 100%);
  -webkit-mask-composite:source-in;
          mask-image:linear-gradient(to right, transparent 0, #000 32%),
                     linear-gradient(to bottom, transparent 0, #000 15%, #000 85%, transparent 100%);
          mask-composite:intersect; }
.slide-section > :not(.section-art):not(.ambiance-canvas){ position:relative; z-index:1; max-width:56%; }

/* Subtle organ/concept accent — a soft flourish bleeding off a corner, behind content */
.slide-accent{ position:absolute; z-index:0; pointer-events:none; width:300px; height:300px; object-fit:contain; opacity:.5;
  -webkit-mask-image:radial-gradient(62% 62% at 50% 50%, #000 42%, transparent 72%);
          mask-image:radial-gradient(62% 62% at 50% 50%, #000 42%, transparent 72%); }
.slide-accent.br{ right:-70px; bottom:-64px; }
.slide-accent.tr{ right:-70px; top:-46px; }
.slide:not(.slide-section):not(.slide-title) > :not(.slide-accent){ position:relative; z-index:1; }
.section-index{ font-family:var(--sans); font-weight:800; font-size:120px; line-height:.9;
  background:linear-gradient(160deg,var(--purple-100),var(--purple)); -webkit-background-clip:text; background-clip:text; color:transparent; opacity:.9; }
.section-title{ font-family:var(--sans); font-weight:800; font-size:56px; color:var(--plum); letter-spacing:-.015em; margin-top:4px; }
.section-sub{ font-size:21px; color:var(--ink-soft); margin-top:16px; max-width:44ch; }
.section-toc{ margin-top:34px; display:flex; gap:10px; flex-wrap:wrap; }
.section-toc .tocchip{ font-family:var(--label); font-size:14px; padding:7px 14px; border-radius:999px; background:#fff; border:1px solid var(--line); color:var(--ink-soft); }
.section-toc .tocchip.on{ background:var(--purple); color:#fff; border-color:var(--purple); box-shadow:var(--shadow-sm); }

/* =====================================================================
   Statement slide (soft plum full-bleed, used rarely)
   ===================================================================== */
.slide-statement{ background:linear-gradient(135deg,var(--plum),#5a4890 55%,#6f5ab0); justify-content:center; align-items:flex-start; }
.slide-statement .kicker{ color:#d9ccff; }
.slide-statement .kicker::before{ background:linear-gradient(90deg,#d9ccff,transparent); }
.slide-statement .big{ font-family:var(--sans); font-weight:800; color:#fff; font-size:46px; line-height:1.14; max-width:22ch; margin-top:14px; }
.slide-statement .big .u{ color:var(--gold); }
.slide-statement .attrib{ color:#cdbdf5; margin-top:22px; font-size:18px; }

/* =====================================================================
   Interactive medication mechanism map
   ===================================================================== */
.medmap{ display:grid; grid-template-columns:290px 1fr; gap:22px; height:100%; min-height:0; }
.med-list{ display:flex; flex-direction:column; gap:7px; }
.med-btn{
  text-align:left; cursor:pointer; font:inherit;
  display:flex; align-items:center; gap:11px;
  padding:7px 14px; border-radius:11px;
  background:var(--card); border:1.5px solid var(--line);
  color:var(--ink); transition:all .18s ease;
}
.med-btn .mn{ line-height:1.15; }
.med-btn .mc{ line-height:1.1; }
.med-btn:hover{ border-color:var(--violet-soft); transform:translateX(2px); }
.med-btn.on{ border-color:var(--purple); background:var(--purple-050); box-shadow:var(--shadow-sm); }
.med-btn .dot{ width:11px; height:11px; border-radius:50%; flex:0 0 auto; }
.med-btn .mn{ font-weight:700; font-size:15px; }
.med-btn .mc{ font-size:12px; color:var(--ink-faint); }
.med-detail{ position:relative; background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-sm); padding:26px 30px; overflow:auto; }
.med-detail h3{ font-size:26px; }
.med-detail .mrow{ display:flex; gap:10px; align-items:baseline; padding:7px 0; border-bottom:1px dashed var(--line); font-size:15px; }
.med-detail .mrow .lab{ flex:0 0 150px; font-family:var(--label); font-weight:700; color:var(--purple); font-size:13px; text-transform:uppercase; letter-spacing:.04em; }
.med-detail .mrow .val{ color:var(--ink-soft); }
.med-detail .mrow .val b{ color:var(--ink); }
.effect-badges{ display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }

/* Up / down arrows for physiology direction */
.dir{ font-weight:800; font-family:var(--sans); }
.dir.up{ color:var(--coral); }
.dir.down{ color:var(--teal); }

/* =====================================================================
   Circular loop (weight-regain vicious cycle)
   ===================================================================== */
.loopwrap{ position:relative; width:600px; height:470px; margin:0 auto; }
.loop-center{ position:absolute; left:300px; top:235px; transform:translate(-50%,-50%);
  width:132px; height:132px; border-radius:50%; display:grid; place-items:center; text-align:center; padding:0 14px;
  background:radial-gradient(circle at 40% 30%, #fff, var(--coral-050));
  border:2px solid var(--coral); color:#b8544a; font-weight:800; font-family:var(--sans); font-size:15px; line-height:1.15; box-shadow:var(--shadow); z-index:3; }
/* labels sit OUTSIDE the ring, anchored radially so they never touch the hub.
   The anchoring transform lives on the wrapper (never a .step), because .step's
   reveal resets transform:none and would otherwise wipe the anchor out. */
.loop-node{ position:absolute; width:152px; z-index:2; }
.loop-node.ln-top{    transform:translate(-50%,-100%); }
.loop-node.ln-bottom{ transform:translate(-50%,0); }
.loop-node.ln-right{  transform:translate(0,-50%); }
.loop-node.ln-left{   transform:translate(-100%,-50%); }
.loop-box{
  background:var(--card); border:1.5px solid var(--line-strong); border-radius:12px;
  padding:9px 13px; box-shadow:var(--shadow-sm);
}
.ln-top .loop-box, .ln-bottom .loop-box{ text-align:center; }
.ln-right .loop-box{ text-align:left; }
.ln-left .loop-box{ text-align:right; }
.loop-box .ln-t{ font-weight:700; font-size:14px; color:var(--plum); }
.loop-box .ln-s{ font-size:12px; color:var(--ink-faint); margin-top:1px; }
.loop-dot{ fill:var(--coral); }

/* =====================================================================
   Speaker notes
   ===================================================================== */
#notes{
  position:fixed; left:0; right:0; bottom:0; z-index:60;
  background:rgba(37,34,56,.97); color:#efeaff;
  padding:22px 32px 26px; box-shadow:0 -10px 40px rgba(0,0,0,.3);
  transform:translateY(102%); transition:transform .35s cubic-bezier(.22,.9,.3,1);
  max-height:44vh; overflow:auto;
}
#notes.open{ transform:none; }
#notes .nh{ font-family:var(--label); text-transform:uppercase; letter-spacing:.14em; font-size:12px; color:var(--violet-soft); margin-bottom:8px; }
#notes .nb{ font-size:16.5px; line-height:1.55; max-width:none; }
#notes .nb b{ color:#fff; }
#notes .nb ul{ margin:8px 0 0; padding-left:20px; }
#notes .nb li{ margin:3px 0; }

/* =====================================================================
   Chrome: progress, controls, footer, overview
   ===================================================================== */
#topbar{ position:fixed; top:0; left:0; right:0; height:4px; z-index:50; background:transparent; }
#progress{ height:100%; width:0; background:linear-gradient(90deg,var(--coral),var(--purple),var(--blue)); transition:width .4s ease; }

.deck-logo{ position:fixed; right:22px; top:16px; z-index:40; display:flex; align-items:center; gap:9px;
  font-family:var(--sans); font-weight:800; color:var(--plum); font-size:15px; opacity:.9; }
.deck-logo .mk{ width:26px; height:26px; border-radius:8px; background:linear-gradient(135deg,var(--purple),var(--violet-soft)); display:grid; place-items:center; color:#fff; }
.deck-logo .mk svg{ width:16px; height:16px; }

#footer{ position:fixed; left:22px; bottom:14px; z-index:40; display:flex; align-items:center; gap:12px; color:var(--ink-faint); font-size:12.5px; font-family:var(--label); }
#footer .sep{ opacity:.4; }
#slidecount{ font-variant-numeric:tabular-nums; }

#controls{ position:fixed; right:20px; bottom:16px; z-index:45; display:flex; align-items:center; gap:8px; }
.ctl{ width:40px; height:40px; border-radius:11px; border:1px solid var(--line); background:rgba(255,255,255,.85); backdrop-filter:blur(8px);
  color:var(--plum); display:grid; place-items:center; cursor:pointer; transition:all .15s ease; }
.ctl:hover{ border-color:var(--violet-soft); color:var(--purple); box-shadow:var(--shadow-sm); }
.ctl svg{ width:20px; height:20px; }
.ctl.wide{ width:auto; padding:0 14px; gap:8px; font-family:var(--label); font-weight:700; font-size:13px; }
.ctl[aria-pressed="true"]{ background:var(--purple); color:#fff; border-color:var(--purple); }

/* step dots */
#stepdots{ position:fixed; left:50%; transform:translateX(-50%); bottom:18px; z-index:45; display:flex; gap:7px; }
#stepdots .d{ width:8px; height:8px; border-radius:50%; background:var(--line-strong); transition:all .2s ease; }
#stepdots .d.on{ background:var(--purple); transform:scale(1.25); }
#stepdots.hide{ display:none; }

/* Overview / navigator */
#overview{ position:fixed; inset:0; z-index:70; background:rgba(247,244,255,.97); backdrop-filter:blur(6px);
  display:none; padding:56px 60px; overflow:auto; }
#overview.open{ display:block; }
#overview h2{ font-size:26px; margin-bottom:6px; }
#overview .ov-sub{ color:var(--ink-soft); margin-bottom:26px; }
.ov-grid{ display:grid; grid-template-columns:repeat(5,1fr); gap:16px; }
.ov-card{ cursor:pointer; background:#fff; border:1.5px solid var(--line); border-radius:14px; padding:14px 15px; min-height:96px;
  display:flex; flex-direction:column; gap:6px; transition:all .15s ease; }
.ov-card:hover{ border-color:var(--purple); transform:translateY(-3px); box-shadow:var(--shadow); }
.ov-card.cur{ border-color:var(--purple); box-shadow:0 0 0 3px rgba(128,102,216,.18); }
.ov-card .ov-n{ font-family:var(--label); font-size:12px; color:var(--purple); font-weight:700; }
.ov-card .ov-t{ font-weight:700; font-size:14px; color:var(--plum); line-height:1.2; }
.ov-card .ov-sec{ margin-top:auto; font-size:11px; color:var(--ink-faint); font-family:var(--label); text-transform:uppercase; letter-spacing:.06em; }

/* Section-divider ("chapter cover") tiles — filled purple so chapter
   boundaries jump out of the grid of white content cards. Text colors are
   re-set below for readability on the dark ground, and the current-slide
   ring is boosted so it stays visible on the purple fill. */
.ov-card.ov-section{ background:linear-gradient(150deg,var(--purple),var(--plum));
  border-color:var(--purple); border-left:5px solid var(--violet-soft); }
.ov-card.ov-section:hover{ border-color:var(--violet-soft); box-shadow:var(--shadow-lg); }
.ov-card.ov-section .ov-n{ color:var(--purple-100); }
.ov-card.ov-section .ov-t{ color:#fff; }
.ov-card.ov-section .ov-sec{ color:rgba(255,255,255,.72); }
.ov-card.ov-section.cur{ border-color:#fff; box-shadow:0 0 0 3px rgba(255,255,255,.85); }

/* small-print sources */
.sources{ font-size:12.5px; color:var(--ink-faint); line-height:1.5; }
.sources b{ color:var(--ink-soft); }
.disclaimer{ background:var(--purple-050); border:1px solid var(--line-strong); border-radius:var(--r); padding:16px 20px; font-size:15px; color:var(--ink-soft); }

/* inline signal rows */
.mrow-lite{ display:flex; align-items:center; gap:10px; font-size:15px; color:var(--ink-soft); padding:8px 12px; background:var(--card-2); border:1px solid var(--line); border-radius:10px; }

/* misc helpers */
.mono{ font-family:"IBM Plex Mono",ui-monospace,monospace; }
.small{ font-size:13px; } .muted{ color:var(--ink-faint); }
.hr{ height:1px; background:var(--line); margin:14px 0; border:0; }
.nowrap{ white-space:nowrap; }

/* When served by review.py, the pencil panel is injected — keep our chrome clear of it via z-index already set. */

/* Hint toast */
#hint{ position:fixed; left:50%; bottom:70px; transform:translateX(-50%); z-index:48;
  background:rgba(37,34,56,.92); color:#fff; padding:10px 18px; border-radius:999px; font-size:13.5px; font-family:var(--label);
  display:flex; gap:10px; align-items:center; box-shadow:var(--shadow); transition:opacity .4s ease; }
#hint kbd{ background:rgba(255,255,255,.18); border-radius:6px; padding:2px 7px; font-family:var(--label); font-size:12px; }
#hint.gone{ opacity:0; pointer-events:none; }

/* fullscreen tweaks: hide review chrome handled by review.js; our controls stay */
:fullscreen #hint{ display:none; }

/* Reveal-all mode (?all) — every step visible at once; also used for PDF export */
.reveal-all .step{ opacity:1 !important; transform:none !important; }

/* =====================================================================
   INTERACTIVITY LAYER (added) — ambiance, checkpoints, what-if, organ explorer
   Self-contained; uses only existing palette tokens.
   ===================================================================== */

/* --- Subtle mouse ambiance (lavender particle field) --- */
.ambiance-canvas{
  position:absolute !important; inset:0 !important; width:100% !important; height:100% !important;
  max-width:none !important; z-index:0 !important; pointer-events:none; display:block;
}

/* --- Checkpoint MCQ --- */
.quiz-intro{ font-size:16px; color:var(--ink-soft); margin-bottom:14px; max-width:70ch; }
.quiz-q{ font-family:var(--sans); font-weight:800; font-size:23px; color:var(--plum); line-height:1.18;
  margin-bottom:16px; max-width:44ch; }
.quiz-options{ display:flex; flex-direction:column; gap:11px; max-width:860px; }
.quiz-opt{
  display:flex; align-items:center; gap:14px; text-align:left; width:100%; cursor:pointer; font:inherit;
  font-family:var(--body); font-size:17px; color:var(--ink);
  background:var(--card); border:1.5px solid var(--line); border-radius:12px; padding:13px 18px;
  transition:border-color .18s ease, background .18s ease, transform .12s ease;
}
.quiz-opt:hover{ border-color:var(--violet-soft); transform:translateX(2px); }
.quiz-key{ flex:0 0 auto; width:30px; height:30px; display:grid; place-items:center; border-radius:8px;
  font-family:var(--sans); font-weight:800; font-size:15px; color:var(--purple);
  background:var(--purple-050); border:1px solid var(--line-strong); }
.quiz-opt.correct{ border-color:var(--green); background:var(--green-050);
  animation:quizPop .42s cubic-bezier(.2,1.3,.4,1) both; }
.quiz-opt.correct .quiz-key{ color:#3d8a63; background:rgba(127,191,155,.24); border-color:var(--green); }
.quiz-opt.wrong{ border-color:var(--coral); background:var(--coral-050); }
.quiz-opt.wrong .quiz-key{ color:#b8544a; background:rgba(233,135,123,.24); border-color:var(--coral); }
.quiz-opt.dim{ opacity:.5; }
.quiz-opt.locked{ cursor:default; }
.quiz-opt.locked:hover{ transform:none; }
@keyframes quizPop{ 0%{ transform:scale(1);} 45%{ transform:scale(1.025);} 100%{ transform:scale(1);} }
.reduce-motion .quiz-opt.correct{ animation:none; }
.reduce-motion .quiz-opt:hover{ transform:none; }
.quiz-feedback{ margin-top:18px; font-family:var(--sans); font-weight:700; font-size:17px;
  color:var(--ink-soft); min-height:1.4em; max-width:820px; line-height:1.4;
  opacity:0; transform:translateY(6px); transition:opacity .3s ease, transform .3s ease; }
.quiz-feedback.show{ opacity:1; transform:none; }
.quiz-feedback.ok{ color:#3d8a63; }
.quiz-feedback.no{ color:#b8544a; }
.reduce-motion .quiz-feedback{ transition:none; }
.quiz-score-pill{ background:var(--purple); color:#fff; border-color:var(--purple);
  box-shadow:var(--shadow-sm); }

/* --- "Defended weight" what-if panel --- */
.wi-panel{ background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow-sm); padding:13px 16px; }
.wi-panel .wi-h{ font-family:var(--label); font-size:11.5px; font-weight:700; text-transform:uppercase;
  letter-spacing:.07em; color:var(--purple); margin-bottom:9px; }
.wi-row{ margin-bottom:9px; }
.wi-row label{ display:flex; justify-content:space-between; align-items:baseline;
  font-size:13.5px; color:var(--ink-soft); margin-bottom:3px; }
.wi-row label b{ color:var(--purple); font-family:var(--sans); font-size:15px; }
.wi-row input[type=range]{ width:100%; accent-color:var(--purple); height:20px; cursor:ew-resize; margin:0; }
.wi-out{ display:flex; gap:9px; margin-top:4px; }
.wi-metric{ flex:1; background:var(--card-2); border:1px solid var(--line); border-radius:10px;
  padding:7px 9px; text-align:center; }
.wi-lab{ display:block; font-size:10.5px; color:var(--ink-faint); font-family:var(--label);
  text-transform:uppercase; letter-spacing:.05em; }
.wi-val{ font-family:var(--sans); font-weight:800; font-size:14.5px; line-height:1.25; }
.wi-val .ar{ font-size:16px; }
.wi-val.up{ color:var(--coral); } .wi-val.down{ color:var(--teal); }
.wi-pressure{ margin-top:11px; }
.wi-pbar{ height:12px; border-radius:999px; background:var(--purple-050);
  overflow:hidden; border:1px solid var(--line); }
.wi-pbar span{ display:block; height:100%; width:40%; border-radius:999px;
  background:linear-gradient(90deg,var(--gold),var(--coral)); transition:width .3s ease; }
.reduce-motion .wi-pbar span{ transition:none; }
.wi-plabel{ font-size:13px; margin-top:5px; color:var(--ink-soft); }
.wi-plabel b{ font-family:var(--sans); color:var(--plum); }

/* --- Organ explorer (gut–brain–adipose axis) --- */
.signal-list{ display:flex; flex-direction:column; gap:5px; margin-top:8px; }
.signal-chip{ display:flex; align-items:center; gap:10px; text-align:left; cursor:pointer; font:inherit;
  background:var(--card); border:1.5px solid var(--line); border-radius:10px; padding:4px 11px; color:var(--ink);
  transition:border-color .18s ease, background .18s ease, transform .12s ease; }
.signal-chip:hover{ border-color:var(--violet-soft); transform:translateX(2px); }
.signal-chip.on{ border-color:var(--purple); background:var(--purple-050); box-shadow:var(--shadow-sm); }
.reduce-motion .signal-chip:hover{ transform:none; }
.signal-chip img{ height:23px; width:28px; object-fit:contain; flex:0 0 auto;
  filter:drop-shadow(0 3px 5px rgba(73,58,120,.22)); }
.signal-chip .sc-n{ font-family:var(--sans); font-weight:700; font-size:14.5px; color:var(--plum); }
.signal-detail{ background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow-sm); padding:12px 15px; margin-top:9px; }
.signal-detail .sd-sig{ display:flex; flex-wrap:wrap; gap:7px; align-items:center; margin:2px 0 9px; }
.signal-detail .sd-row{ font-size:13.5px; color:var(--ink-soft); line-height:1.4; margin-top:6px; }
.signal-detail .sd-row b{ color:var(--ink); }
.signal-detail .sd-lab{ display:inline-block; font-family:var(--label); font-size:10.5px; font-weight:700;
  text-transform:uppercase; letter-spacing:.05em; color:var(--purple); margin-right:6px; }

/* Print → one slide per page, fully revealed */
@media print{
  body{ overflow:visible; background:#fff; }
  #stage-wrap{ position:static; display:block; }
  #stage{ width:auto; height:auto; transform:none !important; }
  .slide{ position:relative !important; display:flex !important; opacity:1 !important;
    width:1280px; height:720px; page-break-after:always; break-after:page; animation:none; box-shadow:none; }
  .slide .step{ opacity:1 !important; transform:none !important; }
  #topbar,#controls,#footer,#stepdots,#notes,#overview,#hint,.deck-logo{ display:none !important; }
}

/* --- Calorie simulator rows --- */
.calrow{ display:flex; align-items:center; gap:10px; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:7px 12px; box-shadow:var(--shadow-sm); }
.calrow .crn{ font-family:var(--label); font-weight:700; font-size:14px; color:var(--plum); flex:0 0 auto; min-width:140px; }
.calrow .cra{ font-family:var(--sans); font-weight:800; font-size:16px; flex:0 0 42px; text-align:center; }
.calrow .crbar{ flex:1; height:10px; border-radius:6px; background:var(--purple-050); overflow:hidden; position:relative; }
/* fixed centre baseline tick — so a bar at rest reads as "at baseline", not empty/unfinished */
.calrow .crbar::before{ content:""; position:absolute; left:50%; top:1px; bottom:1px; width:2px; margin-left:-1px; border-radius:2px; background:var(--line-strong); z-index:0; }
.calrow .crbar i{ position:absolute; left:50%; top:0; bottom:0; width:0; border-radius:6px; z-index:1; transition:width .18s ease, background .18s ease, left .18s ease; }
.reduce-motion .calrow .crbar i{ transition:none; }
input[type=range][data-cal-intake]{ accent-color:var(--purple); height:8px; }

/* --- Video lightbox (click a video to enlarge) --- */
.anim-video{ cursor:zoom-in; }
.vwrap{ position:relative; display:inline-block; }
.vexpand{ position:absolute; top:8px; right:8px; width:30px; height:30px; border-radius:8px; border:none;
  background:rgba(37,34,56,.55); color:#fff; display:grid; place-items:center; cursor:zoom-in; z-index:2; backdrop-filter:blur(3px); }
.vexpand svg{ width:16px; height:16px; }
#vlightbox{ position:fixed; inset:0; z-index:9999; display:none; align-items:center; justify-content:center;
  background:rgba(30,26,48,.82); backdrop-filter:blur(6px); }
#vlightbox.open{ display:flex; }
#vlightbox video{ width:min(84vw,1200px); max-height:86vh; border-radius:16px; box-shadow:0 40px 100px rgba(0,0,0,.5); }
#vlightbox .vclose{ position:absolute; top:22px; right:26px; width:44px; height:44px; border-radius:50%; border:none;
  background:rgba(255,255,255,.14); color:#fff; font-size:22px; cursor:pointer; }
.reduce-motion #vlightbox{ backdrop-filter:none; }

/* two-row SNAKE pathway for the hunger–satiety cycle summary slides (added 2026-07-13) */
.cyclerows{ display:flex; flex-direction:column; gap:8px; }
.pathway.rev{ flex-direction:row-reverse; }        /* row 2 flows right → left */
.pathway.rev .parrow svg{ transform:scaleX(-1); }  /* arrows point left */
/* down-turn connector — mirrors the row columns so the ↓ sits under the 4th node */
.prowlink{ display:flex; align-items:center; height:24px; }
.prowlink .pn{ flex:1 1 0; min-width:0; }
.prowlink .ar{ flex:0 0 34px; }
.prowlink .da{ flex:1 1 0; display:flex; justify-content:center; color:var(--violet-soft); }
.prowlink .da svg{ width:26px; height:26px; transform:rotate(90deg); }
.cyclerows:hover .pnode{ opacity:.42; transition:opacity .2s ease, box-shadow .2s ease, border-color .2s ease; }
.cyclerows:hover .pnode:hover{ opacity:1; border-color:var(--purple); box-shadow:0 0 0 4px rgba(128,102,216,.16); }
.reduce-motion .cyclerows:hover .pnode{ transition:none; }

/* =====================================================================
   2026-07-13 · Dense-card slides: keep 6 bullet cards inside their box
   ---------------------------------------------------------------------
   "History taking" packs 6 cards × 4 bullets into a .grid.body-scroll that
   is only ~412px tall — the content ran ~47px over, so the last lines were
   clipped and appeared to collide with the red-flags bar below it. Tighten
   the card padding and bullet rhythm for THIS slide only. Scoped by
   data-title so no other slide, and no design token, is affected.
   ===================================================================== */
/* =====================================================================
   2026-07-13 · .slide.fit — "this slide's content is taller than its box"
   ---------------------------------------------------------------------
   A pre-deploy audit found 7 slides whose .body-scroll was CLIPPING real
   content (scrollHeight > clientHeight), so the last lines of text were
   silently cut off. Rather than rewrite each slide, tighten the rhythm on
   just those slides. Opt-in via class="slide fit". Tokens untouched.
   ===================================================================== */
.slide.fit .card{ padding:12px 15px; }
.slide.fit .card.pad-lg{ padding:14px 18px; }
.slide.fit .callout{ padding:10px 14px; }
.slide.fit .cols{ gap:14px; }
.slide.fit ul.clean li{ padding:2px 0; line-height:1.3; font-size:14.5px; }
.slide.fit ul.clean.small li{ font-size:13px; }
.slide.fit ul.clean li::before{ margin-top:7px; }
.slide.fit .anim-video{ max-height:104px; }
.slide.fit .organ-side{ height:60px !important; }   /* beats the inline height */
.slide.fit .anim-cap{ font-size:11.5px; }

/* Three slides needed a little more than the shared .fit rhythm. */
.slide.fit[data-title="Leptin resistance"] .anim-video{ max-height:84px; }
.slide.fit[data-title="Leptin resistance"] .callout{ padding:8px 13px; }
.slide.fit[data-title="Leptin resistance"] .pnode .cap{ font-size:11.5px; line-height:1.28; }
/* "Defended weight & the regain loop" is deliberately LEFT ALONE: its .loop-node
   children are absolutely positioned around a radial circle, so scaling, padding
   or wrapping anything on it collides the nodes with the centre. Its ~18px of
   slack at the bottom of the loop wrapper is empty space, not lost content. */
.slide.fit[data-title="GLP-1 RAs: liraglutide & semaglutide"] .anim-video{ max-height:86px; }
.slide.fit[data-title="GLP-1 RAs: liraglutide & semaglutide"] .card{ padding:10px 14px; }

.slide[data-title="History taking"] .grid.body-scroll{ gap:11px; align-content:start; }
.slide[data-title="History taking"] .grid.body-scroll .card{ padding:12px 15px; }
.slide[data-title="History taking"] .grid.body-scroll ul.clean.small li{
  padding:2px 0; line-height:1.32; font-size:13px;
}
.slide[data-title="History taking"] .grid.body-scroll ul.clean li::before{ margin-top:7px; }
