/* The School (school.html, school/*.html) and the Marketplace (marketplace.html), on top of home.css. The home
   page's type scale, section rhythm and hero (S102, docs/homepage_research.md). Light only. Real footage and real
   files: every lesson runs in the FORGE Studio simulator. Nothing moves until the visitor asks. */

.school {
  --t-h1: clamp(36px, 3.8vw, 52px);
  --t-h2: clamp(28px, 2.8vw, 38px);
  --t-h3: 20px;
  --t-lead: clamp(18px, 1.4vw, 21px);
  --t-body: 17px;
  --t-small: 15px;
  --sec-pad: clamp(64px, 8vw, 104px);
}
.school main { overflow-x: clip; }

/* ================================================================================================ the School page */

/* The hero: the words beside the start of the path, lessons 1 and 2 (written by tools/school/gen.mjs). */
.sc-hero-path { list-style: none; margin: 0; padding: 0 0 0 0; display: grid; gap: 16px; position: relative; }
.sc-hero-path::before { content: ""; position: absolute; left: 24px; top: 24px; bottom: 24px; width: 2px; background: var(--navy-100); }
.sc-hero-step {
  position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; gap: 20px;
  padding: 12px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none;
  box-shadow: 0 18px 44px rgba(20, 51, 107, .1); transition: border-color .2s ease, box-shadow .2s ease;
}
.sc-hero-path li:nth-child(2) { margin-left: clamp(24px, 4vw, 56px); }
.sc-hero-step:hover { border-color: var(--navy-100); box-shadow: var(--shadow-2); }
.sc-hero-step:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sc-hero-step img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-btn); display: block; }
.sc-hero-step .in { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sc-hero-step .n { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.sc-hero-step b { font-size: 19px; line-height: 1.25; letter-spacing: -.01em; }
.sc-hero-step .meta { font-size: 14.5px; color: var(--ink-2); }
@media (max-width: 520px) { .sc-hero-step { grid-template-columns: 1fr; } .sc-hero-path li:nth-child(2) { margin-left: 0; } .sc-hero-path::before { content: none; } }

/* The Lesson Path: one line of numbered stops, each a card with the lesson's picture, outcome and time. */
.sc-path { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 20px; position: relative; max-width: 1080px; }
.sc-path::before { content: ""; position: absolute; left: 21px; top: 24px; bottom: 24px; width: 2px; background: linear-gradient(var(--navy-100, #d6e0f0), var(--line)); }
.sc-path > li { position: relative; padding-left: 68px; }
.sc-num {
  position: absolute; left: 0; top: 22px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 600; font-size: 17px; box-shadow: 0 0 0 6px var(--surface);
}
.sc-step {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); text-decoration: none; color: inherit; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s var(--ease);
}
.sc-step:hover { border-color: var(--navy-100, #d6e0f0); box-shadow: var(--shadow-2); }
.sc-step:hover .sc-go { color: var(--navy-600); }
.sc-step:active { transform: scale(.995); }
.sc-step:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sc-step img { width: 100%; height: 100%; min-height: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; display: block; background: var(--surface-2); }
.sc-step .in { display: flex; flex-direction: column; gap: 6px; padding: 22px 26px 24px; min-width: 0; }
.sc-step .n { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.school main .sc-step h3 { margin: 0; font-size: 22px; letter-spacing: -.015em; line-height: 1.25; }
.sc-step p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.55; }
.sc-foot { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.sc-step .meta { font-size: 14px; font-weight: 600; color: var(--ink); background: var(--surface-2); border-radius: var(--r-pill); padding: 5px 12px; }
.sc-go { font-weight: 600; color: var(--navy); border-bottom: 1.5px solid currentColor; }
@media (max-width: 800px) {
  .sc-step { grid-template-columns: 1fr; }
  .sc-step img { height: auto; min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 600px) {
  .sc-path::before { left: 15px; }
  .sc-path > li { padding-left: 46px; }
  .sc-num { width: 32px; height: 32px; font-size: 15px; top: 14px; box-shadow: 0 0 0 4px var(--surface); }
  .sc-step .in { padding: 18px 18px 20px; }
}

/* Learn It with Your AI */
.sc-ai { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.sc-ask-h { margin: 28px 0 8px; font-size: var(--t-small); color: var(--ink-3); }
.sc-ask { margin: 0 0 22px; padding: 16px 20px; background: var(--navy-50); border-radius: var(--r-card); font-size: 18px; font-weight: 600; color: var(--ink); max-width: 36ch; }
.sc-ways { margin: 0; display: grid; gap: 22px; }
.sc-ways > div { border-top: 2px solid var(--navy); padding-top: 14px; }
.sc-ways dt { font-weight: 600; font-size: 19px; }
.sc-ways dd { margin: 6px 0 0; color: var(--ink-2); font-size: var(--t-body); line-height: 1.55; }
.sc-skip { margin: 24px 0 0; color: var(--ink-3); font-size: var(--t-small); }
@media (max-width: 860px) { .sc-ai { grid-template-columns: 1fr; } }

/* Before You Start */
.sc-start { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 48px; }
.sc-start .hm-actions { margin-top: 24px; }

/* ================================================================================================ a lesson */

.ls-hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.ls-crumbs { padding-top: clamp(20px, 3vw, 32px); margin-bottom: 0; }
.ls-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: 18px 0 clamp(40px, 5vw, 64px); }
.ls-top > * { min-width: 0; }
.ls-top-solo { grid-template-columns: minmax(0, 1fr); }
.ls-top-solo > div { max-width: 66ch; }
.ls-part { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.ls-top h1 { font-size: clamp(34px, 3.8vw, 54px); line-height: 1.06; letter-spacing: -.032em; font-weight: 600; margin: 0; text-wrap: balance; }
.ls-top .hm-lead { max-width: 54ch; }
.ls-facts { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ls-facts li { font-size: 14.5px; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px 12px; }
.ls-facts li:first-child { background: var(--navy-50); border-color: transparent; }
.ls-facts li b { color: var(--navy); font-weight: 600; }
.ls-start { margin: 22px 0 0; }
.ls-film { margin: 0; }
.ls-film figcaption { margin: 12px 0 0; font-size: var(--t-small); color: var(--ink-3); }
@media (max-width: 900px) { .ls-top { grid-template-columns: 1fr; } .ls-film { order: -1; } }

/* At a glance: the goal, what you need, and the AI box, as three columns in one panel (S166 taste 12). */
.ls-glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin: clamp(32px, 4vw, 48px) 0; box-shadow: none; padding: 26px 28px; }
.ls-glance > section { min-width: 0; }
.ls-glance h2 { font-size: 18px; letter-spacing: -.01em; margin: 0 0 8px; }
.ls-glance p, .ls-glance li { color: var(--ink-2); font-size: 15.5px; line-height: 1.55; margin: 0 0 8px; }
.ls-glance ul { margin: 0; padding-left: 18px; }
.ls-glance p:last-child { margin-bottom: 0; }
.ls-glance a { color: var(--navy); font-weight: 600; }
.ls-ask { font-weight: 600; color: var(--ink) !important; background: var(--navy-50); border-radius: var(--r-btn); padding: 8px 12px; user-select: all; overflow-wrap: anywhere; }
.ls-top-note { margin: 0 0 clamp(28px, 4vw, 44px); }
/* Callouts are a tint, not a coloured stripe (S166 taste 4). */
.ls-note { background: var(--surface-2); border-radius: var(--r-card); padding: 14px 18px; max-width: 76ch; }
.ls-note p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.6; }
.ls-warn { background: var(--warn-bg); }
.ls-warn p { color: var(--ink); }
@media (max-width: 900px) { .ls-glance { grid-template-columns: 1fr; gap: 24px; padding: 20px; } }

/* The lesson's text beside its contents. */
.ls-body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(32px, 5vw, 72px); align-items: start; padding-bottom: clamp(64px, 9vw, 120px); }
.ls-body > * { min-width: 0; }
.ls-art { min-width: 0; }
.ls-art > section { padding-bottom: clamp(28px, 4vw, 44px); }
.ls-art > section + section { border-top: 1px solid var(--line); padding-top: clamp(28px, 4vw, 44px); }
.ls-art h2 { font-size: clamp(26px, 2.4vw, 32px); letter-spacing: -.022em; font-weight: 600; margin: 0 0 16px; scroll-margin-top: calc(var(--header-h) + 16px); }
.ls-art h3 { font-size: 18.5px; font-weight: 600; margin: 26px 0 8px; scroll-margin-top: calc(var(--header-h) + 16px); }
.ls-art p, .ls-art li { color: var(--ink-2); font-size: 16.5px; line-height: 1.65; }
.ls-art p { margin: 0 0 12px; max-width: 68ch; }
.ls-art ul, .ls-art ol { margin: 0 0 12px; padding-left: 22px; max-width: 68ch; }
.ls-art li + li { margin-top: 6px; }
.ls-art b.ui { font-weight: 600; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.ls-learn { list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.ls-learn li { position: relative; padding-left: 30px; margin: 0 !important; }
.ls-learn li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 12px; height: 7px; border-left: 2.5px solid var(--navy); border-bottom: 2.5px solid var(--navy); transform: rotate(-45deg); }

/* Step by Step: each step a card with its number, its time, its place in Studio, what to do, the exact values and
   how you know it worked. */
.ls-steps { counter-reset: s; list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 18px; max-width: none !important; }
.ls-art .ls-gen > li {
  counter-increment: s; position: relative; margin: 0; padding: 22px 24px 22px 76px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-card); scroll-margin-top: calc(var(--header-h) + 16px);
}
.ls-gen > li::before {
  content: counter(s); position: absolute; left: 22px; top: 20px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 15px;
}
.ls-gen > li.ls-task::before { background: var(--surface); color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.ls-art .ls-gen h3 { margin: 4px 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; font-size: 19px; }
.ls-time { font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.ls-gen h3 .ls-time { background: var(--surface-2); border-radius: var(--r-pill); padding: 3px 10px; }
.ls-art .ls-yours { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.ls-art .ls-where { font-size: 15px; color: var(--ink-3); }
.ls-art .ls-do { margin: 4px 0 14px; }
.ls-vals { border: 1px solid var(--line-2); background: var(--paper); border-radius: var(--r-btn); padding: 12px 16px; margin: 8px 0 14px; max-width: 68ch; }
.ls-art .ls-vals-h { font-size: 13px; font-weight: 600; color: var(--ink-3); margin: 0 0 6px; }
.ls-vals dl { margin: 0; display: grid; gap: 6px; }
.ls-vals dl > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; border-top: 1px solid var(--line); padding-top: 6px; }
.ls-vals dl > div:first-child { border-top: 0; padding-top: 0; }
.ls-vals dt { color: var(--ink-2); font-size: 15.5px; overflow-wrap: anywhere; }
.ls-vals dd { margin: 0; text-align: right; }
.ls-art .ls-vals code { font-family: var(--mono, ui-monospace, Consolas, monospace); font-size: 15.5px; font-weight: 600; background: var(--surface-2); border-radius: 5px; padding: 2px 8px; color: var(--ink); overflow-wrap: anywhere; }
.ls-art .ls-done { background: var(--ok-bg); border-radius: var(--r-btn); padding: 10px 14px; margin-bottom: 0; }
.ls-done span { display: block; font-size: 13px; font-weight: 600; color: var(--ok); }
.ls-pic { margin: 14px 0 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-btn); padding: 8px; }
.ls-pic img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
/* Blocks on a phone: shrunk to the screen they cannot be read, so they keep Studio's own size and the box slides
   sideways under the finger (the page itself never does). */
@media (max-width: 700px) {
  .ls-steps > li { min-width: 0; }
  .ls-pic:has(img[src*="/blocks/"]) { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .ls-pic img[src*="/blocks/"] { max-width: none; }
}

/* The side column: contents and files as plain lists, the next lesson the one box, the one thing to press. */
.ls-side { display: grid; gap: 24px; position: sticky; top: calc(var(--header-h) + 16px); }
.ls-side .panel { margin: 0; box-shadow: none; }
.ls-side h2 { font-size: 18px; margin: 0 0 8px; }
.ls-files-box { padding-top: 18px; border-top: 1px solid var(--line); }
.ls-side p, .ls-side li { color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.ls-toc { max-height: calc(100dvh - var(--header-h) - 48px); overflow: auto; }
.ls-toc ol { margin: 6px 0 0; padding-left: 30px; } /* room for "27." inside the scrolling list */
.ls-toc li { font-size: 15px; }
.ls-toc li + li { margin-top: 4px; }
.ls-toc a { color: var(--ink-2); text-decoration: none; }
.ls-toc a:hover { color: var(--navy); text-decoration: underline; }
.ls-toc .ls-time { margin-left: 4px; font-weight: 500; }
.ls-files { list-style: none; padding: 0 !important; margin: 10px 0 0 !important; display: grid; gap: 8px; }
.ls-files .btn { max-width: 100%; white-space: normal; text-align: left; overflow-wrap: anywhere; }
.ls-next { display: block; text-decoration: none; color: inherit; transition: border-color .2s ease, box-shadow .2s ease; }
.ls-next:hover { border-color: var(--navy-100, #d6e0f0); box-shadow: var(--shadow-2); }
.ls-next small { display: block; color: var(--ink-3); font-size: 13.5px; font-weight: 600; }
.ls-next b { display: block; margin-top: 4px; font-size: 18px; }
.ls-next span { display: block; color: var(--ink-2); font-size: 15px; line-height: 1.5; margin-top: 6px; }
.ls-art .ls-next { max-width: 68ch; }
@media (max-width: 900px) {
  .ls-body { grid-template-columns: 1fr; }
  .ls-side { position: static; }
  .ls-toc, .ls-side-gen > .ls-next { display: none; }
}
@media (max-width: 600px) {
  .ls-art p, .ls-art li { font-size: 16px; }
  .ls-art .ls-gen > li { padding: 18px 16px 18px 16px; }
  .ls-gen > li::before { position: static; margin-bottom: 10px; width: 32px; height: 32px; font-size: 14px; }
  .ls-art b.ui { white-space: normal; }
  .ls-vals dl > div { grid-template-columns: 1fr; gap: 2px; }
  .ls-vals dd { text-align: left; }
}

/* ================================================================================================ the Marketplace */

/* The kinds are the filter (S166 taste 5): each chip with its one line and where it goes in Studio under it. */
.mk-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px clamp(16px, 2.4vw, 32px); margin: 28px 0 32px; }
.mk-kind p { margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.mk-kind .mk-where { display: block; margin-top: 4px; font-size: 13.5px; color: var(--ink-3); }
.mk-filter button { min-height: 44px; border: 1px solid var(--line-2); background: var(--paper); border-radius: var(--r-pill); padding: 0 20px; font: inherit; font-size: 15.5px; font-weight: 600; cursor: pointer; color: var(--ink-2); transition: background-color .15s, border-color .15s, color .15s; }
.mk-filter button:hover { border-color: var(--navy); color: var(--navy); }
.mk-filter button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.mk-filter button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 900px) { .mk-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .mk-filter { grid-template-columns: 1fr; } }
.mk-count { margin: 0 0 16px; font-size: var(--t-small); color: var(--ink-3); }
.mk-empty { margin: 0; color: var(--ink-2); font-size: var(--t-body); }
.mk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.mk-item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.mk-item img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--surface-2); }
.mk-item .in { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mk-item .kind { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.school main .mk-item h3 { margin: 0; font-size: 21px; letter-spacing: -.015em; }
.mk-item p { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
.mk-item .meta { margin-top: auto; padding-top: 10px; font-size: 13.5px; color: var(--ink-3); }
@media (max-width: 1000px) { .mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .mk-grid { grid-template-columns: 1fr; } }

.mk-how { list-style: none; counter-reset: s; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
.mk-how li { counter-increment: s; position: relative; padding-left: 52px; }
.mk-how li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 600; font-size: 15px;
}
.mk-how b { display: block; font-size: 18px; }
.mk-how span { display: block; margin-top: 4px; color: var(--ink-2); font-size: var(--t-body); line-height: 1.55; }
@media (max-width: 820px) { .mk-how { grid-template-columns: 1fr; } }
/* The hero picture (a still, no film) sits in the home page's film frame. */
.market .hm-film img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* For a board owner: the set-up lesson before the path (S160 W08). */
.sc-board { display: flex; flex-direction: column; gap: 4px; margin: 28px 0 0; max-width: 1080px; color: inherit; background: var(--navy-50); border-color: transparent; box-shadow: none; }
.sc-board-go { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; border-radius: 8px; }
.sc-board b { font-size: 19px; font-weight: 600; }
.sc-board span { color: var(--ink-2); }
.sc-board-go:hover b { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.sc-board-go:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
/* The four-step guide beside the lesson (S170 finding 4). */
.sc-board-short { margin: 10px 0 0; color: var(--ink-2); font-size: var(--t-small, 14.5px); }
.sc-board-short a, .ls-alt a { color: var(--navy); font-weight: 600; }
.ls-alt { margin: 14px 0 0; color: var(--ink-2); font-size: var(--t-body); line-height: 1.55; }
.hm-lead a { color: var(--navy); font-weight: 600; }
/* The download under "You Need", the board under the next lesson (S170 finding 3). */
.ls-get { margin: 10px 0 0 !important; }
.ls-real { margin: 18px 0 0; color: var(--ink-2); font-size: var(--t-body); }
/* The side column's next-lesson card steps aside while the main one is on screen (S170 finding 9). */
.ls-next-side { transition: opacity .2s ease, visibility .2s; }
.ls-next-side.ls-off { opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .ls-next-side { transition: none; } }
