/* The science page, and its figures where the home page borrows one: the home page's look, with a moving figure
   on a slate for each idea. Figures are drawn by science.js; the text stands on its own without it. */
.sci { max-width: 820px; margin: 0 auto; padding: 28px 22px 0; }

.sci-hero { position: relative; overflow: hidden; border-radius: 28px; padding: 60px 48px 44px; box-shadow: 0 18px 40px rgba(0, 42, 40, 0.14); }
.sci-hero > :not(.web) { position: relative; }
.sci-hero h1 { margin-top: 14px; font-size: 54px; line-height: 1.08; letter-spacing: -1.2px; max-width: 700px; }
.sci-hero .lead { margin-top: 24px; font-size: 19px; color: var(--chalk-dim); }
.web { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.web line { stroke: var(--tint); stroke-width: 1; opacity: 0.07; animation: fire 9s ease-in-out infinite; }
.web circle { fill: var(--chalk); opacity: 0.35; animation: twinkle 6s ease-in-out infinite; }
@keyframes fire { 0%, 100% { opacity: 0.07; } 6% { opacity: 0.55; } 18% { opacity: 0.07; } }
@keyframes twinkle { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.8; } }

.toc { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 8px; }
.toc a {
  color: var(--chalk); font-size: 14px; padding: 7px 15px; border-radius: 999px;
  border: 1px solid rgba(242, 239, 230, 0.24); background: rgba(242, 239, 230, 0.05);
}
.toc a:hover { background: rgba(242, 239, 230, 0.13); text-decoration: none; }
.toc b { color: var(--tint); font-weight: 600; margin-right: 6px; }

.idea { margin-top: 104px; scroll-margin-top: 24px; }
.idea > h2 { margin-top: 10px; font-size: 40px; line-height: 1.12; letter-spacing: -0.9px; max-width: 700px; }
.idea > p { margin-top: 14px; color: var(--muted); font-size: 18px; }
.idea > p strong { color: var(--ink); font-weight: 600; }

/* A figure: a slate with a title, a replay button, the drawing and a caption. */
.fig { margin-top: 32px; border-radius: 24px; padding: 24px 28px 22px; box-shadow: 0 14px 34px rgba(0, 42, 40, 0.12); }
.fig-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.fig-head .eyebrow { color: var(--tint); }
.fig-head .right { display: flex; align-items: center; gap: 12px; }
.chip { font-size: 13px; font-weight: 600; color: var(--chalk); font-variant-numeric: tabular-nums; white-space: nowrap; }
.replay, .act {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--chalk); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  background: rgba(242, 239, 230, 0.08); border: 1px solid rgba(242, 239, 230, 0.28);
}
.replay:hover, .act:hover { background: rgba(242, 239, 230, 0.17); }
.replay svg { width: 13px; height: 13px; }
html:not(.js) .replay { display: none; }
.fig-canvas { margin-top: 16px; }
.fig-canvas svg { display: block; overflow: visible; }
.fig-canvas text { font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif; }
.fig-caption { margin-top: 14px; font-size: 14px; color: var(--chalk-dim); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13px; color: var(--chalk-dim); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 20px; height: 0; border-top: 3px solid var(--progress); border-radius: 2px; }
.swatch.dashed { border-top: 2px dashed rgba(242, 239, 230, 0.55); }
.swatch.dot { width: 9px; height: 9px; border: none; border-radius: 50%; background: var(--progress); }
.no-anim, .no-anim * { transition: none !important; animation: none !important; }

