// jsx/Training.jsx: the AI training page, the prospectus for "AI at work",
// Zarco's two-session live course for whole teams. Namespace: tr- (this page
// loads only TopNav, Glyphs, Training, Closing and Footer, so every tr- rule
// below is a fresh, self-contained set, the same isolation contract
// LocalAi.jsx documents for la-).
//
// Register: concrete and specific, elevated in the 2026-08-16 round (Luke:
// the first cut read "very plain"). A course sells on its agenda, so the
// spine of the page is the four-stage "how it runs" process spine (the
// homepage hp-proc recipe: alternating dark mini-scenes, magenta scroll
// fill); the practical bits sit on the page's one Committed-magenta
// surface; the one cinematic moment (photo budget) is the closing claim
// that the team leaves with assistants it built itself. No testimonials, no
// trained-N-teams figures: the course is new and the page must not imply a
// track record it does not have (spec honesty rule). No prices on the page,
// consistent with the whole site. Composition: TopNav → hero (scoped
// aurora) → who this is for → how it runs (spine) → the practical bits
// (committed band) → what you keep → the takeaway statement (photo moment)
// → Closing (supplies #contact) → Footer.

// ── hero: full-bleed photographic cinema (round two of the 2026-08-16
// elevation: the first fold was the unchanged part and read "same page").
// The cp-hero recipe from Console.jsx, ported: photo+scrim stack in its own
// absolute layer, bottom-weighted content, guaranteed legibility wash. The
// page's ONE photographic moment now lives here (the closing statement band
// handed its photo back, see TrStatement); altitude.jpg on a LOW cloud-sea
// crop and a darker grade, both distinct from the homepage's use of the
// same file. ──────────────────────────────────────────────────────────────
function TrHero() {
  return (
    <header className="tr-hero" id="top">
      <div className="tr-hero-frame">
        <div className="tr-hero-photo">
          <img src="assets/photo/people/class-table.jpg" alt="Three people working around one table, laptops open, the work in the middle" loading="eager" />
          <span className="tr-hero-scrim" aria-hidden="true" />
        </div>
        <div className="shell tr-hero-in">
          <p className="chapter-mark tr-hero-eyebrow ch-rev">Zarco / AI training</p>
          <h1 className="tr-h1 ch-rev">
            <span className="tr-line">Your whole team,</span>
            <span className="tr-line">working with AI<span className="tr-dot">.</span></span>
          </h1>
          <div className="tr-hero-row ch-rev">
            <p className="tr-hero-sub">AI at work is our live training course for businesses. Two sessions of 3.5 hours, shaped around your company's real work, for everyone from the sceptic to the person already deep in it.</p>
            <div className="tr-hero-ctas">
              <a className="btn btn-primary" href="index.html#contact">Discuss a project</a>
              <a className="btn btn-ghost tr-hero-ghost" href="#course">How it runs</a>
            </div>
          </div>
          <p className="tr-hero-facts ch-rev">Two sessions of 3.5 hours<span className="tr-hero-facts-sep" aria-hidden="true">·</span>Up to 12 people<span className="tr-hero-facts-sep" aria-hidden="true">·</span>Remote or at your office</p>
        </div>
      </div>
    </header>
  );
}

// ── who this is for: the quiet index shape, but indexed by STARTING LEVEL,
// not job function. A function list read as "for these departments only"
// (Luke, 2026-08-16 late: "feels like it might limit us"); ability levels
// exclude nobody and restate the tailoring promise, each row carrying a
// small note on what the course does with that person. ───────────────────
const TR_LEVELS = [
  { level: "New to all of it", note: "starts here" },
  { level: "Uses it most weeks", note: "goes deeper" },
  { level: "Already building things", note: "goes further" },
];
function TrWho() {
  return (
    <section className="section tr-row" id="who">
      <div className="shell tr-row-grid">
        <div className="tr-row-label">
          <h2 className="chapter-mark tr-row-h2">Who this is for</h2>
          <p className="tr-row-note">Any business, any mix of roles. What matters is where each person starts, and the skills survey finds that before day one.</p>
        </div>
        <div className="tr-row-body">
          <ul className="tr-index" role="list">
            {TR_LEVELS.map((r) => (
              <li className="tr-index-row" key={r.level}>
                <span className="tr-index-level">{r.level}</span>
                <span className="tr-index-note">{r.note}</span>
              </li>
            ))}
          </ul>
          <p className="tr-row-foot">One room, mixed roles, on purpose. The point is a company that works with AI, not a specialist who owns it.</p>
        </div>
      </div>
    </section>
  );
}

