/*
Copyright (C) 2026 Loophole, LLC.
SPDX-License-Identifier: AGPL-3.0-only
See https://github.com/Loophole-LLC/Jayce/blob/main/LICENSE.md for terms and warranty information.

Styles for the interactive JAYCE lesson (jayce-toy-learning.html). Moved from the JAYCE repository's
docs/ page; rules are scoped to .lesson so they can share a page with the site's styles.css.
*/

/* Clears the site's fixed header (see the 820px rule at the end for its taller mobile form). */
.jayce-page { padding: 136px 18px 40px; }

.jayce-intro {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  max-width: 1100px;
  margin: 12px auto 44px;
}
.jayce-intro__logo { width: 100%; height: auto; padding: 0; }
.jayce-intro h1 { max-width: 650px; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.1; letter-spacing: -.035em; }
.jayce-intro__copy > p:not(.eyebrow) { margin: 18px 0 0; color: var(--text-muted); line-height: 1.65; }
.jayce-intro__license a { color: var(--white); text-underline-offset: 4px; }
.jayce-intro .link-row { gap: 12px 24px; font-size: .94rem; }

.jayce-overview { max-width: 1100px; margin: 0 auto 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.jayce-overview h2 { margin: 0 0 16px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.025em; }
.jayce-overview p { max-width: 84ch; color: var(--text-muted); line-height: 1.65; }
.jayce-overview p a { color: var(--white); text-underline-offset: 4px; }
.jayce-comparison { width: 100%; margin: 24px 0; border-collapse: collapse; table-layout: fixed; font-size: .95rem; }
.jayce-comparison caption { margin-bottom: 10px; color: var(--text-muted); text-align: left; font-size: .85rem; }
.jayce-comparison th, .jayce-comparison td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.jayce-comparison thead { background: var(--surface); }
.jayce-comparison th:first-child { width: 18%; }
.jayce-comparison td { color: var(--text-muted); }
.jayce-chat-note { margin-top: 28px; padding: 22px 24px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--accent-soft); }
.jayce-chat-note h3 { margin: 0 0 12px; font-size: 1.2rem; }
.jayce-overview .jayce-learning-flow { color: var(--white); font-weight: 650; }

