/* n8n course hub, scroll preview. Page layer.
   Every colour, font, shadow and easing is a token from /assets/site/tokens.css,
   which is generated from 00-Core/brand/DESIGN.md. There is no hex in this file.
   The engine files (scrollcraft.css, scrollcraft.js) are untouched copies. */

:root {
  --sc-canvas: var(--page);
  --sc-surface: var(--surface);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--ink-2);
  --sc-accent: var(--gold);
  --sc-accent-ink: var(--ink);
  --sc-font-display: var(--font-head);
  --sc-font-text: var(--font-body);
  --hdr: 53px;          /* the site header's height (frame.css: 52px + 1px rule) */
  --gut: 16px;
  --wrap: 1120px;
  --r: 8px;
}
@media (min-width: 768px) { :root { --gut: 32px; } }

body { font-size: 16px; line-height: 1.5; letter-spacing: normal; background: var(--page); color: var(--ink); }
main { overflow-x: clip; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; margin: 0; text-wrap: balance; color: inherit; }
p, dl, dd, ol, figure { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: var(--teal-text); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.g-ink :focus-visible { outline-color: var(--gold); }
::selection { background: var(--teal-pale); color: var(--ink); }

/* Grounds are hard cuts, painted per section. No drift. */
.g-cream { background: var(--page); }
.g-white { background: var(--surface); }
.g-teal  { background: var(--teal-pale); }
.g-ink   { background: var(--ink); color: var(--on-dark); }

/* Pills, as on every template page (DESIGN.md "Buttons"). */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 980px; border: 1px solid transparent;
  font: 600 16px/1.2 var(--font-head); text-decoration: none; text-align: center; white-space: nowrap;
  transition: background-color 150ms var(--ease-ui), color 150ms var(--ease-ui), transform 120ms var(--ease-press);
}
.pill:active { transform: scale(0.98); }
.pill-primary { background: var(--teal); color: var(--on-dark); }
.pill-primary:hover { background: var(--teal-text); }
.pill-gold { background: var(--gold); color: var(--ink); }
.pill-gold:hover { background: var(--gold-hover); }

/* The label row: the course's facts set like a museum label. Reused on the
   start plate, so the ask reads as part of the collection. */
.label__facts, .start__facts {
  display: flex; flex-wrap: wrap; gap: 8px 0;
  font: 600 14px/21px var(--font-head); text-transform: uppercase; letter-spacing: 0.18em; color: var(--teal-text);
}
.label__facts span + span::before, .start__facts span + span::before {
  content: ""; display: inline-block; width: 1px; height: 14px; margin: 0 14px; vertical-align: -2px; background: var(--line-control);
}

/* ---------------------------------------------------------------- 1 LABEL */
.label { padding: 32px var(--gut) 64px; overflow: clip; }
.label__in { max-width: var(--wrap); margin: 0 auto; display: grid; gap: 48px; }
.label__copy { display: flex; flex-direction: column; align-items: flex-start; }
.label__copy > * + * { margin-top: 16px; }
@media (max-width: 767px) {
  .label { padding-top: 24px; }
  .label__cta { order: 1; margin-top: 20px !important; }
  .answer-capsule { order: 2; }
  .label__meta { order: 3; }
  .label__lead { font-size: 18px; }
  .label__facts, .start__facts { letter-spacing: 0.1em; }
  .label__facts, .start__facts { gap: 4px 16px; }
  .label__facts span + span::before, .start__facts span + span::before { display: none; }
}
.label h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.01em; max-width: 20ch; margin-top: 16px; }
.label__lead { font-size: 20px; line-height: 1.45; max-width: 36rem; }
.answer-capsule {
  max-width: 62ch; margin-top: 24px !important; padding: 12px 16px;
  font-size: 17px; line-height: 1.6; color: var(--ink);
  background: var(--gold-pale); border-left: 4px solid var(--gold); border-radius: 0 var(--r) var(--r) 0;
}
.label__meta { display: flex; gap: 24px; font-size: 14px; color: var(--ink-2); }
.label__meta strong { color: var(--ink); font-weight: 500; }
.label__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px !important; }