// ── how it runs: the page's spine, PHOTOGRAPHIC since the fifth round.
// Luke's throughline across four rounds of notes: every designed dark
// UI fragment on this page read as "promoting software", not a course.
// So the software idiom is gone from training.html entirely (the session
// window mock, the teaching-chrome mini-scenes and the assistant fragment
// were all removed in this round; git history has them). The spine keeps
// the homepage recipe's structure (alternating sides, magenta scroll fill,
// node dots) but each stage's visual is now a photograph of people doing
// that stage. Photos: self-hosted, Unsplash-licensed, people/ set. ───────

const TR_STAGES = [
  { phase: "Before", title: "A scoping call and a short skills survey.", body: "We learn your work and your team's level before anyone books a room, so both sessions run on tasks the room recognises.", photo: "assets/photo/people/class-scope.jpg", alt: "Two people talking through the work at a table, laptop open between them", pos: "50% 30%" },
  { phase: "Session one", title: "Foundations.", body: "How the models actually work, prompting that holds up, everyday workflows for writing, analysis, meetings and research, and the ground rules for company data.", photo: "assets/photo/people/class-board.jpg", alt: "A facilitator working through a flip chart with a small group", pos: "62% 30%" },
  { phase: "The week between", title: "One real task each.", body: "Everyone runs AI on one real task from their own job and brings back what happened. Session two opens on what they found.", photo: "assets/photo/people/class-desk.jpg", alt: "Back at their own desk, running the task for real", pos: "50% 45%" },
  { phase: "Session two", title: "Building.", body: "Custom GPTs and assistants on your own documents, first automations across the tools you already use, and a where-next roadmap.", photo: "assets/photo/people/class-group.jpg", alt: "The cohort heads-down at one table, building on their own laptops", pos: "50% 40%" },
];
function TrCourse() {
  return (
    <section className="section tr-proc shell" id="course">
      <div className="tr-proc-head ch-rev">
        <h2 className="chapter-mark tr-row-h2">How it runs</h2>
        <p className="tr-proc-lede">Tailoring is the course. The scoping call decides the examples, the pace and where session two spends its build time.</p>
      </div>
      <ol className="tr-proc-list" role="list">
        {TR_STAGES.map((s, i) => (
          <li className={"tr-proc-row ch-rev" + (i % 2 ? " tr-proc-row--flip" : "")} key={s.title}>
            <span className="tr-proc-node" aria-hidden="true" />
            <div className="tr-proc-copy">
              <span className="tr-proc-phase">{s.phase}</span>
              <h3>{s.title}</h3>
              <p>{s.body}</p>
            </div>
            <figure className="tr-proc-photo">
              <img src={s.photo} alt={s.alt} loading="lazy" style={{ objectPosition: s.pos }} />
            </figure>
          </li>
        ))}
      </ol>
    </section>
  );
}

// ── the practical bits: promoted to the page's Committed-magenta surface
// (2026-08-16 elevation round; the homepage FAQ band's exact color-mix
// formula, never raw --magenta as a ground). Four label-and-value cells;
// each answers a question a buyer actually asks. Price stays off the page
// by design (sitewide rule); the cell says how it is priced instead. ──────
const TR_FACTS = [
  { label: "Format", value: "Two live sessions of 3.5 hours, about a week apart." },
  { label: "Where", value: "Remote, or at your office anywhere in the UK." },
  { label: "The room", value: "Up to 12 people, mixed roles welcome." },
  { label: "Price", value: "Per cohort, not per head. Scoped on the call." },
];
function TrFacts() {
  return (
    <section className="tr-facts-band ch-rev" id="practical">
      <div className="shell">
        <h2 className="tr-facts-h2">The practical bits.</h2>
        <dl className="tr-facts">
          {TR_FACTS.map((f) => (
            <div className="tr-fact" key={f.label}>
              <dt className="tr-fact-label">{f.label}</dt>
              <dd className="tr-fact-value">{f.value}</dd>
            </div>
          ))}
        </dl>
      </div>
    </section>
  );
}

