/* Anchoring effect lesson. All rules scoped under .an-* */

/* the wheel of numbers */
.an-wheel { display: flex; justify-content: center; }
.an-wheel svg { width: min(100%, 270px); height: auto; overflow: visible; }
.an-wheel .a { fill: #4a3aa8; } .an-wheel .b { fill: #1c1745; }
.an-wheel .rim { fill: none; stroke: var(--violet-deep); stroke-width: 6; }
.an-wheel .hub { fill: #f6efe2; stroke: var(--gold); stroke-width: 4; }
.an-wheel .num { font: 600 36px var(--mono); fill: #1b1b1b; text-anchor: middle; }
.an-wheel .ptr { fill: var(--gold); stroke: #070a14; stroke-width: 2; }
.an-wheel.stop .hub { stroke-width: 6; }

/* rows of bars on one scale */
.an-rows { display: flex; flex-direction: column; gap: 9px; width: 100%; }
.an-rows .rw { display: grid; grid-template-columns: 112px 1fr 44px; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; line-height: 1.15; color: var(--dim); animation: cardIn .25s both; }
.an-rows .rw i { display: block; height: 14px; border-radius: 999px; background: #06080f; overflow: hidden; }
.an-rows .rw b { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--faint); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.an-rows .rw .v { font-family: var(--mono); font-size: 14px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.an-rows .card b { background: var(--gold); } .an-rows .card .v, .an-rows .card .lb { color: var(--gold); }
.an-rows .you b { background: var(--violet-bright); } .an-rows .you .v, .an-rows .you .lb { color: var(--violet-bright); }
.an-rows .truth b { background: var(--mint); } .an-rows .truth .v, .an-rows .truth .lb { color: var(--mint); }

/* Everest and the thermometer */
.an-ev { display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 100%; }
.an-ev img { width: min(56%, 230px); height: auto; filter: drop-shadow(0 14px 24px rgba(0,0,0,.5)); }
.an-thermo { width: 124px; height: auto; flex: none; overflow: visible; }
.an-thermo .tube { fill: #06080f; stroke: var(--line-strong); stroke-width: 2; }
.an-thermo .bulb { fill: var(--red); }
.an-thermo .merc { fill: var(--red); }
.an-thermo .tk { stroke: var(--dim); stroke-width: 2; }
.an-thermo .tl { font: 600 18px var(--mono); fill: var(--dim); text-anchor: end; }
.an-thermo g line { stroke-width: 3; }
.an-thermo g text { font: 700 18px var(--sans); }
.an-thermo .sea line { stroke: var(--dim); } .an-thermo .sea text { fill: var(--dim); }
.an-thermo .you { opacity: 0; } .an-thermo .you.on { opacity: 1; }
.an-thermo .you line { stroke: var(--gold); } .an-thermo .you text { fill: var(--gold); }
.an-thermo .real { opacity: 0; transition: opacity .4s; }
.an-thermo.shown .real { opacity: 1; }
.an-thermo .real line { stroke: var(--mint); } .an-thermo .real text { fill: var(--mint); }

/* nodding and shaking */
.an-heads { display: flex; justify-content: center; gap: 28px; width: 100%; }
.an-head { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); transition: border-color .3s; }
.an-head svg { width: 96px; height: 96px; }
.an-head .face { fill: #f2c9a0; stroke: #070a14; stroke-width: 2; }
.an-head .eye { fill: #1b1b1b; }
.an-head .mouth { fill: none; stroke: #1b1b1b; stroke-width: 3; stroke-linecap: round; }
.an-head b { font-size: 14px; color: var(--text); }
.an-head.right { border-color: var(--mint); }
.an-heads.go .nod svg { animation: anNod .7s ease-in-out 4; }
.an-heads.go .shake svg { animation: anShake .7s ease-in-out 4; }
@keyframes anNod { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes anShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* the sketch of both walks */
.an-sk { width: 100%; }
.an-sketch { width: 100%; height: auto; overflow: visible; }
.an-sketch .band { fill: rgba(63, 214, 154, .14); stroke: var(--mint); stroke-width: 1.5; stroke-dasharray: 4 4; }
.an-sketch .bt { font: 700 14px var(--sans); fill: var(--mint); text-anchor: middle; }
.an-sketch .ax { stroke: var(--line-strong); stroke-width: 2; }
.an-sketch .nl { font: 600 14px var(--mono); fill: var(--dim); text-anchor: middle; }
.an-sketch .walk { stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 7; }
.an-sketch .walk.lo { stroke: var(--violet-bright); } .an-sketch .walk.hi { stroke: var(--gold); }
.an-sketch .dot.lo { fill: var(--violet-bright); } .an-sketch .dot.hi { fill: var(--gold); }
.an-sketch .st { font: 700 14px var(--sans); text-anchor: middle; }
.an-sketch .st.lo { fill: var(--violet-bright); } .an-sketch .st.hi { fill: var(--gold); }

/* the judge */
.an-judge { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.an-judge img { width: min(88%, 300px); height: auto; filter: drop-shadow(0 14px 24px rgba(0,0,0,.5)); transition: width .4s; }
.an-judge.small img { width: min(60%, 200px); }
.an-judge .an-rows { display: none; }
.an-judge .an-rows.on { display: flex; }
.an-judge .an-rows .rw { grid-template-columns: 80px 1fr 52px; }

/* three fixes */
.an-fixes { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.an-fix { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); transition: border-color .3s, opacity .3s; }
.an-fix span { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 15px var(--mono); color: var(--bg); background: var(--violet-bright); }
.an-fix p { margin: 0; font: 600 17px/1.3 var(--serif); color: var(--text); }
.an-fix.right { border-color: var(--mint); } .an-fix.right span { background: var(--mint); }
.an-fix em { display: block; font: 700 13px var(--sans); font-style: normal; color: var(--dim); }
.an-fix.right em { color: var(--mint); }
.an-fix.off { opacity: .6; }

/* the deal */
.an-deal { display: flex; justify-content: center; width: 100%; }
.an-pp { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: min(100%, 280px); padding: 18px 20px; border-radius: 18px; background: #f6efe2; box-shadow: 0 6px 0 #070a14; }
.an-pp .nm { font: 700 15px var(--sans); color: #3a3226; }
.an-pp s { font: 600 16px var(--mono); color: #7a7064; }
.an-pp b { font: 700 44px var(--mono); color: #1b1b1b; line-height: 1; }
.an-pp em { font-style: normal; font: 800 14px var(--sans); color: #fff; background: #c0392b; padding: 4px 10px; border-radius: 8px; }

@media (max-height: 700px) {
  .an-wheel svg { width: min(100%, 220px); }
  .an-ev img { width: min(48%, 170px); }
  .an-thermo { width: 112px; }
  .an-head svg { width: 76px; height: 76px; }
  .an-judge img { width: min(70%, 220px); }
  .an-judge.small img { width: min(40%, 130px); }
  .an-fix { padding: 9px 12px; }
  .an-fix p { font-size: 15px; }
  .an-pp b { font-size: 36px; }
}