.lesson {
  color-scheme: light;
  color: var(--ink);
  font-family: ui-rounded, "Avenir Next", Avenir, system-ui, sans-serif;
  line-height: normal;
  text-rendering: auto;
  --ink: #202a35;
  --muted: #5e6c79;
  --paper: #fbfcfd;
  --line: #dfe6ed;
  --blue: #4678ab;
  --car: #4c78a8;
  --truck: #df8d36;
  --train: #8d68a8;
  --bike: #4d927d;
  --board: #d36f83;
  --skate: #4097aa;
}
.lesson { max-width: 1120px; margin: 16px auto; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: 0 14px 44px #26394b12; }
:where(.lesson) h1, :where(.lesson) h2, :where(.lesson) h3, :where(.lesson) p { max-width: none; margin-top: 0; line-height: normal; letter-spacing: normal; overflow-wrap: normal; }
.lesson-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.lesson-eyebrow { margin: 0 0 7px; color: #4777a2; font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.lesson-hero h2 { margin-bottom: 6px; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.045em; }
.lesson-hero p:last-child { max-width: 690px; margin-bottom: 0; color: var(--muted); line-height: 1.5; }
.tag { flex: none; padding: 9px 12px; border: 1px solid #cfdeeb; border-radius: 999px; background: #f0f6fb; color: #3f6790; font-size: 12px; font-weight: 800; }
.main-grid { display: grid; grid-template-columns: minmax(390px, 1fr) minmax(390px, .96fr); gap: 14px; }
.panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.panel-heading h2, .panel-heading h3 { margin: 0; font-size: 15px; }
.micro { color: var(--muted); font-size: 10px; }
.bins { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bin { --class: var(--car); padding: 9px; border: 1px solid color-mix(in srgb, var(--class) 25%, white); border-radius: 12px; background: color-mix(in srgb, var(--class) 5%, white); transition: .25s ease; }
.bin.active { border-color: var(--class); background: color-mix(in srgb, var(--class) 11%, white); box-shadow: 0 0 0 2px color-mix(in srgb, var(--class) 12%, transparent); }
.bin-name { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 7px; color: var(--class); font-size: 12px; font-weight: 850; }
.bin-name span:first-child { color: var(--ink); }
.label-id { flex: none; padding: 3px 6px; border-radius: 99px; background: #edf1f4; color: #607080; font-size: 9px; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.slot { min-height: 36px; display: flex; align-items: center; gap: 6px; padding: 6px; border: 1px dashed #ccd6df; border-radius: 8px; background: #ffffffb8; color: #7c8994; font-size: 10px; }
.slot.filled { border-style: solid; border-color: color-mix(in srgb, var(--class) 30%, white); color: var(--ink); }
.slot.just-filled { animation: pop .42s ease; }
.toy-icon { font-size: 20px; line-height: 1; }
.new-example { display: flex; align-items: center; gap: 12px; margin-top: 13px; padding: 10px 12px; border-radius: 12px; background: #f1f4f6; }
.new-toy { width: 48px; height: 48px; display: grid; flex: none; place-items: center; border-radius: 12px; background: white; box-shadow: 0 2px 9px #26394b15; font-size: 29px; }
.new-copy strong { display: block; font-size: 12px; }
.new-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.field-note { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.feedback { display: none; margin-top: 9px; padding: 9px 11px; border-left: 3px solid #8d68a8; border-radius: 0 9px 9px 0; background: #f5f0f8; font-size: 11px; line-height: 1.45; }
.feedback.show { display: block; }
.feedback b { color: #694d82; }
.map { position: relative; height: 302px; overflow: hidden; border: 1px solid #dce4e9; border-radius: 12px; background-color: #fcfdfd; background-image: linear-gradient(#60708012 1px, transparent 1px), linear-gradient(90deg, #60708012 1px, transparent 1px); background-size: 20% 20%; }
.map:before { content: "MORE BODY BULK  ↑"; position: absolute; top: 8px; left: 8px; color: #758391; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.map:after { content: "LONGER BODY  →"; position: absolute; right: 9px; bottom: 7px; color: #758391; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.map-marker { position: absolute; z-index: 2; display: flex; align-items: center; gap: 3px; padding: 4px 5px; border: 1px solid color-mix(in srgb, var(--class) 52%, white); border-radius: 999px; background: white; box-shadow: 0 2px 7px #25394b1c; opacity: 0; transform: translate(-50%, -50%) scale(.8); transition: left .55s ease, top .55s ease, opacity .25s, transform .25s, box-shadow .25s; white-space: nowrap; }
.map-marker.visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.map-marker.selected { z-index: 3; box-shadow: 0 0 0 4px color-mix(in srgb, var(--class) 18%, transparent), 0 2px 8px #25394b24; }
.map-marker.query { z-index: 5; border: 2px solid #202a35; font-size: 22px; }
.map-marker b { color: var(--class); font-size: 8px; }
.link { position: absolute; z-index: 1; height: 2px; border-top: 2px dashed #273746; opacity: 0; transform-origin: 0 50%; transition: opacity .2s; }
.link.show { opacity: .65; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 9px; color: var(--muted); font-size: 9px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--class); }
.status { min-height: 58px; margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--blue); border-radius: 0 9px 9px 0; background: #f0f5f9; }
.status strong { display: block; font-size: 12px; }
.status span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.lower-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 14px; margin-top: 14px; }
.lower-grid h3 { margin-bottom: 7px; font-size: 13px; }
.lower-grid p { margin: 0; color: #4f5e6a; font-size: 10px; line-height: 1.55; }
.math { grid-column: 1 / -1; }
.math-intro { margin: -2px 0 9px !important; }
.math-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 7px; }
.calc { padding: 8px 9px; border: 1px solid #e0e7ec; border-radius: 9px; background: #f9fbfc; }
.calc.winner { border-color: #80a98d; background: #eef7f0; }
.calc strong { display: block; font-size: 10px; }
.calc span { display: block; margin-top: 3px; color: #596874; font-size: 9px; line-height: 1.4; }
.math-answer { margin-top: 8px !important; color: #3c7050 !important; font-weight: 800; }
.controls { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.lesson button { min-height: 44px; padding: 8px 12px; border: 1px solid #d2dce4; border-radius: 9px; background: white; color: var(--ink); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.lesson button.primary { border-color: #4678ab; background: #4678ab; color: white; }
.lesson button:disabled { opacity: .45; cursor: default; }
.progress { flex: 1; color: var(--muted); text-align: right; font-size: 10px; }
.track { height: 4px; margin-top: 5px; overflow: hidden; border-radius: 9px; background: #e2e8ed; }
.fill { width: 0; height: 100%; border-radius: inherit; background: #6f9d7d; transition: width .3s; }
.foot { margin: 10px 1px 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
@keyframes pop { 50% { transform: scale(1.06); background: white; } }
@media (max-width: 850px) {
  .jayce-intro { grid-template-columns: 1fr; gap: 24px; margin: 8px 10px 30px; }
  .jayce-intro__logo { width: 240px; }
  .jayce-overview { margin: 0 10px 30px; }
  .jayce-comparison { font-size: .875rem; }
  .jayce-comparison th:first-child { width: 24%; }
  .jayce-comparison th, .jayce-comparison td { padding: 12px 7px; }
  .jayce-chat-note { padding: 18px; }
  .jayce-page { padding: 148px 8px 24px; }
  .lesson { margin: 4px auto; padding: 15px; }
  .main-grid, .lower-grid { grid-template-columns: 1fr; }
  .math { grid-column: auto; }
  .lesson-hero { flex-direction: column; gap: 10px; }
  .map { height: 270px; }
}
@media (prefers-reduced-motion: reduce) { .lesson *, .lesson *:before, .lesson *:after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
@media (max-width: 480px) {
  .slots { grid-template-columns: 1fr; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; }
  .progress { grid-column: 1 / -1; }
}

/* The site's Content-Security-Policy blocks inline style attributes, so the per-label colors that
   used style="--class:..." are keyed on data-class instead. */
.bin[data-class="board"], .dot[data-class="board"] { --class: var(--board); }
.bin[data-class="bike"], .dot[data-class="bike"] { --class: var(--bike); }
.bin[data-class="car"], .dot[data-class="car"] { --class: var(--car); }
.bin[data-class="truck"], .dot[data-class="truck"] { --class: var(--truck); }
.bin[data-class="train"], .dot[data-class="train"] { --class: var(--train); }
.bin[data-class="skate"], .dot[data-class="skate"] { --class: var(--skate); }

.lesson .foot a { color: var(--blue); }

/* Same breakpoint and clearance the site's .hero uses for the taller, non-fixed mobile header. */
@media (max-width: 820px) { .jayce-page { padding-top: 220px; } }