// ── what you keep: plain rows on paper (the round-three assistant mock
// was removed with the rest of the software idiom; the sentence "working,
// yours" carries the claim now). ─────────────────────────────────────────
const TR_KEEPS = [
  "The assistants and automations built in the room. Working, yours.",
  "A prompt library shaped around your team's actual tasks.",
  "An AI usage policy template you can put in front of staff.",
  "A follow-up clinic call within 30 days, once the questions get real.",
];
function TrKeep() {
  return (
    <section className="section tr-row" id="what-you-keep">
      <div className="shell tr-row-grid">
        <div className="tr-row-label">
          <h2 className="chapter-mark tr-row-h2">What you keep</h2>
        </div>
        <div className="tr-row-body">
          <ul className="tr-keeps" role="list">
            {TR_KEEPS.map((k) => (<li className="tr-keep-row" key={k}>{k}</li>))}
          </ul>
        </div>
      </div>
    </section>
  );
}

// ── the takeaway statement: a dark typographic band on --panel (round two
// moved the page's one photographic moment up to the hero, so this band
// handed its photo back rather than spending a second one; the magenta rule
// and the display-light sentence carry it alone, the ConsoleOneSystem
// register at band scale). ────────────────────────────────────────────────
function TrStatement() {
  return (
    <section className="tr-statement ch-rev">
      <span className="edge-glow" aria-hidden="true" />
      <div className="tr-statement-frame">
        <div className="shell tr-statement-in">
          <span className="tr-statement-rule" aria-hidden="true" />
          <p className="tr-statement-text">Your team leaves with assistants it built itself, on work it recognises.</p>
        </div>
      </div>
    </section>
  );
}

function Training() {
  return (
    <React.Fragment>
      <TrHero />
      <TrWho />
      <TrCourse />
      <TrFacts />
      <TrKeep />
      <TrStatement />
    </React.Fragment>
  );
}

function TrainingPage() {
  React.useEffect(() => window.initRevealObserver(), []);
  return (
    <div className="site atmos">
      <TopNav current="training" />
      <Training />
      <Closing
        mark="Book a scoping call"
        title={<React.Fragment>Start with the <em>scoping call</em>.</React.Fragment>}
        lede="Tell us about your team and we will find a time. Thirty minutes, no obligation, UK-based."
        cells={[
          { label: "When", value: "30 minutes, any working day." },
          { label: "Where", value: "Google Meet, or your office if you're London-based." },
          { label: "What you leave with", value: "The course shaped to your team, and dates if you want them." },
        ]}
        form={{
          subject: "AI at work enquiry (training page)",
          messageLabel: "Tell us about your team",
          messagePlaceholder: "Roughly how many people, and where they are with AI today.",
          submitLabel: "Book a scoping call",
        }}
      />
      <Footer />
    </div>
  );
}