.label__media { position: relative; }
.plane { position: relative; }
.plane img { border-radius: var(--r); }
.plane--far, .plane--near { position: absolute; inset: 0; pointer-events: none; }
.plane--far img, .plane--near img { position: absolute; width: 34%; height: auto; max-width: none; }
.plane--far img { filter: saturate(0.6) blur(1px); opacity: 0.5; }
.plane--far img:nth-child(1) { left: -6%; top: -16%; }
.plane--far img:nth-child(2) { left: 38%; top: -22%; width: 28%; }
.plane--far img:nth-child(3) { right: -8%; top: -8%; }
.plane--near { z-index: 2; }
.plane--near img { box-shadow: var(--shadow-card); border: 1px solid var(--line); }
.plane--near img:nth-child(1) { left: -7%; bottom: -14%; width: 30%; }
.plane--near img:nth-child(2) { right: -5%; bottom: 10%; width: 26%; }
.plane--mid { z-index: 1; }
.preview { position: relative; display: block; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-raised); border: 1px solid var(--line); background: var(--ink); }
.preview img, .preview iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; display: block; }
.preview__play {
  position: absolute; left: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 18px 10px 14px; border-radius: 980px; background: var(--gold); color: var(--ink);
  font: 600 16px/1 var(--font-head); transition: background-color 150ms var(--ease-ui);
}
.preview__play svg { width: 18px; height: 18px; fill: currentColor; }
.preview:hover .preview__play { background: var(--gold-hover); }

@media (max-width: 1099px) {
  .label__media { margin: 8px 6% 24px; }
  .plane--far { display: none; }
  .plane--near img:nth-child(2) { display: none; }
  .plane--near img:nth-child(1) { width: 32%; left: -5%; bottom: -12%; }
  /* A plane moving at its own rate would slide over the buttons above it. */
  .label [data-sc-parallax] { transform: none !important; }
}
@media (min-width: 768px) { .label h1 { font-size: 48px; } .label__lead { font-size: 22px; } }
@media (min-width: 1100px) {
  .label { padding-top: 48px; padding-bottom: 96px; }
  .label__in { grid-template-columns: minmax(0, 1fr) minmax(0, 500px); gap: 64px; align-items: center; min-height: calc(100svh - var(--hdr) - 144px); }
  .label__media { margin: 48px 0; }
}

/* ------------------------------------------------------------------ 2 RUN
   The course as an n8n workflow. Each node carries its own --t, the progress
   at which it executes. Everything below computes from --sc-p, which the
   engine publishes on the act: the fill, the gold check, the wire, the count
   printed on the wire. */
.run__stage {
  display: grid; align-content: center; gap: 24px;
  padding: calc(var(--hdr) + 16px) var(--gut) 24px;
  color: var(--on-dark);
}
/* The n8n canvas: a quiet dot grid. Decoration only; every line of text sits
   on the plain ink ground at 13:1 or better. */
.run__stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle, var(--on-dark-hair) 1px, transparent 1.5px) 0 0 / 24px 24px;
}
.run__top, .run__board { position: relative; width: 100%; max-width: var(--wrap); margin: 0 auto; }
.run h2 { font-size: 32px; line-height: 1.25; color: var(--on-dark); }
.run__caps { display: grid; margin-top: 12px; }
.cap { grid-area: 1 / 1; }
.cap__n { font: 600 14px/21px var(--font-head); text-transform: uppercase; letter-spacing: 0.18em; color: var(--on-dark-2); }
.cap__name { font: 700 24px/1.25 var(--font-head); color: var(--on-dark); margin-top: 4px; }
.cap__d { font-size: 16px; line-height: 1.5; color: var(--on-dark-2); max-width: 40ch; margin-top: 8px; }
.cap__c { display: none; }