/* Shared drawing styles */
.grid { stroke: rgba(242, 239, 230, 0.12); stroke-width: 1; }
.tick { fill: var(--chalk-dim); font-size: 12px; }
.axis { fill: var(--chalk-dim); font-size: 12px; font-weight: 600; letter-spacing: 0.4px; }
.curve { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.curve.faint { stroke: rgba(242, 239, 230, 0.5); stroke-width: 2; stroke-dasharray: 5 6; }
.curve.bright { stroke: var(--progress); stroke-width: 3.5; filter: drop-shadow(0 0 6px rgba(209, 224, 163, 0.4)); }
.head { stroke: rgba(242, 239, 230, 0.32); stroke-width: 1; stroke-dasharray: 2 4; }
.ping { opacity: 0; transition: opacity 0.2s; }
.ping.on { opacity: 1; }
.ping .dot { fill: var(--progress); }
.ping .ring { fill: none; stroke: var(--progress); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.ping.on .ring { animation: ring 0.9s ease-out; }
@keyframes ring { from { opacity: 0.9; transform: scale(0.3); } to { opacity: 0; transform: scale(1.9); } }
.endlab { font-size: 13px; font-weight: 600; opacity: 0; transition: opacity 0.6s; }
.endlab.show { opacity: 1; }
.endlab.bright { fill: var(--progress); }
.endlab.faint { fill: var(--chalk-dim); }

/* 2: two study plans on a calendar */
.plans { display: grid; gap: 14px; }
.plan, .plan-head { display: grid; grid-template-columns: 104px 1fr 170px; gap: 16px; align-items: center; }
.plan-name { font-size: 15px; font-weight: 600; }
.days { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.days-head span { text-align: center; font-size: 11px; color: var(--chalk-dim); font-variant-numeric: tabular-nums; }
.days-head span.now { color: var(--chalk); font-weight: 600; }
.day {
  height: 76px; border-radius: 8px; background: rgba(242, 239, 230, 0.05); border: 1px solid rgba(242, 239, 230, 0.1);
  display: flex; flex-direction: column-reverse; align-items: stretch; gap: 3px; padding: 4px; transition: background 0.25s, border-color 0.25s;
}
.day.now { background: rgba(242, 239, 230, 0.13); border-color: rgba(242, 239, 230, 0.4); }
.day.test { align-items: center; justify-content: center; border-style: dashed; }
.blk { height: 13px; border-radius: 4px; background: var(--progress); opacity: 0; transform: translateY(-14px) scale(0.8); transition: opacity 0.3s, transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.blk.on { opacity: 1; transform: none; }
.check { font-size: 20px; color: var(--progress); opacity: 0; transform: scale(0.4); transition: opacity 0.3s, transform 0.4s cubic-bezier(0.3, 1.8, 0.5, 1); }
.check.on { opacity: 1; transform: none; }
.later { display: grid; gap: 6px; }
.meter { position: relative; height: 10px; border-radius: 5px; background: rgba(242, 239, 230, 0.14); overflow: hidden; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 5px; background: var(--progress); }
.later span { font-size: 13px; color: var(--chalk-dim); min-height: 20px; }

/* 3: recall a path */
.recall { width: 100%; height: auto; max-width: 640px; margin: 0 auto; }
.node { fill: rgba(242, 239, 230, 0.06); stroke: rgba(242, 239, 230, 0.45); stroke-width: 1.5; transition: fill 0.4s, stroke 0.4s; }
.node.lit { fill: rgba(209, 224, 163, 0.2); stroke: var(--progress); }
.node-text { fill: var(--chalk); font-family: Georgia, serif !important; font-size: 30px; text-anchor: middle; }
.node-cap { fill: var(--chalk-dim); font-size: 18px; text-anchor: middle; }
.link { fill: none; stroke: var(--progress); stroke-linecap: round; transition: stroke-width 0.6s, opacity 0.6s; }
.flash { fill: none; stroke: var(--chalk); stroke-linecap: round; stroke-width: 18; opacity: 0; transition: opacity 0.6s; filter: blur(5px); }
.flash.on { opacity: 0.35; transition: opacity 0.1s; }
.spark { fill: #fff8de; opacity: 0; filter: drop-shadow(0 0 8px #f1e6c6); }
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.act.primary { background: var(--progress); border-color: var(--progress); color: var(--green); }
.act.primary:hover { background: #e0ecb9; }
.act.quiet { background: none; border-color: transparent; color: var(--chalk-dim); }
.strength { max-width: 440px; margin: 20px auto 0; }
.strength .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--chalk-dim); margin-bottom: 7px; }
.strength .meter i.base { transition: width 0.6s ease; }
.strength .meter i.temp {
  border-radius: 0 5px 5px 0; transition: width 0.35s ease, left 0.6s ease;
  background: repeating-linear-gradient(45deg, rgba(242, 239, 230, 0.6) 0 4px, rgba(242, 239, 230, 0.25) 4px 8px);
}
.strength .meter i.temp.fading { transition: width 1.8s ease-in, left 0.6s ease; }
.swatch.hatch { width: 14px; height: 9px; border: none; border-radius: 2px; background: repeating-linear-gradient(45deg, rgba(242, 239, 230, 0.6) 0 3px, rgba(242, 239, 230, 0.25) 3px 6px); }
.swatch.solid { width: 14px; height: 9px; border: none; border-radius: 2px; background: var(--progress); }
.status-line { text-align: center; margin-top: 14px; min-height: 24px; font-size: 15px; color: var(--chalk); }

/* 4: stars along the signal */
.star { transform-box: fill-box; transform-origin: center; opacity: 0; transform: scale(0.2); transition: opacity 0.3s, transform 0.5s cubic-bezier(0.3, 1.8, 0.5, 1); }
.star.on { opacity: 1; transform: none; }
.star.big { fill: #f1e6c6; filter: drop-shadow(0 0 6px rgba(241, 230, 198, 0.7)); }
.star.small { fill: rgba(242, 239, 230, 0.6); }
.runner { fill: #fff8de; filter: drop-shadow(0 0 6px #f1e6c6); }

/* 5: three stages */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.col { transition: opacity 0.4s; opacity: 0.45; }
.col.active, .col.done { opacity: 1; }
.sbar { height: 4px; border-radius: 2px; background: rgba(242, 239, 230, 0.17); overflow: hidden; }
.sbar i { display: block; height: 100%; width: 0; background: var(--progress); }
.slabel { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.slabel .dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; transition: background 0.3s, border-color 0.3s; }
.col.done .slabel .dot { background: var(--progress); border-color: var(--progress); }
.vig { height: 128px; padding-top: 20px; margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; position: relative; }
.vcap { margin-top: 6px; text-align: center; font-size: 13px; color: var(--chalk-dim); }
.qcard {
  position: relative; width: 64px; height: 76px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(242, 239, 230, 0.07); border: 1px solid rgba(242, 239, 230, 0.3);
  font-family: Georgia, serif; font-size: 30px; transition: border-color 0.3s, background 0.3s;
}
.qcard.small { width: 48px; height: 60px; font-size: 24px; border-radius: 10px; }
.qcard .qm, .qcard .ok { grid-area: 1 / 1; transition: opacity 0.3s, transform 0.4s cubic-bezier(0.3, 1.8, 0.5, 1); }
.qcard .ok { color: var(--progress); opacity: 0; transform: scale(0.4); }
.qcard.ok { border-color: var(--progress); background: rgba(209, 224, 163, 0.12); }
.qcard.ok .qm { opacity: 0; }
.qcard.ok .ok { opacity: 1; transform: none; }
.bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%; padding: 4px 10px; border-radius: 10px; white-space: nowrap;
  background: var(--chalk); color: var(--green); font-family: "Avenir Next", Avenir, sans-serif; font-size: 12px; font-weight: 600;
  opacity: 0; transform: translate(-50%, 6px) scale(0.7); transform-origin: bottom center; transition: opacity 0.3s, transform 0.4s cubic-bezier(0.3, 1.8, 0.5, 1);
}
.bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--chalk); }
.bubble.on { opacity: 1; transform: translate(-50%, 0); }
.calendar {
  width: 56px; height: 62px; border-radius: 10px; overflow: hidden; background: var(--chalk); color: var(--green); text-align: center;
  opacity: 0; transform: rotateX(80deg); transform-origin: top; transition: opacity 0.3s, transform 0.6s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.calendar.on { opacity: 1; transform: none; }
.calendar b { display: block; height: 14px; background: var(--progress); }
.calendar span { display: block; font-family: Georgia, serif; font-size: 24px; line-height: 1.2; margin-top: 3px; }
.calendar small { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.five { display: grid; grid-template-columns: repeat(5, 9px); gap: 4px; }
.five i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--chalk-dim); transition: background 0.2s, border-color 0.2s, transform 0.3s; }
.five i.on { background: var(--progress); border-color: var(--progress); transform: scale(1.25); }
.later-v { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.stage-cards { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--raised); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.card .eyebrow { font-size: 11px; }
.card h3 { margin-top: 6px; font-size: 19px; font-weight: 600; }
.card p { margin-top: 6px; color: var(--muted); }

/* Two more things */
.pair { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pair .card { padding: 28px; }
.pair h3 { font-family: Georgia, serif; font-weight: normal; font-size: 26px; letter-spacing: -0.4px; }
.icon { width: 56px; height: 56px; color: var(--accent); }
.icon .z { font-family: Georgia, serif; font-size: 13px; fill: currentColor; animation: zz 3.6s ease-in-out infinite; opacity: 0; }
.icon .z:nth-of-type(2) { animation-delay: 1.2s; }
.icon .z:nth-of-type(3) { animation-delay: 2.4s; }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(8px, -12px); } }
.icon .climber { fill: currentColor; animation: climb 4s ease-in-out infinite; }
@keyframes climb { 0% { transform: translate(0, 0); } 70%, 100% { transform: translate(26px, -26px); } }

/* At home */
.home-tips { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tips { border-radius: 24px; padding: 32px 30px 30px; border: 1.25px solid transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--gold) border-box; }
.tips h3 { font-family: Georgia, serif; font-weight: normal; font-size: 28px; letter-spacing: -0.5px; }
.tips ul { list-style: none; margin-top: 16px; display: grid; gap: 12px; }
.tips li { position: relative; padding-left: 28px; color: var(--muted); }
.tips li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--accent); }
.tips li:nth-child(-n+3)::before { background: var(--accent); }
.tips li strong { color: var(--ink); font-weight: 600; }

.built { margin-top: 104px; border-radius: 24px; padding: 40px 36px; }
.built h2 { margin-top: 10px; font-size: 34px; line-height: 1.15; letter-spacing: -0.7px; }
.built p { margin-top: 12px; color: var(--chalk-dim); font-size: 18px; }
.built a { color: var(--progress); }
.built .links { display: flex; flex-wrap: wrap; gap: 6px 24px; }

.sources { margin-top: 88px; }
.sources h2 { font-size: 26px; letter-spacing: -0.4px; }
.sources ol { margin-top: 14px; padding-left: 22px; display: grid; gap: 7px; font-size: 14px; color: var(--muted); max-width: 820px; }
.sources em { font-style: italic; }

@media (max-width: 760px) {
  .sci-hero { padding: 36px 20px 28px; border-radius: 24px; }
  .sci-hero h1 { font-size: 36px; letter-spacing: -0.6px; }
  .sci-hero .lead { font-size: 17px; }
  .web { opacity: 0.6; }
  .toc a { font-size: 13px; padding: 6px 12px; }
  .idea, .built { margin-top: 72px; }
  .idea > h2 { font-size: 30px; letter-spacing: -0.6px; }
  .idea > p { font-size: 17px; }
  .fig { padding: 18px 16px 18px; border-radius: 20px; margin-left: -6px; margin-right: -6px; }
  .fig-head { flex-wrap: wrap; row-gap: 10px; }
  .fig-head .eyebrow { flex-basis: 100%; font-size: 11px; letter-spacing: 1.2px; }
  .fig-head .right { flex: 1; justify-content: space-between; }
  .plan, .plan-head { grid-template-columns: 1fr; gap: 8px; }
  .plan-head > :first-child, .plan-head > :last-child { display: none; }
  .plan { padding-bottom: 6px; }
  .later { grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
  .day { height: 64px; padding: 3px; border-radius: 6px; }
  .days { gap: 3px; }
  .blk { height: 10px; border-radius: 3px; }
  .trio { gap: 8px; }
  .slabel { font-size: 11px; gap: 4px; }
  .slabel .dot { width: 9px; height: 9px; }
  .vig { height: 108px; padding-top: 18px; gap: 6px; }
  .qcard { width: 52px; height: 62px; font-size: 24px; }
  .qcard.small { width: 38px; height: 48px; font-size: 19px; }
  .bubble { font-size: 10px; padding: 3px 7px; }
  .vcap { font-size: 11px; }
  .stage-cards, .pair, .home-tips { grid-template-columns: 1fr; }
  .tips, .built { padding: 28px 22px; }
  .built h2 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .web line, .web circle, .icon .z, .icon .climber { animation: none; }
  .icon .z { opacity: 1; }
}
