/* Discovery introductions and the short experiments that follow them. */
.study-home .home-mast, .study-home .home-stage { background: #101b2a; }
.study-home .home-stage { border-bottom: 3px solid #f1ab74; }
.study-home .home-stage::before {
  background: radial-gradient(ellipse at 78% 42%, #294366 0%, transparent 60%),
    radial-gradient(circle, #b5c5e22c 1px, transparent 1.5px) 0 0 / 22px 22px;
  mask-image: linear-gradient(90deg, #0009, #000);
}
.study-home .opening { padding-block: clamp(2.35rem, 4vw, 4.7rem); }
.study-home .opening h1 { max-width: none; font-size: clamp(3.1rem, 5.5vw, 6rem); line-height: .94; text-wrap: balance; }
.study-home .opening h1 em { display: block; color: #ffc38c; }
.study-home .opening-copy > p:not(.eyebrow) { max-width: 43ch; color: #e1e8f0; }
.opening-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; }
.opening-actions .gallery-button { background: #ffc38c; color: #2e211d; border-color: #ffc38c; }
.opening-actions .gallery-button span { color: inherit; }
.opening-actions .gallery-button:hover { background: #ffdbac; }
.opening-actions > a:last-child { color: #e0ebf4; font-size: .89rem; font-weight: 680; }
.study-home .proof-window {
  border: 1px solid #7289a9;
  box-shadow: 5px 5px 0 #070e18, 0 1.1rem 4rem #070e177d;
  background: linear-gradient(165deg, #254263 0%, #152539 57%);
}
.study-home .trial-buttons button[aria-pressed='true'] { background: #ffc38c; border-color: #ffc38c; }
.study-home .trial-actions a { color: #a8edec; }
.study-home .catalogue-heading { border-bottom: 1px solid #b6c4c9; padding-bottom: .85rem; }
.study-home .catalogue-heading p { max-width: 29ch; }
.study-home .folio-grid { gap: .9rem; }
.study-home .folio { border-color: #b4bfc5; box-shadow: 0 .32rem .6rem #2437460d; overflow: clip; }
.study-home .folio:hover { border-color: #5a738a; }
.study-home .folio-copy .eyebrow { font-size: .68rem; letter-spacing: .10em; }
.study-home .folio-copy h3 { font-size: clamp(2rem, 3vw, 3rem); }
.study-home .folio-enter { color: #184c69; }
.study-home :is(.folio:focus-visible, .folio:hover) .folio-enter { text-decoration: underline; text-underline-offset: .18em; }
.study-home .art-riemann { background: radial-gradient(ellipse at 50% 58%, #35577e, #162539 80%); }
.study-home .art-riemann::before { box-shadow: 0 0 28px #84f0dfa4; }
.study-home .art-matrix { background: repeating-linear-gradient(0deg, #7798af26 0 1px, transparent 1px 18px), #e0eaf3; }
.study-home .art-packing { background-color: #9c614c; }
.study-home .art-sequence { background: radial-gradient(ellipse at 60% 54%, #cfebc2, #aacbb7); }
.study-home .art-unit-distance {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .85rem;
  background: radial-gradient(ellipse at 55% 70%, #394c83, #1e284e 75%);
  color: #f7dfa1;
}
.unit-card-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .8rem;
  padding: .12rem .65rem .12rem 0;
}
.unit-card-points i { width: .39rem; height: .39rem; border-radius: 50%; background: #e5ebfb; box-shadow: 0 0 .65rem #cedbff99; }
.unit-card-points i:nth-child(n+4):nth-child(-n+6) { transform: translateX(.56rem); background: #ffda89; }
.unit-card-points i:nth-child(n+7) { transform: translateX(1.12rem); }
.study-home .art-unit-distance > span { font: 600 .67rem ui-monospace, monospace; white-space: nowrap; }
.maker-credit { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; }
.maker-credit img { flex: 0 0 auto; }

.guide[data-guide='riemann'] { --accent-ink: #22517a; --lightwash: #e4edf6; --panel: #162b47; --panel-deep: #102039; --bright: #a8e8f0; }
.guide[data-guide='unit-distance'] { --accent-ink: #3b4e86; --lightwash: #e5e9f8; --panel: #202d52; --panel-deep: #17213f; --bright: #cbd8ff; }
.guide[data-guide='matrix'] { --accent-ink: #15565e; --lightwash: #e0efed; --panel: #14383f; --panel-deep: #0b272e; --bright: #a6e9cf; }
.guide[data-guide='packing'] { --accent-ink: #8a422b; --lightwash: #f3e6d2; --panel: #4b3026; --panel-deep: #2f211e; --bright: #ffd298; }
.guide[data-guide='sequencing'] { --accent-ink: #315a3d; --lightwash: #e2eddc; --panel: #18392e; --panel-deep: #112b22; --bright: #d4ec9f; }
.discovery-heading {
  position: relative;
  gap: clamp(.8rem, 3vw, 2.8rem);
  align-items: stretch;
  padding: clamp(1.2rem, 3.5vw, 2.7rem);
  border: 1px solid #b6c7ce;
  border-top: 3px solid var(--accent-ink);
  background: radial-gradient(circle at 95% 94%, #fff8e5 0%, transparent 60%), var(--lightwash);
}
.discovery-heading .eyebrow { margin-bottom: .55rem; color: var(--accent-ink); }
.discovery-heading h1 { font-size: clamp(3.25rem, 6.8vw, 6rem); min-width: 0; }
.discovery-heading .guide-deck { color: #2f414d; }
.discovery-action {
  display: inline-flex;
  align-items: center;
  min-height: 2.85rem;
  gap: .52rem;
  margin: 1rem 0 .14rem;
  padding: .45rem .78rem;
  border-radius: .16rem;
  background: var(--accent-ink);
  color: #fff;
  font-size: .87rem;
  line-height: 1.25;
  font-weight: 700;
  text-decoration: none;
}
.discovery-action:hover { filter: brightness(.84); }
.discovery-note {
  align-self: center;
  padding: clamp(.85rem,2.1vw,1.2rem) clamp(.72rem,2.1vw,1.25rem);
  border-left: 2px solid var(--accent-ink);
  background: #fffdf2bb;
}
.discovery-note .eyebrow { display: block; font-size: .7rem; }
.discovery-note > strong { display: block; margin-bottom: .42rem; color: var(--accent-ink); font: 400 clamp(1.85rem,3.1vw,2.45rem)/.99 var(--serif); }
.discovery-note p { margin-bottom: .5rem; color: #314752; font-size: .89rem; }
.discovery-note a { color: var(--accent-ink); font-size: .83rem; font-weight: 720; }
.challenge-first { padding-top: clamp(2.2rem,5vw,3.8rem); }

.discovery-game {
  position: relative;
  margin-block: 1.15rem 1.1rem;
  padding: clamp(.8rem, 3.2vw, 1.7rem);
  border: 1px solid #62829a;
  border-radius: .42rem;
  background: radial-gradient(ellipse at 87% 38%, #587ba05b 0%, transparent 64%), var(--panel);
  color: #f5f7f2;
  overflow-wrap: anywhere;
  box-shadow: .3rem .3rem 0 #25384927;
}
.discovery-game :focus-visible { outline-color: #ffd388; }
.game-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .72rem;
  padding-bottom: .74rem;
  border-bottom: 1px solid #bfd9e45e;
  color: #d9e9ee;
  font-size: .87rem;
}
.game-banner > strong { color: var(--bright); font: 680 clamp(1.1rem,2.7vw,1.55rem) ui-monospace, monospace; }
.game-banner > button { margin-inline-start: auto; }
.game-body, .growth-inner { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(10rem, .88fr); align-items: center; gap: .8rem 1.45rem; padding-block: .89rem; }
.game-question { font-weight: 710; line-height: 1.36; margin-bottom: .48rem; }
.game-choices, .game-toggle { display: flex; flex-wrap: wrap; gap: .36rem; }
.game-choices button, .game-toggle button, .game-banner > button {
  min-height: 2.65rem;
  padding: .38rem .67rem;
  border: 1px solid #a5bdc8;
  border-radius: .17rem;
  background: var(--panel-deep);
  color: #f2f7f5;
  font-size: .86rem;
  font-weight: 680;
  line-height: 1.22;
}
.game-choices button[aria-pressed='true'], .game-toggle button[aria-pressed='true'] { border-color: var(--bright); color: #17282d; background: var(--bright); }
:is(.game-choices, .game-toggle) button:hover:not([aria-pressed='true']), .game-banner > button:hover { background: #456373; }
.game-feedback { margin: 0; padding: .65rem .7rem; border-left: 2px solid #a6bbcd; background: var(--panel-deep); color: #e7eff0; font-size: .9rem; font-weight: 680; }
[data-verdict='match'] .game-feedback, [data-verdict='revealed'] .game-feedback { border-color: var(--bright); }
[data-verdict='loose'] .game-feedback { border-color: #ffc890; }
.chain-chart {
  position: relative;
  display: grid;
  gap: .18rem;
  min-width: 0;
  padding: .55rem .8rem;
  border: 1px solid #7796ba;
  border-radius: .2rem;
  background: #0e213a95;
}
.chain-chart > span { color: #d6e3ee; font-size: .78rem; }
.chain-chart > strong { color: var(--bright); font: 700 clamp(1.8rem,4vw,3.1rem)/1.2 ui-monospace,monospace; }
[data-verdict='loose'] .chain-chart > strong, [data-verdict='long'] .chain-chart > strong { color: #ffcf94; }
.ceiling-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  justify-items: center;
  padding: .43rem 0 .2rem;
  background: linear-gradient(90deg, #6a899b, #6a899b) center .77rem / 70% 1px no-repeat;
}
.ceiling-track > span { display: grid; justify-items: center; gap: .33rem; color: #d3e4ee; font-size: .73rem; }
.ceiling-track > span::before { content: ''; width: .68rem; height: .68rem; border: 1px solid #92aebd; border-radius: 50%; background: #1a2c44; }
.ceiling-track > .ceiling-target::before { border-color: #abebeb; }
[data-verdict='loose'] .ceiling-looser::before { border-color: #ffca91; background: #ffca91; box-shadow: 0 0 0 .22rem #ffca9142; }
[data-verdict='long'] .ceiling-tighter::before, [data-verdict='match'] .ceiling-target::before {
  border-color: #a8edf0; background: #a8edf0; box-shadow: 0 0 0 .22rem #a8edf044;
}
.growth-inner { align-items: start; }
.growth-game .game-toggle { margin-left: auto; }
.growth-result { display: grid; gap: .15rem; margin-top: .62rem; }
.growth-result label { display: flex; justify-content: space-between; gap: .3rem; color: #dfefed; font-size: .8rem; }
.growth-result strong { font-variant-numeric: tabular-nums; }
.growth-result meter { width: 100%; min-height: .8rem; }
.growth-result meter::-webkit-meter-bar { background: #536874; }
.growth-result meter::-webkit-meter-optimum-value { background: #ffc387; }
.growth-result #growth-fast::-webkit-meter-optimum-value { background: #a6e9cf; }
.growth-result meter::-moz-meter-bar { background: #a6e9cf; }
.growth-poster { position: relative; min-height: 8rem; isolation: isolate; border-radius: .18rem; border: 1px solid #779d9c; background: radial-gradient(ellipse at 66% 54%, #37666a, #152f37 72%); }
.growth-poster .grid-small, .growth-poster .grid-large {
  position: absolute;
  aspect-ratio: 1;
  border: 1px solid #c1eff1;
  background: repeating-linear-gradient(0deg, transparent 0 30%, #a6d5db80 31% 33%),
    repeating-linear-gradient(90deg, transparent 0 30%, #a6d5db80 31% 33%), #1c5a6355;
}
.growth-poster .grid-small { width: 2.2rem; left: 15%; top: 36%; transform: rotate(-10deg); }
.growth-poster .grid-large { width: 4.5rem; right: 17%; top: 12%; transform: rotate(8deg); }
[data-factor='4'] .growth-poster .grid-large { width: 5.3rem; right: 13%; top: 8%; background-size: 50% 50%; }
.growth-poster > span { position: absolute; inset: auto 0 .34rem; text-align: center; color: #dbf3ed; font: 700 .79rem ui-monospace,monospace; }
.growth-poster b { color: #a6e9cf; }

.packing-goal { padding: .66rem .65rem .5rem; border: 1px solid #ac9875; background: #1c2b27; border-radius: .18rem; }
.packing-goal span { display: block; color: #ffdc9f; font-weight: 730; font-size: .91rem; }
.packing-goal label { display: block; color: #e3eadc; font-size: .76rem; }
.packing-goal meter { width: 100%; }
.packing-goal meter::-webkit-meter-bar { background: #6b765e; }
.packing-goal meter::-webkit-meter-optimum-value { background: #efc88e; }
[data-verdict='match'] .packing-goal { border-color: #dec397; }
[data-verdict='match'] :is(#pack-result,#seq-result) { border-color: var(--bright); color: #f4ffe7; }
.r04-game { background: radial-gradient(ellipse at 76% 8%, #754d37, transparent 68%), var(--panel); border-color: #9a7460; }
.r04-controls { display: flex; gap: .45rem 1rem; align-items: center; flex-wrap: wrap; margin-bottom: .75rem; }
.r04-game [hidden] { display: none; }
.r04-controls .guide-range { flex: 1 1 15rem; max-width: 26rem; margin: 0; }
.r04-controls .guide-range input { accent-color: var(--bright); height: 2.55rem; }
.r04-controls .guide-range output { color: var(--bright); }
.r04-controls .game-choices { gap: .32rem; }
.r04-controls .game-choices button { min-height: 44px; border-color: #bb9b85; padding-inline: .53rem; }
.r04-readouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .42rem; margin-bottom: .65rem; }
.r04-readouts > div { display: grid; align-content: space-between; gap: .35rem; padding: .57rem .65rem; border: 1px solid #9e7e68; border-radius: .2rem; background: #33241e; }
.r04-readouts span { color: #f4e3cd; font-size: .78rem; line-height: 1.22; }
.r04-readouts strong { color: #ffd796; font: 650 clamp(.87rem, 2.7vw, 1.65rem)/1 ui-monospace, monospace; }
.r04-result { border-color: #ffce8d; }
.r04-figures { display: grid; grid-template-columns: minmax(0, 1.19fr) minmax(0, 1fr); gap: .67rem; margin-top: .72rem; }
.r04-figure { display: grid; grid-template-rows: auto 1fr; min-width: 0; margin: 0; border: 1px solid #a77d63; border-radius: .22rem; background: #2e221e; }
.r04-figure figcaption { display: grid; gap: .2rem; margin: 0; padding: .74rem .73rem 0; }
.r04-figure figcaption strong { color: #fff1dd; font-size: .94rem; }
.r04-figure figcaption span { color: #e9d1b9; font-size: .77rem; line-height: 1.4; }
#r04-plot { display: block; align-self: end; width: 100%; height: clamp(9rem, 21vw, 13.1rem); cursor: crosshair; }
.r04-bars { display: grid; align-self: end; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: .33rem; margin: 0; padding: .58rem .65rem .48rem; list-style-type: none; }
.r04-bars > li { min-width: 0; text-align: center; font: 650 .76rem/1.2 ui-monospace, monospace; color: #f8e8d2; }
.r04-bar-track { position: relative; display: flex; align-items: end; height: clamp(6.6rem, 16vw, 10rem); margin-bottom: .3rem; border: 1px solid #846353; border-radius: .17rem; background: #3b2b24; overflow: hidden; }
.r04-bar-track span { display: block; width: 100%; min-height: 1px; border-top: 1px solid #fff3da; background: linear-gradient(180deg, #ffd598, #bd7444); }
.r04-bars [data-zero='true'] .r04-bar-track { border-style: dashed; border-color: #b8a08a; }
.r04-bars [data-zero='true'] .r04-bar-track span { display: none; }
.r04-duration-text { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (max-width: 49rem) {
  .r04-figures { grid-template-columns: minmax(0, 1fr); }
  .r04-figure:has(.r04-bars) { grid-row: 1; }
}
@media (max-width: 30rem) {
  .r04-readouts > div { padding: .5rem .32rem; }
  .r04-controls .game-choices { display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .r04-controls .game-choices button { padding-inline: .3rem; font-size: .76rem; }
}

.sequence-cases { margin-bottom: .85rem; }
.sequence-challenge .lab-heading h3, .packing-challenge .lab-heading h3 { font: 400 clamp(2rem,4.7vw,3.15rem)/.98 var(--serif); margin-bottom: .38rem; }
.sequence-challenge .cube-canvas { height: clamp(12rem,25vw,18rem); }
.sequence-progress { color: #e0ead5; margin: .46rem 0 -.24rem; font-size: .79rem; }
[data-verdict='loose'] #seq-result { color: #ffdfac; border-color: #e8ae74; }

.squeeze-game { margin-top: 1.7rem; }
.squeeze-game .lab-heading h3, .unit-game .lab-heading h3 { color: #f5f7fa; }
.squeeze-game .lab-heading p, .unit-game .lab-heading p { color: #dbe7f5; }
.squeeze-inputs, .unit-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem 1rem; margin-bottom: .75rem; }
.control-label { display: block; margin-bottom: .3rem; color: #dce9f2; font-size: .83rem; font-weight: 700; }
.squeeze-inputs .guide-range { flex: 1 1 12.5rem; max-width: 20rem; margin: 0; }
.squeeze-inputs .guide-range label, .overlap-controls .guide-range label { min-width: 0; color: #e4edf6; }
.squeeze-inputs .guide-range output, .overlap-controls .guide-range output { color: var(--bright); }
.squeeze-inputs input, .overlap-controls input { accent-color: var(--bright); }
#squeeze-height, #unit-focus {
  min-height: 2.65rem;
  padding: .4rem .67rem;
  border: 1px solid #acbfce;
  border-radius: .17rem;
  background: var(--panel-deep);
  color: #eff5f8;
  font-size: .84rem;
  font-weight: 700;
}
#squeeze-height[aria-pressed='true'], #unit-focus[aria-pressed='true'] { background: var(--bright); color: #182335; }
.squeeze-diagram {
  margin: .62rem 0 .75rem;
  padding: .63rem .5rem .16rem;
  border: 1px solid #798ca8;
  border-radius: .24rem;
  background: #132237;
}
.squeeze-key { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; color: #e8f1f4; font-size: .84rem; }
.squeeze-key > span { display: inline-flex; align-items: center; gap: .32rem; }
.squeeze-key i { width: .64rem; height: .64rem; border-radius: 50%; background: #a8e8f0; }
.squeeze-key > span + span i { background: #ffc38c; }
.squeeze-canvas { display: block; width: 100%; height: 7.2rem; }
.squeeze-game .explanation { margin-bottom: 0; border-color: #7e92ad; background: #132237; color: #e4eaf1; }
.squeeze-game .explanation summary { color: #c6eff7; }

.unit-game { background: radial-gradient(ellipse at 78% 45%, #455c9b88, transparent 65%), var(--panel); border-color: #6c7eac; }
.unit-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(11rem, .75fr); align-items: stretch; gap: .6rem; margin-block: .75rem; }
.unit-grid .lab-figure {
  margin: 0;
  border: 1px solid #6e80aa;
  border-radius: .22rem;
  background: radial-gradient(ellipse at center, #283963 0%, #14213e 80%);
}
.unit-grid canvas { display: block; width: 100%; height: clamp(10.75rem, 26vw, 17rem); }
.unit-grid figcaption { margin: 0; padding: .5rem .65rem; color: #d7e0f1; }
.unit-views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-block: .85rem; }
.unit-view {
  margin: 0;
  padding: .65rem .55rem .5rem;
  min-width: 0;
  border: 1px solid #8295bb;
  border-radius: .22rem;
  background: radial-gradient(ellipse at center, #2b3d66, #14213e 78%);
}
.unit-view figcaption { display: grid; gap: .18rem; margin: 0; color: #e7efff; text-align: center; }
.unit-view figcaption strong { font-size: .89rem; }
.unit-view figcaption span { color: #c9d9f5; font-size: .77rem; font-variant-numeric: tabular-nums; }
.unit-view canvas { display: block; width: 100%; height: clamp(7.4rem, 24vw, 13rem); }
.projection-game .unit-view-length { margin: 0; color: #ffdc93; text-align: center; font-weight: 720; font-size: .85rem; }
.unit-views[data-view='1'] [data-plane='1'], .unit-views[data-view='2'] [data-plane='2'] { border-color: #ffdc93; }
.unit-views[data-view='1'] [data-plane='2'] canvas, .unit-views[data-view='2'] [data-plane='1'] canvas { opacity: .3; }
.unit-views[data-view='1'] [data-plane='2'] .unit-view-length, .unit-views[data-view='2'] [data-plane='1'] .unit-view-length { color: #c9d9f5; }
.projection-game .projection-prompt { margin: 0 0 .55rem; color: #e7efff; }
.projection-game .view-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 25rem;
  margin-bottom: .7rem;
}
.view-choices button { padding-inline: .35rem; }
.unit-controls .unit-angle { flex: 1 1 15rem; max-width: 23rem; margin: 0; }
.unit-angle label { min-width: 0; color: #e4edf6; }
.unit-angle output { color: var(--bright); }
.unit-angle input { accent-color: var(--bright); }
.unit-score, .unit-equation, .overlap-score > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .35rem;
  padding: clamp(.7rem, 2.6vw, 1.5rem);
  border: 1px solid #788ab2;
  border-radius: .22rem;
  background: #172440;
  color: #e2eaf9;
  font-size: .83rem;
}
.unit-score strong, .unit-equation strong, .overlap-score strong { color: #ffdc93; font: 650 clamp(1rem,2.7vw,2.1rem)/1.15 ui-monospace, monospace; }
.unit-score strong { font: 400 clamp(3rem, 6.8vw, 6rem)/.88 var(--serif); }
.diagonal-readout {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: baseline;
  gap: .25rem .45rem;
  margin-top: .58rem;
  padding-top: .55rem;
  border-top: 1px solid #7082a1;
}
.diagonal-readout strong { color: #ffdc93; font: 680 1.22rem/1 ui-monospace, monospace; text-align: end; }
.diagonal-readout > span:last-child { grid-column: 1 / -1; color: #f1d7b0; }
.overlap-score { display: grid; gap: .45rem; }
.overlap-controls .guide-range { flex: 1 1 13rem; margin: 0; }
.field-note { color: #415472; }

.reasoning-check {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: .9rem 1.5rem;
  padding: clamp(.85rem,3vw,1.8rem);
  border: 1px solid #a9bcc5;
  border-top: 3px solid var(--accent-ink);
  background: linear-gradient(135deg, var(--lightwash) 30%, #fbf7ea);
}
.reasoning-check .eyebrow { color: var(--accent-ink); }
.reasoning-check h2 { font-size: clamp(2.1rem,4.8vw,3.45rem); }
.reasoning-check p { margin-bottom: 0; }
.reasoning-choices { display: grid; gap: .42rem; }
.reasoning-choices details { background: #fffdf6; border: 1px solid #a2afb8; border-radius: .14rem; }
.reasoning-choices summary {
  min-height: 2.75rem;
  padding: .62rem .65rem;
  color: var(--accent-ink);
  background: transparent;
  font-weight: 720;
  line-height: 1.3;
  cursor: pointer;
}
.reasoning-choices details[open] { border-color: var(--accent-ink); }
.reasoning-choices details p { margin: 0; padding: 0 .7rem .75rem; color: #293e4b; font-size: .91rem; }
.reasoning-choices a { padding-block: .28rem; color: var(--accent-ink); font-size: .85rem; font-weight: 700; }

.sample-rivals { margin-top: 1.7rem; background: radial-gradient(ellipse at 93% 54%, #396f6788, transparent 62%), var(--panel); }
.sample-rivals .lab-heading h3 { color: #f4f5ee; }
.sample-rivals .lab-heading p { color: #ddf0ed; }
.sample-rival-inputs { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1.2rem; }
.sample-rival-inputs .guide-range { flex: 1 1 13rem; max-width: 24rem; margin: 0; }
.sample-rival-inputs .guide-range label { color: #dff6ef; min-width: 0; }
.sample-rival-inputs output { color: var(--bright); }
.sample-rival-inputs input { accent-color: var(--bright); }
.sample-reveal {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  min-height: 2.75rem;
  padding: .38rem .65rem;
  border: 1px solid #91b6ae;
  border-radius: .2rem;
  font-size: .86rem;
  font-weight: 680;
}
.sample-rival-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(10rem,.8fr); gap: .65rem; margin-block: .7rem; }
.sample-rival-grid .lab-figure { margin: 0; padding: .26rem; border: 1px solid #6b9d98; border-radius: .24rem; background: var(--panel-deep); }
.sample-rival-grid canvas { display: block; width: 100%; height: clamp(10rem,22vw,14rem); }
.sample-rival-grid figcaption { padding-inline: .42rem; color: #d3e8e2; }
.sample-comparison { display: grid; align-content: start; gap: .4rem; }
.sample-comparison > div { display: grid; gap: .4rem; padding: .65rem .72rem; border: 1px solid #6b9d98; border-radius: .19rem; background: var(--panel-deep); }
.sample-comparison span { color: #dfefe9; font-size: .83rem; }
.sample-comparison code, .sample-comparison strong { color: #a9ecd8; font-size: clamp(.84rem,2vw,1.12rem); }
.sample-comparison > div:nth-child(2) code { color: #ffc68c; }

.packing-narrowing {
  margin-block: 1.1rem .7rem;
  padding: clamp(.6rem,2vw,1rem);
  border-radius: .25rem;
  border: 1px solid #a88071;
  background: #4c3126;
}
.packing-counts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .45rem; }
.packing-counts button {
  display: grid;
  align-content: start;
  gap: .22rem;
  padding: .55rem clamp(.25rem,1.5vw,.8rem);
  border: 1px solid #c3a393;
  border-radius: .19rem;
  background: #3b2822;
  color: #f4e5d7;
  text-align: left;
}
.packing-counts button[aria-pressed='true'] { background: #654331; border-color: #ffd298; box-shadow: inset 0 2px #ffd298; }
.packing-counts button:hover { background: #654331; }
.packing-counts strong { color: #ffd298; font: 400 clamp(1.95rem,5vw,4.2rem)/.95 var(--serif); }
.packing-counts span { font-size: .83rem; font-weight: 700; line-height: 1.2; }
.packing-narrowing .game-feedback { margin-top: .6rem; min-height: 3.05rem; border-color: #ffd298; }

.next-reading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  column-gap: 1.1rem;
  margin-bottom: 2rem;
  padding: clamp(.8rem,2.7vw,1.4rem);
  border: 1px solid #b1c0c7;
  border-left: .2rem solid var(--accent-ink);
  background: var(--lightwash);
  color: var(--ink);
  text-decoration: none;
}
.next-reading:hover strong { text-decoration: underline; text-underline-offset: .11em; }
.next-reading :is(span,strong) { display: block; color: var(--accent-ink); }
.next-reading span { font-size: .76rem; font-weight: 700; }
.next-reading strong { font: 400 clamp(1.65rem,4vw,2.75rem)/1.1 var(--serif); }
.next-reading p { margin: .3rem 0 0; color: #344a53; font-size: .91rem; }
.next-reading > b { color: var(--accent-ink); font-size: 1.4rem; }

@media (min-width: 68rem) {
  .guide .lesson-nav { position: sticky; z-index: 5; top: 0; background: #f5f0e7f7; box-shadow: 0 .28rem .6rem #463c2912; }
  .guide :is(.lesson,.squeeze-game,#matrix-scene-title,#cell-result) { scroll-margin-top: 4.35rem; }
}

@media (max-width: 48rem) {
  .discovery-heading { grid-template-columns: minmax(0, 1fr); }
  .study-home .opening h1 { font-size: clamp(2.4rem, 11.65vw, 5.4rem); }
  .reasoning-check { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 30rem) {
  .game-body, .growth-inner { grid-template-columns: minmax(0,1fr); }
  .game-banner > button { margin-inline-start: 0; }
  .growth-game .game-toggle { margin-left: 0; }
  .growth-poster { min-height: 7.4rem; }
  .discovery-heading h1 { font-size: clamp(2.95rem, 12vw,4.6rem); }
  .discovery-note { padding-inline: .7rem; }
  .study-home .folio-copy h3 { font-size: clamp(1.82rem,8vw,2.45rem); }
  .study-home .folio { grid-template-columns: minmax(5.8rem,.53fr) minmax(0,1fr); }
  .study-home .opening-actions { align-items: flex-start; }
  .unit-grid { grid-template-columns: minmax(0,1fr); }
  .unit-score { display: grid; grid-row: 1; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: center; }
  .unit-score > span:nth-of-type(2) { grid-row: 3; grid-column: 1; }
  .unit-score > strong { grid-row: 2; grid-column: 1; }
  .overlap-score { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .diagonal-readout { grid-row: 1 / 4; grid-column: 2; border-top: 0; border-left: 1px solid #7082a1; margin: 0; padding: .3rem 0 .3rem .55rem; }
  .diagonal-readout strong { grid-column: 1 / -1; text-align: left; font-size: 1.72rem; }
  .sample-rival-grid { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .study-home .folio, .discovery-action { transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
  .study-home .folio:hover { box-shadow: 0 .48rem .85rem #2437461c; }
  .ceiling-track span::before { transition: background-color 160ms ease, box-shadow 160ms ease; }
}