.flow { position: relative; display: grid; gap: 12px; max-width: 560px; }
.node { --on: clamp(0, (var(--sc-p, 0) - var(--t)) * 25, 1); position: relative; display: grid; grid-template-columns: 40px 1fr; column-gap: 16px; align-items: center; min-height: 40px; }
.node__box {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r);
  border: 2px solid var(--on-dark-line); background: var(--ink); color: var(--on-dark); text-decoration: none;
  font: 700 18px/1 var(--font-head); isolation: isolate;
}
.node__box::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; background: var(--teal); opacity: var(--on); z-index: -1; }
.node__ok {
  position: absolute; top: -9px; right: -9px; width: 20px; height: 20px; padding: 3px; border-radius: 50%;
  background: var(--gold); fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  opacity: var(--on); transform: scale(calc(0.5 + 0.5 * var(--on)));
}
.node__name { font-size: 15px; line-height: 1.3; color: var(--on-dark-2); }
.wire { position: absolute; left: 19px; top: 42px; width: 2px; height: 10px; background: var(--on-dark-hair); }
.wire i { position: absolute; inset: 0; background: var(--teal-light); transform-origin: top; transform: scaleY(clamp(0, (var(--sc-p, 0) - var(--t)) * 10, 1)); }
.wire b {
  position: absolute; left: 37px; top: -19px; white-space: nowrap;
  font: 500 14px/1 var(--font-body); color: var(--on-dark-2);
  opacity: clamp(0, (var(--sc-p, 0) - var(--t) - 0.04) * 20, 1);
}
/* On a phone the count sits under the section name: make room for it. */
@media (max-width: 1099px) {
  .node { min-height: 40px; }
  .node__name { align-self: start; padding-top: 1px; }
  .wire b { left: 37px; top: -20px; }
  .node:has(.wire) .node__name { padding-bottom: 18px; }
}

.run__outs { display: grid; }
.out { grid-area: 1 / 1; }
.out img { width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--on-dark-hair); }
.out figcaption { margin-top: 12px; font-size: 15px; line-height: 1.45; color: var(--on-dark-2); }
.out__n { display: block; font: 600 14px/21px var(--font-head); text-transform: uppercase; letter-spacing: 0.18em; }
.out__title { color: var(--on-dark); font-weight: 500; text-decoration: underline; }
.out__watch { color: var(--on-dark); margin-left: 8px; display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; }

/* Phone and tablet: the workflow runs down the screen, and the one output
   that matters, the Final Project, opens over the nodes that already ran. */
@media (max-width: 1099px) {
  .run__outs { position: absolute; left: 0; right: 0; top: -4px; pointer-events: none; }
  .out--final { background: var(--ink); padding-bottom: 8px; pointer-events: auto; }
  .out:not(.out--final) { display: none; }
  .out--final img { max-height: 180px; object-fit: cover; }
  .out figcaption { margin-top: 8px; font-size: 14px; }
}
@media (min-width: 600px) and (max-width: 1099px) {
  .run__outs { left: 260px; top: 0; }
  .out--final img { max-height: none; }
}

/* Desktop: the workflow runs across, captions top left, each node's output
   top right. */
@media (min-width: 1100px) {
  .run__stage { gap: 40px; padding-top: calc(var(--hdr) + 32px); padding-bottom: 40px; }
  .run h2 { font-size: 44px; }
  .run__top { min-height: 300px; padding-right: 480px; }
  .run__outs { position: absolute; right: 0; bottom: calc(100% + 56px); width: 440px; }
  .cap__name { font-size: 32px; }
  .cap__d { font-size: 18px; }
  .cap__c { display: block; margin-top: 12px; font: 600 14px/21px var(--font-head); text-transform: uppercase; letter-spacing: 0.18em; color: var(--on-dark-2); }

  .flow { width: 100%; max-width: var(--wrap); margin: 0 auto; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; }
  .node { grid-template-columns: none; justify-items: center; text-align: center; row-gap: 14px; align-content: start; }
  .node__box { width: 64px; height: 64px; font-size: 26px; }
  .node__ok { width: 24px; height: 24px; top: -11px; right: -11px; }
  .node__name { font-size: 14px; max-width: 13ch; }
  .wire { left: calc(50% + 40px); top: 31px; width: calc(100% - 80px); height: 2px; }
  .wire i { transform-origin: left; transform: scaleX(clamp(0, (var(--sc-p, 0) - var(--t)) * 10, 1)); }
  .wire b { left: 50%; top: auto; bottom: 10px; translate: -50% 0; white-space: normal; width: min-content; text-align: center; line-height: 1.2; }
  .node:has(.wire) .node__name { padding-bottom: 0; }
}
@media (min-width: 1360px) {
  .node__box { width: 76px; height: 76px; font-size: 30px; }
  .wire { left: calc(50% + 46px); top: 37px; width: calc(100% - 92px); }
}
/* Short desktop windows: give the board its room back. */
@media (min-width: 1100px) and (max-height: 760px) {
  .run__top { min-height: 250px; }
  .run__outs { width: 360px; }
  .run__top { padding-right: 400px; }
  .cap__d { font-size: 16px; }
}