const trainingCss = `
/* ── hero: full-bleed photographic cinema (cp-hero recipe ported; see the
   component comment). The photo+scrim stack is its own absolute layer so
   the text stays a fully-opaque sibling on top; content bottom-weighted so
   the headline sits inside the scrim's darkest band. altitude.jpg low
   cloud-sea crop, darker grade than the homepage's use (distinct crop AND
   grade, the reuse rule). ── */
.tr-hero { position: relative; isolation: isolate; overflow-x: clip; }
.tr-hero-frame {
  position: relative; overflow: hidden;
  min-height: clamp(560px, 80vh, 820px);
  display: flex; align-items: flex-end;
  background: var(--paper);
}
.tr-hero-photo { position: absolute; inset: 0; }
/* People round (2026-08-16, Luke's call: real faces, the page must feel
   human): the hero photo is now human photography, warm room, graded
   toward the site's ink but kept warmer than the mountain grades. */
.tr-hero-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: 50% 42%;
  filter: saturate(0.72) contrast(1.05) brightness(0.55);
}
/* The cp-hero legibility stack: alpenglow radial + vertical panel gradient
   over a guaranteed dark floor, so legibility never depends on the photo
   cooperating (the measured cp-hero reasoning carries over). */
.tr-hero-scrim {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(70% 55% at 50% 88%, rgba(255,0,102,0.08), transparent 70%),
    linear-gradient(180deg, oklch(0.155 0.012 340 / .66) 0%, transparent 38% 60%, oklch(0.155 0.012 340 / .80) 100%),
    linear-gradient(180deg, rgba(6,7,10,.46) 0%, rgba(6,7,10,.40) 50%, rgba(6,7,10,.72) 100%);
}
.tr-hero-in {
  position: relative; z-index: 2; width: 100%;
  padding-top: clamp(64px, 10vh, 120px);
  padding-bottom: clamp(80px, 10vh, 120px);
}
.tr-hero-eyebrow { color: var(--panel-ink-60); }
.tr-h1 {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(52px, 7.4vw, 96px); line-height: .98; letter-spacing: -.03em;
  margin: 18px 0 0; max-width: 14ch; color: var(--panel-ink);
  text-shadow: 0 2px 28px rgba(0,0,0,.45);
}
.tr-line { display: block; }
.tr-dot { color: var(--magenta); }
.tr-hero-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 48px; margin-top: 36px; flex-wrap: wrap;
}
.tr-hero-sub {
  max-width: 46ch; color: var(--panel-ink-60); font-size: 18px; line-height: 1.55; margin: 0;
  text-shadow: 0 2px 28px rgba(0,0,0,.45);
}
.tr-hero-ctas { display: flex; align-items: center; gap: 22px; padding-bottom: 4px; flex-wrap: wrap; }
.tr-hero-facts { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin: 22px 0 0; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--panel-ink-60); }
.tr-hero-facts-sep { color: var(--panel-ink-40); }
.tr-hero-ghost { color: var(--panel-ink); border-color: rgba(255,255,255,.4); }
.tr-hero-ghost:hover { border-color: var(--panel-ink); background: rgba(255,255,255,.08); }

/* ── shared row rhythm: narrow label column beside the content, one shape
   for every section so the page reads as one system ── */
.tr-row { padding-top: clamp(56px, 8vh, 88px); padding-bottom: clamp(56px, 8vh, 88px); }
.tr-row-grid {
  display: grid; grid-template-columns: minmax(200px, 260px) 1fr;
  gap: clamp(40px, 6vw, 88px); align-items: start;
}
.tr-row-label { min-width: 0; }
.tr-row-h2 { margin: 0; }
.tr-row-note { margin-top: 14px; font-size: 14.5px; line-height: 1.55; color: var(--ink-60); max-width: 30ch; }
.tr-row-body { min-width: 0; }

/* ── who this is for: an index, not a badge row ── */
.tr-index { list-style: none; margin: 0; padding: 0; }
.tr-index-row {
  padding: 16px 0; border-top: 1px solid var(--ink-10);
  display: flex; align-items: baseline; justify-content: space-between; gap: 18px;
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(22px, 2.8vw, 32px); letter-spacing: -0.01em; line-height: 1.15;
  color: var(--ink);
}
.tr-index-row:last-child { border-bottom: 1px solid var(--ink-10); }
.tr-index-note { font-family: var(--font-sans); font-size: 14.5px; font-weight: 450; color: var(--ink-60); white-space: nowrap; }
.tr-row-foot { margin-top: 24px; font-size: 15px; line-height: 1.55; color: var(--ink-60); max-width: 52ch; }

/* ── how it runs: the spine (the homepage hp-proc recipe, ported verbatim
   where values transfer). Copy and dark mini-scenes alternate sides of a
   vertical hairline whose magenta fill inks in on scroll where view()
   exists; the node dots ink magenta as each row reveals. ── */
.tr-proc { padding-top: clamp(64px, 9vh, 104px); padding-bottom: clamp(56px, 8vh, 88px); }
.tr-proc-head .tr-row-h2 { margin: 0; }
.tr-proc-lede { margin: 16px 0 0; max-width: 58ch; color: var(--ink-60); font-size: clamp(16px, 1.4vw, 18px); line-height: 1.6; }
.tr-proc-list { position: relative; margin: clamp(40px, 6vh, 64px) 0 0; list-style: none; padding: 0; }
.tr-proc-list::before { content: ""; position: absolute; left: calc(clamp(28px, 4vw, 48px)/2 - .5px); top: 12px; bottom: 12px; width: 1px; background: var(--ink-10); }
.tr-proc-list::after { content: ""; position: absolute; left: calc(clamp(28px, 4vw, 48px)/2 - .5px); top: 12px; bottom: 12px; width: 1px; background: var(--magenta); transform: scaleY(0); transform-origin: top; }
@supports (animation-timeline: view()) {
  .tr-proc-list::after {
    animation: tr-spine-fill 1ms linear both;
    animation-timeline: view();
    animation-range: entry 15% exit 85%;
  }
}
@keyframes tr-spine-fill { to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .tr-proc-list::after { animation: none; } }
.tr-proc-row { position: relative; display: grid; grid-template-columns: clamp(28px, 4vw, 48px) minmax(0, 1.05fr) minmax(0, .95fr); gap: 0 clamp(22px, 4vw, 56px); align-items: center; padding: clamp(30px, 4.5vh, 46px) 0; }
.tr-proc-copy { grid-column: 2; grid-row: 1; }
.tr-proc-row .tr-proc-photo { grid-column: 3; grid-row: 1; }
.tr-proc-row--flip .tr-proc-copy { grid-column: 3; }
.tr-proc-row--flip .tr-proc-photo { grid-column: 2; }
.tr-proc-node { grid-column: 1; grid-row: 1; justify-self: center; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--ink-40); transition: background .5s var(--ease) .35s, border-color .5s var(--ease) .35s; }
.tr-proc-row.in .tr-proc-node { background: var(--magenta); border-color: var(--magenta); }
.tr-proc-phase { display: block; font-size: 13px; font-weight: 500; color: var(--ink-60); margin-bottom: 10px; }
.tr-proc-copy h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 10px; color: var(--ink); }
.tr-proc-copy p { margin: 0; max-width: 52ch; color: var(--ink-60); font-size: 16px; line-height: 1.55; }

/* stage photos: rounded frames, lightly graded so the set reads as one
   shoot; each img carries its own object-position inline */
.tr-proc-photo { margin: 0; border-radius: 16px; overflow: hidden; height: clamp(220px, 30vh, 300px); box-shadow: var(--elev-rest); }
.tr-proc-photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8) contrast(1.04) brightness(.95); }


/* ── the practical bits: the page's Committed-magenta surface (homepage
   FAQ band formula: color-mix magenta 55% into panel, never raw magenta
   as a ground; panel-ink on it measures 7.75:1 there). ── */
.tr-facts-band {
  width: 100%; margin-top: clamp(40px, 6vh, 64px);
  padding-top: clamp(56px, 7.5vh, 80px); padding-bottom: clamp(56px, 7.5vh, 80px);
  background: color-mix(in oklch, var(--magenta) 55%, var(--panel) 45%);
}
.tr-facts-h2 {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -.02em; line-height: 1.1;
  color: var(--panel-ink); margin: 0 0 clamp(28px, 4vh, 40px);
}
.tr-facts { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 clamp(24px, 3vw, 48px); }
.tr-fact { padding: 16px 0 0; border-top: 1px solid rgba(255, 255, 255, .28); }
.tr-fact-label { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .8); margin-bottom: 8px; }
.tr-fact-value { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--panel-ink); }

/* ── what you keep: plain rows ── */
.tr-keeps { list-style: none; margin: 0; padding: 0; }
.tr-keep-row { padding: 16px 0; border-top: 1px solid var(--ink-10); font-size: 16px; line-height: 1.55; color: var(--ink-80); max-width: 60ch; }
.tr-keep-row:last-child { border-bottom: 1px solid var(--ink-10); }

/* ── the takeaway statement: dark typographic band on --panel (the photo
   moved to the hero; the sentence carries this band alone). ── */
.tr-statement { position: relative; }
.tr-statement-frame { position: relative; overflow: hidden; min-height: clamp(280px, 40vh, 440px); display: flex; align-items: center; background: var(--panel); }
.tr-statement-in { position: relative; z-index: 2; text-align: center; width: 100%; padding-top: clamp(56px, 9vh, 96px); padding-bottom: clamp(56px, 9vh, 96px); }
.tr-statement-rule { display: inline-block; width: 40px; height: 3px; border-radius: 2px; background: var(--magenta); margin-bottom: 28px; }
.tr-statement-text {
  margin: 0 auto; font-family: var(--font-display); font-weight: 300;
  font-size: clamp(23px, 2.9vw, 34px); line-height: 1.4; letter-spacing: -0.01em;
  color: var(--panel-ink); text-wrap: pretty; max-width: 26ch;
  text-shadow: 0 2px 24px rgba(0,0,0,.5);
}

@media (max-width: 900px) {
  .tr-proc-row, .tr-proc-row--flip { grid-template-columns: clamp(24px, 5vw, 36px) 1fr; gap: 0 clamp(14px, 3vw, 24px); }
  .tr-proc-row .tr-proc-copy, .tr-proc-row--flip .tr-proc-copy { grid-column: 2; }
  .tr-proc-row .tr-proc-photo, .tr-proc-row--flip .tr-proc-photo { grid-column: 2; grid-row: 2; margin-top: 18px; }
  .tr-facts { grid-template-columns: 1fr 1fr; gap: 8px clamp(24px, 3vw, 48px); }
}
@media (max-width: 860px) {
  .tr-row-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .tr-h1 { max-width: none; }
  .tr-hero-frame { min-height: clamp(480px, 72vh, 640px); }
  .tr-hero-row { gap: 24px; margin-top: 28px; }
  .tr-facts { grid-template-columns: 1fr; }
}
`;

window.TrainingPage = TrainingPage;
window.trainingCss = trainingCss;