/* ------------------------------------------------------------ 3 CATALOGUE
   One object per section. The same label on every one: number, name, count,
   and the section's first video as its plate. */
.obj { padding: 64px var(--gut); border-top: 1px solid var(--line); }
.obj:nth-child(even) { background: var(--surface); }
.obj:first-child { border-top: 0; padding-top: 48px; }
.obj > * { max-width: var(--wrap); }
.obj { display: grid; gap: 32px; justify-content: center; grid-template-columns: minmax(0, var(--wrap)); }
.obj__num { font: 700 64px/1 var(--font-head); color: var(--teal); letter-spacing: -0.02em; }
.obj h3 { font-size: 28px; line-height: 1.25; margin-top: 8px; }
.obj__count { margin-top: 8px; font: 600 14px/21px var(--font-head); text-transform: uppercase; letter-spacing: 0.18em; color: var(--teal-text); }
.obj__plate { margin-top: 24px; max-width: 420px; }
.obj__plate img { width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--line); }

.lsn { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.lsn:last-child { border-bottom: 1px solid var(--line); }
.lsn__t { width: 96px; height: 54px; border-radius: 6px; object-fit: cover; grid-row: span 2; }
.lsn__n { font-size: 14px; color: var(--ink-2); }
.lsn__title { font: 500 16px/1.4 var(--font-body); color: var(--ink); margin-top: 2px; }
.lsn__go { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 2px; }
.lsn__go a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 500; text-decoration: underline; }
.lsn__go a:hover { color: var(--ink); }

@media (min-width: 1100px) {
  .obj { grid-template-columns: 340px minmax(0, 716px); gap: 64px; padding: 96px var(--gut); }
  .obj--right { grid-template-columns: minmax(0, 716px) 340px; }
  .obj--right .obj__label { order: 2; }
  .obj__label { position: sticky; top: calc(var(--hdr) + 32px); align-self: start; }
  .obj__num { font-size: 96px; }
  .obj h3 { font-size: 32px; }
  .lsn { grid-template-columns: 128px minmax(0, 1fr) auto; column-gap: 20px; align-items: center; }
  .lsn__t { width: 128px; height: 72px; grid-row: auto; }
  .lsn__go { grid-column: 3; margin-top: 0; justify-content: end; }
}

/* ---------------------------------------------------------------- 4 ABOUT */
.about { padding: 64px var(--gut); }
.about__in { max-width: var(--wrap); margin: 0 auto; display: grid; gap: 40px; }
.about h2 { font-size: 32px; line-height: 1.25; }
.about h3 { font: 600 22px/1.5 var(--font-head); margin-top: 24px; }
.about__text p { font-size: 18px; line-height: 1.6; max-width: 700px; margin-top: 12px; }
.about__nums { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); overflow: hidden; }
.about__nums > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 24px; border: 0 solid var(--line); }
.about__nums > div:nth-child(odd) { border-right-width: 1px; }
.about__nums > div:nth-child(-n+2) { border-bottom-width: 1px; }
.about__nums dd { font: 700 48px/1 var(--font-head); color: var(--ink); letter-spacing: -0.02em; }
.about__nums dt { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.about__person { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 16px; align-items: center; max-width: 700px; }
.about__person img { width: 64px; height: 64px; border-radius: 50%; }
.about__name strong { display: block; font: 600 18px/1.4 var(--font-head); }
.about__name span { font-size: 14px; color: var(--ink-2); }
.about__person > p:last-child { grid-column: 1 / -1; margin-top: 16px; font-size: 16px; line-height: 1.6; }
@media (min-width: 768px) {
  .about__nums { grid-template-columns: repeat(4, 1fr); }
  .about__nums > div { border-width: 0 1px 0 0 !important; }
  .about__nums > div:last-child { border-right-width: 0 !important; }
}
@media (min-width: 1100px) {
  .about { padding: 96px var(--gut); }
  .about__in { grid-template-columns: minmax(0, 1fr) 380px; column-gap: 64px; row-gap: 48px; }
  .about h2 { font-size: 44px; }
  .about__nums { grid-column: 1 / -1; grid-row: 2; }
  .about__person { align-self: start; padding-top: 12px; }
  .about__nums dd { font-size: 56px; }
}

/* ------------------------------------------------------------------ 5 FAQ */
.faq { padding: 64px var(--gut); }
.faq__in { max-width: 700px; margin: 0 auto; }
.faq h2 { font-size: 32px; line-height: 1.25; }
.faq__list { margin-top: 32px; }
.faq__list > div { padding: 24px 0; border-top: 1px solid var(--line); }
.faq__list > div:last-child { border-bottom: 1px solid var(--line); }
.faq dt { font: 600 18px/1.4 var(--font-head); }
.faq dd p { margin-top: 8px; font-size: 16px; line-height: 1.6; }
@media (min-width: 1100px) { .faq { padding: 96px var(--gut); } .faq h2 { font-size: 44px; } }

/* ----------------------------------------------------------- 6 START PLATE */
.start { padding: 64px var(--gut) 96px; }
.start__plate {
  max-width: 760px; margin: 0 auto; padding: 32px 24px; border-radius: var(--r);
  background: var(--gold-pale); border: 1px solid var(--line);
}
.start h2 { font-size: 32px; line-height: 1.25; margin-top: 16px; }
.start__plate > p:not(.start__facts) { font-size: 18px; line-height: 1.6; margin-top: 12px; max-width: 48ch; }
.start__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.start__next { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.6; max-width: 56ch; }
.start__next a { color: var(--teal-text); text-decoration: underline; font-weight: 500; }
@media (min-width: 768px) { .start__plate { padding: 48px; } .start h2 { font-size: 44px; } }

/* ------------------------------------------------------- the index of objects */
.mini { display: none; }
@media (min-width: 1280px) and (hover: hover) {
  .mini:not([hidden]) {
    position: fixed; right: 20px; top: 50%; translate: 0 -50%; z-index: 40;
    display: grid; gap: 0; opacity: 0; pointer-events: none; visibility: hidden;
    transition: opacity 300ms var(--ease-fade), visibility 0s linear 300ms;
  }
  .mini.is-on { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity 300ms var(--ease-fade); }
  .mini::before { content: ""; position: absolute; left: 50%; top: 24px; bottom: 24px; width: 2px; translate: -1px 0; background: var(--line); }
  .mini a { position: relative; display: grid; place-items: center; width: 48px; height: 44px; text-decoration: none; }
  .mini span {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r);
    border: 1px solid var(--line-control); background: var(--surface); color: var(--ink);
    font: 600 14px/1 var(--font-head); transition: background-color 150ms var(--ease-ui), color 150ms var(--ease-ui);
  }
  .mini a:hover span { border-color: var(--teal); }
  .mini a[aria-current="true"] span { background: var(--teal); border-color: var(--teal); color: var(--on-dark); }
}

/* --------------------------------------------------------- reduced motion
   The run stops being a film and becomes a page: unpinned, every node shown
   as executed, every caption in reading order, the Final Project output open.
   Nothing is lost, only stilled. */
@media (prefers-reduced-motion: reduce) {
  .run { height: auto !important; --sc-p: 1 !important; }
  .run .sc-stage { position: static; height: auto; padding-block: 64px; }
  .run__caps { gap: 24px; }
  .run__caps > .cap { grid-area: auto; opacity: 1 !important; transform: none !important; }
  .run__outs > .out { opacity: 1 !important; transform: none !important; }
  .run__outs > .out:not(.out--final) { display: none; }
  .run__outs { position: static !important; width: auto !important; max-width: 560px; margin-top: 32px; }
  .cap__c { display: block; margin-top: 8px; font-size: 14px; color: var(--on-dark-2); }
  .pill, .preview__play, .mini span, .mini { transition: none; }
}
